Instructions to use Bllossom/llama-3.1-Korean-Bllossom-Vision-8B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Bllossom/llama-3.1-Korean-Bllossom-Vision-8B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Bllossom/llama-3.1-Korean-Bllossom-Vision-8B") 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.1-Korean-Bllossom-Vision-8B") model = AutoModelForMultimodalLM.from_pretrained("Bllossom/llama-3.1-Korean-Bllossom-Vision-8B") 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.1-Korean-Bllossom-Vision-8B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Bllossom/llama-3.1-Korean-Bllossom-Vision-8B" # 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.1-Korean-Bllossom-Vision-8B", "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.1-Korean-Bllossom-Vision-8B
- SGLang
How to use Bllossom/llama-3.1-Korean-Bllossom-Vision-8B 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.1-Korean-Bllossom-Vision-8B" \ --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.1-Korean-Bllossom-Vision-8B", "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.1-Korean-Bllossom-Vision-8B" \ --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.1-Korean-Bllossom-Vision-8B", "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.1-Korean-Bllossom-Vision-8B with Docker Model Runner:
docker model run hf.co/Bllossom/llama-3.1-Korean-Bllossom-Vision-8B
이전 파인튜닝 관련 질문
안녕하세요 답변이 늦어 죄송합니다.
먼저 예시를 들자면 일자별 주식 차트 수치 변화에 따른 데이터를 기재한 데이터셋을 파인튜닝 하였을 때
"2024년 5월달 가장 차트(수치) 변화가 심했던 상품들에 대해 알려줘" 리는 질문을 올바르게 수행하는데 괜찮을까요?
제가 아직 파인튜닝 관련하여 독학으로 시작한지 얼마 안되어서 질문에 부족한 부분이 있을 수 있습니다.
좋은글 올려주셔서 감사합니다 :)
안녕하세요 서울과학기술대학교 MLP Lab
신동재 연구원입니다.
일자별 주식 차트 수치 변화에 따른 데이터셋의 품질과 볼륨이 어느정도이냐에 따라 성능편차가 클것으로 예상됩니다.
본 모델은 LLaVA-Next 기반으로 이루어져 있는데 이미지 크기에 따라 특정 image_grid_pinpoints로 이미지의 사이즈가 조정되어
각 pinpoint 별로 다른 패치갯수를 가지게 됩니다. 이는 해당 패치들을 flatten해서 나열하여 언어 모델에 입력되었을 때 해석 순서의 변화가 발생할 수 있기 때문에 만약 General한 성능을 원하신다면 가지고 계신 데이터의 이미지 해상도 별로 pinpoints가 어떻게 나오는지 분포를 먼저 확인하시는게 좋을것 같습니다.