Spaces:
Paused
Paused
Upload app.py
Browse files
app.py
CHANGED
@@ -32,7 +32,11 @@ phi_new_model = "models/phi_adapter"
|
|
32 |
phi_model = PeftModel.from_pretrained(phi_base_model, phi_new_model)
|
33 |
phi_model = phi_model.merge_and_unload()
|
34 |
|
35 |
-
|
|
|
|
|
|
|
|
|
36 |
|
37 |
tokenizer = AutoTokenizer.from_pretrained('microsoft/phi-2', trust_remote_code=True)
|
38 |
tokenizer.pad_token = tokenizer.unk_token
|
|
|
32 |
phi_model = PeftModel.from_pretrained(phi_base_model, phi_new_model)
|
33 |
phi_model = phi_model.merge_and_unload()
|
34 |
|
35 |
+
compute_type = 'float32'
|
36 |
+
if device != 'cpu':
|
37 |
+
compute_type = 'float16'
|
38 |
+
|
39 |
+
audi_model = whisperx.load_model("large-v2", device, compute_type=compute_type)
|
40 |
|
41 |
tokenizer = AutoTokenizer.from_pretrained('microsoft/phi-2', trust_remote_code=True)
|
42 |
tokenizer.pad_token = tokenizer.unk_token
|