Skip to content

Commit

Permalink
Idefics2: sync added image tokens with transformers
Browse files Browse the repository at this point in the history
Before this change, the number of reserved image tokens was not the
same as the number of images. Fixes #2029.

While at it, also remove all the image token handling duplication
in `prepare_input`.
  • Loading branch information
danieldk committed Jun 25, 2024
1 parent 83634dc commit 1f1f4be
Show file tree
Hide file tree
Showing 17 changed files with 1,465 additions and 1,335 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ this will impact performance.
### Distributed Tracing

`text-generation-inference` is instrumented with distributed tracing using OpenTelemetry. You can use this feature
by setting the address to an OTLP collector with the `--otlp-endpoint` argument. The default service name can be
by setting the address to an OTLP collector with the `--otlp-endpoint` argument. The default service name can be
overridden with the `--otlp-service-name` argument

### Architecture
Expand Down
4 changes: 3 additions & 1 deletion benchmark/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
tracing::info!("Downloading tokenizer");

// Parse Huggingface hub token
let auth_token = std::env::var("HF_TOKEN").or_else(|_| std::env::var("HUGGING_FACE_HUB_TOKEN")).ok();
let auth_token = std::env::var("HF_TOKEN")
.or_else(|_| std::env::var("HUGGING_FACE_HUB_TOKEN"))
.ok();

// Download and instantiate tokenizer
// We need to download it outside of the Tokio runtime
Expand Down
2 changes: 1 addition & 1 deletion clients/python/text_generation/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,6 @@ class DeployedModel(BaseModel):
# Disable warning for use of `model_` prefix in `model_id`. Be mindful about adding members
# with model_ prefixes, since this disables guardrails for colliding fields:
# https://github.com/pydantic/pydantic/issues/9177
model_config = ConfigDict(protected_namespaces=())
model_config = ConfigDict(protected_namespaces=())
model_id: str
sha: str
Loading

0 comments on commit 1f1f4be

Please sign in to comment.