Spaces:
Paused
Paused
Commit
·
32a0c88
1
Parent(s):
74effde
fixed model list
Browse files- src/openai_routes.py +5 -3
src/openai_routes.py
CHANGED
|
@@ -129,14 +129,16 @@ async def openai_list_models(username: str = Depends(authenticate_user)):
|
|
| 129 |
|
| 130 |
openai_models = []
|
| 131 |
for model in SUPPORTED_MODELS:
|
|
|
|
|
|
|
| 132 |
openai_models.append({
|
| 133 |
-
"id":
|
| 134 |
"object": "model",
|
| 135 |
"created": 1677610602, # Static timestamp
|
| 136 |
"owned_by": "google",
|
| 137 |
"permission": [
|
| 138 |
{
|
| 139 |
-
"id": "modelperm-" +
|
| 140 |
"object": "model_permission",
|
| 141 |
"created": 1677610602,
|
| 142 |
"allow_create_engine": False,
|
|
@@ -150,7 +152,7 @@ async def openai_list_models(username: str = Depends(authenticate_user)):
|
|
| 150 |
"is_blocking": False
|
| 151 |
}
|
| 152 |
],
|
| 153 |
-
"root":
|
| 154 |
"parent": None
|
| 155 |
})
|
| 156 |
|
|
|
|
| 129 |
|
| 130 |
openai_models = []
|
| 131 |
for model in SUPPORTED_MODELS:
|
| 132 |
+
# Remove "models/" prefix for OpenAI compatibility
|
| 133 |
+
model_id = model["name"].replace("models/", "")
|
| 134 |
openai_models.append({
|
| 135 |
+
"id": model_id,
|
| 136 |
"object": "model",
|
| 137 |
"created": 1677610602, # Static timestamp
|
| 138 |
"owned_by": "google",
|
| 139 |
"permission": [
|
| 140 |
{
|
| 141 |
+
"id": "modelperm-" + model_id.replace("/", "-"),
|
| 142 |
"object": "model_permission",
|
| 143 |
"created": 1677610602,
|
| 144 |
"allow_create_engine": False,
|
|
|
|
| 152 |
"is_blocking": False
|
| 153 |
}
|
| 154 |
],
|
| 155 |
+
"root": model_id,
|
| 156 |
"parent": None
|
| 157 |
})
|
| 158 |
|