Spaces:
Building
Building
Update app.py
Browse files
app.py
CHANGED
@@ -10,14 +10,13 @@ def generate_embeddings(chunks):
|
|
10 |
return embeddings.tolist() # Convert tensor to list for Gradio
|
11 |
|
12 |
# Define the Gradio interface
|
13 |
-
|
14 |
fn=generate_embeddings,
|
15 |
-
inputs=gr.
|
16 |
-
outputs=gr.
|
17 |
title="Sentence Transformer Embeddings",
|
18 |
description="Generate embeddings for input text chunks."
|
19 |
)
|
20 |
|
21 |
# Launch the Gradio app
|
22 |
-
|
23 |
-
iface.launch()
|
|
|
10 |
return embeddings.tolist() # Convert tensor to list for Gradio
|
11 |
|
12 |
# Define the Gradio interface
|
13 |
+
interface = gr.Interface(
|
14 |
fn=generate_embeddings,
|
15 |
+
inputs=gr.Textbox(lines=5, placeholder="Enter text chunks here..."),
|
16 |
+
outputs=gr.JSON(),
|
17 |
title="Sentence Transformer Embeddings",
|
18 |
description="Generate embeddings for input text chunks."
|
19 |
)
|
20 |
|
21 |
# Launch the Gradio app
|
22 |
+
interface.launch()
|
|