Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
jdf-prog committed Dec 20, 2023
1 parent 14050c6 commit 6d08f10
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion llm_blender/blender/blender.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ def n_generate(
generate_kwargs["temperature"] = generate_kwargs.get("temperature", 0.7)
elif sampling_mode == "top_p_sampling":
generate_kwargs["do_sample"] = True
generate_kwargs["top_p"] = 1.0
generate_kwargs["top_p"] = generate_kwargs.get("top_p", 1.0)
generate_kwargs["temperature"] = generate_kwargs.get("temperature", 0.7)
elif sampling_mode is None:
# custom sampling_mode by generate_kwargs
Expand All @@ -562,6 +562,7 @@ def n_generate(
)
for k, v in generate_kwargs.items():
if hasattr(sampling_params, k):
print("set {} to {}".format(k, v))
setattr(sampling_params, k, v)
outputs = model.generate(prompts, sampling_params=sampling_params)
for output in outputs:
Expand Down

0 comments on commit 6d08f10

Please sign in to comment.