ContextCourse / app.py
eCiu's picture
Enable ZeroGPU for Gradio tool
cbbc5ea verified
Raw History Blame Contribute Delete
369 Bytes
import gradio as gr
import spaces
@spaces.GPU
def my_tool(input_text: str) -> str:
"""Do something with input.
Args:
input_text: The input
Returns:
The result
"""
return f"Processed: {input_text}"
demo = gr.Interface(fn=my_tool, inputs="text", outputs="text")
if __name__ == "__main__":
demo.launch(mcp_server=True)