SeeknnDestroy
commited on
minor fix1
Browse files
app.py
CHANGED
@@ -166,8 +166,8 @@ def get_confidence_color(confidence):
|
|
166 |
def generate_gte_embedding(text, model_name='Alibaba-NLP/gte-multilingual-base'):
|
167 |
"""Generate GTE embeddings for a single text."""
|
168 |
start_time = time.time()
|
169 |
-
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
170 |
-
model = AutoModel.from_pretrained(model_name)
|
171 |
|
172 |
# Tokenize and generate embedding
|
173 |
inputs = tokenizer(text, padding=True, truncation=True, return_tensors="pt")
|
|
|
166 |
def generate_gte_embedding(text, model_name='Alibaba-NLP/gte-multilingual-base'):
|
167 |
"""Generate GTE embeddings for a single text."""
|
168 |
start_time = time.time()
|
169 |
+
tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
170 |
+
model = AutoModel.from_pretrained(model_name, trust_remote_code=True)
|
171 |
|
172 |
# Tokenize and generate embedding
|
173 |
inputs = tokenizer(text, padding=True, truncation=True, return_tensors="pt")
|