Spaces:
Running on Zero
Running on Zero
Deploy clean CPU interface on free CPU hosting
Browse files- README.md +8 -27
- app.py +28 -31
- requirements.txt +2 -1
README.md
CHANGED
|
@@ -1,33 +1,14 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji: 🏎️
|
| 4 |
-
colorFrom: green
|
| 5 |
-
colorTo: blue
|
| 6 |
sdk: gradio
|
| 7 |
sdk_version: 6.29.1
|
| 8 |
-
python_version:
|
| 9 |
app_file: app.py
|
| 10 |
-
pinned: false
|
| 11 |
---
|
| 12 |
|
| 13 |
-
Private
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 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 |
-
|
| 2 |
-
import
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
-
|
| 6 |
-
return run_probe(False)
|
| 7 |
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
-
def
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
return gpu_smoke()
|
| 17 |
-
raise ValueError('Choose CPU or GPU')
|
| 18 |
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
-
|
| 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 |
-
|
|
|
|
|
|
| 1 |
+
fastapi==0.141.1
|
| 2 |
+
uvicorn==0.52.1
|