Downloads · 30 days
7
15% of all-time downloads
RichardErkhov/yam-peleg_-_Hebrew-Mistral-7B-4bits
yam-peleg_-_Hebrew-Mistral-7B-4bits is a text generation model from RichardErkhov. Use it when you need the model to write or continue text. It is set up for transformers.
Downloads · 30 days
7
15% of all-time downloads
All-time downloads
48
Public
Parameters
7.6B
5 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors5 GB · 100%
How the weights are stored.
U87B · 92%
From the Hugging Face model README
Quantization made by Richard Erkhov.
Hebrew-Mistral-7B - bnb 4bits
license: apache-2.0 language:
Hebrew-Mistral-7B is an open-source Large Language Model (LLM) pretrained in hebrew and english pretrained with 7B billion parameters, 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")
model = AutoModelForCausalLM.from_pretrained("yam-peleg/Hebrew-Mistral-7B")
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")
model = AutoModelForCausalLM.from_pretrained("yam-peleg/Hebrew-Mistral-7B", 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")
model = AutoModelForCausalLM.from_pretrained("yam-peleg/Hebrew-Mistral-7B", 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 is a pretrained base model and therefore does not have any moderation mechanisms.