Spaces:
Running
Running
phyloforfun
commited on
Commit
•
1efd92a
1
Parent(s):
1a14ab7
Major update. Support for 15 LLMs, World Flora Online taxonomy validation, geolocation, 2 OCR methods, significant UI changes, stability improvements, consistent JSON parsing
Browse files
app.py
CHANGED
@@ -2195,14 +2195,6 @@ def sidebar_content():
|
|
2195 |
#################################################################################################################################################
|
2196 |
# Routing Function ##############################################################################################################################
|
2197 |
#################################################################################################################################################
|
2198 |
-
# Function to parse command line arguments
|
2199 |
-
def parse_command_line_argument(arg_name):
|
2200 |
-
for arg in sys.argv:
|
2201 |
-
if arg.startswith(f'--{arg_name}='):
|
2202 |
-
return arg.split('=')[1] == '1'
|
2203 |
-
return False
|
2204 |
-
|
2205 |
-
|
2206 |
|
2207 |
def main():
|
2208 |
with st.sidebar:
|
@@ -2248,14 +2240,7 @@ st.set_page_config(layout="wide", page_icon='img/icon.ico', page_title='VoucherV
|
|
2248 |
# Parse the 'is_hf' argument and set it in session state
|
2249 |
if 'is_hf' not in st.session_state:
|
2250 |
st.session_state['is_hf'] = True
|
2251 |
-
|
2252 |
-
is_hf_arg = parse_command_line_argument('is_hf')
|
2253 |
-
if is_hf_arg == '1':
|
2254 |
-
st.session_state['is_hf'] = True
|
2255 |
-
else:
|
2256 |
-
st.session_state['is_hf'] = False
|
2257 |
-
except:
|
2258 |
-
st.session_state['is_hf'] = True
|
2259 |
print(f"is_hf {st.session_state['is_hf']}")
|
2260 |
# Default YAML file path
|
2261 |
if 'config' not in st.session_state:
|
@@ -2382,11 +2367,12 @@ print(f"private_file3 {st.session_state['private_file']}")
|
|
2382 |
print(f"proceed_to_build_llm_prompt3 {st.session_state['proceed_to_build_llm_prompt']}")
|
2383 |
print(f"proceed_to_private3 {st.session_state['proceed_to_private']}")
|
2384 |
|
2385 |
-
if not st.session_state.private_file and not st.session_state['is_hf']:
|
2386 |
-
|
2387 |
-
elif st.session_state.proceed_to_build_llm_prompt:
|
|
|
2388 |
build_LLM_prompt_config()
|
2389 |
-
elif st.session_state.proceed_to_private and not st.session_state['is_hf']:
|
2390 |
-
|
2391 |
elif st.session_state.proceed_to_main:
|
2392 |
main()
|
|
|
2195 |
#################################################################################################################################################
|
2196 |
# Routing Function ##############################################################################################################################
|
2197 |
#################################################################################################################################################
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2198 |
|
2199 |
def main():
|
2200 |
with st.sidebar:
|
|
|
2240 |
# Parse the 'is_hf' argument and set it in session state
|
2241 |
if 'is_hf' not in st.session_state:
|
2242 |
st.session_state['is_hf'] = True
|
2243 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2244 |
print(f"is_hf {st.session_state['is_hf']}")
|
2245 |
# Default YAML file path
|
2246 |
if 'config' not in st.session_state:
|
|
|
2367 |
print(f"proceed_to_build_llm_prompt3 {st.session_state['proceed_to_build_llm_prompt']}")
|
2368 |
print(f"proceed_to_private3 {st.session_state['proceed_to_private']}")
|
2369 |
|
2370 |
+
# if not st.session_state.private_file and not st.session_state['is_hf']:
|
2371 |
+
# create_private_file()
|
2372 |
+
# elif st.session_state.proceed_to_build_llm_prompt:
|
2373 |
+
if st.session_state.proceed_to_build_llm_prompt:
|
2374 |
build_LLM_prompt_config()
|
2375 |
+
# elif st.session_state.proceed_to_private and not st.session_state['is_hf']:
|
2376 |
+
# create_private_file()
|
2377 |
elif st.session_state.proceed_to_main:
|
2378 |
main()
|