Spaces:
Sleeping
Sleeping
Commit
·
04f8232
1
Parent(s):
798cc05
returning json for compatibility
Browse files
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('
|
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="
|
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 |
)
|