mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-08-11 13:12:18 +00:00
Merge remote-tracking branch 'origin/main' into store_connector
This commit is contained in:
commit
4ef9ada7dc
14
pilot/configs/__init__.py
Normal file
14
pilot/configs/__init__.py
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import os
|
||||||
|
import random
|
||||||
|
import sys
|
||||||
|
|
||||||
|
from dotenv import load_dotenv
|
||||||
|
|
||||||
|
if "pytest" in sys.argv or "pytest" in sys.modules or os.getenv("CI"):
|
||||||
|
print("Setting random seed to 42")
|
||||||
|
random.seed(42)
|
||||||
|
|
||||||
|
# Load the users .env file into environment variables
|
||||||
|
load_dotenv(verbose=True, override=True)
|
||||||
|
|
||||||
|
del load_dotenv
|
@ -9,6 +9,7 @@ from typing import Optional
|
|||||||
from pilot.model.compression import compress_module
|
from pilot.model.compression import compress_module
|
||||||
from pilot.model.adapter import get_llm_model_adapter
|
from pilot.model.adapter import get_llm_model_adapter
|
||||||
from pilot.utils import get_gpu_memory
|
from pilot.utils import get_gpu_memory
|
||||||
|
from pilot.configs.model_config import DEVICE
|
||||||
from pilot.model.llm.monkey_patch import replace_llama_attn_with_non_inplace_operations
|
from pilot.model.llm.monkey_patch import replace_llama_attn_with_non_inplace_operations
|
||||||
|
|
||||||
def raise_warning_for_incompatible_cpu_offloading_configuration(
|
def raise_warning_for_incompatible_cpu_offloading_configuration(
|
||||||
@ -50,7 +51,7 @@ class ModelLoader(metaclass=Singleton):
|
|||||||
def __init__(self,
|
def __init__(self,
|
||||||
model_path) -> None:
|
model_path) -> None:
|
||||||
|
|
||||||
self.device = "cuda" if torch.cuda.is_available() else "cpu"
|
self.device = DEVICE
|
||||||
self.model_path = model_path
|
self.model_path = model_path
|
||||||
self.kwargs = {
|
self.kwargs = {
|
||||||
"torch_dtype": torch.float16,
|
"torch_dtype": torch.float16,
|
||||||
|
Loading…
Reference in New Issue
Block a user