DictaLM
: A Large Generative Language Model for Modern Hebrew
A large generative pretrained transformer (GPT) language model for Hebrew, released
here
.
This is an alpha version of the model, and there are many improvements to come.
We are actively working on improving the model, so stay tuned.
This is the base-model pretrained on general text completion. On it's own, it isn't very useful, but it can be fine-tuned for specific tasks (instruct, chat, QA, and more).
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
tokenizer = AutoTokenizer.from_pretrained('dicta-il/dictalm-7b')
model = AutoModelForCausalLM.from_pretrained('dicta-il/dictalm-7b', trust_remote_code=True).cuda()
model.eval()
with torch.inference_mode():
# this prompt was taken from the headline of a [YNet](https://www.ynet.co.il/architecture/article/b1j3bzcrn) article.
prompt = 'מנורה מכובע ים וכוסות מבקבוקי פלסטיק: הצצה'
kwargs = dict(
inputs=tokenizer(prompt, return_tensors='pt').input_ids.to(model.device),
do_sample=True,
top_k=50,
top_p=0.95,
temperature=0.75,
max_length=100,
min_new_tokens=5
)
print(tokenizer.batch_decode(model.generate(**kwargs), skip_special_tokens=True))
There are many different parameters you can input into
kwargs
for different results (greedy, beamsearch, different samplign configurations, longer/shorter respones, etc.).
You can view the full list of parameters you can pass to the
generate
function
here
.
Alternative ways to initialize the model:
If you have multiple smaller GPUs, and the package
accelerate
is installed, you can initialize the model split across the devices:
model = AutoModelForCausalLM.from_pretrained('dicta-il/dictalm-7b', trust_remote_code=True, device_map='auto')
If you are running on linux and have the
bitsandbytes
package installed, you can initialize the model in 4/8 bit inference mode:
model = AutoModelForCausalLM.from_pretrained('dicta-il/dictalm-7b', trust_remote_code=True, load_in_8bit=True)
If you have
FlashAttention
installed in your environment, you can instruct the model to use the flash attention implementation (either V1 or V2, whichever is installed):
model = AutoModelForCausalLM.from_pretrained('dicta-il/dictalm-7b', trust_remote_code=True, use_flash_attention=True)
Citation
If you use DictaLM in your research, please cite
DictaLM -- A Large Generative Language Model for Modern Hebrew
BibTeX:
@misc{shmidman2023introducing,
title={Introducing DictaLM -- A Large Generative Language Model for Modern Hebrew},
author={Shaltiel Shmidman and Avi Shmidman and Amir David Nissan Cohen and Moshe Koppel},
year={2023},
eprint={2309.14568},
archivePrefix={arXiv},
primaryClass={cs.CL}
}
dictalm-7b huggingface.co is an AI model on huggingface.co that provides dictalm-7b's model effect (), which can be used instantly with this dicta-il dictalm-7b model. huggingface.co supports a free trial of the dictalm-7b model, and also provides paid use of the dictalm-7b. Support call dictalm-7b model through api, including Node.js, Python, http.
dictalm-7b huggingface.co is an online trial and call api platform, which integrates dictalm-7b's modeling effects, including api services, and provides a free online trial of dictalm-7b, you can try dictalm-7b online for free by clicking the link below.
dicta-il dictalm-7b online free url in huggingface.co:
dictalm-7b is an open source model from GitHub that offers a free installation service, and any user can find dictalm-7b on GitHub to install. At the same time, huggingface.co provides the effect of dictalm-7b install, users can directly use dictalm-7b installed effect in huggingface.co for debugging and trial. It also supports api for free installation.