Spaces:
Paused
Paused
Update backend_api.py
Browse files- backend_api.py +8 -4
backend_api.py
CHANGED
|
@@ -24,10 +24,14 @@ import httpx
|
|
| 24 |
# Import project importer for importing from HF/GitHub
|
| 25 |
from project_importer import ProjectImporter
|
| 26 |
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
# No dependencies on Gradio or heavy libraries
|
| 32 |
print("[Startup] Loading system prompts from backend_prompts...")
|
| 33 |
|
|
|
|
| 24 |
# Import project importer for importing from HF/GitHub
|
| 25 |
from project_importer import ProjectImporter
|
| 26 |
|
| 27 |
+
def get_available_models():
|
| 28 |
+
try:
|
| 29 |
+
# Chỉ gọi khi ứng dụng đã chạy và đã load biến môi trường
|
| 30 |
+
return client.models.list()
|
| 31 |
+
except Exception as e:
|
| 32 |
+
print(f"Lỗi lấy danh sách model: {e}")
|
| 33 |
+
return []
|
| 34 |
+
# from standalone backend_prompts.py
|
| 35 |
# No dependencies on Gradio or heavy libraries
|
| 36 |
print("[Startup] Loading system prompts from backend_prompts...")
|
| 37 |
|