SnowFlash383935 commited on
Commit
c783546
·
verified ·
1 Parent(s): 838e69f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -15
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
- with gr.Blocks(theme='SnowFlash383935/emerald') as demo:
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()