Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
Update app.py
Browse files
app.py
CHANGED
@@ -268,10 +268,9 @@ async def query_pdf(pdf_id: str, query: str) -> Dict[str, Any]:
|
|
268 |
|
269 |
# ์์คํ
ํ๋กฌํํธ ์ค๋น
|
270 |
system_prompt = """
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
๋ต๋ณ์ ๋ช
ํํ๊ณ ๊ฐ๊ฒฐํ๊ฒ ์์ฑํ๊ณ , ๊ด๋ จ ํ์ด์ง ๋ฒํธ๋ฅผ ์ธ์ฉํ์ธ์. ๋ฐ๋์ ๊ณต์ํ ๋งํฌ๋ก ์น์ ํ๊ฒ ์๋ตํ์ธ์.
|
275 |
"""
|
276 |
|
277 |
# gpt-4.1-mini ๋ชจ๋ธ ์ฌ์ฉ
|
@@ -283,7 +282,7 @@ async def query_pdf(pdf_id: str, query: str) -> Dict[str, Any]:
|
|
283 |
model="gpt-4.1-mini",
|
284 |
messages=[
|
285 |
{"role": "system", "content": system_prompt},
|
286 |
-
{"role": "user", "content": f"
|
287 |
],
|
288 |
temperature=0.7,
|
289 |
max_tokens=2048,
|
@@ -353,7 +352,7 @@ async def summarize_pdf(pdf_id: str) -> Dict[str, Any]:
|
|
353 |
response = openai_client.chat.completions.create(
|
354 |
model="gpt-4.1-mini",
|
355 |
messages=[
|
356 |
-
{"role": "system", "content": "๋ค์ PDF ๋ด์ฉ์ ๊ฐ๊ฒฐํ๊ฒ ์์ฝํด์ฃผ์ธ์. ํต์ฌ ์ฃผ์ ์ ์ฃผ์ ํฌ์ธํธ๋ฅผ ํฌํจํ ์์ฝ์ 500์ ์ด๋ด๋ก ์์ฑํด์ฃผ์ธ์."},
|
357 |
{"role": "user", "content": f"PDF ๋ด์ฉ:\n{all_text}"}
|
358 |
],
|
359 |
temperature=0.7,
|
|
|
268 |
|
269 |
# ์์คํ
ํ๋กฌํํธ ์ค๋น
|
270 |
system_prompt = """
|
271 |
+
The default language is set to English. However, please respond in the language used in the user's prompt (e.g., English, Korean, Japanese, Chinese, etc.).
|
272 |
+
You are an assistant that answers questions based solely on the provided PDF context. Please use only the information from the provided PDF content to respond. If relevant information is not available in the context, honestly reply with, "The requested information could not be found in the provided PDF."
|
273 |
+
Please ensure your responses are clear and concise, citing relevant page numbers. Always respond politely and courteously.
|
|
|
274 |
"""
|
275 |
|
276 |
# gpt-4.1-mini ๋ชจ๋ธ ์ฌ์ฉ
|
|
|
282 |
model="gpt-4.1-mini",
|
283 |
messages=[
|
284 |
{"role": "system", "content": system_prompt},
|
285 |
+
{"role": "user", "content": f"The default language is set to English.๋ค์ PDF ๋ด์ฉ์ ์ฐธ๊ณ ํ์ฌ ์ง๋ฌธ์ ๋ต๋ณํด์ฃผ์ธ์.\n\nPDF ๋ด์ฉ:\n{all_text}\n\n์ง๋ฌธ: {query}"}
|
286 |
],
|
287 |
temperature=0.7,
|
288 |
max_tokens=2048,
|
|
|
352 |
response = openai_client.chat.completions.create(
|
353 |
model="gpt-4.1-mini",
|
354 |
messages=[
|
355 |
+
{"role": "system", "content": "The default language is set to English. ๋ค์ PDF ๋ด์ฉ์ ๊ฐ๊ฒฐํ๊ฒ ์์ฝํด์ฃผ์ธ์. ํต์ฌ ์ฃผ์ ์ ์ฃผ์ ํฌ์ธํธ๋ฅผ ํฌํจํ ์์ฝ์ 500์ ์ด๋ด๋ก ์์ฑํด์ฃผ์ธ์."},
|
356 |
{"role": "user", "content": f"PDF ๋ด์ฉ:\n{all_text}"}
|
357 |
],
|
358 |
temperature=0.7,
|