Skip to content

Commit b4d60fc

Browse files
committed
[bugfix] fix embedding load.
1 parent 409b55a commit b4d60fc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

llmexport/llmexport.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3227,7 +3227,8 @@ def export_config(self, mnn_config = False):
32273227
"precision": "low",
32283228
"memory": "low"
32293229
}
3230-
if self.visual is not None or self.audio is not None:
3230+
if (hasattr(self, 'visual') and self.visual is not None) or \
3231+
(hasattr(self, 'audio') and self.audio is not None):
32313232
config['mllm'] = {
32323233
'backend_type': "cpu",
32333234
"thread_num": 4,
@@ -3588,9 +3589,9 @@ def response(self, query):
35883589
@spinner_run(f'load pretrained model ')
35893590
def load_model(self, model_path):
35903591
self.tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
3591-
self.config = AutoConfig.from_pretrained(model_path)
3592+
self.config = AutoConfig.from_pretrained(model_path, trust_remote_code=True)
35923593
self.config._attn_implementation = 'eager'
3593-
self.model = AutoModel.from_config(self.config)
3594+
self.model = AutoModel.from_config(self.config, trust_remote_code=True)
35943595
transformer = self.model.encoder
35953596
self.model_type = self.config.model_type
35963597
self.lm_ = self.model.pooler

0 commit comments

Comments
 (0)