Code Monkey home page Code Monkey logo

Comments (4)

Matheus-Garbelini avatar Matheus-Garbelini commented on June 10, 2024 1

@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.

michaelfeil avatar michaelfeil commented on June 10, 2024

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.
  1. 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)
  2. 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.

shenlei1020 avatar shenlei1020 commented on June 10, 2024

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.

michaelfeil avatar michaelfeil commented on June 10, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.