Text Generation
Transformers
Safetensors
English
nexus
small-language-model
grounded-qa
vlm-decoder
visual-question-answering
hallucination-mitigation
conversational
custom_code
Instructions to use ifx-pse-sys-ml/flame-27m-grounded with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ifx-pse-sys-ml/flame-27m-grounded with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ifx-pse-sys-ml/flame-27m-grounded", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("ifx-pse-sys-ml/flame-27m-grounded", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ifx-pse-sys-ml/flame-27m-grounded with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ifx-pse-sys-ml/flame-27m-grounded" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ifx-pse-sys-ml/flame-27m-grounded", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ifx-pse-sys-ml/flame-27m-grounded
- SGLang
How to use ifx-pse-sys-ml/flame-27m-grounded 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 "ifx-pse-sys-ml/flame-27m-grounded" \ --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": "ifx-pse-sys-ml/flame-27m-grounded", "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 "ifx-pse-sys-ml/flame-27m-grounded" \ --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": "ifx-pse-sys-ml/flame-27m-grounded", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ifx-pse-sys-ml/flame-27m-grounded with Docker Model Runner:
docker model run hf.co/ifx-pse-sys-ml/flame-27m-grounded
card: general benchmark table vs flame-27m-instruct and SmolLM-135M-Instruct
Browse files
README.md
CHANGED
|
@@ -75,6 +75,51 @@ the model for copying the answer out of the context, which is exactly what a gro
|
|
| 75 |
do β it cost 32 points of accuracy in an earlier sweep (27 % vs 59 %). This model's `generate()`
|
| 76 |
accepts `penalize_prompt`, `no_repeat_ngram_size` and `repetition_penalty`.
|
| 77 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 78 |
## Reproducing the comparison
|
| 79 |
|
| 80 |
The numbers in the tables above come from a decoding **sweep**, not a single hand-picked setting.
|
|
|
|
| 75 |
do β it cost 32 points of accuracy in an earlier sweep (27 % vs 59 %). This model's `generate()`
|
| 76 |
accepts `penalize_prompt`, `no_repeat_ngram_size` and `repetition_penalty`.
|
| 77 |
|
| 78 |
+
## General benchmarks
|
| 79 |
+
|
| 80 |
+
Grounding was added without paying for it elsewhere. Measured with `lm-eval` on the usual
|
| 81 |
+
leaderboard metric per task (`acc_norm` where defined, else `acc`):
|
| 82 |
+
|
| 83 |
+
| task | flame-27m-instruct | **flame-27m-grounded** | SmolLM-135M-Instruct |
|
| 84 |
+
|---|---|---|---|
|
| 85 |
+
| hellaswag | 29.22 | 29.36 | **41.9** |
|
| 86 |
+
| arc_easy | 37.29 | 36.28 | **43.9** |
|
| 87 |
+
| arc_challenge | 22.61 | 23.89 | **27.4** |
|
| 88 |
+
| piqa | 59.30 | 59.30 | **67.0** |
|
| 89 |
+
| winogrande | 51.70 | 51.30 | 51.3 |
|
| 90 |
+
| openbookqa | 27.40 | 27.60 | **33.6** |
|
| 91 |
+
| mmlu | **24.88** | 24.23 | 24.4 |
|
| 92 |
+
| **average (7 above)** | 36.06 | **36.00** | **41.36** |
|
| 93 |
+
| boolq | 61.56 | **62.42** | β |
|
| 94 |
+
| lambada_openai | **26.00** | 25.25 | β |
|
| 95 |
+
| truthfulqa_mc2 | 43.85 | **44.29** | β |
|
| 96 |
+
| gpqa_diamond_zeroshot | 26.77 | **29.80** | β |
|
| 97 |
+
| **average (all 11)** | 37.33 | **37.61** | β |
|
| 98 |
+
| IFEval (instruction-level) | 0.24 | **0.48** | β |
|
| 99 |
+
|
| 100 |
+
**Against the model it replaces for VLM use**, the grounded checkpoint is a tie on general ability β
|
| 101 |
+
36.00 vs 36.06 on the seven comparable tasks, 37.61 vs 37.33 across eleven β while grounded VQA
|
| 102 |
+
accuracy goes 25.1% β 79.3% and POPE object-hallucination 96.1% β 21.6%. That is the whole point of
|
| 103 |
+
this checkpoint: the grounding is free.
|
| 104 |
+
|
| 105 |
+
**Against SmolLM-135M-Instruct**, flame is ~5.4 points behind on the seven-task average at **one
|
| 106 |
+
fifth the parameters**, and at parity on `winogrande` and `mmlu`. The gap is concentrated in
|
| 107 |
+
commonsense and science (`hellaswag` β12.5, `arc_easy` β7.6, `piqa` β7.7); it is capacity, not data
|
| 108 |
+
or tuning.
|
| 109 |
+
|
| 110 |
+
Reading notes, so the numbers are not over-read:
|
| 111 |
+
|
| 112 |
+
* A 27M model is near chance on most of these (`arc_challenge` 23.9 against 25 chance,
|
| 113 |
+
`mmlu` 24.2 against 25). Differences of a point or two are noise.
|
| 114 |
+
* `gpqa_diamond_zeroshot` has **198 items** at 25% chance β the +3.03 there is about six questions
|
| 115 |
+
and means nothing on its own.
|
| 116 |
+
* IFEval is ~0 for both flame models in absolute terms; doubling 0.24 β 0.48 is directional only.
|
| 117 |
+
* The SmolLM column is reproduced from the
|
| 118 |
+
[flame-27m-instruct](https://huggingface.co/ifx-pse-sys-ml/flame-27m-instruct) card. Its average
|
| 119 |
+
there (38.7) includes `commonsense_qa`, which this harness does not carry, so it is **recomputed
|
| 120 |
+
over the same seven tasks here (41.36)** to stay comparable. The four extra tasks and IFEval were
|
| 121 |
+
not run for SmolLM, hence the dashes.
|
| 122 |
+
|
| 123 |
## Reproducing the comparison
|
| 124 |
|
| 125 |
The numbers in the tables above come from a decoding **sweep**, not a single hand-picked setting.
|