barser65 commited on
Commit
0234904
·
1 Parent(s): 8a547f9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -4
app.py CHANGED
@@ -128,15 +128,12 @@ def converti(path):
128
  if mystring.find('Abstract\n') > 0:
129
  abstr0 = mystring[mystring.find('Abstract\n')+10:]
130
  abstr = abstr0[:abstr0.find('1\n')]
131
- # print(abstr)
132
 
133
  from transformers import pipeline
134
  summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
135
  summary = summarizer(abstr, max_length=56)
136
  summary_text = summary[0]['summary_text']
137
 
138
- return summary_text
139
-
140
  import torch
141
  import soundfile as sf
142
  from IPython.display import Audio
@@ -165,5 +162,5 @@ def converti(path):
165
 
166
  import gradio as gr
167
 
168
- iface = gr.Interface(fn=converti, inputs="file", outputs="text")
169
  iface.launch()
 
128
  if mystring.find('Abstract\n') > 0:
129
  abstr0 = mystring[mystring.find('Abstract\n')+10:]
130
  abstr = abstr0[:abstr0.find('1\n')]
 
131
 
132
  from transformers import pipeline
133
  summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
134
  summary = summarizer(abstr, max_length=56)
135
  summary_text = summary[0]['summary_text']
136
 
 
 
137
  import torch
138
  import soundfile as sf
139
  from IPython.display import Audio
 
162
 
163
  import gradio as gr
164
 
165
+ iface = gr.Interface(fn=converti, inputs="file", outputs="audio")
166
  iface.launch()