Image-Text-to-Text
Transformers
English
Chinese
eviscene
multimodal
image-factuality
agent
sft
distillation
Instructions to use ZiAnwang/EviScene with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ZiAnwang/EviScene with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="ZiAnwang/EviScene")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("ZiAnwang/EviScene", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ZiAnwang/EviScene with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ZiAnwang/EviScene" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ZiAnwang/EviScene", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ZiAnwang/EviScene
- SGLang
How to use ZiAnwang/EviScene 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 "ZiAnwang/EviScene" \ --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": "ZiAnwang/EviScene", "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 "ZiAnwang/EviScene" \ --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": "ZiAnwang/EviScene", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use ZiAnwang/EviScene with Docker Model Runner:
docker model run hf.co/ZiAnwang/EviScene
File size: 2,924 Bytes
c10636a | 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 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 | from __future__ import annotations
from pathlib import Path
from typing import Any, Dict
from eviscene.eval.run_artifacts import load_jsonl_objects
def case_list(path: Path | None) -> list[str] | None:
if path is None:
return None
case_ids = [
line.strip()
for line in path.read_text(encoding="utf-8").splitlines()
if line.strip() and not line.lstrip().startswith("#")
]
if len(case_ids) != len(set(case_ids)):
raise ValueError("--case-list values must be unique")
return case_ids
def select_samples(
samples: list[Dict[str, Any]],
*,
requested_case_ids: list[str] | None,
limit: int | None,
shard_count: int = 1,
shard_index: int = 0,
) -> list[Dict[str, Any]]:
indexed: Dict[str, Dict[str, Any]] = {}
for sample in samples:
case_id = str(sample.get("case_id", "")).strip()
if not case_id:
raise ValueError("runtime input row lacks case_id")
if case_id in indexed:
raise ValueError(f"runtime input contains duplicate case_id {case_id}")
indexed[case_id] = sample
if requested_case_ids:
requested = [str(item).strip() for item in requested_case_ids]
if any(not item for item in requested):
raise ValueError("requested case_id values must be non-empty")
if len(requested) != len(set(requested)):
raise ValueError("requested case_id values must be unique")
missing = [case_id for case_id in requested if case_id not in indexed]
if missing:
raise ValueError(
"requested case_id values are absent from release: "
+ ", ".join(missing)
)
samples = [indexed[case_id] for case_id in requested]
if shard_count < 1:
raise ValueError("--shard-count must be at least 1")
if shard_index < 0 or shard_index >= shard_count:
raise ValueError("--shard-index must be in [0, shard-count)")
if shard_count > 1:
samples = [
sample
for index, sample in enumerate(
sorted(samples, key=lambda item: str(item["case_id"]))
)
if index % shard_count == shard_index
]
if limit is not None:
if limit < 1:
raise ValueError("--limit must be at least 1 when supplied")
samples = samples[:limit]
return samples
def metadata_index(path: Path | None) -> Dict[str, Dict[str, Any]]:
if path is None:
return {}
indexed: Dict[str, Dict[str, Any]] = {}
for row in load_jsonl_objects(path):
case_id = str(row.get("case_id") or "").strip()
if not case_id:
raise ValueError(f"metadata row lacks non-empty case_id: {path}")
if case_id in indexed:
raise ValueError(f"duplicate metadata row for case_id {case_id}")
indexed[case_id] = dict(row)
return indexed
|