Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from textblob import TextBlob
|
| 3 |
-
from transformers import
|
| 4 |
import torch
|
| 5 |
import base64
|
| 6 |
import numpy as np
|
|
@@ -16,7 +16,7 @@ torch_dtype = torch.float16 if torch.cuda.is_available() else torch.float32
|
|
| 16 |
model_id = "openai/whisper-small"
|
| 17 |
|
| 18 |
# 3. Load the model from pretrained weights
|
| 19 |
-
model =
|
| 20 |
model_id, torch_dtype=torch_dtype, low_cpu_mem_usage=True, use_safetensors=True
|
| 21 |
)
|
| 22 |
model.to(device)
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from textblob import TextBlob
|
| 3 |
+
from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor, pipeline
|
| 4 |
import torch
|
| 5 |
import base64
|
| 6 |
import numpy as np
|
|
|
|
| 16 |
model_id = "openai/whisper-small"
|
| 17 |
|
| 18 |
# 3. Load the model from pretrained weights
|
| 19 |
+
model = AutoModelForSpeechSeq2Seq.from_pretrained(
|
| 20 |
model_id, torch_dtype=torch_dtype, low_cpu_mem_usage=True, use_safetensors=True
|
| 21 |
)
|
| 22 |
model.to(device)
|