Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ollama Chat Templates #582

Merged
merged 107 commits into from
Jun 12, 2024
Merged
Changes from 1 commit
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
7df08c4
Update llama.py
danielhanchen May 19, 2024
ba5b6ce
offload
danielhanchen May 19, 2024
a07057e
Update llama.py
danielhanchen May 19, 2024
4be9063
Update llama.py
danielhanchen May 19, 2024
3dc3d3f
Update llama.py
danielhanchen May 19, 2024
f1cc1e8
Update llama.py
danielhanchen May 19, 2024
5cb531a
Update llama.py
danielhanchen May 19, 2024
6bd8e60
Update llama.py
danielhanchen May 19, 2024
d1d57ff
Update llama.py
danielhanchen May 19, 2024
7470f67
continued pretraining trainer
danielhanchen May 20, 2024
da9c1a6
Update trainer.py
danielhanchen May 20, 2024
2c68f56
Update trainer.py
danielhanchen May 20, 2024
217bf9d
Update trainer.py
danielhanchen May 20, 2024
6e85384
Update trainer.py
danielhanchen May 21, 2024
77f9c51
is_bfloat16_supported
danielhanchen May 21, 2024
c0e1d27
Update __init__.py
danielhanchen May 21, 2024
2b23b93
Update README.md
danielhanchen May 21, 2024
902e23a
Update llama.py
danielhanchen May 21, 2024
98f41ce
Merge branch 'main' into nightly
danielhanchen May 22, 2024
3193cac
is_bfloat16_supported
danielhanchen May 22, 2024
dfeaf4b
Update __init__.py
danielhanchen May 22, 2024
1e84090
Mistral v3
danielhanchen May 22, 2024
f63f32b
Merge branch 'main' into nightly
danielhanchen May 23, 2024
57ad8e7
Phi 3 medium
danielhanchen May 23, 2024
2b994b2
Update chat_templates.py
danielhanchen May 23, 2024
ff8171f
Update chat_templates.py
danielhanchen May 23, 2024
5ca8b58
Phi-3
danielhanchen May 23, 2024
98c2e81
Merge branch 'main' into nightly
danielhanchen May 23, 2024
3817660
Merge branch 'main' into nightly
danielhanchen May 23, 2024
f858145
Merge branch 'main' into nightly
danielhanchen May 24, 2024
a1328f6
Update save.py
danielhanchen May 24, 2024
fb29673
Update README.md
shimmyshimmer May 25, 2024
fa85556
Untrained tokens
danielhanchen May 26, 2024
c511aca
Update tokenizer_utils.py
danielhanchen May 26, 2024
35e7355
Update tokenizer_utils.py
danielhanchen May 26, 2024
cc0bf44
Update tokenizer_utils.py
danielhanchen May 26, 2024
674ba66
Update tokenizer_utils.py
danielhanchen May 26, 2024
9823f52
Update tokenizer_utils.py
danielhanchen May 26, 2024
c0c761b
Update tokenizer_utils.py
danielhanchen May 26, 2024
e2850c0
Update tokenizer_utils.py
danielhanchen May 26, 2024
8e12780
Update tokenizer_utils.py
danielhanchen May 26, 2024
6f1855e
Update tokenizer_utils.py
danielhanchen May 26, 2024
d27b173
Update tokenizer_utils.py
danielhanchen May 26, 2024
7bf7399
Update tokenizer_utils.py
danielhanchen May 26, 2024
31ecef9
Update tokenizer_utils.py
danielhanchen May 26, 2024
b67d93f
Update tokenizer_utils.py
danielhanchen May 26, 2024
e874ccd
Update tokenizer_utils.py
danielhanchen May 26, 2024
d7b54ff
Update tokenizer_utils.py
danielhanchen May 27, 2024
5a4a512
Update tokenizer_utils.py
danielhanchen May 27, 2024
82c040e
Update tokenizer_utils.py
danielhanchen May 27, 2024
8e227b2
Update tokenizer_utils.py
danielhanchen May 27, 2024
250d386
Update tokenizer_utils.py
danielhanchen May 27, 2024
e6db3ba
Update llama.py
danielhanchen May 27, 2024
e673fa2
Update tokenizer_utils.py
danielhanchen May 27, 2024
222b835
Update tokenizer_utils.py
danielhanchen May 27, 2024
6404aa5
Update tokenizer_utils.py
danielhanchen May 27, 2024
cfea7b2
Update tokenizer_utils.py
danielhanchen May 27, 2024
083e5ba
Update save.py
danielhanchen May 27, 2024
6f2565c
Update save.py
danielhanchen May 27, 2024
c19b04e
Update save.py
danielhanchen May 27, 2024
64b12a2
checkpoint
danielhanchen May 28, 2024
4cd5a8a
Merge branch 'main' into nightly
danielhanchen May 28, 2024
196faec
Update _utils.py
danielhanchen May 28, 2024
235be40
Update tokenizer_utils.py
danielhanchen May 29, 2024
cf9090a
Update tokenizer_utils.py
danielhanchen May 29, 2024
1fb1110
Update tokenizer_utils.py
danielhanchen May 29, 2024
d1bd60c
Update llama.py
danielhanchen May 30, 2024
732ead0
accelerate
danielhanchen May 30, 2024
359ae5c
Update _utils.py
danielhanchen May 30, 2024
8dcfad3
Update _utils.py
danielhanchen May 30, 2024
2bafc57
Update _utils.py
danielhanchen May 30, 2024
90f6311
Update _utils.py
danielhanchen May 30, 2024
7b84ff7
Update _utils.py
danielhanchen May 30, 2024
60f4b9a
Update _utils.py
danielhanchen May 30, 2024
3ebe5a5
Update _utils.py
danielhanchen May 30, 2024
7bbc8ce
Update tokenizer_utils.py
danielhanchen May 30, 2024
6f5c84c
train_dataloader
danielhanchen May 30, 2024
0d269ca
Update llama.py
danielhanchen May 30, 2024
6b7c142
Update llama.py
danielhanchen May 30, 2024
54f3a74
Update llama.py
danielhanchen May 30, 2024
0bc96c5
use_fast_convert
danielhanchen May 30, 2024
02c91b0
Merge branch 'main' into nightly
danielhanchen May 30, 2024
b384ff0
Merge branch 'main' into nightly
danielhanchen May 30, 2024
a8b5d89
Update save.py
danielhanchen May 30, 2024
872d569
Update save.py
danielhanchen May 30, 2024
3a1f5f2
Update save.py
danielhanchen May 30, 2024
bcadc8c
Update save.py
danielhanchen Jun 2, 2024
1381820
remove_special_tokens
danielhanchen Jun 2, 2024
e01b87d
Ollama
danielhanchen Jun 2, 2024
b3479c7
Update chat_templates.py
danielhanchen Jun 3, 2024
86804dc
Update chat_templates.py
danielhanchen Jun 3, 2024
87fdd3a
Update chat_templates.py
danielhanchen Jun 3, 2024
5c5df69
Merge branch 'main' into nightly
danielhanchen Jun 7, 2024
6386d94
Update llama.py
danielhanchen Jun 7, 2024
b1a9551
Update chat_templates.py
danielhanchen Jun 9, 2024
344a05d
Support bfloat16 GGUF
danielhanchen Jun 9, 2024
6b11e0d
Update save.py
danielhanchen Jun 9, 2024
c6e4b5b
Update llama.py
danielhanchen Jun 9, 2024
57f29ab
fast_forward_inference
danielhanchen Jun 9, 2024
d32e972
Update mapper.py
danielhanchen Jun 9, 2024
e121fa5
Update loader.py
danielhanchen Jun 9, 2024
5eaa10f
Update llama.py
danielhanchen Jun 9, 2024
f57d28d
Update tokenizer_utils.py
danielhanchen Jun 10, 2024
8937507
info
danielhanchen Jun 11, 2024
8982edb
edits
danielhanchen Jun 11, 2024
8904605
Create chat template
danielhanchen Jun 11, 2024
2a374c2
Fix tokenizer
danielhanchen Jun 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update llama.py
danielhanchen committed May 19, 2024
commit 6bd8e600d72aeccb1108c83d50df07471ad0d400
10 changes: 6 additions & 4 deletions unsloth/models/llama.py
Original file line number Diff line number Diff line change
@@ -1582,7 +1582,9 @@ def get_peft_model(
lora_config = LoraConfig(**arguments)

# First offload lm_head and embed_tokens to disk
original_device = model.get_input_embeddings().weight.device
input_embeddings_device = model. get_input_embeddings().weight.device
output_embeddings_device = model.get_output_embeddings().weight.device

if use_gradient_checkpointing == "unsloth":
if train_embed_tokens:
print("Unsloth: Offloading input_embeddings to disk to save VRAM")
@@ -1594,7 +1596,7 @@ def get_peft_model(
gc.collect()
torch.cuda.empty_cache()
pass

if train_lm_head:
print("Unsloth: Offloading output_embeddings to disk to save VRAM")
offload_output_embeddings(model, temporary_location)
@@ -1618,15 +1620,15 @@ def get_peft_model(
print("Unsloth: Casting embed_tokens to float32")
assert(hasattr(model.model.model.embed_tokens, "modules_to_save"))
model.model.model.embed_tokens.modules_to_save.default\
.to(device = original_device, dtype = torch.float32, non_blocking = True)
.to(device = input_embeddings_device, dtype = torch.float32, non_blocking = True)
model.model.model.embed_tokens.modules_to_save.default.requires_grad_(True)
pass

if train_lm_head:
print("Unsloth: Casting lm_head to float32")
assert(hasattr(model.model.lm_head, "modules_to_save"))
model.model.lm_head.modules_to_save.default\
.to(device = original_device, dtype = torch.float32, non_blocking = True)
.to(device = output_embeddings_device, dtype = torch.float32, non_blocking = True)
model.model.lm_head.modules_to_save.default.requires_grad_(True)
pass