Spaces:
Runtime error
Runtime error
storresbusquets
commited on
Commit
·
efa520c
1
Parent(s):
2328277
Update app.py
Browse files
app.py
CHANGED
@@ -205,7 +205,7 @@ class GradioInference:
|
|
205 |
# results["text"], max_length=150, min_length=30, do_sample=False
|
206 |
# )
|
207 |
|
208 |
-
########################## PRUEBA
|
209 |
from langchain import HuggingFacePipeline, PromptTemplate, LLMChain
|
210 |
|
211 |
llm_model = "tiiuae/falcon-7b-instruct"
|
@@ -239,8 +239,8 @@ class GradioInference:
|
|
239 |
|
240 |
text = results["text"]
|
241 |
|
242 |
-
|
243 |
-
########################## FIN PRUEBA
|
244 |
|
245 |
#### Prueba
|
246 |
# WHITESPACE_HANDLER = lambda k: re.sub('\s+', ' ', re.sub('\n+', ' ', k.strip()))
|
@@ -307,7 +307,7 @@ class GradioInference:
|
|
307 |
if lang == "english":
|
308 |
return (
|
309 |
results["text"],
|
310 |
-
|
311 |
# transcription_summary[0]["summary_text"],
|
312 |
formatted_keywords,
|
313 |
formatted_sentiment,
|
@@ -316,7 +316,7 @@ class GradioInference:
|
|
316 |
else:
|
317 |
return (
|
318 |
results["text"],
|
319 |
-
|
320 |
# summary,
|
321 |
formatted_keywords,
|
322 |
formatted_sentiment,
|
|
|
205 |
# results["text"], max_length=150, min_length=30, do_sample=False
|
206 |
# )
|
207 |
|
208 |
+
########################## PRUEBA LLM #################################
|
209 |
from langchain import HuggingFacePipeline, PromptTemplate, LLMChain
|
210 |
|
211 |
llm_model = "tiiuae/falcon-7b-instruct"
|
|
|
239 |
|
240 |
text = results["text"]
|
241 |
|
242 |
+
summ = llm_chain.run(text)
|
243 |
+
########################## FIN PRUEBA LLM #################################
|
244 |
|
245 |
#### Prueba
|
246 |
# WHITESPACE_HANDLER = lambda k: re.sub('\s+', ' ', re.sub('\n+', ' ', k.strip()))
|
|
|
307 |
if lang == "english":
|
308 |
return (
|
309 |
results["text"],
|
310 |
+
summ,
|
311 |
# transcription_summary[0]["summary_text"],
|
312 |
formatted_keywords,
|
313 |
formatted_sentiment,
|
|
|
316 |
else:
|
317 |
return (
|
318 |
results["text"],
|
319 |
+
summ,
|
320 |
# summary,
|
321 |
formatted_keywords,
|
322 |
formatted_sentiment,
|