Text Generation
Transformers
Diffusers
Safetensors
English
gpt_oss
phillnet-2
gpt-oss
multimodal
image-generation
video-generation
speech
audio
custom-code
conversational
custom_code
Instructions to use ayjays132/Phillnet-2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ayjays132/Phillnet-2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ayjays132/Phillnet-2", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ayjays132/Phillnet-2", trust_remote_code=True) model = AutoModelForCausalLM.from_pretrained("ayjays132/Phillnet-2", trust_remote_code=True) messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ayjays132/Phillnet-2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ayjays132/Phillnet-2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ayjays132/Phillnet-2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/ayjays132/Phillnet-2
- SGLang
How to use ayjays132/Phillnet-2 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 "ayjays132/Phillnet-2" \ --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": "ayjays132/Phillnet-2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "ayjays132/Phillnet-2" \ --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": "ayjays132/Phillnet-2", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use ayjays132/Phillnet-2 with Docker Model Runner:
docker model run hf.co/ayjays132/Phillnet-2
| from __future__ import annotations | |
| from PIL import Image | |
| from .config import MotionPreset | |
| def apply_camera_motion(frame: Image.Image, *, t: float, motion: MotionPreset) -> Image.Image: | |
| img = frame.convert("RGB") | |
| w, h = img.size | |
| t = max(0.0, min(1.0, float(t))) | |
| if motion in {"push_in", "zoom"}: | |
| scale = 1.0 + 0.055 * t | |
| return _center_crop_zoom(img, scale) | |
| if motion == "pull_out": | |
| scale = 1.055 - 0.055 * t | |
| return _center_crop_zoom(img, scale) | |
| if motion == "pan_left": | |
| return _translate(img, dx=int((t - 0.5) * w * 0.06), dy=0) | |
| if motion == "pan_right": | |
| return _translate(img, dx=int((0.5 - t) * w * 0.06), dy=0) | |
| if motion == "slow_orbit": | |
| return _center_crop_zoom(img.rotate((t - 0.5) * 2.5, resample=Image.Resampling.BICUBIC), 1.02) | |
| if motion == "ken_burns": | |
| moved = _translate(img, dx=int((0.5 - t) * w * 0.035), dy=int((t - 0.5) * h * 0.025)) | |
| return _center_crop_zoom(moved, 1.015 + 0.04 * t) | |
| if motion == "product_turntable_fake": | |
| moved = _translate(img, dx=int((0.5 - t) * w * 0.025), dy=0) | |
| return _center_crop_zoom(moved, 1.015 + 0.015 * (1.0 - abs(0.5 - t) * 2.0)) | |
| if motion == "handheld_subtle": | |
| dx = int(w * 0.008 * _wave(t, 1.0)) | |
| dy = int(h * 0.006 * _wave(t, 1.7)) | |
| return _center_crop_zoom(_translate(img, dx=dx, dy=dy), 1.015) | |
| return img | |
| def _center_crop_zoom(img: Image.Image, scale: float) -> Image.Image: | |
| w, h = img.size | |
| scale = max(1.0, float(scale)) | |
| nw, nh = max(1, int(w / scale)), max(1, int(h / scale)) | |
| left = max(0, (w - nw) // 2) | |
| top = max(0, (h - nh) // 2) | |
| return img.crop((left, top, left + nw, top + nh)).resize((w, h), Image.Resampling.BICUBIC) | |
| def _translate(img: Image.Image, *, dx: int, dy: int) -> Image.Image: | |
| w, h = img.size | |
| shifted = img.transform((w, h), Image.Transform.AFFINE, (1, 0, dx, 0, 1, dy), resample=Image.Resampling.BICUBIC) | |
| if dx == 0 and dy == 0: | |
| return shifted | |
| return _center_crop_zoom(shifted, 1.01) | |
| def _wave(t: float, phase: float) -> float: | |
| import math | |
| return math.sin((float(t) + phase) * math.tau) | |