Skip to content

Commit 8603869

Browse files
committed
Updated Docs and Github Actions
1 parent 078020a commit 8603869

File tree

4 files changed

+25
-14
lines changed

4 files changed

+25
-14
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes for version updates.
44

5+
## [0.1.3] - 2024-02-27
6+
7+
### Changed
8+
9+
- Updated GitHub Actions workflow to use the --no-cache-dir flag in pip install commands, which prevents disk space issues during dependency installation (e.g., for large packages like torch).
10+
511
## [0.1.2] - 2024-02-25
612

713
### Changed

locallab/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
LocalLab - A lightweight AI inference server
33
"""
44

5-
__version__ = "0.1.2"
5+
__version__ = "0.1.3"
66

77
from typing import Dict, Any, Optional
88

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setup(
77
name="locallab",
8-
version="0.1.2",
8+
version="0.1.3",
99
packages=find_packages(include=["locallab", "locallab.*"]),
1010
install_requires=[
1111
"fastapi>=0.68.0,<1.0.0",

tests/conftest.py

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,39 @@
11
import pytest
22
from fastapi.testclient import TestClient
3-
from unittest.mock import Mock, patch
4-
from server.locallab.main import app
5-
from server.locallab.model_manager import ModelManager
6-
from server.locallab.client import LocalLabClient
3+
from unittest.mock import Mock
4+
from locallab.main import app
5+
from locallab.model_manager import ModelManager
76

87
@pytest.fixture
98
def test_client():
9+
"""
10+
Fixture to create a TestClient for the FastAPI app.
11+
"""
1012
return TestClient(app)
1113

1214
@pytest.fixture
1315
def model_manager():
16+
"""
17+
Fixture to create a new instance of the ModelManager.
18+
"""
1419
return ModelManager()
1520

1621
@pytest.fixture
1722
def mock_tokenizer():
23+
"""
24+
Fixture for a mocked tokenizer.
25+
Returns a simple dictionary mimicking tokenizer output.
26+
"""
1827
tokenizer = Mock()
1928
tokenizer.return_value = {"input_ids": [1, 2, 3], "attention_mask": [1, 1, 1]}
2029
return tokenizer
2130

2231
@pytest.fixture
2332
def mock_model():
33+
"""
34+
Fixture for a mocked model.
35+
Mocks the generate method.
36+
"""
2437
model = Mock()
2538
model.generate.return_value = [[1, 2, 3, 4]]
2639
return model
27-
28-
@pytest.fixture
29-
def locallab_client():
30-
with patch('locallab.client.requests') as mock_requests:
31-
client = LocalLabClient("http://localhost:8000")
32-
mock_requests.get.return_value.json.return_value = {"status": "ok"}
33-
mock_requests.post.return_value.json.return_value = {"response": "test response"}
34-
yield client

0 commit comments

Comments
 (0)