Downloads · 30 days
6
2% of all-time downloads
kesimeg/lora-turkish-clip
lora-turkish-clip is a machine learning model from kesimeg. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft.
This is a LoRA adapter OpenAI CLIP. The LoRA model is trained on Turkish language. You can get more information (and code 🎉) on how to train or use the model on my [github].
Downloads · 30 days
6
2% of all-time downloads
All-time downloads
292
Public
Repo size
3.9 MB
Likes
2
Public
Click a slice to open those files.
.safetensors3.9 MB · 100%
From the Hugging Face model README
This is a LoRA adapter OpenAI CLIP. The LoRA model is trained on Turkish language. You can get more information (and code 🎉) on how to train or use the model on my github.
You can use the model like shown in below:
from PIL import Image
from transformers import CLIPProcessor, CLIPModel
model = CLIPModel.from_pretrained("openai/clip-vit-base-patch32")
model.load_adapter("kesimeg/lora-turkish-clip")
model.eval()
processor = CLIPProcessor.from_pretrained("openai/clip-vit-base-patch32")
img = Image.open("dog.png") # A dog image
inputs = processor(text=["Çimenler içinde bir köpek.","Bir köpek.","Çimenler içinde bir kuş."], images=img, return_tensors="pt", padding=True)
outputs = model(**inputs)
logits_per_image = outputs.logits_per_image
probs = logits_per_image.softmax(dim=1)
print(probs)