Downloads · 30 days
0
gauravprasadgp/qwen3-embedding_0.6B_lora
qwen3-embedding_0.6B_lora is a machine learning model from gauravprasadgp. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
Model Name: Qwen3-Embedding-0.6B-LoRA-Fine-tuned Base Model: Qwen/Qwen3-Embedding-0.6B Model Type: Embedding Model Fine-tuning Method: Low-Rank Adaptation (LoRA) Developer: https://github.com/gauravprasadgp Contact: h…
Downloads · 30 days
0
Access
Public
Updated Jul 12, 2025
Repo size
20.6 MB
Likes
0
Public
Click a slice to open those files.
.json14.2 MB · 57%
From the Hugging Face model README
This model is a fine-tuned version of the Qwen3-Embedding-0.6B model, adapted using the LoRA method. The goal of this fine-tuning was to enhance its performance on specific downstream tasks (e.g., semantic search, clustering, recommendation systems) by aligning its embeddings more closely with the characteristics of a particular dataset.
Qwen3-Embedding-0.6B is an efficient and performant embedding model from the Qwen series, designed to convert text into high-dimensional numerical vectors (embeddings) that capture semantic meaning. LoRA fine-tuning allows for efficient adaptation of large pre-trained models with minimal computational cost and storage requirements, making it ideal for targeted performance improvements without full model retraining.
This model is intended for:
q_proj, k_proj, v_proj, out_proj]You can load and use this model with the Hugging Face transformers and peft libraries.
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel, PeftConfig
import torch
# Replace with the actual path or Hugging Face Hub ID if uploaded
model_id = "your_username/your_fine_tuned_qwen_embedding_model" # Example: "my_org/qwen3-embedding-0.6b-lora"
config = PeftConfig.from_pretrained(model_id)
base_model = AutoModelForCausalLM.from_pretrained(config.base_model_name_or_path, trust_remote_code=True, torch_dtype=torch.bfloat16)
tokenizer = AutoTokenizer.from_pretrained(config.base_model_name_or_path, trust_remote_code=True)
model = PeftModel.from_pretrained(base_model, model_id)
# Example usage for generating embeddings (adjust for your specific model's embedding API)
def get_embedding(text):
inputs = tokenizer(text, return_tensors='pt', padding=True, truncation=True, max_length=512)
with torch.no_grad():
outputs = model(**inputs)
# Assuming the embedding is the last hidden state of the [CLS] token or averaged
# You might need to adjust this based on how Qwen3-Embedding-0.6B produces embeddings
# For many embedding models, it's typically a pooling operation
# Example: Mean pooling of last hidden states
embeddings = outputs.last_hidden_state.mean(dim=1).squeeze().cpu().numpy()
return embeddings
# Test
text_example = "This is a sample sentence for embedding."
embedding = get_embedding(text_example)
print(embedding.shape)
## Citation
If you use this fine-tuned model in your research or application, please consider citing the original **Qwen/Qwen3-Embedding-0.6B** paper (if available) and acknowledge this fine-tuned version.
```bibtex
@article{Qwen3Embedding,
title={Qwen-Embedding: A Family of Embedding Models},
author={[Authors of Qwen3-Embedding-0.6B]},
journal={arXiv preprint arXiv:XXXX.XXXXX}, % Replace with actual arXiv ID if available
year={202X} % Replace with actual year
}
% And if applicable, for your fine-tuning:
@misc{your_finetuned_model,
title={Qwen3-Embedding-0.6B Fine-tuned with LoRA for [Your Application]},
author={[Your Name/Organization]},
year={2025},
note={Available at [Link to your model if uploaded]}
}