Comments (4)
@Matheus-Garbelini haha, thanks a lot @michaelfeil. This model is indeed not mine, hence I could just assume it was some upstream config issue, but you confirmed that this was the case.
Currently I'm running infinity with embeddings + reranking models and it's works flawlessly.
Regards.
from infinity.
Hey @Matheus-Garbelini , thanks for opening the issue
Looks like there is no max_length attr
in the config.json
Asking to truncate to max_length but no maximum length is provided and the model has no predefined maximum length. Default to no truncation.
Asking to truncate to max_length but no maximum length is provided and the model has no predefined maximum length. Default to no truncation.
- How does it work if you send a rerank request using
from sentence_transformer import CrossEncoder
? Is the max length respected for this model? (I am pretty sure the issue is upstream) - Given that max_length is not in the config, how would you expect the 514 token length to be handled? (model supports only 514)
from infinity.
Please check the usage of "maidalun1020/bce-reranker-base_v1" in: https://github.com/netease-youdao/BCEmbedding?tab=readme-ov-file#3-based-on-sentence_transformers
from sentence_transformers import CrossEncoder
# init reranker model
model = CrossEncoder('maidalun1020/bce-reranker-base_v1', max_length=512)
# calculate scores of sentence pairs
scores = model.predict(sentence_pairs)
max_length
should be 512.
from infinity.
@shenlei1020 @Matheus-Garbelini Thanks for your comments - excited to see your responses here.
I would avoid overwriting the defaults of the authors model code - it depends on the person publishing the model. In this case, a wrong value was sent on purpose by the engineers behind https://huggingface.co/maidalun1020/bce-reranker-base_v1/discussions/4 . I encourage you to fix things in the future directly in the upstream repos - infinity just optimizes the inference .
https://huggingface.co/maidalun1020/bce-reranker-base_v1/discussions/4/files will solve it.
from infinity.
Related Issues (20)
- cannot use rerank (BAAI/bge-base-en-v1.5) HOT 1
- How does this compare to Huggingface's Text Embedding Inference? HOT 4
- Create llama-index `InfinityEmbeddings` as langchain HOT 4
- Parity break with OpenAI API: /models HOT 4
- Torch + Cuda + Bert crashes abruptly on startup HOT 10
- Asking to truncate to max_length but no maximum length HOT 1
- Adding torch.compile + fp16 + bettertransformer a CLI argument
- Support for nomic-ai/nomic-embed-text-v1.5 HOT 1
- Support for instructur/instructor-xl models HOT 5
- infinity_emb failed at startup using `torch.compile` when installed via pip HOT 9
- "msg":"Input should be a valid list" HOT 6
- support for `revision` HOT 1
- unexpected keyword argument 'trust_remote_code' HOT 3
- Adding max token budget per batch
- How is long text handled?
- Return actual token count on forward pass HOT 1
- AMD ROCm docker images support (+ optimization) HOT 6
- AWQ-Bert / 4-bit Bert
- 422 error if /embeddings input is a string HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from infinity.