Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions asmtransformers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ by Wang et al. in the jTrans paper (referred to above), is implicitly included i
JUMP-token, the correct token to predict is the correct jump address. This is the token index of the place the code was
supposed to jump to, materialised in the vocabulary as JUMP_ADDR_n `(n = 1, len(max_token_lenght))`.

You can also find our monolingual, pretrained only ARM64BERT model on Huggingface:
<a href='https://huggingface.co/NetherlandsForensicInstitute/ARM64Bert'>NetherlandsForensicInstitute/ARM64Bert</a>
You can also find our monolingual, pretrained only ARM64BERT model on Hugging Face:
[NetherlandsForensicInstitute/ARM64Bert](https://huggingface.co/NetherlandsForensicInstitute/ARM64Bert)

Finetuning
----------
Expand All @@ -152,8 +152,8 @@ to train the model.

Our multilingual model can be found on [Hugging Face](https://huggingface.co/NetherlandsForensicInstitute/Multilingual-ASMBERT)

You can also find our monolingual, ARM64BERT semantic search model on Hugging Face:
<a href='https://huggingface.co/NetherlandsForensicInstitute/ARM64bert-embedding'>NetherlandsForensicInstitute/ARM64bert-embedding</a>
You can also find our monolingual, ARM64BERT-embedding semantic search model on Hugging Face:
[NetherlandsForensicInstitute/ARM64bert-embedding](https://huggingface.co/NetherlandsForensicInstitute/ARM64bert-embedding)

Evaluation
----------
Expand Down
2 changes: 1 addition & 1 deletion asmtransformers/asmtransformers/models/asmsentencebert.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@


class ASMTransformerModule(Module):
"""Minimal sentence-transformers module for ARM64BERT finetuning."""
"""Minimal sentence-transformers module for ASMBERT finetuning."""

def __init__(
self,
Expand Down
2 changes: 1 addition & 1 deletion asmtransformers/asmtransformers/models/embedder.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@


class ASMEmbedder:
"""Native inference wrapper for ARM64BERT-style embedding checkpoints."""
"""Native inference wrapper for ASMBERT-style embedding checkpoints."""

def __init__(self, model, tokenizer, *, device=None, normalize_embeddings=True):
self.model = model
Expand Down
8 changes: 4 additions & 4 deletions asmtransformers/tests/test_embedder.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,10 @@ def test_mean_pool_ignores_padding():

@pytest.mark.skipif(os.environ.get('CI') == 'true', reason="don't run this test on CI")
def test_hf_embedding_model_loads_natively(anchor):
embedder = ASMEmbedder.from_pretrained('NetherlandsForensicInstitute/ARM64BERT-embedding')
embedder = ASMEmbedder.from_pretrained('NetherlandsForensicInstitute/Multilingual-ASMBERT')

embedding = embedder.encode(anchor, architecture='arm64')

assert np.isclose(embedding.sum(), -0.09272218)
assert np.isclose(embedding.min(), -0.10641833)
assert np.isclose(embedding.max(), 0.116405316)
assert np.isclose(embedding.sum(), -0.0179356)
assert np.isclose(embedding.min(), -0.1113021)
assert np.isclose(embedding.max(), 0.12490158)
6 changes: 3 additions & 3 deletions citatio/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Citatio 📜
==========

This package provides a REST API to the [`asmtransformers`](../asmtransformers) and its
[`ARM64BERT-embedding`](https://huggingface.co/NetherlandsForensicInstitute/ARM64BERT-embedding/) model,
[`Multilingual-ASMBERT`](https://huggingface.co/NetherlandsForensicInstitute/Multilingual-ASMBERT/) model,
bridging Ghidra to a search index to find similar functions in ARM64 binaries.
See [`sententia`](../sententia) for the Ghidra plugin that uses this REST API to both add functions to the search index
and search for possible function names / labels based on vector similarity.
Expand All @@ -12,13 +12,13 @@ Configuration and runtime

The citatio REST API takes 3 configuration options:

- The model to be used for embedding (currently, only `NetherlandsForensicInstitute/ARM64BERT-embedding` is supported);
- The model to be used for embedding (currently, only `NetherlandsForensicInstitute/Multilingual-ASMBERT` is supported);
- The authentication modes to support, any of `anonymous`, `client_supplied` and `oidc`;
- The database to store both assembly and embeddings in, either SQLite+sqlitevec or PostgreSQL+pgvector;

Citatio uses [confidence](https://github.com/NetherlandsForensicInstitute/confidence/) to read configuration, so both strategically placed files and environment variables are supported:

- `CITATIO_MODEL_HF` or `CITATIO_MODEL_PATH`: a local path or huggingface model name (though again, currently only the `ARM64BERT-embedding` model is supported);
- `CITATIO_MODEL_HF` or `CITATIO_MODEL_PATH`: a local path or huggingface model name (though again, currently only the `NetherlandsForensicInstitute/Multilingual-ASMBERT` model is supported);
- `CITATIO_AUTH_ANONYMOUS` (allowing operation without identifying a user) and
`CITATIO_AUTH_CLIENT__SUPPLIED` (enabling a client to supply a user identity in a request body) can be set to `true` to enable them,
OIDC configuration requires at least four values, see below.
Expand Down
Loading