Skip to content

Commit

Permalink
Refine LLM for No Rerank (#551)
Browse files Browse the repository at this point in the history
Signed-off-by: letonghan <letong.han@intel.com>
  • Loading branch information
letonghan authored Aug 22, 2024
1 parent c541d1d commit fe8ef3f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions comps/llms/text-generation/tgi/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,10 @@ async def llm_generate(input: Union[LLMParamsDoc, ChatCompletionRequest, Searche
logger.info("[ SearchedDoc ] input from retriever microservice")
prompt = input.initial_query
if input.retrieved_docs:
docs = [doc.text for doc in input.retrieved_docs]
if logflag:
logger.info(f"[ SearchedDoc ] retrieved docs: {input.retrieved_docs}")
for doc in input.retrieved_docs:
logger.info(f"[ SearchedDoc ] {doc}")
prompt = ChatTemplate.generate_rag_prompt(input.initial_query, input.retrieved_docs[0].text)
logger.info(f"[ SearchedDoc ] combined retrieved docs: {docs}")
prompt = ChatTemplate.generate_rag_prompt(input.initial_query, docs)
# use default llm parameters for inferencing
new_input = LLMParamsDoc(query=prompt)
if logflag:
Expand Down

0 comments on commit fe8ef3f

Please sign in to comment.