dpassov commited on
Commit
e31ba85
Β·
verified Β·
1 Parent(s): 3c4a3d1

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -5
app.py CHANGED
@@ -1,11 +1,23 @@
1
- import gradio as gr
2
- print("hello")
3
  # gr.load("NousResearch/Yarn-Mistral-7b-128k",src="models").launch()
 
 
 
 
 
 
 
 
 
 
 
4
  from transformers import pipeline
5
 
6
- classifier = pipeline("sentiment-analysis")
 
7
  def get_class(input):
8
- return classifier("I've been waiting for a HuggingFace course my whole life.")
9
 
10
  iface = gr.Interface(fn=get_class, inputs="text", outputs=['text'], title='hello', description='play around')
11
- iface.launch()
 
1
+ # import gradio as gr
2
+ # print("hello")
3
  # gr.load("NousResearch/Yarn-Mistral-7b-128k",src="models").launch()
4
+ # from transformers import pipeline
5
+
6
+ # classifier = pipeline("sentiment-analysis")
7
+ # def get_class(input):
8
+ # return classifier("I've been waiting for a HuggingFace course my whole life.")
9
+
10
+ # iface = gr.Interface(fn=get_class, inputs="text", outputs=['text'], title='hello', description='play around')
11
+ # iface.launch()
12
+
13
+
14
+ # Use a pipeline as a high-level helper
15
  from transformers import pipeline
16
 
17
+ pipe = pipeline("text-generation", model="NousResearch/Yarn-Mistral-7b-128k")
18
+
19
  def get_class(input):
20
+ return pipe(input)
21
 
22
  iface = gr.Interface(fn=get_class, inputs="text", outputs=['text'], title='hello', description='play around')
23
+ iface.launch()