tsuname_llm_embed / README.md
Kanompung's picture
Update README.md
2a38b1f verified
metadata
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 and Huggingface's TRL library.

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)