Skip to content

Commit

Permalink
allow to set has_header
Browse files Browse the repository at this point in the history
  • Loading branch information
raphael-cohere committed Oct 23, 2023
1 parent 6362669 commit 568e57e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cohere/custom_model_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,20 @@ class CsvDataset(LocalFileCustomModelDataset):
another prompt, another completion
"""

def __init__(self, train_file: str, delimiter: str, eval_file: Optional[str] = None):
def __init__(self, train_file: str, delimiter: str, eval_file: Optional[str] = None, has_header: Optional[bool] = False):
"""
Args:
train_file (str): local path to csv with training data
eval_file: (str, optional): local path to a csv with eval data
"""
super().__init__(train_file, eval_file)
self._delimiter = delimiter
self._has_header = has_header

def file_config(self) -> FileConfig:
config = dict(_empty_file_config)
config["delimiter"] = self._delimiter
config["hasHeader"] = self._has_header
return config


Expand Down

0 comments on commit 568e57e

Please sign in to comment.