ayushsinha commited on
Commit
d0316fe
Β·
verified Β·
1 Parent(s): 88cb50a

Update README.md

Browse files

Pythia Quantized Model for Sentiment Analysis
This repository hosts a quantized version of the Pythia model, fine-tuned for sentiment analysis tasks.
The model has been optimized for efficient deployment while maintaining high accuracy, making it suitable
for resource-constrained environments.


Model Details
-------------

* **Developed By:** AventIQ-AI
* **Model Architecture:** Pythia-410m
* **Task:** Sentiment Analysis
* **Dataset:** IMDb Reviews
* **Quantization:** Fp16
* **Fine-tuning Framework:** Hugging Face Transformers

The quantized model achieves comparable performance to the full-precision model while reducing memory usage and inference time.

Usage
-----

### Installation

pip install transformers torch

### Loading the Model

from transformers import AutoTokenizer, AutoModelForSequenceClassification


tokenizer = AutoTokenizer.from_pretrained("AventIQ-AI/pythia-410m")
model = AutoModelForSequenceClassification.from_pretrained("AventIQ-AI/pythia-410m")

# Example usage
text = "This product is amazing!"
inputs = tokenizer(text, return_tensors="pt")
outputs = model(**inputs)
logits = outputs.logits
predicted_class = logits.argmax().item()
print("Predicted class:", predicted_class)

Performance Metrics
-------------------

* **Accuracy:** 0.56
* **F1 Score:** 0.56
* **Precision:** 0.68
* **Recall:** 0.56

Fine-Tuning Details
-------------------

### Dataset

The IMDb Reviews dataset was used, containing both positive and negative sentiment examples.
Preprocessing Steps: Text was tokenized using the Hugging Face tokenizer, and sequences were truncated/padded to a maximum length of 128 tokens.

### Training

* Number of epochs: 3
* Batch size: 8
* evaluation_strategy=epoch
* Learning rate: 2e-5

### Quantization

Post-training quantization was applied using PyTorch's built-in quantization framework to reduce the model size and improve inference efficiency.

Repository Structure
--------------------

.
β”œβ”€β”€ model/ # Contains the fine tuned model files
β”œβ”€β”€ tokenizer/ # Tokenizer configuration and vocabulary files
β”œβ”€β”€ model.safetensors/ # Fine Tuned model
β”œβ”€β”€ README.md # Model documentation
└── LICENSE # License for the repository

Limitations
-----------

* The model may not generalize well to domains outside the fine-tuning dataset.
* Quantization may result in minor accuracy degradation compared to full-precision models.

License
-------

This project is licensed under the Apache License 2.0. See the LICENSE file for more details.

Contributing
------------

Contributions are welcome! Feel free to open an issue or submit a pull request if you have suggestions or improvements.

Files changed (1) hide show
  1. README.md +13 -3
README.md CHANGED
@@ -1,3 +1,13 @@
1
- ---
2
- license: apache-2.0
3
- ---
 
 
 
 
 
 
 
 
 
 
 
1
+ Pythia Quantized Model for Sentiment Analysis
2
+ This repository hosts a quantized version of the Pythia model, fine-tuned for sentiment analysis tasks.
3
+ The model has been optimized for efficient deployment while maintaining high accuracy, making it suitable
4
+ for resource-constrained environments.
5
+
6
+ Model Details
7
+ Model Architecture: Pythia
8
+ Task: Sentiment Analysis
9
+ Dataset: Twitter Tweets
10
+ Quantization: FP16
11
+
12
+ Fine-tuning Framework: Hugging Face Transformers
13
+ The quantized model achieves comparable performance to its full-precision counterpart while significantly reducing memory usage and inference latency.