Instructions to use percepta-ai/spotlight-vm with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use percepta-ai/spotlight-vm with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="percepta-ai/spotlight-vm", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("percepta-ai/spotlight-vm", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use percepta-ai/spotlight-vm with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "percepta-ai/spotlight-vm" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "percepta-ai/spotlight-vm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/percepta-ai/spotlight-vm
- SGLang
How to use percepta-ai/spotlight-vm 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 "percepta-ai/spotlight-vm" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "percepta-ai/spotlight-vm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'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 "percepta-ai/spotlight-vm" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "percepta-ai/spotlight-vm", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use percepta-ai/spotlight-vm with Docker Model Runner:
docker model run hf.co/percepta-ai/spotlight-vm
Download examples/euler2.py from percepta-ai/spotlight-vm: direct link, hf CLI and curl.
- Browser
- Download file 494 Bytes
-
https://huggingface.co/percepta-ai/spotlight-vm/resolve/main/examples/euler2.py
- Command line
-
hf download hf://percepta-ai/spotlight-vm/examples/euler2.py
-
curl -L -o euler2.py https://huggingface.co/percepta-ai/spotlight-vm/resolve/main/examples/euler2.py
494 Bytes
| # https://projecteuler.net/problem=2 | |
| # Sum the even Fibonacci terms not exceeding 4,000,000. | |
| # Recursive function calling, generators and Python idioms | |
| def fib(): | |
| a, b = 1, 2 | |
| while True: | |
| yield a | |
| a, b = b, a + b | |
| def evens(it): | |
| for x in it: | |
| if x % 2 == 0: | |
| yield x | |
| def upto(limit, it): | |
| for x in it: | |
| if x > limit: | |
| return | |
| yield x | |
| def euler2(limit=4000000): | |
| return sum(evens(upto(limit, fib()))) | |
| print(euler2()) | |