Instructions to use SWE-bench/SWE-agent-LM-32B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SWE-bench/SWE-agent-LM-32B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="SWE-bench/SWE-agent-LM-32B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("SWE-bench/SWE-agent-LM-32B") model = AutoModelForCausalLM.from_pretrained("SWE-bench/SWE-agent-LM-32B") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use SWE-bench/SWE-agent-LM-32B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "SWE-bench/SWE-agent-LM-32B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SWE-bench/SWE-agent-LM-32B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/SWE-bench/SWE-agent-LM-32B
- SGLang
How to use SWE-bench/SWE-agent-LM-32B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "SWE-bench/SWE-agent-LM-32B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SWE-bench/SWE-agent-LM-32B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "SWE-bench/SWE-agent-LM-32B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "SWE-bench/SWE-agent-LM-32B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use SWE-bench/SWE-agent-LM-32B with Docker Model Runner:
docker model run hf.co/SWE-bench/SWE-agent-LM-32B
Missing Model Files?
It seems that the model files from model-00001-of-00014.safetensors to model-00003-of-00014.safetensors might be missing. Could you please confirm?
Oh what the heck, not sure how that happened. Just uploaded. Thanks for the catch!
The model-00004-of-00014.safetensors file seems too small. You should double-check whether the model files were uploaded completely and whether they can be loaded correctly.
Yeah good catch - I think the previous upload I did early-terminated. Just did it again, and double checked pulling + inference, it's good to go now!
>>> from transformers import AutoModelForCausalLM, AutoTokenizer
>>> model = AutoModelForCausalLM.from_pretrained("/mnt/data/liang.zeng/models/SWE-agent-LM-32B")
[2025-05-08 14:06:00,311] [INFO] [real_accelerator.py:219:get_accelerator] Setting ds_accelerator to cuda (auto detect)
Sliding Window Attention is enabled but not implemented for `sdpa`; unexpected results may be encountered.
Loading checkpoint shards: 0%| | 0/14 [00:00<?, ?it/s]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.10/dist-packages/transformers/models/auto/auto_factory.py", line 571, in from_pretrained
return model_class.from_pretrained(
File "/usr/local/lib/python3.10/dist-packages/transformers/modeling_utils.py", line 279, in _wrapper
return func(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/transformers/modeling_utils.py", line 4399, in from_pretrained
) = cls._load_pretrained_model(
File "/usr/local/lib/python3.10/dist-packages/transformers/modeling_utils.py", line 4822, in _load_pretrained_model
state_dict = load_state_dict(
File "/usr/local/lib/python3.10/dist-packages/transformers/modeling_utils.py", line 513, in load_state_dict
with safe_open(checkpoint_file, framework="pt") as f:
FileNotFoundError: No such file or directory: "/mnt/data/liang.zeng/models/SWE-agent-LM-32B/ft-model-00001-of-00014.safetensors"
>>>
Unfortunately, it still doesn’t load correctly.
Oh wait i think it seems like it's looking for
FileNotFoundError: No such file or directory: "/mnt/data/liang.zeng/models/SWE-agent-LM-32B/ft-model-00001-of-00014.safetensors"
But the *.safetensors I uploaded are all prefixed with "model-", not "ft-".
Could you try either renaming your files locally or updating your serving framework to point to "model-000...safetensors" instead? Perhaps the first option is easier.
I can also update the file names to have the "ft-" prefix, not sure what the usual convention is.