mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-09-03 22:53:44 +08:00
2f60026c22
* Add tinygrad ref testing * BaseDir and give a fake ref id to test * one more before the real thing * Add the correct ref * test * Update test_tinygrad_ref.py * Update tinygrad_ref * Update test_tinygrad_ref.py * Update tinygrad_ref * This SHOULD FAIL * Revert "This SHOULD FAIL" This reverts commit 58862f8a730c34c1407386f729067b0c564e910b. * bit of red * Move ref to models so compiled branches can read it * step one * step 2 * Update build-all-tinygrad-models.yaml * Update build-all-tinygrad-models.yaml * Update build-all-tinygrad-models.yaml * Update build-all-tinygrad-models.yaml * Update build-all-tinygrad-models.yaml * Update build-all-tinygrad-models.yaml * Update tinygrad_ref.py * Update build-all-tinygrad-models.yaml * bump to fail test * Revert "bump to fail test" This reverts commit 4f58991f32036ac55564470f1fdaa50492578f15. * pytest should take care of it * lint --------- Co-authored-by: Jason Wen <haibin.wen3@gmail.com>
24 lines
739 B
Python
24 lines
739 B
Python
import requests
|
|
|
|
from sunnypilot.models.tinygrad_ref import get_tinygrad_ref
|
|
from sunnypilot.models.fetcher import ModelFetcher
|
|
|
|
|
|
def fetch_tinygrad_ref():
|
|
response = requests.get(ModelFetcher.MODEL_URL, timeout=10)
|
|
response.raise_for_status()
|
|
json_data = response.json()
|
|
return json_data.get("tinygrad_ref")
|
|
|
|
|
|
def test_tinygrad_ref():
|
|
current_ref = get_tinygrad_ref()
|
|
remote_ref = fetch_tinygrad_ref()
|
|
assert remote_ref == current_ref, (
|
|
f"""tinygrad_repo ref does not match remote tinygrad_ref of current compiled driving models json.
|
|
Current: {current_ref}
|
|
Remote: {remote_ref}
|
|
Please run build-all workflow to update models."""
|
|
)
|
|
print("tinygrad_repo ref matches current compiled driving models json ref.")
|