Skip to content

Commit 01bc092

Browse files
authored
Merge branch 'main' into openai_api_version_route
2 parents 3d702af + fe73ef7 commit 01bc092

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

api/models.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class ModelInfo:
2828

2929
id: str
3030
created: int
31-
owner: str
31+
owned_by: str
3232
object: str = "model"
3333

3434

@@ -56,9 +56,9 @@ def retrieve_model_info(args, model_id: str) -> Union[ModelInfo, None]:
5656
if is_model_downloaded(model_id, args.model_directory):
5757
path = args.model_directory / model_config.name
5858
created = int(os.path.getctime(path))
59-
owner = getpwuid(os.stat(path).st_uid).pw_name
59+
owned_by = getpwuid(os.stat(path).st_uid).pw_name
6060

61-
return ModelInfo(id=model_config.name, created=created, owner=owner)
61+
return ModelInfo(id=model_config.name, created=created, owned_by=owned_by)
6262
return None
6363
return None
6464

@@ -79,8 +79,10 @@ def get_model_info_list(args) -> ModelInfo:
7979
if is_model_downloaded(model_id, args.model_directory):
8080
path = args.model_directory / model_config.name
8181
created = int(os.path.getctime(path))
82-
owner = getpwuid(os.stat(path).st_uid).pw_name
82+
owned_by = getpwuid(os.stat(path).st_uid).pw_name
8383

84-
data.append(ModelInfo(id=model_config.name, created=created, owner=owner))
84+
data.append(
85+
ModelInfo(id=model_config.name, created=created, owned_by=owned_by)
86+
)
8587
response = ModelInfoList(data=data)
8688
return response

0 commit comments

Comments
 (0)