Spaces:
Runtime error
Runtime error
Download test_stream.py from limitless235/llm-pushback: direct link, hf CLI and curl.
- Browser
- Download file 410 Bytes
-
https://huggingface.co/spaces/limitless235/llm-pushback/resolve/main/test_stream.py
- Command line
-
hf download hf://spaces/limitless235/llm-pushback/test_stream.py
-
curl -L -o test_stream.py https://huggingface.co/spaces/limitless235/llm-pushback/resolve/main/test_stream.py
410 Bytes
| from mlx_vlm import load | |
| from mlx_vlm.generate import stream_generate | |
| model, processor = load("mlx-community/Qwen3.5-4B-MLX-4bit", adapter_path="adapters") | |
| prompt = "<|im_start|>user\nHello<|im_end|>\n<|im_start|>assistant\n" | |
| for count, result in enumerate(stream_generate(model, processor, prompt, max_tokens=10)): | |
| print(f"Yield {count}: {type(result)} -> {repr(getattr(result, 'text', str(result)))}") | |