llm is the only app (#15779)

* tinygrad/llm is the only app

* upd pyproject

* claude refs

* scoping

* min diff
This commit is contained in:
George Hotz
2026-04-17 10:44:48 +08:00
committed by GitHub
parent 0e69388f6b
commit ec00cefa5b
16 changed files with 49 additions and 32 deletions

View File

@@ -1,6 +1,6 @@
import unittest
from tinygrad import Tensor, dtypes, TinyJit, UOp
from tinygrad.apps.llm import apply_rope as apply_rope_new, precompute_freqs_cis
from tinygrad.llm.cli import apply_rope as apply_rope_new, precompute_freqs_cis
from test.helpers import assert_jit_cache_len
def apply_rope(x:Tensor, start_pos:int):

View File

@@ -22,18 +22,15 @@ class TestLLMServer(unittest.TestCase):
cls.bos_id = 1
cls.eos_id = 999
import tinygrad.apps.llm as llm_module
llm_module.model = cls.mock_model
llm_module.model_name = "test-model"
llm_module.tok = cls.mock_tok
llm_module.bos_id = cls.bos_id
llm_module.eos_id = cls.eos_id
llm_module.eot_id = None
from tinygrad.llm.cli import Handler, LLMServer
from tinygrad.apps.llm import Handler
from tinygrad.viz.serve import TCPServerWithReuse
cls.server = TCPServerWithReuse(('127.0.0.1', 0), Handler)
cls.server = LLMServer(('127.0.0.1', 0), Handler)
cls.server.model = cls.mock_model
cls.server.model_name = "test-model"
cls.server.tok = cls.mock_tok
cls.server.bos_id = cls.bos_id
cls.server.eos_id = cls.eos_id
cls.server.eot_id = None
cls.port = cls.server.server_address[1]
cls.server_thread = threading.Thread(target=cls.server.serve_forever, daemon=True)
cls.server_thread.start()

View File

@@ -1,5 +1,5 @@
import unittest, base64, functools, sys
from tinygrad.apps.llm import SimpleTokenizer
from tinygrad.llm.cli import SimpleTokenizer
from tinygrad.helpers import fetch
@unittest.skipIf(sys.platform == 'win32', "fetch race condition on Windows")