Skip to content

Commit b8aee11

Browse files
committed
MLC import fix
1 parent 28c303c commit b8aee11

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

dsp/modules/hf_client.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@
2727

2828
# from dsp.modules.adapter import TurboAdapter, DavinciAdapter, LlamaAdapter
2929

30-
from mlc_chat import ChatModule
31-
from mlc_chat import ChatConfig
32-
3330
class HFClientTGI(HFModel):
3431
def __init__(self, model, port, url="http://future-hgx-1", **kwargs):
3532
super().__init__(model=model, is_client=True)
@@ -90,14 +87,17 @@ def _generate(self, prompt, **kwargs):
9087
raise Exception("Received invalid JSON response from server")
9188

9289

93-
9490
@CacheMemory.cache
9591
def send_hftgi_request_v00(arg, **kwargs):
9692
return requests.post(arg, **kwargs)
9793

9894
class ChatModuleClient(HFModel):
9995
def __init__(self, model, model_path):
10096
super().__init__(model=model, is_client=True)
97+
98+
from mlc_chat import ChatModule
99+
from mlc_chat import ChatConfig
100+
101101
self.cm = ChatModule(model=model, lib_path=model_path, chat_config=ChatConfig(conv_template="LM"))
102102

103103
def _generate(self, prompt, **kwargs):

0 commit comments

Comments
 (0)