Marco-Cheung
commited on
Commit
•
94cf9c3
1
Parent(s):
2960239
Update app.py
Browse files
app.py
CHANGED
@@ -5,6 +5,9 @@ from transformers import pipeline, VitsModel, VitsTokenizer
|
|
5 |
|
6 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
7 |
|
|
|
|
|
|
|
8 |
# load speech translation checkpoint
|
9 |
ASR_MODEL_NAME = 'openai/whisper-base'
|
10 |
asr_pipe = pipeline("automatic-speech-recognition", model=ASR_MODEL_NAME, chunk_length_s=30,device=device)
|
|
|
5 |
|
6 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
7 |
|
8 |
+
target_dtype = np.int16
|
9 |
+
max_range = np.iinfo(target_dtype).max
|
10 |
+
|
11 |
# load speech translation checkpoint
|
12 |
ASR_MODEL_NAME = 'openai/whisper-base'
|
13 |
asr_pipe = pipeline("automatic-speech-recognition", model=ASR_MODEL_NAME, chunk_length_s=30,device=device)
|