dwb2023 commited on
Commit
9d1f846
1 Parent(s): 94e9e1d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -4
app.py CHANGED
@@ -21,11 +21,8 @@ YT_LENGTH_LIMIT_S = 4800 # 1 hour 20 minutes
21
 
22
  device = 0 if torch.cuda.is_available() else "cpu"
23
 
24
- # Load model with bitsandbytes quantization
25
- bnb_config = BitsAndBytesConfig(load_in_4bit=True)
26
-
27
  # Load the model
28
- model = WhisperForConditionalGeneration.from_pretrained(MODEL_NAME, config=bnb_config)
29
 
30
  # bnb_config = bnb.QuantizationConfig(bits=4)
31
  pipe = pipeline(task="automatic-speech-recognition", model=model, chunk_length_s=30, device=device)
 
21
 
22
  device = 0 if torch.cuda.is_available() else "cpu"
23
 
 
 
 
24
  # Load the model
25
+ model = WhisperForConditionalGeneration.from_pretrained(MODEL_NAME, device_map="auto")
26
 
27
  # bnb_config = bnb.QuantizationConfig(bits=4)
28
  pipe = pipeline(task="automatic-speech-recognition", model=model, chunk_length_s=30, device=device)