Skip to content

add from_pretrained#3334

Open
A9isha wants to merge 2 commits intomainfrom
anisha-from-pretrained2
Open

add from_pretrained#3334
A9isha wants to merge 2 commits intomainfrom
anisha-from-pretrained2

Conversation

@A9isha
Copy link
Collaborator

@A9isha A9isha commented Mar 6, 2026

Description

Adding a simplified API of from_pretrained() which can work minimally as

import maxtext as mt
model,mesh, config = mt.from_pretrained(model_name=“Qwen3-0.8b”)

and also

import maxtext as mt
argv =    ["", 
            f"{MAXTEXT_CONFIGS_DIR}/base.yml", 
            f"load_parameters_path={MODEL_CHECKPOINT_PATH}/0/items",
            f"model_name={MODEL_NAME}",
         ]
model,mesh, config = mt.from_pretrained(argv)

as well as

import maxtext as mt
argv =    ["", 
            f"{MAXTEXT_CONFIGS_DIR}/base.yml", 
            f"load_parameters_path={MODEL_CHECKPOINT_PATH}/0/items",
         ]
model,mesh, config = mt.from_pretrained(argv, model_name=“Qwen3-0.8b”)

Tests

Please describe how you tested this change, and include any instructions and/or
commands to reproduce.

Checklist

Before submitting this PR, please make sure (put X in square brackets):

  • I have performed a self-review of my code. For an optional AI review, add the gemini-review label.
  • I have necessary comments in my code, particularly in hard-to-understand areas.
  • I have run end-to-end tests tests and provided workload links above if applicable.
  • I have made or will make corresponding changes to the doc if needed, including adding new documentation pages to the relevant Table of Contents (toctree directive) as explained in our documentation.

@A9isha A9isha force-pushed the anisha-from-pretrained2 branch 4 times, most recently from d1ae158 to 145fd41 Compare March 6, 2026 08:12
@A9isha A9isha marked this pull request as ready for review March 6, 2026 08:33
@A9isha A9isha force-pushed the anisha-from-pretrained2 branch 2 times, most recently from 1806286 to 92819d8 Compare March 8, 2026 21:35
@A9isha A9isha requested a review from parambole as a code owner March 8, 2026 21:35
@A9isha A9isha force-pushed the anisha-from-pretrained2 branch from 92819d8 to 865247a Compare March 9, 2026 21:50
@A9isha A9isha requested a review from shuningjin as a code owner March 10, 2026 21:07
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.

1 participant