mayacinka commited on
Commit
4f2515c
·
verified ·
1 Parent(s): ea70ef5

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +27 -0
README.md ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ ---
4
+
5
+
6
+ ## 💻 Usage
7
+ ```python
8
+ !pip install -qU transformers bitsandbytes accelerate
9
+
10
+ from transformers import AutoTokenizer
11
+ import transformers
12
+ import torch
13
+
14
+ model = "mayacinka/ExpertRamonda-7Bx2_MoE"
15
+
16
+ tokenizer = AutoTokenizer.from_pretrained(model)
17
+ pipeline = transformers.pipeline(
18
+ "text-generation",
19
+ model=model,
20
+ model_kwargs={"torch_dtype": torch.float16, "load_in_4bit": True},
21
+ )
22
+
23
+ messages = [{"role": "user", "content": "Explain what a Mixture of Experts is in less than 100 words."}]
24
+ prompt = pipeline.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
25
+ outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
26
+ print(outputs[0]["generated_text"])
27
+ ```