From 5f21ccdb4770b2b32a483d5a7be04a46bea375aa Mon Sep 17 00:00:00 2001 From: Jael Gu Date: Thu, 12 Jan 2023 16:47:51 +0800 Subject: [PATCH] Fix name bug Signed-off-by: Jael Gu --- auto_transformers.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/auto_transformers.py b/auto_transformers.py index e0933ef..ea88ad5 100644 --- a/auto_transformers.py +++ b/auto_transformers.py @@ -73,6 +73,7 @@ class AutoTransformers(NNOperator): else: self.device = 'cuda' if torch.cuda.is_available() else 'cpu' self.model_name = self.map_model_names(model_name) + print(1111, self.model_name) if tokenizer: self.tokenizer = tokenizer else: @@ -252,8 +253,8 @@ class AutoTransformers(NNOperator): for line in data.split('\r\n'): line = line.replace(' ', '') if line.startswith('"name":'): - name = line.split(':')[-1].replace('"', '').replace(',', '') - default_sbert.append(name) + n = line.split(':')[-1].replace('"', '').replace(',', '') + default_sbert.append(n) if name in default_sbert: name = 'sentence-transformers/' + name return name