Spaces:
Paused
Paused
apolinario
commited on
Commit
•
7f1aa40
1
Parent(s):
de829ef
Initial test
Browse files- app.py +11 -0
- requirements.txt +1 -0
app.py
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import torch
|
3 |
+
|
4 |
+
is_cuda = torch.cuda.is_available()
|
5 |
+
def greet(name):
|
6 |
+
if is_cuda:
|
7 |
+
return "Hello cuda" + name + "!!"
|
8 |
+
else:
|
9 |
+
return "Hello ooops" + name + "!!"
|
10 |
+
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
11 |
+
iface.launch()
|
requirements.txt
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
torch
|