SamuelMiller commited on
Commit
1244cc6
·
1 Parent(s): a5799cc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -30
app.py CHANGED
@@ -1,36 +1,26 @@
1
- #import torch
2
- #from transformers import pipeline
3
- #import gradio as gr
4
- #import streamlit as st
5
- # from transformers import Speech2TextProcessor, Speech2TextForConditionalGeneration
6
- # from gradio.mix import Parallel, Series
7
-
8
-
9
- #desc = "Summarize your text! (audio transcription available soon)"
10
- import streamlit as st
11
  from transformers import pipeline
 
 
 
 
12
 
13
- pipe = pipeline('sentiment-analysis')
14
- text = st.text_area('enter some text!')
15
 
16
- if text:
17
- out = pipe(text)
18
- st.json(out)
19
-
20
 
21
- #qa_model = 'huggingface/SamuelMiller/qa_squad'
22
- #my_model = 'huggingface/SamuelMiller/lil_sumsum'
23
- #better_model = 'huggingface/google/pegasus-large'
24
 
25
- #def summarize(text):
26
- #summ = gr.Interface.load(qa_model)
27
- #summary = summ(text)
28
- #return summary
29
- #iface = gr.Interface(fn=summarize,
30
- #theme='huggingface',
31
- #title= 'sum_it',
32
- #description= desc,
33
- #inputs= "text",
34
- #outputs= 'textbox')
35
- #iface.launch(inline = False)
36
 
 
1
+ import torch
 
 
 
 
 
 
 
 
 
2
  from transformers import pipeline
3
+ import gradio as gr
4
+ from transformers import Speech2TextProcessor, Speech2TextForConditionalGeneration
5
+ from gradio.mix import Parallel, Series
6
+
7
 
8
+ desc = "Summarize your text! (audio transcription available soon)"
 
9
 
 
 
 
 
10
 
11
+ qa_model = 'huggingface/SamuelMiller/qa_squad'
12
+ my_model = 'huggingface/SamuelMiller/lil_sumsum'
13
+ better_model = 'huggingface/google/pegasus-large'
14
 
15
+ def summarize(text):
16
+ summ = gr.Interface.load(qa_model)
17
+ summary = summ(text)
18
+ return summary
19
+ iface = gr.Interface(fn=summarize,
20
+ theme='huggingface',
21
+ title= 'sum_it',
22
+ description= desc,
23
+ inputs= "text",
24
+ outputs= 'textbox')
25
+ iface.launch(inline = False)
26