Skip to content

Commit ddd4489

Browse files
committed
fix: strip <human in RedPajama responses
1 parent 88e51a2 commit ddd4489

File tree

3 files changed

+10
-52
lines changed

3 files changed

+10
-52
lines changed

app/client/webllm.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import {
1616

1717
import { ChatOptions, LLMApi, LLMConfig, RequestMessage } from "./api";
1818
import { LogLevel } from "@mlc-ai/web-llm";
19+
import { fixMessage } from "../utils";
1920

2021
const KEEP_ALIVE_INTERVAL = 5_000;
2122

@@ -144,6 +145,7 @@ export class WebLLMApi implements LLMApi {
144145
}
145146

146147
if (reply) {
148+
reply = fixMessage(reply);
147149
options.onFinish(reply, stopReason, usage);
148150
} else {
149151
options.onError?.(new Error("Empty response generated by LLM"));

0 commit comments

Comments
 (0)