phyloforfun commited on
Commit
0bf3a45
1 Parent(s): 524a99c

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
Files changed (1) hide show
  1. app.py +5 -7
app.py CHANGED
@@ -26,14 +26,12 @@ st.set_page_config(layout="wide", page_icon='img/icon.ico', page_title='VoucherV
26
 
27
  # Parse the 'is_hf' argument and set it in session state
28
  if 'is_hf' not in st.session_state:
29
- try:
30
- is_hf_os = os.getenv('IS_HF')
31
- if is_hf_os == 1 or is_hf_os == '1' or is_hf_os or is_hf_os == 'true' or is_hf_os == 'True':
32
- st.session_state['is_hf'] = True
33
- else:
34
- st.session_state['is_hf'] = False
35
- except:
36
  st.session_state['is_hf'] = False
 
37
  print(f"is_hf {st.session_state['is_hf']}")
38
 
39
 
 
26
 
27
  # Parse the 'is_hf' argument and set it in session state
28
  if 'is_hf' not in st.session_state:
29
+ is_hf_os = os.getenv('IS_HF', '').lower() # Get the environment variable and convert to lowercase for uniformity
30
+ if is_hf_os in ['1', 'true']: # Check against string representations of truthy values
31
+ st.session_state['is_hf'] = True
32
+ else:
 
 
 
33
  st.session_state['is_hf'] = False
34
+
35
  print(f"is_hf {st.session_state['is_hf']}")
36
 
37