Downloads · 30 days
9
9% of all-time downloads
crab27/llama3-edge
llama3-edge is a feature extraction model from crab27. Use it when you need embeddings to search or compare text. It is set up for transformers.
This repository contains a custom Llama 3 based model for edge prediction tasks. It predicts edge targets based on context IDs.
Downloads · 30 days
9
9% of all-time downloads
All-time downloads
95
Public
Parameters
7.1B
28.2 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors28.2 GB · 100%
From the Hugging Face model README
This repository contains a custom Llama 3 based model for edge prediction tasks. It predicts edge targets based on context IDs.
The model corresponds to a Llama3 architecture with the following configuration:
It uses a UnifiedIdMapper to map between original IDs (nodes/edges) and internal model IDs.
configuration_llama_edge.py: Defines LlamaEdgeConfig (inherits from PretrainedConfig).modeling_llama_edge.py: Defines LlamaEdgeForCausalLM and components (inherits from PreTrainedModel).id_mapper.py: UnifiedIdMapper for ID mapping logic.inference.py: Example script to run inference using the model and mapper.model.safetensors: Model weights (required).unified_id_mapper.json: Mapping data (required).You can load the model using the provided classes:
import torch
from configuration_llama_edge import LlamaEdgeConfig
from modeling_llama_edge import LlamaEdgeForCausalLM
from id_mapper import UnifiedIdMapper
# Load configuration
config = LlamaEdgeConfig()
# Initialize model
model = LlamaEdgeForCausalLM(config)
# Load weights
from safetensors.torch import load_file
state_dict = load_file("model.safetensors")
model.load_state_dict(state_dict)
model.eval()
Use the inference.py script to run a prediction example:
python inference.py