yangtb24 commited on
Commit
4296023
·
verified ·
1 Parent(s): 64c7900

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -27
app.py CHANGED
@@ -8,6 +8,7 @@ import concurrent.futures
8
  import threading
9
  import base64
10
  import io
 
11
  from PIL import Image
12
  from datetime import datetime
13
  from apscheduler.schedulers.background import BackgroundScheduler
@@ -462,38 +463,13 @@ def list_models():
462
 
463
  detailed_models = []
464
 
465
- for model in text_models:
466
  detailed_models.append({
467
  "id": model,
468
  "object": "model",
469
  "created": 1678888888,
470
  "owned_by": "openai",
471
- "permission": [
472
- ],
473
- "root": model,
474
- "parent": None
475
- })
476
-
477
- for model in embedding_models:
478
- detailed_models.append({
479
- "id": model,
480
- "object": "model",
481
- "created": 1678888888,
482
- "owned_by": "openai",
483
- "permission": [
484
- ],
485
- "root": model,
486
- "parent": None
487
- })
488
-
489
- for model in image_models:
490
- detailed_models.append({
491
- "id": model,
492
- "object": "model",
493
- "created": 1678888888,
494
- "owned_by": "openai",
495
- "permission": [
496
- ],
497
  "root": model,
498
  "parent": None
499
  })
 
8
  import threading
9
  import base64
10
  import io
11
+ from itertools import chain
12
  from PIL import Image
13
  from datetime import datetime
14
  from apscheduler.schedulers.background import BackgroundScheduler
 
463
 
464
  detailed_models = []
465
 
466
+ for model in chain(text_models, embedding_models, image_models):
467
  detailed_models.append({
468
  "id": model,
469
  "object": "model",
470
  "created": 1678888888,
471
  "owned_by": "openai",
472
+ "permission": [],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
473
  "root": model,
474
  "parent": None
475
  })