Spaces:
Runtime error
Runtime error
Logan Zoellner
commited on
Commit
•
dc96994
1
Parent(s):
643d279
rebug
Browse files
app.py
CHANGED
@@ -45,6 +45,7 @@ def continue_story(prompt):
|
|
45 |
output = response.json()
|
46 |
print(f"If there was an error? Reason is : {output}")
|
47 |
|
|
|
48 |
|
49 |
#error handling
|
50 |
if "error" in output:
|
@@ -52,6 +53,9 @@ def continue_story(prompt):
|
|
52 |
#fallback method
|
53 |
output_tmp=fallbackResponse()
|
54 |
else:
|
|
|
|
|
|
|
55 |
output_tmp = output[0]['generated_text']
|
56 |
#truncate response at first newline
|
57 |
if "\n" in output_tmp:
|
@@ -61,6 +65,8 @@ def continue_story(prompt):
|
|
61 |
if ":" not in output_tmp:
|
62 |
output_tmp = "computer:"+output_tmp
|
63 |
|
|
|
|
|
64 |
|
65 |
|
66 |
#truncate story to last 6 lines
|
|
|
45 |
output = response.json()
|
46 |
print(f"If there was an error? Reason is : {output}")
|
47 |
|
48 |
+
|
49 |
|
50 |
#error handling
|
51 |
if "error" in output:
|
|
|
53 |
#fallback method
|
54 |
output_tmp=fallbackResponse()
|
55 |
else:
|
56 |
+
|
57 |
+
print("generated text was",output[0]['generated_text'])
|
58 |
+
|
59 |
output_tmp = output[0]['generated_text']
|
60 |
#truncate response at first newline
|
61 |
if "\n" in output_tmp:
|
|
|
65 |
if ":" not in output_tmp:
|
66 |
output_tmp = "computer:"+output_tmp
|
67 |
|
68 |
+
print("which was trimmed to",output_tmp)
|
69 |
+
|
70 |
|
71 |
|
72 |
#truncate story to last 6 lines
|