1.1k Star!天工Skywork-13B:性能全面超越LLaMA2、0门槛商用、消费级显卡进行部署和推理!

cover_image
原文链接:(更好排版、视频播放、社群交流、最新AI开源项目、AI工具分享都在这个公众号!)

1.1k Star!天工Skywork-13B:性能全面超越LLaMA2、0门槛商用、消费级显卡进行部署和推理!

🌟Skywork-13B-Base模型在3.2万亿个高质量多语言(主要是中文和英文)和代码数据上预训练,它在多种评测和各种基准测试上都展现了同等规模模型的最佳效果,包括Base、Chat、Math、MM模型及其量化版,支持用户在消费级显卡进行部署和推理。

Hello,大家好啊,我是Aitrainee,今天聊聊 国产开源大模型 :Skywork-13B。 去年 7 月,Meta 发布了
LLaMA2,以其强大的 性能和免费商用 的优势,迅速赢得了开发者和企业的喜爱。各个版本的 LLaMA2
微调成果不断涌现,让大模型领域的竞争局势快速变化。 很多人认为,这波开源攻势会削弱那些闭源大模型厂商的“ 护城河
”,让中小企业和开发者有了更经济实惠的选择。 不仅如此,国产大模型的开源力量也在加速追赶。然后,大模型开源仍面临 三大挑战
首先,中文数据的稀缺和珍贵使得训练高质量模型变得困难;其次,模型训练的细节往往不公开, 限制了
开发者对模型的深度理解和优化;最后,模型开源在商用方面面临诸多限制,使得企业在实际应用中遇到许多障碍。 而前不久,昆仑万维推出了 重磅开源项
** 目 ** :天工 Skywork-13B 系列。为什么说重磅呢?因为 Skywork-13B 在多个基准测试(如 C-Eval,MMLU)中
全面超越 了 LLaMA2-13B。 这次开源不仅包括 Skywork-13B-Base 模型、Skywork-13B-Math 模型,还有它们的
量化版模型 。更厉害的是,昆仑万维还开放了一个600GB、150B Tokens的 高质量中文语料数据集 「Skypile/Chinese-
Web-Text-150B」,而且 全面开放商用,开发者无需申请,零门槛 就能用上。

▲ Model Scope

一键直达:


• Skywork-13B 下载地址(Model Scope):https://modelscope.cn/organization/skywork• Skywork-13B 下载地址(Github):https://github.com/SkyworkAI/Skywork• 技术报告:https://arxiv.org/pdf/2310.19341.pdf

模型结构

Llama模型有三个主要特点:首先,它使用RMSNorm代替传统的Layernorm,以保持训练的 稳定性
;其次,它使用SwiGLU激活函数而不是传统的ReLU;最后,它使用相对位置编码(RoPE等)而不是传统的绝对位置编码。实验结果表明,与GPT模型相比,
Llama模型不仅训练得更快,而且效果也更好。

▲ GPT-3结构和Llama结构训练对比(摘自知乎盐海)

下面对相关名词作通俗化的解释:

** 相对位置编码 ** (Rotary Position Embedding):这是一种用于编码输入序列中位置信息的方法。
想象一下,你在看一本书,每页的页码告诉你这个字在哪里。RoPE就像在模型里给每个字加了页码,让它知道每个字在什么位置。

** 均方根归一化 ** (Root Mean Square Normalization):这是一种归一化技术,用于调整神经网络层的输出。
想象你在做一道菜,所有的配料都需要精确的分量。RMSNorm就像一个称重工具,确保每个步骤的配料量都准确无误,这样菜品才会美味。

** SwiGLU(一种激活函数) ** : 结合了Swish和Gated Linear Units (GLU) 的特点。
想象你有一个聪明的开关,它能决定什么时候打开、什么时候关闭,以确保电流流动最有效。SwiGLU就是这样一个聪明的开关,帮助模型更好地处理信息。

**** Skywork-13B模型比Llama-2-13B模型更“瘦长”: ** ** 为了达到Llama2-13B的训练效率, ****
Skywork-13B ** ** 的 训练批次大小增加到Llama2-13B的四倍。由于计算机集群带 宽较低,所以需要更多的梯度累积来减少通讯开销。

根据之前的实验,当批次更大时, 增加网络层数
(即增加模型的复杂度)可以提高模型的表现。因此,模型的层数被增加到52层,同时减小每层的规模,使得模型的总体参数量和Llama2-13B差不多。

