RajuKandasamy commited on
Commit
30a9e3a
1 Parent(s): f5f37bf

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +68 -0
README.md ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - ta
5
+ library_name: transformers
6
+ pipeline_tag: text-generation
7
+ ---
8
+ # Model Card for Model ID
9
+
10
+ <!-- Provide a quick summary of what the model is/does. -->
11
+
12
+ This model is trained on PonniyinSelvan tamil corpus dataset.
13
+
14
+ ## Model Details
15
+ Base model used is EleutherAI's Pythia 1.4b
16
+ ### Model Description
17
+
18
+
19
+ - **Finetuned from model [optional]:** Pythia 1.4b
20
+
21
+
22
+ ## Uses
23
+
24
+ Purely education and research purposes only. Not fit for any kind of practical use.
25
+
26
+
27
+
28
+ ## Bias, Risks, and Limitations
29
+
30
+ The base model Bias, Risks and Limitations apply
31
+
32
+
33
+ ## How to Get Started with the Model
34
+ ```python
35
+ import torch
36
+ from transformers import AutoTokenizer, AutoModelForCausalLM
37
+
38
+ model_path = "RajuKandasamy/ponniyinselvan_1.4b_alpha"
39
+ device = "cuda" if torch.cuda.is_available() else "cpu"
40
+ model = AutoModelForCausalLM.from_pretrained(model_path, load_in_8bit=False).to(device)
41
+
42
+ tokenizer = AutoTokenizer.from_pretrained(model_path)
43
+
44
+ model.eval()
45
+
46
+ prompt="""வந்தியத்தேவன்"""
47
+ input_ids = tokenizer.encode(prompt, return_tensors="pt").to(model.device)
48
+ attention_mask = torch.ones_like(input_ids).to(model.device) # set attention mask to 1 for all input tokens
49
+ print("Thinking ...\n ")
50
+ with torch.no_grad():
51
+ output = model.generate(input_ids=input_ids, attention_mask=attention_mask, max_length=256, early_stopping=False, temperature=0.9, top_p=0.9,top_k=500, do_sample=True,output_scores=True, pad_token_id=tokenizer.eos_token_id, repetition_penalty=1.2,eos_token_id=tokenizer.eos_token_id)
52
+ output_str = tokenizer.decode(output[0], skip_special_tokens=False)
53
+ print(output_str)
54
+ ```
55
+
56
+ ## Training Details
57
+
58
+ 10 epochs
59
+
60
+ ### Training Data
61
+
62
+ ponniyinselvan text corpus
63
+
64
+ ### Training Procedure
65
+
66
+ Casual Language Modelling, With custom BPE tokenizer
67
+
68
+