sh2orc commited on
Commit
b6bace5
β€’
1 Parent(s): 9b52a86

Create README.md

Browse files
Files changed (1) hide show
  1. README.md +55 -0
README.md ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: llama3
3
+ ---
4
+
5
+ - Foundation Model [google/gemma-1.1-7b-it](https://huggingface.co/google/gemma-1.1-7b-it)
6
+ - datasets
7
+ - [jojo0217/korean_safe_conversation](https://huggingface.co/datasets/jojo0217/korean_safe_conversation)
8
+
9
+
10
+ # Usage for VLLM
11
+ ```python
12
+ from vllm import LLM, SamplingParams
13
+ from transformers import AutoTokenizer, pipeline
14
+
15
+ BASE_MODEL = "sh2orc/gemma-1.1-korean-7b-it"
16
+
17
+ llm = LLM(model=BASE_MODEL)
18
+
19
+ tokenizer = AutoTokenizer.from_pretrained(BASE_MODEL)
20
+ tokenizer.pad_token = tokenizer.eos_token
21
+ tokenizer.padding_side = 'right'
22
+
23
+ instruction = '독도에 λŒ€ν•΄μ„œ μ•Œλ €μ€˜'
24
+
25
+ messages = [
26
+ {
27
+ "role": "user",
28
+ "content": instruction
29
+ },
30
+ ]
31
+
32
+
33
+ prompt_message = tokenizer.apply_chat_template(
34
+ messages,
35
+ tokenize=False,
36
+ add_generation_prompt=True,
37
+ )
38
+
39
+ eos_token_id = [tokenizer.eos_token_id, tokenizer.convert_tokens_to_ids("<end_of_turn>")]
40
+
41
+ outputs = llm.generate(prompt_message, SamplingParams(stop_token_ids=eos_token_id, temperature=0.2, top_p=0.8,max_tokens=4096))
42
+
43
+ for output in outputs:
44
+ propt = output.prompt
45
+ generated_text = output.outputs[0].text
46
+ print(generated_text)
47
+
48
+ ```
49
+
50
+
51
+ # Result
52
+ <pre>
53
+ λ…λ„λŠ” 동해에 μœ„μΉ˜ν•œ λŒ€ν•œλ―Όκ΅­μ˜ νŠΉλ³„μžμΉ˜λ„λ‘œ, 면적은 5.8km이며, 행정ꡬ역은 λ…λ„κ΅°μž…λ‹ˆλ‹€. λ…λ„μ˜ 면적은 λŒ€λž΅ 5.8km이며, μΈκ΅¬λŠ” μ•½ 10λͺ…μž…λ‹ˆλ‹€. λ…λ„λŠ” ν•œκ΅­κ³Ό 일본의 ꡭ경을 ν˜•μ„±ν•˜κ³  있으며, λ…λ„μ˜ 주민듀은 일본의 영ν–₯을 많이 λ°›μ•˜μŠ΅λ‹ˆλ‹€. λ…λ„μ˜ κ²½μ œλŠ” κ΄€κ΄‘κ³Ό μ†Œκ·œλͺ¨μ˜ 어업이 μ£Όλ₯Ό 이루며, λ…λ„λŠ” 1949λ…„λΆ€ν„° 1954λ…„κΉŒμ§€ 일본에 μ˜ν•΄ μ λ Ήλ˜μ—ˆμŠ΅λ‹ˆλ‹€. λ…λ„λŠ” 1954λ…„ 인천 κ°•ν™” μ‘°μ•½μœΌλ‘œ 인해 μš°λ¦¬λ‚˜λΌμ˜ μ˜ν† κ°€ λ˜μ—ˆμŠ΅λ‹ˆλ‹€.
54
+ </pre>
55
+