Spaces:
Runtime error
Runtime error
seawolf2357
commited on
Commit
โข
ae155b0
1
Parent(s):
4a98e80
Update app.py
Browse files
app.py
CHANGED
@@ -116,8 +116,12 @@ async def generate_reply(comment, transcript):
|
|
116 |
์์ฑ๋ ๊ธ์ ๋ง์ง๋ง์ ๋ฐ๋์ ์ธ์ฟ๋ง๊ณผ OpenFreeAI ๋ผ๊ณ ์์ ์ ๋ฐํ๋ผ.
|
117 |
"""
|
118 |
prompt = f"{system_prompt}\n๋๊ธ: {comment}\n๋น๋์ค ์๋ง: {transcript}"
|
119 |
-
response = await hf_client(
|
120 |
-
|
|
|
|
|
|
|
|
|
121 |
|
122 |
async def create_thread_and_send_reply(message, video_id, comment, reply, session):
|
123 |
thread = await message.channel.create_thread(name=f"{message.author.name}์ ๋๊ธ ๋ต๊ธ", message=message)
|
|
|
116 |
์์ฑ๋ ๊ธ์ ๋ง์ง๋ง์ ๋ฐ๋์ ์ธ์ฟ๋ง๊ณผ OpenFreeAI ๋ผ๊ณ ์์ ์ ๋ฐํ๋ผ.
|
117 |
"""
|
118 |
prompt = f"{system_prompt}\n๋๊ธ: {comment}\n๋น๋์ค ์๋ง: {transcript}"
|
119 |
+
response = await hf_client.create_chat_completion(messages=[{"role": "system", "content": system_prompt}, {"role": "user", "content": comment}], max_tokens=150)
|
120 |
+
if response and response.choices:
|
121 |
+
return response.choices[0].text
|
122 |
+
else:
|
123 |
+
return "๋ต๋ณ์ ์์ฑํ ์ ์์ต๋๋ค."
|
124 |
+
|
125 |
|
126 |
async def create_thread_and_send_reply(message, video_id, comment, reply, session):
|
127 |
thread = await message.channel.create_thread(name=f"{message.author.name}์ ๋๊ธ ๋ต๊ธ", message=message)
|