Views
No views yet
1
2pip install -U mlx-lm
31
2python -m mlx_lm.convert --hf-path {Your Phi-4-MLX Path} -q
31
2from mlx_lm import load, generate
3
4model, tokenizer = load("Your Phi-4-mlx-int4 Path")
5
6prompt = tokenizer.apply_chat_template(
7 [{"role": "user", "content": "I have $20,000 in my savings account, where I receive a 4% profit per year and payments twice a year. Can you please tell me how long it will take for me to become a millionaire? Also, can you please explain the math step by step as if you were explaining it to an uneducated person?"}],
8 tokenize=False,
9 add_generation_prompt=True,
10)
11
12response = generate(model, tokenizer, prompt=prompt,max_tokens=1024, verbose=True)
13