diff --git a/setup.py b/setup.py index 854c9cc..3e1a416 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ setup( name="adaptive-classifier", - version="0.1.0", + version="0.1.1", author="codelion", author_email="codelion@okyasoft.com", description="A flexible, adaptive classification system for dynamic text classification", diff --git a/src/adaptive_classifier/__init__.py b/src/adaptive_classifier/__init__.py index f060777..1fa7f18 100644 --- a/src/adaptive_classifier/__init__.py +++ b/src/adaptive_classifier/__init__.py @@ -4,7 +4,7 @@ from .multilabel import MultiLabelAdaptiveClassifier, MultiLabelAdaptiveHead from huggingface_hub import ModelHubMixin -__version__ = "0.0.19" +__version__ = "0.1.1" __all__ = [ "AdaptiveClassifier", diff --git a/src/adaptive_classifier/classifier.py b/src/adaptive_classifier/classifier.py index 63023f9..35e4352 100644 --- a/src/adaptive_classifier/classifier.py +++ b/src/adaptive_classifier/classifier.py @@ -549,7 +549,8 @@ def _save_pretrained( 'id_to_label': {str(k): v for k, v in self.id_to_label.items()}, 'train_steps': self.train_steps, 'training_history': self.training_history, # Save cumulative training counts - 'config': self.config.to_dict() + 'config': self.config.to_dict(), + 'library_name': 'adaptive-classifier' # Tell HuggingFace Hub this requires the adaptive-classifier library } # Save examples in a separate file to keep config clean @@ -924,7 +925,13 @@ def _generate_model_card(self) -> str: This model is an instance of an [adaptive-classifier](https://github.com/codelion/adaptive-classifier) that allows for continuous learning and dynamic class addition. -You can install it with `pip install adaptive-classifier`. +## Installation + +**IMPORTANT:** To use this model, you must first install the `adaptive-classifier` library. You do **NOT** need `trust_remote_code=True`. + +```bash +pip install adaptive-classifier +``` ## Model Details @@ -941,10 +948,12 @@ def _generate_model_card(self) -> str: ## Usage +After installing the `adaptive-classifier` library, you can load and use this model: + ```python from adaptive_classifier import AdaptiveClassifier -# Load the model +# Load the model (no trust_remote_code needed!) classifier = AdaptiveClassifier.from_pretrained("adaptive-classifier/model-name") # Make predictions @@ -952,12 +961,14 @@ def _generate_model_card(self) -> str: predictions = classifier.predict(text) print(predictions) # List of (label, confidence) tuples -# Add new examples +# Add new examples for continuous learning texts = ["Example 1", "Example 2"] labels = ["class1", "class2"] classifier.add_examples(texts, labels) ``` +**Note:** This model uses the `adaptive-classifier` library distributed via PyPI. You do **NOT** need to set `trust_remote_code=True` - just install the library first. + ## Training Details - Training Steps: {self.train_steps}