lhallee commited on
Commit
8838583
·
verified ·
1 Parent(s): 8739ef1

Upload README.md with huggingface_hub

Browse files
Files changed (1) hide show
  1. README.md +25 -0
README.md CHANGED
@@ -41,6 +41,31 @@ outputs = model(**inputs)
41
  embeddings = outputs.last_hidden_state # (batch, seq_len, hidden_dim)
42
  ```
43
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  ## Batch Embedding
45
 
46
  ```python
 
41
  embeddings = outputs.last_hidden_state # (batch, seq_len, hidden_dim)
42
  ```
43
 
44
+ ## Experimental Test-Time Training
45
+
46
+ TTT is disabled by default. Normal ANKH inference, embeddings, and
47
+ `state_dict()` keys are unchanged unless you explicitly call `model.ttt(...)`.
48
+ The current implementation is experimental and trains only local LoRA adapters
49
+ with masked language modeling on the test protein. ANKH's FastPLMs MaskedLM
50
+ head is encoder-only and not pretrained for standard MLM, so treat TTT results
51
+ with extra caution.
52
+
53
+ ```python
54
+ from transformers import AutoModelForMaskedLM
55
+
56
+ mlm = AutoModelForMaskedLM.from_pretrained(
57
+ "Synthyra/ANKH_base",
58
+ trust_remote_code=True,
59
+ ).cuda().eval()
60
+
61
+ metrics = mlm.ttt(
62
+ seq="MSTNPKPQRKTKRNT",
63
+ ttt_config={"steps": 3, "ags": 1, "batch_size": 1},
64
+ )
65
+ mlm.ttt_reset()
66
+ print(metrics["losses"])
67
+ ```
68
+
69
  ## Batch Embedding
70
 
71
  ```python