Skip to content

Optimize example code block regex#296

Merged
mishig25 merged 1 commit into
mainfrom
fix-example-codeblock-re
Sep 19, 2022
Merged

Optimize example code block regex#296
mishig25 merged 1 commit into
mainfrom
fix-example-codeblock-re

Conversation

@mariosasko

Copy link
Copy Markdown
Contributor

Fix the example code block regex to avoid the so-called "catastrophic backtracking" scenario, which causes CI to hang. For the reproduction, check this commit from huggingface/datasets#4957 (notice the missing closing ```).

@mishig25

mishig25 commented Sep 14, 2022

Copy link
Copy Markdown
Contributor

note for myself: https://huggingface.co/docs/transformers/main/en/model_doc/bert#transformers.BertForSequenceClassification.forward.example-4 codeexample hashlink should be working

note for myself: be sure to check that match groups of changed regex are working as expected

mishig25 added a commit to huggingface/transformers that referenced this pull request Sep 19, 2022

@mishig25 mishig25 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!
tested it & works great!

@mishig25 mishig25 merged commit 433d755 into main Sep 19, 2022
@mishig25 mishig25 deleted the fix-example-codeblock-re branch September 19, 2022 12:44
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

Successfully merging this pull request may close these issues.

2 participants