Spaces:
Runtime error
Runtime error
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) | |