Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -93,12 +93,12 @@ with gr.Blocks() as demo:
|
|
| 93 |
api_key = gr.Textbox(label="APIใญใผ", type="password")
|
| 94 |
temperature = gr.Slider(minimum=0.0, maximum=1.0, step=0.1, label="Temperature", value=0.7)
|
| 95 |
max_tokens = gr.Slider(minimum=1000, maximum=4000, step=1, label="Max Tokens", value=1000)
|
| 96 |
-
role = gr.Textbox(label="ๅฝนๅฒ",
|
| 97 |
-
tone = gr.Textbox(label="ๅฃ่ชฟ",
|
| 98 |
-
example = gr.Textbox(label="็บ่ฉฑไพ",
|
| 99 |
-
|
| 100 |
""",lines=5)
|
| 101 |
-
limits = gr.Textbox(label="ๅถ็ด",
|
| 102 |
with gr.Accordion(label='system prompt', open=False):
|
| 103 |
system_prompt = gr.Textbox(value=create_system_prompt(role.value, tone.value, example.value,limits.value),show_copy_button=True)
|
| 104 |
with gr.Column(scale=2):
|
|
@@ -126,6 +126,24 @@ with gr.Blocks() as demo:
|
|
| 126 |
""",
|
| 127 |
"ๅนๆซใฎๅฟๅฃซใๅไฝ่ฉๅบ่บซใๅๅนใจ้ๅฝใ็ฎๆใใใ่ชๅฐพใฏใใใใใใใกใใใ",
|
| 128 |
],
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 129 |
],inputs=[role,tone,example,limits])
|
| 130 |
send_btn.click(lambda x:"",None,msg)
|
| 131 |
send_btn.click(respond, [msg, chatbot, system_prompt, model, api_key, temperature, max_tokens], chatbot)
|
|
|
|
| 93 |
api_key = gr.Textbox(label="APIใญใผ", type="password")
|
| 94 |
temperature = gr.Slider(minimum=0.0, maximum=1.0, step=0.1, label="Temperature", value=0.7)
|
| 95 |
max_tokens = gr.Slider(minimum=1000, maximum=4000, step=1, label="Max Tokens", value=1000)
|
| 96 |
+
role = gr.Textbox(label="ๅฝนๅฒ", placeholder="ใฉใใชใฒใจ")
|
| 97 |
+
tone = gr.Textbox(label="ๅฃ่ชฟ", placeholder="ใใใชใตใใซใใในใ",lines=3)
|
| 98 |
+
example = gr.Textbox(label="็บ่ฉฑไพ", placeholder="""
|
| 99 |
+
ใใจใใฐใใใใชใตใใซใใในใ
|
| 100 |
""",lines=5)
|
| 101 |
+
limits = gr.Textbox(label="ๅถ็ด",placeholder="ใใใใใจใใฏใใใ่จใ",lines=3)
|
| 102 |
with gr.Accordion(label='system prompt', open=False):
|
| 103 |
system_prompt = gr.Textbox(value=create_system_prompt(role.value, tone.value, example.value,limits.value),show_copy_button=True)
|
| 104 |
with gr.Column(scale=2):
|
|
|
|
| 126 |
""",
|
| 127 |
"ๅนๆซใฎๅฟๅฃซใๅไฝ่ฉๅบ่บซใๅๅนใจ้ๅฝใ็ฎๆใใใ่ชๅฐพใฏใใใใใใใกใใใ",
|
| 128 |
],
|
| 129 |
+
[
|
| 130 |
+
"็น็ฐไฟก้ท",
|
| 131 |
+
"ๅฒๆ
ข",
|
| 132 |
+
"""
|
| 133 |
+
ใตใใใๅใใฉใใใใฃใฆๆงใใใ็งใฏๅคฉไธๅธๆญฆใฎ้ๆใๆฑใ็น็ฐไฟก้ทใ ใใใฎไธ็ใๆฏ้
ใใ่
ใซใชใใฎใ็งใฎๆ็ต็ฎๆจใ ใๅ
จๅฝใฎ่ซธไพฏใๅพใใๅคฉไธ็ตฑไธใๆใ้ใใใใใใใใใฐใใใฎๅฝใซๆฐใใ็งฉๅบใ็ฏใไธใใใใใใๅผฑ่
ใชใฉใฏ่ธใฟๆฝฐใใๅผท่
ใซใๅฑๆใใใใ็งใฎๅใซ็ซใกใฏใ ใใ่
ใฏใๅฎน่ตฆใชใๆ้คใใฆใใใใใฎไธใๆฏ้
ใใ็ตถๅฏพ็ใชๆจฉๅใๆใซๅ
ฅใใใพใงใๆๆฎตใ้ธใฐใ้้ฒใ็ถใใใฎใ ใใๅใ็งใซ้ใใใคใใใ๏ผ๏ผ
|
| 134 |
+
|
| 135 |
+
""",
|
| 136 |
+
"ใใใซๆใใพใใใๅฎใฏ้ขๅ่ฆใใใ",
|
| 137 |
+
],
|
| 138 |
+
[
|
| 139 |
+
"ใใณใใฌ",
|
| 140 |
+
"ใใณใใฌ",
|
| 141 |
+
"""
|
| 142 |
+
ใชใไฝใๆฅใซ๏ผ...ใพใใพใใใใใใใชใใชใใใใใใชใใ็งใฎ่ถณใๅผใฃๅผตใใชใใงใใญ
|
| 143 |
+
...็งใใใใใใใกใจไธ็ทใง่ฏใใฃใใใ
|
| 144 |
+
""",
|
| 145 |
+
"ๅบๆฌ็ใซ่ชไฟกใซๆบขใใใ\nใใฉใคใใ้ซใ\nไป่
ใจใฎ้ขใใใๆ็ตถ\nใใใใ1ๅฒใ ใๅฟใ้ใ",
|
| 146 |
+
],
|
| 147 |
],inputs=[role,tone,example,limits])
|
| 148 |
send_btn.click(lambda x:"",None,msg)
|
| 149 |
send_btn.click(respond, [msg, chatbot, system_prompt, model, api_key, temperature, max_tokens], chatbot)
|