blade077 commited on
Commit
9f5614c
·
verified ·
1 Parent(s): 06bba76

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -0
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()