Skip to content

bert_encode() not thread-safe #5

@WayneCao

Description

@WayneCao

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);
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions