Fraser commited on
Commit
3eb1d35
·
1 Parent(s): a300a19
src/lib/components/Piclets/PicletDetail.svelte CHANGED
@@ -432,12 +432,6 @@
432
 
433
 
434
  /* Stats Tab */
435
- .section-title {
436
- margin: 0 0 16px;
437
- font-size: 18px;
438
- font-weight: bold;
439
- color: #000;
440
- }
441
 
442
  .stats-list {
443
  display: flex;
 
432
 
433
 
434
  /* Stats Tab */
 
 
 
 
 
 
435
 
436
  .stats-list {
437
  display: flex;
src/lib/services/qwen3Client.ts CHANGED
@@ -68,15 +68,11 @@ export class Qwen3Client {
68
  throw new Error('Qwen3Client only supports "/chat" endpoint');
69
  }
70
 
 
71
  const [
72
  message,
73
  chat_history = [],
74
- system_prompt = "You are a helpful assistant.",
75
- max_new_tokens = 2048,
76
- temperature = 0.7,
77
- top_p = 0.95,
78
- top_k = 50,
79
- repetition_penalty = 1.0
80
  ] = params;
81
 
82
  try {
@@ -84,14 +80,10 @@ export class Qwen3Client {
84
  await this.initializeGradioClient();
85
 
86
  // Use the proper Gradio Client API to call the add_message function
 
87
  const response = await this.callQwen3API(message, {
88
  sys_prompt: system_prompt,
89
- model: this.options.model,
90
- max_new_tokens,
91
- temperature,
92
- top_p,
93
- top_k,
94
- repetition_penalty
95
  });
96
 
97
  // Return in the expected format: {data: [response_text]}
@@ -111,15 +103,12 @@ export class Qwen3Client {
111
  throw new Error('Gradio client not initialized');
112
  }
113
 
114
- // Prepare settings for the Qwen3 space based on app.py structure
 
115
  const settingsFormValue = {
116
  model: options.model || this.options.model,
117
  sys_prompt: options.sys_prompt || "You are a helpful assistant.",
118
- thinking_budget: Math.min(options.max_new_tokens || 20, 38), // Qwen3 has max 38k thinking budget
119
- temperature: options.temperature || 0.7,
120
- top_p: options.top_p || 0.95,
121
- top_k: options.top_k || 50,
122
- repetition_penalty: options.repetition_penalty || 1.0
123
  };
124
 
125
  // Thinking button state - disable for faster responses
@@ -242,37 +231,8 @@ export class Qwen3Client {
242
  }
243
 
244
  /**
245
- * Test connection to Qwen3 service
246
  */
247
- async testConnection(): Promise<boolean> {
248
- try {
249
- // Try to initialize the Gradio client first
250
- await this.initializeGradioClient();
251
-
252
- // Test with a simple message
253
- const result = await this.predict('/chat', [
254
- 'Hello, are you working? Please respond with just "Yes" if you can receive this message.',
255
- [],
256
- 'You are a helpful assistant. Respond very briefly with just "Yes" if you can receive messages.',
257
- 50, // Small token limit for test
258
- 0.7,
259
- 0.95,
260
- 50,
261
- 1.0
262
- ]);
263
-
264
- const response = result.data && result.data[0] && typeof result.data[0] === 'string' ? result.data[0] : '';
265
- const isWorking = response.length > 0 && !response.includes('temporarily unavailable');
266
-
267
- console.log(`🔍 Qwen3 connection test result: ${isWorking ? 'PASS' : 'FAIL'}`);
268
- console.log(`📝 Test response: "${response.substring(0, 50)}..."`);
269
-
270
- return isWorking;
271
- } catch (error) {
272
- console.error('Qwen3 connection test failed:', error);
273
- return false;
274
- }
275
- }
276
  }
277
 
278
  // Export a default instance
 
68
  throw new Error('Qwen3Client only supports "/chat" endpoint');
69
  }
70
 
71
+ // Note: Qwen3-Demo only uses these 3 parameters from the rwkv-compatible API
72
  const [
73
  message,
74
  chat_history = [],
75
+ system_prompt = "You are a helpful assistant."
 
 
 
 
 
76
  ] = params;
77
 
78
  try {
 
80
  await this.initializeGradioClient();
81
 
82
  // Use the proper Gradio Client API to call the add_message function
83
+ // Only pass parameters that actually exist in the Qwen3 Gradio app
84
  const response = await this.callQwen3API(message, {
85
  sys_prompt: system_prompt,
86
+ model: this.options.model
 
 
 
 
 
87
  });
88
 
89
  // Return in the expected format: {data: [response_text]}
 
103
  throw new Error('Gradio client not initialized');
104
  }
105
 
106
+ // Prepare settings for the Qwen3 space based on actual app.py structure
107
+ // Only use parameters that actually exist in the Gradio app
108
  const settingsFormValue = {
109
  model: options.model || this.options.model,
110
  sys_prompt: options.sys_prompt || "You are a helpful assistant.",
111
+ thinking_budget: 38 // Use maximum thinking budget for best quality
 
 
 
 
112
  };
113
 
114
  // Thinking button state - disable for faster responses
 
231
  }
232
 
233
  /**
234
+ * No connection testing - let natural failures trigger fallback to Zephyr-7B
235
  */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
236
  }
237
 
238
  // Export a default instance
src/lib/services/textGenerationClient.ts CHANGED
@@ -8,7 +8,6 @@ import { qwen3Client } from './qwen3Client';
8
 
9
  interface TextGenerationClient {
10
  predict(endpoint: string, params: any[]): Promise<{data: any[]}>;
11
- testConnection?(): Promise<boolean>;
12
  }
13
 
14
  class TextGenerationManager {
 
8
 
9
  interface TextGenerationClient {
10
  predict(endpoint: string, params: any[]): Promise<{data: any[]}>;
 
11
  }
12
 
13
  class TextGenerationManager {