Spaces:
Paused
Paused
add app and reqs
Browse filesSigned-off-by: Jason <jasoli@nvidia.com>
- app.py +16 -0
- requirements.txt +1 -0
app.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
import spaces
|
| 3 |
+
import torch
|
| 4 |
+
|
| 5 |
+
import nemo.collections.tts.models
|
| 6 |
+
|
| 7 |
+
zero = torch.Tensor([0]).cuda()
|
| 8 |
+
print(zero.device) # <-- 'cpu' 🤔
|
| 9 |
+
|
| 10 |
+
@spaces.GPU
|
| 11 |
+
def greet(n):
|
| 12 |
+
print(zero.device) # <-- 'cuda:0' 🤗
|
| 13 |
+
return f"Hello {zero + n} Tensor"
|
| 14 |
+
|
| 15 |
+
demo = gr.Interface(fn=greet, inputs=gr.Number(), outputs=gr.Text())
|
| 16 |
+
demo.launch()
|
requirements.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
nemo_toolkit[tts]@git+https://github.com/NVIDIA-NeMo/NeMo.git@9551d86f0900403de7acb110b3bfee2b9d6cabdb
|