ko commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -16,6 +16,9 @@ with open("kosen.txt", encoding="utf-8") as f:
|
|
| 16 |
def rag_chat(message, history):
|
| 17 |
# 過去の会話を文字列化
|
| 18 |
conversation = ""
|
|
|
|
|
|
|
|
|
|
| 19 |
for msg in history:
|
| 20 |
role = msg["role"]
|
| 21 |
content = msg["content"]
|
|
|
|
| 16 |
def rag_chat(message, history):
|
| 17 |
# 過去の会話を文字列化
|
| 18 |
conversation = ""
|
| 19 |
+
if history is None:
|
| 20 |
+
history = []
|
| 21 |
+
|
| 22 |
for msg in history:
|
| 23 |
role = msg["role"]
|
| 24 |
content = msg["content"]
|