wwe180 commited on
Commit
21b3cf4
1 Parent(s): 9311868

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +36 -0
README.md ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ tags:
3
+ - lora
4
+ - Llama3
5
+ base_model:
6
+ - wwe180/Llama3-15B-lingyang-v0.1
7
+ ---
8
+ #该模型是实验性的,因此无法保证结果。
9
+ # Llama3-15B-神女-lora-v0.1
10
+ Llama3-15B-ShenNu-lora-v0.1 是:
11
+
12
+ [Llama3-15B-lingyang-v0.1](https://huggingface.co/wwe180/Llama3-15B-lingyang-v0.1)的lora
13
+
14
+ ## 💻 Usage
15
+
16
+ ```python
17
+ !pip install -qU transformers accelerate
18
+
19
+ from transformers import AutoTokenizer
20
+ import transformers
21
+ import torch
22
+
23
+ model = "wwe180/Llama3-15B-lingyang-v0.1"
24
+ messages = [{"role": "user", "content": "What is a large language model?"}]
25
+
26
+ tokenizer = AutoTokenizer.from_pretrained(model)
27
+ prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
28
+ pipeline = transformers.pipeline(
29
+ "text-generation",
30
+ model=model,
31
+ torch_dtype=torch.float16,
32
+ device_map="auto",
33
+ )
34
+
35
+ outputs = pipeline(prompt, max_new_tokens=256, do_sample=True, temperature=0.7, top_k=50, top_p=0.95)
36
+ print(outputs[0]["generated_text"])