Fastc

Latest version: v2.2407.0

Safety actively analyzes 681881 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

2.2407.0

- **Introduction of Logistic Regression Classifier**: Added a new classification kernel leveraging Logistic Regression for efficient text categorization without the need for fine-tuning.

- **Support for Multiple Pooling Strategies**: Implemented various pooling strategies, including `MEAN`, `MEAN_MASKED`, `MAX`, `MAX_MASKED`, `CLS`, `SUM`, and `ATTENTION_WEIGHTED` for flexible embedding generation.

- **Template and Instruct Models**: Introduced support for instruct templates with models like `intfloat/multilingual-e5-large-instruct` to enhance performance by utilizing structured templates.

- **Model Export and HuggingFace Integration**: Simplified the process of saving and publishing models to HuggingFace with automatic model cards and additional metadata such as tags and languages.

- **Inference Server**: Added a dockerized inference server with an HTTP API to facilitate deployment. This includes new scripts for starting the server both in a docker container and on a host machine.

- **Improved Documentation**: Updated and expanded documentation, including examples for training models, classification kernels, pooling strategies, model export, and inference.

1.2406.5

Centroid Classifier Refactor:
- **Normalization Improvements:** Introduced `_normalize` method for efficient tensor normalization using `torch.nn.functional.normalize`.
- **Training Enhancements:**
- `train` method now calculates centroids using mean embeddings for each label.
- Centroids are stored and normalized upon training.
- **Prediction Optimization:**
- Improved `predict` and `predict_one` methods to utilize normalized centroids.
- Replaced cosine similarity calculations with dot product for faster computations.

Interface Changes:
- Updated `get_embeddings` method to yield `torch.Tensor` instead of `numpy.ndarray`.
- Removed redundant code and streamlined embedding extraction process.

Embedding Model Initialization:
- Ensured the embedding model is set to evaluation mode immediately after loading to improve inference efficiency (`self._model.eval()`).

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.