当前位置: 首页 > news >正文

嘉兴公司做网站制作模板网站

嘉兴公司做网站,制作模板网站,品牌开发者应考虑的因素,客户管理软件哪家好vLLM 是一款专为大语言模型推理加速而设计的框架#xff0c;实现了 KV 缓存内存几乎零浪费#xff0c;解决了内存管理瓶颈问题。 更多 vLLM 中文文档及教程可访问 →https://vllm.hyper.ai/ *在线运行 vLLM 入门教程#xff1a;零基础分步指南 源码 examples/offline_inf…vLLM 是一款专为大语言模型推理加速而设计的框架实现了 KV 缓存内存几乎零浪费解决了内存管理瓶颈问题。 更多 vLLM 中文文档及教程可访问 →https://vllm.hyper.ai/ *在线运行 vLLM 入门教程零基础分步指南 源码 examples/offline_inference/encoder_decoder_multimodal.py # SPDX-License-Identifier: Apache-2.0 此示例显示了如何使用 vLLM 进行离线推理 文本生成的 enc-dec LMMS 上的显式/隐式提示格式。import time from collections.abc import Sequence from dataclasses import asdict from typing import NamedTuplefrom vllm import LLM, EngineArgs, PromptType, SamplingParams from vllm.assets.audio import AudioAsset from vllm.assets.image import ImageAsset from vllm.utils import FlexibleArgumentParserclass ModelRequestData(NamedTuple):engine_args: EngineArgsprompts: Sequence[PromptType]def run_florence2():engine_args EngineArgs(modelmicrosoft/Florence-2-large,tokenizerfacebook/bart-large,max_num_seqs8,trust_remote_codeTrue,limit_mm_per_prompt{image: 1},dtypehalf,)prompts [{ # implicit prompt with task tokenprompt: DETAILED_CAPTION,multi_modal_data: {image: ImageAsset(stop_sign).pil_image},},{ # explicit encoder/decoder promptencoder_prompt: {prompt: Describe in detail what is shown in the image.,multi_modal_data: {image: ImageAsset(cherry_blossom).pil_image},},decoder_prompt: ,},]return ModelRequestData(engine_argsengine_args,promptsprompts,)def run_mllama():engine_args EngineArgs(modelmeta-llama/Llama-3.2-11B-Vision-Instruct,max_model_len4096,max_num_seqs2,limit_mm_per_prompt{image: 1},dtypehalf,)prompts [{ # Implicit prompt # 隐式提示prompt: |image||begin_of_text|What is the content of this image?, # noqa: E501multi_modal_data: {image: ImageAsset(stop_sign).pil_image,},},{ # Explicit prompt # 显示提示encoder_prompt: {prompt: |image|,multi_modal_data: {image: ImageAsset(stop_sign).pil_image,},},decoder_prompt: |image||begin_of_text|Please describe the image., # noqa: E501},]return ModelRequestData(engine_argsengine_args,promptsprompts,)def run_whisper():engine_args EngineArgs(modelopenai/whisper-large-v3-turbo,max_model_len448,max_num_seqs16,limit_mm_per_prompt{audio: 1},dtypehalf,)prompts [{ # Test implicit prompt # 测试隐式提示prompt: |startoftranscript|,multi_modal_data: {audio: AudioAsset(mary_had_lamb).audio_and_sample_rate,},},{ # Test explicit encoder/decoder prompt # 测试显式 编码/解码提示encoder_prompt: {prompt: ,multi_modal_data: {audio: AudioAsset(winning_call).audio_and_sample_rate,},},decoder_prompt: |startoftranscript|,}]return ModelRequestData(engine_argsengine_args,promptsprompts,)model_example_map {florence2: run_florence2,mllama: run_mllama,whisper: run_whisper, }def main(args):model args.model_typeif model not in model_example_map:raise ValueError(fModel type {model} is not supported.)req_data model_example_map[model]()engine_args asdict(req_data.engine_args) | {seed: args.seed}llm LLM(**engine_args)prompts req_data.prompts# 创建一个采样参数对象。sampling_params SamplingParams(temperature0,top_p1.0,max_tokens64,)start time.time()# 从提示中生成输出 token 。# 输出是包含提示的对象生成了文本和其他信息。outputs llm.generate(prompts, sampling_params)# 打印输出。for output in outputs:prompt output.promptgenerated_text output.outputs[0].textprint(fDecoder prompt: {prompt!r}, fGenerated text: {generated_text!r})duration time.time() - startprint(Duration:, duration)print(RPS:, len(prompts) / duration)if __name__ __main__:parser FlexibleArgumentParser(descriptionDemo on using vLLM for offline inference with vision language models for text generation)parser.add_argument(--model-type,-m,typestr,defaultmllama,choicesmodel_example_map.keys(),helpHuggingface model_type.)parser.add_argument(--seed,typeint,defaultNone,helpSet the seed when initializing vllm.LLM.)args parser.parse_args()main(args)
http://www.pierceye.com/news/996296/

相关文章:

  • 快速迁移网站wordpress网站很慢
  • 官方网站的作用邢台做wap网站费用
  • 梧州网站优化运营策划
  • 佛山网站快照优化公司免费好用的wordpress
  • 河南有名的做网站公司有哪些做设计找素材的+网站有哪些
  • 网站建设规划设计任务书网站开发的费用申请
  • 淮阳住房城乡建设局网站网页模板的作用
  • 知识问答网站开发不用编程做APP和响应式网站
  • 免费创建个人商城网站吗中国互联网前100名企业
  • 贵阳网站建设端觉有做数学题的网站吗
  • 网站备案格式网站开发工程师适合女生吗
  • 江门网站建设自助建站广播电台网站建设板块
  • 淮北市建设安全监督站网站文员工作内容
  • 先做网站还是app海北网站建设
  • 网站中转页怎么做做网页需要什么
  • 台州城乡建设规划网站房产管理局官网入口
  • 徐州手机建站模板宁波公司招聘
  • 类似 wordpress 建站哪里有培训班
  • 广州建设六马路小学网站微营销软件免费下载
  • 广州网站推广解决方案网站建设标志头像图片
  • 网站建设 中企动力成都qq空间wordpress
  • 什么是定制网站php网站开发面试
  • 网站建设推广专家服务重庆万泰建设集团有限公司
  • 2017两学一做竞赛网站手游游戏推广平台
  • 贵州灵溪seo整站优化wordpress开发文档(chm)
  • iis7 网站权限设置亚马逊网站开发设计
  • 贵阳做网站哪家好复古网站设计
  • 网站跳转是什么意思58这样网站怎么做
  • 易语言网站批量注册怎么做百度模板网站模板
  • 海伦市网站山西大川建设有限公司网站