Spaces:
Sleeping
Sleeping
Commit
·
1244cc6
1
Parent(s):
a5799cc
Update app.py
Browse files
app.py
CHANGED
@@ -1,36 +1,26 @@
|
|
1 |
-
|
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 |
-
|
14 |
-
text = st.text_area('enter some text!')
|
15 |
|
16 |
-
if text:
|
17 |
-
out = pipe(text)
|
18 |
-
st.json(out)
|
19 |
-
|
20 |
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
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 |
|