Skip to content

Commit

Permalink
Allow '#' in the task name. This will be used as a separator for deno…
Browse files Browse the repository at this point in the history
…ting different versions of the same task.

PiperOrigin-RevId: 612779694
  • Loading branch information
SeqIO Team authored and SeqIO committed Mar 5, 2024
1 parent 16380a6 commit 11706e4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion seqio/dataset_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@

_DEFAULT_FEATURE_KEYS = ["inputs", "targets"]

_VALID_TASK_NAME_REGEX = re.compile(r"^[\w\d\.\:_]+$")
_VALID_TASK_NAME_REGEX = re.compile(r"^[\w\d\.\:_#]+$")
_MAX_EXAMPLES_TO_MEM_CACHE = 10000
SHUFFLE_BUFFER_SIZE = 1000

Expand Down
3 changes: 3 additions & 0 deletions seqio/dataset_providers_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ def test_invalid_name(self):
):
self.add_task("invalid/name", self.function_source)

def test_hash_in_name(self):
self.add_task("valid#name", self.function_source)

def test_repeat_name(self):
with self.assertRaisesWithLiteralMatch(
ValueError, "Attempting to register duplicate provider: text_line_task"
Expand Down

0 comments on commit 11706e4

Please sign in to comment.