Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -60,13 +60,8 @@ try:
|
|
| 60 |
audio_model = whisperx.load_model(
|
| 61 |
audio_model_size,
|
| 62 |
device,
|
| 63 |
-
compute_type=compute_type
|
| 64 |
-
#
|
| 65 |
-
# Check documentation for required parameters
|
| 66 |
-
max_new_tokens=100, # Example values, adjust as needed
|
| 67 |
-
clip_timestamps=True,
|
| 68 |
-
hallucination_silence_threshold=0.5,
|
| 69 |
-
hotwords=None # Add specific hotwords if needed
|
| 70 |
)
|
| 71 |
print(f"Model loaded successfully with compute_type: {compute_type}")
|
| 72 |
except ValueError as e:
|
|
@@ -76,17 +71,18 @@ except ValueError as e:
|
|
| 76 |
audio_model = whisperx.load_model(
|
| 77 |
audio_model_size,
|
| 78 |
device,
|
| 79 |
-
compute_type="int8"
|
| 80 |
-
|
| 81 |
-
clip_timestamps=True,
|
| 82 |
-
hallucination_silence_threshold=0.5,
|
| 83 |
-
hotwords=None
|
| 84 |
)
|
| 85 |
print("Fell back to int8 compute type successfully.")
|
| 86 |
except Exception as e:
|
| 87 |
print(f"Failed to load model with int8: {e}")
|
| 88 |
|
| 89 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 90 |
# load weights
|
| 91 |
model_to_merge = PeftModel.from_pretrained(phi_model,'./model_chkpt/lora_adaptor')
|
| 92 |
merged_model = model_to_merge.merge_and_unload()
|
|
|
|
| 60 |
audio_model = whisperx.load_model(
|
| 61 |
audio_model_size,
|
| 62 |
device,
|
| 63 |
+
compute_type=compute_type
|
| 64 |
+
# Removed unsupported parameters
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 65 |
)
|
| 66 |
print(f"Model loaded successfully with compute_type: {compute_type}")
|
| 67 |
except ValueError as e:
|
|
|
|
| 71 |
audio_model = whisperx.load_model(
|
| 72 |
audio_model_size,
|
| 73 |
device,
|
| 74 |
+
compute_type="int8"
|
| 75 |
+
# Removed unsupported parameters
|
|
|
|
|
|
|
|
|
|
| 76 |
)
|
| 77 |
print("Fell back to int8 compute type successfully.")
|
| 78 |
except Exception as e:
|
| 79 |
print(f"Failed to load model with int8: {e}")
|
| 80 |
|
| 81 |
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
|
| 85 |
+
|
| 86 |
# load weights
|
| 87 |
model_to_merge = PeftModel.from_pretrained(phi_model,'./model_chkpt/lora_adaptor')
|
| 88 |
merged_model = model_to_merge.merge_and_unload()
|