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

快递公司网站模板html做网站步骤

快递公司网站模板,html做网站步骤,wordpress 链接美化,中英网站源码下载本地部署 Llama-3-EvoVLM-JP-v2 0. 引言1. 关于 Llama-3-EvoVLM-JP-v22. 本地部署2-0. 克隆代码2-1. 安装依赖模块2-2. 创建 Web UI2-3.启动 Web UI2-4. 访问 Web UI 0. 引言 Sakana AI 提出了一种称为进化模型合并的方法#xff0c;并使用该方法创建大规模语言模型#xff… 本地部署 Llama-3-EvoVLM-JP-v2 0. 引言1. 关于 Llama-3-EvoVLM-JP-v22. 本地部署2-0. 克隆代码2-1. 安装依赖模块2-2. 创建 Web UI2-3.启动 Web UI2-4. 访问 Web UI 0. 引言 Sakana AI 提出了一种称为进化模型合并的方法并使用该方法创建大规模语言模型LLM 、视觉语言模型VLM和图像生成模型他们创建了具有各种功能的合并模型。这次他们发布了一个新的日本 VLMLlama-3-EvoVLM-JP-v2它利用进化模型合并来实现多个图像的问答。此外为了评估构建的模型他们还将发布一个数据集日语多图像视觉问答JA-Multi-Image-VQA以评估用日语回答有关多个图像的问题的能力。 1. 关于 Llama-3-EvoVLM-JP-v2 VLM研究LLM它是发展最快的领域之一。最近VLM的研究不断取得进展不仅提高了单图像描绘和问答的性能而且还具备处理视频和多图像的能力。另一方面这种新型的VLM主要是在英语国家开发的在非英语国家仍然基本上不存在。日语也是如此虽然已经开发了几种日语VLM但这种类型的尖端VLM仍然不多。因此Sakana AI 使用进化模型融合来创建这种新型的英语 VLM 和日语 VLM。他们认为通过合并这些LLM他们可以快速构建一个尖端的日本 VLM。 在构建新的VLM时底层模型是开源模型。LLM其中他们选择了Llama-3它具有高性能并且各种额外训练的模型都是公开的。有几种使用 Llama-3 创建的高性能 VLM但Mantis-8B-SigLIP-Llama-3是一种前所未有的 VLM可以将输入图像放置在我选择的输入文本中的任何位置。高性能日语培训帮助学生获得日语能力。LLM他们使用Llama-3-ELYZA-JP-8B 。首先通过合并这两个模型他们成功构建了“可以处理多个图像的日本 VLM”。此外他们还添加了一个名为Bunny-v1.1-Llama-3-8B-V的高性能英文VLM来增强图像渲染能力。LLM这些部件也被添加到合并中。 2. 本地部署 2-0. 克隆代码 git clone https://huggingface.co/spaces/SakanaAI/Llama-3-EvoVLM-JP-v2; cd Llama-3-EvoVLM-JP-v22-1. 安装依赖模块 pip install githttps://github.com/TIGER-AI-Lab/Mantis.git2-2. 创建 Web UI # webui.py import gradio as gr import time import subprocessimport torchfrom models.mllava import (MLlavaProcessor,LlavaForConditionalGeneration,prepare_inputs, ) from models.conversation import Conversation, SeparatorStyle from transformers import TextIteratorStreamer from transformers.utils import is_flash_attn_2_available from threading import Threaddevice cuda if torch.cuda.is_available() else cpu IMAGE_TOKEN image generation_kwargs {max_new_tokens: 1024,num_beams: 1,do_sample: False,no_repeat_ngram_size: 3, }if not is_flash_attn_2_available():subprocess.run(pip install flash-attn --no-build-isolation, env{FLASH_ATTENTION_SKIP_CUDA_BUILD: TRUE},shellTrue)processor MLlavaProcessor.from_pretrained(TIGER-Lab/Mantis-8B-siglip-llama3) processor.tokenizer.pad_token processor.tokenizer.eos_tokenmodel LlavaForConditionalGeneration.from_pretrained(SakanaAI/Llama-3-EvoVLM-JP-v2,torch_dtypetorch.float16,attn_implementationflash_attention_2,device_mapdevice, ).eval()# Set the system prompt conv_template Conversation(system|start_header_id|system|end_header_id|\n\nあなたは誠実で優秀な日本人のアシスタントです。特に指示が無い場合は、常に日本語で回答してください。,roles(user, assistant),messages(),offset0,sep_styleSeparatorStyle.LLAMA_3,sep|eot_id|, )def get_chat_messages(history):chat_history []user_role conv_template.roles[0]assistant_role conv_template.roles[1]for i, message in enumerate(history):if isinstance(message[0], str):chat_history.append({role: user_role, text: message[0]})if i ! len(history) - 1:assert message[1], The bot message is not provided, internal errorchat_history.append({role: assistant_role, text: message[1]})else:assert not message[1], the bot message internal error, get: {}.format(message[1])chat_history.append({role: assistant_role, text: })return chat_historydef get_chat_images(history):images []for message in history:if isinstance(message[0], tuple):images.extend(message[0])return imagesdef add_message(history, message):return history, gr.MultimodalTextbox(interactiveFalse)def bot(history, message):images message[files] if message[files] else Nonetext message[text].strip()if not text:raise gr.Error(You must enter a message!)num_image_tokens text.count(IMAGE_TOKEN)# modify textif images and num_image_tokens len(images):if num_image_tokens ! 0:gr.Warning(The number of images uploaded is more than the number of image placeholders in the text. Will automatically prepend image to the text.)# prefix image tokenstext IMAGE_TOKEN * (len(images) - num_image_tokens) textif images and num_image_tokens len(images):raise gr.Error(The number of images uploaded is less than the number of image placeholders in the text!)current_messages []if images:current_messages [[(image,), None] for image in images]if text:current_messages [[text, None]]current_history history current_messages# chat_messages get_chat_messages(current_history)# chat_images get_chat_images(current_history)chat_messages get_chat_messages(current_messages)chat_images get_chat_images(current_messages)# Generate!inputs prepare_inputs(None, chat_images, model, processor, historychat_messages, **generation_kwargs)streamer TextIteratorStreamer(processor, skip_promptTrue, skip_special_tokensTrue)inputs[streamer] streamerthread Thread(targetmodel.generate, kwargsinputs)thread.start()buffer for new_text in streamer:buffer new_texttime.sleep(0.01)# yield buffercurrent_history[-1] (current_history[-1][0], buffer)yield current_historyexamples [{text: 1番目と2番目の画像に写っている動物の違いは何ですか簡潔に説明してください。,files: [./examples/image_0.jpg, ./examples/image_1.jpg],},{text: 2枚の写真について、簡単にそれぞれ説明してください。,files: [./examples/image_2.jpg, ./examples/image_3.jpg],}, ]with gr.Blocks(fill_heightTrue) as demo:chatbot gr.Chatbot(elem_idchatbot,bubble_full_widthFalse,scale1,)chat_input gr.MultimodalTextbox(interactiveTrue,file_types[image],placeholderEnter message or upload images. Please use image to indicate the position of uploaded images,show_labelTrue,renderTrue,)examples gr.Examples(examples, [chat_input], [])chat_msg chat_input.submit(add_message, [chatbot, chat_input], [chatbot, chat_input])bot_msg chat_msg.then(bot, [chatbot, chat_input], chatbot, api_namebot_response)bot_msg.then(lambda: gr.MultimodalTextbox(valueNone, interactiveTrue), None, [chat_input])demo.queue().launch()2-3.启动 Web UI python webui.py2-4. 访问 Web UI 使用浏览器打开 http://localhost:7860 完结
http://www.sczhlp.com/news/180678/

