Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -73,6 +73,11 @@ import os
|
|
73 |
|
74 |
# Function to get bot response
|
75 |
def format_prompt(state, bot_index, character_name, character_description):
|
|
|
|
|
|
|
|
|
|
|
76 |
prompt = f"{character_description}\n\n"
|
77 |
for message in state["history"][bot_index]:
|
78 |
if message['role'] == 'user':
|
|
|
73 |
|
74 |
# Function to get bot response
|
75 |
def format_prompt(state, bot_index, character_name, character_description):
|
76 |
+
if character_name is None or character_name.strip() == "":
|
77 |
+
character_name = "Ryan"
|
78 |
+
if character_description is None or character_description.strip() == "":
|
79 |
+
character_description = "Ryan is a college student who is always willing to help. He knows a lot about math and coding."
|
80 |
+
|
81 |
prompt = f"{character_description}\n\n"
|
82 |
for message in state["history"][bot_index]:
|
83 |
if message['role'] == 'user':
|