Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,21 +1,24 @@
|
|
| 1 |
-
import gradio
|
| 2 |
-
import gradio.components as components
|
| 3 |
-
import gradio.blocks as blocks
|
| 4 |
|
| 5 |
-
|
| 6 |
-
import gradio as gr
|
| 7 |
-
import gradio._types as _types
|
| 8 |
|
| 9 |
-
|
| 10 |
-
|
| 11 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
import whisper
|
| 13 |
import gradio as gr
|
| 14 |
import torch
|
| 15 |
from transformers import BertTokenizer, BertForSequenceClassification, pipeline
|
| 16 |
from app.questions import get_question
|
| 17 |
|
| 18 |
-
# Load
|
|
|
|
| 19 |
confidence_model = BertForSequenceClassification.from_pretrained('RiteshAkhade/final_confidence')
|
| 20 |
confidence_tokenizer = BertTokenizer.from_pretrained('RiteshAkhade/final_confidence')
|
| 21 |
context_model = BertForSequenceClassification.from_pretrained('RiteshAkhade/context_model')
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
|
| 2 |
+
import gradio_client.utils as _gcu
|
|
|
|
|
|
|
| 3 |
|
| 4 |
+
_original_get_type = _gcu.get_type
|
| 5 |
+
def _get_type_patched(schema):
|
| 6 |
|
| 7 |
+
if isinstance(schema, bool):
|
| 8 |
+
return "Any"
|
| 9 |
+
return _original_get_type(schema)
|
| 10 |
+
|
| 11 |
+
_gcu.get_type = _get_type_patched
|
| 12 |
+
# βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 13 |
+
|
| 14 |
import whisper
|
| 15 |
import gradio as gr
|
| 16 |
import torch
|
| 17 |
from transformers import BertTokenizer, BertForSequenceClassification, pipeline
|
| 18 |
from app.questions import get_question
|
| 19 |
|
| 20 |
+
# Load models
|
| 21 |
+
whisper_model = whisper.load_model("small")
|
| 22 |
confidence_model = BertForSequenceClassification.from_pretrained('RiteshAkhade/final_confidence')
|
| 23 |
confidence_tokenizer = BertTokenizer.from_pretrained('RiteshAkhade/final_confidence')
|
| 24 |
context_model = BertForSequenceClassification.from_pretrained('RiteshAkhade/context_model')
|