Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -83,6 +83,9 @@ with gr.Blocks(theme=gr.themes.Monochrome(),css="footer{display:none !important}
|
|
| 83 |
def return_sent():
|
| 84 |
return 'message sent, please wait...'
|
| 85 |
|
|
|
|
|
|
|
|
|
|
| 86 |
initial_message = "Please write your prompt here and press 'enter'" # Initial message for the User Interface (basically the message for the typing input area so change the message under the quotes if you want to change that)
|
| 87 |
Chatbot = gr.Chatbot(label="Anonymous User",layout=['bubble']) # Creating a gradio-chatbot User Interface with the label "Anonymous User".
|
| 88 |
|
|
@@ -90,5 +93,6 @@ with gr.Blocks(theme=gr.themes.Monochrome(),css="footer{display:none !important}
|
|
| 90 |
|
| 91 |
txt.submit(fn = return_sent, inputs = None, outputs = txt)
|
| 92 |
txt.submit(fn = predict_prompt, inputs = [txt, user_id], outputs = Chatbot, show_progress = 'hidden') # Adding the messages into the row with gradio.
|
|
|
|
| 93 |
|
| 94 |
chatblock.launch() # launch!
|
|
|
|
| 83 |
def return_sent():
|
| 84 |
return 'message sent, please wait...'
|
| 85 |
|
| 86 |
+
def return_placeholder():
|
| 87 |
+
return gr.Textbox(value = None, show_label = False, placeholder = initial_message, container = False)
|
| 88 |
+
|
| 89 |
initial_message = "Please write your prompt here and press 'enter'" # Initial message for the User Interface (basically the message for the typing input area so change the message under the quotes if you want to change that)
|
| 90 |
Chatbot = gr.Chatbot(label="Anonymous User",layout=['bubble']) # Creating a gradio-chatbot User Interface with the label "Anonymous User".
|
| 91 |
|
|
|
|
| 93 |
|
| 94 |
txt.submit(fn = return_sent, inputs = None, outputs = txt)
|
| 95 |
txt.submit(fn = predict_prompt, inputs = [txt, user_id], outputs = Chatbot, show_progress = 'hidden') # Adding the messages into the row with gradio.
|
| 96 |
+
Chatbot.change(fn = return_placeholder, inputs = None, outputs = txt)
|
| 97 |
|
| 98 |
chatblock.launch() # launch!
|