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()
input_text = "A long, long time ago,"
input_ids = tokenizer(input_text, add_generation_prompt=True, return_tensors='pt').to(model.device)
output_ids = model.generate(**input_ids, max_new_tokens=20)
response = tokenizer.decode(output_ids[0], 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 on huggingface.co
102
Total runs
0
24-hour runs
4
3-day runs
30
7-day runs
27
30-day runs
More Information About neo_7b huggingface.co Model
neo_7b huggingface.co is an AI model on huggingface.co that provides neo_7b's model effect (), which can be used instantly with this m-a-p neo_7b model. huggingface.co supports a free trial of the neo_7b model, and also provides paid use of the neo_7b. Support call neo_7b model through api, including Node.js, Python, http.
neo_7b huggingface.co is an online trial and call api platform, which integrates neo_7b's modeling effects, including api services, and provides a free online trial of neo_7b, you can try neo_7b online for free by clicking the link below.
neo_7b is an open source model from GitHub that offers a free installation service, and any user can find neo_7b on GitHub to install. At the same time, huggingface.co provides the effect of neo_7b install, users can directly use neo_7b installed effect in huggingface.co for debugging and trial. It also supports api for free installation.