Skip to content

Commit

Permalink
Fixed Llama3.1 support
Browse files Browse the repository at this point in the history
  • Loading branch information
eisenzopf committed Jan 20, 2025
1 parent f0248fe commit 07ca7fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lapet/llama.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,14 @@ def post_process_output(self, prompt, output):

class Llama31ModelHandler():
def load_model_and_tokenizer(self, device, model_id):
tokenizer = AutoTokenizer.from_pretrained(model_id)
tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
if tokenizer.pad_token is None:
tokenizer.pad_token = tokenizer.eos_token

model = AutoModelForCausalLM.from_pretrained(
model_id,
device_map=device
device_map=device,
trust_remote_code=True
)

print(model_id + " loaded.")
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "lapet"
version = "0.8.4"
version = "0.8.5"
authors = [
{name = "Jonathan Eisenzopf", email = "[email protected]"},
]
Expand Down

0 comments on commit 07ca7fe

Please sign in to comment.