Skip to content

Commit e302a1b

Browse files
authored
[vLLM Snippet] update (#942)
Follow up to #693 1. Add missing comma 2. Add line splitter between two commands <img width="600" alt="Screenshot 2024-10-04 at 14 52 09" src="https://github.com/user-attachments/assets/99a30553-4081-47fe-b89b-ca0c2a7d9fca">
1 parent a22a62a commit e302a1b

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

packages/tasks/src/local-apps.ts

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export interface LocalAppSnippet {
1313
/**
1414
* Content (or command) to be run
1515
*/
16-
content: string;
16+
content: string | string[];
1717
}
1818

1919
/**
@@ -149,7 +149,7 @@ const snippetVllm = (model: ModelData): LocalAppSnippet[] => {
149149
`curl -X POST "http://localhost:8000/v1/chat/completions" \\ `,
150150
` -H "Content-Type: application/json" \\ `,
151151
` --data '{`,
152-
` "model": "${model.id}"`,
152+
` "model": "${model.id}",`,
153153
` "messages": [`,
154154
` {"role": "user", "content": "Hello!"}`,
155155
` ]`,
@@ -159,7 +159,7 @@ const snippetVllm = (model: ModelData): LocalAppSnippet[] => {
159159
{
160160
title: "Install from pip",
161161
setup: ["# Install vLLM from pip:", "pip install vllm"].join("\n"),
162-
content: ["# Load and run the model:", `vllm serve "${model.id}"`, ...runCommand].join("\n"),
162+
content: [`# Load and run the model:\nvllm serve "${model.id}"`, runCommand.join("\n")],
163163
},
164164
{
165165
title: "Use Docker images",
@@ -175,10 +175,9 @@ const snippetVllm = (model: ModelData): LocalAppSnippet[] => {
175175
` --model ${model.id}`,
176176
].join("\n"),
177177
content: [
178-
"# Load and run the model:",
179-
`docker exec -it my_vllm_container bash -c "vllm serve ${model.id}"`,
180-
...runCommand,
181-
].join("\n"),
178+
`# Load and run the model:\ndocker exec -it my_vllm_container bash -c "vllm serve ${model.id}"`,
179+
runCommand.join("\n"),
180+
],
182181
},
183182
];
184183
};

0 commit comments

Comments
 (0)