Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -91,7 +91,7 @@ def get_text_embeddings(text):
|
|
91 |
with torch.no_grad(): # Disable gradient calculation for inference
|
92 |
outputs = text_model(**inputs)
|
93 |
embeddings = outputs.last_hidden_state.mean(dim=1)
|
94 |
-
return embeddings[0].detach().numpy()
|
95 |
|
96 |
# :white_check_mark: Gradio interface function
|
97 |
def embed_text_interface(text):
|
|
|
91 |
with torch.no_grad(): # Disable gradient calculation for inference
|
92 |
outputs = text_model(**inputs)
|
93 |
embeddings = outputs.last_hidden_state.mean(dim=1)
|
94 |
+
return embeddings[0].detach().cpu().numpy()
|
95 |
|
96 |
# :white_check_mark: Gradio interface function
|
97 |
def embed_text_interface(text):
|