wip
Browse files
src/lib/components/InferencePlayground/InferencePlayground.svelte
CHANGED
@@ -22,16 +22,12 @@
|
|
22 |
|
23 |
const startMessages: ChatCompletionInputMessage[] = [{ role: 'user', content: '' }];
|
24 |
|
25 |
-
let
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
}
|
32 |
-
];
|
33 |
-
|
34 |
-
$: conversation = conversations[0];
|
35 |
|
36 |
let systemMessage: ChatCompletionInputMessage = { role: 'system', content: '' };
|
37 |
let hfToken: string | null = import.meta.env.VITE_HF_TOKEN;
|
@@ -117,7 +113,6 @@
|
|
117 |
if (streamingMessage) {
|
118 |
streamingMessage.content = content;
|
119 |
conversation.messages = [...conversation.messages];
|
120 |
-
conversations = conversations;
|
121 |
}
|
122 |
},
|
123 |
abortController,
|
@@ -129,7 +124,6 @@
|
|
129 |
// check if the user did not abort the request
|
130 |
if (waitForNonStreaming) {
|
131 |
conversation.messages = [...conversation.messages, newMessage];
|
132 |
-
conversations = conversations;
|
133 |
}
|
134 |
}
|
135 |
|
|
|
22 |
|
23 |
const startMessages: ChatCompletionInputMessage[] = [{ role: 'user', content: '' }];
|
24 |
|
25 |
+
let conversation: Conversation = {
|
26 |
+
model: models[0],
|
27 |
+
config: defaultGenerationConfig,
|
28 |
+
messages: startMessages,
|
29 |
+
streaming: true
|
30 |
+
};
|
|
|
|
|
|
|
|
|
31 |
|
32 |
let systemMessage: ChatCompletionInputMessage = { role: 'system', content: '' };
|
33 |
let hfToken: string | null = import.meta.env.VITE_HF_TOKEN;
|
|
|
113 |
if (streamingMessage) {
|
114 |
streamingMessage.content = content;
|
115 |
conversation.messages = [...conversation.messages];
|
|
|
116 |
}
|
117 |
},
|
118 |
abortController,
|
|
|
124 |
// check if the user did not abort the request
|
125 |
if (waitForNonStreaming) {
|
126 |
conversation.messages = [...conversation.messages, newMessage];
|
|
|
127 |
}
|
128 |
}
|
129 |
|