ECUiVADE commited on
Commit
e67c000
1 Parent(s): 5931ff7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -153,7 +153,7 @@ def upload_to_google_drive():
153
 
154
  def generate(prompt, history):
155
 
156
- global isFirstRun,initContext,Name,Occupation,Ethnicity,Gender,Age,context,YearsOfExp
157
 
158
  #if not len(Name) == 0 and not len(Occupation) == 0 and not len(Ethnicity) == 0 and not len(Gender) == 0 and not len(Age) == 0 and not len(YearsOfExp):
159
  if agreed:
@@ -187,7 +187,7 @@ def generate(prompt, history):
187
 
188
  # yield response
189
 
190
- history.append((prompt,response))
191
  if not isFirstRun:
192
  chat_log_history.append({"user": prompt, "bot": response})
193
  upload_to_google_drive()
@@ -197,12 +197,12 @@ def generate(prompt, history):
197
  context += response
198
 
199
  print (context)
200
- return "", history
201
 
202
  else:
203
  output = "Did you forget to enter your Details? Please go to the User Info Tab and Input your data. "
204
- history.append((prompt,output))
205
- return "", history
206
 
207
  def submit_user_info(name,occupation,yearsofexp,ethnicity,gender,age):
208
  global Name, Occupation,Ethnicity,Gender,Age,chat_log_name,YearsOfExp
 
153
 
154
  def generate(prompt, history):
155
 
156
+ global isFirstRun,initContext,Name,Occupation,Ethnicity,Gender,Age,context,YearsOfExp,chat_history
157
 
158
  #if not len(Name) == 0 and not len(Occupation) == 0 and not len(Ethnicity) == 0 and not len(Gender) == 0 and not len(Age) == 0 and not len(YearsOfExp):
159
  if agreed:
 
187
 
188
  # yield response
189
 
190
+ chat_history.append((prompt,response))
191
  if not isFirstRun:
192
  chat_log_history.append({"user": prompt, "bot": response})
193
  upload_to_google_drive()
 
197
  context += response
198
 
199
  print (context)
200
+ return "", chat_history
201
 
202
  else:
203
  output = "Did you forget to enter your Details? Please go to the User Info Tab and Input your data. "
204
+ chat_history.append((prompt,output))
205
+ return "", chat_history
206
 
207
  def submit_user_info(name,occupation,yearsofexp,ethnicity,gender,age):
208
  global Name, Occupation,Ethnicity,Gender,Age,chat_log_name,YearsOfExp