使用 FastChat 运行 CodeLlama-7b-Instruct-hf

本文介绍了如何通过pip安装、启动和配置FastChat以使用CodeLlama-7b-Instruct-hf模型,以及在VSCode中的集成方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

1. 确认 FactChat 支持的 Model

访问 model_support.md,确认 codellama/CodeLlama-7b-Instruct-hf 在支持列表中,

在这里插入图片描述

2. 升级依赖

pip install -e ".[model_worker,webui]"
pip install git+https://github.com/huggingface/transformers.git@main accelerate

3. 启动 controller

python -m fastchat.serve.controller

4. 启动 CodeLlama

python -m fastchat.serve.model_worker --model-names "codellama-34b-instruct,gpt-3.5-turbo,gpt-3.5-turbo-16k,gpt-4,gpt-4-32k,text-davinci-003" --model-path codellama/CodeLlama-7b-Instruct-hf

5. 启动 api server

python -m fastchat.serve.openai_api_server --host 0.0.0.0 --port 8000

6. VSCode 中使用 CodeLlama

参考连接:

  • https://continue.dev/docs/walkthroughs/codellama
  • https://continue.dev/docs/customization#local-models-with-openai-compatible-server

配置 Continue 插件的 config 如下,

from continuedev.src.continuedev.libs.llm.openai import OpenAI
...
config = ContinueConfig(
    ...
    models=Models(default=OpenAI(
        api_key="EMPTY",
        model="CodeLlama-7b-Instruct-hf",
        api_base="http://localhost:8000/v1")
    ),

完结!

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值