X-LLaVA: Optimizing Bilingual Large Vision-Language Alignment
Paper β’ 2403.11399 β’ Published β’ 6
How to use Bllossom/llama-3.2-Korean-Bllossom-3B-gguf-Q4_K_M with Transformers:
# Load model directly
from transformers import AutoModel
model = AutoModel.from_pretrained("Bllossom/llama-3.2-Korean-Bllossom-3B-gguf-Q4_K_M", device_map="auto")How to use Bllossom/llama-3.2-Korean-Bllossom-3B-gguf-Q4_K_M with llama.cpp:
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf Bllossom/llama-3.2-Korean-Bllossom-3B-gguf-Q4_K_M:Q4_K_M # Run inference directly in the terminal: llama cli -hf Bllossom/llama-3.2-Korean-Bllossom-3B-gguf-Q4_K_M:Q4_K_M
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Bllossom/llama-3.2-Korean-Bllossom-3B-gguf-Q4_K_M:Q4_K_M # Run inference directly in the terminal: llama cli -hf Bllossom/llama-3.2-Korean-Bllossom-3B-gguf-Q4_K_M:Q4_K_M
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf Bllossom/llama-3.2-Korean-Bllossom-3B-gguf-Q4_K_M:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf Bllossom/llama-3.2-Korean-Bllossom-3B-gguf-Q4_K_M:Q4_K_M
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf Bllossom/llama-3.2-Korean-Bllossom-3B-gguf-Q4_K_M:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf Bllossom/llama-3.2-Korean-Bllossom-3B-gguf-Q4_K_M:Q4_K_M
docker model run hf.co/Bllossom/llama-3.2-Korean-Bllossom-3B-gguf-Q4_K_M:Q4_K_M
How to use Bllossom/llama-3.2-Korean-Bllossom-3B-gguf-Q4_K_M with Ollama:
ollama run hf.co/Bllossom/llama-3.2-Korean-Bllossom-3B-gguf-Q4_K_M:Q4_K_M
How to use Bllossom/llama-3.2-Korean-Bllossom-3B-gguf-Q4_K_M with Unsloth Studio:
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Bllossom/llama-3.2-Korean-Bllossom-3B-gguf-Q4_K_M to start chatting
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for Bllossom/llama-3.2-Korean-Bllossom-3B-gguf-Q4_K_M to start chatting
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Bllossom/llama-3.2-Korean-Bllossom-3B-gguf-Q4_K_M to start chatting
How to use Bllossom/llama-3.2-Korean-Bllossom-3B-gguf-Q4_K_M with Pi:
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Bllossom/llama-3.2-Korean-Bllossom-3B-gguf-Q4_K_M:Q4_K_M
# Install Pi:
npm install -g @mariozechner/pi-coding-agent
# Add to ~/.pi/agent/models.json:
{
"providers": {
"llama-cpp": {
"baseUrl": "http://localhost:8080/v1",
"api": "openai-completions",
"apiKey": "none",
"models": [
{
"id": "Bllossom/llama-3.2-Korean-Bllossom-3B-gguf-Q4_K_M:Q4_K_M"
}
]
}
}
}# Start Pi in your project directory: pi
How to use Bllossom/llama-3.2-Korean-Bllossom-3B-gguf-Q4_K_M with OpenClaw:
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Bllossom/llama-3.2-Korean-Bllossom-3B-gguf-Q4_K_M:Q4_K_M
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:8080/v1 \ --custom-model-id "Bllossom/llama-3.2-Korean-Bllossom-3B-gguf-Q4_K_M:Q4_K_M" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
openclaw agent --local --agent main --message "Hello from Hugging Face"
How to use Bllossom/llama-3.2-Korean-Bllossom-3B-gguf-Q4_K_M with Docker Model Runner:
docker model run hf.co/Bllossom/llama-3.2-Korean-Bllossom-3B-gguf-Q4_K_M:Q4_K_M
How to use Bllossom/llama-3.2-Korean-Bllossom-3B-gguf-Q4_K_M with Lemonade:
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Bllossom/llama-3.2-Korean-Bllossom-3B-gguf-Q4_K_M:Q4_K_M
lemonade run user.llama-3.2-Korean-Bllossom-3B-gguf-Q4_K_M-Q4_K_M
lemonade list
How to use Bllossom/llama-3.2-Korean-Bllossom-3B-gguf-Q4_K_M with Hermes Agent:
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Bllossom/llama-3.2-Korean-Bllossom-3B-gguf-Q4_K_M:Q4_K_M
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:8080/v1 hermes config set model.default Bllossom/llama-3.2-Korean-Bllossom-3B-gguf-Q4_K_M:Q4_K_M
hermes
μ ν¬ Bllossom νμμ Bllossom-3B λͺ¨λΈμ 곡κ°ν©λλ€.
llama3.2-3Bκ° λμλλ° νκ΅μ΄κ° ν¬ν¨ μλμλ€κ΅¬?? μ΄λ² Bllossom-3Bλ νκ΅μ΄κ° μ§μλμ§ μλ κΈ°λ³Έ λͺ¨λΈμ νκ΅μ΄-μμ΄λ‘ κ°νλͺ¨λΈμ
λλ€.
- 100% full-tuningμΌλ‘ 150GBμ μ μ λ νκ΅μ΄λ‘ μΆκ° μ¬μ νμ΅ λμμ΅λλ€. (GPUλ§μ΄ νμ μ΅λλ€)
- κ΅μ₯ν μ μ λ Instruction Tuningμ μ§ννμ΅λλ€.
- μμ΄ μ±λ₯μ μ ν μμμν€μ§ μμ μμ ν Bilingual λͺ¨λΈμ
λλ€.
- LogicKor κΈ°μ€ 5Bμ΄ν μ΅κ³ μ μλ₯Ό κΈ°λ‘νκ³ 6μ μ΄λ°λ μ μλ₯Ό 보μ
λλ€.
- Instruction tuningλ§ μ§ννμ΅λλ€. DPO λ± μ±λ₯ μ¬λ¦΄ λ°©λ²μΌλ‘ νλν΄λ³΄μΈμ.
- MT-Bench, LogicKor λ± λ²€μΉλ§ν¬ μ μλ₯Ό μλ°κΈ° μν΄ μ λ΅λ°μ΄ν°λ₯Ό νμ©νκ±°λ νΉμ λ²€μΉλ§ν¬λ₯Ό νκ²ν
ν΄μ νμ΅νμ§ μμμ΅λλ€. (ν΄λΉ λ²€μΉλ§ν¬ νκ²ν
ν΄μ νμ΅νλ©΄ 8μ λ λμ΅λλ€...)
μΈμ λ κ·Έλ¬λ― ν΄λΉ λͺ¨λΈμ μμ
μ μ΄μ©μ΄ κ°λ₯ν©λλ€.
1. Bllossomμ AAAI2024, NAACL2024, LREC-COLING2024 (ꡬλ) λ°νλμμ΅λλ€.
2. μ’μ μΈμ΄λͺ¨λΈ κ³μ μ
λ°μ΄νΈ νκ² μ΅λλ€!! νκ΅μ΄ κ°νλ₯Όμν΄ κ³΅λ μ°κ΅¬νμ€λΆ(νΉνλ
Όλ¬Έ) μΈμ λ νμν©λλ€!!
from llama_cpp import Llama
from transformers import AutoTokenizer
model_id = 'Bllossom/llama-3.2-Korean-Bllossom-3B'
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = Llama(
model_path='llama-3.2-Korean-Bllossom-3B-gguf-Q4_K_M.gguf'
)
instruction = "μ² μκ° 20κ°μ μ°νμ κ°μ§κ³ μμλλ° μν¬κ° μ λ°μ κ°μ Έκ°κ³ λ―Όμκ° λ¨μ 5κ°λ₯Ό κ°μ Έκ°μΌλ©΄ μ² μμκ² λ¨μ μ°νμ κ°―μλ λͺκ°μΈκ°μ?"
messages = [
{"role": "user", "content": f"{instruction}"}
]
prompt = tokenizer.apply_chat_template(
messages,
tokenize = False,
add_generation_prompt=True
)
generation_kwargs = {
"max_tokens":512,
"stop":["<|eot_id|>"],
"echo":True,
"top_p":0.9,
"temperature":0.6,
}
resonse_msg = model(prompt, **generation_kwargs)
print(resonse_msg['choices'][0]['text'][len(prompt):])
μ² μκ° 20κ°μ μ°νμ κ°μ§κ³ μμκ³ μν¬κ° μ λ°μ κ°μ Έκ°λ©΄, μν¬κ° κ°μ Έκ° μ°νμ κ°―μλ 20 / 2 = 10κ°μ
λλ€.
μ΄μ μ² μκ° λ¨μ μ°νμ κ°―μλ₯Ό κ³μ°ν΄λ³΄κ² μ΅λλ€. μν¬κ° 10κ°λ₯Ό κ°μ Έκ° ν μ² μκ° λ¨μ μ°νμ κ°―μλ 20 - 10 = 10κ°μ
λλ€.
λ―Όμκ° λ¨μ 5κ°λ₯Ό κ°μ Έκ°μΌλ―λ‘, μ² μκ° λ¨μ μ°νμ κ°―μλ 10 - 5 = 5κ°μ
λλ€.
λ°λΌμ μ² μκ° λ¨μ μ°νμ κ°―μλ 5κ°μ
λλ€.

Language Model
@misc{bllossom,
author = {ChangSu Choi, Yongbin Jeong, Seoyoon Park, InHo Won, HyeonSeok Lim, SangMin Kim, Yejee Kang, Chanhyuk Yoon, Jaewan Park, Yiseul Lee, HyeJin Lee, Younggyun Hahm, Hansaem Kim, KyungTae Lim},
title = {Optimizing Language Augmentation for Multilingual Large Language Models: A Case Study on Korean},
year = {2024},
journal = {LREC-COLING 2024},
paperLink = {\url{https://arxiv.org/pdf/2403.10882}},
},
}
Vision-Language Model
@misc{bllossom-V,
author = {Dongjae Shin, Hyunseok Lim, Inho Won, Changsu Choi, Minjun Kim, Seungwoo Song, Hangyeol Yoo, Sangmin Kim, Kyungtae Lim},
title = {X-LLaVA: Optimizing Bilingual Large Vision-Language Alignment},
year = {2024},
publisher = {GitHub},
journal = {NAACL 2024 findings},
paperLink = {\url{https://arxiv.org/pdf/2403.11399}},
},
}
ktlim@seoultech.ac.krhahmyg@teddysum.aikhss@yonsei.ac.kr4-bit