tsuname_llm_embed / README.md
Kanompung's picture
Update README.md
2a38b1f verified
---
base_model: Tsunami-th/Tsunami-1.0-14B-Instruct
tags:
- text-generation-inference
- transformers
- unsloth
- qwen2
- trl
license: apache-2.0
language:
- en
---
# Uploaded model
- **Developed by:** Kanompung
- **License:** apache-2.0
- **Finetuned from model :** Tsunami-th/Tsunami-1.0-14B-Instruct
This qwen2 model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
[<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)
```python
from transformers import AutoTokenizer, AutoModel
import torch
tokenizer = AutoTokenizer.from_pretrained("Kanompung/Tsunami_llm_embed")
model = AutoModel.from_pretrained("Kanompung/Tsunami_llm_embed")
texts = ["สวัสดีครับ", "วันนี้อากาศดี"]
enc = tokenizer(texts, padding=True, truncation=True, return_tensors="pt")
with torch.no_grad():
out = model(**enc)
embeds = out.last_hidden_state.mean(dim=1)
print(embeds.shape)