harphool17 commited on
Commit
61b8b5c
Β·
verified Β·
1 Parent(s): 30b790c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -9
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/Loading Parakeet Base Model...")
10
- model = nemo_asr.models.EncDecRNNTBPEModel.from_pretrained(model_name="nvidia/parakeet-tdt-0.6b-v2")
 
11
 
12
- print("Downloading Custom LoRA Adapter from Model Hub...")
13
- # This safely pulls your adapter from your unlimited Model repository!
14
- adapter_path = hf_hub_download(repo_id="harphool17/parakeet-asr-adapter", filename="ASR-Adapter.nemo")
15
-
16
- print("Attaching and FUSING your custom LoRA Adapter...")
17
- model.load_adapters(adapter_path)
18
  model.eval()
19
- print("βœ… Brain successfully fused! Server Ready.")
 
 
 
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