Spaces:
Runtime error
Runtime error
Update api name
Browse filesFiles changed (2)
- app.py+3-3
- test_api.py+5-4
203 unmodified lines20420520620720820921010 unmodified lines221222223224225226227228229230231232233234203 unmodified linesfn=try_text2int_preprocessed,inputs=inputs_text2int_preprocessed,outputs=outputs_text2int_preprocessed,api_name="text2int_preprocessed",)examples_text2int_preprocessed = [10 unmodified linesimport requestsrequests.post(url="https://tangibleai-mathtext.hf.space/run/text2int_preprocessed", json={"data": ["one hundred forty five"]}).json()```Or using `curl`:```bashcurl -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']}")203 unmodified lines20420520620720820921010 unmodified lines221222223224225226227228229230231232233234203 unmodified linesfn=try_text2int_preprocessed,inputs=inputs_text2int_preprocessed,outputs=outputs_text2int_preprocessed,api_name="text2int-preprocessed",)examples_text2int_preprocessed = [10 unmodified linesimport requestsrequests.post(url="https://tangibleai-mathtext.hf.space/run/text2int-preprocessed", json={"data": ["one hundred forty five"]}).json()```Or using `curl`:```bashcurl -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 lines7891011121314151617187 unmodified lines2627282930313224 unmodified lines5758596061626 unmodified linesimport httpxfrom os.path import existsNUMBER_OF_CALLS = 10headers = {"Content-Type": "application/json; charset=utf-8"}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","test_data": ["one hundred forty five","twenty thousand nine hundred fifty",24 unmodified linesreturn {"endpoint": url.split("/")[-1],"test data": data,"response": response.json().get("data"),"call number": call_number,"number of calls": number_of_calls,6 unmodified lines7891011121314151617187 unmodified lines2627282930313224 unmodified lines575859606162636 unmodified linesimport httpxfrom os.path import existsNUMBER_OF_CALLS = 20headers = {"Content-Type": "application/json; charset=utf-8"}# 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","test_data": ["one hundred forty five","twenty thousand nine hundred fifty",24 unmodified linesreturn {"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