VizuaraAI commited on
Commit
06996a5
·
verified ·
1 Parent(s): 163aba0

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +42 -0
README.md ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ tags:
4
+ - pytorch
5
+ - language-model
6
+ - gpt
7
+ ---
8
+
9
+ # LLM 114M Parameters
10
+
11
+ This is a 114M parameter language model trained on 10 billion tokens.
12
+
13
+ ## Model Details
14
+ - Parameters: 114,150,144
15
+ - Training tokens: 10 billion
16
+ - Architecture: GPT-style transformer
17
+
18
+ ## Usage
19
+ ```python
20
+ import torch
21
+ from Model import LLM, params
22
+ import tiktoken
23
+
24
+ # Load tokenizer
25
+ tokenizer = tiktoken.get_encoding("gpt2")
26
+
27
+ # Load model
28
+ device = "cuda" if torch.cuda.is_available() else "cpu"
29
+ model = LLM(params, tokenizer, device)
30
+ model.load_state_dict(torch.load("best_model_state-114m.bin"))
31
+ model.eval()
32
+
33
+ # Generate text
34
+ output = model.generate(
35
+ "Hello, I am",
36
+ max_gen_len=50,
37
+ temperature=0.6,
38
+ top_p=0.9,
39
+ top_k=32
40
+ )
41
+ print(output)
42
+ ```