support remote access using fastapi; add double click/scroll; enable local run omniparser
This commit is contained in:
12
demo/gradio/fast_api_demo.py
Normal file
12
demo/gradio/fast_api_demo.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from fastapi import FastAPI
|
||||
import gradio as gr
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
def greet(name):
|
||||
return f"Hello, {name}!"
|
||||
|
||||
gradio_interface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
||||
gradio_app = gr.routes.App.create_app(gradio_interface)
|
||||
|
||||
app.mount("/gradio", gradio_app)
|
||||
Reference in New Issue
Block a user