huedaya commited on
Commit
6c87da3
·
1 Parent(s): fab4dca
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -1,21 +1,22 @@
1
  import os
2
- os.system("pip install git+https://github.com/openai/whisper.git")
3
 
4
  import whisper
5
  from flask import Flask, jsonify, request
6
  import requests
7
  import time
8
  from transformers import pipeline
9
- from datasets import load_dataset
10
 
11
 
12
  model = whisper.load_model("small")
13
- pipe = pipeline(
14
- "automatic-speech-recognition",
15
- model="openai/whisper-small.en",
16
- chunk_length_s=15,
17
- device=model.device,
18
- )
 
19
 
20
  app = Flask(__name__)
21
  app.config['TIMEOUT'] = 60 * 10 # 10 mins
 
1
  import os
2
+ os.system("pip install git+https://github.com/sanchit-gandhi/whisper-jax.git")
3
 
4
  import whisper
5
  from flask import Flask, jsonify, request
6
  import requests
7
  import time
8
  from transformers import pipeline
9
+ from whisper_jax import FlaxWhisperPipline
10
 
11
 
12
  model = whisper.load_model("small")
13
+ # pipe = pipeline(
14
+ # "automatic-speech-recognition",
15
+ # model="openai/whisper-small.en",
16
+ # chunk_length_s=15,
17
+ # device=model.device,
18
+ # )
19
+ pipe = FlaxWhisperPipline("openai/whisper-large-v2")
20
 
21
  app = Flask(__name__)
22
  app.config['TIMEOUT'] = 60 * 10 # 10 mins