Spaces:
Runtime error
Runtime error
update
Browse files
app.py
CHANGED
|
@@ -14,17 +14,33 @@ def state_player(message, history):
|
|
| 14 |
message = message.lower()
|
| 15 |
response = block_inference(message)
|
| 16 |
history.append((message, response))
|
|
|
|
|
|
|
|
|
|
| 17 |
html_out = "<iframe src='https://docs.google.com/document/d/e/2PACX-1vQCMltKYqqUNbkM7yWIkzo7HKxCelusP1ocDKjjhRGv_4EHblWl_9hMIFBUdXSSdneTFo7dQUt70jN-/pub?embedded=true'></iframe>"
|
| 18 |
-
return
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
-
|
| 22 |
-
embed_docs = gr.HTML()
|
| 23 |
-
demo = gr.Interface(
|
| 24 |
-
state_player,
|
| 25 |
-
[text_editor, "state"],
|
| 26 |
-
[text_editor, "state", embed_docs],
|
| 27 |
-
allow_flagging="never",
|
| 28 |
-
)
|
| 29 |
-
if __name__ == "__main__":
|
| 30 |
-
demo.launch()
|
|
|
|
| 14 |
message = message.lower()
|
| 15 |
response = block_inference(message)
|
| 16 |
history.append((message, response))
|
| 17 |
+
return history, history
|
| 18 |
+
|
| 19 |
+
def google_docs_embed(dummy):
|
| 20 |
html_out = "<iframe src='https://docs.google.com/document/d/e/2PACX-1vQCMltKYqqUNbkM7yWIkzo7HKxCelusP1ocDKjjhRGv_4EHblWl_9hMIFBUdXSSdneTFo7dQUt70jN-/pub?embedded=true'></iframe>"
|
| 21 |
+
return html_out
|
| 22 |
+
|
| 23 |
+
#text_editor = gr.Textbox(lines=20, interactive=True, )
|
| 24 |
+
#embed_docs = gr.HTML()
|
| 25 |
+
#demo = gr.Interface(
|
| 26 |
+
# state_player,
|
| 27 |
+
# [text_editor, "state"],
|
| 28 |
+
# [text_editor, "state"],
|
| 29 |
+
# allow_flagging="never",
|
| 30 |
+
#)
|
| 31 |
+
#if __name__ == "__main__":
|
| 32 |
+
# demo.launch()
|
| 33 |
+
|
| 34 |
+
with gr.Blocks() as demo:
|
| 35 |
+
with gr.Row():
|
| 36 |
+
text_editor = gr.Textbox(lines=20, interactive=True, )
|
| 37 |
+
b1 = gr.Button("Generate")
|
| 38 |
+
b2 = gr.Button("Docs API")
|
| 39 |
+
with gr.Row():
|
| 40 |
+
in_dummy = gr.Textbox(visible=False, value='dummy')
|
| 41 |
+
embed_docs = gr.HTML()
|
| 42 |
+
|
| 43 |
+
b1.click(state_player, [text_editor, "state"], [text_editor, "state"])
|
| 44 |
+
b2.click(google_docs_embed,in_dummy, embed_docs)
|
| 45 |
|
| 46 |
+
demo.launch(debug=True, enable_queue=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|