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

edit doc #3647

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions data/datasets/oa_dolly_15k_multilingual/README.md
@@ -0,0 +1 @@
Reformat [argilla/databricks-dolly-15k-curated-multilingual](https://huggingface.co/datasets/argilla/databricks-dolly-15k-curated-multilingual) dataset
55 changes: 55 additions & 0 deletions data/datasets/oa_dolly_15k_multilingual/create_dataset.py
@@ -0,0 +1,55 @@
import json
from pathlib import Path

from datasets import Dataset, load_dataset


def build_dataset(data_file: str, include_context: bool = True) -> Dataset:
json_data = [
to_oa_format(json.loads(line), include_context=include_context)
for line in Path(data_file).read_text().splitlines()
]

dataset = Dataset.from_list(json_data)
return dataset


def to_oa_format(data: dict, include_context: bool = True) -> dict:
output_data = {
"INSTRUCTION": data["instruction"],
"RESPONSE": data["response"],
"SOURCE": "databricks-dolly-15k",
"METADATA": {
"CATEGORY": data["category"],
},
}

if include_context:
output_data["METADATA"]["CONTEXT"] = data["context"]

return output_data


def main():
dataset = load_dataset("argilla/databricks-dolly-15k-curated-multilingual")
json_data = []
for lang, data in dataset.items():
for row in data:
json_data.append({
"INSTRUCTION": row["instruction"],
"INSTRUCTION_EN": row["instruction_original_en"],
"RESPONSE_EN": row["response_original_en"],
"RESPONSE": row["response"],
"SOURCE": "databricks-dolly-15k-curated-multilingual",
"METADATA": {
"CATEGORY": row["category"],
"CONTEXT": row["context"],
"LANG": lang
},
})
format_dataset = Dataset.from_list(json_data)
format_dataset.push_to_hub("blancsw/oa_dolly_15k_multilingual")


if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion model/README.md
Expand Up @@ -72,7 +72,7 @@ cd model_training
# export shared modules
export PYTHONPATH=$PYTHONPATH:../../oasst-shared

python trainer_sft.py --configs defaults oa_dataset_only pythia --cache_dir $DATA_PATH --output_dir $MODEL_PATH/sft_model
python trainer_sft.py --configs defaults oasst_only pythia-70m-deduped --cache_dir $DATA_PATH --output_dir $MODEL_PATH/sft_model

# if you want to use wandb, add
--wandb_entity your_username/team_name
Expand Down