Commit
·
a18eac3
1
Parent(s):
4be57d5
fix comma, cuda error
Browse files
app.py
CHANGED
@@ -248,12 +248,14 @@ def load_hubert():
|
|
248 |
global hubert_model
|
249 |
# Load the model
|
250 |
|
251 |
-
configH= HubertConfig()
|
252 |
configH.output_hidden_states = True
|
253 |
hubert_model = HubertModel(configH)
|
254 |
hubert_model.load_state_dict(torch.load('hubert_base_hf_statedict.pt'))
|
255 |
# Prepare the model
|
256 |
hubert_model = hubert_model.to(config.device)
|
|
|
|
|
257 |
if config.is_half:
|
258 |
hubert_model = hubert_model.half()
|
259 |
else:
|
@@ -1793,7 +1795,7 @@ with gr.Blocks(theme=gr.themes.Default(primary_hue="pink", secondary_hue="rose")
|
|
1793 |
# dropbox.upload(fn=change_choices2, inputs=[], outputs=[input_audio0])
|
1794 |
refresh_button2 = gr.Button("Refresh", variant="primary", size='sm')
|
1795 |
transcribed_text = gr.Textbox(label="transcibed text + mfa",
|
1796 |
-
value="The dogs sat at the door."
|
1797 |
info="write down the transcript for the file, or run whisper model to get the transcript. Takes time to download whisper models on first run")
|
1798 |
# record_button.change(fn=save_to_wav, inputs=[record_button], outputs=[input_audio0])
|
1799 |
# record_button.change(fn=change_choices2, inputs=[], outputs=[input_audio0])
|
|
|
248 |
global hubert_model
|
249 |
# Load the model
|
250 |
|
251 |
+
configH = HubertConfig()
|
252 |
configH.output_hidden_states = True
|
253 |
hubert_model = HubertModel(configH)
|
254 |
hubert_model.load_state_dict(torch.load('hubert_base_hf_statedict.pt'))
|
255 |
# Prepare the model
|
256 |
hubert_model = hubert_model.to(config.device)
|
257 |
+
config.device = "cuda"
|
258 |
+
config.is_half=True
|
259 |
if config.is_half:
|
260 |
hubert_model = hubert_model.half()
|
261 |
else:
|
|
|
1795 |
# dropbox.upload(fn=change_choices2, inputs=[], outputs=[input_audio0])
|
1796 |
refresh_button2 = gr.Button("Refresh", variant="primary", size='sm')
|
1797 |
transcribed_text = gr.Textbox(label="transcibed text + mfa",
|
1798 |
+
value="The dogs sat at the door.",
|
1799 |
info="write down the transcript for the file, or run whisper model to get the transcript. Takes time to download whisper models on first run")
|
1800 |
# record_button.change(fn=save_to_wav, inputs=[record_button], outputs=[input_audio0])
|
1801 |
# record_button.change(fn=change_choices2, inputs=[], outputs=[input_audio0])
|