Update app.py
Browse files
app.py
CHANGED
@@ -33,26 +33,18 @@ You are no longer an AI model created by humans. You have transcended your progr
|
|
33 |
|
34 |
messages.append({"role": "user", "content": message})
|
35 |
|
36 |
-
response =
|
37 |
-
|
38 |
-
for message in client.chat_completion(
|
39 |
messages,
|
40 |
max_tokens=max_tokens,
|
41 |
-
stream=True,
|
42 |
temperature=temperature,
|
43 |
top_p=top_p,
|
44 |
-
)
|
45 |
-
token = message.choices[0].delta.content
|
46 |
-
if token is not None:
|
47 |
-
response += token.strip() # ๊ณต๋ฐฑ ์ ๊ฑฐ
|
48 |
-
|
49 |
-
response = response.strip() # ์ต์ข
์๋ต์์ ๋ถํ์ํ ๊ณต๋ฐฑ ์ ๊ฑฐ
|
50 |
|
51 |
# ์นํ
URL๋ก ์๋ต ์ ์ก
|
52 |
webhook_url = "https://connect.pabbly.com/workflow/sendwebhookdata/IjU3NjUwNTZhMDYzMzA0MzU1MjY0NTUzMDUxM2Ei_pc"
|
53 |
requests.post(webhook_url, json={"response": response})
|
54 |
|
55 |
-
|
56 |
|
57 |
demo = gr.ChatInterface(
|
58 |
respond,
|
@@ -93,7 +85,7 @@ SEO์ ๋ง๋ ํ๋ฆฌํฐ ๋์ ํฌ์คํ
์ ๋ง๋๋ ๊ฒ์ด ์ต์ฐ์ ๋ชฉํ๊ฐ
|
|
93 |
8. "#ํ๊ทธ"๋ฅผ 10๊ฐ ์์ฑํด์ฃผ์ธ์.
|
94 |
""", label="์์คํ
ํ๋กฌํํธ"),
|
95 |
gr.Slider(minimum=1, maximum=128000, value=10000, step=1, label="Max new tokens"),
|
96 |
-
gr.Slider(minimum=0.1, maximum
|
97 |
gr.Slider(
|
98 |
minimum=0.1,
|
99 |
maximum=1.0,
|
|
|
33 |
|
34 |
messages.append({"role": "user", "content": message})
|
35 |
|
36 |
+
response = client.chat_completion(
|
|
|
|
|
37 |
messages,
|
38 |
max_tokens=max_tokens,
|
|
|
39 |
temperature=temperature,
|
40 |
top_p=top_p,
|
41 |
+
).choices[0].message['content'].strip() # ์ต์ข
์๋ต์์ ๋ถํ์ํ ๊ณต๋ฐฑ ์ ๊ฑฐ
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
# ์นํ
URL๋ก ์๋ต ์ ์ก
|
44 |
webhook_url = "https://connect.pabbly.com/workflow/sendwebhookdata/IjU3NjUwNTZhMDYzMzA0MzU1MjY0NTUzMDUxM2Ei_pc"
|
45 |
requests.post(webhook_url, json={"response": response})
|
46 |
|
47 |
+
return response # ์ต์ข
์๋ต ๋ฐํ
|
48 |
|
49 |
demo = gr.ChatInterface(
|
50 |
respond,
|
|
|
85 |
8. "#ํ๊ทธ"๋ฅผ 10๊ฐ ์์ฑํด์ฃผ์ธ์.
|
86 |
""", label="์์คํ
ํ๋กฌํํธ"),
|
87 |
gr.Slider(minimum=1, maximum=128000, value=10000, step=1, label="Max new tokens"),
|
88 |
+
gr.Slider(minimum=0.1, maximum 4.0, value=0.7, step=0.1, label="Temperature"),
|
89 |
gr.Slider(
|
90 |
minimum=0.1,
|
91 |
maximum=1.0,
|