mishig HF staff commited on
Commit
413bc00
1 Parent(s): 15d6d38

Rm jsonMode

Browse files
src/lib/components/InferencePlayground/InferencePlayground.svelte CHANGED
@@ -21,7 +21,7 @@
21
  {
22
  id: String(Math.random()),
23
  model: '01-ai/Yi-1.5-34B-Chat',
24
- config: { temperature: 0.5, maxTokens: 2048, streaming: true, jsonMode: false },
25
  messages: startMessages
26
  }
27
  ];
@@ -128,7 +128,6 @@
128
  requestMessages,
129
  conversation.config.temperature,
130
  conversation.config.maxTokens,
131
- conversation.config.jsonMode,
132
  (content) => {
133
  if (streamingMessage) {
134
  streamingMessage.content = content;
@@ -146,7 +145,6 @@
146
  requestMessages,
147
  conversation.config.temperature,
148
  conversation.config.maxTokens,
149
- conversation.config.jsonMode
150
  );
151
  // check if the user did not abort the request
152
  if (waitForNonStreaming) {
@@ -386,7 +384,7 @@
386
  {
387
  id: String(Math.random()),
388
  model: e.target.value,
389
- config: { temperature: 0.5, maxTokens: 2048, streaming: true, jsonMode: false },
390
  messages: [...conversations[0].messages]
391
  }
392
  ];
 
21
  {
22
  id: String(Math.random()),
23
  model: '01-ai/Yi-1.5-34B-Chat',
24
+ config: { temperature: 0.5, maxTokens: 2048, streaming: true },
25
  messages: startMessages
26
  }
27
  ];
 
128
  requestMessages,
129
  conversation.config.temperature,
130
  conversation.config.maxTokens,
 
131
  (content) => {
132
  if (streamingMessage) {
133
  streamingMessage.content = content;
 
145
  requestMessages,
146
  conversation.config.temperature,
147
  conversation.config.maxTokens,
 
148
  );
149
  // check if the user did not abort the request
150
  if (waitForNonStreaming) {
 
384
  {
385
  id: String(Math.random()),
386
  model: e.target.value,
387
+ config: { temperature: 0.5, maxTokens: 2048, streaming: true },
388
  messages: [...conversations[0].messages]
389
  }
390
  ];
src/lib/components/InferencePlayground/InferencePlaygroundGenerationConfig.svelte CHANGED
@@ -1,9 +1,4 @@
1
  <script lang="ts">
2
- // export let temperature = 0.5;
3
- // export let maxTokens = 2048;
4
- // export let streaming = true;
5
- // export let jsonMode = true;
6
-
7
  export let config;
8
  export let classNames = '';
9
  </script>
 
1
  <script lang="ts">
 
 
 
 
 
2
  export let config;
3
  export let classNames = '';
4
  </script>
src/lib/components/InferencePlayground/inferencePlaygroundUtils.ts CHANGED
@@ -18,7 +18,6 @@ export async function handleStreamingResponse(
18
  messages: ChatCompletionInputMessage[],
19
  temperature: number,
20
  maxTokens: number,
21
- jsonMode: boolean,
22
  onChunk: (content: string) => void,
23
  abortController: AbortController
24
  ): Promise<void> {
@@ -30,7 +29,6 @@ export async function handleStreamingResponse(
30
  messages: messages,
31
  temperature: temperature,
32
  max_tokens: maxTokens,
33
- json_mode: jsonMode
34
  },
35
  { signal: abortController.signal }
36
  )) {
@@ -54,14 +52,12 @@ export async function handleNonStreamingResponse(
54
  messages: ChatCompletionInputMessage[],
55
  temperature: number,
56
  maxTokens: number,
57
- jsonMode: boolean
58
  ): Promise<ChatCompletionInputMessage> {
59
  const response = await hf.chatCompletion({
60
  model: model,
61
  messages: messages,
62
  temperature: temperature,
63
  max_tokens: maxTokens,
64
- json_mode: jsonMode
65
  });
66
 
67
  if (response.choices && response.choices.length > 0) {
 
18
  messages: ChatCompletionInputMessage[],
19
  temperature: number,
20
  maxTokens: number,
 
21
  onChunk: (content: string) => void,
22
  abortController: AbortController
23
  ): Promise<void> {
 
29
  messages: messages,
30
  temperature: temperature,
31
  max_tokens: maxTokens,
 
32
  },
33
  { signal: abortController.signal }
34
  )) {
 
52
  messages: ChatCompletionInputMessage[],
53
  temperature: number,
54
  maxTokens: number,
 
55
  ): Promise<ChatCompletionInputMessage> {
56
  const response = await hf.chatCompletion({
57
  model: model,
58
  messages: messages,
59
  temperature: temperature,
60
  max_tokens: maxTokens,
 
61
  });
62
 
63
  if (response.choices && response.choices.length > 0) {
src/lib/types/index.d.ts CHANGED
@@ -7,7 +7,6 @@ type GenerationConfig = {
7
  temperature: number;
8
  maxTokens: number;
9
  streaming: boolean;
10
- jsonMode: boolean;
11
  };
12
 
13
  type Conversation = {
 
7
  temperature: number;
8
  maxTokens: number;
9
  streaming: boolean;
 
10
  };
11
 
12
  type Conversation = {