Giter Site home page Giter Site logo

xyzhang626 / embeddings.cpp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from skeskinen/bert.cpp

50.0 50.0 3.0 180 KB

ggml implementation of embedding models including SentenceTransformer and BGE

License: MIT License

Shell 0.78% C++ 66.94% Python 14.17% C 11.34% CMake 6.77%

embeddings.cpp's People

Contributors

dranger003 avatar hlhr202 avatar lindeer avatar marclove avatar skeskinen avatar xyzhang626 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

embeddings.cpp's Issues

Illegal instruction (core dumped)

I'm following the examples from the readme.
When I run:

python download-repo.py BAAI/bge-base-en-v1.5 # or any other model
sh run_conversions.sh bge-base-en-v1.5

It fails at the quantization step:

[...]
Done. Output file: bge-base-en-v1.5/ggml-model-f16.bin

Illegal instruction (core dumped)
Illegal instruction (core dumped)

Is there something I can do to make it work?

Cuda?

Do you have any plans to support the other backends that LlamaCPP supports so that this can be accelerated?

Tokenizer works inconsistently but better for bge zh series model

Summary

This repo's tokenizer works consistently with huggingface's tokenizer in the most cases and works inconsistently but possibly better bge zh series model.

Details

bge-small-zh-v1.5 tokenizer will be bad at 1) words with capital letter 2) accent letter. It can be caused by the normalization setting of it.

For example, in the case 大家好我是GPT, hf tokenizer (left column) can not recognize the upper GPT but tokenizer in this repo (right column) can do it.
image

It's similar for the accent case.
image

If you find any more differences between tokenizer in this repo with the huggingface one, please let me know I will try to fix it.

bert_encode() not thread-safe

In server.cpp, bert_encode seems not thread-safe, different invocation works in same memory buffer in bert_context

while(true) {
    std::string string_in = receive_string(new_socket);
    if (string_in.empty()) {
        break;
    }
    std::vector<float> embeddings = std::vector<float>(n_embd);
    bert_encode(bctx, params.n_threads, string_in.data(), embeddings.data());
    send_floats(new_socket, embeddings);
}

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.