ninehills / llm-inference-benchmark

LLM Inference benchmark
MIT License
245 stars 7 forks source link

一直跑不通你们这个工程 #2

Open luhairong11 opened 1 month ago

luhairong11 commented 1 month ago

image

执行命令: locust -u 8 -r 2 --prompt-text "我" -o 100 --provider vllm -H http://127.0.0.1:7860 --tokenizer /data/pretrain_models/qwen/Qwen-1_8B-Chat-Int4 --qps 1 有相关的群吗

luhairong11 commented 1 month ago

有输出的格式示例吗: def parse_output_json(self, data, prompt): usage = data.get("usage", None)

    assert len(data["choices"]) == 1, f"Too many choices {len(data['choices'])}"
    choice = data["choices"][0]
    if self.parsed_options.chat:
        if self.parsed_options.stream:
            text = choice["delta"].get("content", "")
        else:
            text = choice["message"]["content"]
    else:
        text = choice["text"]

    if text is None:
        text = ""

    logprobs = choice.get("logprobs", None)
    return ChunkMetadata(
        text=text,
        logprob_tokens=len(logprobs["tokens"]) if logprobs else None,
        usage_tokens=usage["completion_tokens"] if usage else None,
        prompt_usage_tokens=usage.get("prompt_tokens", None) if usage else None,
    )
luhairong11 commented 1 month ago

image 已经跑通了