Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -6,17 +6,18 @@ from huggingface_hub import hf_hub_download
|
|
| 6 |
# βββββββββββββββββββββββββββββββββββββββββββββ
|
| 7 |
# MODEL LOADING (Runs once when server starts)
|
| 8 |
# βββββββββββββββββββββββββββββββββββββββββββββ
|
| 9 |
-
print("Downloading
|
| 10 |
-
model
|
|
|
|
| 11 |
|
| 12 |
-
print("
|
| 13 |
-
#
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
print("Attaching and FUSING your custom LoRA Adapter...")
|
| 17 |
-
model.load_adapters(adapter_path)
|
| 18 |
model.eval()
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
# βββββββββββββββββββββββββββββββββββββββββββββ
|
| 22 |
# INFERENCE FUNCTION
|
|
|
|
| 6 |
# βββββββββββββββββββββββββββββββββββββββββββββ
|
| 7 |
# MODEL LOADING (Runs once when server starts)
|
| 8 |
# βββββββββββββββββββββββββββββββββββββββββββββ
|
| 9 |
+
print("Downloading your Full Custom Model from the Hub...")
|
| 10 |
+
# Because you saved the full model, we just download your 2.5GB file!
|
| 11 |
+
custom_model_path = hf_hub_download(repo_id="harphool17/parakeet-asr-adapter", filename="ASR-Adapter.nemo")
|
| 12 |
|
| 13 |
+
print("Booting up the model engine...")
|
| 14 |
+
# The 'restore_from' command automatically unpacks the .nemo file and loads everything inside.
|
| 15 |
+
model = nemo_asr.models.EncDecRNNTBPEModel.restore_from(custom_model_path)
|
|
|
|
|
|
|
|
|
|
| 16 |
model.eval()
|
| 17 |
+
|
| 18 |
+
print("β
Custom Parakeet Engine Online! Server Ready.")
|
| 19 |
+
|
| 20 |
+
|
| 21 |
|
| 22 |
# βββββββββββββββββββββββββββββββββββββββββββββ
|
| 23 |
# INFERENCE FUNCTION
|