Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -24,8 +24,8 @@
|
|
| 24 |
# - MergedCell column_letter ์ค๋ฅ ์์ ์๋ฃ
|
| 25 |
# - ์์
์ ์ฑ๋ถ ์ ์ฒด ์คํฌ๋ฆฌ๋
|
| 26 |
# - ๋จ์ผ ์ฑ๋ถ ๊ฒ์
|
| 27 |
-
# -
|
| 28 |
-
# - ๋จ์ผ ์ฑ๋ถ ๊ฒ์
|
| 29 |
# - ์๋ณธ TOTAL ํ ์ ๊ฑฐ ํ ์ TOTAL ํ 1๊ฐ๋ง ์์ฑ
|
| 30 |
#
|
| 31 |
# SOURCE_ONLY_MODE=True ๊ธฐ์ค ํ์ ์์น
|
|
@@ -2367,7 +2367,7 @@ def process(countries,file,product_name="",use_mfds_live=False,live_max_terms=5,
|
|
| 2367 |
f"- ์ ์ฑ๋ถ ํ ์: {len(formula_df)}๊ฐ\n"
|
| 2368 |
f"- In formula ํฉ๊ณ: {format_amount(sum_formula_percent(formula_df))}%\n"
|
| 2369 |
f"- ์ฌ๊ฒํ ํ์ ์ฑ๋ถ: {len(regulatory_df)}๊ฐ\n"
|
| 2370 |
-
|
| 2371 |
"- ํ์ ๋ฐฉ์: GPT ํ์ ์์ / ์
๋ก๋๋ ๊ตญ๊ฐ๋ณ ํ์ผ rowยทline ์ง์ ๊ฒ์\n"
|
| 2372 |
f"- ๊ตญ๊ฐ๋ณ ์ธ๋ฑ์ค ์ํ: {' | '.join(index_messages)}\n"
|
| 2373 |
"- ์๋ ๊ฐ์ : ์ ์ฒด ์คํฌ๋ฆฌ๋์์ GPT/LLM ํธ์ถ ์ ๊ฑฐ\n"
|
|
@@ -3706,12 +3706,8 @@ def process_single_ingredient(
|
|
| 3706 |
"โ
๋จ์ผ ์ฑ๋ถ ๊ฒ์ ์๋ฃ\n"
|
| 3707 |
f"- ๊ฒ์์ด: {safe_str(single_query)}\n"
|
| 3708 |
f"- ์ ํ ๊ตญ๊ฐ ์: {len(countries)}๊ฐ\n"
|
| 3709 |
-
|
| 3710 |
-
|
| 3711 |
-
"- ํ์ ๋ฐฉ์: GPT ํ์ ์์, ์
๋ก๋๋ ๊ตญ๊ฐ๋ณ ํ์ผ row/line ์ง์ ๊ฒ์ + ์์ฝ์ฒ ์ฒดํฌ ON ์ ์ค์๊ฐ ๊ฒฐ๊ณผ ์ฌ์ฉ\n"
|
| 3712 |
-
"- ๊ธ์ง ์ฑ๋ถ: ํจ๋ ์ ๋ฌด์ ๋ฌด๊ดํ๊ฒ ๋ฐฐํฉ๊ธ์ง ์ฐ์ ํ์\n"
|
| 3713 |
-
"- ์์ฝ์ฒ ๋ธ๋ผ์ฐ์ ์คํจ ์์๋ ๊ตญ๊ฐ๋ณ ํ์ผ ๊ฒ์ ๊ฒฐ๊ณผ๋ ๊ณ์ ํ์๋จ\n"
|
| 3714 |
-
"- MFDS ๊ท์ ๋งค์นญ 0ํ์ ์์ฝ์ฒ์์ ๊ธ์ง/์ ํ ์์ธ๊ฐ ํ์ธ๋์ง ์์๋ค๋ ์๋ฏธ\n"
|
| 3715 |
)
|
| 3716 |
return result_df, msg
|
| 3717 |
|
|
@@ -3736,25 +3732,17 @@ DEFAULT_ADMIN_EMAIL = os.getenv("ADMIN_EMAIL", "jin2li@rebom.kr").strip().lower(
|
|
| 3736 |
DEFAULT_ADMIN_PASSWORD = os.getenv("ADMIN_PASSWORD", "qwer0515!")
|
| 3737 |
|
| 3738 |
|
| 3739 |
-
def process_with_auth(user, countries, file, product_name=""
|
| 3740 |
-
|
| 3741 |
-
return None, None, require_login_message()
|
| 3742 |
|
| 3743 |
-
return process(countries, file, product_name, use_mfds_live, live_max_terms, live_headless)
|
| 3744 |
-
|
| 3745 |
-
|
| 3746 |
-
def process_single_ingredient_with_auth(user, countries, single_query, single_amount, single_function, single_use_mfds_live=False):
|
| 3747 |
-
output_columns = ["๊ตญ๊ฐ", "๊ฒ์์ด", "๋ฐฐํฉํ๋/๊ธ์ง", "์์ธ ํ์ ", "ํ์ ์ถ์ฒ", "๋น๊ณ "]
|
| 3748 |
-
|
| 3749 |
-
if not is_approved_user(user):
|
| 3750 |
-
return pd.DataFrame(columns=output_columns), require_login_message()
|
| 3751 |
|
|
|
|
| 3752 |
return process_single_ingredient(
|
| 3753 |
countries,
|
| 3754 |
single_query,
|
| 3755 |
single_amount,
|
| 3756 |
single_function,
|
| 3757 |
-
|
| 3758 |
)
|
| 3759 |
|
| 3760 |
|
|
@@ -3770,17 +3758,17 @@ def auth_fn(username, password):
|
|
| 3770 |
# Gradio ๊ธฐ๋ณธ auth ์ฌ์ฉ ์ ๋ด๋ถ ๋ก๊ทธ์ธ ์ฒดํฌ ์ฐํ
|
| 3771 |
# ============================================================
|
| 3772 |
|
| 3773 |
-
def process_with_auth(user, countries, file, product_name=""
|
| 3774 |
-
return process(countries, file, product_name,
|
| 3775 |
|
| 3776 |
|
| 3777 |
-
def process_single_ingredient_with_auth(user, countries, single_query, single_amount, single_function
|
| 3778 |
return process_single_ingredient(
|
| 3779 |
countries,
|
| 3780 |
single_query,
|
| 3781 |
single_amount,
|
| 3782 |
single_function,
|
| 3783 |
-
|
| 3784 |
)
|
| 3785 |
|
| 3786 |
|
|
@@ -3806,17 +3794,17 @@ def auth_fn(username, password):
|
|
| 3806 |
return USER_DB.get(username) == password
|
| 3807 |
|
| 3808 |
|
| 3809 |
-
def process_with_auth(user, countries, file, product_name=""
|
| 3810 |
-
return process(countries, file, product_name,
|
| 3811 |
|
| 3812 |
|
| 3813 |
-
def process_single_ingredient_with_auth(user, countries, single_query, single_amount, single_function
|
| 3814 |
return process_single_ingredient(
|
| 3815 |
countries,
|
| 3816 |
single_query,
|
| 3817 |
single_amount,
|
| 3818 |
single_function,
|
| 3819 |
-
|
| 3820 |
)
|
| 3821 |
|
| 3822 |
|
|
@@ -3847,17 +3835,17 @@ def auth_fn(username, password):
|
|
| 3847 |
|
| 3848 |
|
| 3849 |
# Gradio ๊ธฐ๋ณธ auth๋ฅผ ํต๊ณผํ ์ฌ์ฉ์๋ ์ด๋ฏธ ์ธ์ฆ๋ ์ํ์ด๋ฏ๋ก ๋ด๋ถ ๋ก๊ทธ์ธ ์ฒดํฌ๋ฅผ ํ์ง ์๋๋ค.
|
| 3850 |
-
def process_with_auth(user, countries, file, product_name=""
|
| 3851 |
-
return process(countries, file, product_name,
|
| 3852 |
|
| 3853 |
|
| 3854 |
-
def process_single_ingredient_with_auth(user, countries, single_query, single_amount, single_function
|
| 3855 |
return process_single_ingredient(
|
| 3856 |
countries,
|
| 3857 |
single_query,
|
| 3858 |
single_amount,
|
| 3859 |
single_function,
|
| 3860 |
-
|
| 3861 |
)
|
| 3862 |
|
| 3863 |
|
|
@@ -3883,17 +3871,17 @@ def auth_fn(username, password):
|
|
| 3883 |
return USER_DB.get(username) == password
|
| 3884 |
|
| 3885 |
|
| 3886 |
-
def process_with_auth(user, countries, file, product_name=""
|
| 3887 |
-
return process(countries, file, product_name,
|
| 3888 |
|
| 3889 |
|
| 3890 |
-
def process_single_ingredient_with_auth(user, countries, single_query, single_amount, single_function
|
| 3891 |
return process_single_ingredient(
|
| 3892 |
countries,
|
| 3893 |
single_query,
|
| 3894 |
single_amount,
|
| 3895 |
single_function,
|
| 3896 |
-
|
| 3897 |
)
|
| 3898 |
|
| 3899 |
|
|
@@ -3919,17 +3907,17 @@ def auth_fn(username, password):
|
|
| 3919 |
return USER_DB.get(username) == password
|
| 3920 |
|
| 3921 |
|
| 3922 |
-
def process_with_auth(user, countries, file, product_name=""
|
| 3923 |
-
return process(countries, file, product_name,
|
| 3924 |
|
| 3925 |
|
| 3926 |
-
def process_single_ingredient_with_auth(user, countries, single_query, single_amount, single_function
|
| 3927 |
return process_single_ingredient(
|
| 3928 |
countries,
|
| 3929 |
single_query,
|
| 3930 |
single_amount,
|
| 3931 |
single_function,
|
| 3932 |
-
|
| 3933 |
)
|
| 3934 |
|
| 3935 |
|
|
@@ -3967,17 +3955,17 @@ def auth_fn(username, password):
|
|
| 3967 |
return USER_DB.get(username) == password
|
| 3968 |
|
| 3969 |
|
| 3970 |
-
def process_with_auth(user, countries, file, product_name=""
|
| 3971 |
-
return process(countries, file, product_name,
|
| 3972 |
|
| 3973 |
|
| 3974 |
-
def process_single_ingredient_with_auth(user, countries, single_query, single_amount, single_function
|
| 3975 |
return process_single_ingredient(
|
| 3976 |
countries,
|
| 3977 |
single_query,
|
| 3978 |
single_amount,
|
| 3979 |
single_function,
|
| 3980 |
-
|
| 3981 |
)
|
| 3982 |
|
| 3983 |
|
|
@@ -4430,9 +4418,6 @@ with gr.Blocks(css=custom_css) as demo:
|
|
| 4430 |
refresh=gr.Button("๐ ํด๋/๊ท์ ํ์ผ ์๋ก๊ณ ์นจ")
|
| 4431 |
product_name=gr.Textbox(label="์ ํ๋ช
/ PRODUCT NAME",placeholder="์: ๋ง๋ฐ์นดํฌ๋ฆผ")
|
| 4432 |
file=gr.File(label="์ ์ฑ๋ถ ํ์ผ ์
๋ก๋",file_types=[".xlsx",".xls",".pdf",".png",".jpg",".jpeg",".webp"])
|
| 4433 |
-
use_mfds_live=gr.Checkbox(label="์์ฝ์ฒ ์ฌ์ดํธ ์ค์๊ฐ ์กฐํ ์ฌ์ฉ(์ ์ฒด ์คํฌ๋ฆฌ๋์์๋ ์๋ ๋นํ์ฑํ)",value=False)
|
| 4434 |
-
live_max_terms=gr.Number(label="์์ฝ์ฒ ์ค์๊ฐ ์กฐํ ์ต๋ ๊ฒ์์ด ์(์ต๋ 5)",value=5,precision=0)
|
| 4435 |
-
live_headless=gr.Checkbox(label="์์ฝ์ฒ ์กฐํ ๋ธ๋ผ์ฐ์ ์จ๊น ๋ชจ๋",value=True)
|
| 4436 |
btn=gr.Button("๐ ๋ถ์ ์์",variant="primary")
|
| 4437 |
df_out=gr.Dataframe(label="๋ฏธ๋ฆฌ๋ณด๊ธฐ - Formula Ingredients Statement",wrap=True,interactive=False)
|
| 4438 |
file_out=gr.File(label="๊ฒฐ๊ณผ ๋ค์ด๋ก๋")
|
|
@@ -4443,7 +4428,7 @@ with gr.Blocks(css=custom_css) as demo:
|
|
| 4443 |
|
| 4444 |
btn.click(
|
| 4445 |
process_with_auth,
|
| 4446 |
-
inputs=[current_user,country,file,product_name
|
| 4447 |
outputs=[df_out,file_out,msg_out],
|
| 4448 |
)
|
| 4449 |
|
|
@@ -4456,7 +4441,6 @@ with gr.Blocks(css=custom_css) as demo:
|
|
| 4456 |
with gr.Row():
|
| 4457 |
single_amount=gr.Textbox(label="ํจ๋ %(w/w) ์ ํ ์
๋ ฅ",placeholder="์: 7.2")
|
| 4458 |
single_function=gr.Textbox(label="FUNCTION ์ ํ ์
๋ ฅ",placeholder="์: Sunscreen Agent")
|
| 4459 |
-
single_use_mfds_live=gr.Checkbox(label="์์ฝ์ฒ ์ฌ์ดํธ ์ค์๊ฐ ์กฐํ ์ฌ์ฉ(์ ์ฒด ์คํฌ๋ฆฌ๋์์๋ ์๋ ๋นํ์ฑํ)",value=False)
|
| 4460 |
single_btn=gr.Button("๐ ๋จ์ผ ์ฑ๋ถ ๊ฒ์ ์์",variant="primary")
|
| 4461 |
single_df_out=gr.Dataframe(label="๋จ์ผ ์ฑ๋ถ ๊ฒ์ ๊ฒฐ๊ณผ",wrap=True,interactive=False)
|
| 4462 |
single_msg_out=gr.Textbox(label="๊ฒ์ ์ํ / ๋ฉ์์ง",interactive=False,lines=8)
|
|
@@ -4465,7 +4449,7 @@ with gr.Blocks(css=custom_css) as demo:
|
|
| 4465 |
|
| 4466 |
single_btn.click(
|
| 4467 |
process_single_ingredient_with_auth,
|
| 4468 |
-
inputs=[current_user,single_country,single_query,single_amount,single_function
|
| 4469 |
outputs=[single_df_out,single_msg_out],
|
| 4470 |
)
|
| 4471 |
try:
|
|
|
|
| 24 |
# - MergedCell column_letter ์ค๋ฅ ์์ ์๋ฃ
|
| 25 |
# - ์์
์ ์ฑ๋ถ ์ ์ฒด ์คํฌ๋ฆฌ๋
|
| 26 |
# - ๋จ์ผ ์ฑ๋ถ ๊ฒ์
|
| 27 |
+
# - MFDS ์ค์๊ฐ ์กฐํ UI ์ ๊ฑฐ
|
| 28 |
+
# - ์ ์ฒด/๋จ์ผ ์ฑ๋ถ ๊ฒ์ ๋ชจ๋ ์
๋ก๋ ๊ตญ๊ฐ๋ณ ํ์ผ ์ง์ ๊ทผ๊ฑฐ ์ค์ฌ
|
| 29 |
# - ์๋ณธ TOTAL ํ ์ ๊ฑฐ ํ ์ TOTAL ํ 1๊ฐ๋ง ์์ฑ
|
| 30 |
#
|
| 31 |
# SOURCE_ONLY_MODE=True ๊ธฐ์ค ํ์ ์์น
|
|
|
|
| 2367 |
f"- ์ ์ฑ๋ถ ํ ์: {len(formula_df)}๊ฐ\n"
|
| 2368 |
f"- In formula ํฉ๊ณ: {format_amount(sum_formula_percent(formula_df))}%\n"
|
| 2369 |
f"- ์ฌ๊ฒํ ํ์ ์ฑ๋ถ: {len(regulatory_df)}๊ฐ\n"
|
| 2370 |
+
"- MFDS ์ํ: UI ์ ๊ฑฐ / ์ฌ์ฉ ์ ํจ\n"
|
| 2371 |
"- ํ์ ๋ฐฉ์: GPT ํ์ ์์ / ์
๋ก๋๋ ๊ตญ๊ฐ๋ณ ํ์ผ rowยทline ์ง์ ๊ฒ์\n"
|
| 2372 |
f"- ๊ตญ๊ฐ๋ณ ์ธ๋ฑ์ค ์ํ: {' | '.join(index_messages)}\n"
|
| 2373 |
"- ์๋ ๊ฐ์ : ์ ์ฒด ์คํฌ๋ฆฌ๋์์ GPT/LLM ํธ์ถ ์ ๊ฑฐ\n"
|
|
|
|
| 3706 |
"โ
๋จ์ผ ์ฑ๋ถ ๊ฒ์ ์๋ฃ\n"
|
| 3707 |
f"- ๊ฒ์์ด: {safe_str(single_query)}\n"
|
| 3708 |
f"- ์ ํ ๊ตญ๊ฐ ์: {len(countries)}๊ฐ\n"
|
| 3709 |
+
"- MFDS ์ํ: UI ์ ๊ฑฐ / ์ฌ์ฉ ์ ํจ\n"
|
| 3710 |
+
"- ํ์ ๋ฐฉ์: GPT ํ์ ์์, ์
๋ก๋๋ ๊ตญ๊ฐ๋ณ ํ์ผ row/line ์ง์ ๊ฒ์\n"
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3711 |
)
|
| 3712 |
return result_df, msg
|
| 3713 |
|
|
|
|
| 3732 |
DEFAULT_ADMIN_PASSWORD = os.getenv("ADMIN_PASSWORD", "qwer0515!")
|
| 3733 |
|
| 3734 |
|
| 3735 |
+
def process_with_auth(user, countries, file, product_name=""):
|
| 3736 |
+
return process(countries, file, product_name, False, 5, True)
|
|
|
|
| 3737 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3738 |
|
| 3739 |
+
def process_single_ingredient_with_auth(user, countries, single_query, single_amount, single_function):
|
| 3740 |
return process_single_ingredient(
|
| 3741 |
countries,
|
| 3742 |
single_query,
|
| 3743 |
single_amount,
|
| 3744 |
single_function,
|
| 3745 |
+
False,
|
| 3746 |
)
|
| 3747 |
|
| 3748 |
|
|
|
|
| 3758 |
# Gradio ๊ธฐ๋ณธ auth ์ฌ์ฉ ์ ๋ด๋ถ ๋ก๊ทธ์ธ ์ฒดํฌ ์ฐํ
|
| 3759 |
# ============================================================
|
| 3760 |
|
| 3761 |
+
def process_with_auth(user, countries, file, product_name=""):
|
| 3762 |
+
return process(countries, file, product_name, False, 5, True)
|
| 3763 |
|
| 3764 |
|
| 3765 |
+
def process_single_ingredient_with_auth(user, countries, single_query, single_amount, single_function):
|
| 3766 |
return process_single_ingredient(
|
| 3767 |
countries,
|
| 3768 |
single_query,
|
| 3769 |
single_amount,
|
| 3770 |
single_function,
|
| 3771 |
+
False,
|
| 3772 |
)
|
| 3773 |
|
| 3774 |
|
|
|
|
| 3794 |
return USER_DB.get(username) == password
|
| 3795 |
|
| 3796 |
|
| 3797 |
+
def process_with_auth(user, countries, file, product_name=""):
|
| 3798 |
+
return process(countries, file, product_name, False, 5, True)
|
| 3799 |
|
| 3800 |
|
| 3801 |
+
def process_single_ingredient_with_auth(user, countries, single_query, single_amount, single_function):
|
| 3802 |
return process_single_ingredient(
|
| 3803 |
countries,
|
| 3804 |
single_query,
|
| 3805 |
single_amount,
|
| 3806 |
single_function,
|
| 3807 |
+
False,
|
| 3808 |
)
|
| 3809 |
|
| 3810 |
|
|
|
|
| 3835 |
|
| 3836 |
|
| 3837 |
# Gradio ๊ธฐ๋ณธ auth๋ฅผ ํต๊ณผํ ์ฌ์ฉ์๋ ์ด๋ฏธ ์ธ์ฆ๋ ์ํ์ด๋ฏ๋ก ๋ด๋ถ ๋ก๊ทธ์ธ ์ฒดํฌ๋ฅผ ํ์ง ์๋๋ค.
|
| 3838 |
+
def process_with_auth(user, countries, file, product_name=""):
|
| 3839 |
+
return process(countries, file, product_name, False, 5, True)
|
| 3840 |
|
| 3841 |
|
| 3842 |
+
def process_single_ingredient_with_auth(user, countries, single_query, single_amount, single_function):
|
| 3843 |
return process_single_ingredient(
|
| 3844 |
countries,
|
| 3845 |
single_query,
|
| 3846 |
single_amount,
|
| 3847 |
single_function,
|
| 3848 |
+
False,
|
| 3849 |
)
|
| 3850 |
|
| 3851 |
|
|
|
|
| 3871 |
return USER_DB.get(username) == password
|
| 3872 |
|
| 3873 |
|
| 3874 |
+
def process_with_auth(user, countries, file, product_name=""):
|
| 3875 |
+
return process(countries, file, product_name, False, 5, True)
|
| 3876 |
|
| 3877 |
|
| 3878 |
+
def process_single_ingredient_with_auth(user, countries, single_query, single_amount, single_function):
|
| 3879 |
return process_single_ingredient(
|
| 3880 |
countries,
|
| 3881 |
single_query,
|
| 3882 |
single_amount,
|
| 3883 |
single_function,
|
| 3884 |
+
False,
|
| 3885 |
)
|
| 3886 |
|
| 3887 |
|
|
|
|
| 3907 |
return USER_DB.get(username) == password
|
| 3908 |
|
| 3909 |
|
| 3910 |
+
def process_with_auth(user, countries, file, product_name=""):
|
| 3911 |
+
return process(countries, file, product_name, False, 5, True)
|
| 3912 |
|
| 3913 |
|
| 3914 |
+
def process_single_ingredient_with_auth(user, countries, single_query, single_amount, single_function):
|
| 3915 |
return process_single_ingredient(
|
| 3916 |
countries,
|
| 3917 |
single_query,
|
| 3918 |
single_amount,
|
| 3919 |
single_function,
|
| 3920 |
+
False,
|
| 3921 |
)
|
| 3922 |
|
| 3923 |
|
|
|
|
| 3955 |
return USER_DB.get(username) == password
|
| 3956 |
|
| 3957 |
|
| 3958 |
+
def process_with_auth(user, countries, file, product_name=""):
|
| 3959 |
+
return process(countries, file, product_name, False, 5, True)
|
| 3960 |
|
| 3961 |
|
| 3962 |
+
def process_single_ingredient_with_auth(user, countries, single_query, single_amount, single_function):
|
| 3963 |
return process_single_ingredient(
|
| 3964 |
countries,
|
| 3965 |
single_query,
|
| 3966 |
single_amount,
|
| 3967 |
single_function,
|
| 3968 |
+
False,
|
| 3969 |
)
|
| 3970 |
|
| 3971 |
|
|
|
|
| 4418 |
refresh=gr.Button("๐ ํด๋/๊ท์ ํ์ผ ์๋ก๊ณ ์นจ")
|
| 4419 |
product_name=gr.Textbox(label="์ ํ๋ช
/ PRODUCT NAME",placeholder="์: ๋ง๋ฐ์นดํฌ๋ฆผ")
|
| 4420 |
file=gr.File(label="์ ์ฑ๋ถ ํ์ผ ์
๋ก๋",file_types=[".xlsx",".xls",".pdf",".png",".jpg",".jpeg",".webp"])
|
|
|
|
|
|
|
|
|
|
| 4421 |
btn=gr.Button("๐ ๋ถ์ ์์",variant="primary")
|
| 4422 |
df_out=gr.Dataframe(label="๋ฏธ๋ฆฌ๋ณด๊ธฐ - Formula Ingredients Statement",wrap=True,interactive=False)
|
| 4423 |
file_out=gr.File(label="๊ฒฐ๊ณผ ๋ค์ด๋ก๋")
|
|
|
|
| 4428 |
|
| 4429 |
btn.click(
|
| 4430 |
process_with_auth,
|
| 4431 |
+
inputs=[current_user,country,file,product_name],
|
| 4432 |
outputs=[df_out,file_out,msg_out],
|
| 4433 |
)
|
| 4434 |
|
|
|
|
| 4441 |
with gr.Row():
|
| 4442 |
single_amount=gr.Textbox(label="ํจ๋ %(w/w) ์ ํ ์
๋ ฅ",placeholder="์: 7.2")
|
| 4443 |
single_function=gr.Textbox(label="FUNCTION ์ ํ ์
๋ ฅ",placeholder="์: Sunscreen Agent")
|
|
|
|
| 4444 |
single_btn=gr.Button("๐ ๋จ์ผ ์ฑ๋ถ ๊ฒ์ ์์",variant="primary")
|
| 4445 |
single_df_out=gr.Dataframe(label="๋จ์ผ ์ฑ๋ถ ๊ฒ์ ๊ฒฐ๊ณผ",wrap=True,interactive=False)
|
| 4446 |
single_msg_out=gr.Textbox(label="๊ฒ์ ์ํ / ๋ฉ์์ง",interactive=False,lines=8)
|
|
|
|
| 4449 |
|
| 4450 |
single_btn.click(
|
| 4451 |
process_single_ingredient_with_auth,
|
| 4452 |
+
inputs=[current_user,single_country,single_query,single_amount,single_function],
|
| 4453 |
outputs=[single_df_out,single_msg_out],
|
| 4454 |
)
|
| 4455 |
try:
|