hans00 commited on
Commit
0c34cba
·
unverified ·
1 Parent(s): 1098b3c

Make whisper use CUDA if available

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -100,9 +100,11 @@ def get_or_create_speaker(interface, audio_file):
100
  print(f"✅ Using cached speaker profile for {os.path.basename(audio_file)}")
101
  return speaker_cache[cache_key]
102
 
 
 
103
  # Create new speaker profile
104
  print(f"🔄 Creating new speaker profile for {os.path.basename(audio_file)}")
105
- speaker = interface.create_speaker(audio_file, whisper_model="large-v3-turbo")
106
 
107
  # Cache the speaker profile
108
  speaker_cache[cache_key] = speaker
 
100
  print(f"✅ Using cached speaker profile for {os.path.basename(audio_file)}")
101
  return speaker_cache[cache_key]
102
 
103
+ device = "cuda" if torch.cuda.is_available() else "cpu"
104
+
105
  # Create new speaker profile
106
  print(f"🔄 Creating new speaker profile for {os.path.basename(audio_file)}")
107
+ speaker = interface.create_speaker(audio_file, whisper_model="large-v3-turbo", whisper_device=device)
108
 
109
  # Cache the speaker profile
110
  speaker_cache[cache_key] = speaker