pmking27 commited on
Commit
4117a1b
·
verified ·
1 Parent(s): 826f0f7

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +57 -0
README.md CHANGED
@@ -34,4 +34,61 @@ pipeline_tag: text-generation
34
 
35
  This gemma model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
36
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
  [<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
 
34
 
35
  This gemma model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
36
 
37
+ ### Running Model:
38
+
39
+ ```python
40
+ from transformers import AutoModelForCausalLM, AutoTokenizer
41
+
42
+ tokenizer = AutoTokenizer.from_pretrained("pmking27/PrathameshLLM-7B")
43
+ model = AutoModelForCausalLM.from_pretrained("pmking27/PrathameshLLM-7B")
44
+
45
+ alpaca_prompt = """
46
+ ### Instruction:
47
+ {}
48
+
49
+ ### Input:
50
+ {}
51
+
52
+ ### Response:
53
+ {}"""
54
+
55
+ inputs = tokenizer(
56
+ [
57
+ alpaca_prompt.format(
58
+ '''You're an assistant trained to answer questions using the given context.
59
+ context:
60
+ General elections will be held in India from 19 April 2024 to 1 June 2024 to elect the 543 members of the 18th Lok Sabha. The elections will be held in seven phases and the results will be announced on 4 June 2024. This will be the largest-ever election in the world, surpassing the 2019 Indian general election, and will be the longest-held general elections in India with a total span of 44 days (excluding the first 1951–52 Indian general election). The incumbent prime minister Narendra Modi who completed a second term will be contesting elections for a third consecutive term.
61
+
62
+ Approximately 960 million individuals out of a population of 1.4 billion are eligible to participate in the elections, which are expected to span a month for completion. The Legislative assembly elections in the states of Andhra Pradesh, Arunachal Pradesh, Odisha, and Sikkim will be held simultaneously with the general election, along with the by-elections for 35 seats among 16 states.
63
+ ''', # instruction
64
+ "भारतातील सार्वत्रिक निवडणुका किती टप्प्यात पार पडतील?", # input
65
+ "", # output - leave this blank for generation!
66
+ )
67
+ ], return_tensors = "pt").to("cuda")
68
+ outputs = model.generate(**inputs, max_new_tokens = 100)
69
+ result=tokenizer.batch_decode(outputs)[0]
70
+ print(result)
71
+ ```
72
+
73
+ ### Output:
74
+
75
+ ```markdown
76
+ <bos>
77
+ ### Instruction:
78
+ You're an assistant trained to answer questions using the given context.
79
+ context:
80
+ General elections will be held in India from 19 April 2024 to 1 June 2024 to elect the 543 members of the 18th Lok Sabha. The elections will be held in seven phases and the results will be announced on 4 June 2024. This will be the largest-ever election in the world, surpassing the 2019 Indian general election, and will be the longest-held general elections in India with a total span of 44 days (excluding the first 1951–52 Indian general election). The incumbent prime minister Narendra Modi who completed a second term will be contesting elections for a third consecutive term.
81
+
82
+ Approximately 960 million individuals out of a population of 1.4 billion are eligible to participate in the elections, which are expected to span a month for completion. The Legislative assembly elections in the states of Andhra Pradesh, Arunachal Pradesh, Odisha, and Sikkim will be held simultaneously with the general election, along with the by-elections for 35 seats among 16 states.
83
+
84
+
85
+ ### Input:
86
+ भारतातील सार्वत्रिक निवडणुका किती टप्प्यात पार पडतील?
87
+
88
+ ### Response:
89
+ भारतातील सार्वत्रिक निवडणुका 7 टप्प्यांमध्ये पार पडतील.<eos>
90
+ ```
91
+
92
+
93
+
94
  [<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)