Spaces:
Runtime error
Runtime error
A-baoYang
commited on
Commit
·
3349d08
1
Parent(s):
5b66c35
Bugfix
Browse files- api_calls.py +2 -2
- app.py +1 -0
api_calls.py
CHANGED
@@ -33,11 +33,11 @@ def api_ocr(image_filepath, model_provider):
|
|
33 |
"image_filepath": image_filepath,
|
34 |
"model_provider": model_provider
|
35 |
}
|
36 |
-
return call_api(api_path, api_params)
|
37 |
|
38 |
def api_model_cat_pain_assessment(user_input_image):
|
39 |
api_path = "model/cat-pain-assessment"
|
40 |
api_params = {
|
41 |
"user_input_image": user_input_image
|
42 |
}
|
43 |
-
return call_api(api_path, api_params)
|
|
|
33 |
"image_filepath": image_filepath,
|
34 |
"model_provider": model_provider
|
35 |
}
|
36 |
+
return call_api(api_path, api_params).get("text_result", "")
|
37 |
|
38 |
def api_model_cat_pain_assessment(user_input_image):
|
39 |
api_path = "model/cat-pain-assessment"
|
40 |
api_params = {
|
41 |
"user_input_image": user_input_image
|
42 |
}
|
43 |
+
return call_api(api_path, api_params).get("json_result", {})
|
app.py
CHANGED
@@ -64,6 +64,7 @@ def bot(query, history, data_array, file_paths, qa_prompt_tmpl, checkbox_replace
|
|
64 |
def draw_cat_pain_assessment_result(user_input_image):
|
65 |
if user_input_image:
|
66 |
json_result = api_model_cat_pain_assessment(user_input_image)
|
|
|
67 |
total_score = sum(list(json_result.values()))
|
68 |
df_result = pd.DataFrame(json_result, index=[0]).T.reset_index()
|
69 |
df_result.columns = ["a", "b"]
|
|
|
64 |
def draw_cat_pain_assessment_result(user_input_image):
|
65 |
if user_input_image:
|
66 |
json_result = api_model_cat_pain_assessment(user_input_image)
|
67 |
+
print(json_result)
|
68 |
total_score = sum(list(json_result.values()))
|
69 |
df_result = pd.DataFrame(json_result, index=[0]).T.reset_index()
|
70 |
df_result.columns = ["a", "b"]
|