|
@ -73,6 +73,7 @@ class AutoTransformers(NNOperator): |
|
|
else: |
|
|
else: |
|
|
self.device = 'cuda' if torch.cuda.is_available() else 'cpu' |
|
|
self.device = 'cuda' if torch.cuda.is_available() else 'cpu' |
|
|
self.model_name = self.map_model_names(model_name) |
|
|
self.model_name = self.map_model_names(model_name) |
|
|
|
|
|
print(1111, self.model_name) |
|
|
if tokenizer: |
|
|
if tokenizer: |
|
|
self.tokenizer = tokenizer |
|
|
self.tokenizer = tokenizer |
|
|
else: |
|
|
else: |
|
@ -252,8 +253,8 @@ class AutoTransformers(NNOperator): |
|
|
for line in data.split('\r\n'): |
|
|
for line in data.split('\r\n'): |
|
|
line = line.replace(' ', '') |
|
|
line = line.replace(' ', '') |
|
|
if line.startswith('"name":'): |
|
|
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: |
|
|
if name in default_sbert: |
|
|
name = 'sentence-transformers/' + name |
|
|
name = 'sentence-transformers/' + name |
|
|
return name |
|
|
return name |
|
|