Unverified Commit b9a768b3 authored by Sylvain Gugger's avatar Sylvain Gugger Committed by GitHub
Browse files

Enable doc in Spanish (#16518)

* Reorganize doc for multilingual support

* Fix style

* Style

* Toc trees

* Adapt templates
parent 3951b9f3
../../notebooks/README.md
\ No newline at end of file
......@@ -178,7 +178,7 @@ class AddNewModelCommand(BaseTransformersCLICommand):
shutil.move(
f"{directory}/{lowercase_model_name}.mdx",
f"{path_to_transformer_root}/docs/source/model_doc/{lowercase_model_name}.mdx",
f"{path_to_transformer_root}/docs/source/en/model_doc/{lowercase_model_name}.mdx",
)
shutil.move(
......
......@@ -541,7 +541,7 @@ def get_model_files(model_type: str, frameworks: Optional[List[str]] = None) ->
model_files = list(model_module.glob("*.py"))
model_files = filter_framework_files(model_files, frameworks=frameworks)
doc_file = REPO_PATH / "docs" / "source" / "model_doc" / f"{model_type}.mdx"
doc_file = REPO_PATH / "docs" / "source" / "en" / "model_doc" / f"{model_type}.mdx"
# Basic pattern for test files
test_files = [
......@@ -1256,7 +1256,7 @@ def create_new_model_like(
add_model_to_auto_classes(old_model_patterns, new_model_patterns, model_classes)
# 5. Add doc file
doc_file = REPO_PATH / "docs" / "source" / "model_doc" / f"{old_model_patterns.model_type}.mdx"
doc_file = REPO_PATH / "docs" / "source" / "en" / "model_doc" / f"{old_model_patterns.model_type}.mdx"
duplicate_doc_file(doc_file, old_model_patterns, new_model_patterns, frameworks=frameworks)
# 6. Warn the user for duplicate patterns
......
......@@ -25,7 +25,7 @@ from doc_builder.style_doc import style_docstrings_in_code
# All paths are set with the intent you should run this script from the root of the repo with the command
# python utils/check_copies.py
TRANSFORMERS_PATH = "src/transformers"
PATH_TO_DOCS = "docs/source"
PATH_TO_DOCS = "docs/source/en"
REPO_PATH = "."
# Mapping for files that are full copies of others (keys are copies, values the file to keep them up to data with)
......
......@@ -31,7 +31,7 @@ from transformers.utils import ENV_VARS_TRUE_VALUES
# python utils/check_repo.py
PATH_TO_TRANSFORMERS = "src/transformers"
PATH_TO_TESTS = "tests"
PATH_TO_DOC = "docs/source"
PATH_TO_DOC = "docs/source/en"
# Update this list with models that are supposed to be private.
PRIVATE_MODELS = [
......
......@@ -23,7 +23,7 @@ import re
# All paths are set with the intent you should run this script from the root of the repo with the command
# python utils/check_table.py
TRANSFORMERS_PATH = "src/transformers"
PATH_TO_DOCS = "docs/source"
PATH_TO_DOCS = "docs/source/en"
REPO_PATH = "."
......
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