Spaces:
Build error
Build error
Update interface
Browse files
app.py
CHANGED
@@ -151,33 +151,6 @@ with gr.Blocks() as html_block:
|
|
151 |
)
|
152 |
button_text2int.click(try_text2int, inputs=[textbox_input], outputs=[textbox_output])
|
153 |
button_text2int_preprocessed.click(try_text2int_preprocessed, inputs=[textbox_input], outputs=[textbox_output])
|
154 |
-
gr.Markdown(r"""
|
155 |
|
156 |
-
## API
|
157 |
|
158 |
-
You can select which function to run using the `fn_index` argument:
|
159 |
-
|
160 |
-
```python
|
161 |
-
import requests
|
162 |
-
|
163 |
-
requests.post(
|
164 |
-
url="https://Hobson-gradio-rest-api.hf.space/api/predict/", json={"data": ["one hundred forty-two"], "fn_index": 0}
|
165 |
-
).json()
|
166 |
-
```
|
167 |
-
|
168 |
-
Or using `curl`:
|
169 |
-
|
170 |
-
```bash
|
171 |
-
curl -X POST https://Hobson-gradio-rest-api.hf.space/api/predict/ -H 'Content-Type: application/json' -d '{"data": ["one hundred forty-two"], "fn_index": 0}'
|
172 |
-
```
|
173 |
-
""" + f"{json.loads(BQ_JSON)['type']}")
|
174 |
-
|
175 |
-
# interface = gr.Interface(lambda: None, inputs=[textbox_input], outputs=[textbox_output])
|
176 |
interface = gr.Interface(fn=try_text2int_preprocessed, inputs=[textbox_input], outputs=[textbox_output])
|
177 |
-
|
178 |
-
# html_block.input_components = interface.input_components
|
179 |
-
# html_block.output_components = interface.output_components
|
180 |
-
# html_block.examples = None
|
181 |
-
# html_block.predict_durations = []
|
182 |
-
#
|
183 |
-
# bapp = html_block.launch()
|
|
|
151 |
)
|
152 |
button_text2int.click(try_text2int, inputs=[textbox_input], outputs=[textbox_output])
|
153 |
button_text2int_preprocessed.click(try_text2int_preprocessed, inputs=[textbox_input], outputs=[textbox_output])
|
|
|
154 |
|
|
|
155 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
156 |
interface = gr.Interface(fn=try_text2int_preprocessed, inputs=[textbox_input], outputs=[textbox_output])
|
|
|
|
|
|
|
|
|
|
|
|
|
|