Spaces:
Sleeping
Sleeping
Auto commit at 25-2025-08 14:40:50
Browse files
lily_llm_api/services/generation_service.py
CHANGED
|
@@ -284,7 +284,8 @@ def generate_sync(prompt: str, image_data_list: Optional[List[bytes]], max_lengt
|
|
| 284 |
|
| 285 |
# 2) ํ
์คํธ ๊ธธ์ด ์ธก์ (์ด๋ฏธ์ง ํ ํฐ ์ ์ธํ ํ๋กฌํํธ)
|
| 286 |
# ๋ฉํฐ๋ชจ๋ฌ์์๋ RAG ์ค๋ํซ์ ์ปจํ
์คํธ ๋ธ๋ก์ผ๋ก ๋ถ๋ฆฌํ์ฌ ํ
์คํธ ๊ธธ์ด๋ฅผ ์ฐ์
|
| 287 |
-
|
|
|
|
| 288 |
text_inputs = tokenizer(
|
| 289 |
base_text_prompt,
|
| 290 |
return_tensors="pt",
|
|
|
|
| 284 |
|
| 285 |
# 2) ํ
์คํธ ๊ธธ์ด ์ธก์ (์ด๋ฏธ์ง ํ ํฐ ์ ์ธํ ํ๋กฌํํธ)
|
| 286 |
# ๋ฉํฐ๋ชจ๋ฌ์์๋ RAG ์ค๋ํซ์ ์ปจํ
์คํธ ๋ธ๋ก์ผ๋ก ๋ถ๋ฆฌํ์ฌ ํ
์คํธ ๊ธธ์ด๋ฅผ ์ฐ์
|
| 287 |
+
context_block_for_len = f"[CONTEXT]\n{rag_snippet_short}[/CONTEXT]\n" if rag_snippet_short else ""
|
| 288 |
+
base_text_prompt = f"{context_block_for_len}Human: {prompt}\nAssistant:"
|
| 289 |
text_inputs = tokenizer(
|
| 290 |
base_text_prompt,
|
| 291 |
return_tensors="pt",
|