Skip to content

Commit 1351647

Browse files
Merge pull request #1056 from pminervini/main
Update hf.py
2 parents 68b7245 + 075663b commit 1351647

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

dsp/modules/hf.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ def _generate(self, prompt, **kwargs):
168168
print("Failed to extract 'content' from the prompt.")
169169
inputs = self.tokenizer(prompt, return_tensors="pt").to(self.device)
170170

171+
if 'temperature' in kwargs and kwargs['temperature'] == 0.0:
172+
kwargs['do_sample'] = False
173+
171174
# print(kwargs)
172175
outputs = self.model.generate(**inputs, **kwargs)
173176
if self.drop_prompt_from_output:

0 commit comments

Comments
 (0)