File size: 916 Bytes
3b8bc2d
337d2a4
3b8bc2d
 
 
d7daaf8
18526df
b7ea2f1
dab07cf
b7ea2f1
104b149
 
 
 
 
 
 
 
9e789ed
037452a
 
9e789ed
104b149
 
 
 
 
 
 
 
 
 
 
ab046ec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import torch
from transformers import pipeline
import gradio as gr
import streamlit as st
from transformers import Speech2TextProcessor, Speech2TextForConditionalGeneration
# from gradio.mix import Parallel, Series


desc = "Summarize your text! (audio transcription available soon)"



pipe = pipeline('sentiment-analysis')
text = st.text_area('enter some text!')

if text:
  out = pipe(text)
  st.json(out)
qa_model = 'huggingface/SamuelMiller/qa_squad'
my_model = 'huggingface/SamuelMiller/lil_sumsum'
better_model = 'huggingface/google/pegasus-large'

#def summarize(text):
  #summ = gr.Interface.load(qa_model)      
  #summary = summ(text)
  #return summary
#iface = gr.Interface(fn=summarize,
                 #theme='huggingface', 
                 #title= 'sum_it', 
                 #description= desc,
                 #inputs= "text",
                 #outputs= 'textbox')
#iface.launch(inline = False)