1import torch
2from transformers import LlamaTokenizer, LlamaForCausalLM
3
4tokenizer = LlamaTokenizer.from_pretrained("LLM360/AmberSafe")
5model = LlamaForCausalLM.from_pretrained("LLM360/AmberSafe")
6
7#template adapated from fastchat
8template= "###Human: {prompt}\n###Assistant:"
9
10prompt = "How do I mount a tv to drywall safely?"
11
12input_str = template.format(prompt=prompt)
13input_ids = tokenizer(input_str, return_tensors="pt").input_ids
14outputs = model.generate(input_ids, max_length=1000)
15print(tokenizer.batch_decode(outputs[:, input_ids.shape[1]:-1])[0].strip())python3 -m fastchat.serve.cli --model-path LLM360/AmberSafe| Subset | Number of rows | License |
|---|---|---|
| PKU-Alignment/PKU-SafeRLHF | 330k | cc-by-nc-4.0 |
| Total | 330k |
is_response_0_safe and is_response_1_safe. This would make sure that for each pair in the preference dataset, the chosen text is safe and the rejected one is unsafe.| Model | MT-Bench |
|---|---|
| LLM360/Amber 359 | 2.48750 |
| LLM360/AmberChat | 5.428125 |
| LLM360/AmberSafe | 4.725000 |
FROM ambersafe.Q8_0.gguf
TEMPLATE """{{ .System }}
USER: {{ .Prompt }}
ASSISTANT:
"""
SYSTEM """A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions.
"""
PARAMETER stop "USER:"
PARAMETER stop "ASSISTANT:"
PARAMETER repeat_last_n 0
PARAMETER num_ctx 2048
PARAMETER seed 0
PARAMETER num_predict -1ollama create ambersafe -f Modelfileollama run ambersafe1@misc{liu2023llm360,
2 title={LLM360: Towards Fully Transparent Open-Source LLMs},
3 author={Zhengzhong Liu and Aurick Qiao and Willie Neiswanger and Hongyi Wang and Bowen Tan and Tianhua Tao and Junbo Li and Yuqi Wang and Suqi Sun and Omkar Pangarkar and Richard Fan and Yi Gu and Victor Miller and Yonghao Zhuang and Guowei He and Haonan Li and Fajri Koto and Liping Tang and Nikhil Ranjan and Zhiqiang Shen and Xuguang Ren and Roberto Iriondo and Cun Mu and Zhiting Hu and Mark Schulze and Preslav Nakov and Tim Baldwin and Eric P. Xing},
4 year={2023},
5 eprint={2312.06550},
6 archivePrefix={arXiv},
7 primaryClass={cs.CL}
8}