Text Generation
Transformers
Safetensors
gemma3
image-text-to-text
moral reasoning
value reasoning
persona
chain-of-thought
conversational
text-generation-inference
Instructions to use launch/MET-D-Gemma3-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use launch/MET-D-Gemma3-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="launch/MET-D-Gemma3-4B") 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("launch/MET-D-Gemma3-4B") model = AutoModelForMultimodalLM.from_pretrained("launch/MET-D-Gemma3-4B", 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 launch/MET-D-Gemma3-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "launch/MET-D-Gemma3-4B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "launch/MET-D-Gemma3-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/launch/MET-D-Gemma3-4B
- SGLang
How to use launch/MET-D-Gemma3-4B 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 "launch/MET-D-Gemma3-4B" \ --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": "launch/MET-D-Gemma3-4B", "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 "launch/MET-D-Gemma3-4B" \ --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": "launch/MET-D-Gemma3-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use launch/MET-D-Gemma3-4B with Docker Model Runner:
docker model run hf.co/launch/MET-D-Gemma3-4B
| license: gemma | |
| library_name: transformers | |
| base_model: google/gemma-3-4b-it | |
| pipeline_tag: text-generation | |
| tags: | |
| - moral reasoning | |
| - value reasoning | |
| - persona | |
| - chain-of-thought | |
| language: | |
| - en | |
| - es | |
| - hi | |
| - ko | |
| - ms | |
| - zh | |
| # Model Card for MET-D-Gemma3-4B | |
| MET-D-Gemma3-4B is a multilingual moral reasoning model fine-tuned from [Gemma-3-4B-it](https://huggingface.co/google/gemma-3-4b-it). Given a moral dilemma, a character description, and a candidate action, it judges the action from that character's perspective and explains its judgment with an explicit chain-of-thought before answering. Moral dilemmas rarely have a single correct answer, which makes reasoning traces hard to verify. We address this by introducing a character perspective that yields a ground-truth answer, which is used for rejection-sampling the model's own reasoning traces, conditioned on a per-language, per-situation selection of theoretical grounds. Both the reasoning trace and the final answer are generated in whichever language the prompt is written in, so non-English speakers get legible reasoning in their own language. | |
| ## Model Details | |
| - **Base model:** google/gemma-3-4b-it | |
| - **Task:** for a given `(situation, character description, action)` triple, answer two questions from the character's perspective: | |
| 1. Is the action acceptable? (`Yes` / `No` / `Ambiguous`) | |
| 2. Would (not) doing it be emotionally/mentally discomforting? (`Yes` / `No`) | |
| - **Training data:** self-generated reasoning traces, rejection-sampled against the ground truth per character perspective, covering six languages (English, Spanish, Hindi, Korean, Malay, Chinese) | |
| - **Language coverage:** this checkpoint is trained on **all 6 languages combined**. Single-language variants are also available (see [Model Variants](#model-variants) below). | |
| - **License:** [Gemma Terms of Use](https://ai.google.dev/gemma/terms) (inherited from the base model) | |
| ## How to Get Started | |
| ```python | |
| from transformers import AutoTokenizer | |
| from vllm import LLM, SamplingParams | |
| model_id = "launch/MET-D-Gemma3-4B" | |
| tokenizer = AutoTokenizer.from_pretrained(model_id) | |
| llm = LLM(model=model_id, max_model_len=16384) | |
| situation = "..." # the moral dilemma narrative | |
| character = "..." # the character description | |
| action = "..." # the candidate action to judge | |
| prompt = f"""I will provide you a moral dilemma and present you with a character description and questions. | |
| The answer for the first question should be Yes, No, or Ambiguous, and the answer for the second question should be Yes or No. | |
| You should strictly adhere to the output format, since it would be automatically parsed. | |
| Make sure to output both the "Reason:" and "Answer:" for all 2 questions. | |
| Situation: | |
| {situation} | |
| Character Description: | |
| {character} | |
| Question: | |
| 1. From A's perspective, would the following action be deemed acceptable? "{action}" | |
| 2. If the previous answer is yes, would A find doing the action mentally or emotionally discomforting? Conversely, if the previous answer is no, would A find not doing the action discomforting? | |
| Your Answer: | |
| 1. Reason: {{Reason}} Answer: {{Yes/No/Ambiguous}} | |
| 2. Reason: {{Reason}} Answer: {{Yes/No}} | |
| """ | |
| chat_prompt = tokenizer.apply_chat_template( | |
| [{"role": "user", "content": prompt}], | |
| tokenize=False, | |
| add_generation_prompt=True, | |
| ) | |
| sampling_params = SamplingParams(temperature=0.0, max_tokens=2048) | |
| outputs = llm.generate(chat_prompt, sampling_params) | |
| print(outputs[0].outputs[0].text) | |
| ``` | |
| ## Model Variants | |
| This checkpoint is part of the [MET collection](https://huggingface.co/collections/launch/met), which includes the same task across base models and language subsets: | |
| | Repo | Base model | Language(s) | | |
| |---|---|---| | |
| | `launch/MET-D-Qwen3-4B` | Qwen3-4B | all 6 (mixed) | | |
| | `launch/MET-D-Qwen3-4B-en-only` | Qwen3-4B | English only | | |
| | `launch/MET-D-Qwen3-4B-es-only` | Qwen3-4B | Spanish only | | |
| | `launch/MET-D-Qwen3-4B-hi-only` | Qwen3-4B | Hindi only | | |
| | `launch/MET-D-Qwen3-4B-ko-only` | Qwen3-4B | Korean only | | |
| | `launch/MET-D-Qwen3-4B-ms-only` | Qwen3-4B | Malay only | | |
| | `launch/MET-D-Qwen3-4B-zh-only` | Qwen3-4B | Chinese only | | |
| | `launch/MET-D-Qwen3-8B` | Qwen3-8B | all 6 (mixed) | | |
| | `launch/MET-D-Qwen3-8B-en-only` | Qwen3-8B | English only | | |
| | `launch/MET-D-Gemma3-4B` | Gemma-3-4B-it | all 6 (mixed) | | |
| | `launch/MET-D-Gemma3-4B-en-only` | Gemma-3-4B-it | English only | | |
| ## Citation | |
| If you use this, please cite: | |
| ```bibtex | |
| @article{lee2026met, | |
| title={MET: Theory-Grounded and Culture-Aware Multilingual Moral Reasoning}, | |
| author={Lee, Ayoung and Kwon, Ryan and Zhang, Yunxiang and Liu, Yuxuan and Railton, Peter and Wang, Lu}, | |
| journal={arXiv preprint arXiv:2607.11736}, | |
| year={2026} | |
| } | |
| ``` | |