Implementation:Open compass VLMEvalKit QwenAPI
| Field | Value |
|---|---|
| source | VLMEvalKit |
| domain | Vision, API_Integration |
Overview
QwenAPI provides a VLMEvalKit API adapter for Alibaba Qwen pure language models via DashScope.
Description
QwenAPI inherits from BaseAPI and uses the DashScope SDK to communicate with Alibaba's Qwen language model API. It is a text-only adapter (not vision) supporting models such as qwen-turbo, qwen-plus, qwen-max, and qwen-max-longcontext. The class provides configurable seed, temperature, and max token parameters, and authenticates via the DASHSCOPE_API_KEY environment variable.
Usage
Use this adapter when evaluating Qwen pure language models (not vision models) through the Alibaba DashScope API.
Code Reference
- Source:
vlmeval/api/qwen_api.py, Lines: L1-74 - Import:
from vlmeval.api.qwen_api import QwenAPI
Signature:
class QwenAPI(BaseAPI):
def __init__(self, model='qwen-max-1201', retry=5, verbose=True,
seed=2680, temperature=0.0, system_prompt=None,
key=None, max_tokens=2048, proxy=None, **kwargs): ...
def generate_inner(self, inputs, **kwargs): ...
I/O Contract
| Direction | Description |
|---|---|
| Inputs | message — text/image/video content list; model-specific params via kwargs |
| Outputs | generate() returns str prediction; generate_inner() returns (int, str, str) tuple |
Usage Examples
# Example instantiation
model = QwenAPI(model='qwen-max-1201')
response = model.generate(message)