forked from pytorch/torchtitan
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR adds support for Llama3 8b/70b, mainly it: - add tiktonizer, add instructions to download tokenizer - add options for the llama model to support Llama3 - add Llama3 8b/70b configs
- Loading branch information
Showing
21 changed files
with
440 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ __pycache__ | |
build | ||
outputs | ||
dist/* | ||
*.model | ||
|
||
# data | ||
data | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
torch >= 2.2.0.dev | ||
sentencepiece | ||
datasets | ||
tomli >= 1.1.0 ; python_version < "3.11" | ||
tensorboard | ||
sentencepiece | ||
tiktoken |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Copyright (c) Meta Platforms, Inc. and affiliates. | ||
# All rights reserved. | ||
# | ||
# This source code is licensed under the BSD-style license found in the | ||
# LICENSE file in the root directory of this source tree. | ||
|
||
from torchtitan.datasets.tokenizer.sentencepiece import SentencePieceTokenizer | ||
from torchtitan.datasets.tokenizer.tiktoken import TikTokenizer | ||
from torchtitan.datasets.tokenizer.tokenizer import Tokenizer | ||
|
||
from torchtitan.logging_utils import logger | ||
|
||
|
||
def create_tokenizer(tokenizer_type: str, tokenizer_path: str) -> Tokenizer: | ||
logger.info(f"Building {tokenizer_type} tokenizer locally from {tokenizer_path}") | ||
if tokenizer_type == "sentencepiece": | ||
return SentencePieceTokenizer(tokenizer_path) | ||
elif tokenizer_type == "tiktoken": | ||
return TikTokenizer(tokenizer_path) | ||
else: | ||
raise ValueError(f"Unknown tokenizer type: {args.type}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.