Instructions to use dicta-il/dictalm2.0-AWQ with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dicta-il/dictalm2.0-AWQ with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="dicta-il/dictalm2.0-AWQ")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("dicta-il/dictalm2.0-AWQ") model = AutoModelForCausalLM.from_pretrained("dicta-il/dictalm2.0-AWQ") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use dicta-il/dictalm2.0-AWQ with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "dicta-il/dictalm2.0-AWQ" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dicta-il/dictalm2.0-AWQ", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/dicta-il/dictalm2.0-AWQ
- SGLang
How to use dicta-il/dictalm2.0-AWQ 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 "dicta-il/dictalm2.0-AWQ" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dicta-il/dictalm2.0-AWQ", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "dicta-il/dictalm2.0-AWQ" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "dicta-il/dictalm2.0-AWQ", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use dicta-il/dictalm2.0-AWQ with Docker Model Runner:
docker model run hf.co/dicta-il/dictalm2.0-AWQ
Adapting LLMs to Hebrew: Unveiling DictaLM 2.0 with Enhanced Vocabulary and Instruction Capabilities
The DictaLM-2.0 Large Language Model (LLM) is a pretrained generative text model with 7 billion parameters trained to specialize in Hebrew text.
For full details of this model please read our release blog post or the technical report.
This model contains the AWQ 4-bit quantized version of the base model DictaLM-2.0.
You can view and access the full collection of base/instruct unquantized/quantized versions of DictaLM-2.0 here.
Example Code
Running this code requires less than 5GB of GPU VRAM.
from transformers import pipeline
# This loads the model onto the GPU in bfloat16 precision
model = pipeline('text-generation', 'dicta-il/dictalm2.0-AWQ', device_map='cuda')
# Sample few shot examples
prompt = """
עבר: הלכתי
עתיד: אלך
עבר: שמרתי
עתיד: אשמור
עבר: שמעתי
עתיד: אשמע
עבר: הבנתי
עתיד:
"""
print(model(prompt.strip(), do_sample=False, max_new_tokens=4, stop_sequence='\n'))
# [{'generated_text': 'עבר: הלכתי\nעתיד: אלך\n\nעבר: שמרתי\nעתיד: אשמור\n\nעבר: שמעתי\nעתיד: אשמע\n\nעבר: הבנתי\nעתיד: אבין\n\n'}]
Model Architecture
DictaLM-2.0 is based on the Mistral-7B-v0.1 model with the following changes:
- An extended tokenizer with 1,000 injected tokens specifically for Hebrew, increasing the compression rate from 5.78 tokens/word to 2.76 tokens/word.
- Continued pretraining on over 190B tokens of naturally occuring text, 50% Hebrew and 50% English.
Notice
DictaLM 2.0 is a pretrained base model and therefore does not have any moderation mechanisms.
Citation
If you use this model, please cite:
@misc{shmidman2024adaptingllmshebrewunveiling,
title={Adapting LLMs to Hebrew: Unveiling DictaLM 2.0 with Enhanced Vocabulary and Instruction Capabilities},
author={Shaltiel Shmidman and Avi Shmidman and Amir DN Cohen and Moshe Koppel},
year={2024},
eprint={2407.07080},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2407.07080},
}
- Downloads last month
- 2
