huedaya commited on
Commit
e05af3f
·
1 Parent(s): a6d7c56
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -8,6 +8,12 @@ import time
8
  from transformers import pipeline
9
 
10
  model = whisper.load_model("small")
 
 
 
 
 
 
11
 
12
  app = Flask(__name__)
13
  app.config['TIMEOUT'] = 60 * 10 # 10 mins
@@ -24,13 +30,6 @@ def runApi():
24
 
25
  response = requests.get(audio_url)
26
 
27
- pipe = pipeline(
28
- "automatic-speech-recognition",
29
- model="openai/whisper-small",
30
- chunk_length_s=15,
31
- device=model.device,
32
- )
33
-
34
  if response.status_code == requests.codes.ok:
35
  with open("audio.mp3", "wb") as f:
36
  f.write(response.content)
 
8
  from transformers import pipeline
9
 
10
  model = whisper.load_model("small")
11
+ pipe = pipeline(
12
+ "automatic-speech-recognition",
13
+ model="openai/whisper-small",
14
+ chunk_length_s=15,
15
+ device=model.device,
16
+ )
17
 
18
  app = Flask(__name__)
19
  app.config['TIMEOUT'] = 60 * 10 # 10 mins
 
30
 
31
  response = requests.get(audio_url)
32
 
 
 
 
 
 
 
 
33
  if response.status_code == requests.codes.ok:
34
  with open("audio.mp3", "wb") as f:
35
  f.write(response.content)