From 54ac39c648e20ce2329529e07fcc03eee58dda18 Mon Sep 17 00:00:00 2001 From: Francisco Kurucz Date: Thu, 8 Aug 2024 17:42:58 -0300 Subject: [PATCH] Fix code example to load bigcode starcoder2 7b (#32474) --- .../models/starcoder2/configuration_starcoder2.py | 2 +- src/transformers/models/starcoder2/modeling_starcoder2.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/transformers/models/starcoder2/configuration_starcoder2.py b/src/transformers/models/starcoder2/configuration_starcoder2.py index 3752692821a1b9..2329f0a0a6b4bf 100644 --- a/src/transformers/models/starcoder2/configuration_starcoder2.py +++ b/src/transformers/models/starcoder2/configuration_starcoder2.py @@ -25,7 +25,7 @@ class Starcoder2Config(PretrainedConfig): r""" This is the configuration class to store the configuration of a [`Starcoder2Model`]. It is used to instantiate a Starcoder2 model according to the specified arguments, defining the model architecture. Instantiating a configuration - with the defaults will yield a similar configuration to that of the [bigcode/starcoder2-7b_16k](https://huggingface.co/bigcode/starcoder2-7b_16k) model. + with the defaults will yield a similar configuration to that of the [bigcode/starcoder2-7b](https://huggingface.co/bigcode/starcoder2-7b) model. Configuration objects inherit from [`PretrainedConfig`] and can be used to control the model outputs. Read the diff --git a/src/transformers/models/starcoder2/modeling_starcoder2.py b/src/transformers/models/starcoder2/modeling_starcoder2.py index f3b365776ead16..d51077b04254fb 100644 --- a/src/transformers/models/starcoder2/modeling_starcoder2.py +++ b/src/transformers/models/starcoder2/modeling_starcoder2.py @@ -1058,8 +1058,8 @@ def forward( ```python >>> from transformers import AutoTokenizer, Starcoder2ForCausalLM - >>> model = Starcoder2ForCausalLM.from_pretrained("bigcode/starcoder2-7b_16k") - >>> tokenizer = AutoTokenizer.from_pretrained("bigcode/starcoder2-7b_16k") + >>> model = Starcoder2ForCausalLM.from_pretrained("bigcode/starcoder2-7b") + >>> tokenizer = AutoTokenizer.from_pretrained("bigcode/starcoder2-7b") >>> prompt = "Hey, are you conscious? Can you talk to me?" >>> inputs = tokenizer(prompt, return_tensors="pt")