Spaces:
Runtime error
Runtime error
fix: gr.Audio params
Browse files
app.py
CHANGED
@@ -10,10 +10,10 @@ import torch
|
|
10 |
import numpy as np
|
11 |
|
12 |
processor = AutoProcessor.from_pretrained(
|
13 |
-
"
|
14 |
)
|
15 |
model = AutoModelForDocumentQuestionAnswering.from_pretrained(
|
16 |
-
"
|
17 |
)
|
18 |
|
19 |
tokenizer_ru2en = AutoTokenizer.from_pretrained("Helsinki-NLP/opus-mt-ru-en")
|
@@ -92,7 +92,7 @@ interface = gr.Interface(
|
|
92 |
inputs=[
|
93 |
gr.Image(type="pil"),
|
94 |
gr.Textbox(label="Вопрос (на русском)", placeholder="Ваш вопрос"),
|
95 |
-
gr.Audio(
|
96 |
],
|
97 |
outputs=gr.Textbox(label="Ответ (на русском)"),
|
98 |
examples=[["doc.png", "О чем данный документ?"]],
|
|
|
10 |
import numpy as np
|
11 |
|
12 |
processor = AutoProcessor.from_pretrained(
|
13 |
+
"MariaK/layoutlmv2-base-uncased_finetuned_docvqa_v2"
|
14 |
)
|
15 |
model = AutoModelForDocumentQuestionAnswering.from_pretrained(
|
16 |
+
"MariaK/layoutlmv2-base-uncased_finetuned_docvqa_v2"
|
17 |
)
|
18 |
|
19 |
tokenizer_ru2en = AutoTokenizer.from_pretrained("Helsinki-NLP/opus-mt-ru-en")
|
|
|
92 |
inputs=[
|
93 |
gr.Image(type="pil"),
|
94 |
gr.Textbox(label="Вопрос (на русском)", placeholder="Ваш вопрос"),
|
95 |
+
gr.Audio(sources="microphone", streaming=True, label="Голосовой ввод"),
|
96 |
],
|
97 |
outputs=gr.Textbox(label="Ответ (на русском)"),
|
98 |
examples=[["doc.png", "О чем данный документ?"]],
|