Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -147,8 +147,10 @@ async def get_video_comments(video_id):
|
|
147 |
|
148 |
async def generate_replies(comments, transcript):
|
149 |
replies = []
|
|
|
150 |
for comment, _ in comments:
|
151 |
messages = [
|
|
|
152 |
{"role": "system", "content": f"λΉλμ€ μλ§: {transcript}"},
|
153 |
{"role": "user", "content": comment}
|
154 |
]
|
@@ -168,7 +170,6 @@ async def generate_replies(comments, transcript):
|
|
168 |
logging.debug(f'μμ±λ λ΅κΈ: {replies}')
|
169 |
return replies
|
170 |
|
171 |
-
|
172 |
async def send_webhook_data(session, chunk_data, chunk_number):
|
173 |
for attempt in range(MAX_RETRIES):
|
174 |
try:
|
|
|
147 |
|
148 |
async def generate_replies(comments, transcript):
|
149 |
replies = []
|
150 |
+
system_prompt = "λλ μ νλΈ λκΈμ λ΅κΈμ μμ±νλ μν μ΄λ€. λλ μμ£Ό μΉμ νκ³ μ¬μ΄ λ΄μ©μΌλ‘ μ λ¬Έμ μΈ κΈμ μμ±νμ¬μΌ νλ€. μμ±λ κΈμ λ§μ§λ§μ λ°λμ μΈμΏλ§κ³Ό 'OpenFreeAI'λΌκ³ μμ μ λ°νλΌ."
|
151 |
for comment, _ in comments:
|
152 |
messages = [
|
153 |
+
{"role": "system", "content": system_prompt},
|
154 |
{"role": "system", "content": f"λΉλμ€ μλ§: {transcript}"},
|
155 |
{"role": "user", "content": comment}
|
156 |
]
|
|
|
170 |
logging.debug(f'μμ±λ λ΅κΈ: {replies}')
|
171 |
return replies
|
172 |
|
|
|
173 |
async def send_webhook_data(session, chunk_data, chunk_number):
|
174 |
for attempt in range(MAX_RETRIES):
|
175 |
try:
|