umm-maybe commited on
Commit
cf17b13
·
1 Parent(s): 7fe3a25

Trying again

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -4,9 +4,10 @@ from transformers import pipeline
4
  # Load the pipeline
5
  tourModel = pipeline(model="manhan/GPT-Tour")
6
 
7
- def getTour(hh_income,hh_size,age,sex,edu,wrk):
8
  # person = a dict with person-level and hh-level attributes:
9
  person = {}
 
10
  if hh_income<0:
11
  _skip = 1 # nvm, bad data
12
  elif hh_income<4: # $25,000
@@ -19,6 +20,7 @@ def getTour(hh_income,hh_size,age,sex,edu,wrk):
19
  person['hh_inc'] = 'high'
20
  else: # over
21
  person['hh_inc'] = 'affluent'
 
22
  if hh_size == 1:
23
  person['hh_size'] = 'single'
24
  elif hh_size == 2:
@@ -27,6 +29,7 @@ def getTour(hh_income,hh_size,age,sex,edu,wrk):
27
  person['hh_size'] = 'small'
28
  else: # more than four people
29
  person['hh_size'] = 'large'
 
30
  if age < 18:
31
  person['age_grp'] = 'child'
32
  elif age < 45:
 
4
  # Load the pipeline
5
  tourModel = pipeline(model="manhan/GPT-Tour")
6
 
7
+ def getTour(income,size,years,sex,edu,wrk):
8
  # person = a dict with person-level and hh-level attributes:
9
  person = {}
10
+ hh_income = int(income)
11
  if hh_income<0:
12
  _skip = 1 # nvm, bad data
13
  elif hh_income<4: # $25,000
 
20
  person['hh_inc'] = 'high'
21
  else: # over
22
  person['hh_inc'] = 'affluent'
23
+ hh_size = int(size)
24
  if hh_size == 1:
25
  person['hh_size'] = 'single'
26
  elif hh_size == 2:
 
29
  person['hh_size'] = 'small'
30
  else: # more than four people
31
  person['hh_size'] = 'large'
32
+ age = int(years)
33
  if age < 18:
34
  person['age_grp'] = 'child'
35
  elif age < 45: