phyloforfun commited on
Commit
5b7117f
1 Parent(s): e86548c

file upload gallery

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -18,6 +18,7 @@ from vouchervision.vouchervision_main import voucher_vision, voucher_vision_OCR_
18
  from vouchervision.general_utils import test_GPU, get_cfg_from_full_path, summarize_expense_report, create_google_ocr_yaml_config, validate_dir
19
 
20
  PROMPTS_THAT_NEED_DOMAIN_KNOWLEDGE = ["Version 1","Version 1 PaLM 2"]
 
21
  COLORS_EXPENSE_REPORT = {
22
  'GPT_4': '#8fff66', # Bright Green
23
  'GPT_3_5': '#006400', # Dark Green
@@ -567,7 +568,8 @@ def display_image_gallery():
567
  # Loop through each image in the input list
568
  for image_path in st.session_state['input_list']:
569
  # Convert the image to base64 (assuming you have this utility function)
570
- base64_image = image_to_base64(image_path)
 
571
 
572
  # Embed the image with the determined width in the custom div
573
  img_html = f"""
@@ -1107,7 +1109,8 @@ def content_tab_settings():
1107
  ### Project
1108
  with col_project_1:
1109
  st.subheader('Run name')
1110
- st.session_state.config['leafmachine']['project']['run_name'] = st.text_input("Run name", st.session_state.config['leafmachine']['project'].get('run_name', ''),label_visibility='collapsed')
 
1111
  # st.session_state.config['leafmachine']['project']['dir_output'] = st.text_input("Output directory", st.session_state.config['leafmachine']['project'].get('dir_output', ''))
1112
  st.write("Run name will be the name of the final zipped folder.")
1113
 
@@ -1116,7 +1119,9 @@ def content_tab_settings():
1116
  st.session_state.config['leafmachine']['project']['dir_images_local'] = st.session_state['dir_uploaded_images'] #st.text_input("Input images directory", st.session_state.config['leafmachine']['project'].get('dir_images_local', ''))
1117
  # st.session_state.config['leafmachine']['project']['continue_run_from_partial_xlsx'] = st.text_input("Continue run from partially completed project XLSX", st.session_state.config['leafmachine']['project'].get('continue_run_from_partial_xlsx', ''), disabled=True)
1118
  st.subheader('LLM Version')
1119
- st.session_state.config['leafmachine']['LLM_version'] = st.selectbox("LLM version", ["GPT 4", "GPT 3.5", "Azure GPT 4", "Azure GPT 3.5", "PaLM 2"], index=["GPT 4", "GPT 3.5", "Azure GPT 4", "Azure GPT 3.5", "PaLM 2"].index(st.session_state.config['leafmachine'].get('LLM_version', 'Azure GPT 4')))
 
 
1120
  st.markdown("""***Note:*** GPT-4 is significantly more expensive than GPT-3.5 """)
1121
 
1122
  ### Prompt Version
 
18
  from vouchervision.general_utils import test_GPU, get_cfg_from_full_path, summarize_expense_report, create_google_ocr_yaml_config, validate_dir
19
 
20
  PROMPTS_THAT_NEED_DOMAIN_KNOWLEDGE = ["Version 1","Version 1 PaLM 2"]
21
+ LLM_VERSIONS = ["GPT 4", "GPT 3.5", "Azure GPT 4", "Azure GPT 3.5", "PaLM 2"]
22
  COLORS_EXPENSE_REPORT = {
23
  'GPT_4': '#8fff66', # Bright Green
24
  'GPT_3_5': '#006400', # Dark Green
 
568
  # Loop through each image in the input list
569
  for image_path in st.session_state['input_list']:
570
  # Convert the image to base64 (assuming you have this utility function)
571
+ img_file = Image.open(image_path)
572
+ base64_image = image_to_base64(img_file)
573
 
574
  # Embed the image with the determined width in the custom div
575
  img_html = f"""
 
1109
  ### Project
1110
  with col_project_1:
1111
  st.subheader('Run name')
1112
+ st.session_state.config['leafmachine']['project']['run_name'] = st.text_input("Run name", st.session_state.config['leafmachine']['project'].get('run_name', ''),
1113
+ label_visibility='collapsed')
1114
  # st.session_state.config['leafmachine']['project']['dir_output'] = st.text_input("Output directory", st.session_state.config['leafmachine']['project'].get('dir_output', ''))
1115
  st.write("Run name will be the name of the final zipped folder.")
1116
 
 
1119
  st.session_state.config['leafmachine']['project']['dir_images_local'] = st.session_state['dir_uploaded_images'] #st.text_input("Input images directory", st.session_state.config['leafmachine']['project'].get('dir_images_local', ''))
1120
  # st.session_state.config['leafmachine']['project']['continue_run_from_partial_xlsx'] = st.text_input("Continue run from partially completed project XLSX", st.session_state.config['leafmachine']['project'].get('continue_run_from_partial_xlsx', ''), disabled=True)
1121
  st.subheader('LLM Version')
1122
+ st.session_state.config['leafmachine']['LLM_version'] = st.selectbox("LLM version", LLM_VERSIONS,
1123
+ index=LLM_VERSIONS.index(st.session_state.config['leafmachine'].get('LLM_version', 'Azure GPT 4')),
1124
+ label_visibility='collapsed')
1125
  st.markdown("""***Note:*** GPT-4 is significantly more expensive than GPT-3.5 """)
1126
 
1127
  ### Prompt Version