Instructions to use yam-peleg/Hebrew-Gemma-11B-Instruct with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use yam-peleg/Hebrew-Gemma-11B-Instruct with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="yam-peleg/Hebrew-Gemma-11B-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("yam-peleg/Hebrew-Gemma-11B-Instruct") model = AutoModelForCausalLM.from_pretrained("yam-peleg/Hebrew-Gemma-11B-Instruct") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use yam-peleg/Hebrew-Gemma-11B-Instruct with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "yam-peleg/Hebrew-Gemma-11B-Instruct" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yam-peleg/Hebrew-Gemma-11B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/yam-peleg/Hebrew-Gemma-11B-Instruct
- SGLang
How to use yam-peleg/Hebrew-Gemma-11B-Instruct with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "yam-peleg/Hebrew-Gemma-11B-Instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yam-peleg/Hebrew-Gemma-11B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "yam-peleg/Hebrew-Gemma-11B-Instruct" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "yam-peleg/Hebrew-Gemma-11B-Instruct", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use yam-peleg/Hebrew-Gemma-11B-Instruct with Docker Model Runner:
docker model run hf.co/yam-peleg/Hebrew-Gemma-11B-Instruct
Hebrew-Gemma-11B-Instruct
Base Models:
- 07.03.2024: Hebrew-Gemma-11B
- 16.03.2024: Hebrew-Gemma-11B-V2
Instruct Models:
- 07.03.2024: Hebrew-Gemma-11B-Instruct
The Hebrew-Gemma-11B-Instruct Large Language Model (LLM) is a instruct fine-tuned version of the Hebrew-Gemma-11B generative text model using a variety of conversation datasets.
It is continued pretrain of gemma-7b, extended to a larger scale and trained on 3B additional tokens of both English and Hebrew text data.
Instruction format
This format must be strictly respected, otherwise the model will generate sub-optimal outputs.
<bos><start_of_turn>user
Write a hello world program<end_of_turn>
<start_of_turn>model
Here is a simple hellow world program<end_of_turn><eos>
- The conversation starts with
<bos>. - Each turn is preceded by a
<start_of_turn>delimiter and then the role of the entity (userormodel). - Turns finish with the
<end_of_turn>token. - Conversation finish with the
<eos>token.
You can follow this format to build the prompt manually, if you need to do it without the tokenizer's chat template.
A simple example using the tokenizer's chat template:
from transformers import AutoTokenizer, AutoModelForCausalLM
model_id = "Hebrew-Gemma-11B-Instruct"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, device_map="cuda")
chat = [
{ "role": "user", "content": "ΧΧͺΧΧ Χ§ΧΧ Χ€Χ©ΧΧ ΧΧ€ΧΧΧͺΧΧ Χ©ΧΧΧ€ΧΧ‘ ΧΧΧ‘Χ ΧΧͺ ΧΧͺΧΧ¨ΧΧ Χ©Χ ΧΧΧΧ" },
]
prompt = tokenizer.apply_chat_template(chat, tokenize=False, add_generation_prompt=True)
Terms of Use
As an extention of Gemma-7B, this model is subject to the original license and terms of use by Google.
Benchmark Results
- Coming Soon!
Notice
Hebrew-Gemma-11B is a pretrained base model and therefore does not have any moderation mechanisms.
Authors
- Trained by Yam Peleg.
- In collaboration with Jonathan Rouach and Arjeo, inc.
- Downloads last month
- 1,127