From c82319b493889aaa60912319369e33dd049420fc Mon Sep 17 00:00:00 2001 From: Lysandre Debut Date: Thu, 13 Feb 2025 12:20:53 +0100 Subject: [PATCH] Helium documentation fixes (#36170) * Helium documentation fixes * Update helium.md * Update helium.md * Update helium.md --- docs/source/en/model_doc/helium.md | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/docs/source/en/model_doc/helium.md b/docs/source/en/model_doc/helium.md index df5927544d..b830c0a72b 100644 --- a/docs/source/en/model_doc/helium.md +++ b/docs/source/en/model_doc/helium.md @@ -107,7 +107,7 @@ Tips: ## Usage tips -`Helium` can be found on the [Huggingface Hub](https://huggingface.co/collections/kyutai/helium-1-preview) +`Helium` can be found on the [Huggingface Hub](https://huggingface.co/models?other=helium) In the following, we demonstrate how to use `helium-1-preview` for the inference. @@ -115,16 +115,12 @@ In the following, we demonstrate how to use `helium-1-preview` for the inference >>> from transformers import AutoModelForCausalLM, AutoTokenizer >>> device = "cuda" # the device to load the model onto ->>> model = AutoModelForCausalLM.from_pretrained("helium-1-preview", device_map="auto") ->>> tokenizer = AutoTokenizer.from_pretrained("helium-1-preview") +>>> model = AutoModelForCausalLM.from_pretrained("kyutai/helium-1-preview-2b", device_map="auto") +>>> tokenizer = AutoTokenizer.from_pretrained("kyutai/helium-1-preview-2b") >>> prompt = "Give me a short introduction to large language model." ->>> messages = [{"role": "user", "content": prompt}] - ->>> text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True) - ->>> model_inputs = tokenizer([text], return_tensors="pt").to(device) +>>> model_inputs = tokenizer(prompt, return_tensors="pt").to(device) >>> generated_ids = model.generate(model_inputs.input_ids, max_new_tokens=512, do_sample=True)