Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,17 +1,3 @@
|
|
1 |
import gradio as gr
|
2 |
-
from sentence_transformers import SentenceTransformer
|
3 |
-
model = SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2')
|
4 |
-
def update(raw):
|
5 |
-
global model
|
6 |
-
sentences = raw.split("$")
|
7 |
-
embeddings = model.encode(sentences)
|
8 |
-
return embeddings
|
9 |
|
10 |
-
|
11 |
-
gr.Markdown("Sentence Similarity. Type sentences with $ separator")
|
12 |
-
with gr.Row():
|
13 |
-
inp = gr.Textbox(placeholder="What is your name?")
|
14 |
-
out = gr.Textbox()
|
15 |
-
btn = gr.Button("Run")
|
16 |
-
btn.click(fn=update, inputs=inp, outputs=out)
|
17 |
-
demo.launch()
|
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
+
gr.load("models/facebook/musicgen-small").launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|