mirror of
https://github.com/supermemoryai/supermemory.git
synced 2026-09-12 23:01:07 +00:00
CloudflareAI for better streaming
This commit is contained in:
parent
ad422c6b66
commit
f0b2412a8b
2 changed files with 6 additions and 2 deletions
|
|
@ -139,7 +139,8 @@ export async function POST(request: Request, _: CloudflareVectorizeStore, embedd
|
|||
// );
|
||||
// return response;
|
||||
const ai = new Ai(env?.AI);
|
||||
const output: AiTextGenerationOutput = (await ai.run('@hf/thebloke/mistral-7b-instruct-v0.1-awq', {
|
||||
// @ts-ignore
|
||||
const output: AiTextGenerationOutput = (await ai.run('@hf/mistralai/mistral-7b-instruct-v0.2', {
|
||||
prompt,
|
||||
stream: true,
|
||||
})) as ReadableStream;
|
||||
|
|
|
|||
|
|
@ -374,7 +374,10 @@ export function Chat({
|
|||
loading={i === chatHistory.length - 1 ? isLoading : false}
|
||||
sources={msg.answer.sources}
|
||||
>
|
||||
{msg.answer.parts.map((part) => part.text).join(" ")}
|
||||
{msg.answer.parts
|
||||
.map((part) => part.text)
|
||||
.join("")
|
||||
.replace("</s>", "")}
|
||||
</ChatAnswer>
|
||||
</ChatMessage>
|
||||
))}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue