apolinario commited on
Commit
16aa660
1 Parent(s): cc138d1
Files changed (2) hide show
  1. app.py +11 -0
  2. 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