micknikolic commited on
Commit
85c6c19
Β·
1 Parent(s): 7899f9f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -13,6 +13,8 @@ model = AutoModelForSpeechSeq2Seq.from_pretrained(pretrained_model_name_or_path=
13
  torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
14
  use_safetensors=True)
15
 
 
 
16
  #Instantiating the processor object.
17
 
18
  processor = AutoProcessor.from_pretrained(pretrained_model_name_or_path="openai/whisper-large-v3")
@@ -27,7 +29,8 @@ pipe = pipeline(task="automatic-speech-recognition",
27
  chunk_length_s=30,
28
  batch_size=16,
29
  return_timestamps=True,
30
- torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32
 
31
  )
32
 
33
  #Defining speech-to-text function.
@@ -65,7 +68,6 @@ gr_interface = gr.Interface(
65
  "textbox",
66
  "state"
67
  ],
68
- theme="dark",
69
  live=True
70
  )
71
 
 
13
  torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
14
  use_safetensors=True)
15
 
16
+ model = model.to("cuda")
17
+
18
  #Instantiating the processor object.
19
 
20
  processor = AutoProcessor.from_pretrained(pretrained_model_name_or_path="openai/whisper-large-v3")
 
29
  chunk_length_s=30,
30
  batch_size=16,
31
  return_timestamps=True,
32
+ torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,
33
+ device="cuda"
34
  )
35
 
36
  #Defining speech-to-text function.
 
68
  "textbox",
69
  "state"
70
  ],
 
71
  live=True
72
  )
73