Gabriel C commited on
Commit
7c07f39
1 Parent(s): 48c53a8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -4,8 +4,14 @@ import gradio as gr
4
  import numpy as np
5
  from groq import Groq
6
  from transformers import pipeline
 
7
 
8
- transcriber = pipeline("automatic-speech-recognition", model="openai/whisper-base.en")
 
 
 
 
 
9
 
10
  groq_client = Groq(api_key=os.getenv('GROQ_API_KEY'))
11
 
 
4
  import numpy as np
5
  from groq import Groq
6
  from transformers import pipeline
7
+ from transformers.utils import is_flash_attn_2_available
8
 
9
+ transcriber = pipeline("automatic-speech-recognition",
10
+ model="openai/whisper-large-v3",
11
+ torch_dtype=torch.float16,
12
+ device="cuda:0",
13
+ model_kwargs={"attn_implementation": "flash_attention_2"} if is_flash_attn_2_available() else {"attn_implementation": "sdpa"},
14
+ )
15
 
16
  groq_client = Groq(api_key=os.getenv('GROQ_API_KEY'))
17