Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
andreea-popescu-reef committed Sep 5, 2024
1 parent 6b04b41 commit 735a91a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/compute_horde_prompt_gen/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,9 @@ def generate(
)

def decode(self, output):
return self.tokenizer.decode(output, skip_special_tokens=True)
if self.model_name == LLAMA3:
return self.tokenizer.decode(output, skip_special_tokens=True)
elif self.model_name == PHI3:
return self.tokenizer.batch_decode(output)
else:
raise ValueError(f"Unknown model {self.model_name}")
2 changes: 1 addition & 1 deletion src/compute_horde_prompt_gen/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def generate_prompts(
new_prompts = []
for j, sequence in enumerate(sequences):
output = model.decode(sequence)
log.info(f"{i=} output={output}")
log.info(f"\n\n{i=} output={output}\n\n")
generated_prompts = parse_output(output)
log.debug(f"{i=} sequence={j} {generated_prompts=} from {output=}")

Expand Down

0 comments on commit 735a91a

Please sign in to comment.