(schema: bytes, marker: bytes)
| 203 | raise ValueError("Missing file_identifier in schema files.") |
| 204 | |
| 205 | def extract_alignment(schema: bytes, marker: bytes) -> int: |
| 206 | for line in schema.splitlines(): |
| 207 | if marker in line: |
| 208 | match = re.search(rb"force_align\s*:\s*(\d+)", line) |
| 209 | if match: |
| 210 | return int(match.group(1)) |
| 211 | raise RuntimeError(f"Failed to find marker {marker!r} in program.fbs") |
| 212 | |
| 213 | program_schema_data = schemas.get(program_schema) |
| 214 | tensor_alignment = extract_alignment( |