Instructions to use SaeedLab/TITAN-BBB with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use SaeedLab/TITAN-BBB with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("SaeedLab/TITAN-BBB", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Upload folder using huggingface_hub
Browse files
classification/__init__.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
| 1 |
-
from .
|
| 2 |
from .modeling_bbb_model import BBBModel, BBBModelForSequenceClassification
|
|
|
|
| 1 |
+
from .configuration_bbb_model import BBBConfig
|
| 2 |
from .modeling_bbb_model import BBBModel, BBBModelForSequenceClassification
|
classification/configuration_bbb_model.py
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from transformers import PretrainedConfig
|
| 2 |
+
|
| 3 |
+
class BBBConfig(PretrainedConfig):
|
| 4 |
+
model_type = "bbb-model"
|
| 5 |
+
|
| 6 |
+
def __init__(
|
| 7 |
+
self,
|
| 8 |
+
gnn_layers: int = 4,
|
| 9 |
+
gnn_hidden: int = 512,
|
| 10 |
+
dropout: float = 0.1,
|
| 11 |
+
num_heads: int = 8,
|
| 12 |
+
num_features: int = 2265,
|
| 13 |
+
proj_dim: int = 1024,
|
| 14 |
+
neurons_fc: list[int] = [256],
|
| 15 |
+
input_dim: int = 768,
|
| 16 |
+
task: str = 'classification',
|
| 17 |
+
**kwargs):
|
| 18 |
+
|
| 19 |
+
self.gnn_layers = gnn_layers
|
| 20 |
+
self.gnn_hidden = gnn_hidden
|
| 21 |
+
self.dropout = dropout
|
| 22 |
+
self.num_heads = num_heads
|
| 23 |
+
self.num_features = num_features
|
| 24 |
+
self.proj_dim = proj_dim
|
| 25 |
+
self.neurons_fc = neurons_fc
|
| 26 |
+
self.input_dim = input_dim
|
| 27 |
+
self.task = task
|
| 28 |
+
super().__init__(**kwargs)
|
classification/modeling_bbb_model.py
CHANGED
|
@@ -6,7 +6,7 @@ from torch_geometric.nn import GATConv
|
|
| 6 |
from transformers import PreTrainedModel
|
| 7 |
from transformers.modeling_outputs import BaseModelOutputWithPooling, SequenceClassifierOutput
|
| 8 |
|
| 9 |
-
from .
|
| 10 |
|
| 11 |
class BBBModel(PreTrainedModel):
|
| 12 |
config_class = BBBConfig
|
|
|
|
| 6 |
from transformers import PreTrainedModel
|
| 7 |
from transformers.modeling_outputs import BaseModelOutputWithPooling, SequenceClassifierOutput
|
| 8 |
|
| 9 |
+
from .configuration_bbb_model import BBBConfig
|
| 10 |
|
| 11 |
class BBBModel(PreTrainedModel):
|
| 12 |
config_class = BBBConfig
|