Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from transformers import pipeline
|
3 |
+
|
4 |
+
# Use a pipeline as a high-level helper
|
5 |
+
|
6 |
+
model = pipeline("text-generation", model="cognitivecomputations/samantha-mistral-7b")
|
7 |
+
|
8 |
+
def predict(text):
|
9 |
+
return model(text)
|
10 |
+
|
11 |
+
demo = gr.Interface(fn=predict, inputs="text", outputs="label")
|
12 |
+
demo.launch()
|