Skip to content

batch inputs during inference #25

@the-entire-country-of-ireland

Description

How can we batch multiple inputs when computing the embeddings using a trained model? The script command/inference/get_embedding.py demonstrates how to compute a single function's embedding, but it has slow throughput.

I tried to concatenate the tensors for each respective field in the dicts produced from sample_emb = trex.process_token_dict(sample_tokens), but ran into a problem where the inputs needed to first be padded to the proper length, and I could not determine how to pad them or determine what the proper padding value is for each field.

Could you please give an example of computing embeddings for multiple functions at once?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions