Image-Text-to-Text
Transformers
Safetensors
gemma4
fp8
vllm
llm-compressor
compressed-tensors
conversational
Instructions to use RedHatAI/gemma-4-31B-it-FP8-dynamic with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use RedHatAI/gemma-4-31B-it-FP8-dynamic with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="RedHatAI/gemma-4-31B-it-FP8-dynamic") 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("RedHatAI/gemma-4-31B-it-FP8-dynamic") model = AutoModelForMultimodalLM.from_pretrained("RedHatAI/gemma-4-31B-it-FP8-dynamic", 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 RedHatAI/gemma-4-31B-it-FP8-dynamic with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "RedHatAI/gemma-4-31B-it-FP8-dynamic" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "RedHatAI/gemma-4-31B-it-FP8-dynamic", "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/RedHatAI/gemma-4-31B-it-FP8-dynamic
- SGLang
How to use RedHatAI/gemma-4-31B-it-FP8-dynamic 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 "RedHatAI/gemma-4-31B-it-FP8-dynamic" \ --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": "RedHatAI/gemma-4-31B-it-FP8-dynamic", "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 "RedHatAI/gemma-4-31B-it-FP8-dynamic" \ --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": "RedHatAI/gemma-4-31B-it-FP8-dynamic", "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 RedHatAI/gemma-4-31B-it-FP8-dynamic with Docker Model Runner:
docker model run hf.co/RedHatAI/gemma-4-31B-it-FP8-dynamic
Add eval results: gsm8k_platinum.json
Browse files
every_eval_ever/gsm8k_platinum.json
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"schema_version": "0.2.2",
|
| 3 |
+
"evaluation_id": "gsm8k_platinum_cot_llama/RedHatAI/gemma-4-31B-it-FP8-Dynamic/1781644883.581219",
|
| 4 |
+
"evaluation_timestamp": "1781235616",
|
| 5 |
+
"retrieved_timestamp": "1781644883.581219",
|
| 6 |
+
"source_metadata": {
|
| 7 |
+
"source_name": "lm-evaluation-harness",
|
| 8 |
+
"source_type": "evaluation_run",
|
| 9 |
+
"source_organization_name": "RedHatAI",
|
| 10 |
+
"evaluator_relationship": "third_party"
|
| 11 |
+
},
|
| 12 |
+
"eval_library": {
|
| 13 |
+
"name": "lm_eval",
|
| 14 |
+
"version": "0.4.13.dev0"
|
| 15 |
+
},
|
| 16 |
+
"model_info": {
|
| 17 |
+
"name": "RedHatAI/gemma-4-31B-it-FP8-Dynamic",
|
| 18 |
+
"id": "RedHatAI/gemma-4-31B-it-FP8-Dynamic",
|
| 19 |
+
"developer": "RedHatAI",
|
| 20 |
+
"additional_details": {
|
| 21 |
+
"model_args": "{'model': 'RedHatAI/gemma-4-31B-it-FP8-Dynamic', 'max_length': 36096, 'base_url': 'http://127.0.0.1:8000/v1/chat/completions', 'num_concurrent': 128, 'max_retries': 3, 'tokenized_requests': False, 'tokenizer_backend': None, 'timeout': 1200}",
|
| 22 |
+
"num_seeds_merged": "3"
|
| 23 |
+
}
|
| 24 |
+
},
|
| 25 |
+
"evaluation_results": [
|
| 26 |
+
{
|
| 27 |
+
"evaluation_name": "gsm8k_platinum_cot_llama/strict-match",
|
| 28 |
+
"source_data": {
|
| 29 |
+
"dataset_name": "gsm8k_platinum_cot_llama",
|
| 30 |
+
"source_type": "hf_dataset",
|
| 31 |
+
"hf_repo": "madrylab/gsm8k-platinum",
|
| 32 |
+
"hf_split": "test"
|
| 33 |
+
},
|
| 34 |
+
"metric_config": {
|
| 35 |
+
"evaluation_description": "exact_match (filter: strict-match)",
|
| 36 |
+
"lower_is_better": false,
|
| 37 |
+
"score_type": "continuous",
|
| 38 |
+
"min_score": 0.0,
|
| 39 |
+
"max_score": 1.0
|
| 40 |
+
},
|
| 41 |
+
"score_details": {
|
| 42 |
+
"score": 0.9583677970774745,
|
| 43 |
+
"details": {
|
| 44 |
+
"seed_scores": "[0.9586435070306039, 0.9586435070306039, 0.9578163771712159]",
|
| 45 |
+
"evaluation_timestamps": "[1781235616, 1781235679, 1781235740]",
|
| 46 |
+
"seed_values": "[1234, 2345, 3456]"
|
| 47 |
+
},
|
| 48 |
+
"uncertainty": {
|
| 49 |
+
"standard_error": {
|
| 50 |
+
"value": 0.00027570995312931057,
|
| 51 |
+
"method": "across_seeds"
|
| 52 |
+
},
|
| 53 |
+
"num_samples": 3
|
| 54 |
+
}
|
| 55 |
+
},
|
| 56 |
+
"generation_config": {
|
| 57 |
+
"generation_args": {
|
| 58 |
+
"temperature": 1.0,
|
| 59 |
+
"top_p": 0.95,
|
| 60 |
+
"top_k": 64.0,
|
| 61 |
+
"max_tokens": 32000,
|
| 62 |
+
"max_attempts": 1
|
| 63 |
+
},
|
| 64 |
+
"additional_details": {
|
| 65 |
+
"do_sample": "true",
|
| 66 |
+
"until": "[\"<|eot_id|>\", \"<|start_header_id|>user<|end_header_id|>\", \"Q:\", \"</s>\", \"<|im_end|>\"]",
|
| 67 |
+
"seed": "1234",
|
| 68 |
+
"num_fewshot": "0"
|
| 69 |
+
}
|
| 70 |
+
}
|
| 71 |
+
},
|
| 72 |
+
{
|
| 73 |
+
"evaluation_name": "gsm8k_platinum_cot_llama/flexible-extract",
|
| 74 |
+
"source_data": {
|
| 75 |
+
"dataset_name": "gsm8k_platinum_cot_llama",
|
| 76 |
+
"source_type": "hf_dataset",
|
| 77 |
+
"hf_repo": "madrylab/gsm8k-platinum",
|
| 78 |
+
"hf_split": "test"
|
| 79 |
+
},
|
| 80 |
+
"metric_config": {
|
| 81 |
+
"evaluation_description": "exact_match (filter: flexible-extract)",
|
| 82 |
+
"lower_is_better": false,
|
| 83 |
+
"score_type": "continuous",
|
| 84 |
+
"min_score": 0.0,
|
| 85 |
+
"max_score": 1.0
|
| 86 |
+
},
|
| 87 |
+
"score_details": {
|
| 88 |
+
"score": 0.9586435070306039,
|
| 89 |
+
"details": {
|
| 90 |
+
"seed_scores": "[0.9586435070306039, 0.9586435070306039, 0.9586435070306039]",
|
| 91 |
+
"evaluation_timestamps": "[1781235616, 1781235679, 1781235740]",
|
| 92 |
+
"seed_values": "[1234, 2345, 3456]"
|
| 93 |
+
},
|
| 94 |
+
"uncertainty": {
|
| 95 |
+
"standard_error": {
|
| 96 |
+
"value": 0.0,
|
| 97 |
+
"method": "across_seeds"
|
| 98 |
+
},
|
| 99 |
+
"num_samples": 3
|
| 100 |
+
}
|
| 101 |
+
},
|
| 102 |
+
"generation_config": {
|
| 103 |
+
"generation_args": {
|
| 104 |
+
"temperature": 1.0,
|
| 105 |
+
"top_p": 0.95,
|
| 106 |
+
"top_k": 64.0,
|
| 107 |
+
"max_tokens": 32000,
|
| 108 |
+
"max_attempts": 1
|
| 109 |
+
},
|
| 110 |
+
"additional_details": {
|
| 111 |
+
"do_sample": "true",
|
| 112 |
+
"until": "[\"<|eot_id|>\", \"<|start_header_id|>user<|end_header_id|>\", \"Q:\", \"</s>\", \"<|im_end|>\"]",
|
| 113 |
+
"seed": "1234",
|
| 114 |
+
"num_fewshot": "0"
|
| 115 |
+
}
|
| 116 |
+
}
|
| 117 |
+
}
|
| 118 |
+
]
|
| 119 |
+
}
|