Spaces:
Runtime error
Runtime error
rodolfoocampo
commited on
Commit
•
5dcee28
1
Parent(s):
14d2ae1
Update app.py
Browse files
app.py
CHANGED
@@ -146,43 +146,41 @@ with gr.Blocks(css='''
|
|
146 |
return {continueStoryCol: gr.update(visible=False), newStoryCol: gr.update(visible=True), finishCol: gr.update(visible=False)}
|
147 |
|
148 |
|
149 |
-
with gr.Column(elem_id="main_col"):
|
150 |
-
|
151 |
-
|
152 |
-
character = gr.Textbox(label='Who will be the main character?', elem_id = 'theme', placeholder="i.e. Diego, an 11-year-old pirate")
|
153 |
-
|
154 |
-
|
155 |
-
messageHistory = gr.State()
|
156 |
-
|
157 |
-
beginBtn = gr.Button("Start!", elem_id="generate-btn")
|
158 |
-
|
159 |
-
story_output = gr.Textbox(label='Story')
|
160 |
-
|
161 |
-
blank = gr.Textbox(label='How will you fill the blank?', elem_id = 'blank')
|
162 |
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
with gr.Column(visible=False) as newStoryCol:
|
167 |
-
newStoryBtn = gr.Button("Create New Story", elem_id="new-story-btn")
|
168 |
-
|
169 |
-
with gr.Column(visible=True) as finishCol:
|
170 |
-
finishBtn = gr.Button("Finish Story", elem_id="finish-btn")
|
171 |
-
|
172 |
-
provideFeedbackBtn = gr.Button("Provide Feedback", elem_id="feedback-btn")
|
173 |
-
|
174 |
-
with gr.Column(visible=False) as feedbackForm:
|
175 |
-
gr.Radio(["1", "2", "3", "4", "5"], label="How would you rate the story")
|
176 |
-
feedback_text = gr.Textbox(label='Any other comments?')
|
177 |
-
submitFeedbackBtn = gr.Button("Submit Feedback", elem_id="submit-feedback-btn")
|
178 |
|
179 |
-
|
180 |
-
|
181 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
182 |
|
183 |
-
|
184 |
-
|
185 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
186 |
|
187 |
|
188 |
beginBtn.click(generateStory, inputs=[character], outputs=[story_output, messageHistory])
|
|
|
146 |
return {continueStoryCol: gr.update(visible=False), newStoryCol: gr.update(visible=True), finishCol: gr.update(visible=False)}
|
147 |
|
148 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
149 |
|
150 |
+
character = gr.Textbox(label='Who will be the main character?', elem_id = 'theme', placeholder="i.e. Diego, an 11-year-old pirate")
|
151 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
152 |
|
153 |
+
messageHistory = gr.State()
|
154 |
+
|
155 |
+
beginBtn = gr.Button("Start!", elem_id="generate-btn")
|
156 |
+
|
157 |
+
story_output = gr.Textbox(label='Story')
|
158 |
+
|
159 |
+
blank = gr.Textbox(label='How will you fill the blank?', elem_id = 'blank')
|
160 |
+
|
161 |
+
with gr.Column(visible=True) as continueStoryCol:
|
162 |
+
continueBtn = gr.Button("Continue Story", elem_id="continue-btn")
|
163 |
+
|
164 |
+
with gr.Column(visible=False) as newStoryCol:
|
165 |
+
newStoryBtn = gr.Button("Create New Story", elem_id="new-story-btn")
|
166 |
+
|
167 |
+
with gr.Column(visible=True) as finishCol:
|
168 |
+
finishBtn = gr.Button("Finish Story", elem_id="finish-btn")
|
169 |
|
170 |
+
provideFeedbackBtn = gr.Button("Provide Feedback", elem_id="feedback-btn")
|
171 |
+
|
172 |
+
with gr.Column(visible=False) as feedbackForm:
|
173 |
+
gr.Radio(["1", "2", "3", "4", "5"], label="How would you rate the story")
|
174 |
+
feedback_text = gr.Textbox(label='Any other comments?')
|
175 |
+
submitFeedbackBtn = gr.Button("Submit Feedback", elem_id="submit-feedback-btn")
|
176 |
+
|
177 |
+
with gr.Column(visible=False) as thankyou:
|
178 |
+
|
179 |
+
feedback_text = gr.HTML("<h2>Thanks for your feeback!</h2>")
|
180 |
+
|
181 |
+
with gr.Column(visible=False) as mesHistoryCol:
|
182 |
+
|
183 |
+
messageHistoryTextBox = gr.Textbox(label='How will you fill the blank?', elem_id = 'blank', value=messageHistory)
|
184 |
|
185 |
|
186 |
beginBtn.click(generateStory, inputs=[character], outputs=[story_output, messageHistory])
|