baban commited on
Commit
5ead207
·
verified ·
1 Parent(s): 48027f3

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +51 -37
README.md CHANGED
@@ -1,49 +1,63 @@
1
  ---
2
- datasets:
3
- - ai4bharat/samanantar
4
- language:
5
- - en
6
- - hi
7
- metrics:
8
- - bleu
9
- - chrf
10
- base_model:
11
- - meta-llama/Llama-3.2-1B
12
- pipeline_tag: text-generation
13
  ---
14
 
15
- ### Inference script
16
- ```
17
- import torch
18
- from transformers import AutoTokenizer, AutoModelForCausalLM
19
 
20
- # Load tokenizer and model
21
- model_name = "baban/MT_En_Hindi"
22
- tokenizer = AutoTokenizer.from_pretrained(model_name)
23
- model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16, device_map="auto")
24
 
25
- source_text = "The weather is nice today."
26
- prompt = f"Translate the following English sentence to Hindi:\n{source_text}"
 
 
27
 
28
- messages = [
29
- {"role": "user", "content": prompt}
30
- ]
31
 
32
- # Tokenize the formatted input
33
- input_ids = tokenizer.apply_chat_template(messages, return_tensors="pt").to(model.device)
34
 
 
35
 
36
- with torch.no_grad():
37
- output_ids = model.generate(
38
- input_ids=input_ids,
39
- max_new_tokens=100,
40
- do_sample=False
41
- )
42
 
 
43
 
44
- # Decode and print only the new tokens (the response)
45
- response = tokenizer.decode(output_ids[0][input_ids.shape[-1]:], skip_special_tokens=True)
46
- print("\n=== Translation ===")
47
- print(response)
48
 
49
- ```
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ library_name: transformers
3
+ license: other
4
+ base_model: meta-llama/Llama-3.2-1B
5
+ tags:
6
+ - llama-factory
7
+ - full
8
+ - generated_from_trainer
9
+ model-index:
10
+ - name: MT_En_Hindi
11
+ results: []
 
12
  ---
13
 
14
+ <!-- This model card has been generated automatically according to the information the Trainer had access to. You
15
+ should probably proofread and complete it, then remove this comment. -->
 
 
16
 
17
+ # MT_En_Hindi
 
 
 
18
 
19
+ This model is a fine-tuned version of [meta-llama/Llama-3.2-1B](https://huggingface.co/meta-llama/Llama-3.2-1B) on the MT_En_Hindi dataset.
20
+ It achieves the following results on the evaluation set:
21
+ - Loss: 0.5924
22
+ - Num Input Tokens Seen: 6566229120
23
 
24
+ ## Model description
 
 
25
 
26
+ More information needed
 
27
 
28
+ ## Intended uses & limitations
29
 
30
+ More information needed
 
 
 
 
 
31
 
32
+ ## Training and evaluation data
33
 
34
+ More information needed
 
 
 
35
 
36
+ ## Training procedure
37
+
38
+ ### Training hyperparameters
39
+
40
+ The following hyperparameters were used during training:
41
+ - learning_rate: 5e-05
42
+ - train_batch_size: 16
43
+ - eval_batch_size: 16
44
+ - seed: 42
45
+ - distributed_type: multi-GPU
46
+ - num_devices: 8
47
+ - gradient_accumulation_steps: 8
48
+ - total_train_batch_size: 1024
49
+ - total_eval_batch_size: 128
50
+ - optimizer: Use OptimizerNames.ADAMW_TORCH with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
51
+ - lr_scheduler_type: inverse_sqrt
52
+ - num_epochs: 3.0
53
+
54
+ ### Training results
55
+
56
+
57
+
58
+ ### Framework versions
59
+
60
+ - Transformers 4.52.4
61
+ - Pytorch 2.7.0+cu128
62
+ - Datasets 3.6.0
63
+ - Tokenizers 0.21.1