Replace the links from main doc tp stable doc in the model list of the README.
()
| 67 | |
| 68 | |
| 69 | def clean_main_ref_in_model_list(): |
| 70 | """Replace the links from main doc tp stable doc in the model list of the README.""" |
| 71 | # If the introduction or the conclusion of the list change, the prompts may need to be updated. |
| 72 | _start_prompt = "🤗 Transformers currently provides the following architectures" |
| 73 | _end_prompt = "1. Want to contribute a new model?" |
| 74 | with open(README_FILE, "r", encoding="utf-8", newline="\n") as f: |
| 75 | lines = f.readlines() |
| 76 | |
| 77 | # Find the start of the list. |
| 78 | start_index = 0 |
| 79 | while not lines[start_index].startswith(_start_prompt): |
| 80 | start_index += 1 |
| 81 | start_index += 1 |
| 82 | |
| 83 | index = start_index |
| 84 | # Update the lines in the model list. |
| 85 | while not lines[index].startswith(_end_prompt): |
| 86 | if lines[index].startswith("1."): |
| 87 | lines[index] = lines[index].replace( |
| 88 | "https://huggingface.co/docs/diffusers/main/model_doc", |
| 89 | "https://huggingface.co/docs/diffusers/model_doc", |
| 90 | ) |
| 91 | index += 1 |
| 92 | |
| 93 | with open(README_FILE, "w", encoding="utf-8", newline="\n") as f: |
| 94 | f.writelines(lines) |
| 95 | |
| 96 | |
| 97 | def get_version(): |
nothing calls this directly
no outgoing calls
no test coverage detected