thefutureofai commited on
Commit
872eb56
·
verified ·
1 Parent(s): e338ca8

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +28 -17
README.md CHANGED
@@ -1,24 +1,42 @@
1
  ---
2
  license: mit
 
 
 
 
 
 
 
 
 
3
  ---
4
- **Lazarus, the best small LLM**
5
 
6
- Lazarus is a next-generation LLM based off of GPT2-medium and distilled from Llama3 3b using the vicgalle/alpaca-gpt4 dataset.
7
 
8
- Lazarus shows exceptional understanding of questions and reasoning compared to other small models its size. Much better, larger model sizes are coming.
9
 
10
- Here are some of Lazarus's responses:
11
 
12
- User: what is AI?
13
- Lazarus: Artificial Intelligence (AI) is a technology that helps humans solve complex problems and communicate with each other. It can help humans solve complex problems by analyzing and modeling data, and can help them understand complex information.
 
 
 
 
 
 
 
14
 
15
- User: what is the Pythagorean Theorem?
16
- Lazarus: The pythagorean theorem is a theorem used to find the hypotenuse of a triangle.
 
17
 
18
- Here is the code to run:
19
 
20
- python3 '''
 
21
 
 
22
  from transformers import AutoTokenizer, AutoModelForCausalLM
23
  import torch
24
 
@@ -47,10 +65,7 @@ def chat():
47
  if user_input.lower() == "exit":
48
  break
49
 
50
- # Add user's message
51
  chat_history.append(f"You: {user_input}")
52
-
53
- # Keep last 3 exchanges (6 lines)
54
  recent_history = chat_history[-6:]
55
  full_prompt = system_prompt + "\n".join(recent_history) + "\nAI:"
56
 
@@ -68,11 +83,9 @@ def chat():
68
  eos_token_id=tokenizer.eos_token_id
69
  )
70
 
71
- # Extract model's new output portion
72
  response = tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True)
73
  response = response.strip()
74
 
75
- # Filter out low-quality or empty responses
76
  bad_responses = {"I hope that", "I don't know", "", "I'm excited"}
77
  if response in bad_responses:
78
  print("AI: [Regenerating due to low-quality response]")
@@ -83,5 +96,3 @@ def chat():
83
 
84
  if __name__ == "__main__":
85
  chat()
86
-
87
- '''
 
1
  ---
2
  license: mit
3
+ tags:
4
+ - gpt2
5
+ - distilled
6
+ - small-llm
7
+ - llama3
8
+ - alpaca
9
+ - reasoning
10
+ - chatbot
11
+ - conversational
12
  ---
 
13
 
14
+ # Lazarus The Best Small LLM
15
 
16
+ **Lazarus** is a next-generation small LLM based on `gpt2-medium`, distilled from LLaMA 3 3B using the [`vicgalle/alpaca-gpt4`](https://huggingface.co/datasets/vicgalle/alpaca-gpt4) dataset.
17
 
18
+ Lazarus demonstrates exceptional performance for its size, especially in question understanding and step-by-step reasoning — outperforming many small LLMs. Larger versions are in development.
19
 
20
+ ---
21
+
22
+ ## 🔍 Example Responses
23
+
24
+ **User:** What is AI?
25
+ **Lazarus:** Artificial Intelligence (AI) is a technology that helps humans solve complex problems and communicate with each other. It can help humans solve complex problems by analyzing and modeling data, and can help them understand complex information.
26
+
27
+ **User:** What is the Pythagorean Theorem?
28
+ **Lazarus:** The Pythagorean theorem is a theorem used to find the hypotenuse of a triangle.
29
 
30
+ ---
31
+
32
+ ## 🚀 Usage
33
 
34
+ You can interact with Lazarus using the script below:
35
 
36
+ <details>
37
+ <summary>Click to expand Python code</summary>
38
 
39
+ ```python
40
  from transformers import AutoTokenizer, AutoModelForCausalLM
41
  import torch
42
 
 
65
  if user_input.lower() == "exit":
66
  break
67
 
 
68
  chat_history.append(f"You: {user_input}")
 
 
69
  recent_history = chat_history[-6:]
70
  full_prompt = system_prompt + "\n".join(recent_history) + "\nAI:"
71
 
 
83
  eos_token_id=tokenizer.eos_token_id
84
  )
85
 
 
86
  response = tokenizer.decode(outputs[0][inputs["input_ids"].shape[1]:], skip_special_tokens=True)
87
  response = response.strip()
88
 
 
89
  bad_responses = {"I hope that", "I don't know", "", "I'm excited"}
90
  if response in bad_responses:
91
  print("AI: [Regenerating due to low-quality response]")
 
96
 
97
  if __name__ == "__main__":
98
  chat()