Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
from transformers import pipeline
|
2 |
import gradio as gr
|
|
|
3 |
import torch
|
4 |
|
5 |
|
@@ -7,7 +8,9 @@ import torch
|
|
7 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
8 |
|
9 |
|
10 |
-
|
|
|
|
|
11 |
|
12 |
def transcribe(audio):
|
13 |
text = pipe(audio)["text"]
|
|
|
1 |
from transformers import pipeline
|
2 |
import gradio as gr
|
3 |
+
import os
|
4 |
import torch
|
5 |
|
6 |
|
|
|
8 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
9 |
|
10 |
|
11 |
+
auth_token = os.environ.get("hf_token") or True
|
12 |
+
|
13 |
+
pipe = pipeline(model="fahadqazi/whisper-small-sindhi", device=device, use_auth_token=auth_token) # change to "your-username/the-name-you-picked"
|
14 |
|
15 |
def transcribe(audio):
|
16 |
text = pipe(audio)["text"]
|