Instructions to use Bllossom/llama-3.2-Korean-Bllossom-AICA-5B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Bllossom/llama-3.2-Korean-Bllossom-AICA-5B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Bllossom/llama-3.2-Korean-Bllossom-AICA-5B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Bllossom/llama-3.2-Korean-Bllossom-AICA-5B") model = AutoModelForMultimodalLM.from_pretrained("Bllossom/llama-3.2-Korean-Bllossom-AICA-5B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Bllossom/llama-3.2-Korean-Bllossom-AICA-5B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Bllossom/llama-3.2-Korean-Bllossom-AICA-5B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Bllossom/llama-3.2-Korean-Bllossom-AICA-5B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/Bllossom/llama-3.2-Korean-Bllossom-AICA-5B
- SGLang
How to use Bllossom/llama-3.2-Korean-Bllossom-AICA-5B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Bllossom/llama-3.2-Korean-Bllossom-AICA-5B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Bllossom/llama-3.2-Korean-Bllossom-AICA-5B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Bllossom/llama-3.2-Korean-Bllossom-AICA-5B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Bllossom/llama-3.2-Korean-Bllossom-AICA-5B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use Bllossom/llama-3.2-Korean-Bllossom-AICA-5B with Docker Model Runner:
docker model run hf.co/Bllossom/llama-3.2-Korean-Bllossom-AICA-5B
VLM 모델 관련 문의
#7
by KHSeo - opened
안녕하세요. 한국어 LLM 모델을 개발해주셔서 감사합니다.
혹시 VLM관련 Training 코드가 공개가 되었나요? 설명란에는 보이지 않아 있으신지 해서 문의드립니다.
Bllossom VLM은 LLama 3.2 11B-Instruct의 포맷을 따라 사용하셨나요?
안녕하세요 MLP Lab 신동재 연구원입니다
말씀주신 내용에 대한 답변은 아래와 같습니다.
- VLM 학습코드는 공개되어있지 않습니다.
- Llama-3.2.11B-Insturct의 포맷과 동일합니다.
감사합니다.
현재 내부 학습코드는 공개계획이 없습니다.
간단한 튜토리얼의 경우는 trl의 예제코드를 참조해보시는것도 좋을것 같습니다.
https://github.com/huggingface/trl/tree/main
ShinDJ changed discussion status to closed