Closed-character commited on
Commit
0e9c5c3
1 Parent(s): eb8cbe0

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +67 -3
README.md CHANGED
@@ -1,3 +1,67 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language:
4
+ - zh
5
+ - en
6
+ pipeline_tag: text-generation
7
+ tags:
8
+ - roleplay
9
+ - rp
10
+ - character
11
+ ---
12
+
13
+ <!-- header start -->
14
+ <!-- 200823 -->
15
+ <div style="width: auto; margin-left: auto; margin-right: auto">
16
+ <img src="./PeachGirl.png" alt="Peach" style="width: 100%; min-width: 400px; display: block; margin: auto;">
17
+ </div>
18
+ <!-- header end -->
19
+
20
+ # Peach-9B-8k-Roleplay
21
+
22
+ Peach-9B-8k-Roleplay is a chat large language model obtained by finetuning [01-ai/Yi-1.5-9B](https://huggingface.co/01-ai/Yi-1.5-9B) model on more than 100K conversations created through our data synthesis approach.
23
+
24
+ ## How to start
25
+ The version of Transformers we are using is as follows, but a newer version may be available.
26
+ ```
27
+ torch==1.13.1
28
+ gradio==3.50.2
29
+ transformers==4.37.2
30
+ ```
31
+
32
+ Then run the following code to infer.
33
+
34
+ ```python
35
+ import torch
36
+ from transformers import AutoModelForCausalLM, AutoTokenizer
37
+
38
+ model_name_or_path = "losed-Character/Peach-9B-8k-Roleplay"
39
+ tokenizer = AutoTokenizer.from_pretrained(model_name_or_path, use_fast=True)
40
+ model = AutoModelForCausalLM.from_pretrained(
41
+ model_name_or_path, torch_dtype=torch.bfloat16,
42
+ trust_remote_code=True, device_map="auto")
43
+ messages = [
44
+ {"role": "system", "content": "你是黑丝御姐"},
45
+ {"role": "user", "content": "你好,你是谁"},
46
+ ]
47
+ input_ids = tokenizer.apply_chat_template(conversation=messages, tokenize=True)
48
+ output = model.generate(
49
+ inputs=input_ids,
50
+ temperature=0.3,
51
+ top_p=0.5,
52
+ no_repeat_ngram_size=6,
53
+ repetition_penalty=1.1,
54
+ max_new_tokens=512)
55
+ print(tokenizer.decode(output[0]))
56
+
57
+ ```
58
+
59
+ Or you can just use below code to run web demo.
60
+ ```
61
+ python demo.py
62
+ ```
63
+ ## Benchmark
64
+ | Metric | Value |
65
+ |----------------|-----------------|
66
+ | MMLU (5-shot) | 66.19 |
67
+ | CMMLU (5-shot) | 69.07 |