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
File size: 3,556 Bytes
a55a3c9 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | """Check every full-task speed ratio and token count against the published episode timings."""
import argparse
import json
import math
from pathlib import Path
from zipfile import ZipFile
def verify(archive_path, pairs_path):
def check(condition, message):
if not condition:
raise ValueError(message)
pairs=json.loads(pairs_path.read_text())['pairs']
with ZipFile(archive_path) as archive:
names=[n for n in archive.namelist() if n.startswith('timing/')]
episodes={}
for name in names:
event=json.loads(archive.read(name))
grade=json.loads(archive.read(name.replace('timing/','receipts/',1)))
check(event['seconds']==grade['elapsed_s'] and event['score']==grade['score'],f'{name}: grade and timing disagree')
times=[s['start_s'] for s in event['steps']]+[event['seconds']]
check(bool(event['steps']) and all(math.isfinite(t) and t>=0 for t in times),f'{name}: invalid timestamps')
for start,end,s in zip(times,times[1:],event['steps']):
check(0<=s['inference_s']<=end-start+1e-6 and 0<=s['thinking']<=s['generated'],f'{name}: invalid step duration or token count')
digest=event['receipt_sha256']
check(digest not in episodes or episodes[digest]==event,f'{name}: conflicting episode identity')
episodes[digest]=event
used=set()
for p in pairs:
original,edited=(episodes[p[a]['receipt_sha256']] for a in ('original','edited'))
label=f"WebArena {p['task']}, {p['checkpoint']}, repeat {p['repeat']}"
check(original['steps'][0]['view_sha256']==edited['steps'][0]['view_sha256'],f'{label}: different initial observations')
for arm,event in [('original',original),('edited',edited)]:
result=p[arm]
check((p['task'],arm,result['seconds'],result['score'],result['shard_sha256'])==(event['task'],event['arm'],event['seconds'],event['score'],event['shard_sha256']),f'{label}: wrong {arm} episode')
check([s['action'] for s in event['steps']]==result['commands'],f'{label}: different {arm} actions')
check(sum(s['generated'] for s in event['steps'])==result['generated'],f'{label}: different {arm} token count')
check(sum(s['thinking'] for s in event['steps'])==result['thinking'],f'{label}: different {arm} reasoning token count')
check(math.isclose(sum(s['inference_s'] for s in event['steps']),result['inference_seconds'],rel_tol=1e-12),f'{label}: different {arm} inference time')
used.add(event['receipt_sha256'])
if p['comparable'] and original['score']==edited['score']==1:
check(edited['seconds']>0 and isinstance(p['ratio'],(int,float)) and math.isclose(original['seconds']/edited['seconds'],p['ratio'],rel_tol=1e-12),f'{label}: speed ratio disagrees with the clock')
else:
check(p['ratio'] is None,f'{label}: speed ratio on an unsuccessful or incomparable pair')
check(bool(pairs) and used==set(episodes) and len(names)==2*len(pairs),'Incomplete timing archive')
return len(pairs),len(names)
if __name__=='__main__':
parser=argparse.ArgumentParser(description=__doc__)
parser.add_argument('archive',type=Path)
parser.add_argument('pairs',type=Path)
args=parser.parse_args()
count,total=verify(args.archive,args.pairs)
print(f'Verified {count} paired comparisons against {total} recorded episode timings.')
|