Spaces:
Running
Running
karubiniumu
commited on
Commit
•
13a0823
1
Parent(s):
c301bfe
Update app.py
Browse files
app.py
CHANGED
@@ -35,9 +35,9 @@ class Niwa_rag :
|
|
35 |
self.createPipe()
|
36 |
def createPipe(self):
|
37 |
user_message_template = """
|
38 |
-
|
39 |
|
40 |
-
|
41 |
{% for memory in memories %}
|
42 |
{{ memory.content }}
|
43 |
{% endfor %}
|
@@ -50,7 +50,7 @@ class Niwa_rag :
|
|
50 |
質問: {{query}}
|
51 |
回答:
|
52 |
"""
|
53 |
-
system_message = ChatMessage.from_system("
|
54 |
user_message = ChatMessage.from_user(user_message_template)
|
55 |
messages = [system_message, user_message]
|
56 |
|
@@ -123,10 +123,11 @@ def fn(q,history):
|
|
123 |
app = gr.ChatInterface(
|
124 |
fn,
|
125 |
type="messages",
|
|
|
126 |
textbox=gr.Textbox(placeholder='質問を記入して下さい',submit_btn=True),
|
127 |
-
|
128 |
)
|
129 |
|
130 |
|
131 |
if __name__ == "__main__":
|
132 |
-
app.launch(
|
|
|
35 |
self.createPipe()
|
36 |
def createPipe(self):
|
37 |
user_message_template = """
|
38 |
+
チャット履歴と提供された資料に基づいて、質問に答えてください。
|
39 |
|
40 |
+
チャット履歴:
|
41 |
{% for memory in memories %}
|
42 |
{{ memory.content }}
|
43 |
{% endfor %}
|
|
|
50 |
質問: {{query}}
|
51 |
回答:
|
52 |
"""
|
53 |
+
system_message = ChatMessage.from_system("あなたは、提供された資料とチャット履歴を使用して人間を支援するAIアシスタントです")
|
54 |
user_message = ChatMessage.from_user(user_message_template)
|
55 |
messages = [system_message, user_message]
|
56 |
|
|
|
123 |
app = gr.ChatInterface(
|
124 |
fn,
|
125 |
type="messages",
|
126 |
+
title='庭ファン Chatbot',
|
127 |
textbox=gr.Textbox(placeholder='質問を記入して下さい',submit_btn=True),
|
128 |
+
css_paths = './app.css'
|
129 |
)
|
130 |
|
131 |
|
132 |
if __name__ == "__main__":
|
133 |
+
app.launch()
|