hateslopacademy commited on
Commit
3513a99
·
verified ·
1 Parent(s): 2d2492e

Unsloth Model Card

Browse files
Files changed (1) hide show
  1. README.md +13 -130
README.md CHANGED
@@ -1,138 +1,21 @@
1
  ---
 
 
 
 
 
 
 
2
  language:
3
- - ko
4
  - en
5
- library_name: transformers
6
- tags:
7
- - vision-language
8
- - korean
9
- - image-to-text
10
- - multilingual
11
- - fashion
12
- - e-commerce
13
- - text-classification
14
- - text-generation
15
- datasets:
16
- - hateslopacademy/otpensource_dataset
17
- base_model:
18
- - Bllossom/llama-3.2-Korean-Bllossom-AICA-5B
19
- inference: true
20
- license: llama3.2
21
- model_name: otpensource-vision
22
- size_categories: 1K<n<10K
23
- task_categories:
24
- - image-to-text
25
- - text-classification
26
- task_ids:
27
- - image-captioning
28
- - sentiment-analysis
29
- ---
30
-
31
- # otpensource-vision
32
-
33
- ## 모델 설명
34
-
35
- **otpensource-vision**은 **Bllossom/llama-3.2-Korean-Bllossom-AICA-5B**를 기반으로 학습된 Vision-Language 모델입니다. 해당 모델은 한국어와 영어로 작성된 텍스트와 이미지를 결합하여 다양한 태스크를 수행할 수 있도록 설계되었습니다.
36
-
37
- ### 주요 특징
38
- - **Bllossom 기반 학습**: llama-3.2-Korean-Bllossom-AICA-5B를 기반으로 학습된 모델로, 언어 모델과 시각-언어 모델의 장점을 모두 제공합니다.
39
- - **Vision-Language 태스크 지원**: 이미지를 입력받아 텍스트 정보를 생성하거나, 텍스트 입력만으로 자연어 처리 태스크를 수행할 수 있습니다.
40
- - **패션 데이터를 활용한 학습**: 한국어 패션 데이터셋(otpensource_data)을 활용하여 옷의 카테고리, 색상, 계절, 특징 등 관련 정보를 추출하도록 학습되었습니다.
41
- - **상업적 활용 가능**: 라이선스는 CC-BY-4.0으로 상업적 이용이 가능합니다.
42
-
43
- ---
44
-
45
- ## 모델 세부사항
46
-
47
- ### 학습 데이터
48
- 모델 학습에 사용된 데이터셋:
49
- - **[otpensource_data](https://huggingface.co/datasets/hateslopacademy/otpensource_dataset)**:
50
- - 약 9000개의 패션 데이터로 구성
51
- - 옷의 카테고리, 색상, 계절, 특징, 이미지 URL 등을 포함하며, Vision-Language 학습에 최적화
52
-
53
- ### 학습 방식
54
- - **기반 모델**: Bllossom/llama-3.2-Korean-Bllossom-AICA-5B
55
- - **GPU 요구사항**: A100 40GB 이상 권장
56
- - **최적화**: Vision-Language 태스크와 한국어 텍스트 태스크를 통합적으로 학습
57
-
58
- ---
59
-
60
- ## 주요 사용 사례
61
-
62
- ### Vision-Language 태스크
63
- 1. **이미지 분석**
64
- - 입력된 이미지에서 옷의 카테고리, 색상, 계절, 특징을 추출하여 JSON 형식으로 반환.
65
- - 예시:
66
- ```json
67
- {
68
- "category": "트렌치코트",
69
- "gender": "여",
70
- "season": "SS",
71
- "color": "네이비",
72
- "material": "면",
73
- "feature": "트렌치코트"
74
- }
75
- ```
76
-
77
- 2. **언어모델 태스크**
78
- - 텍스트만 입력했을 때 자연어 처리를 수행하며, 질문 응답, 텍스트 요약, 감정 분석 등 다양한 태스크 수행 가능.
79
-
80
- ---
81
-
82
- ## 학습 및 성능
83
-
84
- ### LogicKor 벤치마크 성능 (Bllossom 기반 모델 성능)
85
- | Category | Single Turn | Multi Turn |
86
- |----------------|-------------|------------|
87
- | Reasoning | 6.57 | 5.29 |
88
- | Math | 6.43 | 6.29 |
89
- | Writing | 9.14 | 8.71 |
90
- | Coding | 8.00 | 9.14 |
91
- | Understanding | 8.14 | 9.29 |
92
- | Grammar | 6.71 | 4.86 |
93
-
94
- ### 학습 구성
95
- - **모델 크기**: 5B 파라미터
96
- - **학습 데이터 크기**: 약 9000개의 시각-언어 데이터
97
- - **평가 결과**: 패션 관련 태스크에서 높은 정확도와 효율성 제공
98
-
99
  ---
100
 
101
- ## 코드 예시
102
-
103
- ### Vision-Language 태스크
104
-
105
- ```python
106
- from transformers import MllamaForConditionalGeneration, MllamaProcessor
107
- import torch
108
- from PIL import Image
109
- import requests
110
-
111
- model = MllamaForConditionalGeneration.from_pretrained(
112
- 'otpensource-vision',
113
- torch_dtype=torch.bfloat16,
114
- device_map='auto'
115
- )
116
- processor = MllamaProcessor.from_pretrained('otpensource-vision')
117
-
118
- url = "https://image.msscdn.net/thumbnails/images/prd_img/20240710/4242307/detail_4242307_17205916382801_big.jpg?w=1200"
119
- image = Image.open(requests.get(url, stream=True).raw)
120
-
121
- messages = [
122
- {'role': 'user', 'content': [
123
- {'type': 'image', 'image': image},
124
- {'type': 'text', 'text': '이 옷의 정보를 JSON으로 알려줘.'}
125
- ]}
126
- ]
127
 
128
- input_text = processor.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
 
 
129
 
130
- inputs = processor(
131
- image=image,
132
- text=input_text,
133
- add_special_tokens=False,
134
- return_tensors="pt",
135
- ).to(model.device)
136
 
137
- output = model.generate(**inputs, max_new_tokens=256, temperature=0.1)
138
- print(processor.decode(output[0]))
 
1
  ---
2
+ base_model: Bllossom/llama-3.2-Korean-Bllossom-AICA-5B
3
+ tags:
4
+ - text-generation-inference
5
+ - transformers
6
+ - unsloth
7
+ - mllama
8
+ license: apache-2.0
9
  language:
 
10
  - en
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  ---
12
 
13
+ # Uploaded finetuned model
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
14
 
15
+ - **Developed by:** hateslopacademy
16
+ - **License:** apache-2.0
17
+ - **Finetuned from model :** Bllossom/llama-3.2-Korean-Bllossom-AICA-5B
18
 
19
+ This mllama model was trained 2x faster with [Unsloth](https://github.com/unslothai/unsloth) and Huggingface's TRL library.
 
 
 
 
 
20
 
21
+ [<img src="https://raw.githubusercontent.com/unslothai/unsloth/main/images/unsloth%20made%20with%20love.png" width="200"/>](https://github.com/unslothai/unsloth)