bluuebunny commited on
Commit
04f8232
·
1 Parent(s): 798cc05

returning json for compatibility

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -7,7 +7,7 @@ import torch # For gpu
7
  device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
8
 
9
  # Load a pretrained Sentence Transformer model and move it to the appropriate device
10
- model = SentenceTransformer('Alibaba-NLP/gte-large-en-v1.5', trust_remote_code=True)
11
  model = model.to(device)
12
 
13
  # Function that does the embedding
@@ -22,7 +22,7 @@ def predict(input_text):
22
  gradio_app = gr.Interface(
23
  predict,
24
  inputs="text",
25
- outputs="numpy",
26
  title="Text to Vector Generator",
27
  description="Input a text and get its vector representation using an embedding model."
28
  )
 
7
  device = torch.device("cuda") if torch.cuda.is_available() else torch.device("cpu")
8
 
9
  # Load a pretrained Sentence Transformer model and move it to the appropriate device
10
+ model = SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2', trust_remote_code=True)
11
  model = model.to(device)
12
 
13
  # Function that does the embedding
 
22
  gradio_app = gr.Interface(
23
  predict,
24
  inputs="text",
25
+ outputs="json",
26
  title="Text to Vector Generator",
27
  description="Input a text and get its vector representation using an embedding model."
28
  )