h2o-danube2-1.8b-base is a foundation model trained by H2O.ai with 1.8 billion parameters. For details, please refer to our
Technical Report. We release three versions of this model:
We adjust the Llama 2 architecture for a total of around 1.8b parameters. We use the Mistral tokenizer with a vocabulary size of 32,000 and train our model up to a context length of 8,192.
This is a pre-trained foundation model. For your task, you will likely want to perform application specific fine-tuning. We also offer a chat fine-tuned version:
h2oai/h2o-danube2-1.8b-chat.
To use the model with the transformers library on a machine with GPUs, first make sure you have the transformers library installed.
1# pip install transformers>=4.39.3
2
3import torch
4from transformers import AutoModelForCausalLM, AutoTokenizer
5
6tokenizer = AutoTokenizer.from_pretrained("h2oai/h2o-danube2-1.8b-base")
7
8model = AutoModelForCausalLM.from_pretrained(
9 "h2oai/h2o-danube2-1.8b-base",
10 torch_dtype=torch.bfloat16,
11)
12model.cuda()
13
14inputs = tokenizer("The Danube is the second longest river in Europe", return_tensors="pt").to(model.device)
15res = model.generate(
16 **inputs,
17 max_new_tokens=38,
18 do_sample=False,
19)
20print(tokenizer.decode(res[0], skip_special_tokens=True))
Among models of similar size h2o-danube2-1.8b-base achieves best results (on average) across benchmarks of Open LLM Leaderboard 🤗
Please read this disclaimer carefully before using the large language model provided in this repository. Your use of the model signifies your agreement to the following terms and conditions.
By using the large language model provided in this repository, you agree to accept and comply with the terms and conditions outlined in this disclaimer. If you do not agree with any part of this disclaimer, you should refrain from using the model and any content generated by it.