Feature Extraction
Transformers
Safetensors
PyTorch
autoencoder
reconstruction
preprocessing
normalizing-flow
scaler
custom_code
Instructions to use amaye15/autoencoder with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use amaye15/autoencoder with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="amaye15/autoencoder", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("amaye15/autoencoder", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
AndrewMayesPrezzee commited on
Commit ·
5eda1f5
1
Parent(s): 5b68b61
Feat - Relative & Absolute Imports
Browse files- configuration_autoencoder.py +6 -0
- modeling_autoencoder.py +4 -1
configuration_autoencoder.py
CHANGED
|
@@ -5,6 +5,12 @@ Autoencoder configuration for Hugging Face Transformers.
|
|
| 5 |
from transformers import PretrainedConfig
|
| 6 |
from typing import List, Optional
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
class AutoencoderConfig(PretrainedConfig):
|
| 10 |
"""
|
|
|
|
| 5 |
from transformers import PretrainedConfig
|
| 6 |
from typing import List, Optional
|
| 7 |
|
| 8 |
+
# Support both package-relative and flat import in HF remote code context
|
| 9 |
+
try:
|
| 10 |
+
from . import __version__ as _pkg_version # type: ignore
|
| 11 |
+
except Exception: # pragma: no cover
|
| 12 |
+
_pkg_version = None
|
| 13 |
+
|
| 14 |
|
| 15 |
class AutoencoderConfig(PretrainedConfig):
|
| 16 |
"""
|
modeling_autoencoder.py
CHANGED
|
@@ -13,7 +13,10 @@ from transformers import PreTrainedModel
|
|
| 13 |
from transformers.modeling_outputs import BaseModelOutput
|
| 14 |
from transformers.utils import ModelOutput
|
| 15 |
|
| 16 |
-
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
|
| 19 |
class NeuralScaler(nn.Module):
|
|
|
|
| 13 |
from transformers.modeling_outputs import BaseModelOutput
|
| 14 |
from transformers.utils import ModelOutput
|
| 15 |
|
| 16 |
+
try:
|
| 17 |
+
from .configuration_autoencoder import AutoencoderConfig # when loaded via HF dynamic module
|
| 18 |
+
except Exception:
|
| 19 |
+
from configuration_autoencoder import AutoencoderConfig # local usage
|
| 20 |
|
| 21 |
|
| 22 |
class NeuralScaler(nn.Module):
|