테스트

This commit is contained in:
2026-01-28 21:24:22 +09:00
parent 5f828601ce
commit b2a8634fde
3 changed files with 61 additions and 41 deletions

11
app.py
View File

@@ -105,11 +105,8 @@ def query_select_summarize_stream(results, query, ai, min_similarity: float = 0.
else :
print('일반', results.get('documents'))
context_parts = [f'검색된 사용자 수는 {len(results.get('ids'))}']
docs = [f"{d[d.find('[이름]'): d.find('[', d.find('[이름]')+1)]} {d[d.find('[부서]'): d.find('[', d.find('[부서]')+1)]}" for d in results.get('documents')]
context = "\n".join(context_parts + docs)
docs = [f"[{d[d.find('[이름]'): d.find('[', d.find('[이름]')+1)]} {d[d.find('[부서]'): d.find('[', d.find('[부서]')+1)]}]" for d in results.get('documents')]
context = ",".join(context_parts + docs)
print(context)
# 모델 로드
@@ -148,7 +145,7 @@ def query_select_summarize_stream(results, query, ai, min_similarity: float = 0.
generation_kwargs = dict(
**model_inputs,
streamer=streamer,
max_new_tokens=3000,
max_new_tokens=600,
do_sample=True,
temperature=0.3,
top_p=0.9,
@@ -213,7 +210,7 @@ def query_summarize_simple(query: str) :
# conduct text completion
generated_ids = model.generate(
**model_inputs,
max_new_tokens=300,
max_new_tokens=600,
do_sample=True, # ✅ 샘플링 활성화
temperature=0.3,
top_p=0.9,