Skip to content

Commit c18e96c

Browse files
committed
"use_cache: false" for all requests
1 parent c6262f2 commit c18e96c

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

src/lib/components/InferencePlayground/inferencePlaygroundUtils.ts

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export async function handleStreamingResponse(
2626
temperature: conversation.config.temperature,
2727
max_tokens: conversation.config.maxTokens,
2828
},
29-
{ signal: abortController.signal }
29+
{ signal: abortController.signal, use_cache: false }
3030
)) {
3131
if (chunk.choices && chunk.choices.length > 0 && chunk.choices[0]?.delta?.content) {
3232
out += chunk.choices[0].delta.content;
@@ -45,12 +45,15 @@ export async function handleNonStreamingResponse(
4545
...conversation.messages,
4646
];
4747

48-
const response = await hf.chatCompletion({
49-
model: model.id,
50-
messages,
51-
temperature: conversation.config.temperature,
52-
max_tokens: conversation.config.maxTokens,
53-
});
48+
const response = await hf.chatCompletion(
49+
{
50+
model: model.id,
51+
messages,
52+
temperature: conversation.config.temperature,
53+
max_tokens: conversation.config.maxTokens,
54+
},
55+
{ use_cache: false }
56+
);
5457

5558
if (response.choices && response.choices.length > 0) {
5659
const { message } = response.choices[0];

0 commit comments

Comments
 (0)