Downloads · 30 days
0
hateslopacademy/otpensource-vision-lora
otpensource-vision-lora is a text classification model from hateslopacademy. Use it when you need a label for a piece of text. It is set up for transformers. The card lists the license as cc-by-4.0.
otpensource-vision LoRA는 otpensource-vision 모델을 기반으로 LoRA (Low-Rank Adaptation) 기법을 활용하여 학습된 경량 Vision-Language 모델입니다. 기존 모델 대비 적은 연산량으로 특정 도메인에 최적화된 결과를 제공하며, 한국어와 영어를 지원합니다.
Downloads · 30 days
0
Access
Public
Updated Feb 3, 2025
Repo size
181 MB
Likes
0
Public
Click a slice to open those files.
.safetensors181 MB · 100%
From the Hugging Face model README
otpensource-vision LoRA는 otpensource-vision 모델을 기반으로 LoRA (Low-Rank Adaptation) 기법을 활용하여 학습된 경량 Vision-Language 모델입니다. 기존 모델 대비 적은 연산량으로 특정 도메인에 최적화된 결과를 제공하며, 한국어와 영어를 지원합니다.
모델 학습에 사용된 데이터셋:
이미지 분석 및 설명
{
"category": "트렌치코트",
"gender": "여",
"season": "SS",
"color": "네이비",
"material": "",
"feature": "트렌치코트"
}
텍스트 분석 및 분류
from transformers import MllamaForConditionalGeneration, MllamaProcessor
import torch
from PIL import Image
import requests
model = MllamaForConditionalGeneration.from_pretrained(
'otpensource-vision-lora',
torch_dtype=torch.bfloat16,
device_map='auto'
)
processor = MllamaProcessor.from_pretrained('otpensource-vision-lora')
url = "https://image.msscdn.net/thumbnails/images/prd_img/20240710/4242307/detail_4242307_17205916382801_big.jpg?w=1200"
image = Image.open(requests.get(url, stream=True).raw)
messages = [
{'role': 'user', 'content': [
{'type': 'image', 'image': image},
{'type': 'text', 'text': '이 옷의 정보를 JSON으로 알려줘.'}
]}
]
input_text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = processor(
image=image,
text=input_text,
add_special_tokens=False,
return_tensors="pt",
).to(model.device)
output = model.generate(**inputs, max_new_tokens=256, temperature=0.1)
print(processor.decode(output[0]))
이 모델은 Unsloth 및 Hugging Face TRL 라이브러리를 활용해 기존 모델 대비 2배 빠르게 학습되었습니다.