remotewith commited on
Commit
e3759cc
1 Parent(s): 86459b3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -40,6 +40,7 @@ def audio_to_text(audio, num_speakers):
40
  embeddings = make_embeddings(path, segments, duration)
41
  add_speaker_labels(segments, embeddings, num_speakers)
42
  output = get_output(segments)
 
43
  return output
44
 
45
  def convert_to_wav(path):
@@ -98,17 +99,16 @@ def get_output(segments):
98
 
99
 
100
  def text_to_short_summary(text):
101
- tokenizer = AutoTokenizer.from_pretrained("knkarthick/MEETING-SUMMARY-BART-LARGE-XSUM-SAMSUM-DIALOGSUM")
102
 
103
- model = AutoModelForSeq2SeqLM.from_pretrained("knkarthick/MEETING-SUMMARY-BART-LARGE-XSUM-SAMSUM-DIALOGSUM")
104
 
105
  from transformers import pipeline
106
  summarizer = pipeline("summarization", model="knkarthick/MEETING-SUMMARY-BART-LARGE-XSUM-SAMSUM-DIALOGSUM")
107
- text = '''The tower is 324 metres (1,063 ft) tall, about the same height as an 81-storey building, and the tallest structure in Paris. Its base is square, measuring 125 metres (410 ft) on each side. During its construction, the Eiffel Tower surpassed the Washington Monument to become the tallest man-made structure in the world, a title it held for 41 years until the Chrysler Building in New York City was finished in 1930. It was the first structure to reach a height of 300 metres. Due to the addition of a broadcasting aerial at the top of the tower in 1957, it is now taller than the Chrysler Building by 5.2 metres (17 ft). Excluding transmitters, the Eiffel Tower is the second tallest free-standing structure in France after the Millau Viaduct.
108
- '''
109
  return summarizer(text)
110
 
111
-
112
 
113
 
114
  app1=gr.Interface(
@@ -128,7 +128,7 @@ app2=gr.Interface(fn=text_to_short_summary,
128
  inputs=gr.Textbox(label="Enter"),
129
  outputs=gr.Textbox(label="Output"))
130
 
131
- demo = gr.TabbedInterface([app1, app2], ["Text", "Summary"])
132
 
133
 
134
  demo.launch()
 
40
  embeddings = make_embeddings(path, segments, duration)
41
  add_speaker_labels(segments, embeddings, num_speakers)
42
  output = get_output(segments)
43
+ text_to_short_summary(output)
44
  return output
45
 
46
  def convert_to_wav(path):
 
99
 
100
 
101
  def text_to_short_summary(text):
102
+ #tokenizer = AutoTokenizer.from_pretrained("knkarthick/MEETING-SUMMARY-BART-LARGE-XSUM-SAMSUM-DIALOGSUM")
103
 
104
+ #model = AutoModelForSeq2SeqLM.from_pretrained("knkarthick/MEETING-SUMMARY-BART-LARGE-XSUM-SAMSUM-DIALOGSUM")
105
 
106
  from transformers import pipeline
107
  summarizer = pipeline("summarization", model="knkarthick/MEETING-SUMMARY-BART-LARGE-XSUM-SAMSUM-DIALOGSUM")
108
+
 
109
  return summarizer(text)
110
 
111
+ ###########################################################################
112
 
113
 
114
  app1=gr.Interface(
 
128
  inputs=gr.Textbox(label="Enter"),
129
  outputs=gr.Textbox(label="Output"))
130
 
131
+ demo = gr.TabbedInterface([app1, app2], ["Text", "Detailed_Summary"])
132
 
133
 
134
  demo.launch()