You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently chatglm.cpp provides Pipeline for users. The Pipeline class provides a method called chat, which handles the system prompt, chat history, output formatting and more.
This is awesome. But for better flexibility, a low level API generate is also needed for integrate chatglm.cpp with other systems like text-generation-webui, LangChain, and Xinference.
Here are some detailed needs for the method generate (in Python):
defgenerate(
self,
prompt: str, # the full prompt passed directly to the modelstop: Optional[Union[str, List[str]]] = [], # stop wordsmax_tokens: int=128,
temperature: float=0.8,
top_p: float=0.95,
top_k: int=40,
**other_generate_kwargs
) ->Completion:
passclassCompletion(TypedDict):
text: strindex: intprompt_tokens: intcompletion_tokens: inttotal_tokens: intfinish_reason: Optional[str] # "stop" for eos met and "length" for max_tokens reached
The text was updated successfully, but these errors were encountered:
Currently
chatglm.cpp
providesPipeline
for users. ThePipeline
class provides a method calledchat
, which handles the system prompt, chat history, output formatting and more.This is awesome. But for better flexibility, a low level API
generate
is also needed for integratechatglm.cpp
with other systems liketext-generation-webui
,LangChain
, andXinference
.Here are some detailed needs for the method
generate
(in Python):The text was updated successfully, but these errors were encountered: