Skip to content

Commit

Permalink
done
Browse files Browse the repository at this point in the history
  • Loading branch information
sunggg committed Feb 12, 2024
1 parent edf8d27 commit dc64632
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion serve/mlc_serve/model/tvm_model.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import math
import os
import json
from typing import List, Tuple, Sequence

import structlog
Expand Down Expand Up @@ -79,8 +80,18 @@ def get_tvm_model(config, dev):
f"{config.model_artifact_path}/params", dev
)
params = []
try:
params_names = [
d["name"]
for d in json.loads(str(vm.module.get_function("_metadata")()))[
"params"
]
]
except:
params_names = [f"param_{i}" for i in range(_meta["ParamSize"])]

for i in range(_meta["ParamSize"]):
params.append(_params[f"param_{i}"])
params.append(_params[params_names[i]])

return vm.module, params, None

Expand Down

0 comments on commit dc64632

Please sign in to comment.