Spaces:
Runtime error
Runtime error
storresbusquets
commited on
Commit
·
c0149cb
1
Parent(s):
f443362
Update app.py
Browse files
app.py
CHANGED
@@ -27,7 +27,7 @@ class GradioInference:
|
|
27 |
self.yt = None
|
28 |
|
29 |
# Initialize summary model for English
|
30 |
-
self.summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
|
31 |
|
32 |
# Initialize VoiceLabT5 model and tokenizer
|
33 |
self.keyword_model = T5ForConditionalGeneration.from_pretrained(
|
@@ -41,7 +41,7 @@ class GradioInference:
|
|
41 |
self.classifier = pipeline("text-classification", model="lxyuan/distilbert-base-multilingual-cased-sentiments-student", return_all_scores=False)
|
42 |
|
43 |
# Initialize Multilingual summary model
|
44 |
-
self.tokenizer = AutoTokenizer.from_pretrained("csebuetnlp/mT5_multilingual_XLSum")
|
45 |
self.model = AutoModelForSeq2SeqLM.from_pretrained("csebuetnlp/mT5_multilingual_XLSum")
|
46 |
|
47 |
# self.llm_tokenizer = AutoTokenizer.from_pretrained("tiiuae/falcon-7b-instruct")
|
@@ -92,7 +92,7 @@ class GradioInference:
|
|
92 |
|
93 |
# Perform summarization on the transcription
|
94 |
transcription_summary = self.summarizer(
|
95 |
-
results["text"], max_length=
|
96 |
)
|
97 |
|
98 |
#### Prueba
|
@@ -215,7 +215,7 @@ class GradioInference:
|
|
215 |
|
216 |
# Perform summarization on the transcription
|
217 |
transcription_summary = self.summarizer(
|
218 |
-
results["text"], max_length=150, min_length=30, do_sample=False
|
219 |
)
|
220 |
|
221 |
########################## PRUEBA LLM #################################
|
@@ -428,7 +428,7 @@ with block as demo:
|
|
428 |
|
429 |
with block:
|
430 |
gr.Markdown("### Video Examples")
|
431 |
-
gr.Examples(["https://www.youtube.com/shorts/xDNzz8yAH7I","https://www.youtube.com/watch?v=
|
432 |
|
433 |
gr.Markdown("### Audio Examples")
|
434 |
gr.Examples(
|
|
|
27 |
self.yt = None
|
28 |
|
29 |
# Initialize summary model for English
|
30 |
+
self.summarizer = pipeline("summarization", model="facebook/bart-large-cnn", truncation=True)
|
31 |
|
32 |
# Initialize VoiceLabT5 model and tokenizer
|
33 |
self.keyword_model = T5ForConditionalGeneration.from_pretrained(
|
|
|
41 |
self.classifier = pipeline("text-classification", model="lxyuan/distilbert-base-multilingual-cased-sentiments-student", return_all_scores=False)
|
42 |
|
43 |
# Initialize Multilingual summary model
|
44 |
+
self.tokenizer = AutoTokenizer.from_pretrained("csebuetnlp/mT5_multilingual_XLSum", truncation=True)
|
45 |
self.model = AutoModelForSeq2SeqLM.from_pretrained("csebuetnlp/mT5_multilingual_XLSum")
|
46 |
|
47 |
# self.llm_tokenizer = AutoTokenizer.from_pretrained("tiiuae/falcon-7b-instruct")
|
|
|
92 |
|
93 |
# Perform summarization on the transcription
|
94 |
transcription_summary = self.summarizer(
|
95 |
+
results["text"], max_length=256, min_length=30, do_sample=False, truncation=True
|
96 |
)
|
97 |
|
98 |
#### Prueba
|
|
|
215 |
|
216 |
# Perform summarization on the transcription
|
217 |
transcription_summary = self.summarizer(
|
218 |
+
results["text"], max_length=150, min_length=30, do_sample=False, truncation=True
|
219 |
)
|
220 |
|
221 |
########################## PRUEBA LLM #################################
|
|
|
428 |
|
429 |
with block:
|
430 |
gr.Markdown("### Video Examples")
|
431 |
+
gr.Examples(["https://www.youtube.com/shorts/xDNzz8yAH7I","https://www.youtube.com/watch?v=MnrJzXM7a6o&pp=ygURc3RldmUgam9icyBzcGVlY2g%3D"], inputs=link)
|
432 |
|
433 |
gr.Markdown("### Audio Examples")
|
434 |
gr.Examples(
|