File size: 602 Bytes
7197456 b194cd1 7197456 3f8ee6d 7b99542 34619cb 7b99542 7197456 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
import spaces
import gradio as gr
@spaces.GPU
def gpu():
return "Invoking gpu";
def nogpu():
return "No Gpu";
with gr.Blocks() as demo:
outgpu = gr.Textbox(lines=5);
outnpu = gr.Textbox(lines=5);
btngpu = gr.Button(value="gpu");
btngpun = gr.Button(value="ngpu");
btngpu.click(gpu, None, [outgpu]);
btngpun.click(nogpu, None, [outnpu]);
if __name__ == "__main__":
demo.launch(
share=False,
debug=False,
server_port=7860,
server_name="0.0.0.0",
allowed_paths=[ZIP_DIR]
)
|