Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -157,11 +157,12 @@ def refresh_models():
|
|
157 |
logging.warning("没有有效的key,无法获取完整模型列表。")
|
158 |
all_models = []
|
159 |
|
160 |
-
#
|
161 |
-
|
162 |
-
|
|
|
163 |
else:
|
164 |
-
logging.warning("
|
165 |
free_models = []
|
166 |
|
167 |
logging.info(f"所有模型列表:{all_models}")
|
|
|
157 |
logging.warning("没有有效的key,无法获取完整模型列表。")
|
158 |
all_models = []
|
159 |
|
160 |
+
# 从环境变量读取免费模型列表
|
161 |
+
free_models_str = os.environ.get("FREE_MODELS")
|
162 |
+
if free_models_str:
|
163 |
+
free_models = [model.strip() for model in free_models_str.split(',')]
|
164 |
else:
|
165 |
+
logging.warning("环境变量 FREE_MODELS 未设置或为空,免费模型列表将为空。")
|
166 |
free_models = []
|
167 |
|
168 |
logging.info(f"所有模型列表:{all_models}")
|