Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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,
|
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)
|