feat: Add VLM config to config.example.yaml with config.yaml support
This commit is contained in:
@@ -145,12 +145,18 @@ Output ONLY the JSON object, no additional text."""
|
||||
}
|
||||
]
|
||||
|
||||
# Get VLM configuration from environment or fallback to LLM config
|
||||
# Get VLM configuration
|
||||
# Priority: Environment variables > config.yaml > defaults
|
||||
import os
|
||||
vlm_provider = os.getenv("VLM_PROVIDER", "qwen") # qwen, glm, openai
|
||||
vlm_api_key = os.getenv("VLM_API_KEY") or os.getenv("DASHSCOPE_API_KEY")
|
||||
vlm_base_url = os.getenv("VLM_BASE_URL")
|
||||
vlm_model = os.getenv("VLM_MODEL")
|
||||
from pixelle_video.config import config_manager
|
||||
|
||||
# Try to get VLM config from config.yaml
|
||||
vlm_config = getattr(config_manager.config, 'vlm', None)
|
||||
|
||||
vlm_provider = os.getenv("VLM_PROVIDER") or (vlm_config.provider if vlm_config and hasattr(vlm_config, 'provider') else "qwen")
|
||||
vlm_api_key = os.getenv("VLM_API_KEY") or os.getenv("DASHSCOPE_API_KEY") or (vlm_config.api_key if vlm_config and hasattr(vlm_config, 'api_key') else None)
|
||||
vlm_base_url = os.getenv("VLM_BASE_URL") or (vlm_config.base_url if vlm_config and hasattr(vlm_config, 'base_url') else None)
|
||||
vlm_model = os.getenv("VLM_MODEL") or (vlm_config.model if vlm_config and hasattr(vlm_config, 'model') else None)
|
||||
|
||||
# Configure based on provider
|
||||
if vlm_provider == "qwen":
|
||||
|
||||
Reference in New Issue
Block a user