惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
SegmentFault 最新的问题
爱范儿
爱范儿
博客园 - 三生石上(FineUI控件)
Microsoft Security Blog
Microsoft Security Blog
Google DeepMind News
Google DeepMind News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
GbyAI
GbyAI
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
V
V2EX
酷 壳 – CoolShell
酷 壳 – CoolShell
量子位
博客园_首页
T
Tailwind CSS Blog
aimingoo的专栏
aimingoo的专栏
A
About on SuperTechFans
T
The Blog of Author Tim Ferriss
Stack Overflow Blog
Stack Overflow Blog
Recent Announcements
Recent Announcements
P
Proofpoint News Feed
博客园 - 司徒正美
有赞技术团队
有赞技术团队
Engineering at Meta
Engineering at Meta
Last Week in AI
Last Week in AI
MongoDB | Blog
MongoDB | Blog

Replicate's blog

How to make remarkable videos with Seedance 2.0 – Replicate blog How to prompt Seedream 5.0 – Replicate blog Recraft V4: image generation with design taste – Replicate blog Run Isaac 0.1 on Replicate – Replicate blog Run FLUX.2 on Replicate – Replicate blog How to prompt Nano Banana Pro – Replicate blog Retro Diffusion's pixel art models are now on Replicate – Replicate blog Replicate is joining Cloudflare – Replicate blog Extract text from documents and images with Datalab Marker and OCR – Replicate blog How to prompt Veo 3.1 – Replicate blog IBM's Granite 4.0 is now on Replicate – Replicate blog Which image editing model should I use? – Replicate blog Introducing our new search API – Replicate blog Torch compile caching for inference speed – Replicate blog Announcing Replicate's remote MCP server – Replicate blog How to prompt Veo 3 with images – Replicate blog Open source video is back – Replicate blog Generate consistent characters – Replicate blog Bria is now on Replicate – Replicate blog How we optimized FLUX.1 Kontext [dev] – Replicate blog Compare AI video models – Replicate blog The FLUX.1 Kontext hackathon – Replicate blog How to prompt Veo 3 for the best results – Replicate blog Get the most from Google Veo 3 – Replicate blog FLUX.1 Kontext from the community – Replicate blog Use FLUX.1 Kontext to edit images with words – Replicate blog Generate incredible images with Google's Imagen 4 – Replicate blog Run OpenAI’s latest models on Replicate – Replicate blog NVIDIA H100 GPUs are here – Replicate blog Run 30,000+ LoRAs on Hugging Face with Replicate – Replicate blog
Train and run Stanford Alpaca on your own machine – Repli...
2023-03-16 · via Replicate's blog

LLaMA is a new open-source language model from Meta Research that performs as well as closed-source models. Similar to Stable Diffusion, there’s been a ton of experimentation and innovation since the model was publicly released. As Simon Willison articulated, LLaMA is easy to run on your own hardware, large enough to be useful, and open-source enough to be tinkered with.

LLaMA is powerful, but it was not built for answering questions. It functions more like a fancy version of autocomplete than a conversational bot. This is where Stanford’s Alpaca comes in. Alpaca is a fine-tuned version of LLaMA that can respond to instructions like ChatGPT. And, like LLaMA, it’s open-source.

The problem is, the weights for Alpaca have not been released, so you can’t tinker with it. We do have all the component parts we need to replicate it though: the LLaMA weights, the training data, and the training script.

In this post we’ll show you how to train Alpaca so you can tinker with it on your own machine.

Note: LLaMA and anything built on LLaMA is for research purposes only. You can’t build anything commercial with it.

Prerequisites

  • LLaMA weights. They are only available for research use. To apply for access, fill out this Meta Research form.
  • GPU machine. You’ll need a Linux machine with one or more 80GB A100 GPUs. It’ll be faster if you get a machine with more GPUs – we used four. We’ve had success with Google Cloud. You can follow our instructions here.

Step 1: Clone the Alpaca repository

We’ve created a fork of the Alpaca repository that adds a Cog file that’ll set up all the dependencies for you.

Log into your GPU instance via SSH. Clone the repository by running:

Step 2: Convert the LLaMA weights

The LLaMA weights are currently only available for research use. To apply for access, fill out this Meta Research form.

Put your downloaded weights in a folder called unconverted-weights. The folder hierarchy should look something like this:

Convert the weights from a PyTorch checkpoint to a transformers-compatible format using this command:

You final directory structure should look like this:

Step 3: Train the model

Kick off the training:

This will take about an hour and a half on four A100s, so you might want to go and do some programming while your model is programming itself.

Step 4: Run the model

When that’s finished, you can run Alpaca:

Alpaca

Next steps

Here are some ideas for what you could do next:

  • Fine-tune the model or constrain the decoder to create a model for a particular task.
  • Experiment with different interfaces for interacting with the model. Where could you talk to it?
  • Push the model to Replicate to run it in the cloud. This is handy if you want an API to build interfaces, or to run large-scale evaluation in parallel. You’ll need to keep it private so the weights aren’t public.

Just remember that you can only use Alpaca for non-commercial research. Eventually, we expect models like this will be released with more permissive licenses that will allow them to be used for all sorts of things — chat bots, coding assistants, and so on.

Open-source language models are just getting started, and we can’t wait to see what you build.

We’re going to be posting more guides to hacking on open-source language models. Follow us on Twitter to follow along.