basicpytorch / app.py
x0x7's picture
Adding the start of some privateGPT code
24f0707
raw
history blame
354 Bytes
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)