mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-22 14:49:29 +00:00
Replace stop clause with shorter, pythonic alternative (#7159)
Replace this comment with: - Description: Replace `if var is not None:` with `if var:`, a concise and pythonic alternative - Issue: N/A - Dependencies: None - Tag maintainer: Unsure - Twitter handle: N/A Signed-off-by: serhatgktp <efkan@ibm.com>
This commit is contained in:
parent
8045870a0f
commit
baf48d3583
@ -179,7 +179,7 @@ class HuggingFacePipeline(LLM):
|
||||
f"Got invalid task {self.pipeline.task}, "
|
||||
f"currently only {VALID_TASKS} are supported"
|
||||
)
|
||||
if stop is not None:
|
||||
if stop:
|
||||
# This is a bit hacky, but I can't figure out a better way to enforce
|
||||
# stop tokens when making calls to huggingface_hub.
|
||||
text = enforce_stop_tokens(text, stop)
|
||||
|
Loading…
Reference in New Issue
Block a user