lodrick-the-lafted commited on
Commit
fc9a0d4
·
verified ·
1 Parent(s): 7a8567f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +32 -0
README.md CHANGED
@@ -8,3 +8,35 @@ tags:
8
  Where we're going, we don't need reason.
9
 
10
  Goliath x MegaDolphin.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  Where we're going, we don't need reason.
9
 
10
  Goliath x MegaDolphin.
11
+
12
+
13
+
14
+ <img src=https://huggingface.co/lodrick-the-lafted/Grafted-Titanic-Dolphin-2x120B/resolve/main/gtd.png>
15
+
16
+
17
+
18
+
19
+ ## 💻 Usage
20
+
21
+ ```python
22
+ from transformers import AutoTokenizer
23
+ import transformers
24
+ import torch
25
+
26
+ model = "lodrick-the-lafted/Grafted-Titanic-Dolphin-2x120B"
27
+
28
+ tokenizer = AutoTokenizer.from_pretrained(model)
29
+ pipeline = transformers.pipeline(
30
+ "text-generation",
31
+ model=model,
32
+ model_kwargs={"torch_dtype": torch.float16, "load_in_4bit": True},
33
+ )
34
+
35
+ messages = [{"role": "user", "content": "Explain what a Mixture of Experts is in less than 100 words."}]
36
+ prompt = pipeline.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
37
+ outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
38
+ print(outputs[0]["generated_text"])
39
+ ```
40
+
41
+
42
+