Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -56,6 +56,7 @@ import gradio as gr
|
|
56 |
device = torch.device('cuda')
|
57 |
#device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
58 |
|
|
|
59 |
def transcribe(file_upload, progress=gr.Progress(track_tqdm=True)): # microphone
|
60 |
|
61 |
file = file_upload
|
@@ -68,7 +69,8 @@ def transcribe(file_upload, progress=gr.Progress(track_tqdm=True)): # microphone
|
|
68 |
chunk_length_s=30,
|
69 |
device=device)
|
70 |
|
71 |
-
pipe.model.config.forced_decoder_ids = pipe.tokenizer.get_decoder_prompt_ids(
|
|
|
72 |
text = pipe(file)["text"]
|
73 |
#--------------____________________________________________--------------"
|
74 |
|
|
|
56 |
device = torch.device('cuda')
|
57 |
#device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
58 |
|
59 |
+
|
60 |
def transcribe(file_upload, progress=gr.Progress(track_tqdm=True)): # microphone
|
61 |
|
62 |
file = file_upload
|
|
|
69 |
chunk_length_s=30,
|
70 |
device=device)
|
71 |
|
72 |
+
pipe.model.config.forced_decoder_ids = pipe.tokenizer.get_decoder_prompt_ids(task="transcribe")
|
73 |
+
|
74 |
text = pipe(file)["text"]
|
75 |
#--------------____________________________________________--------------"
|
76 |
|