MCPcopy Create free account
hub / github.com/RingBDStack/GDAP / __post_init__

Method __post_init__

run_seq2seq.py:227–246  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

225 )
226
227 def __post_init__(self):
228 if self.dataset_name is None and self.train_file is None and self.validation_file is None:
229 raise ValueError(
230 "Need either a dataset name or a training/validation file.")
231 else:
232 if self.train_file is not None:
233 extension = self.train_file.split(".")[-1]
234 assert extension in [
235 "csv", "json"], "`train_file` should be a csv or a json file."
236 if self.validation_file is not None:
237 extension = self.validation_file.split(".")[-1]
238 assert extension in [
239 "csv", "json"], "`validation_file` should be a csv or a json file."
240 if not self.task.startswith("summarization") and not self.task.startswith(
241 "translation") and not self.task.startswith('event'):
242 raise ValueError(
243 "`task` should be summarization, summarization_{dataset}, translation or translation_{xx}_to_{yy}."
244 )
245 if self.val_max_target_length is None:
246 self.val_max_target_length = self.max_target_length
247
248 # Start Code for Event Extraction
249 decoding_format: str = field(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected