Upload split_utils.py with huggingface_hub
Browse files- split_utils.py +2 -2
split_utils.py
CHANGED
@@ -31,12 +31,12 @@ def parse_random_mix_string(input_str):
|
|
31 |
{'dale': 0.9, 'oren': 0.7, 'mike': 1.0}
|
32 |
"""
|
33 |
if not re.fullmatch(
|
34 |
-
r"((
|
35 |
input_str,
|
36 |
):
|
37 |
raise ValueError(f"Invalid input format for split '{input_str}'")
|
38 |
|
39 |
-
pattern = re.compile(r"(
|
40 |
matches = pattern.findall(input_str)
|
41 |
|
42 |
return {
|
|
|
31 |
{'dale': 0.9, 'oren': 0.7, 'mike': 1.0}
|
32 |
"""
|
33 |
if not re.fullmatch(
|
34 |
+
r"((\w+\[\d*\.?\d*%?\]|\w+)\+)*(\w+\[\d*\.?\d*%?\]|\w+)",
|
35 |
input_str,
|
36 |
):
|
37 |
raise ValueError(f"Invalid input format for split '{input_str}'")
|
38 |
|
39 |
+
pattern = re.compile(r"(\w+)(\[\d*\.?\d*%?\])?")
|
40 |
matches = pattern.findall(input_str)
|
41 |
|
42 |
return {
|