Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -20,8 +20,8 @@ EMBEDDINGS_ENDPOINT = "https://api.siliconflow.cn/v1/embeddings"
|
|
20 |
|
21 |
app = Flask(__name__)
|
22 |
|
23 |
-
|
24 |
-
|
25 |
embedding_models = []
|
26 |
free_embedding_models = []
|
27 |
|
@@ -105,7 +105,7 @@ def refresh_models():
|
|
105 |
text_models = get_all_models(FREE_MODEL_TEST_KEY, "chat")
|
106 |
embedding_models = get_all_models(FREE_MODEL_TEST_KEY, "embedding")
|
107 |
reranker_models = get_all_models(FREE_MODEL_TEST_KEY, "reranker")
|
108 |
-
|
109 |
free_embedding_models = []
|
110 |
|
111 |
with concurrent.futures.ThreadPoolExecutor(
|
@@ -506,8 +506,8 @@ def handsome_chat_completions():
|
|
506 |
model_name = data['model']
|
507 |
request_type = determine_request_type(
|
508 |
model_name,
|
509 |
-
|
510 |
-
|
511 |
)
|
512 |
api_key = select_key(request_type, model_name)
|
513 |
|
@@ -718,7 +718,7 @@ def list_models():
|
|
718 |
return jsonify({"error": "Unauthorized"}), 401
|
719 |
|
720 |
detailed_models = []
|
721 |
-
for model in
|
722 |
detailed_models.append({
|
723 |
"id": model,
|
724 |
"object": "model",
|
|
|
20 |
|
21 |
app = Flask(__name__)
|
22 |
|
23 |
+
text_models = []
|
24 |
+
free_text_models = []
|
25 |
embedding_models = []
|
26 |
free_embedding_models = []
|
27 |
|
|
|
105 |
text_models = get_all_models(FREE_MODEL_TEST_KEY, "chat")
|
106 |
embedding_models = get_all_models(FREE_MODEL_TEST_KEY, "embedding")
|
107 |
reranker_models = get_all_models(FREE_MODEL_TEST_KEY, "reranker")
|
108 |
+
free_text_models = []
|
109 |
free_embedding_models = []
|
110 |
|
111 |
with concurrent.futures.ThreadPoolExecutor(
|
|
|
506 |
model_name = data['model']
|
507 |
request_type = determine_request_type(
|
508 |
model_name,
|
509 |
+
text_models,
|
510 |
+
free_text_models
|
511 |
)
|
512 |
api_key = select_key(request_type, model_name)
|
513 |
|
|
|
718 |
return jsonify({"error": "Unauthorized"}), 401
|
719 |
|
720 |
detailed_models = []
|
721 |
+
for model in text_models:
|
722 |
detailed_models.append({
|
723 |
"id": model,
|
724 |
"object": "model",
|