Nelly-43 commited on
Commit
8d43fc9
·
verified ·
1 Parent(s): 66a7714

Update app_web.py

Browse files
Files changed (1) hide show
  1. app_web.py +3 -2
app_web.py CHANGED
@@ -12,6 +12,7 @@ from src.verifier import verify_and_respond
12
  from src.llm import list_models
13
  from src.stata import explain_
14
  from src.peri import APPROVED_OPTIONS
 
15
 
16
  from huggingface_hub import snapshot_download
17
 
@@ -253,11 +254,11 @@ def render_chat():
253
  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."
254
 
255
  if qinit_result.get("value_chain", None)[0] not in APPROVED_OPTIONS.get('value_chains'):
256
- 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 \
257
  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."
258
 
259
  if qinit_result.get("investment", None)[0] not in APPROVED_OPTIONS.get('investments'):
260
- 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 \
261
  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."
262
 
263
  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')):
 
12
  from src.llm import list_models
13
  from src.stata import explain_
14
  from src.peri import APPROVED_OPTIONS
15
+ from src.prompts import dict_to_string
16
 
17
  from huggingface_hub import snapshot_download
18
 
 
254
  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."
255
 
256
  if qinit_result.get("value_chain", None)[0] not in APPROVED_OPTIONS.get('value_chains'):
257
+ 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 \
258
  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."
259
 
260
  if qinit_result.get("investment", None)[0] not in APPROVED_OPTIONS.get('investments'):
261
+ 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 \
262
  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."
263
 
264
  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')):