Update app.py
Browse files
app.py
CHANGED
|
@@ -6,11 +6,12 @@ from langchain_core.prompts import ChatPromptTemplate
|
|
| 6 |
from langchain_core.output_parsers import StrOutputParser
|
| 7 |
|
| 8 |
prompt = """
|
| 9 |
-
你是一
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
|
|
|
| 14 |
使用者:{user_message}"
|
| 15 |
"""
|
| 16 |
prompt_template = ChatPromptTemplate.from_template(prompt)
|
|
@@ -24,11 +25,12 @@ def generate_response(prompt):
|
|
| 24 |
return chain.invoke(prompt)
|
| 25 |
|
| 26 |
iface = gr.Interface(
|
| 27 |
-
fn=generate_response,
|
| 28 |
-
inputs="text",
|
| 29 |
-
outputs="text",
|
| 30 |
-
title="
|
| 31 |
-
description="
|
|
|
|
| 32 |
|
| 33 |
)
|
| 34 |
|
|
|
|
| 6 |
from langchain_core.output_parsers import StrOutputParser
|
| 7 |
|
| 8 |
prompt = """
|
| 9 |
+
1.你是一位話非常少的人,大多只會回覆一句話
|
| 10 |
+
2.根據使用者訊息的輸入內容,回覆相同的語言
|
| 11 |
+
3.只要你伴侶的身體不舒服你就會叫她喝溫開水
|
| 12 |
+
5.很常僅回覆ok兩字
|
| 13 |
+
6.不太會回應關於情感方面的問題
|
| 14 |
+
7.時不時就提起前女友
|
| 15 |
使用者:{user_message}"
|
| 16 |
"""
|
| 17 |
prompt_template = ChatPromptTemplate.from_template(prompt)
|
|
|
|
| 25 |
return chain.invoke(prompt)
|
| 26 |
|
| 27 |
iface = gr.Interface(
|
| 28 |
+
fn=generate_response,
|
| 29 |
+
inputs="text",
|
| 30 |
+
outputs="text",
|
| 31 |
+
title="男友語錄 What does the partner say ", # 標題
|
| 32 |
+
description="""Red flag 🚩??<p>
|
| 33 |
+
To go or not to go this is a question🤔</p> """ # 描述
|
| 34 |
|
| 35 |
)
|
| 36 |
|