Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -84,6 +84,16 @@ def text_dict_adres(input):
|
|
| 84 |
|
| 85 |
return eval_result
|
| 86 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
|
| 88 |
def openai_response(ocr_input):
|
| 89 |
prompt = f"""Tabular Data Extraction
|
|
@@ -142,6 +152,9 @@ with gr.Blocks() as demo:
|
|
| 142 |
with gr.Row():
|
| 143 |
isim_soyisim = gr.Textbox(label="İsim Soyisim")
|
| 144 |
adres = gr.Textbox(label="Adres")
|
|
|
|
|
|
|
|
|
|
| 145 |
|
| 146 |
submit_button.click(get_parsed_address, inputs = img_area, outputs = open_api_text, api_name="upload_image")
|
| 147 |
|
|
@@ -155,6 +168,9 @@ with gr.Blocks() as demo:
|
|
| 155 |
open_api_text.change(text_dict_adres, [open_api_text], adres)
|
| 156 |
open_api_text.change(text_dict_tel, [open_api_text], tel)
|
| 157 |
open_api_text.change(text_dict_isim, [open_api_text], isim_soyisim)
|
|
|
|
|
|
|
|
|
|
| 158 |
|
| 159 |
# json_out = gr.Textbox()
|
| 160 |
# csv_out = gr.Textbox()
|
|
|
|
| 84 |
|
| 85 |
return eval_result
|
| 86 |
|
| 87 |
+
def text_dict_ickapi(input):
|
| 88 |
+
eval_result = ast.literal_eval(input)["ickapi_no"]
|
| 89 |
+
|
| 90 |
+
return eval_result
|
| 91 |
+
|
| 92 |
+
def text_dict_diskapi(input):
|
| 93 |
+
eval_result = ast.literal_eval(input)["diskapi_no"]
|
| 94 |
+
|
| 95 |
+
return eval_result
|
| 96 |
+
|
| 97 |
|
| 98 |
def openai_response(ocr_input):
|
| 99 |
prompt = f"""Tabular Data Extraction
|
|
|
|
| 152 |
with gr.Row():
|
| 153 |
isim_soyisim = gr.Textbox(label="İsim Soyisim")
|
| 154 |
adres = gr.Textbox(label="Adres")
|
| 155 |
+
with gr.Row():
|
| 156 |
+
diskapi_no = gr.Textbox(label="İç Kapı No")
|
| 157 |
+
ickapi_no = gr.Textbox(label="Dış Kapı No")
|
| 158 |
|
| 159 |
submit_button.click(get_parsed_address, inputs = img_area, outputs = open_api_text, api_name="upload_image")
|
| 160 |
|
|
|
|
| 168 |
open_api_text.change(text_dict_adres, [open_api_text], adres)
|
| 169 |
open_api_text.change(text_dict_tel, [open_api_text], tel)
|
| 170 |
open_api_text.change(text_dict_isim, [open_api_text], isim_soyisim)
|
| 171 |
+
open_api_text.change(text_dict_diskapi, [open_api_text], diskapi_no)
|
| 172 |
+
open_api_text.change(text_dict_ickapi, [open_api_text], ickapi_no)
|
| 173 |
+
|
| 174 |
|
| 175 |
# json_out = gr.Textbox()
|
| 176 |
# csv_out = gr.Textbox()
|