acknowledge user-provided maxStopWords in HuggingFaceTGI.ts

This commit is contained in:
Nate 2024-09-29 13:52:42 -07:00
parent 3d1f577975
commit c9324542fc

View file

@ -37,7 +37,10 @@ class HuggingFaceTGI extends BaseLLM {
top_k: options.topK,
presence_penalty: options.presencePenalty,
frequency_penalty: options.frequencyPenalty,
stop: options.stop?.slice(0, HuggingFaceTGI.MAX_STOP_TOKENS),
stop: options.stop?.slice(
0,
this.maxStopWords ?? HuggingFaceTGI.MAX_STOP_TOKENS,
),
};
return finalOptions;