Image-Text-to-Text
Transformers
Safetensors
qwen3_5
phai-ide
science
code
tool-use
sft
lora
conversational
Instructions to use AItonomy/PhAI-IDE-9B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use AItonomy/PhAI-IDE-9B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="AItonomy/PhAI-IDE-9B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("AItonomy/PhAI-IDE-9B") model = AutoModelForMultimodalLM.from_pretrained("AItonomy/PhAI-IDE-9B", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use AItonomy/PhAI-IDE-9B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AItonomy/PhAI-IDE-9B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AItonomy/PhAI-IDE-9B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/AItonomy/PhAI-IDE-9B
- SGLang
How to use AItonomy/PhAI-IDE-9B 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 "AItonomy/PhAI-IDE-9B" \ --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": "AItonomy/PhAI-IDE-9B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "AItonomy/PhAI-IDE-9B" \ --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": "AItonomy/PhAI-IDE-9B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use AItonomy/PhAI-IDE-9B with Docker Model Runner:
docker model run hf.co/AItonomy/PhAI-IDE-9B
Update README with verified ScienceAccelBench results
#2
by leyili6666 - opened
README.md
CHANGED
|
@@ -25,15 +25,15 @@ The training data is sourced from [AItonomy/ScienceIDE](https://huggingface.co/d
|
|
| 25 |
|
| 26 |
## Quick start
|
| 27 |
|
| 28 |
-
Use Transformers 5.16.1, PyTorch and Accelerate. The example loads the model, configuration and tokenizer directly from this repository.
|
| 29 |
|
| 30 |
```python
|
| 31 |
from transformers import AutoTokenizer, AutoModelForImageTextToText
|
| 32 |
|
| 33 |
model_id = "AItonomy/PhAI-IDE-9B"
|
| 34 |
-
tokenizer = AutoTokenizer.from_pretrained(model_id
|
| 35 |
model = AutoModelForImageTextToText.from_pretrained(
|
| 36 |
-
model_id, dtype="bfloat16", device_map="auto",
|
| 37 |
)
|
| 38 |
inputs = tokenizer.apply_chat_template(
|
| 39 |
[{"role": "user", "content": "Explain how to verify a numerical simulation."}],
|
|
@@ -45,32 +45,17 @@ print(tokenizer.decode(output[0, inputs["input_ids"].shape[1]:], skip_special_to
|
|
| 45 |
|
| 46 |
BF16 weights occupy approximately 18.82 GB, plus runtime memory and KV cache.
|
| 47 |
|
| 48 |
-
##
|
| 49 |
|
| 50 |
-
|
| 51 |
|
| 52 |
-
|
| 53 |
|
| 54 |
-
|
|
| 55 |
-
| --- | ---: | ---: | ---: |
|
| 56 |
-
|
|
| 57 |
-
|
|
| 58 |
-
|
|
| 59 |
-
| OpenBookQA (128-sample subset) | 33.59 | **35.16** | **+1.56** |
|
| 60 |
-
| GSM8K (128-sample subset) | 89.84 | **92.97** | **+3.12** |
|
| 61 |
-
|
| 62 |
-
### Comparison with published models
|
| 63 |
-
|
| 64 |
-
Scores (%); evaluation settings vary by source.
|
| 65 |
-
|
| 66 |
-
| Benchmark | Reference model | Parameters | Published score | PhAI-IDE-9B result | Source |
|
| 67 |
-
| --- | --- | ---: | ---: | ---: | --- |
|
| 68 |
-
| GSM8K | Llama-3.1-8B-Instruct | 8B | 84.5 | **92.97** | [Meta model card](https://huggingface.co/meta-llama/Llama-3.1-8B-Instruct#instruction-tuned-models) |
|
| 69 |
-
| GSM8K | Qwen2.5-7B-Instruct | 7B | 91.6 | **92.97** | [Qwen2.5 report, Table 8](https://arxiv.org/html/2412.15115v2#S5.SS2.SSS1) |
|
| 70 |
-
| GSM8K | Gemma-2-9B-IT | 9B | 76.7 | **92.97** | [Qwen2.5 report, Table 8](https://arxiv.org/html/2412.15115v2#S5.SS2.SSS1) |
|
| 71 |
-
| GSM8K | SciTulu-7B | 7B | 29.5 | **92.97** | [SciRIFF report, Table 7](https://arxiv.org/html/2406.07835v2#A3) |
|
| 72 |
-
| BBH word-sorting | Llama-3.1-8B-Instruct | 8.03B | 51.2 | **60.40** | [BenchLM independent results](https://huggingface.co/spaces/steampunque/benchlm/blob/d45e8600172857935610426f797a4429f2f136d6/README.md) |
|
| 73 |
-
| BBH word-sorting | Qwen2.5-7B-Instruct | 7.62B | 15.6 | **60.40** | [BenchLM independent results](https://huggingface.co/spaces/steampunque/benchlm/blob/d45e8600172857935610426f797a4429f2f136d6/README.md) |
|
| 74 |
|
| 75 |
## Training procedure
|
| 76 |
|
|
|
|
| 25 |
|
| 26 |
## Quick start
|
| 27 |
|
| 28 |
+
Use Transformers 5.16.1, PyTorch and Accelerate. The example loads the model, configuration and tokenizer directly from this repository.
|
| 29 |
|
| 30 |
```python
|
| 31 |
from transformers import AutoTokenizer, AutoModelForImageTextToText
|
| 32 |
|
| 33 |
model_id = "AItonomy/PhAI-IDE-9B"
|
| 34 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
| 35 |
model = AutoModelForImageTextToText.from_pretrained(
|
| 36 |
+
model_id, dtype="bfloat16", device_map="auto",
|
| 37 |
)
|
| 38 |
inputs = tokenizer.apply_chat_template(
|
| 39 |
[{"role": "user", "content": "Explain how to verify a numerical simulation."}],
|
|
|
|
| 45 |
|
| 46 |
BF16 weights occupy approximately 18.82 GB, plus runtime memory and KV cache.
|
| 47 |
|
| 48 |
+
## ScienceAccelBench performance
|
| 49 |
|
| 50 |
+
Across all 27 ScienceAccelBench environments, the task-pooled pass rate increases from **17.09% to 20.89% (+3.80 percentage points)** on **158 valid paired tasks**.
|
| 51 |
|
| 52 |
+
Task-held-out, localized scientific-code repair on familiar codebases, with original numerical verification. Pass rates (%); gains in percentage points.
|
| 53 |
|
| 54 |
+
| Environment | Tasks | Qwen3.5-9B | PhAI-IDE-9B | Gain (pp) |
|
| 55 |
+
| --- | ---: | ---: | ---: | ---: |
|
| 56 |
+
| laps | 16 | 31.25 | **50.00** | **+18.75** |
|
| 57 |
+
| mitgcm-biogeo | 8 | 0.00 | **12.50** | **+12.50** |
|
| 58 |
+
| pluto-rmhd-resrmhd | 7 | 0.00 | **28.57** | **+28.57** |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
|
| 60 |
## Training procedure
|
| 61 |
|