Spaces:
Runtime error
Runtime error
thomas0104
commited on
Commit
•
81f4913
1
Parent(s):
729ca56
Update app.py
Browse files
app.py
CHANGED
@@ -1,3 +1,5 @@
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
import pytube as pt
|
3 |
from transformers import pipeline
|
@@ -6,7 +8,7 @@ from huggingface_hub import model_info
|
|
6 |
MODEL_NAME = "thomas0104/whisper-large-v2-nan-tw-only-char" #this always needs to stay in line 8 :D sorry for the hackiness
|
7 |
lang = "chinese"
|
8 |
|
9 |
-
|
10 |
pipe = pipeline(
|
11 |
task="automatic-speech-recognition",
|
12 |
model=MODEL_NAME,
|
|
|
1 |
+
import torch
|
2 |
+
|
3 |
import gradio as gr
|
4 |
import pytube as pt
|
5 |
from transformers import pipeline
|
|
|
8 |
MODEL_NAME = "thomas0104/whisper-large-v2-nan-tw-only-char" #this always needs to stay in line 8 :D sorry for the hackiness
|
9 |
lang = "chinese"
|
10 |
|
11 |
+
device = 0 if torch.cuda.is_available() else "cpu"
|
12 |
pipe = pipeline(
|
13 |
task="automatic-speech-recognition",
|
14 |
model=MODEL_NAME,
|