mirror of
https://github.com/open-compass/opencompass.git
synced 2025-05-30 16:03:24 +08:00

* [Feat] Support visualglm inference on MMBench. * [Feat] Support llava inference on MMBench. * [Fix] Fix pre-commit format. * [Fix] Add docstring for llava * [Fix] Fix multi-process inference error of LlaVA and add comments. 1. Set `low_cpu_mem_usage` to False to address device issue. 2. Add docstring and type hints. 3. Rename class and remove registry. * [Fix] Pre-commit fix. * [Fix] add forward entry, add dynamic import to seedbench * [Fix] Fix pre-commit. * [Fix] Fix missing context. * [Fix] Fix docstring.
15 lines
334 B
Python
15 lines
334 B
Python
from typing import Any
|
|
|
|
import torch
|
|
|
|
|
|
class VisualGLMPostProcessor:
|
|
""""Post processor for VisualGLM on MMBench."""
|
|
|
|
def __init__(self) -> None:
|
|
pass
|
|
|
|
def __call__(self, output_token: torch.tensor, tokenizer: Any,
|
|
input_len: int) -> str:
|
|
return tokenizer.decode(output_token[input_len:])
|