Skip to content

Commit

Permalink
Fix code example to load bigcode starcoder2 7b (#32474)
Browse files Browse the repository at this point in the history
  • Loading branch information
JuanFKurucz authored Aug 8, 2024
1 parent 0164560 commit 54ac39c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/transformers/models/starcoder2/modeling_starcoder2.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 54ac39c

Please sign in to comment.