from transformers import AutoModelForCausalLM, AutoTokenizer
model_path = '<your-hf-model-path-with-tokenizer>'
tokenizer = AutoTokenizer.from_pretrained(model_path, use_fast=False, trust_remote_code=True)
model = AutoModelForCausalLM.from_pretrained(
model_path,
device_map="auto",
torch_dtype='auto'
).eval()
messages = [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Hello, what can you help me do?"},
]
input_ids = tokenizer.apply_chat_template(conversation=messages, add_generation_prompt=True, return_tensors='pt')
output_ids = model.generate(input_ids.to('cuda'), max_new_tokens=20)
response = tokenizer.decode(output_ids[0][input_ids.shape[1]:], skip_special_tokens=True)
print(response)
Citation
@article{zhang2024mapneo,
title = {MAP-Neo: Highly Capable and Transparent Bilingual Large Language Model Series},
author = {Ge Zhang and Scott Qu and Jiaheng Liu and Chenchen Zhang and Chenghua Lin and Chou Leuang Yu and Danny Pan and Esther Cheng and Jie Liu and Qunshu Lin and Raven Yuan and Tuney Zheng and Wei Pang and Xinrun Du and Yiming Liang and Yinghao Ma and Yizhi Li and Ziyang Ma and Bill Lin and Emmanouil Benetos and Huan Yang and Junting Zhou and Kaijing Ma and Minghao Liu and Morry Niu and Noah Wang and Quehry Que and Ruibo Liu and Sine Liu and Shawn Guo and Soren Gao and Wangchunshu Zhou and Xinyue Zhang and Yizhi Zhou and Yubo Wang and Yuelin Bai and Yuhan Zhang and Yuxiang Zhang and Zenith Wang and Zhenzhu Yang and Zijian Zhao and Jiajun Zhang and Wanli Ouyang and Wenhao Huang and Wenhu Chen},
year = {2024},
journal = {arXiv preprint arXiv: 2405.19327}
}
Runs of m-a-p neo_7b_instruct_v0.1 on huggingface.co
19
Total runs
0
24-hour runs
1
3-day runs
0
7-day runs
-15
30-day runs
More Information About neo_7b_instruct_v0.1 huggingface.co Model
neo_7b_instruct_v0.1 huggingface.co is an AI model on huggingface.co that provides neo_7b_instruct_v0.1's model effect (), which can be used instantly with this m-a-p neo_7b_instruct_v0.1 model. huggingface.co supports a free trial of the neo_7b_instruct_v0.1 model, and also provides paid use of the neo_7b_instruct_v0.1. Support call neo_7b_instruct_v0.1 model through api, including Node.js, Python, http.
neo_7b_instruct_v0.1 huggingface.co is an online trial and call api platform, which integrates neo_7b_instruct_v0.1's modeling effects, including api services, and provides a free online trial of neo_7b_instruct_v0.1, you can try neo_7b_instruct_v0.1 online for free by clicking the link below.
m-a-p neo_7b_instruct_v0.1 online free url in huggingface.co:
neo_7b_instruct_v0.1 is an open source model from GitHub that offers a free installation service, and any user can find neo_7b_instruct_v0.1 on GitHub to install. At the same time, huggingface.co provides the effect of neo_7b_instruct_v0.1 install, users can directly use neo_7b_instruct_v0.1 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
neo_7b_instruct_v0.1 install url in huggingface.co: