Spaces:
Sleeping
Sleeping
first model
Browse files- app.py +5 -1
- requirments.txt +1 -0
app.py
CHANGED
|
@@ -1,7 +1,11 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
def greet(text):
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 7 |
iface.launch()
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from setfit import SetFitModel
|
| 3 |
|
| 4 |
def greet(text):
|
| 5 |
+
model = SetFitModel.from_pretrained("skylord/setfit-bge-small-v1.5-sst2-8-shot-talk2loop") # Load from the Hugging Face Hub
|
| 6 |
+
preds = model.predict([text])
|
| 7 |
+
|
| 8 |
+
return "Tag: " + preds
|
| 9 |
|
| 10 |
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 11 |
iface.launch()
|
requirments.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
setfit
|