This repository has been archived by the owner on Apr 11, 2024. It is now read-only.
-
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.
- Loading branch information
Showing
27 changed files
with
188 additions
and
72 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
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,8 +1,35 @@ | ||
from examples.minimal.dataset import AntropicDataset | ||
from src.xllm.cli.train import cli_run_train | ||
from src.xllm.core.config import HuggingFaceConfig | ||
from src.xllm.datasets.registry import datasets_registry | ||
|
||
if __name__ == "__main__": | ||
datasets_registry.add(key="antropic", value=AntropicDataset) | ||
cli_run_train(config_cls=HuggingFaceConfig) | ||
import datasets | ||
from tqdm import tqdm | ||
from xllm import HuggingFaceConfig | ||
from xllm.datasets import GeneralDataset | ||
from xllm.experiments import Experiment | ||
|
||
|
||
def run(): | ||
rlhf_dataset = datasets.load_dataset("Anthropic/hh-rlhf") | ||
|
||
parsed_data = dict() | ||
|
||
for split in ["train", "test"]: | ||
parsed_data[split] = list() | ||
|
||
for sample in tqdm(rlhf_dataset[split], desc=f"Parsing {split}"): | ||
text_parts = sample["chosen"].split("\n\n")[1:] | ||
|
||
parsed_data[split].append(text_parts) | ||
|
||
train = parsed_data["train"] | ||
evaluation = parsed_data["test"] | ||
|
||
train_dataset = GeneralDataset.from_list(data=train) | ||
eval_dataset = GeneralDataset.from_list(data=evaluation) | ||
|
||
config = HuggingFaceConfig(model_name_or_path="facebook/opt-350m") | ||
|
||
experiment = Experiment(config=config, train_dataset=train_dataset, eval_dataset=eval_dataset) | ||
|
||
experiment.build() | ||
|
||
experiment.run() | ||
|
||
experiment.push_to_hub(repo_id="YOUR_NAME/MODEL_NAME") |
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,5 @@ | ||
HUGGING_FACE_HUB_TOKEN= | ||
WANDB_API_KEY= | ||
WANDB_ENTITY= | ||
WANDB_PROJECT= | ||
TOKENIZERS_PARALLELISM=false |
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,5 @@ | ||
# Minimal | ||
|
||
## Run | ||
|
||
python ./train.py |
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,8 @@ | ||
from examples.minimal_using_cli.dataset import AntropicDataset | ||
from src.xllm.cli.train import cli_run_train | ||
from src.xllm.core.config import HuggingFaceConfig | ||
from src.xllm.datasets.registry import datasets_registry | ||
|
||
if __name__ == "__main__": | ||
datasets_registry.add(key="antropic", value=AntropicDataset) | ||
cli_run_train(config_cls=HuggingFaceConfig) |
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
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
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
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
Oops, something went wrong.