Spaces:
Runtime error
Runtime error
Commit
·
dc88c51
1
Parent(s):
fc59e04
fix: modify reqs with GPU and torch reqs
Browse files- app.py +7 -0
- requirements.txt +9 -5
app.py
CHANGED
|
@@ -1,6 +1,13 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
from transformers import pipeline
|
|
|
|
| 3 |
from nemo.collections.speechlm2 import SALM
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
# Initialize the ASR model which is based on the "nvidia/canary-qwen-2.5b" architecture and uses NVIDIA's NeMo framework
|
| 6 |
model = SALM.from_pretrained("nvidia/canary-qwen-2.5b").bfloat16().eval().to(device)
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
from transformers import pipeline
|
| 3 |
+
import torch
|
| 4 |
from nemo.collections.speechlm2 import SALM
|
| 5 |
+
import spaces
|
| 6 |
+
|
| 7 |
+
if torch.cuda.is_available():
|
| 8 |
+
device = torch.device("cuda")
|
| 9 |
+
else:
|
| 10 |
+
device = torch.device("cpu")
|
| 11 |
|
| 12 |
# Initialize the ASR model which is based on the "nvidia/canary-qwen-2.5b" architecture and uses NVIDIA's NeMo framework
|
| 13 |
model = SALM.from_pretrained("nvidia/canary-qwen-2.5b").bfloat16().eval().to(device)
|
requirements.txt
CHANGED
|
@@ -1,5 +1,9 @@
|
|
| 1 |
-
gradio
|
| 2 |
-
transformers
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
gradio
|
| 2 |
+
transformers
|
| 3 |
+
spaces
|
| 4 |
+
nemo_toolkit[asr] @ git+https://github.com/NVIDIA/NeMo.git
|
| 5 |
+
peft
|
| 6 |
+
sacrebleu
|
| 7 |
+
seaborn
|
| 8 |
+
--extra-index-url https://download.pytorch.org/whl/cu113
|
| 9 |
+
torch
|