Spaces:
Runtime error
Runtime error
File size: 354 Bytes
c93f6af 24f0707 c93f6af 24f0707 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
import gradio as gr
import torch
import os
def greet(name):
return torch.cuda.is_available()
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
if 'HUGGINGFACE_SPACE_ID' in os.environ:
# Running in Hugging Face Space
gradio_share = False
else:
# Running on desktop
gradio_share = True
iface.launch(share=gradio_share)
|