Unverified Commit c6ae9b7d authored by camenduru's avatar camenduru Committed by GitHub
Browse files

Where did this 'x' come from, Elon? (#4277)



* why mdx?

* why mdx?

* why mdx?

* no x for kandinksy either

---------
Co-authored-by: default avatarPatrick von Platen <patrick.v.platen@gmail.com>
parent b3e5cd6b
...@@ -12,7 +12,7 @@ specific language governing permissions and limitations under the License. ...@@ -12,7 +12,7 @@ specific language governing permissions and limitations under the License.
# 스케줄러 # 스케줄러
diffusion 파이프라인은 diffusion 모델, 스케줄러 등의 컴포넌트들로 구성됩니다. 그리고 파이프라인 안의 일부 컴포넌트를 다른 컴포넌트로 교체하는 식의 커스터마이징 역시 가능합니다. 이와 같은 컴포넌트 커스터마이징의 가장 대표적인 예시가 바로 [스케줄러](../api/schedulers/overview.mdx)를 교체하는 것입니다. diffusion 파이프라인은 diffusion 모델, 스케줄러 등의 컴포넌트들로 구성됩니다. 그리고 파이프라인 안의 일부 컴포넌트를 다른 컴포넌트로 교체하는 식의 커스터마이징 역시 가능합니다. 이와 같은 컴포넌트 커스터마이징의 가장 대표적인 예시가 바로 [스케줄러](../api/schedulers/overview.md)를 교체하는 것입니다.
......
...@@ -536,7 +536,7 @@ def find_all_documented_objects(): ...@@ -536,7 +536,7 @@ def find_all_documented_objects():
content = f.read() content = f.read()
raw_doc_objs = re.findall(r"(?:autoclass|autofunction):: transformers.(\S+)\s+", content) raw_doc_objs = re.findall(r"(?:autoclass|autofunction):: transformers.(\S+)\s+", content)
documented_obj += [obj.split(".")[-1] for obj in raw_doc_objs] documented_obj += [obj.split(".")[-1] for obj in raw_doc_objs]
for doc_file in Path(PATH_TO_DOC).glob("**/*.mdx"): for doc_file in Path(PATH_TO_DOC).glob("**/*.md"):
with open(doc_file, "r", encoding="utf-8", newline="\n") as f: with open(doc_file, "r", encoding="utf-8", newline="\n") as f:
content = f.read() content = f.read()
raw_doc_objs = re.findall("\[\[autodoc\]\]\s+(\S+)\s+", content) raw_doc_objs = re.findall("\[\[autodoc\]\]\s+(\S+)\s+", content)
...@@ -674,7 +674,7 @@ def check_all_objects_are_documented(): ...@@ -674,7 +674,7 @@ def check_all_objects_are_documented():
def check_model_type_doc_match(): def check_model_type_doc_match():
"""Check all doc pages have a corresponding model type.""" """Check all doc pages have a corresponding model type."""
model_doc_folder = Path(PATH_TO_DOC) / "model_doc" model_doc_folder = Path(PATH_TO_DOC) / "model_doc"
model_docs = [m.stem for m in model_doc_folder.glob("*.mdx")] model_docs = [m.stem for m in model_doc_folder.glob("*.md")]
model_types = list(diffusers.models.auto.configuration_auto.MODEL_NAMES_MAPPING.keys()) model_types = list(diffusers.models.auto.configuration_auto.MODEL_NAMES_MAPPING.keys())
model_types = [MODEL_TYPE_TO_DOC_MAPPING[m] if m in MODEL_TYPE_TO_DOC_MAPPING else m for m in model_types] model_types = [MODEL_TYPE_TO_DOC_MAPPING[m] if m in MODEL_TYPE_TO_DOC_MAPPING else m for m in model_types]
......
...@@ -161,7 +161,7 @@ def get_model_table_from_auto_modules(): ...@@ -161,7 +161,7 @@ def get_model_table_from_auto_modules():
def check_model_table(overwrite=False): def check_model_table(overwrite=False):
"""Check the model table in the index.rst is consistent with the state of the lib and maybe `overwrite`.""" """Check the model table in the index.rst is consistent with the state of the lib and maybe `overwrite`."""
current_table, start_index, end_index, lines = _find_text_in_file( current_table, start_index, end_index, lines = _find_text_in_file(
filename=os.path.join(PATH_TO_DOCS, "index.mdx"), filename=os.path.join(PATH_TO_DOCS, "index.md"),
start_prompt="<!--This table is updated automatically from the auto modules", start_prompt="<!--This table is updated automatically from the auto modules",
end_prompt="<!-- End table-->", end_prompt="<!-- End table-->",
) )
...@@ -169,11 +169,11 @@ def check_model_table(overwrite=False): ...@@ -169,11 +169,11 @@ def check_model_table(overwrite=False):
if current_table != new_table: if current_table != new_table:
if overwrite: if overwrite:
with open(os.path.join(PATH_TO_DOCS, "index.mdx"), "w", encoding="utf-8", newline="\n") as f: with open(os.path.join(PATH_TO_DOCS, "index.md"), "w", encoding="utf-8", newline="\n") as f:
f.writelines(lines[:start_index] + [new_table] + lines[end_index:]) f.writelines(lines[:start_index] + [new_table] + lines[end_index:])
else: else:
raise ValueError( raise ValueError(
"The model table in the `index.mdx` has not been updated. Run `make fix-copies` to fix this." "The model table in the `index.md` has not been updated. Run `make fix-copies` to fix this."
) )
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment