phyloforfun commited on
Commit
3a1d033
1 Parent(s): eb76783

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
@@ -2299,7 +2299,7 @@ st.set_page_config(layout="wide", page_icon='img/icon.ico', page_title='VoucherV
2299
 
2300
  # Parse the 'is_hf' argument and set it in session state
2301
  if 'is_hf' not in st.session_state:
2302
- st.session_state['is_hf'] = True
2303
 
2304
 
2305
  #################################################################################################################################################
 
2299
 
2300
  # Parse the 'is_hf' argument and set it in session state
2301
  if 'is_hf' not in st.session_state:
2302
+ st.session_state['is_hf'] = False
2303
 
2304
 
2305
  #################################################################################################################################################
vouchervision/API_validation.py CHANGED
@@ -180,8 +180,10 @@ class APIvalidation:
180
  # temp_filename = temp.name
181
 
182
  # return temp_filename
 
 
183
  def get_google_credentials(self):
184
- creds_json_str = os.getenv('GOOGLE_SERVICE_ACCOUNT_JSON')
185
  credentials = service_account.Credentials.from_service_account_info(json.loads(creds_json_str))
186
  return credentials
187
 
 
180
  # temp_filename = temp.name
181
 
182
  # return temp_filename
183
+
184
+ # https://cloud.google.com/docs/authentication/provide-credentials-adc
185
  def get_google_credentials(self):
186
+ creds_json_str = os.getenv('GOOGLE_APPLICATION_CREDENTIALS')
187
  credentials = service_account.Credentials.from_service_account_info(json.loads(creds_json_str))
188
  return credentials
189
 
vouchervision/utils_VoucherVision.py CHANGED
@@ -435,9 +435,9 @@ class VoucherVision():
435
  # else:
436
  # print("Google API credentials not found.")
437
  def get_google_credentials(self):
438
- creds_json_str = os.getenv('GOOGLE_SERVICE_ACCOUNT_JSON')
439
- credentials = service_account.Credentials.from_service_account_info(json.loads(creds_json_str))
440
- return credentials
441
 
442
  def set_API_keys(self):
443
  if self.is_hf:
 
435
  # else:
436
  # print("Google API credentials not found.")
437
  def get_google_credentials(self):
438
+ creds_json_str = os.getenv('GOOGLE_APPLICATION_CREDENTIALS')
439
+ credentials = service_account.Credentials.from_service_account_info(json.loads(creds_json_str))
440
+ return credentials
441
 
442
  def set_API_keys(self):
443
  if self.is_hf: