Commit 977817a0 authored by lintangsutawika's avatar lintangsutawika
Browse files

made two delimiter modes

parent 3c805576
...@@ -33,7 +33,9 @@ class Sampler: ...@@ -33,7 +33,9 @@ class Sampler:
self.delimiter.join( self.delimiter.join(
[ [
# TODO: is separating doc_to_text and doc_to_target by one space always desired? # TODO: is separating doc_to_text and doc_to_target by one space always desired?
self.task.doc_to_text(doc) + " " + self.task.doc_to_target(doc) self.task.doc_to_text(doc)
+ self.config.sample_delimiter
+ self.task.doc_to_target(doc)
for doc in selected_docs for doc in selected_docs
] ]
) )
......
...@@ -76,7 +76,8 @@ class TaskConfig(dict): ...@@ -76,7 +76,8 @@ class TaskConfig(dict):
gold_alias: Union[Callable, str] = None gold_alias: Union[Callable, str] = None
output_type: str = "greedy_until" output_type: str = "greedy_until"
generation_kwargs: dict = None generation_kwargs: dict = None
delimiter: str = "\n\n" target_delimiter: str = "\n\n"
sample_delimiter: str = " "
filter_list: Union[str, list] = None filter_list: Union[str, list] = None
should_decontaminate: bool = False should_decontaminate: bool = False
doc_to_decontamination_query: str = None doc_to_decontamination_query: str = None
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment