Instructions to use LeoLM/leo-hessianai-13b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LeoLM/leo-hessianai-13b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="LeoLM/leo-hessianai-13b", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("LeoLM/leo-hessianai-13b", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("LeoLM/leo-hessianai-13b", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use LeoLM/leo-hessianai-13b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "LeoLM/leo-hessianai-13b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "LeoLM/leo-hessianai-13b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/LeoLM/leo-hessianai-13b
- SGLang
How to use LeoLM/leo-hessianai-13b 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 "LeoLM/leo-hessianai-13b" \ --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": "LeoLM/leo-hessianai-13b", "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 "LeoLM/leo-hessianai-13b" \ --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": "LeoLM/leo-hessianai-13b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use LeoLM/leo-hessianai-13b with Docker Model Runner:
docker model run hf.co/LeoLM/leo-hessianai-13b
how to prompt
hello and thank you for these models!
what is the prompt format to get the (non-chat) models to translate english->german?
i've tried few-shot prompting, failed.
e.g. prompt:
English: The Sultan appoints judges, and can grant pardons and commute sentences.
German: Der Sultan ernennt Richter und kann Begnadigungen und Pendelstrafen gewähren.
English: Antisemitism in modern Ukraine Antisemitism and Special Relativity
German: Antisemitismus in der modernen Ukraine Antisemitismus und besondere Relativität
English: Morales continued his feud with Buddy Rose, defeating him by disqualification.
German: Morales setzte seine Fehde mit Buddy Rose fort und besiegte ihn durch Disqualifikation.
English: American Maury Tripp attended the Jamboree from Saratoga, California.
German: Der Amerikaner Maury Tripp besuchte das Jamboree aus Saratoga, Kalifornien.
English: He bowled a series of bouncers at Viv Richards at Brisbane and claimed 3/77 and 5/92 in the Third Test at Melbourne.
German: Er boomte eine Reihe von Bouncern bei Viv Richards in Brisbane und behauptete 3 / 77 und 5 / 92 im dritten Test in Melbourne.
English: The Frenchwoman's win irritated some of her male rivals.
German:
output:
...
English: The Frenchwoman's win irritated some of her male rivals.
German:
English: In 1860 he was elected to represent the City of Sydney in the New South Wales Legislative Assembly as an independent candidate.
German: Im Jahr 1860 wurde er zum Vertreter des
To be honest I haven't done too much prompt engineering for the base models. Similar few-shot prompts seem to function fine with the chat models after adjusting the generation parameters to for example temperature=0.2, top_p=1.0, which pushes the model to output most-likely tokens. I've found lower temperatures (0.1 - 0.5) to work best for translation. Maybe this change also helps with the base models?
On our 13b demo after changing the params as above, your example works fine:
😃: English: The Sultan appoints judges, and can grant pardons and commute sentences.
German: Der Sultan ernennt Richter und kann Begnadigungen und Pendelstrafen gewähren.
English: Antisemitism in modern Ukraine Antisemitism and Special Relativity
German: Antisemitismus in der modernen Ukraine Antisemitismus und besondere Relativität
English: Morales continued his feud with Buddy Rose, defeating him by disqualification.
German: Morales setzte seine Fehde mit Buddy Rose fort und besiegte ihn durch Disqualifikation.
English: American Maury Tripp attended the Jamboree from Saratoga, California.
German: Der Amerikaner Maury Tripp besuchte das Jamboree aus Saratoga, Kalifornien.
English: He bowled a series of bouncers at Viv Richards at Brisbane and claimed 3/77 and 5/92 in the Third Test at Melbourne.
German: Er boomte eine Reihe von Bouncern bei Viv Richards in Brisbane und behauptete 3 / 77 und 5 / 92 im dritten Test in Melbourne.
English: The Frenchwoman's win irritated some of her male rivals.
German:
🤖: Der Sieg der Französin hat einige ihrer männlichen Rivalen verärgert.
works. thank you!