Feature Extraction
Transformers
Safetensors
medical
radiology
vision-language
chest-ct
3d-medical-imaging
glint
custom_code
Instructions to use Deepnoid/GLINT-CT with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Deepnoid/GLINT-CT with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="Deepnoid/GLINT-CT", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("Deepnoid/GLINT-CT", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download common_layers.py from Deepnoid/GLINT-CT: direct link, hf CLI and curl.
- Browser
- Download file 752 Bytes
-
https://huggingface.co/Deepnoid/GLINT-CT/resolve/main/common_layers.py
- Command line
-
hf download hf://Deepnoid/GLINT-CT/common_layers.py
-
curl -L -o common_layers.py https://huggingface.co/Deepnoid/GLINT-CT/resolve/main/common_layers.py
752 Bytes
| from torch import nn | |
| from transformers.modeling_utils import PreTrainedModel | |
| class BasePreTrainedModel(PreTrainedModel): | |
| supports_gradient_checkpointing = True | |
| def _init_weights(self, module): | |
| if ( | |
| isinstance(module, nn.Conv2d) # noqa: SIM101 | |
| or isinstance(module, nn.Embedding) | |
| or isinstance(module, nn.Linear) | |
| ): | |
| module.weight.data.normal_(mean=0.0, std=0.02) | |
| if hasattr(module, "bias") and module.bias is not None: | |
| module.bias.data.zero_() | |
| elif isinstance(module, nn.LayerNorm): | |
| module.bias.data.zero_() | |
| module.weight.data.fill_(1.0) | |
| elif isinstance(module, nn.Parameter): | |
| raise ValueError() | |