bluuebunny commited on
Commit
7b7086e
·
verified ·
1 Parent(s): 63bb515

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -15,14 +15,14 @@ def predict(input_text):
15
 
16
  # Calculate embeddings by calling model.encode(), specifying the device
17
  embeddings = model.encode(input_text, device=device)
18
- embeddings_str = np.array2string(embeddings, separator=',', threshold=np.inf)
19
- return embeddings_str
20
 
21
  # Gradio app interface
22
  gradio_app = gr.Interface(
23
  predict,
24
  inputs="text",
25
- outputs="text",
26
  title="Text to Vector Generator",
27
  description="Input a text and get its vector representation using an embedding model (mixedbread-ai/mxbai-embed-large-v1)."
28
  )
 
15
 
16
  # Calculate embeddings by calling model.encode(), specifying the device
17
  embeddings = model.encode(input_text, device=device)
18
+
19
+ return embeddings
20
 
21
  # Gradio app interface
22
  gradio_app = gr.Interface(
23
  predict,
24
  inputs="text",
25
+ outputs=gr.Textbox(lines=30, placeholder="Scrollable array output")),
26
  title="Text to Vector Generator",
27
  description="Input a text and get its vector representation using an embedding model (mixedbread-ai/mxbai-embed-large-v1)."
28
  )