songff commited on
Commit
f51ddd5
·
verified ·
1 Parent(s): 5d04f40

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +14 -3
README.md CHANGED
@@ -1,5 +1,12 @@
1
  ---
2
  license: apache-2.0
 
 
 
 
 
 
 
3
  ---
4
 
5
  # P-Aligner
@@ -8,14 +15,14 @@ license: apache-2.0
8
  ## Quick Start
9
 
10
  ```python
11
- import vllm
12
  from transformers import AutoTokenizer
13
 
14
  raw_instruction = "What is the capital of France?"
15
- model_path = "songff/P-Aligner"
16
 
17
  tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
18
- model = vllm.LLM(
19
  model=model_path,
20
  gpu_memory_utilization=0.9,
21
  enable_prefix_caching=True,
@@ -24,6 +31,10 @@ model = vllm.LLM(
24
 
25
  outputs = model.generate(
26
  [raw_instruction],
 
 
 
 
27
  )
28
  better_instruction = tokenizer.parse_output(
29
  outputs[0].outputs[0].text,
 
1
  ---
2
  license: apache-2.0
3
+ datasets:
4
+ - songff/UltraPrompt
5
+ language:
6
+ - en
7
+ base_model:
8
+ - meta-llama/Llama-3.2-3B-Instruct
9
+ library_name: transformers
10
  ---
11
 
12
  # P-Aligner
 
15
  ## Quick Start
16
 
17
  ```python
18
+ from vllm import LLM, SamplingParams
19
  from transformers import AutoTokenizer
20
 
21
  raw_instruction = "What is the capital of France?"
22
+ model_path = "P-Aligner"
23
 
24
  tokenizer = AutoTokenizer.from_pretrained(model_path, trust_remote_code=True)
25
+ model = LLM(
26
  model=model_path,
27
  gpu_memory_utilization=0.9,
28
  enable_prefix_caching=True,
 
31
 
32
  outputs = model.generate(
33
  [raw_instruction],
34
+ sampling_params=SamplingParams(
35
+ temperature=0.0,
36
+ max_tokens=2048,
37
+ ),
38
  )
39
  better_instruction = tokenizer.parse_output(
40
  outputs[0].outputs[0].text,