|
59 | 59 | """ |
60 | 60 |
|
61 | 61 | import argparse |
| 62 | +from functools import partial |
| 63 | +import json |
62 | 64 | import os |
63 | | -import time |
64 | 65 | import sys |
65 | | -import json |
66 | 66 | import threading |
67 | | -from functools import partial |
68 | | -from typing import Sequence, List, Any, Callable |
69 | | -import numpy as np |
| 67 | +import time |
| 68 | +from typing import Any, Callable, List, Sequence |
70 | 69 | import absl |
71 | | - |
72 | | -from transformers import AutoConfig |
| 70 | +import flax.linen as nn |
73 | 71 | from huggingface_hub import hf_hub_download, list_repo_files |
74 | | -from safetensors import safe_open |
75 | 72 | import jax |
76 | | -import flax.linen as nn |
77 | | -from orbax.checkpoint import type_handlers |
78 | 73 | from MaxText import pyconfig |
79 | | -from MaxText.common_types import MODEL_MODE_TRAIN |
80 | | -from MaxText.layers import models, quantizations |
81 | 74 | from maxtext.checkpoint_conversion.standalone_scripts.llama_or_mistral_ckpt import save_weights_to_checkpoint |
82 | 75 | from maxtext.checkpoint_conversion.utils.param_mapping import HOOK_FNS, PARAM_MAPPING |
83 | | -from maxtext.checkpoint_conversion.utils.utils import apply_hook_fns, HF_IDS, print_ram_usage, get_hf_model, MemoryMonitorTqdm, print_peak_memory, validate_and_filter_param_map_keys |
| 76 | +from maxtext.checkpoint_conversion.utils.utils import HF_IDS, MemoryMonitorTqdm, apply_hook_fns, get_hf_model, print_peak_memory, print_ram_usage, validate_and_filter_param_map_keys |
| 77 | +from MaxText.common_types import MODEL_MODE_TRAIN |
84 | 78 | from maxtext.inference.inference_utils import str2bool |
| 79 | +from maxtext.layers import quantizations |
| 80 | +from maxtext.models import models |
85 | 81 | from maxtext.utils import max_logging |
86 | 82 | from maxtext.utils import max_utils |
87 | 83 | from maxtext.utils import maxtext_utils |
| 84 | +import numpy as np |
| 85 | +from orbax.checkpoint import type_handlers |
| 86 | +from safetensors import safe_open |
| 87 | +from transformers import AutoConfig |
88 | 88 |
|
89 | 89 |
|
90 | 90 | absl.logging.set_verbosity(absl.logging.INFO) # for max_logging.log |
|
0 commit comments