Text Generation
Transformers
Safetensors
English
qwen2
software
environment
agent
code
conversational
Eval Results
text-generation-inference
Instructions to use GAIR/OpenSWE-72B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use GAIR/OpenSWE-72B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="GAIR/OpenSWE-72B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("GAIR/OpenSWE-72B") model = AutoModelForCausalLM.from_pretrained("GAIR/OpenSWE-72B", device_map="auto") 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 GAIR/OpenSWE-72B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "GAIR/OpenSWE-72B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "GAIR/OpenSWE-72B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/GAIR/OpenSWE-72B
- SGLang
How to use GAIR/OpenSWE-72B 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 "GAIR/OpenSWE-72B" \ --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": "GAIR/OpenSWE-72B", "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 "GAIR/OpenSWE-72B" \ --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": "GAIR/OpenSWE-72B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use GAIR/OpenSWE-72B with Docker Model Runner:
docker model run hf.co/GAIR/OpenSWE-72B
Add files using upload-large-folder tool
Browse files- model-00000-of-00028.safetensors +3 -0
- model-00002-of-00028.safetensors +3 -0
- model-00006-of-00028.safetensors +3 -0
- model-00009-of-00028.safetensors +3 -0
- model-00011-of-00028.safetensors +3 -0
- model-00021-of-00028.safetensors +3 -0
- model-00023-of-00028.safetensors +3 -0
- model-00024-of-00028.safetensors +3 -0
model-00000-of-00028.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:1b06b0f0f583c49478303fd2ab0bb4ad39f00827652d1fd66f4a85af46d865a8
|
| 3 |
+
size 5309991440
|
model-00002-of-00028.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9c7a861e4de390a8810c0d953cb5ea7fd2706d9771113b36dc1ea9c270ede40d
|
| 3 |
+
size 5237139256
|
model-00006-of-00028.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bd90c2ea1d74a77e365a869b732b91afbac5e5e93c4002f5f7cafa13e5582f0e
|
| 3 |
+
size 5328864504
|
model-00009-of-00028.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:282912778946f54642573dfa47190e50cdbcd4afd13ece516f1c014b73fe70f7
|
| 3 |
+
size 5328864504
|
model-00011-of-00028.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d23bd159fae289975255de6bee52d92a31998133299dfc13ceec32ea6e2a13bd
|
| 3 |
+
size 5328864504
|
model-00021-of-00028.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e9c5f55bea63a7263227a46db0b84dbbcd6d70a5a8bdc6286daaca5d7c1e211a
|
| 3 |
+
size 5328864496
|
model-00023-of-00028.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3c2a3250e9dc520508c2d34bfae8aa6fe234034535fb581e680b714f86074995
|
| 3 |
+
size 5328864496
|
model-00024-of-00028.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0188103eec2dc2e4f2c0dca0227f18e645ae11fcf0a3a319c7114800fe271052
|
| 3 |
+
size 5328864496
|