Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad Escape character Error #15

Closed
wassimseif opened this issue Oct 16, 2023 · 1 comment
Closed

Bad Escape character Error #15

wassimseif opened this issue Oct 16, 2023 · 1 comment

Comments

@wassimseif
Copy link

I got this error from trying to run another repository of yours ( voicebox )
I got this error

  File "/root/work/code/mw_speech_synthesis/speech_synthesis/training/voicebox/voicebox_pytorch/__init__.py", line 1, in <module>
    from voicebox_pytorch.voicebox_pytorch import (
  File "/root/work/code/mw_speech_synthesis/speech_synthesis/training/voicebox/voicebox_pytorch/__init__.py", line 1, in <module>
    from voicebox_pytorch.voicebox_pytorch import (
  File "/root/work/code/mw_speech_synthesis/speech_synthesis/training/voicebox/voicebox_pytorch/voicebox_pytorch.py", line 28, in <module>
    from spear_tts_pytorch import TextToSemantic
  File "/root/.miniforge/envs/vb/lib/python3.10/site-packages/spear_tts_pytorch/__init__.py", line 1, in <module>
    from spear_tts_pytorch.spear_tts_pytorch import (
  File "/root/.miniforge/envs/vb/lib/python3.10/site-packages/spear_tts_pytorch/spear_tts_pytorch.py", line 27, in <module>
    from x_clip.tokenizer import tokenizer
  File "/root/.miniforge/envs/vb/lib/python3.10/site-packages/x_clip/tokenizer.py", line 169, in <module>
    tokenizer = SimpleTokenizer()
  File "/root/.miniforge/envs/vb/lib/python3.10/site-packages/x_clip/tokenizer.py", line 77, in __init__
    self.pat = re.compile(
  File "/root/.miniforge/envs/vb/lib/python3.10/re.py", line 251, in compile
    return _compile(pattern, flags)
  File "/root/.miniforge/envs/vb/lib/python3.10/re.py", line 303, in _compile
    p = sre_compile.compile(pattern, flags)
  File "/root/.miniforge/envs/vb/lib/python3.10/sre_compile.py", line 788, in compile
    p = sre_parse.parse(p, flags)
  File "/root/.miniforge/envs/vb/lib/python3.10/sre_parse.py", line 955, in parse
    p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
  File "/root/.miniforge/envs/vb/lib/python3.10/sre_parse.py", line 444, in _parse_sub
    itemsappend(_parse(source, state, verbose, nested + 1,
  File "/root/.miniforge/envs/vb/lib/python3.10/sre_parse.py", line 555, in _parse
    code1 = _class_escape(source, this)
  File "/root/.miniforge/envs/vb/lib/python3.10/sre_parse.py", line 350, in _class_escape
    raise source.error('bad escape %s' % escape, len(escape))
re.error: bad escape \p at position 59

The source is this line

self.pat = re.compile(
            r"""<\|startoftext\|>|<\|endoftext\|>|'s|'t|'re|'ve|'m|'ll|'d|[\p{L}]+|[\p{N}]|[^\s\p{L}\p{N}]+""",
            re.IGNORECASE)
@lucidrains
Copy link
Owner

@wassimseif ah darn, i thought the re did everything regex did

ok, i've reverted a recent change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants