Demo on Hub & GPU grant
#2
by
merve
HF staff
- opened
Hello πββοΈ congratulations on release!
Would you like to host your demo on Spaces? We can provide Zero GPU (A100 for inference for free) and increase visibility of your model
Yes, we would like to. That sounds fantastic!
@nlpzhaof
thanks a lot!
I invited you to our ZeroGPU org, you need to accept the invitation to get access to ZeroGPUs. You can check out the org page for more info.
When building the Space, select the GPU type as zero and simply do:
+import spaces
your_pytorch_model.to('cuda')
+@spaces.GPU
def infer(image, prompt):
return your_pytorch_model(**inputs)
gr.Interface(
fn=infer,
inputs=[gr.Image(), gr.Text()],
outputs=gr.Textbox(),
).launch()