-
Notifications
You must be signed in to change notification settings - Fork 4
Closed
Description
So i was going through the github and hugging face link and available items and then tried to create the inference script to test the model.
Steps:
- I firstly cloned the repo and its content
!git clone https://github.com/pulp-bio/BioFoundation.git - installed the required packages from requirements.txt
- downloaded the weights from the hugging face via the following command
from huggingface_hub import snapshot_download
snapshot_download(
repo_id="thorir/FEMBA",
repo_type="model",
local_dir="checkpoints/FEMBA"
)
- installed mamba-ssm and its dependencies
- wrote the script to test the artifact detection model
import torch
from safetensors.torch import load_file
from models.FEMBA import FEMBA
# Model configuration
model = FEMBA(
seq_length=1280,
num_channels=22,
num_classes=2,
exp=4,
embed_dim=79,
num_blocks=4,
classification_type='bc'
)
# Load safetensors checkpoint
state_dict = load_file("/content/checkpoints/FEMBA/TUAR/FEMBA_base.safetensors")
model.load_state_dict(state_dict)
model.eval()
# Dummy input
x = torch.randn(1, 22, 1280)
mask = torch.zeros_like(x, dtype=torch.bool)
# Inference
with torch.no_grad():
preds, _ = model(x, mask)
print(preds)
but im getting this error module 'torch' has no attribute 'version' multiple times, tried restarting the colab session.
even though the torch is installed and working
import torch
print(torch.__version__)
result is 2.8.0+cu126
PS : this is the colab notebook Link.
Metadata
Metadata
Assignees
Labels
No labels