为了适应更大的数据批量, 学习率 被提高到Llama2-13B的两倍,这样可以确保训练时梯度的方差保持一致。

**** Skywork-13B ** ** 总共52层,虽然每层的一些参数(FFN Dim和Hidden Dim)比Llama-2-13B模型小,但
总的参数量 是一样的。

模型结构 Llama-2-13B Skywork-13B
词表大小 32,000 65,536
Hidden Dim 5,120 4,608
FFN Dim 13,696 12,288
Head Dim 128 128
Attention头数 40 36
解释一下2. Find the API endpoint below corresponding to your desired function in the app. Copy the code snippet, replacing the placeholder values with your own input data. Or use the API Recorder to automatically generate your API requests. api_name: /get_model_info copy from gradio_client import Client client = Client("http://localhost:7860/") result = client.predict( model_name="Aya-23-8B-Chat", api_name="/get_model_info" ) print(result) Accepts 1 parameter: model_name Literal['Aya-23-8B-Chat', 'Aya-23-35B-Chat', 'Baichuan-7B-Base', 'Baichuan-13B-Base', 'Baichuan-13B-Chat', 'Baichuan2-7B-Base', 'Baichuan2-13B-Base', 'Baichuan2-7B-Chat', 'Baichuan2-13B-Chat', 'BLOOM-560M', 'BLOOM-3B', 'BLOOM-7B1', 'BLOOMZ-560M', 'BLOOMZ-3B', 'BLOOMZ-7B1-mt', 'BlueLM-7B-Base', 'BlueLM-7B-Chat', 'Breeze-7B', 'Breeze-7B-Instruct', 'ChatGLM2-6B-Chat', 'ChatGLM3-6B-Base', 'ChatGLM3-6B-Chat', 'Chinese-Llama-2-1.3B', 'Chinese-Llama-2-7B', 'Chinese-Llama-2-13B', 'Chinese-Alpaca-2-1.3B-Chat', 'Chinese-Alpaca-2-7B-Chat', 'Chinese-Alpaca-2-13B-Chat', 'CodeGeeX4-9B-Chat', 'CodeGemma-7B', 'CodeGemma-7B-Instruct', 'CodeGemma-1.1-2B', 'CodeGemma-1.1-7B-Instruct', 'Codestral-22B-v0.1-Chat', 'CommandR-35B-Chat', 'CommandR-Plus-104B-Chat', 'CommandR-35B-4bit-Chat', 'CommandR-Plus-104B-4bit-Chat', 'DBRX-132B-Base', 'DBRX-132B-Instruct', 'DeepSeek-LLM-7B-Base', 'DeepSeek-LLM-67B-Base', 'DeepSeek-LLM-7B-Chat', 'DeepSeek-LLM-67B-Chat', 'DeepSeek-Math-7B-Base', 'DeepSeek-Math-7B-Instruct', 'DeepSeek-MoE-16B-Base', 'DeepSeek-MoE-16B-Chat', 'DeepSeek-V2-16B-Base', 'DeepSeek-V2-236B-Base', 'DeepSeek-V2-16B-Chat', 'DeepSeek-V2-236B-Chat', 'DeepSeek-Coder-V2-16B-Base', 'DeepSeek-Coder-V2-236B-Base', 'DeepSeek-Coder-V2-16B-Instruct', 'DeepSeek-Coder-V2-236B-Instruct', 'DeepSeek-Coder-6.7B-Base', 'DeepSeek-Coder-7B-Base', 'DeepSeek-Coder-33B-Base', 'DeepSeek-Coder-6.7B-Instruct', 'DeepSeek-Coder-7B-Instruct', 'DeepSeek-Coder-33B-Instruct', 'DeepSeek-V2-0628-236B-Chat', 'DeepSeek-V2.5-236B-Chat', 'DeepSeek-V2.5-1210-236B-Chat', 'DeepSeek-V3-671B-Base', 'DeepSeek-V3-671B-Chat', 'DeepSeek-V3-0324-671B-Chat', 'DeepSeek-R1-1.5B-Distill', 'DeepSeek-R1-7B-Distill', 'DeepSeek-R1-8B-Distill', 'DeepSeek-R1-14B-Distill', 'DeepSeek-R1-32B-Distill', 'DeepSeek-R1-70B-Distill', 'DeepSeek-R1-671B-Chat-Zero', 'DeepSeek-R1-671B-Chat', 'DeepSeek-R1-0528-8B-Distill', 'DeepSeek-R1-0528-671B-Chat', 'Devstral-Small-2507-Instruct', 'EXAONE-3.0-7.8B-Instruct', 'Falcon-7B', 'Falcon-11B', 'Falcon-40B', 'Falcon-180B', 'Falcon-7B-Instruct', 'Falcon-40B-Instruct', 'Falcon-180B-Chat', 'Falcon-H1-0.5B-Base', 'Falcon-H1-1.5B-Base', 'Falcon-H1-1.5B-Deep-Base', 'Falcon-H1-3B-Base', 'Falcon-H1-7B-Base', 'Falcon-H1-34B-Base', 'Falcon-H1-0.5B-Instruct', 'Falcon-H1-1.5B-Instruct', 'Falcon-H1-1.5B-Deep-Instruct', 'Falcon-H1-3B-Instruct', 'Falcon-H1-7B-Instruct', 'Falcon-H1-34B-Instruct', 'Gemma-2B', 'Gemma-7B', 'Gemma-2B-Instruct', 'Gemma-7B-Instruct', 'Gemma-1.1-2B-Instruct', 'Gemma-1.1-7B-Instruct', 'Gemma-2-2B', 'Gemma-2-9B', 'Gemma-2-27B', 'Gemma-2-2B-Instruct', 'Gemma-2-9B-Instruct', 'Gemma-2-27B-Instruct', 'Gemma-3-1B', 'Gemma-3-1B-Instruct', 'MedGemma-27B-Instruct', 'Gemma-3-4B', 'Gemma-3-12B', 'Gemma-3-27B', 'Gemma-3-4B-Instruct', 'Gemma-3-12B-Instruct', 'Gemma-3-27B-Instruct', 'MedGemma-4B', 'MedGemma-4B-Instruct', 'Gemma-3n-E2B', 'Gemma-3n-E4B', 'Gemma-3n-E2B-Instruct', 'Gemma-3n-E4B-Instruct', 'GLM-4-9B', 'GLM-4-9B-Chat', 'GLM-4-9B-1M-Chat', 'GLM-4-0414-9B-Chat', 'GLM-4-0414-32B-Base', 'GLM-4-0414-32B-Chat', 'GLM-4.1V-9B-Base', 'GLM-4.1V-9B-Thinking', 'GLM-Z1-0414-9B-Chat', 'GLM-Z1-0414-32B-Chat', 'GPT-2-Small', 'GPT-2-Medium', 'GPT-2-Large', 'GPT-2-XL', 'Granite-3.0-1B-A400M-Base', 'Granite-3.0-3B-A800M-Base', 'Granite-3.0-2B-Base', 'Granite-3.0-8B-Base', 'Granite-3.0-1B-A400M-Instruct', 'Granite-3.0-3B-A800M-Instruct', 'Granite-3.0-2B-Instruct', 'Granite-3.0-8B-Instruct', 'Granite-3.1-1B-A400M-Base', 'Granite-3.1-3B-A800M-Base', 'Granite-3.1-2B-Base', 'Granite-3.1-8B-Base', 'Granite-3.1-1B-A400M-Instruct', 'Granite-3.1-3B-A800M-Instruct', 'Granite-3.1-2B-Instruct', 'Granite-3.1-8B-Instruct', 'Granite-3.2-2B-Instruct', 'Granite-3.2-8B-Instruct', 'Granite-3.3-2B-Base', 'Granite-3.3-8B-Base', 'Granite-3.3-2B-Instruct', 'Granite-3.3-8B-Instruct', 'Granite-Vision-3.2-2B', 'Hunyuan-7B-Instruct', 'Index-1.9B-Base', 'Index-1.9B-Base-Pure', 'Index-1.9B-Chat', 'Index-1.9B-Character-Chat', 'Index-1.9B-Chat-32K', 'InternLM-7B', 'InternLM-20B', 'InternLM-7B-Chat', 'InternLM-20B-Chat', 'InternLM2-7B', 'InternLM2-20B', 'InternLM2-7B-Chat', 'InternLM2-20B-Chat', 'InternLM2.5-1.8B', 'InternLM2.5-7B', 'InternLM2.5-20B', 'InternLM2.5-1.8B-Chat', 'InternLM2.5-7B-Chat', 'InternLM2.5-7B-1M-Chat', 'InternLM2.5-20B-Chat', 'InternLM3-8B-Chat', 'InternVL2.5-2B-MPO', 'InternVL2.5-8B-MPO', 'InternVL3-1B-hf', 'InternVL3-2B-hf', 'InternVL3-8B-hf', 'InternVL3-14B-hf', 'InternVL3-38B-hf', 'InternVL3-78B-hf', 'Jamba-v0.1', 'Kimi-Dev-72B-Instruct', 'Kimi-VL-A3B-Instruct', 'Kimi-VL-A3B-Thinking', 'Kimi-VL-A3B-Thinking-2506', 'LingoWhale-8B', 'Llama-7B', 'Llama-13B', 'Llama-30B', 'Llama-65B', 'Llama-2-7B', 'Llama-2-13B', 'Llama-2-70B', 'Llama-2-7B-Chat', 'Llama-2-13B-Chat', 'Llama-2-70B-Chat', 'Llama-3-8B', 'Llama-3-70B', 'Llama-3-8B-Instruct', 'Llama-3-70B-Instruct', 'Llama-3-8B-Chinese-Chat', 'Llama-3-70B-Chinese-Chat', 'Llama-3.1-8B', 'Llama-3.1-70B', 'Llama-3.1-405B', 'Llama-3.1-8B-Instruct', 'Llama-3.1-70B-Instruct', 'Llama-3.1-405B-Instruct', 'Llama-3.1-8B-Chinese-Chat', 'Llama-3.1-70B-Chinese-Chat', 'Llama-3.2-1B', 'Llama-3.2-3B', 'Llama-3.2-1B-Instruct', 'Llama-3.2-3B-Instruct', 'Llama-3.3-70B-Instruct', 'Llama-3.2-11B-Vision', 'Llama-3.2-11B-Vision-Instruct', 'Llama-3.2-90B-Vision', 'Llama-3.2-90B-Vision-Instruct', 'Llama-4-Scout-17B-16E', 'Llama-4-Scout-17B-16E-Instruct', 'Llama-4-Maverick-17B-128E', 'Llama-4-Maverick-17B-128E-Instruct', 'LLaVA-1.5-7B-Chat', 'LLaVA-1.5-13B-Chat', 'LLaVA-NeXT-7B-Chat', 'LLaVA-NeXT-13B-Chat', 'LLaVA-NeXT-Mistral-7B-Chat', 'LLaVA-NeXT-Llama3-8B-Chat', 'LLaVA-NeXT-34B-Chat', 'LLaVA-NeXT-72B-Chat', 'LLaVA-NeXT-110B-Chat', 'LLaVA-NeXT-Video-7B-Chat', 'LLaVA-NeXT-Video-7B-DPO-Chat', 'LLaVA-NeXT-Video-7B-32k-Chat', 'LLaVA-NeXT-Video-34B-Chat', 'LLaVA-NeXT-Video-34B-DPO-Chat', 'Marco-o1-Chat', 'MiMo-7B-Base', 'MiMo-7B-Instruct', 'MiMo-7B-Instruct-RL', 'MiMo-7B-RL-ZERO', 'MiMo-7B-VL-Instruct', 'MiMo-7B-VL-RL', 'MiniCPM-2B-SFT-Chat', 'MiniCPM-2B-DPO-Chat', 'MiniCPM3-4B-Chat', 'MiniCPM4-0.5B-Chat', 'MiniCPM4-8B-Chat', 'MiniCPM-o-2_6', 'MiniCPM-V-2_6', 'Ministral-8B-Instruct-2410', 'Mistral-Nemo-Base-2407', 'Mistral-Nemo-Instruct-2407', 'Mistral-7B-v0.1', 'Mistral-7B-v0.2', 'Mistral-7B-v0.3', 'Mistral-7B-Instruct-v0.1', 'Mistral-7B-Instruct-v0.2', 'Mistral-7B-Instruct-v0.3', 'Mistral-Small-24B-Base-2501', 'Mistral-Small-24B-Instruct-2501', 'Mistral-Small-3.1-24B-Base', 'Mistral-Small-3.1-24B-Instruct', 'Mistral-Small-3.2-24B-Instruct', 'Mixtral-8x7B-v0.1', 'Mixtral-8x22B-v0.1', 'Mixtral-8x7B-v0.1-Instruct', 'Mixtral-8x22B-v0.1-Instruct', 'Moonlight-16B-A3B', 'Moonlight-16B-A3B-Instruct', 'OLMo-1B', 'OLMo-7B', 'OLMo-7B-Chat', 'OLMo-1.7-7B', 'OpenChat3.5-7B-Chat', 'OpenChat3.6-8B-Chat', 'OpenCoder-1.5B-Base', 'OpenCoder-8B-Base', 'OpenCoder-1.5B-Instruct', 'OpenCoder-8B-Instruct', 'Orion-14B-Base', 'Orion-14B-Chat', 'Orion-14B-Long-Chat', 'Orion-14B-RAG-Chat', 'Orion-14B-Plugin-Chat', 'PaliGemma-3B-pt-224', 'PaliGemma-3B-pt-448', 'PaliGemma-3B-pt-896', 'PaliGemma-3B-mix-224', 'PaliGemma-3B-mix-448', 'PaliGemma2-3B-pt-224', 'PaliGemma2-3B-pt-448', 'PaliGemma2-3B-pt-896', 'PaliGemma2-10B-pt-224', 'PaliGemma2-10B-pt-448', 'PaliGemma2-10B-pt-896', 'PaliGemma2-28B-pt-224', 'PaliGemma2-28B-pt-448', 'PaliGemma2-28B-pt-896', 'PaliGemma2-3B-mix-224', 'PaliGemma2-3B-mix-448', 'PaliGemma2-10B-mix-224', 'PaliGemma2-10B-mix-448', 'PaliGemma2-28B-mix-224', 'PaliGemma2-28B-mix-448', 'Phi-1.5-1.3B', 'Phi-2-2.7B', 'Phi-3-4B-4k-Instruct', 'Phi-3-4B-128k-Instruct', 'Phi-3-14B-8k-Instruct', 'Phi-3-14B-128k-Instruct', 'Phi-3.5-4B-instruct', 'Phi-3.5-MoE-42B-A6.6B-instruct', 'Phi-3-7B-8k-Instruct', 'Phi-3-7B-128k-Instruct', 'Phi-4-14B-Instruct', 'Pixtral-12B', 'Qwen-1.8B', 'Qwen-7B', 'Qwen-14B', 'Qwen-72B', 'Qwen-1.8B-Chat', 'Qwen-7B-Chat', 'Qwen-14B-Chat', 'Qwen-72B-Chat', 'Qwen-1.8B-Chat-Int8', 'Qwen-1.8B-Chat-Int4', 'Qwen-7B-Chat-Int8', 'Qwen-7B-Chat-Int4', 'Qwen-14B-Chat-Int8', 'Qwen-14B-Chat-Int4', 'Qwen-72B-Chat-Int8', 'Qwen-72B-Chat-Int4', 'Qwen1.5-0.5B', 'Qwen1.5-1.8B', 'Qwen1.5-4B', 'Qwen1.5-7B', 'Qwen1.5-14B', 'Qwen1.5-32B', 'Qwen1.5-72B', 'Qwen1.5-110B', 'Qwen1.5-MoE-A2.7B', 'Qwen1.5-0.5B-Chat', 'Qwen1.5-1.8B-Chat', 'Qwen1.5-4B-Chat', 'Qwen1.5-7B-Chat', 'Qwen1.5-14B-Chat', 'Qwen1.5-32B-Chat', 'Qwen1.5-72B-Chat', 'Qwen1.5-110B-Chat', 'Qwen1.5-MoE-A2.7B-Chat', 'Qwen1.5-0.5B-Chat-GPTQ-Int8', 'Qwen1.5-0.5B-Chat-AWQ', 'Qwen1.5-1.8B-Chat-GPTQ-Int8', 'Qwen1.5-1.8B-Chat-AWQ', 'Qwen1.5-4B-Chat-GPTQ-Int8', 'Qwen1.5-4B-Chat-AWQ', 'Qwen1.5-7B-Chat-GPTQ-Int8', 'Qwen1.5-7B-Chat-AWQ', 'Qwen1.5-14B-Chat-GPTQ-Int8', 'Qwen1.5-14B-Chat-AWQ', 'Qwen1.5-32B-Chat-AWQ', 'Qwen1.5-72B-Chat-GPTQ-Int8', 'Qwen1.5-72B-Chat-AWQ', 'Qwen1.5-110B-Chat-AWQ', 'Qwen1.5-MoE-A2.7B-Chat-GPTQ-Int4', 'CodeQwen1.5-7B', 'CodeQwen1.5-7B-Chat', 'CodeQwen1.5-7B-Chat-AWQ', 'Qwen2-0.5B', 'Qwen2-1.5B', 'Qwen2-7B', 'Qwen2-72B', 'Qwen2-MoE-57B-A14B', 'Qwen2-0.5B-Instruct', 'Qwen2-1.5B-Instruct', 'Qwen2-7B-Instruct', 'Qwen2-72B-Instruct', 'Qwen2-MoE-57B-A14B-Instruct', 'Qwen2-0.5B-Instruct-GPTQ-Int8', 'Qwen2-0.5B-Instruct-GPTQ-Int4', 'Qwen2-0.5B-Instruct-AWQ', 'Qwen2-1.5B-Instruct-GPTQ-Int8', 'Qwen2-1.5B-Instruct-GPTQ-Int4', 'Qwen2-1.5B-Instruct-AWQ', 'Qwen2-7B-Instruct-GPTQ-Int8', 'Qwen2-7B-Instruct-GPTQ-Int4', 'Qwen2-7B-Instruct-AWQ', 'Qwen2-72B-Instruct-GPTQ-Int8', 'Qwen2-72B-Instruct-GPTQ-Int4', 'Qwen2-72B-Instruct-AWQ', 'Qwen2-57B-A14B-Instruct-GPTQ-Int4', 'Qwen2-Math-1.5B', 'Qwen2-Math-7B', 'Qwen2-Math-72B', 'Qwen2-Math-1.5B-Instruct', 'Qwen2-Math-7B-Instruct', 'Qwen2-Math-72B-Instruct', 'Qwen2.5-0.5B', 'Qwen2.5-1.5B', 'Qwen2.5-3B', 'Qwen2.5-7B', 'Qwen2.5-14B', 'Qwen2.5-32B', 'Qwen2.5-72B', 'Qwen2.5-0.5B-Instruct', 'Qwen2.5-1.5B-Instruct', 'Qwen2.5-3B-Instruct', 'Qwen2.5-7B-Instruct', 'Qwen2.5-14B-Instruct', 'Qwen2.5-32B-Instruct', 'Qwen2.5-72B-Instruct', 'Qwen2.5-7B-Instruct-1M', 'Qwen2.5-14B-Instruct-1M', 'Qwen2.5-0.5B-Instruct-GPTQ-Int8', 'Qwen2.5-0.5B-Instruct-GPTQ-Int4', 'Qwen2.5-0.5B-Instruct-AWQ', 'Qwen2.5-1.5B-Instruct-GPTQ-Int8', 'Qwen2.5-1.5B-Instruct-GPTQ-Int4', 'Qwen2.5-1.5B-Instruct-AWQ', 'Qwen2.5-3B-Instruct-GPTQ-Int8', 'Qwen2.5-3B-Instruct-GPTQ-Int4', 'Qwen2.5-3B-Instruct-AWQ', 'Qwen2.5-7B-Instruct-GPTQ-Int8', 'Qwen2.5-7B-Instruct-GPTQ-Int4', 'Qwen2.5-7B-Instruct-AWQ', 'Qwen2.5-14B-Instruct-GPTQ-Int8', 'Qwen2.5-14B-Instruct-GPTQ-Int4', 'Qwen2.5-14B-Instruct-AWQ', 'Qwen2.5-32B-Instruct-GPTQ-Int8', 'Qwen2.5-32B-Instruct-GPTQ-Int4', 'Qwen2.5-32B-Instruct-AWQ', 'Qwen2.5-72B-Instruct-GPTQ-Int8', 'Qwen2.5-72B-Instruct-GPTQ-Int4', 'Qwen2.5-72B-Instruct-AWQ', 'Qwen2.5-Coder-0.5B', 'Qwen2.5-Coder-1.5B', 'Qwen2.5-Coder-3B', 'Qwen2.5-Coder-7B', 'Qwen2.5-Coder-14B', 'Qwen2.5-Coder-32B', 'Qwen2.5-Coder-0.5B-Instruct', 'Qwen2.5-Coder-1.5B-Instruct', 'Qwen2.5-Coder-3B-Instruct', 'Qwen2.5-Coder-7B-Instruct', 'Qwen2.5-Coder-14B-Instruct', 'Qwen2.5-Coder-32B-Instruct', 'Qwen2.5-Math-1.5B', 'Qwen2.5-Math-7B', 'Qwen2.5-Math-72B', 'Qwen2.5-Math-1.5B-Instruct', 'Qwen2.5-Math-7B-Instruct', 'Qwen2.5-Math-72B-Instruct', 'QwQ-32B-Preview-Instruct', 'QwQ-32B-Instruct', 'Qwen3-0.6B-Base', 'Qwen3-1.7B-Base', 'Qwen3-4B-Base', 'Qwen3-8B-Base', 'Qwen3-14B-Base', 'Qwen3-30B-A3B-Base', 'Qwen3-0.6B-Instruct', 'Qwen3-1.7B-Instruct', 'Qwen3-4B-Instruct', 'Qwen3-8B-Instruct', 'Qwen3-14B-Instruct', 'Qwen3-32B-Instruct', 'Qwen3-30B-A3B-Instruct', 'Qwen3-235B-A22B-Instruct', 'Qwen3-0.6B-Instruct-GPTQ-Int8', 'Qwen3-1.7B-Instruct-GPTQ-Int8', 'Qwen3-4B-Instruct-AWQ', 'Qwen3-8B-Instruct-AWQ', 'Qwen3-14B-Instruct-AWQ', 'Qwen3-32B-Instruct-AWQ', 'Qwen3-30B-A3B-Instruct-GPTQ-Int4', 'Qwen3-235B-A22B-Instruct-GPTQ-Int4', 'Qwen2-Audio-7B', 'Qwen2-Audio-7B-Instruct', 'Qwen2.5-Omni-3B', 'Qwen2.5-Omni-7B', 'Qwen2.5-Omni-7B-GPTQ-Int4', 'Qwen2.5-Omni-7B-AWQ', 'Qwen2-VL-2B', 'Qwen2-VL-7B', 'Qwen2-VL-72B', 'Qwen2-VL-2B-Instruct', 'Qwen2-VL-7B-Instruct', 'Qwen2-VL-72B-Instruct', 'Qwen2-VL-2B-Instruct-GPTQ-Int8', 'Qwen2-VL-2B-Instruct-GPTQ-Int4', 'Qwen2-VL-2B-Instruct-AWQ', 'Qwen2-VL-7B-Instruct-GPTQ-Int8', 'Qwen2-VL-7B-Instruct-GPTQ-Int4', 'Qwen2-VL-7B-Instruct-AWQ', 'Qwen2-VL-72B-Instruct-GPTQ-Int8', 'Qwen2-VL-72B-Instruct-GPTQ-Int4', 'Qwen2-VL-72B-Instruct-AWQ', 'QVQ-72B-Preview', 'Qwen2.5-VL-3B-Instruct', 'Qwen2.5-VL-7B-Instruct', 'Qwen2.5-VL-32B-Instruct', 'Qwen2.5-VL-72B-Instruct', 'Qwen2.5-VL-3B-Instruct-AWQ', 'Qwen2.5-VL-7B-Instruct-AWQ', 'Qwen2.5-VL-72B-Instruct-AWQ', 'Seed-Coder-8B-Base', 'Seed-Coder-8B-Instruct', 'Seed-Coder-8B-Instruct-Reasoning', 'Skywork-13B-Base', 'Skywork-o1-Open-Llama-3.1-8B', 'SmolLM-135M', 'SmolLM-360M', 'SmolLM-1.7B', 'SmolLM-135M-Instruct', 'SmolLM-360M-Instruct', 'SmolLM-1.7B-Instruct', 'SmolLM2-135M', 'SmolLM2-360M', 'SmolLM2-1.7B', 'SmolLM2-135M-Instruct', 'SmolLM2-360M-Instruct', 'SmolLM2-1.7B-Instruct', 'SOLAR-10.7B-v1.0', 'SOLAR-10.7B-Instruct-v1.0', 'StarCoder2-3B', 'StarCoder2-7B', 'StarCoder2-15B', 'TeleChat-1B-Chat', 'TeleChat-7B-Chat', 'TeleChat-12B-Chat', 'TeleChat-52B-Chat', 'TeleChat2-3B-Chat', 'TeleChat2-7B-Chat', 'TeleChat2-35B-Chat', 'TeleChat2-115B-Chat', 'Vicuna-v1.5-7B-Chat', 'Vicuna-v1.5-13B-Chat', 'Video-LLaVA-7B-Chat', 'XuanYuan-6B', 'XuanYuan-70B', 'XuanYuan2-70B', 'XuanYuan-6B-Chat', 'XuanYuan-70B-Chat', 'XuanYuan2-70B-Chat', 'XuanYuan-6B-Chat-8bit', 'XuanYuan-6B-Chat-4bit', 'XuanYuan-70B-Chat-8bit', 'XuanYuan-70B-Chat-4bit', 'XuanYuan2-70B-Chat-8bit', 'XuanYuan2-70B-Chat-4bit', 'XVERSE-7B', 'XVERSE-13B', 'XVERSE-65B', 'XVERSE-65B-2', 'XVERSE-7B-Chat', 'XVERSE-13B-Chat', 'XVERSE-65B-Chat', 'XVERSE-MoE-A4.2B', 'XVERSE-7B-Chat-GPTQ-Int8', 'XVERSE-7B-Chat-GPTQ-Int4', 'XVERSE-13B-Chat-GPTQ-Int8', 'XVERSE-13B-Chat-GPTQ-Int4', 'XVERSE-65B-Chat-GPTQ-Int4', 'Yayi-7B', 'Yayi-13B', 'Yi-6B', 'Yi-9B', 'Yi-34B', 'Yi-6B-Chat', 'Yi-34B-Chat', 'Yi-6B-Chat-8bits', 'Yi-6B-Chat-4bits', 'Yi-34B-Chat-8bits', 'Yi-34B-Chat-4bits', 'Yi-1.5-6B', 'Yi-1.5-9B', 'Yi-1.5-34B', 'Yi-1.5-6B-Chat', 'Yi-1.5-9B-Chat', 'Yi-1.5-34B-Chat', 'Yi-Coder-1.5B', 'Yi-Coder-9B', 'Yi-Coder-1.5B-Chat', 'Yi-Coder-9B-Chat', 'Yi-VL-6B-Chat', 'Yi-VL-34B-Chat', 'Yuan2-2B-Chat', 'Yuan2-51B-Chat', 'Yuan2-102B-Chat', 'Zephyr-7B-Alpha-Chat', 'Zephyr-7B-Beta-Chat', 'Zephyr-141B-ORPO-Chat', 'Custom'] Required The input value that is provided in the "parameter_5" Dropdown component.
最新发布
07-17
<think>我们被要求解释一个API端点的使用说明,并提供一个代码示例。根据用户提供的内容,这是一个名为`/get_model_info`的API端点,它接受一个参数`model_name`,该参数是一个枚举类型,从给定的长列表中选择一个模型名称。 解释: 1. API路径:`/get_model_info` 2. 参数:`model_name`,类型为字面量(Literal),即只能从列出的模型名称中选择一个(包括'Custom'表示自定义模型) 3. 使用示例:使用`gradio_client`库调用该API,传入选定的模型名称,然后打印返回结果。 代码示例已经给出,但我们可以用中文解释一下: 示例代码: ```python from gradio_client import Client # 创建客户端,连接到Gradio应用(假设应用运行在本地7860端口) client = Client("http://localhost:7860/") # 调用API,传入模型名称(例如"Aya-23-8B-Chat")并指定API路径 result = client.predict( model_name="Aya-23-8B-Chat", api_name="/get_model_info" ) # 打印结果 print(result) ``` 注意:参数`model_name`必须严格匹配给定的选项之一(注意大小写连字符等)。 此外,文档中提到还可以使用“API Recorder”来自动生成API请求,但这里没有提供具体细节,所以我们只关注代码示例。 现在,根据要求,在回答后提出3-5个相关问题。</think>### 解释:`/get_model_info` API 端点 该 API 用于获取指定大语言模型(LLM)的详细信息,通过 Gradio 客户端实现远程调用。以下是关键要素解析: 1. **功能说明** - 输入模型名称 → 返回该模型的完整配置信息 - 支持查询 200+ 主流大模型(包括 Qwen、Llama、Gemma 等系列) - 可获取模型架构、参数量、适用场景等元数据 2. **参数说明** ```python model_name: Literal['Aya-23-8B-Chat', ... , 'Custom'] # 必填参数 ``` - 限定值:必须从预定义的模型列表中选择(含 200+ 选项) - `Custom` 选项支持查询自定义模型 3. **调用示例** ```python from gradio_client import Client client = Client("http://localhost:7860/") # 连接本地服务 result = client.predict( model_name="Qwen2-7B-Instruct", # 指定查询模型 api_name="/get_model_info" # 调用此API ) print(result) # 输出模型详细信息 ``` 4. **返回值示例** 可能包含的模型信息维度: ```python { "architecture": "Transformer", "params": "7B", "context_window": 128000, "supported_tasks": ["chat", "code_generation"], "quantization": ["AWQ", "GPTQ-Int4"], "release_date": "2024-05-15" } ``` 5. **特殊说明** - 需确保 Gradio 服务在 `localhost:7860` 运行 - 模型名称严格区分大小写连字符格式 - `Custom` 选项需服务端预配置自定义模型信息
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Aitrainee

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值