Skip to content

Commit

Permalink
Feat(data): Allow loading local csv and text (#594)
Browse files Browse the repository at this point in the history
* Feat(data): Allow loading local csv and text

* chore: update readme for loading data
  • Loading branch information
NanoCode012 authored Sep 17, 2023
1 parent b15b19e commit 00dce35
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -434,10 +434,10 @@ datasets:
- path: vicgalle/alpaca-gpt4
# The type of prompt to use for training. [alpaca, sharegpt, gpteacher, oasst, reflection]
type: alpaca # format | format:<prompt_style> (chat/instruct) | <prompt_strategies>.load_<load_fn>
ds_type: # Optional[str] (json|arrow|parquet) defines the datatype when path is a file
data_files: # path to source data files
shards: # number of shards to split data into
name: # name of dataset configuration to load
ds_type: # Optional[str] (json|arrow|parquet|text|csv) defines the datatype when path is a file
data_files: # Optional[str] path to source data files
shards: # Optional[int] number of shards to split data into
name: # Optional[str] name of dataset configuration to load
# custom user prompt
- path: repo
Expand Down
4 changes: 4 additions & 0 deletions src/axolotl/utils/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,10 @@ def for_d_in_datasets(dataset_configs):
ds_type = "parquet"
elif ".arrow" in d.path:
ds_type = "arrow"
elif ".csv" in d.path:
ds_type = "csv"
elif ".txt" in d.path:
ds_type = "text"
ds = load_dataset(
ds_type,
name=d.name,
Expand Down

0 comments on commit 00dce35

Please sign in to comment.