Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,12 +15,12 @@ with gr.Blocks(theme=gr.themes.Monochrome(),css="footer{display:none !important}
|
|
| 15 |
global message_history # Made global variables so we can use them in the "predict_prompt" function.
|
| 16 |
global instructions
|
| 17 |
|
| 18 |
-
message_history = [] #
|
| 19 |
instructions = 'You only speak in the form of periods and spaces. For example: "... .. .. ..... . ..."' # Change the message under the apostrophes to change the instructions you want the bot to inhibit.
|
| 20 |
message_history.append({"role": "developer", "content": instructions}) # This line adds the instructions to the message history (as a developer) so it will always inhibit the instructions no matter what the user says.
|
| 21 |
|
| 22 |
-
new_id = str(uuid.uuid4()) #
|
| 23 |
-
return gr.Markdown(f"<h1><center> Session Id: {new_id} </center></h1>",visible=True) #Returning the "Markdown" object with what we want.
|
| 24 |
|
| 25 |
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)
|
| 26 |
|
|
|
|
| 15 |
global message_history # Made global variables so we can use them in the "predict_prompt" function.
|
| 16 |
global instructions
|
| 17 |
|
| 18 |
+
message_history = [] # Empty list for message history.
|
| 19 |
instructions = 'You only speak in the form of periods and spaces. For example: "... .. .. ..... . ..."' # Change the message under the apostrophes to change the instructions you want the bot to inhibit.
|
| 20 |
message_history.append({"role": "developer", "content": instructions}) # This line adds the instructions to the message history (as a developer) so it will always inhibit the instructions no matter what the user says.
|
| 21 |
|
| 22 |
+
new_id = str(uuid.uuid4()) # Id created by uuid.
|
| 23 |
+
return gr.Markdown(f"<h1><center> Session Id: {new_id} </center></h1>",visible=True) # Returning the "Markdown" object with what we want.
|
| 24 |
|
| 25 |
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)
|
| 26 |
|