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 963785d commit f8d2ba9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/compute_horde_prompt_gen/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ def tokenize(prompt: str) -> str:
def tokenize_phi3(self, prompts: list[str], role: str) -> str:
inputs = [{"role": role, "content": prompt} for prompt in prompts]
inputs = self.tokenizer.apply_chat_template(
**inputs, add_generation_prompt=True, return_tensors="pt"
)
inputs, add_generation_prompt=True, return_tensors="pt"
).to("cuda")
return inputs

def generate(
Expand All @@ -99,6 +99,7 @@ def generate(
inputs = self.tokenize_phi3(prompts, role)
else:
raise ValueError(f"Unknown model {self.model_name}")
print(inputs)

return self.model.generate(
**inputs,
Expand Down

0 comments on commit f8d2ba9

Please sign in to comment.