Views
No views yet
1{
2 "category": "트렌치코트",
3 "gender": "여",
4 "season": "SS",
5 "color": "네이비",
6 "material": "",
7 "feature": "트렌치코트"
8}| Category | Single Turn | Multi Turn |
|---|---|---|
| Reasoning | 6.57 | 5.29 |
| Math | 6.43 | 6.29 |
| Writing | 9.14 | 8.71 |
| Coding | 8.00 | 9.14 |
| Understanding | 8.14 | 9.29 |
| Grammar | 6.71 | 4.86 |
1from transformers import MllamaForConditionalGeneration, MllamaProcessor
2import torch
3from PIL import Image
4import requests
5
6model = MllamaForConditionalGeneration.from_pretrained(
7 'otpensource-vision',
8 torch_dtype=torch.bfloat16,
9 device_map='auto'
10)
11processor = MllamaProcessor.from_pretrained('otpensource-vision')
12
13url = "https://image.msscdn.net/thumbnails/images/prd_img/20240710/4242307/detail_4242307_17205916382801_big.jpg?w=1200"
14image = Image.open(requests.get(url, stream=True).raw)
15
16messages = [
17 {'role': 'user', 'content': [
18 {'type': 'image', 'image': image},
19 {'type': 'text', 'text': '이 옷의 정보를 JSON으로 알려줘.'}
20 ]}
21]
22
23input_text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
24
25inputs = processor(
26 image=image,
27 text=input_text,
28 add_special_tokens=False,
29 return_tensors="pt",
30).to(model.device)
31
32output = model.generate(**inputs, max_new_tokens=256, temperature=0.1)
33print(processor.decode(output[0]))