-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfig.py.template
More file actions
130 lines (114 loc) · 3.2 KB
/
config.py.template
File metadata and controls
130 lines (114 loc) · 3.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
"""
Configuration file for AI models.
Instructions:
1. Copy this file to config.py
2. Fill in your API keys and update base URLs as needed
3. Add config.py to .gitignore to prevent committing your API keys
"""
import os
import logging
from pathlib import Path
# Setup logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger("config")
# Base directory for the project
BASE_DIR = Path(__file__).parent
LEC_EVAL_MODEL = ""
TEST_SETTING = {
"vlm": [
{
"model_provider": "qwen",
"model_name": "qwen2.5-vl-72b-instruct"
},
{
"model_provider": "gemini_openai",
},
{
"model_provider": "gpt",
}
],
"caption_llm": [
{
"model_provider": "deepseek",
},
{
"model_provider": "qwen",
"model_name": "qwen2.5-72b-instruct"
}
],
"iterative": [
{
"model_provider": "gpt",
},
{
"model_provider": "qwen",
"model_name": "qwen2.5-vl-72b-instruct"
},
{
"model_provider": "gemini_openai",
}
]
}
# Model configurations
MODEL_CONFIGS = {
"ollama": {
"base_url": "http://127.0.0.1:11434",
"default_model": "llama2"
},
"vllm": {
"base_url": "http://0.0.0.0:8000/v1",
"api_key": "not-needed"
"default_model": "THU-KEG/LongWriter-V-7B-DPO"
},
"claude": {
"base_url": "https://api.anthropic.com",
"api_key": "", # Add your Anthropic API key here
"default_model": "claude-3-7-sonnet-20250219"
},
"gemini": {
"base_url": "https://generativelanguage.googleapis.com",
"api_key": "", # Add your Google API key here
"default_model": "gemini-2.5-pro"
},
"gpt": {
"base_url": "https://api.openai.com/v1",
"api_key": "", # Add your OpenAI API key here
"default_model": "gpt-4o-2024-11-20"
},
"deepseek": {
"base_url": "https://api.deepseek.com",
"api_key": "",
"default_model": "deepseek-reasoner"
},
"gemini_openai": {
"base_url": "",
"api_key": "",
"default_model": "gemini-2.5-pro-preview-03-25"
},
"claude_openai": {
"base_url": "",
"api_key": "",
"default_model": "claude-3-7-sonnet-20250219"
},
"qwen": {
"base_url": "https://dashscope.aliyuncs.com/compatible-mode/v1",
"api_key": "",
"default_model": "qwen2.5-vl-32b-instruct"
}
}
}
# Function to get model configuration
def get_model_config(provider):
"""Get the configuration for a specific model provider."""
return MODEL_CONFIGS.get(provider, {})
# Configuration for external services (e.g., Search APIs)
EXTERNAL_SERVICES_CONFIG = {
"bing_search": {
"api_key": "", # Add your Bing Search V7 API Key here (required for build_static_knowledge_base.py)
"endpoint": "https://api.bing.microsoft.com/v7.0/search"
},
"crawlbase": {
"token": "" # Add your Crawlbase API Token here (alternative for build_static_knowledge_base.py)
}
# Add other external services here if needed
}