您现在的位置是:首页 > 文章详情

FauxPilot —— GitHub Copilot 的替代品

日期:2022-10-08点击:1028

这是一个本地托管版本的 GitHub Copilot。它在英伟达的 Triton 推理服务器中使用了 SalesForce CodeGen 模型和 FasterTransformer 后端。

前提条件

  • Docker
  • docker-compose >= 1.28
  • 一台计算能力大于 7.0 的英伟达 GPU,以及足够的 VRAM 来运行你想要的模型
  • nvidia-docker
  • curl 和 zstd,用于下载和解包模型

Copilot 插件

你可以配置官方 VSCode Copilot 插件来使用你的本地服务器。只要编辑你的 settings.json 来添加。

 "github.copilot.advanced": { "debug.overrideEngine": "codegen", "debug.testOverrideProxyUrl": "http://localhost:5000", "debug.overrideProxyUrl": "http://localhost:5000" }

设置

运行设置脚本以选择要使用的模型。 这将从 Huggingface 下载模型,然后将其转换为与 FasterTransformer 一起使用。

 $ ./setup.sh Models available: [1] codegen-350M-mono (2GB total VRAM required; Python-only) [2] codegen-350M-multi (2GB total VRAM required; multi-language) [3] codegen-2B-mono (7GB total VRAM required; Python-only) [4] codegen-2B-multi (7GB total VRAM required; multi-language) [5] codegen-6B-mono (13GB total VRAM required; Python-only) [6] codegen-6B-multi (13GB total VRAM required; multi-language) [7] codegen-16B-mono (32GB total VRAM required; Python-only) [8] codegen-16B-multi (32GB total VRAM required; multi-language) Enter your choice [6]: 2 Enter number of GPUs [1]: 1 Where do you want to save the model [/home/moyix/git/fauxpilot/models]? /fastdata/mymodels Downloading and converting the model, this will take a while... Converting model codegen-350M-multi with 1 GPUs Loading CodeGen model Downloading config.json: 100%|██████████| 996/996 [00:00<00:00, 1.25MB/s] Downloading pytorch_model.bin: 100%|██████████| 760M/760M [00:11<00:00, 68.3MB/s] Creating empty GPTJ model Converting... Conversion complete. Saving model to codegen-350M-multi-hf... =============== Argument =============== saved_dir: /models/codegen-350M-multi-1gpu/fastertransformer/1 in_file: codegen-350M-multi-hf trained_gpu_num: 1 infer_gpu_num: 1 processes: 4 weight_data_type: fp32 ======================================== transformer.wte.weight transformer.h.0.ln_1.weight [... more conversion output trimmed ...] transformer.ln_f.weight transformer.ln_f.bias lm_head.weight lm_head.bias Done! Now run ./launch.sh to start the FauxPilot server. 

 

原文链接:https://www.oschina.net/p/fauxpilot
关注公众号

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。

持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。

转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。

文章评论

共有0条评论来说两句吧...

文章二维码

扫描即可查看该文章

点击排行

推荐阅读

最新文章