mirror of
https://github.com/hwchase17/langchain.git
synced 2025-07-08 14:05:16 +00:00
Remove some deprecated text generation parameters.
This commit is contained in:
parent
0fa4516ce4
commit
033b874701
@ -28,8 +28,6 @@ class NLPCloud(LLM):
|
|||||||
"""Language to use (multilingual addon)"""
|
"""Language to use (multilingual addon)"""
|
||||||
temperature: float = 0.7
|
temperature: float = 0.7
|
||||||
"""What sampling temperature to use."""
|
"""What sampling temperature to use."""
|
||||||
min_length: int = 1
|
|
||||||
"""The minimum number of tokens to generate in the completion."""
|
|
||||||
max_length: int = 256
|
max_length: int = 256
|
||||||
"""The maximum number of tokens to generate in the completion."""
|
"""The maximum number of tokens to generate in the completion."""
|
||||||
length_no_input: bool = True
|
length_no_input: bool = True
|
||||||
@ -46,14 +44,8 @@ class NLPCloud(LLM):
|
|||||||
"""The number of highest probability tokens to keep for top-k filtering."""
|
"""The number of highest probability tokens to keep for top-k filtering."""
|
||||||
repetition_penalty: float = 1.0
|
repetition_penalty: float = 1.0
|
||||||
"""Penalizes repeated tokens. 1.0 means no penalty."""
|
"""Penalizes repeated tokens. 1.0 means no penalty."""
|
||||||
length_penalty: float = 1.0
|
|
||||||
"""Exponential penalty to the length."""
|
|
||||||
do_sample: bool = True
|
|
||||||
"""Whether to use sampling (True) or greedy decoding."""
|
|
||||||
num_beams: int = 1
|
num_beams: int = 1
|
||||||
"""Number of beams for beam search."""
|
"""Number of beams for beam search."""
|
||||||
early_stopping: bool = False
|
|
||||||
"""Whether to stop beam search at num_beams sentences."""
|
|
||||||
num_return_sequences: int = 1
|
num_return_sequences: int = 1
|
||||||
"""How many completions to generate for each prompt."""
|
"""How many completions to generate for each prompt."""
|
||||||
|
|
||||||
@ -91,7 +83,6 @@ class NLPCloud(LLM):
|
|||||||
"""Get the default parameters for calling NLPCloud API."""
|
"""Get the default parameters for calling NLPCloud API."""
|
||||||
return {
|
return {
|
||||||
"temperature": self.temperature,
|
"temperature": self.temperature,
|
||||||
"min_length": self.min_length,
|
|
||||||
"max_length": self.max_length,
|
"max_length": self.max_length,
|
||||||
"length_no_input": self.length_no_input,
|
"length_no_input": self.length_no_input,
|
||||||
"remove_input": self.remove_input,
|
"remove_input": self.remove_input,
|
||||||
@ -100,10 +91,7 @@ class NLPCloud(LLM):
|
|||||||
"top_p": self.top_p,
|
"top_p": self.top_p,
|
||||||
"top_k": self.top_k,
|
"top_k": self.top_k,
|
||||||
"repetition_penalty": self.repetition_penalty,
|
"repetition_penalty": self.repetition_penalty,
|
||||||
"length_penalty": self.length_penalty,
|
|
||||||
"do_sample": self.do_sample,
|
|
||||||
"num_beams": self.num_beams,
|
"num_beams": self.num_beams,
|
||||||
"early_stopping": self.early_stopping,
|
|
||||||
"num_return_sequences": self.num_return_sequences,
|
"num_return_sequences": self.num_return_sequences,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user