Update app.py
Browse files
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 |
-
|
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 "",
|
201 |
|
202 |
else:
|
203 |
output = "Did you forget to enter your Details? Please go to the User Info Tab and Input your data. "
|
204 |
-
|
205 |
-
return "",
|
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
|