remotewith commited on
Commit
1127158
·
1 Parent(s): b4b2f4e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -12
app.py CHANGED
@@ -48,7 +48,7 @@ def audio_to_text(audio, num_speakers):
48
  add_speaker_labels(segments, embeddings, num_speakers)
49
  output = get_output(segments)
50
  short_sum=text_to_short_summary(output)
51
- return output,short_sum
52
 
53
  def convert_to_wav(path):
54
  if path[-3:] != 'wav':
@@ -106,10 +106,7 @@ def get_output(segments):
106
 
107
 
108
  def text_to_short_summary(text):
109
- #tokenizer = AutoTokenizer.from_pretrained("knkarthick/MEETING-SUMMARY-BART-LARGE-XSUM-SAMSUM-DIALOGSUM")
110
 
111
- #model = AutoModelForSeq2SeqLM.from_pretrained("knkarthick/MEETING-SUMMARY-BART-LARGE-XSUM-SAMSUM-DIALOGSUM")
112
-
113
  from transformers import pipeline
114
  summarizer = pipeline("summarization", model="knkarthick/MEETING-SUMMARY-BART-LARGE-XSUM-SAMSUM-DIALOGSUM")
115
  #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.
@@ -128,19 +125,14 @@ app1=gr.Interface(
128
 
129
  ],
130
  outputs=[
131
- (gr.outputs.Textbox(label='Transcript'),
132
- (gr.outputs.Textbox(label='SHort_sum')))
133
  ]
134
  )
135
 
136
- app2=gr.Interface(fn=text_to_short_summary,
137
- inputs=gr.Textbox(label="Input"),
138
- outputs=gr.Textbox(label="Output"))
139
-
140
- demo = gr.TabbedInterface([app1, app2], ["Text", "Detailed_Summary"])
141
 
142
 
143
- demo.launch()
144
 
145
 
146
 
 
48
  add_speaker_labels(segments, embeddings, num_speakers)
49
  output = get_output(segments)
50
  short_sum=text_to_short_summary(output)
51
+ return output
52
 
53
  def convert_to_wav(path):
54
  if path[-3:] != 'wav':
 
106
 
107
 
108
  def text_to_short_summary(text):
 
109
 
 
 
110
  from transformers import pipeline
111
  summarizer = pipeline("summarization", model="knkarthick/MEETING-SUMMARY-BART-LARGE-XSUM-SAMSUM-DIALOGSUM")
112
  #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.
 
125
 
126
  ],
127
  outputs=[
128
+ (gr.outputs.Textbox(label='Transcript')
129
+
130
  ]
131
  )
132
 
 
 
 
 
 
133
 
134
 
135
+ app1.launch()
136
 
137
 
138