Spaces:
Sleeping
Sleeping
Update scripts/load_model.py
Browse files- scripts/load_model.py +4 -4
scripts/load_model.py
CHANGED
|
@@ -1,15 +1,15 @@
|
|
| 1 |
# model_loader.py
|
| 2 |
from langchain_community.chat_models import ChatLlamaCpp
|
| 3 |
-
|
| 4 |
|
| 5 |
_llm_instance = None
|
| 6 |
|
| 7 |
def get_model(callbacks=None):
|
| 8 |
global _llm_instance
|
| 9 |
if _llm_instance is None:
|
| 10 |
-
|
| 11 |
-
model_path =
|
| 12 |
-
print("Loading ChatLlamaCpp model
|
| 13 |
_llm_instance = ChatLlamaCpp(
|
| 14 |
model_path=model_path,
|
| 15 |
temperature=0.7,
|
|
|
|
| 1 |
# model_loader.py
|
| 2 |
from langchain_community.chat_models import ChatLlamaCpp
|
| 3 |
+
import os
|
| 4 |
|
| 5 |
_llm_instance = None
|
| 6 |
|
| 7 |
def get_model(callbacks=None):
|
| 8 |
global _llm_instance
|
| 9 |
if _llm_instance is None:
|
| 10 |
+
model_path = os.path.join(os.path.dirname(__file__), os.pardir, "Model", "qwen2.5-0.5b-coding-assistant-q4_k_m.gguf")
|
| 11 |
+
model_path = os.path.abspath(model_path)
|
| 12 |
+
print(f"Loading ChatLlamaCpp model from local path: {model_path}")
|
| 13 |
_llm_instance = ChatLlamaCpp(
|
| 14 |
model_path=model_path,
|
| 15 |
temperature=0.7,
|