Image-Text-to-Text
Transformers
Safetensors
inkling2_loop
weight-edit
browser-automation
conversational
8-bit precision
modelopt
Instructions to use husky8/Inkling-2-Mini-Fast-Browser-Use with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use husky8/Inkling-2-Mini-Fast-Browser-Use with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="husky8/Inkling-2-Mini-Fast-Browser-Use") 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("husky8/Inkling-2-Mini-Fast-Browser-Use") model = AutoModelForMultimodalLM.from_pretrained("husky8/Inkling-2-Mini-Fast-Browser-Use", 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 husky8/Inkling-2-Mini-Fast-Browser-Use with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "husky8/Inkling-2-Mini-Fast-Browser-Use" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "husky8/Inkling-2-Mini-Fast-Browser-Use", "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/husky8/Inkling-2-Mini-Fast-Browser-Use
- SGLang
How to use husky8/Inkling-2-Mini-Fast-Browser-Use 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 "husky8/Inkling-2-Mini-Fast-Browser-Use" \ --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": "husky8/Inkling-2-Mini-Fast-Browser-Use", "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 "husky8/Inkling-2-Mini-Fast-Browser-Use" \ --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": "husky8/Inkling-2-Mini-Fast-Browser-Use", "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 husky8/Inkling-2-Mini-Fast-Browser-Use with Docker Model Runner:
docker model run hf.co/husky8/Inkling-2-Mini-Fast-Browser-Use
Download benchmark/compare_browser_inputs.py from husky8/Inkling-2-Mini-Fast-Browser-Use: direct link, hf CLI and curl.
- Browser
- Download file 2.52 kB
-
https://huggingface.co/husky8/Inkling-2-Mini-Fast-Browser-Use/resolve/main/benchmark/compare_browser_inputs.py
- Command line
-
hf download hf://husky8/Inkling-2-Mini-Fast-Browser-Use/benchmark/compare_browser_inputs.py
-
curl -L -o compare_browser_inputs.py https://huggingface.co/husky8/Inkling-2-Mini-Fast-Browser-Use/resolve/main/benchmark/compare_browser_inputs.py
2.52 kB
| """Check whether two edited checkpoints received identical messages at every browser decision.""" | |
| import argparse | |
| import json | |
| from pathlib import Path | |
| from zipfile import ZipFile | |
| def compare(archive_path, pairs_path, previous, current, device, tasks): | |
| pairs = json.loads(pairs_path.read_text())["pairs"] | |
| with ZipFile(archive_path) as archive: | |
| timing = {} | |
| for name in archive.namelist(): | |
| if name.startswith("timing/"): | |
| record = json.loads(archive.read(name)) | |
| timing[record["receipt_sha256"]] = record | |
| comparisons = [] | |
| for task in tasks: | |
| for first in ("edited", "original"): | |
| episodes = [] | |
| for checkpoint in (previous, current): | |
| matches = [p for p in pairs if p["checkpoint"] == checkpoint and p["task"] == task | |
| and p["device"] == device and p["order"][0] == first and p["comparable"]] | |
| if len(matches) != 1: | |
| raise ValueError(f"Expected one comparable {checkpoint} run on task {task}, {first} first.") | |
| episodes.append(timing[matches[0]["edited"]["receipt_sha256"]]) | |
| before, after = episodes | |
| if before["shard_sha256"] == after["shard_sha256"] or min(before["score"], after["score"]) != 1: | |
| raise ValueError(f"Task {task} needs two distinct passing checkpoints.") | |
| counts = [] | |
| for step, (a, b) in enumerate(zip(before["steps"], after["steps"], strict=True), 1): | |
| if a["message_sha256"] != b["message_sha256"] or a["action"] != b["action"]: | |
| raise ValueError(f"Task {task}, {first} first, decision {step} has different input or action.") | |
| counts.append((a["generated"], b["generated"])) | |
| comparisons.append((task, first, counts)) | |
| return comparisons | |
| if __name__ == "__main__": | |
| parser = argparse.ArgumentParser(description=__doc__) | |
| parser.add_argument("archive", type=Path) | |
| parser.add_argument("pairs", type=Path) | |
| parser.add_argument("previous") | |
| parser.add_argument("current") | |
| parser.add_argument("--device", required=True) | |
| parser.add_argument("--tasks", nargs="+", type=int, required=True) | |
| args = parser.parse_args() | |
| for task, first, counts in compare(args.archive, args.pairs, args.previous, args.current, args.device, args.tasks): | |
| print(f"WebArena {task}, {first} first. {len(counts)} matching decisions. Generated tokens per decision {counts}.") | |