Skip to content

Commit

Permalink
Merge pull request #1261 from ThorstenHans/fix/serverless-ai-model-lo…
Browse files Browse the repository at this point in the history
…cation

Update docs and tutorials to place `llama2-chat` and `codellama-instruct` in the correct directory
  • Loading branch information
Timothy McCallum authored Apr 26, 2024
2 parents cc7bc34 + d1dee03 commit bf154ce
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 16 deletions.
14 changes: 8 additions & 6 deletions content/spin/v1/ai-sentiment-analysis-api-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ Next, we need to create the appropriate folder structure from within the applica

```bash
# llama2-chat
$ mkdir -p .spin/ai-models
$ cd .spin/ai-models
$ mkdir -p .spin/ai-models/llama
$ cd .spin/ai-models/llama
$ wget https://huggingface.co/TheBloke/Llama-2-13B-chat-GGML/resolve/a17885f653039bd07ed0f8ff4ecc373abf5425fd/llama-2-13b-chat.ggmlv3.q3_K_L.bin
$ mv llama-2-13b-chat.ggmlv3.q3_K_L.bin llama2-chat
```
Expand All @@ -174,7 +174,8 @@ $ mv llama-2-13b-chat.ggmlv3.q3_K_L.bin llama2-chat
tree .spin
.spin
└── ai-models
└── llama2-chat
└── llama
└── llama2-chat
```

**codellama-instruct example download**
Expand All @@ -185,8 +186,8 @@ tree .spin

```bash
# codellama-instruct
$ mkdir -p .spin/ai-models
$ cd .spin/ai-models
$ mkdir -p .spin/ai-models/llama
$ cd .spin/ai-models/llama
$ wget https://huggingface.co/TheBloke/CodeLlama-13B-Instruct-GGML/resolve/b3dc9d8df8b4143ee18407169f09bc12c0ae09ef/codellama-13b-instruct.ggmlv3.Q3_K_L.bin
$ mv codellama-13b-instruct.ggmlv3.Q3_K_L.bin codellama-instruct
```
Expand All @@ -197,7 +198,8 @@ $ mv codellama-13b-instruct.ggmlv3.Q3_K_L.bin codellama-instruct
tree .spin
.spin
└── ai-models
└── codellama-instruct
└── llama
└── codellama-instruct
```

**all-minilm-l6-v2 example download**
Expand Down
2 changes: 1 addition & 1 deletion content/spin/v1/serverless-ai-api-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ ai_models = ["codellama-instruct"]
By default, the Spin framework will expect any already trained model files (which are configured as per the previous section) to be downloaded by the user and made available inside a `.spin/ai-models/` file path of a given application. For example:

```bash
code-generator-rs/.spin/ai-models/codellama-instruct
code-generator-rs/.spin/ai-models/llama/codellama-instruct
```

See the [serverless AI Tutorial](./ai-sentiment-analysis-api-tutorial) documentation for more concrete examples of implementing the Fermyon Serverless AI API, in your favorite language.
Expand Down
2 changes: 1 addition & 1 deletion content/spin/v1/serverless-ai-hello-world.md
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ Available Routes:
hello-world: https://hello-world-XXXXXX.fermyon.app (wildcard)
```

The app’s manifest file reads the line `ai-models = ["llama2-chat"]` and uses that model in the cloud. For any changes to take effect in the app, it needs to be re-deployed to the cloud.
The app’s manifest file reads the line `ai_models = ["llama2-chat"]` and uses that model in the cloud. For any changes to take effect in the app, it needs to be re-deployed to the cloud.

**Using the Cloud-GPU plugin to test locally**

Expand Down
14 changes: 8 additions & 6 deletions content/spin/v2/ai-sentiment-analysis-api-tutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,8 @@ Next, we need to create the appropriate folder structure from within the applica

```bash
# llama2-chat
$ mkdir -p .spin/ai-models
$ cd .spin/ai-models
$ mkdir -p .spin/ai-models/llama
$ cd .spin/ai-models/llama
$ wget https://huggingface.co/TheBloke/Llama-2-13B-chat-GGML/resolve/a17885f653039bd07ed0f8ff4ecc373abf5425fd/llama-2-13b-chat.ggmlv3.q3_K_L.bin
$ mv llama-2-13b-chat.ggmlv3.q3_K_L.bin llama2-chat
```
Expand All @@ -195,7 +195,8 @@ $ mv llama-2-13b-chat.ggmlv3.q3_K_L.bin llama2-chat
tree .spin
.spin
└── ai-models
└── llama2-chat
└── llama
└── llama2-chat
```

**codellama-instruct example download**
Expand All @@ -206,8 +207,8 @@ tree .spin

```bash
# codellama-instruct
$ mkdir -p .spin/ai-models
$ cd .spin/ai-models
$ mkdir -p .spin/ai-models/llama
$ cd .spin/ai-models/llama
$ wget https://huggingface.co/TheBloke/CodeLlama-13B-Instruct-GGML/resolve/b3dc9d8df8b4143ee18407169f09bc12c0ae09ef/codellama-13b-instruct.ggmlv3.Q3_K_L.bin
$ mv codellama-13b-instruct.ggmlv3.Q3_K_L.bin codellama-instruct
```
Expand All @@ -218,7 +219,8 @@ $ mv codellama-13b-instruct.ggmlv3.Q3_K_L.bin codellama-instruct
tree .spin
.spin
└── ai-models
└── codellama-instruct
└── llama
└── codellama-instruct
```

**all-minilm-l6-v2 example download**
Expand Down
2 changes: 1 addition & 1 deletion content/spin/v2/serverless-ai-api-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ai_models = ["codellama-instruct"]
By default, the Spin framework will expect any already trained model files (which are configured as per the previous section) to be downloaded by the user and made available inside a `.spin/ai-models/` file path of a given application. For example:

```bash
code-generator-rs/.spin/ai-models/codellama-instruct
code-generator-rs/.spin/ai-models/llama/codellama-instruct
```

See the [serverless AI Tutorial](./ai-sentiment-analysis-api-tutorial) documentation for more concrete examples of implementing the Fermyon Serverless AI API, in your favorite language.
Expand Down
2 changes: 1 addition & 1 deletion content/spin/v2/serverless-ai-hello-world.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ Available Routes:
hello-world: https://hello-world-XXXXXX.fermyon.app (wildcard)
```

The app’s manifest file reads the line `ai-models = ["llama2-chat"]` and uses that model in the cloud. For any changes to take effect in the app, it needs to be re-deployed to the cloud.
The app’s manifest file reads the line `ai_models = ["llama2-chat"]` and uses that model in the cloud. For any changes to take effect in the app, it needs to be re-deployed to the cloud.

**Using the Cloud-GPU plugin to test locally**

Expand Down

0 comments on commit bf154ce

Please sign in to comment.