ruisp commited on
Commit
9bb38f8
1 Parent(s): b0ad896

Fixed condition for time frame.

Browse files
Files changed (1) hide show
  1. public_app.py +2 -2
public_app.py CHANGED
@@ -61,8 +61,8 @@ def get_chain(query, api_key=os.environ['OPENAI_API_KEY']):
61
  else:
62
  filter_date = json.loads(date_response)
63
  logging.info(f'Date parameters retrieved: {filter_date}')
64
- if (int(filter_date['year']) > 2023 and int(filter_date['month']) > 6) | (
65
- int(filter_date['year']) < 1936 and int(filter_date['month']) < 3):
66
  return 'Date is in the future or it is before the earliest of the publicly available records.' \
67
  'If you believe this is wrong, please flag below as appropriate.'
68
  filtered_context = search_with_filter(vs, query, init_k=200, step=500, target_k=7, filter_dict=filter_date)
 
61
  else:
62
  filter_date = json.loads(date_response)
63
  logging.info(f'Date parameters retrieved: {filter_date}')
64
+ if int(filter_date['year']) > 2023 and int(filter_date['month']) > 6 | (
65
+ int(filter_date['year']) == 1936 and int(filter_date['month']) < 3) | int(filter_date['year']) < 1936:
66
  return 'Date is in the future or it is before the earliest of the publicly available records.' \
67
  'If you believe this is wrong, please flag below as appropriate.'
68
  filtered_context = search_with_filter(vs, query, init_k=200, step=500, target_k=7, filter_dict=filter_date)