Views
No views yet
Note: Do not load this model with vLLM's--quantization fp8flag — the checkpoint is already quantized and identifies itself viaconfig.json. vLLM's on-the-fly FP8 flag is broken for multimodal Gemma 3 (it silently quantizes the vision tower and produces garbage image outputs); this pre-quantized checkpoint avoids that bug.
1from vllm import LLM, SamplingParams
2
3llm = LLM(model="INSAIT-Institute/MamayLM-Gemma-3-27B-IT-v2.0-FP8-dynamic")
4params = SamplingParams(max_tokens=512, temperature=0.2)
5
6messages = [
7 {
8 "role": "user",
9 "content": [{"type": "text", "text": "Коли був заснований Київський університет?"}],
10 },
11]
12
13outputs = llm.chat(messages, sampling_params=params)
14print(outputs[0].outputs[0].text)vllm serve INSAIT-Institute/MamayLM-Gemma-3-27B-IT-v2.0-FP8-dynamic1from transformers import AutoProcessor, Gemma3ForConditionalGeneration
2import torch
3
4model_id = "INSAIT-Institute/MamayLM-Gemma-3-27B-IT-v2.0-FP8-dynamic"
5
6processor = AutoProcessor.from_pretrained(model_id)
7model = Gemma3ForConditionalGeneration.from_pretrained(
8 model_id, device_map="auto"
9).eval()
10
11messages = [
12 {
13 "role": "user",
14 "content": [{"type": "text", "text": "Коли був заснований Київський університет?"}],
15 },
16]
17
18inputs = processor.apply_chat_template(
19 messages, add_generation_prompt=True, tokenize=True,
20 return_dict=True, return_tensors="pt"
21).to(model.device, dtype=torch.bfloat16)
22
23input_len = inputs["input_ids"].shape[-1]
24
25with torch.inference_mode():
26 generation = model.generate(**inputs, max_new_tokens=512, do_sample=True, temperature=0.2)
27 generation = generation[0][input_len:]
28
29print(processor.decode(generation, skip_special_tokens=True))1messages = [
2 {
3 "role": "user",
4 "content": [
5 {"type": "image", "image": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/bee.jpg"},
6 {"type": "text", "text": "Опиши, що ти бачиш на зображенні."},
7 ],
8 },
9]
10
11inputs = processor.apply_chat_template(
12 messages, add_generation_prompt=True, tokenize=True,
13 return_dict=True, return_tensors="pt"
14).to(model.device, dtype=torch.bfloat16)
15
16input_len = inputs["input_ids"].shape[-1]
17
18with torch.inference_mode():
19 generation = model.generate(**inputs, max_new_tokens=512, do_sample=True, temperature=0.2)
20 generation = generation[0][input_len:]
21
22print(processor.decode(generation, skip_special_tokens=True))