TiGa-RCE commited on
Commit
e63a295
·
verified ·
1 Parent(s): 76e0bfa

Simplify optional GPU account controls and explain connection recovery

Browse files
Files changed (5) hide show
  1. FRONTEND_SOURCE.json +1 -1
  2. RELEASE_MANIFEST.json +4 -4
  3. client.js +2 -0
  4. hf-auth.js +10 -5
  5. index.html +3 -2
FRONTEND_SOURCE.json CHANGED
@@ -4,5 +4,5 @@
4
  "output_sha256": "135a0c57be851af2879660ae6584a4bfa0a9280fc33e2c0372bc47b531f1960f",
5
  "scope": "Frontend only; no engine, private data, track assets, API calls or storage copied",
6
  "status": "Local candidate: configurable training, browser recipes, bounded sequential batches, browser network editor; track renderer and star evaluation unconnected",
7
- "candidate_sha256": "11237dcf43bb2744cbb83982e44fa4db35da81c24d5c0df48d896f8973bac0b5"
8
  }
 
4
  "output_sha256": "135a0c57be851af2879660ae6584a4bfa0a9280fc33e2c0372bc47b531f1960f",
5
  "scope": "Frontend only; no engine, private data, track assets, API calls or storage copied",
6
  "status": "Local candidate: configurable training, browser recipes, bounded sequential batches, browser network editor; track renderer and star evaluation unconnected",
7
+ "candidate_sha256": "24fd848cd38d84d84236558e1d617d79554ae462317b3bea68b11c74d2802076"
8
  }
