Instructions to use skt/A.X-4.0-VL-Light with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use skt/A.X-4.0-VL-Light with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="skt/A.X-4.0-VL-Light", trust_remote_code=True) 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)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("skt/A.X-4.0-VL-Light", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use skt/A.X-4.0-VL-Light with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "skt/A.X-4.0-VL-Light" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "skt/A.X-4.0-VL-Light", "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/skt/A.X-4.0-VL-Light
- SGLang
How to use skt/A.X-4.0-VL-Light 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 "skt/A.X-4.0-VL-Light" \ --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": "skt/A.X-4.0-VL-Light", "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 "skt/A.X-4.0-VL-Light" \ --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": "skt/A.X-4.0-VL-Light", "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 skt/A.X-4.0-VL-Light with Docker Model Runner:
docker model run hf.co/skt/A.X-4.0-VL-Light
라이브러리 질문
안녕하세요. 모델을 만들어주셔서 감사합니다.
안녕녕하세요. 모델을 만들어주셔서 감사합니다.
아래와 같은 질문이 있는데 도움을 주실수 있을까요?
두가지 질문이 있습니다.
- transformers 버전을 몇을 사용하셨나요 ?
- 4.5x 버전을 사용하면 아래와 같이 transformers 내부 함수 호출시 에러가 나옵니다.
[ERROR]
skt/A.X-4.0-VL-Light: cannot import name '_validate_images_text_input_order' from 'transformers.processing_utils' (/usr/local/lib/python3.10/dist-packages/transformers/processing_utils.py)
--> 그래서 4.4x대로 다운그레이드 했습니다. 그랬더니 2번 질문 관련 문제가 생겼습니다.
2./.cache/huggingface/modules/transformers_modules/skt/*
- window는 A_dot_X_hyphen_4_dot_0_hyphen_VL_hyphen_Light이란 폴더가 생기고
- linux는 A.X-4.0-VL-Light 라는 폴더가 생기는데
-> 리눅스에서 _dot_을 . 으로 인식해서 발생하는것 같은데 해결책이 있을까요 ?
-> rename 후 진행해도 새로 A.X-4.0-VL-Light 생겨서 2가지가 공존해버리네여
[Error]
Traceback (most recent call last):
File "/mnt/ai-nas/workspace/vlm/main.py", line 313, in test_model
self.load_model(MODEL)
File "/mnt/ai-nas/workspace/vlm/main.py", line 283, in load_model
self.processors[model_name] = loader.load_processor(model_name)
File "/mnt/ai-nas/workspace/vlm/main.py", line 87, in load_processor
return AutoProcessor.from_pretrained(model_name, trust_remote_code=True) #trust_remote_code 코드 활성화 필수!
File "/usr/local/lib/python3.10/dist-packages/transformers/models/auto/processing_auto.py", line 318, in from_pretrained
processor_class = get_class_from_dynamic_module(
File "/usr/local/lib/python3.10/dist-packages/transformers/dynamic_module_utils.py", line 553, in get_class_from_dynamic_module
return get_class_in_module(class_name, final_module, force_reload=force_download)
File "/usr/local/lib/python3.10/dist-packages/transformers/dynamic_module_utils.py", line 250, in get_class_in_module
module_spec.loader.exec_module(module)
File "", line 883, in exec_module
File "", line 241, in _call_with_frames_removed
File "/root/.cache/huggingface/modules/transformers_modules/skt/A.X-4.0-VL-Light/51c82ddd89f1ecf4e5e574bc73b38f64a8f5725b/processing_ax4vl.py", line 2, in
from .configuration_ax4vl import AX4VLConfig
ModuleNotFoundError: No module named 'transformers_modules.skt.A'