Instructions to use Spinai/AISVI_S4.1.0_SPINAI with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Spinai/AISVI_S4.1.0_SPINAI with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Spinai/AISVI_S4.1.0_SPINAI") 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 AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Spinai/AISVI_S4.1.0_SPINAI") model = AutoModelForMultimodalLM.from_pretrained("Spinai/AISVI_S4.1.0_SPINAI", device_map="auto") 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=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Spinai/AISVI_S4.1.0_SPINAI with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Spinai/AISVI_S4.1.0_SPINAI" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Spinai/AISVI_S4.1.0_SPINAI", "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/Spinai/AISVI_S4.1.0_SPINAI
- SGLang
How to use Spinai/AISVI_S4.1.0_SPINAI 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 "Spinai/AISVI_S4.1.0_SPINAI" \ --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": "Spinai/AISVI_S4.1.0_SPINAI", "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 "Spinai/AISVI_S4.1.0_SPINAI" \ --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": "Spinai/AISVI_S4.1.0_SPINAI", "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 Spinai/AISVI_S4.1.0_SPINAI with Docker Model Runner:
docker model run hf.co/Spinai/AISVI_S4.1.0_SPINAI
You need to agree to share your Hugging Face information to access this model
This repository is publicly accessible, but you have to accept the conditions to access its files and content.
Free for individuals for personal, non-commercial use. Any use by a business (companies, sole proprietors, hospitals, clinics, pharmacies and their staff) requires a prior written agreement with SPINAI Co., Ltd. (info@spinai.net) before any use, including internal testing or evaluation. By requesting access you agree to the terms in LICENSE. 개인의 비상업적 사용은 무료입니다. 사업자(법인·개인사업자·병원·의원·약국 및 그 임직원)의 모든 사용은 주식회사 스피나이와 사전 협의·서면 계약이 필요합니다(내부 시험·평가 포함, 예외 없음). 신청하시면 LICENSE 의 조건에 동의하는 것으로 봅니다.
Log in or Sign Up to review the conditions and access this model content.