0.13.0.dev01base_model: google/gemma-3-1b-it
2# optionally might have model_type or tokenizer_type
3model_type: AutoModelForCausalLM
4tokenizer_type: AutoTokenizer
5# Automatically upload checkpoint and final model to HF
6# hub_model_id: username/custom_model_name
7
8# gemma3 doesn't seem to play nice with ddp
9ddp_find_unused_parameters: true
10
11load_in_8bit: false
12load_in_4bit: false
13
14# huggingface repo
15chat_template: gemma3
16eot_tokens:
17 - <end_of_turn>
18datasets:
19 - path: sam2ai/en-oriya-translation
20 type: chat_template
21 field_messages: conversations
22 message_property_mappings:
23 role: from
24 content: value
25 roles:
26 assistant:
27 - gpt
28 user:
29 - human
30
31val_set_size: 0.0
32output_dir: ./outputs/gemma3-1b
33
34 #adapter: qlora
35 #lora_r: 32
36 #lora_alpha: 16
37 #lora_dropout: 0.05
38 #lora_target_linear: true
39
40sequence_len: 2048
41sample_packing: true
42eval_sample_packing: false
43
44
45wandb_project: gemma3-en-odia-mt
46wandb_entity:
47wandb_watch:
48wandb_name: gemma3-1b
49wandb_log_model:
50
51
52gradient_accumulation_steps: 4
53micro_batch_size: 1
54num_epochs: 4
55optimizer: adamw_bnb_8bit
56lr_scheduler: cosine
57learning_rate: 0.0002
58
59bf16: auto
60tf32: false
61
62gradient_checkpointing: true
63gradient_checkpointing_kwargs:
64 use_reentrant: false
65resume_from_checkpoint:
66logging_steps: 1
67flash_attention: true
68
69warmup_ratio: 0.1
70evals_per_epoch:
71saves_per_epoch: 1
72weight_decay: 0.0
73special_tokens:
74
75# save_first_step: true # uncomment this to validate checkpoint saving works with your config
761# Load model directly
2from transformers import AutoTokenizer, AutoModelForCausalLM
3
4tokenizer = AutoTokenizer.from_pretrained("sam2ai/gemma3-1b-en-odia-mt")
5model = AutoModelForCausalLM.from_pretrained("sam2ai/gemma3-1b-en-odia-mt")
6messages = [
7 {
8 "role": "system",
9 "content": "You are a helpful assistant who is an expert in linguist specializing in English and Odia."
10 },
11 {
12 "role": "user",
13 "content": "Translate English to Odia : A medical officer has been assigned to each ward."
14 }
15]
16inputs = tokenizer.apply_chat_template(
17 messages,
18 add_generation_prompt=True,
19 tokenize=True,
20 return_dict=True,
21 return_tensors="pt",
22 eos_token_id=tokenizer.eos_token_id
23).to(model.device)
24
25outputs = model.generate(**inputs, max_new_tokens=40)
26print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:]))