Update app_web.py
Browse files11 unmodified lines121314151617235 unmodified lines25325425525625725825926026126226311 unmodified linesfrom src.llm import list_modelsfrom src.stata import explain_from src.peri import APPROVED_OPTIONSfrom huggingface_hub import snapshot_download235 unmodified linesworking to expand the framework and you can submit a form to request. In the meantime please let me know if you would like to run the anlysis for one of the included countries."if qinit_result.get("value_chain", None)[0] not in APPROVED_OPTIONS.get('value_chains'):resolution_msg = f"It seems you are trying to run a PERI analysis for {qinit_result.get('value_chain', None)[0]} in {qinit_result.get('country', None)[0]}! Currently the PERI framework only supports analysis for the value chains listed below:\n\n -{'esc_char1'.join(APPROVED_OPTIONS.get('value_chains'))}\n\n We are continuously \working to expand the framework and you can submit a form to request. In the meantime please let me know if you would like to run the anlysis for one of the included countries."if qinit_result.get("investment", None)[0] not in APPROVED_OPTIONS.get('investments'):resolution_msg = f"It seems you are trying to run a PERI analysis for {qinit_result.get('investment', None)[0]} investemnt in {qinit_result.get('country', None)[0]}! Currently the PERI framework only supports analysis for the investment areas listed below:\n\n -{'esc_char1'.join(APPROVED_OPTIONS.get('investments'))}\n\n We are continuously \working to expand the framework and you can submit a form to request. In the meantime please let me know if you would like to run the anlysis for one of the included countries."if qinit_result.get("country", None)[0] in APPROVED_OPTIONS.get('countries') and (qinit_result.get('value_chain', None)[0] in APPROVED_OPTIONS.get('value_chains') or qinit_result.get('investment', None)[0] in APPROVED_OPTIONS.get('investments')):11 unmodified lines12131415161718235 unmodified lines25425525625725825926026126226326411 unmodified linesfrom src.llm import list_modelsfrom src.stata import explain_from src.peri import APPROVED_OPTIONSfrom src.prompts import dict_to_stringfrom huggingface_hub import snapshot_download235 unmodified linesworking to expand the framework and you can submit a form to request. In the meantime please let me know if you would like to run the anlysis for one of the included countries."if qinit_result.get("value_chain", None)[0] not in APPROVED_OPTIONS.get('value_chains'):resolution_msg = f"It seems you are trying to run a PERI analysis for {qinit_result.get('value_chain', None)[0]} in {qinit_result.get('country', None)[0]}! Currently the PERI framework only supports analysis for the value chains listed below:\n\n -{dict_to_string(APPROVED_OPTIONS.get('value_chains'))}\n\n We are continuously \working to expand the framework and you can submit a form to request. In the meantime please let me know if you would like to run the anlysis for one of the included countries."if qinit_result.get("investment", None)[0] not in APPROVED_OPTIONS.get('investments'):resolution_msg = f"It seems you are trying to run a PERI analysis for {qinit_result.get('investment', None)[0]} investemnt in {qinit_result.get('country', None)[0]}! Currently the PERI framework only supports analysis for the investment areas listed below:\n\n -{dict_to_string(APPROVED_OPTIONS.get('investments'))}\n\n We are continuously \working to expand the framework and you can submit a form to request. In the meantime please let me know if you would like to run the anlysis for one of the included countries."if qinit_result.get("country", None)[0] in APPROVED_OPTIONS.get('countries') and (qinit_result.get('value_chain', None)[0] in APPROVED_OPTIONS.get('value_chains') or qinit_result.get('investment', None)[0] in APPROVED_OPTIONS.get('investments')):
app_web.py+3-2