From 5446659a78434eec0335f8f8086f0e1892a0a168 Mon Sep 17 00:00:00 2001 From: Mishig Davaadorj Date: Fri, 4 Oct 2024 14:51:33 +0200 Subject: [PATCH] [vLLM Snippet] update --- packages/tasks/src/local-apps.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/tasks/src/local-apps.ts b/packages/tasks/src/local-apps.ts index 7256953e3d..13158b1f7d 100644 --- a/packages/tasks/src/local-apps.ts +++ b/packages/tasks/src/local-apps.ts @@ -13,7 +13,7 @@ export interface LocalAppSnippet { /** * Content (or command) to be run */ - content: string; + content: string | string[]; } /** @@ -149,7 +149,7 @@ const snippetVllm = (model: ModelData): LocalAppSnippet[] => { `curl -X POST "http://localhost:8000/v1/chat/completions" \\ `, ` -H "Content-Type: application/json" \\ `, ` --data '{`, - ` "model": "${model.id}"`, + ` "model": "${model.id}",`, ` "messages": [`, ` {"role": "user", "content": "Hello!"}`, ` ]`, @@ -159,7 +159,7 @@ const snippetVllm = (model: ModelData): LocalAppSnippet[] => { { title: "Install from pip", setup: ["# Install vLLM from pip:", "pip install vllm"].join("\n"), - content: ["# Load and run the model:", `vllm serve "${model.id}"`, ...runCommand].join("\n"), + content: [`# Load and run the model:\nvllm serve "${model.id}"`, runCommand.join("\n")], }, { title: "Use Docker images", @@ -175,10 +175,9 @@ const snippetVllm = (model: ModelData): LocalAppSnippet[] => { ` --model ${model.id}`, ].join("\n"), content: [ - "# Load and run the model:", - `docker exec -it my_vllm_container bash -c "vllm serve ${model.id}"`, - ...runCommand, - ].join("\n"), + `# Load and run the model:\ndocker exec -it my_vllm_container bash -c "vllm serve ${model.id}"`, + runCommand.join("\n"), + ], }, ]; };