Please note: There has been some issues reported about this model, updates coming soon.
Hebrew-Mistral-7B-200K is an open-source Large Language Model (LLM) pretrained in hebrew and english pretrained with 7B billion parameters and with 200K context length, based on Mistral-7B-v1.0 from Mistral.
It has an extended hebrew tokenizer with 64,000 tokens and is continuesly pretrained from Mistral-7B on tokens in both English and Hebrew.
The resulting model is a powerful general-purpose language model suitable for a wide range of natural language processing tasks, with a focus on Hebrew language understanding and generation.
Below are some code snippets on how to get quickly started with running the model.
First make sure to pip install -U transformers, then copy the snippet from the section that is relevant for your usecase.
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("yam-peleg/Hebrew-Mistral-7B-200K")
model = AutoModelForCausalLM.from_pretrained("yam-peleg/Hebrew-Mistral-7B-200K")
input_text = "שלום! מה שלומך היום?"
input_ids = tokenizer(input_text, return_tensors="pt")
outputs = model.generate(**input_ids)
print(tokenizer.decode(outputs[0]))
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("yam-peleg/Hebrew-Mistral-7B-200K")
model = AutoModelForCausalLM.from_pretrained("yam-peleg/Hebrew-Mistral-7B-200K", device_map="auto")
input_text = "שלום! מה שלומך היום?"
input_ids = tokenizer(input_text, return_tensors="pt").to("cuda")
outputs = model.generate(**input_ids)
print(tokenizer.decode(outputs[0]))
from transformers import AutoTokenizer, AutoModelForCausalLM, BitsAndBytesConfig
tokenizer = AutoTokenizer.from_pretrained("yam-peleg/Hebrew-Mistral-7B-200K")
model = AutoModelForCausalLM.from_pretrained("yam-peleg/Hebrew-Mistral-7B-200K", quantization_config = BitsAndBytesConfig(load_in_4bit=True))
input_text = "שלום! מה שלומך היום?"
input_ids = tokenizer(input_text, return_tensors="pt").to("cuda")
outputs = model.generate(**input_ids)
print(tokenizer.decode(outputs[0])
Hebrew-Mistral-7B-200K is a pretrained base model and therefore does not have any moderation mechanisms.
model-00005-of-00007.safetensors 4.7 GiBmodel-00004-of-00007.safetensors 4.7 GiBmodel-00002-of-00007.safetensors 4.7 GiBmodel-00001-of-00007.safetensors 4.6 GiBmodel-00003-of-00007.safetensors 4.5 GiBmodel-00006-of-00007.safetensors 3.9 GiBmodel-00007-of-00007.safetensors 1000 MiB