Phong1807 commited on
Commit
6cec50f
1 Parent(s): 2fa10a8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -0
app.py CHANGED
@@ -9,6 +9,9 @@ print(f"TRANSFORMERS_CACHE: {os.getenv('TRANSFORMERS_CACHE')}")
9
 
10
  app = Flask(__name__)
11
 
 
 
 
12
  # Tải mô hình Hugging Face
13
  transcriber = pipeline(model="Phong1807/whisper-datn11")
14
 
@@ -18,6 +21,7 @@ firebase_admin.initialize_app(cred)
18
  db = firestore.client()
19
 
20
  @app.route('/transcribe', methods=['POST'])
 
21
  def transcribe():
22
  audio_data = request.files['audio']
23
  transcription = transcriber(audio_data)['text']
 
9
 
10
  app = Flask(__name__)
11
 
12
+ CORS(app)
13
+ app.config['CORS_HEADERS'] = 'Content-type'
14
+
15
  # Tải mô hình Hugging Face
16
  transcriber = pipeline(model="Phong1807/whisper-datn11")
17
 
 
21
  db = firestore.client()
22
 
23
  @app.route('/transcribe', methods=['POST'])
24
+ @cross_origin(origin='*')
25
  def transcribe():
26
  audio_data = request.files['audio']
27
  transcription = transcriber(audio_data)['text']