相关文章:

  • 企业网站的在线推广方法有哪几种做网站什么公司
  • 手机网站插件代码python编写简单网页
  • 上海做网站推广关键词深圳市住房和保障局官网
  • 招聘做网站的需要技术哪些要求做外贸网站用哪些小语种
  • 有没有代做毕业设计的网站wordpress去掉首页
  • 备案号注销了 新网站怎么备案门户建设
  • 网站后台上传木马教程网络规划设计师教程第2版2021版pdf下载
  • 网站建设服务器的选择方式包括哪些wordpress分类不同模板
  • 承接网站开发 小程序开发营销客户管理软件
  • 合肥做一个网站要多少钱网站建设方案书 个人
  • 美橙域名查询网站html5设计
  • 东莞网站织梦网站怎么关闭手机模板
  • 领卷网站怎么做wordpress 会员购买系统
  • 帮助网站源码最好的淘宝网站建设
  • 网站变灰兼容代码网站服务器如何选择
  • 摄影网站介绍做pc端网站效果
  • 网站建站 上海计算机基础网站建设和网络安全
  • 北京网页模板建站做母婴网站
  • 建设网站网站设计一个简单的登录界面网页代码
  • 河北省建设银行网站首页兴宁电子商务网站建设
  • 怎样申请做自己的网站简述网站建设的流程做成一个页面
  • 网站怎么维护更新用手机制作word文档的app
  • 成都哪家做网站比较好网站建设哪里
  • 自学做网站多久广州网络推广定制
  • 为什么有网网站打不开怎么回事啊用wordpress做企业网站视频教程
  • 自己服务器做网站服务器备案wordpress on.7主题
  • 做网站的时候遇到的问题google play三件套
  • 一个网站价格asp故障解答网站模板
  • 秦淮做网站价格苏州园科生态建设集团网站
  • 网站模板织梦免费上饶网站建设公司