mirror of
https://github.com/ml-explore/mlx-examples.git
synced 2025-06-28 20:25:22 +08:00
Merge branch 'ml-explore:main' into adding-support-for-mamba2
This commit is contained in:
commit
e4eae973e8
@ -61,8 +61,8 @@ def wired_limit(model: nn.Module, streams: Optional[List[mx.Stream]] = None):
|
|||||||
model_mb = model_bytes // 2**20
|
model_mb = model_bytes // 2**20
|
||||||
max_rec_mb = max_rec_size // 2**20
|
max_rec_mb = max_rec_size // 2**20
|
||||||
print(
|
print(
|
||||||
"[WARNING] Generating with a model that requires {model_mb} MB "
|
f"[WARNING] Generating with a model that requires {model_mb} MB "
|
||||||
"which is close to the maximum recommended size of {max_rec_mb} "
|
f"which is close to the maximum recommended size of {max_rec_mb} "
|
||||||
"MB. This can be slow. See the documentation for possible work-arounds: "
|
"MB. This can be slow. See the documentation for possible work-arounds: "
|
||||||
"https://github.com/ml-explore/mlx-examples/tree/main/llms#large-models"
|
"https://github.com/ml-explore/mlx-examples/tree/main/llms#large-models"
|
||||||
)
|
)
|
||||||
|
@ -30,6 +30,7 @@ if __name__ == "__main__":
|
|||||||
parser.add_argument("--preload-models", action="store_true")
|
parser.add_argument("--preload-models", action="store_true")
|
||||||
parser.add_argument("--output", default="out.png")
|
parser.add_argument("--output", default="out.png")
|
||||||
parser.add_argument("--verbose", "-v", action="store_true")
|
parser.add_argument("--verbose", "-v", action="store_true")
|
||||||
|
parser.add_argument("--seed", type=int)
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
# Load the models
|
# Load the models
|
||||||
@ -94,6 +95,7 @@ if __name__ == "__main__":
|
|||||||
cfg_weight=args.cfg,
|
cfg_weight=args.cfg,
|
||||||
num_steps=args.steps,
|
num_steps=args.steps,
|
||||||
negative_text=args.negative_prompt,
|
negative_text=args.negative_prompt,
|
||||||
|
seed=args.seed,
|
||||||
)
|
)
|
||||||
for x_t in tqdm(latents, total=int(args.steps * args.strength)):
|
for x_t in tqdm(latents, total=int(args.steps * args.strength)):
|
||||||
mx.eval(x_t)
|
mx.eval(x_t)
|
||||||
|
Loading…
Reference in New Issue
Block a user