Spaces:
Runtime error
Runtime error
Update api name
Browse filesFiles changed (2)
- app.py+3-3
- test_api.py+5-4
203 unmodified lines20420520620720720820921010 unmodified lines221222223224224225226227228229230231231232233234203 unmodified lines fn=try_text2int_preprocessed, inputs=inputs_text2int_preprocessed, outputs=outputs_text2int_preprocessed, api_name="text2int_preprocessed", api_name="text2int-preprocessed", )
examples_text2int_preprocessed = [10 unmodified lines import requests
requests.post( url="https://tangibleai-mathtext.hf.space/run/text2int_preprocessed", json={"data": ["one hundred forty five"]} url="https://tangibleai-mathtext.hf.space/run/text2int-preprocessed", json={"data": ["one hundred forty five"]} ).json() ```
Or using `curl`:
```bash curl -X POST https://tangibleai-mathtext.hf.space/run/text2int_preprocessed -H 'Content-Type: application/json' -d '{"data": ["one hundred forty five"]}' curl -X POST https://tangibleai-mathtext.hf.space/run/text2int-preprocessed -H 'Content-Type: application/json' -d '{"data": ["one hundred forty five"]}' ``` {bq_json}""" + f"{json.loads(BQ_JSON)['type']}")
6 unmodified lines7891010111213141514151617187 unmodified lines262728292930313224 unmodified lines575859606162636 unmodified linesimport httpxfrom os.path import exists
NUMBER_OF_CALLS = 10NUMBER_OF_CALLS = 20
headers = {"Content-Type": "application/json; charset=utf-8"}
base_url = "https://tangibleai-mathtext.hf.space/run/{endpoint}"# base_url = "http://localhost:7860/run/{endpoint}"# base_url = "https://tangibleai-mathtext.hf.space/run/{endpoint}"base_url = "http://localhost:7860/run/{endpoint}"
data_list_1 = { "endpoint": "text2int",7 unmodified lines}
data_list_2 = { "endpoint": "text2int_preprocessed", "endpoint": "text2int-preprocessed", "test_data": [ "one hundred forty five", "twenty thousand nine hundred fifty",24 unmodified lines return { "endpoint": url.split("/")[-1], "test data": data, "status code": response.status_code, "response": response.json().get("data"), "call number": call_number, "number of calls": number_of_calls,app.py+3-3
test_api.py+5-4