Skip to content

Commit 40473b7

Browse files
OliverBryantyiboyasss
authored andcommitted
model_size_in_billions
1 parent 0ba218b commit 40473b7

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

xinference/core/supervisor.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,14 +1079,16 @@ def _convert_model_json_format(self, model_json: Dict[str, Any]) -> Dict[str, An
10791079
converted_specs = []
10801080

10811081
for spec in model_json["model_specs"]:
1082-
model_format = spec["model_format"]
1083-
model_size = spec["model_size_in_billions"]
1082+
model_format = spec.get("model_format", "pytorch")
1083+
model_size = spec.get("model_size_in_billions")
10841084

10851085
if "model_src" not in spec:
10861086
# No model_src, keep spec as is but ensure required fields
10871087
converted_spec = spec.copy()
10881088
if "quantization" not in converted_spec:
1089-
converted_spec["quantization"] = "none" # Default
1089+
converted_spec["quantization"] = "none"
1090+
if "model_format" not in converted_spec:
1091+
converted_spec["model_format"] = "pytorch"
10901092
converted_specs.append(converted_spec)
10911093
continue
10921094

@@ -1163,6 +1165,8 @@ def _convert_model_json_format(self, model_json: Dict[str, Any]) -> Dict[str, An
11631165
converted_spec = spec.copy()
11641166
if "quantization" not in converted_spec:
11651167
converted_spec["quantization"] = "none"
1168+
if "model_format" not in converted_spec:
1169+
converted_spec["model_format"] = "pytorch"
11661170
converted_specs.append(converted_spec)
11671171

11681172
converted["model_specs"] = converted_specs

0 commit comments

Comments
 (0)