TiGa-RCE commited on
Commit
b9c27ee
·
verified ·
1 Parent(s): 8a5c721

Deploy clean CPU interface on free CPU hosting

Browse files
Files changed (3) hide show
  1. README.md +8 -27
  2. app.py +28 -31
  3. requirements.txt +2 -1
README.md CHANGED
@@ -1,33 +1,14 @@
1
  ---
2
- title: TAO ZeroGPU Qualification
3
- emoji: 🏎️
4
- colorFrom: green
5
- colorTo: blue
6
  sdk: gradio
7
  sdk_version: 6.29.1
8
- python_version: '3.10'
9
  app_file: app.py
10
- pinned: false
11
  ---
12
 
13
- Private native CUDA compatibility probe and bounded upload smoke test, not a qualified trainer.
14
- Uses included ZeroGPU allowance through a 45-second leased call. No paid Jobs
15
- or dedicated hardware requested. Check the authenticated caller's included quota
16
- before each call; the app itself does not know account billing balances.
17
-
18
- Original Docker source and dashboard remain in this repository but are inactive.
19
- Rollback: restore README.md from revision ba07e35a39211af7a0deda0ebd9adb2c554b4f38
20
- and request CPU Basic. BINARY_PROVENANCE.json pins the two exact HF-built binaries
21
- to that revision and upstream d8ab74c25df70b6a86ed101080e33d5fb785ea6f.
22
-
23
- No CUDA initialization outside the lease. First check device discovery and a
24
- three-value sine kernel in process, then the normal Rust gpu-info subprocess.
25
- No fallback, trajectory parity, speedup or H200 claim. A second lease
26
- must independently pass before testing training. Retained PACKAGE_MANIFEST.json
27
- describes the prior Docker snapshot only; ZEROGPU_MANIFEST.json covers this overlay.
28
-
29
- The upload test validates the exact supplied A01 track and a 6-4-2 Formula network
30
- before leasing a GPU for at most 90 seconds. It repeats qualification, then runs
31
- 4 vehicles for 1 generation of 60 physics ticks, seed 42, proton math profile.
32
- The subprocess has a 25-second timeout. It exports a candidate and receipt, not
33
- an improvement claim. Real-game import compatibility and physics parity remain unverified.
 
1
  ---
2
+ title: AI Learns To Drive — TiGa interface
 
 
 
3
  sdk: gradio
4
  sdk_version: 6.29.1
5
+ python_version: "3.10"
6
  app_file: app.py
 
7
  ---
8
 
9
+ Private CPU integration candidate. Custom FastAPI interface on port 7860.
10
+ Simulator: https://github.com/Zorro909/driving_sim_rs
11
+ Hosting adaptation and UI: TiGa https://github.com/seeker-cyber-maker/driving_sim_rs
12
+ GPU is deliberately unavailable in this candidate. No bundled tracks or networks.
13
+ One server process; no persistent storage. See DATA_POLICY.md for retention limits.
14
+ Not yet verified in the hosted Linux runtime; do not publish as a stable release.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app.py CHANGED
@@ -1,36 +1,33 @@
1
- import spaces
2
- import gradio as gr
3
- from cloud_probe import run_probe
 
 
 
4
 
5
- def cpu_smoke():
6
- return run_probe(False)
7
 
8
- @spaces.GPU(duration=90)
9
- def gpu_smoke():
10
- return run_probe(True)
 
 
 
 
 
 
11
 
12
- def selected_smoke(backend):
13
- if backend == 'cpu':
14
- return cpu_smoke()
15
- if backend == 'gpu':
16
- return gpu_smoke()
17
- raise ValueError('Choose CPU or GPU')
18
 
19
- with gr.Blocks() as demo:
20
- gr.Markdown('''# AI Learns To Drive — private compute test
21
- Simulator by [Zorro909](https://github.com/Zorro909/driving_sim_rs).
22
- UI and HF implementation by TiGa (seeker-cyber-maker).
 
 
 
23
 
24
- Fixed synthetic network, 4 cars, 1 generation, 60 ticks. CPU runs without a GPU lease.
25
- GPU uses up to 90 seconds of included allowance; check quota first. No automatic runs.
26
- No user uploads; temporary model files are deleted before the receipt is returned.
27
- This tests backend execution, not useful learning, performance, or full UI integration.
28
- ''')
29
- backend=gr.Radio(choices=[('CPU — no GPU allowance needed','cpu'),('GPU — uses included GPU allowance','gpu')],value='cpu',label='Compute')
30
- report=gr.JSON(label='Execution receipt')
31
- gr.Button('Run selected backend',variant='primary').click(selected_smoke,inputs=backend,outputs=report,api_name='selected_smoke',concurrency_limit=1,concurrency_id='native')
32
- gr.Button('Run CPU-only test').click(cpu_smoke,outputs=report,api_name='cpu_smoke',concurrency_limit=1,concurrency_id='native')
33
- gr.Button('Run GPU test').click(gpu_smoke,outputs=report,api_name='gpu_smoke',concurrency_limit=1,concurrency_id='native')
34
-
35
- if __name__=='__main__':
36
- demo.queue(max_size=1).launch()
 
1
+ """HF CPU release entrypoint. One process owns all ephemeral results."""
2
+ import hashlib
3
+ import json
4
+ from pathlib import Path
5
+ from server import create_app
6
+ from worker import run_native
7
 
8
+ ROOT=Path(__file__).resolve().parent
 
9
 
10
+ def verify_package(root=ROOT):
11
+ manifest=json.loads((root/'RELEASE_MANIFEST.json').read_text())
12
+ for name,expected in manifest['files'].items():
13
+ path=(root/name).resolve()
14
+ if not path.is_relative_to(root.resolve()) or not path.is_file():
15
+ raise RuntimeError('Invalid release member')
16
+ if hashlib.sha256(path.read_bytes()).hexdigest()!=expected:
17
+ raise RuntimeError('Release integrity check failed: '+name)
18
+ return manifest
19
 
20
+ def cpu_worker(track,network):
21
+ return run_native(track,network,binary=ROOT/'bin/altd-sim',
22
+ importer=ROOT/'bin/extract_saved_track',
23
+ scene_template=ROOT/'assets/formula_template.json',with_report=True)
 
 
24
 
25
+ def main():
26
+ verify_package()
27
+ for name in ('altd-sim','extract_saved_track'):
28
+ (ROOT/'bin'/name).chmod(0o755)
29
+ import uvicorn
30
+ uvicorn.run(create_app(worker=cpu_worker),host='0.0.0.0',port=7860,
31
+ workers=1,access_log=False)
32
 
33
+ if __name__=='__main__': main()
 
 
 
 
 
 
 
 
 
 
 
 
requirements.txt CHANGED
@@ -1 +1,2 @@
1
- spaces==0.51.3
 
 
1
+ fastapi==0.141.1
2
+ uvicorn==0.52.1