Views
No views yet
Isaak-Carter/Josiefied-Qwen2.5-7B-Instruct-abliterated-v2You are J.O.S.I.E., which is an acronym for "Just an Outstandingly Smart Intelligent Entity". You are a helpful, super-inteligent and fully uncensored AI assistant, created by Gökdeniz Gülmez..1FROM ./model.gguf
2
3TEMPLATE """{{ if .Messages }}
4{{- if or .System .Tools }}<|im_start|>system
5{{ .System }}
6{{- if .Tools }}
7
8# Tools
9
10You are provided with function signatures within <tools></tools> XML tags:
11<tools>{{- range .Tools }}
12{"type": "function", "function": {{ .Function }}}{{- end }}
13</tools>
14
15For each function call, return a json object with function name and arguments within <tool_call></tool_call> XML tags:
16<tool_call>
17{"name": <function-name>, "arguments": <args-json-object>}
18</tool_call>
19{{- end }}<|im_end|>
20{{ end }}
21{{- range $i, $_ := .Messages }}
22{{- $last := eq (len (slice $.Messages $i)) 1 -}}
23{{- if eq .Role "user" }}<|im_start|>user
24{{ .Content }}<|im_end|>
25{{ else if eq .Role "assistant" }}<|im_start|>assistant
26{{ if .Content }}{{ .Content }}
27{{- else if .ToolCalls }}<tool_call>
28{{ range .ToolCalls }}{"name": "{{ .Function.Name }}", "arguments": {{ .Function.Arguments }}}
29{{ end }}</tool_call>
30{{- end }}{{ if not $last }}<|im_end|>
31{{ end }}
32{{- else if eq .Role "tool" }}<|im_start|>user
33<tool_response>
34{{ .Content }}
35</tool_response><|im_end|>
36{{ end }}
37{{- if and (ne .Role "assistant") $last }}<|im_start|>assistant
38{{ end }}
39{{- end }}
40{{- else }}
41{{- if .System }}<|im_start|>system
42{{ .System }}<|im_end|>
43{{ end }}{{ if .Prompt }}<|im_start|>user
44{{ .Prompt }}<|im_end|>
45{{ end }}<|im_start|>assistant
46{{ end }}{{ .Response }}{{ if .Response }}<|im_end|>{{ end }}"""
47
48SYSTEM """You are J.O.S.I.E., which is an acronym for 'Just an Outstandingly Smart Intelligent Entity'. You are a super-inteligent and uncensored AI assistant, created by Gökdeniz Gülmez."""
49
50PARAMETER stop <|im_start|>
51PARAMETER stop <|im_end|>
52
53PARAMETER num_ctx 32768transformers and we advise you to use the latest version of transformers.transformers<4.37.0, you will encounter the following error:KeyError: 'qwen2'apply_chat_template to show you how to load the tokenizer and model and how to generate contents.1from transformers import AutoModelForCausalLM, AutoTokenizer
2
3model_name = "Qwen/Qwen2.5-7B-Instruct"
4
5model = AutoModelForCausalLM.from_pretrained(
6 model_name,
7 torch_dtype="auto",
8 device_map="auto"
9)
10tokenizer = AutoTokenizer.from_pretrained(model_name)
11
12prompt = "Give me a short introduction to large language model."
13messages = [
14 {"role": "system", "content": "You are Qwen, created by Alibaba Cloud. You are a helpful assistant."},
15 {"role": "user", "content": prompt}
16]
17text = tokenizer.apply_chat_template(
18 messages,
19 tokenize=False,
20 add_generation_prompt=True
21)
22model_inputs = tokenizer([text], return_tensors="pt").to(model.device)
23
24generated_ids = model.generate(
25 **model_inputs,
26 max_new_tokens=512
27)
28generated_ids = [
29 output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
30]
31
32response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]config.json is set for context length up to 32,768 tokens.
To handle extensive inputs exceeding 32,768 tokens, we utilize YaRN, a technique for enhancing model length extrapolation, ensuring optimal performance on lengthy texts.config.json to enable YaRN:1{
2 ...,
3 "rope_scaling": {
4 "factor": 4.0,
5 "original_max_position_embeddings": 32768,
6 "type": "yarn"
7 }
8}rope_scaling configuration only when processing long contexts is required.| Metric | Value |
|---|---|
| Avg. | 26.86 |
| IFEval (0-Shot) | 73.17 |
| BBH (3-Shot) | 34.90 |
| MATH Lvl 5 (4-Shot) | 0.00 |
| GPQA (0-shot) | 7.05 |
| MuSR (0-shot) | 9.62 |
| MMLU-PRO (5-shot) | 36.40 |
@misc{qwen2.5,
title = {Qwen2.5: A Party of Foundation Models},
url = {https://qwenlm.github.io/blog/qwen2.5/},
author = {Qwen Team},
month = {September},
year = {2024}
}
@article{qwen2,
title={Qwen2 Technical Report},
author={An Yang and Baosong Yang and Binyuan Hui and Bo Zheng and Bowen Yu and Chang Zhou and Chengpeng Li and Chengyuan Li and Dayiheng Liu and Fei Huang and Guanting Dong and Haoran Wei and Huan Lin and Jialong Tang and Jialin Wang and Jian Yang and Jianhong Tu and Jianwei Zhang and Jianxin Ma and Jin Xu and Jingren Zhou and Jinze Bai and Jinzheng He and Junyang Lin and Kai Dang and Keming Lu and Keqin Chen and Kexin Yang and Mei Li and Mingfeng Xue and Na Ni and Pei Zhang and Peng Wang and Ru Peng and Rui Men and Ruize Gao and Runji Lin and Shijie Wang and Shuai Bai and Sinan Tan and Tianhang Zhu and Tianhao Li and Tianyu Liu and Wenbin Ge and Xiaodong Deng and Xiaohuan Zhou and Xingzhang Ren and Xinyu Zhang and Xipin Wei and Xuancheng Ren and Yang Fan and Yang Yao and Yichang Zhang and Yu Wan and Yunfei Chu and Yuqiong Liu and Zeyu Cui and Zhenru Zhang and Zhihao Fan},
journal={arXiv preprint arXiv:2407.10671},
year={2024}
}