Skip to content

Commit

Permalink
Merge pull request #115 from kookmin-sw/feature/01
Browse files Browse the repository at this point in the history
feat: 문서 제목의 중복 제거
  • Loading branch information
scy6500 authored May 19, 2024
2 parents 4745a69 + 885c34d commit 28621e3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/app/utils/gpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def gpt_genereate(instruction: str, retrieved_doc: List[dict]):
is_valid, error_message = validate_template(template)
print(f"execution_cnt=1, {completion.usage.total_tokens=}")
if is_valid:
doc_title_list = [doc["title"] for doc in retrieved_doc]
doc_title_list = list(set([doc["title"] for doc in retrieved_doc]))
return template, description, doc_title_list, 1

# if there is no valid template
Expand Down Expand Up @@ -166,7 +166,7 @@ def gpt_generate_retry(instruction, retrieved_doc, error_message, wrong_template
is_valid, error_message = validate_template(template)
print(f"{execution_cnt=}, {completion.usage.total_tokens=}")
if is_valid:
doc_title_list = [doc["title"] for doc in retrieved_doc]
doc_title_list = list(set([doc["title"] for doc in retrieved_doc]))
return template, description, doc_title_list, execution_cnt

wrong_template = template
Expand Down

0 comments on commit 28621e3

Please sign in to comment.