cigol123 commited on
Commit
80f190a
·
verified ·
1 Parent(s): d5f3eed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -6,12 +6,13 @@ import numpy as np
6
  from scipy import signal
7
  import os
8
 
9
- # Set up cache directory
10
- os.environ['TRANSFORMERS_CACHE'] = '/code/.cache'
11
- os.makedirs('/code/.cache', exist_ok=True)
 
12
 
13
- processor = WhisperProcessor.from_pretrained("openai/whisper-large-v3", cache_dir='/code/.cache')
14
- model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-large-v3", cache_dir='/code/.cache')
15
 
16
  def process_audio(audio_path):
17
  waveform, sr = sf.read(audio_path)
 
6
  from scipy import signal
7
  import os
8
 
9
+ # Set cache directory to user's home
10
+ cache_dir = os.path.expanduser("~/cache")
11
+ os.environ['TRANSFORMERS_CACHE'] = cache_dir
12
+ os.makedirs(cache_dir, exist_ok=True)
13
 
14
+ processor = WhisperProcessor.from_pretrained("openai/whisper-large-v3", cache_dir=cache_dir)
15
+ model = WhisperForConditionalGeneration.from_pretrained("openai/whisper-large-v3", cache_dir=cache_dir)
16
 
17
  def process_audio(audio_path):
18
  waveform, sr = sf.read(audio_path)