RELEASE_MANIFEST.json CHANGED
@@ -3,7 +3,7 @@
3
  "files": {
4
  "BETA_TESTING.md": "d511965b9d675a092571f8815348da991ef1ef6be3766266c1f98ff393fd3a4d",
5
  "DATA_POLICY.md": "1434ac5420a611b35c69da90bbbb70abb088754fdab0354a51f0f892b4abe224",
6
- "FRONTEND_SOURCE.json": "e49a81a9ea37fb6724eaeac9630af249b721b983ed38e1f395d6c4db6fda0834",
7
  "GODOT_LICENSE": "fb2b3bb82c60f1e76841ba2122eb902f8e39c151476fe21ce10c9a05d1045304",
8
  "IMPORTER_BUILD_RECEIPT.json": "4ba5c533cc617105478e4d85c83f456a7dfa68b1388049624619871ba9e42e9d",
9
  "LICENSE": "53d5851b6440feeae36f72a5f57fcab37858c48b7084765ece4b0c54b9a28ed8",
@@ -46,12 +46,12 @@
46
  "builtin_tracks/tracks/Replica R08 Demolition Derby.track": "6f11a9ffbcb477c9d19964566b1b612d2a94675605246e93e21f27bbbdb357ef",
47
  "builtin_tracks/tracks/Replica R09 Eau Noir.track": "3ec0a78478cca1a4f0d2d98ac81f40783928adf271b70f0c32d295a6da2cdaa9",
48
  "builtin_tracks/tracks/Replica The Champions Trial.track": "a3bfb76422affc774b44c739b0636d08acb901fa7615b9adcb52c069f79834e1",
49
- "client.js": "1c5446c6d192c3da25d370aba88d94f685af94acb175f2d4f5499bfa4098a628",
50
  "delivery.py": "4f5a4e45df92e5cbfdef6eb449ede9ba26217fe24da376fafddae5cbbb73847a",
51
  "gpu_tickets.py": "c32cb5de751d49d3e1cd970c7d6328a42ebe71602dd9fd3788c872eef42611da",
52
- "hf-auth.js": "743fa2b62c611fcc6064664691e133efb5d163412955b2a9d0a562a428412864",
53
  "hf_identity.py": "6993d0238ada835606dbdc3275c17a3fe5a5cac5ad2156ab78230acf2d051eba",
54
- "index.html": "11237dcf43bb2744cbb83982e44fa4db35da81c24d5c0df48d896f8973bac0b5",
55
  "requirements.txt": "9b532747e51bd052e82090ece860d6dafe027407f4512dc74272c148ea104c22",
56
  "server.py": "dd9d2e709ea61b6a3e3942be8377f0cad12509d4df3dbe0baa930523c0a3120c",
57
  "track-library.js": "d19e2a58442e07d0d5029fbdfae1461106b2c3fe91dcb7b3091e304fc700811a",
 
3
  "files": {
4
  "BETA_TESTING.md": "d511965b9d675a092571f8815348da991ef1ef6be3766266c1f98ff393fd3a4d",
5
  "DATA_POLICY.md": "1434ac5420a611b35c69da90bbbb70abb088754fdab0354a51f0f892b4abe224",
6
+ "FRONTEND_SOURCE.json": "35f4b3eb2e268d4fd11aa36feb1220267c683395e2e1b0bf2ff535a945ac16f8",
7
  "GODOT_LICENSE": "fb2b3bb82c60f1e76841ba2122eb902f8e39c151476fe21ce10c9a05d1045304",
8
  "IMPORTER_BUILD_RECEIPT.json": "4ba5c533cc617105478e4d85c83f456a7dfa68b1388049624619871ba9e42e9d",
9
  "LICENSE": "53d5851b6440feeae36f72a5f57fcab37858c48b7084765ece4b0c54b9a28ed8",
 
46
  "builtin_tracks/tracks/Replica R08 Demolition Derby.track": "6f11a9ffbcb477c9d19964566b1b612d2a94675605246e93e21f27bbbdb357ef",
47
  "builtin_tracks/tracks/Replica R09 Eau Noir.track": "3ec0a78478cca1a4f0d2d98ac81f40783928adf271b70f0c32d295a6da2cdaa9",
48
  "builtin_tracks/tracks/Replica The Champions Trial.track": "a3bfb76422affc774b44c739b0636d08acb901fa7615b9adcb52c069f79834e1",
49
+ "client.js": "628ca4edec49c45302bbcbbc7c35f640442a7670105cdb42d8e21c59f1db1ff2",
50
  "delivery.py": "4f5a4e45df92e5cbfdef6eb449ede9ba26217fe24da376fafddae5cbbb73847a",
51
  "gpu_tickets.py": "c32cb5de751d49d3e1cd970c7d6328a42ebe71602dd9fd3788c872eef42611da",
52
+ "hf-auth.js": "b59691ce2c517f193a5d5141538ebe61c961bb163cefa1fcf09b414c388984c1",
53
  "hf_identity.py": "6993d0238ada835606dbdc3275c17a3fe5a5cac5ad2156ab78230acf2d051eba",
54
+ "index.html": "24fd848cd38d84d84236558e1d617d79554ae462317b3bea68b11c74d2802076",
55
  "requirements.txt": "9b532747e51bd052e82090ece860d6dafe027407f4512dc74272c148ea104c22",
56
  "server.py": "dd9d2e709ea61b6a3e3942be8377f0cad12509d4df3dbe0baa930523c0a3120c",
57
  "track-library.js": "d19e2a58442e07d0d5029fbdfae1461106b2c3fe91dcb7b3091e304fc700811a",
client.js CHANGED
@@ -241,6 +241,7 @@ setInterval(()=>{
241
  },1000);
242
  buttons();
243
  async function connect(){
 
244
  $('retry').disabled=true;
245
  $('backendNote').textContent='Checking available backends…';
246
  const controller=new AbortController();
@@ -254,6 +255,7 @@ async function connect(){
254
  capabilitiesReady=true; buttons();
255
  say('Connected. Choose your track and network, then run the test.');
256
  } catch(error) {
 
257
  capabilitiesReady=false; buttons();
258
  $('backendNote').textContent='Connection unavailable — training is disabled.';
259
  say('Could not reach this app. Retry the public beta app address: https://tiga-rce-ald-tao-gpu.hf.space/. The HF repository page is restricted in Protected mode. No run was started.');
 
241
  },1000);
242
  buttons();
243
  async function connect(){
244
+ $('connectionRecovery').hidden=true;
245
  $('retry').disabled=true;
246
  $('backendNote').textContent='Checking available backends…';
247
  const controller=new AbortController();
 
255
  capabilitiesReady=true; buttons();
256
  say('Connected. Choose your track and network, then run the test.');
257
  } catch(error) {
258
+ $('connectionRecovery').hidden=false;
259
  capabilitiesReady=false; buttons();
260
  $('backendNote').textContent='Connection unavailable — training is disabled.';
261
  say('Could not reach this app. Retry the public beta app address: https://tiga-rce-ald-tao-gpu.hf.space/. The HF repository page is restricted in Protected mode. No run was started.');
hf-auth.js CHANGED
@@ -6,8 +6,13 @@
6
  let session=null,locked=false,ready=false,config=null,exchanging=false;
7
  const message=text=>{node('hfIdentity').textContent=text;};
8
  function render(){
 
9
  node('hfSignIn').disabled=locked||exchanging||!ready;
 
 
 
10
  node('hfSignOut').disabled=locked||exchanging||!session;
 
11
  node('hfVerify').disabled=locked||exchanging||!session;
12
  }
13
  function clear(){session=null;window.dispatchEvent(new Event('hf-auth-change'));render();}
@@ -24,13 +29,13 @@
24
  verify(identity){
25
  if(session && (!identity.authenticated||identity.auth_path!=='queue-bearer'||identity.username!==session.userInfo.preferred_username))
26
  throw Error('GPU queue visitor identity did not match your HF sign-in; no GPU request started');
27
- if(session)message('HF visitor verified through GPU queue: '+identity.username+'. GPU allowance remains subject to HF limits.');
28
  }
29
  };
30
- node('hfSignOut').onclick=()=>{clear();message('Signed out of this app. CPU remains anonymous. HF website sign-in is unchanged.');};
31
  node('hfVerify').onclick=async()=>{
32
  try{await window.TrainingClient.verifyIdentity();}
33
- catch{message('Queue identity check failed. No GPU request started. Sign in again or use CPU.');}
34
  };
35
  node('hfSignIn').onclick=async()=>{
36
  if(locked||exchanging||!ready)return;
@@ -66,10 +71,10 @@
66
  if([...scopes].some(scope=>!['openid','profile'].includes(scope)))throw Error();
67
  if(!result.accessToken||!result.userInfo.preferred_username||result.accessTokenExpiresAt.getTime()<=Date.now())throw Error();
68
  session=result;window.dispatchEvent(new Event('hf-auth-change'));
69
- message('Signed in with HF: '+result.userInfo.preferred_username+'. Verify queue identity before GPU use.');
70
  }else{
71
  sessionStorage.removeItem(flowKey);
72
- message(ready?'Optional: sign in with HF before choosing files. CPU needs no sign-in. Token stays in page memory; only a one-use sign-in verifier crosses the redirect in tab-local storage.':
73
  'HF sign-in is not configured on this deployment. CPU remains anonymous.');
74
  }
75
  }).catch(()=>{
 
6
  let session=null,locked=false,ready=false,config=null,exchanging=false;
7
  const message=text=>{node('hfIdentity').textContent=text;};
8
  function render(){
9
+ node('hfSignIn').hidden=!!session;
10
  node('hfSignIn').disabled=locked||exchanging||!ready;
11
+ node('hfAccount').hidden=!session;
12
+ node('hfAccount').textContent=session?'Connected as '+session.userInfo.preferred_username:'';
13
+ node('hfSignOut').hidden=!session;
14
  node('hfSignOut').disabled=locked||exchanging||!session;
15
+ node('hfVerify').hidden=!session;
16
  node('hfVerify').disabled=locked||exchanging||!session;
17
  }
18
  function clear(){session=null;window.dispatchEvent(new Event('hf-auth-change'));render();}
 
29
  verify(identity){
30
  if(session && (!identity.authenticated||identity.auth_path!=='queue-bearer'||identity.username!==session.userInfo.preferred_username))
31
  throw Error('GPU queue visitor identity did not match your HF sign-in; no GPU request started');
32
+ if(session)message('Account connection checked. GPU use remains subject to your HF allowance.');
33
  }
34
  };
35
+ node('hfSignOut').onclick=()=>{clear();message('Account disconnected from this app. CPU remains available. HF website sign-in is unchanged.');};
36
  node('hfVerify').onclick=async()=>{
37
  try{await window.TrainingClient.verifyIdentity();}
38
+ catch{message('Account connection check failed. No GPU request started. Disconnect and sign in again, or use CPU.');}
39
  };
40
  node('hfSignIn').onclick=async()=>{
41
  if(locked||exchanging||!ready)return;
 
71
  if([...scopes].some(scope=>!['openid','profile'].includes(scope)))throw Error();
72
  if(!result.accessToken||!result.userInfo.preferred_username||result.accessTokenExpiresAt.getTime()<=Date.now())throw Error();
73
  session=result;window.dispatchEvent(new Event('hf-auth-change'));
74
+ message('Account connected. You can choose GPU; your account is checked automatically before the run.');
75
  }else{
76
  sessionStorage.removeItem(flowKey);
77
+ message(ready?'CPU needs no sign-in. For your account GPU allowance, sign in before choosing files.':
78
  'HF sign-in is not configured on this deployment. CPU remains anonymous.');
79
  }
80
  }).catch(()=>{
index.html CHANGED
@@ -5,8 +5,9 @@
5
  <header><h1>AI Learns To Drive</h1><p class="hint">Simulator by Zorro909 · UI and HF implementation by TiGa (seeker-cyber-maker).</p><p><a href="https://github.com/Zorro909/driving_sim_rs">Upstream simulator</a> · <a href="https://github.com/seeker-cyber-maker/driving_sim_rs">Implementation fork</a> · <a href="https://store.steampowered.com/app/3312030/AI_Learns_To_Drive/">Game by ActivationFunction on Steam</a></p><p role="status">Runner interface migration candidate — configurable single-run training, browser-local recipes and bounded batches. Network inspection and editing run in your browser. Track rendering and star evaluation are not connected.</p><p><a href="https://tiga-rce-ald-tao-gpu.hf.space/" target="_blank" rel="noopener noreferrer">Open the Protected beta app</a> · Share this app address with testers; the HF repository page remains restricted. CPU is anonymous. Optional HF sign-in identifies account GPU requests; otherwise the limited anonymous allowance may apply. No personal token entry is requested.</p></header>
6
  <nav class="tabs" aria-label="Lab sections"><button data-tab="drive" aria-selected="true">1 · Drive & view</button><button data-tab="training" aria-selected="false">2 · Training runs & presets</button><button data-tab="batch" aria-selected="false">3 · Batches</button><button data-tab="editor" aria-selected="false">4 · Network editor</button></nav><div id="drive" class="pane"><div class="grid"><section class="card"><h2>Simulation</h2><p>Training uses the settings on the Training runs & presets tab. Formula networks, steering and acceleration; speed and raycast sensors. Supported networks: Formula, steering and acceleration, speed/raycast sensors, 2–4 layers with up to 16 nodes.</p>
7
  <p><label for="backend">Compute</label><select id="backend" disabled><option value="cpu">CPU — no GPU allowance</option><option id="gpuOption" value="gpu" disabled>GPU — uses GPU allowance</option></select></p><p id="backendNote" class="hint">Checking available backends…</p>
8
- <button id="retry" type="button">Retry connection</button>
9
- <p><button id="hfSignIn" type="button" disabled>Sign in with Hugging Face</button> <button id="hfSignOut" type="button" disabled>Sign out of this app</button> <button id="hfVerify" type="button" disabled>Verify HF identity — no GPU</button></p><p id="hfIdentity" role="status" class="hint">CPU needs no sign-in. Checking optional HF sign-in…</p>
 
10
  <p><label for="trackPresetDrive">Track selection</label><select id="trackPresetDrive" data-track-library disabled><option value="">Upload a custom track</option></select></p>
11
  <p data-track-status role="status" class="hint">Loading built-in replica tracks…</p>
12
  <p class="hint">Built-in replicas are reconstructed editor-format layouts, not editor-authored or official packaged files. Star conditions are not evaluated.</p>
 
5
  <header><h1>AI Learns To Drive</h1><p class="hint">Simulator by Zorro909 · UI and HF implementation by TiGa (seeker-cyber-maker).</p><p><a href="https://github.com/Zorro909/driving_sim_rs">Upstream simulator</a> · <a href="https://github.com/seeker-cyber-maker/driving_sim_rs">Implementation fork</a> · <a href="https://store.steampowered.com/app/3312030/AI_Learns_To_Drive/">Game by ActivationFunction on Steam</a></p><p role="status">Runner interface migration candidate — configurable single-run training, browser-local recipes and bounded batches. Network inspection and editing run in your browser. Track rendering and star evaluation are not connected.</p><p><a href="https://tiga-rce-ald-tao-gpu.hf.space/" target="_blank" rel="noopener noreferrer">Open the Protected beta app</a> · Share this app address with testers; the HF repository page remains restricted. CPU is anonymous. Optional HF sign-in identifies account GPU requests; otherwise the limited anonymous allowance may apply. No personal token entry is requested.</p></header>
6
  <nav class="tabs" aria-label="Lab sections"><button data-tab="drive" aria-selected="true">1 · Drive & view</button><button data-tab="training" aria-selected="false">2 · Training runs & presets</button><button data-tab="batch" aria-selected="false">3 · Batches</button><button data-tab="editor" aria-selected="false">4 · Network editor</button></nav><div id="drive" class="pane"><div class="grid"><section class="card"><h2>Simulation</h2><p>Training uses the settings on the Training runs & presets tab. Formula networks, steering and acceleration; speed and raycast sensors. Supported networks: Formula, steering and acceleration, speed/raycast sensors, 2–4 layers with up to 16 nodes.</p>
7
  <p><label for="backend">Compute</label><select id="backend" disabled><option value="cpu">CPU — no GPU allowance</option><option id="gpuOption" value="gpu" disabled>GPU — uses GPU allowance</option></select></p><p id="backendNote" class="hint">Checking available backends…</p>
8
+ <div id="connectionRecovery" hidden><button id="retry" type="button">Reconnect to app</button><p class="hint">Checks server availability. Does not restart training, sign you in, or reset GPU allowance.</p></div>
9
+ <div aria-label="Optional GPU account"><p><button id="hfSignIn" type="button" disabled>Sign in with HF for account GPU allowance</button><span id="hfAccount" hidden></span> <button id="hfSignOut" type="button" disabled hidden>Disconnect account</button></p><p id="hfIdentity" role="status" class="hint">CPU needs no sign-in. Checking optional GPU account connection…</p>
10
+ <details><summary>Account help &amp; troubleshooting</summary><p>CPU works without an account. HF sign-in identifies GPU requests; it does not guarantee available allowance. Sign in before choosing files: sign-in reloads this page and clears selected files and unsaved edits. Saved recipes remain.</p><p>Your account token stays in page memory. Refreshing or closing this page disconnects the app. Disconnecting here does not sign you out of the HF website or delete job data.</p><button id="hfVerify" type="button" disabled hidden>Check account connection — no GPU used</button><p class="hint">Checks which account the GPU submission service sees. Runs automatically before GPU training; it does not check your remaining allowance.</p></details></div>
11
  <p><label for="trackPresetDrive">Track selection</label><select id="trackPresetDrive" data-track-library disabled><option value="">Upload a custom track</option></select></p>
12
  <p data-track-status role="status" class="hint">Loading built-in replica tracks…</p>
13
  <p class="hint">Built-in replicas are reconstructed editor-format layouts, not editor-authored or official packaged files. Star conditions are not evaluated.</p>