CODE: https://github.com/frank-morales2020/AST/blob/main/EVO2_TOPOAI_TRANSFORMER_MULTRUN_CORRECTED.ipynb

INFERENCE


import torch
from huggingface_hub import hf_hub_download
from evo2 import Evo2

from warnings import filterwarnings
filterwarnings('ignore')

# 1. Initialize fresh base Evo 2 manager
device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')
print(f"Initializing official Evo 2 Manager for evo2_7b on {device}...")
evo_manager = Evo2('evo2_7b')
model = getattr(evo_manager, 'model', evo_manager)

# 2. Download your governed artifact directly from Hugging Face Hub
repo_id = "frankmorales2020/governed-evo2-7b-topo"
filename = "governed_evo2_weights.pt"

print(f"Downloading governed weights from Hugging Face Hub ({repo_id})...")
checkpoint_path = hf_hub_download(repo_id=repo_id, filename=filename)

# 3. Load the checkpoint and restore state
print("Restoring governed weights and TOPO invariant anchors...")
checkpoint = torch.load(checkpoint_path, map_location=device)
model.load_state_dict(checkpoint["model_state_dict"])
anchors = checkpoint["topo_anchors"]
print(f"Successfully loaded TOPO anchors for layers: {list(anchors.keys())}")

# 4. Run inference test
test_prompt = "ACGTTGCAATGCGATCG"
input_seqs = [test_prompt]

print(f"Running inference test with prompt: '{test_prompt}'")
generated_output = evo_manager.generate(
    input_seqs, 
    n_tokens=30, 
    temperature=0.7, 
    top_k=4
)

print("\nInference Output from HF Loaded Governed Model:")
print(generated_output)

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support