Skip to content

Commit

Permalink
Fix bug iin HuggingFaceEndpoint usage
Browse files Browse the repository at this point in the history
	1. Upgrade langchain hugginface from community to partner (community deprecated)
Added task=text-generation argument to fix error with tgi_endpoint

Signed-off-by: rbrugaro <[email protected]>
  • Loading branch information
rbrugaro committed Jan 30, 2025
1 parent 63c66a0 commit 3b996eb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion comps/llms/src/doc-summarization/integrations/tgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import os

import requests
from langchain_community.llms import HuggingFaceEndpoint
from langchain_huggingface import HuggingFaceEndpoint

from comps import CustomLogger, GeneratedDoc, OpeaComponent, OpeaComponentRegistry, ServiceType
from comps.cores.proto.api_protocol import DocSumChatCompletionRequest
Expand Down Expand Up @@ -71,6 +71,7 @@ async def invoke(self, input: DocSumChatCompletionRequest):
repetition_penalty=input.repetition_penalty if input.repetition_penalty else 1.03,
streaming=input.stream,
server_kwargs=server_kwargs,
task='text-generation',
)
result = await self.generate(input, self.client)

Expand Down

0 comments on commit 3b996eb

Please sign in to comment.