Spaces:
Sleeping
Sleeping
Commit
·
73d45a9
1
Parent(s):
fbfab3f
Update app.py
Browse files
app.py
CHANGED
|
@@ -9,7 +9,7 @@ lang = "en"
|
|
| 9 |
|
| 10 |
transcribe_pipe = pipeline(
|
| 11 |
task="automatic-speech-recognition",
|
| 12 |
-
model=
|
| 13 |
chunk_length_s=30,
|
| 14 |
)
|
| 15 |
transcribe_pipe.model.config.forced_decoder_ids = transcribe_pipe.tokenizer.get_decoder_prompt_ids(language=lang, task="transcribe")
|
|
@@ -25,14 +25,14 @@ def yt_transcribe(yt_url):
|
|
| 25 |
return html_embed_str, text
|
| 26 |
|
| 27 |
qa_model_ckpt = "deepset/tinyroberta-squad2"
|
| 28 |
-
qa_pipe = pipeline('question-answering', model=
|
| 29 |
|
| 30 |
def get_answer(query,context):
|
| 31 |
QA_input = {
|
| 32 |
'question': query,
|
| 33 |
'context': context
|
| 34 |
}
|
| 35 |
-
res =
|
| 36 |
return res
|
| 37 |
|
| 38 |
|
|
|
|
| 9 |
|
| 10 |
transcribe_pipe = pipeline(
|
| 11 |
task="automatic-speech-recognition",
|
| 12 |
+
model=transcribe_model_ckpt,
|
| 13 |
chunk_length_s=30,
|
| 14 |
)
|
| 15 |
transcribe_pipe.model.config.forced_decoder_ids = transcribe_pipe.tokenizer.get_decoder_prompt_ids(language=lang, task="transcribe")
|
|
|
|
| 25 |
return html_embed_str, text
|
| 26 |
|
| 27 |
qa_model_ckpt = "deepset/tinyroberta-squad2"
|
| 28 |
+
qa_pipe = pipeline('question-answering', model=qa_model_ckpt, tokenizer=qa_model_ckpt)
|
| 29 |
|
| 30 |
def get_answer(query,context):
|
| 31 |
QA_input = {
|
| 32 |
'question': query,
|
| 33 |
'context': context
|
| 34 |
}
|
| 35 |
+
res = qa_pipe(QA_input)["answer"]
|
| 36 |
return res
|
| 37 |
|
| 38 |
|