import gradio as gr | |
def greet(name): | |
import torch | |
import pandas as pd | |
flag = f"Hello {name}, we are using torch {torch.__version__}, pandas {pd.__version__}. \n"\ | |
f"Cuda available is {torch.cuda.is_available()}, with total {torch.cuda.device_count()}" | |
return flag | |
iface = gr.Interface(fn=greet, inputs="text", outputs="text") | |
iface.launch() | |