Testing: session scoped fixture for required model loading
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- python
- Lĩnh vực
- testing-qa
Hướng nghiên cứu
Bắt đầu với tests/load_models.py, tests/unload_models.py và conftest.py, sau đó xem xét workflow tox -e load-test-models hiện có cùng với hướng dẫn được liên kết về pytest fixture và marker. Triển khai cơ chế xử lý theo phạm vi session để phát hiện các test lmstudio được chọn, tùy chọn theo dõi model ID của chúng và giữ lại các model bắt buộc; hoàn tất có nghĩa là các test không còn yêu cầu thiết lập riêng để tải model và -m "not lmstudio" tránh tải chúng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The tests/load_models.py/tests/unload_models.py scripts that handle loading and unloading the models used by the test suite currently need to be invoked separately from the test suite execution.
While this approach works, it does mean that you can easily get spurious failures if you forget to run tox -e load-test-models before a local testing session.
We could potentially add a session scoped fixture in conftest.py to get pytest to natively handle ensuring that the required models have been loaded rather than needing to manage it externally: https://stackoverflow.com/questions/76608690/pytest-best-practice-to-setup-and-teardown-before-and-after-all-tests
To avoid pointlessly setting up the models when -m "not lmstudio" has been passed, the fixture should scan the loaded modules and ensure the models are only loaded if that mark is present on at least one selected test (see https://docs.pytest.org/en/stable/example/markers.html and https://docs.pytest.org/en/stable/example/special.html)
To make it even more efficient, the lmstudio marker could potentially be parameterised with the model IDs that a given test expects to already have loaded. For example:
@pytest.mark.lmstudio(models=[EXPECTED_LLM_ID, EXPECTED_EMBEDDING_ID])
def test_list_downloaded_models_async() -> None:
...
When scanning the selected test nodes, the fixture would keep track of the named models, and ensure those models were loaded before running any tests. To avoid problems with unexpected JIT model unloading during the test suite execution, the fixture would still mark models to remain loaded indefinitely.
- Ngôn ngữ chính
- Python
- Star
- 885
- Fork
- 168
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của lmstudio-ai/lmstudio-python
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
lmstudio-ai/lmstudio-python#186 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
lmstudio-ai/lmstudio-python#184 · 1 bình luận · 1 reaction ·
-
Reasoning parametersĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
lmstudio-ai/lmstudio-python#183 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
lmstudio-ai/lmstudio-python#182 · 1 reaction ·
-
error code: 502Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 32/100
lmstudio-ai/lmstudio-python#180 ·
Tất cả issue của lmstudio-ai/lmstudio-python
Issue tương tự
-
style: article/section 📝 system: cloud.rc ☁️ system: security 🔐
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
uabrc/uabrc.github.io#1262 ·
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
NCAR/miles-credit#526 ·
-
documentation
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 76/100
conda/conda-lock#957 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Type: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
aws-samples/sample-per-model-bedrock#464 ·
Maintainer thường phản hồi trong vòng 1 ngày