AreejMehboob commited on
Commit
d47acd6
·
verified ·
1 Parent(s): 2942301

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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):