Spaces:
badrex
/
Running on Zero

badrex commited on
Commit
f9a373a
·
verified ·
1 Parent(s): 06d77dd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -3,6 +3,7 @@ from transformers import pipeline
3
  import numpy as np
4
  import os
5
  from huggingface_hub import login
 
6
 
7
  # Get token from Space secrets
8
  HF_TOKEN = os.environ.get("HF_TOKEN")
@@ -11,8 +12,9 @@ if HF_TOKEN:
11
 
12
  # Load model from your private repo
13
  MODEL_ID = "badrex/JASR" # Change this to match your repo!
14
- transcriber = pipeline("automatic-speech-recognition", model=MODEL_ID, token=HF_TOKEN)
15
 
 
16
  def transcribe(audio):
17
  sr, y = audio
18
  # Convert to mono if stereo
 
3
  import numpy as np
4
  import os
5
  from huggingface_hub import login
6
+ import spaces
7
 
8
  # Get token from Space secrets
9
  HF_TOKEN = os.environ.get("HF_TOKEN")
 
12
 
13
  # Load model from your private repo
14
  MODEL_ID = "badrex/JASR" # Change this to match your repo!
15
+ transcriber = pipeline("automatic-speech-recognition", model=MODEL_ID)
16
 
17
+ @spaces.GPU
18
  def transcribe(audio):
19
  sr, y = audio
20
  # Convert to mono if stereo