Spaces:
Paused
Paused
Download app.py from andronasef/googleit-server: direct link, hf CLI and curl.
- Browser
- Download file 576 Bytes
-
https://huggingface.co/spaces/andronasef/googleit-server/resolve/main/app.py
- Command line
-
hf download hf://spaces/andronasef/googleit-server/app.py
-
curl -L -o app.py https://huggingface.co/spaces/andronasef/googleit-server/resolve/main/app.py
576 Bytes
| import gradio as gr | |
| from handler import handler | |
| def predict(action, query): | |
| try: | |
| return handler(action, query) | |
| except Exception as e: | |
| return {"error": e} | |
| with gr.Blocks() as app: | |
| action_type = gr.Dropdown(label="Type", value="Search", choices=[ | |
| "Search", "AutoSuggest"]) | |
| query = gr.Textbox(label="Query") | |
| output = gr.Textbox(label="Output Box") | |
| greet_btn = gr.Button("Action!") | |
| greet_btn.click( | |
| fn=predict, | |
| inputs=[action_type, query], outputs=output, api_name="api") | |
| app.launch() | |