Spaces:
Paused
Paused
stable login
Browse files
ui/src/app/jobs/new/jobConfig.ts
CHANGED
|
@@ -62,7 +62,7 @@ export const defaultJobConfig: JobConfig = {
|
|
| 62 |
gradient_checkpointing: true,
|
| 63 |
noise_scheduler: 'flowmatch',
|
| 64 |
optimizer: 'adamw8bit',
|
| 65 |
-
timestep_type: '
|
| 66 |
content_or_style: 'balanced',
|
| 67 |
optimizer_params: {
|
| 68 |
weight_decay: 1e-4,
|
|
@@ -88,7 +88,7 @@ export const defaultJobConfig: JobConfig = {
|
|
| 88 |
qtype: 'qfloat8',
|
| 89 |
quantize_te: true,
|
| 90 |
qtype_te: 'qfloat8',
|
| 91 |
-
arch: '
|
| 92 |
low_vram: false,
|
| 93 |
model_kwargs: {},
|
| 94 |
},
|
|
|
|
| 62 |
gradient_checkpointing: true,
|
| 63 |
noise_scheduler: 'flowmatch',
|
| 64 |
optimizer: 'adamw8bit',
|
| 65 |
+
timestep_type: 'weighted',
|
| 66 |
content_or_style: 'balanced',
|
| 67 |
optimizer_params: {
|
| 68 |
weight_decay: 1e-4,
|
|
|
|
| 88 |
qtype: 'qfloat8',
|
| 89 |
quantize_te: true,
|
| 90 |
qtype_te: 'qfloat8',
|
| 91 |
+
arch: 'qwen_image',
|
| 92 |
low_vram: false,
|
| 93 |
model_kwargs: {},
|
| 94 |
},
|
ui/src/contexts/AuthContext.tsx
CHANGED
|
@@ -55,7 +55,9 @@ async function validateToken(token: string) {
|
|
| 55 |
|
| 56 |
if (!res.ok) {
|
| 57 |
const data = await res.json().catch(() => ({}));
|
| 58 |
-
|
|
|
|
|
|
|
| 59 |
}
|
| 60 |
|
| 61 |
return res.json();
|
|
@@ -160,9 +162,17 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
|
|
| 160 |
namespace: data?.name || data?.preferred_username || stored.namespace || 'user',
|
| 161 |
method: stored.method || 'manual',
|
| 162 |
});
|
| 163 |
-
} catch (err) {
|
| 164 |
-
console.warn('Stored HF token
|
| 165 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 166 |
}
|
| 167 |
};
|
| 168 |
|
|
@@ -238,6 +248,9 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
|
|
| 238 |
} catch (err: any) {
|
| 239 |
setError(err?.message || 'Failed to authenticate with Hugging Face');
|
| 240 |
setStatus('error');
|
|
|
|
|
|
|
|
|
|
| 241 |
return false;
|
| 242 |
}
|
| 243 |
},
|
|
|
|
| 55 |
|
| 56 |
if (!res.ok) {
|
| 57 |
const data = await res.json().catch(() => ({}));
|
| 58 |
+
const error: any = new Error(data?.error || 'Failed to validate token');
|
| 59 |
+
error.status = res.status;
|
| 60 |
+
throw error;
|
| 61 |
}
|
| 62 |
|
| 63 |
return res.json();
|
|
|
|
| 162 |
namespace: data?.name || data?.preferred_username || stored.namespace || 'user',
|
| 163 |
method: stored.method || 'manual',
|
| 164 |
});
|
| 165 |
+
} catch (err: any) {
|
| 166 |
+
console.warn('Stored HF token validation failed:', err);
|
| 167 |
+
if (err?.status === 401 || err?.status === 403) {
|
| 168 |
+
await clearAuthState();
|
| 169 |
+
} else {
|
| 170 |
+
await applyAuthState({
|
| 171 |
+
token: stored.token,
|
| 172 |
+
namespace: stored.namespace || 'user',
|
| 173 |
+
method: stored.method || 'manual',
|
| 174 |
+
});
|
| 175 |
+
}
|
| 176 |
}
|
| 177 |
};
|
| 178 |
|
|
|
|
| 248 |
} catch (err: any) {
|
| 249 |
setError(err?.message || 'Failed to authenticate with Hugging Face');
|
| 250 |
setStatus('error');
|
| 251 |
+
if (typeof window !== 'undefined') {
|
| 252 |
+
sessionStorage.removeItem('HF_OAUTH_STATE');
|
| 253 |
+
}
|
| 254 |
return false;
|
| 255 |
}
|
| 256 |
},
|