Downloads · 30 days
12
7% of all-time downloads
AventIQ-AI/all-MiniLM-L6-v2-movie-recommendation-system
all-MiniLM-L6-v2-movie-recommendation-system is a machine learning model from AventIQ-AI. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This repository hosts the quantized version of the all-MiniLM-L6-v2 model fine-tuned for movie reccommendation tasks. The model has been trained on the movielensratings dataset from Hugging Face. The model is quantize…
Downloads · 30 days
12
7% of all-time downloads
All-time downloads
178
Public
Parameters
22.7M
45.4 MB on disk
Likes
2
Public
Click a slice to open those files.
.safetensors45.4 MB · 98%
From the Hugging Face model README
This repository hosts the quantized version of the all-MiniLM-L6-v2 model fine-tuned for movie reccommendation tasks. The model has been trained on the movielens_ratings dataset from Hugging Face. The model is quantized to Float16 (FP16) to optimize inference speed and efficiency while maintaining high performance.
movielens_ratingspip install transformers torch
from sentence_transformers import SentenceTransformer, models
import torch
device = "cuda" if torch.cuda.is_available() else "cpu"
model_name = "AventIQ-AI/all-MiniLM-L6-v2-movie-recommendation-system"
model = SentenceTransformer(model_name).to(device)
def generate_movies(genre, top_k=5):
genre_embedding = model.encode([genre], convert_to_tensor=True)
movie_embeddings = model.encode(df['title'].tolist(), convert_to_tensor=True)
scores = torch.nn.functional.cosine_similarity(genre_embedding, movie_embeddings)
top_results = torch.argsort(scores, descending=True)
# Get unique movies while preserving order
recommended_movies = []
seen = set()
for idx in top_results.tolist():
movie = df.iloc[idx]['title']
if movie not in seen:
recommended_movies.append(movie)
seen.add(movie)
if len(recommended_movies) == top_k:
break
return recommended_movies
print("🎬 Recommended Movies for 'Action':", generate_movies("Action"))
print("🎬 Recommended Movies for 'Comedy':", generate_movies("Comedy"))
print("🎬 Recommended Movies for 'Sci-Fi':", generate_movies("Sci-Fi"))
Post-training quantization was applied using PyTorch's built-in quantization framework. The model was quantized to Float16 (FP16) to reduce model size and improve inference efficiency while balancing accuracy.
.
├── model/ # Contains the quantized model files
├── tokenizer_config/ # Tokenizer configuration and vocabulary files
├── model.safetensors/ # Quantized Model
├── README.md # Model documentation
Contributions are welcome! Feel free to open an issue or submit a pull request if you have suggestions or improvements.