Spaces:
Runtime error
Runtime error
hobs
commited on
Commit
•
c25d79d
1
Parent(s):
ff06403
GBQ test
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import inspect
|
2 |
import json
|
|
|
3 |
import gradio as gr
|
4 |
from gradio import routes
|
5 |
import spacy
|
@@ -21,6 +22,8 @@ CHAR_MAPPING.update((str(i), word) for i, word in enumerate([" " + s + " " for s
|
|
21 |
|
22 |
TOKEN_MAPPING = dict(enumerate([" " + s + " " for s in ONES]))
|
23 |
|
|
|
|
|
24 |
|
25 |
def tokenize(text):
|
26 |
return text.split()
|
@@ -138,7 +141,7 @@ Or using `curl`:
|
|
138 |
```bash
|
139 |
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}'
|
140 |
```
|
141 |
-
""")
|
142 |
|
143 |
interface = gr.Interface(lambda: None, inputs=[textbox_input], outputs=[textbox_output])
|
144 |
|
|
|
1 |
import inspect
|
2 |
import json
|
3 |
+
import os
|
4 |
import gradio as gr
|
5 |
from gradio import routes
|
6 |
import spacy
|
|
|
22 |
|
23 |
TOKEN_MAPPING = dict(enumerate([" " + s + " " for s in ONES]))
|
24 |
|
25 |
+
BQ_JSON = os.environ['BQ_JSON']
|
26 |
+
|
27 |
|
28 |
def tokenize(text):
|
29 |
return text.split()
|
|
|
141 |
```bash
|
142 |
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}'
|
143 |
```
|
144 |
+
""" + f"{json.loads()['type']}")
|
145 |
|
146 |
interface = gr.Interface(lambda: None, inputs=[textbox_input], outputs=[textbox_output])
|
147 |
|