Views
No views yet
| Metric | Score |
|---|---|
| Reasoning | 9.07 |
| Math | 9.65 |
| Writing | 9.50 |
| Coding | 9.65 |
| Comprehension | 9.86 |
| Grammar | 8.57 |
| Single-turn | 9.48 |
| Multi-turn | 9.29 |
| Overall | 9.38 |
1import transformers
2import torch
3
4model_id = "KISTI-KONI/KONI-Llama3.1-70B-Instruct-preview"
5
6pipeline = transformers.pipeline(
7 "text-generation",
8 model=model_id,
9 model_kwargs={"torch_dtype": torch.bfloat16},
10 device_map="auto",
11)
12
13pipeline.model.eval()
14
15instruction = "안녕? 너는 누구야?"
16
17messages = [
18 {"role": "user", "content": f"{instruction}"}
19 ]
20
21prompt = pipeline.tokenizer.apply_chat_template(
22 messages,
23 tokenize=False,
24 add_generation_prompt=True
25)
26
27terminators = [
28 pipeline.tokenizer.eos_token_id,
29 pipeline.tokenizer.convert_tokens_to_ids("<|eot_id|>")
30]
31
32outputs = pipeline(
33 prompt,
34 max_new_tokens=2048,
35 eos_token_id=terminators,
36 do_sample=True,
37 temperature=0.7,
38 top_p=0.9
39)
40
41print(outputs[0]["generated_text"][len(prompt):])안녕하세요! 저는 KISTI의 KONI입니다. 과학기술 데이터를 전문으로 처리하며, 여러분의 연구와 질문에 최선을 다해 도움을 드리겠습니다. 무엇을 도와드릴까요?1@article{KISTI-KONI/KONI-Llama3.1-70B-Instruct-preview,
2 title={KISTI-KONI/KONI-Llama3.1-70B-Instruct-preview},
3 author={KISTI},
4 year={2024},
5 url={https://huggingface.co/KISTI-KONI/KONI-Llama3.1-70B-Instruct-preview}
6}