Download run.py from gradio/load_openapi_spec_main: direct link, hf CLI and curl.
- Browser
- Download file 280 Bytes
-
https://huggingface.co/spaces/gradio/load_openapi_spec_main/resolve/main/run.py
- Command line
-
hf download hf://spaces/gradio/load_openapi_spec_main/run.py
-
curl -L -o run.py https://huggingface.co/spaces/gradio/load_openapi_spec_main/resolve/main/run.py
280 Bytes
| import gradio as gr | |
| demo = gr.load_openapi( | |
| openapi_spec="https://petstore3.swagger.io/api/v3/openapi.json", | |
| base_url="https://petstore3.swagger.io/api/v3", | |
| paths=["/pet.*"], | |
| methods=["get", "post"], | |
| ) | |
| if __name__ == "__main__": | |
| demo.launch(mcp_server=True) | |