adapter description updated
Browse files
README.md
CHANGED
|
@@ -44,7 +44,7 @@ Install the required dependencies:
|
|
| 44 |
pip install transformers torch numpy pandas anarci
|
| 45 |
```
|
| 46 |
|
| 47 |
-
## π Loading
|
| 48 |
|
| 49 |
### Method 1: Load Model and Tokenizer, then Import Adapter
|
| 50 |
```python
|
|
@@ -87,10 +87,12 @@ spec.loader.exec_module(adapter_module)
|
|
| 87 |
ablang = adapter_module.AbLang2PairedHuggingFaceAdapter(model=model, tokenizer=tokenizer)
|
| 88 |
```
|
| 89 |
|
| 90 |
-
**Note**:
|
| 91 |
|
| 92 |
## βοΈ Available Utilities
|
| 93 |
|
|
|
|
|
|
|
| 94 |
- **seqcoding**: Sequence-level representations (averaged across residues)
|
| 95 |
- **rescoding**: Residue-level representations (per-residue embeddings)
|
| 96 |
- **likelihood**: Raw logits for amino acid prediction at each position
|
|
@@ -99,6 +101,14 @@ ablang = adapter_module.AbLang2PairedHuggingFaceAdapter(model=model, tokenizer=t
|
|
| 99 |
- **confidence**: Fast uncertainty scoring (single forward pass, no masking)
|
| 100 |
- **restore**: Restore masked residues (*) with predicted amino acids
|
| 101 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 102 |
## π‘ Examples
|
| 103 |
|
| 104 |
### π AbLang2 (Paired Sequences) - Restore Example
|
|
|
|
| 44 |
pip install transformers torch numpy pandas anarci
|
| 45 |
```
|
| 46 |
|
| 47 |
+
## π Loading Model from Hugging Face Hub
|
| 48 |
|
| 49 |
### Method 1: Load Model and Tokenizer, then Import Adapter
|
| 50 |
```python
|
|
|
|
| 87 |
ablang = adapter_module.AbLang2PairedHuggingFaceAdapter(model=model, tokenizer=tokenizer)
|
| 88 |
```
|
| 89 |
|
| 90 |
+
**Note**: Model automatically use GPU when available, otherwise fall back to CPU.
|
| 91 |
|
| 92 |
## βοΈ Available Utilities
|
| 93 |
|
| 94 |
+
This wrapper translates between HuggingFace's model format and AbLang2's expected input/output structure, making it easy to use AbLang2's powerful antibody analysis tools with model loaded from HuggingFace.
|
| 95 |
+
|
| 96 |
- **seqcoding**: Sequence-level representations (averaged across residues)
|
| 97 |
- **rescoding**: Residue-level representations (per-residue embeddings)
|
| 98 |
- **likelihood**: Raw logits for amino acid prediction at each position
|
|
|
|
| 101 |
- **confidence**: Fast uncertainty scoring (single forward pass, no masking)
|
| 102 |
- **restore**: Restore masked residues (*) with predicted amino acids
|
| 103 |
|
| 104 |
+
All these utilities work seamlessly with the HuggingFace-loaded model, maintaining the same API as the original AbLang2 implementation.
|
| 105 |
+
|
| 106 |
+
The `AbLang2PairedHuggingFaceAdapter` class is a wrapper that lets you use AbLang2 model utilities after loading the model from HuggingFace. This class enables you to:
|
| 107 |
+
|
| 108 |
+
- **Access all AbLang2 utilities** (seqcoding, rescoding, likelihood, probability, etc.) with the same interface as the original implementation
|
| 109 |
+
- **Work with antibody sequences** (heavy and light chains) seamlessly
|
| 110 |
+
- **Maintain compatibility** with the original AbLang2 API while leveraging HuggingFace's model loading and caching capabilities
|
| 111 |
+
|
| 112 |
## π‘ Examples
|
| 113 |
|
| 114 |
### π AbLang2 (Paired Sequences) - Restore Example
|