Skip to content

Commit 6234227

Browse files
committed
Updated package v4.1
1 parent a397af9 commit 6234227

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

locallab/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
LocalLab: Run LLMs locally with a friendly API similar to OpenAI
33
"""
44

5-
__version__ = "0.4.0"
5+
__version__ = "0.4.1"
66

77
from typing import Dict, Any, Optional
88

locallab/model_manager.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,12 @@ async def load_model(self, model_id: str) -> bool:
236236
if not ENABLE_QUANTIZATION or str(ENABLE_QUANTIZATION).lower() in ('false', '0', 'none', ''):
237237
device = "cuda" if torch.cuda.is_available() else "cpu"
238238
logger.info(f"Moving model to {device}")
239-
self.model = self.model.to(device)
239+
self.model = AutoModelForCausalLM.from_pretrained(
240+
model_id,
241+
trust_remote_code=True,
242+
token=hf_token,
243+
device_map="auto"
244+
)
240245
else:
241246
logger.info("Skipping device move for quantized model - using device_map='auto'")
242247

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.4.0",
8+
version="0.4.1",
99
packages=find_packages(include=["locallab", "locallab.*"]),
1010
install_requires=[
1111
"fastapi>=0.95.0,<1.0.0",

0 commit comments

Comments
 (0)