Skip to content

Commit b56201e

Browse files
authored
Merge pull request #30 from KEA-ChunSam/CS-413_Fix/챗봇_기능_중_결과_이상에러
챗봇 성능 개선
2 parents f61d793 + 99a6ca3 commit b56201e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

chat/chat_bot.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,7 @@ def _generate_natural_answer_with_llm(self, question: str, sql: str, result: str
486486
487487
사용자 질문: {question}
488488
컬럼 설명: {COLUMN_DESCRIPTIONS}
489+
쿼리 결과: {result}
489490
만약 matches 테이블을 이용해서 결과를 받아오면
490491
-team_id
491492
"1": "KIA",
@@ -499,7 +500,7 @@ def _generate_natural_answer_with_llm(self, question: str, sql: str, result: str
499500
"9": "NC",
500501
"10": "키움"
501502
를 참고해주세요.
502-
쿼리 결과: {result}
503+
503504
504505
Based on the above information, please write a natural and accurate Korean response to the user’s question.
505506
If the question is about player statistics, please use the column names in your answer.
@@ -510,7 +511,7 @@ def _generate_natural_answer_with_llm(self, question: str, sql: str, result: str
510511
"""
511512

512513
try:
513-
inputs = tokenizer(answer_prompt, return_tensors="pt", truncation=True, max_length=1024)
514+
inputs = tokenizer(answer_prompt, return_tensors="pt", truncation=True, max_length=2048)
514515
inputs = {k: v.to(model.device) for k, v in inputs.items()}
515516

516517
with torch.no_grad():

0 commit comments

Comments
 (0)