Spaces:
Runtime error
Runtime error
Logan Zoellner
commited on
Commit
•
e4d28ce
1
Parent(s):
7a59307
fallback if don't get what expected
Browse files
app.py
CHANGED
@@ -60,10 +60,10 @@ def continue_story(prompt,story):
|
|
60 |
if "\n" in output_tmp:
|
61 |
idx = output_tmp.find('\n')
|
62 |
output_tmp = output_tmp[:idx]
|
63 |
-
#check if response starts with "computer:", if not
|
64 |
-
if
|
65 |
-
output_tmp = "computer:"+
|
66 |
-
|
67 |
print("which was trimmed to",output_tmp)
|
68 |
|
69 |
#truncate story to last 6 lines
|
|
|
60 |
if "\n" in output_tmp:
|
61 |
idx = output_tmp.find('\n')
|
62 |
output_tmp = output_tmp[:idx]
|
63 |
+
#check if response starts with "computer:", if not use fallback
|
64 |
+
if not output_tmp.startswith("computer:"):
|
65 |
+
output_tmp = "computer:"+fallbackResponse()
|
66 |
+
|
67 |
print("which was trimmed to",output_tmp)
|
68 |
|
69 |
#truncate story to last 6 lines
|