Spaces:
Sleeping
Sleeping
Add loguru
Browse files
model.py
CHANGED
@@ -4,6 +4,7 @@ from typing import Iterator
|
|
4 |
|
5 |
from llama_cpp import Llama
|
6 |
from huggingface_hub import hf_hub_download
|
|
|
7 |
|
8 |
def download_model():
|
9 |
print(f"Downloading model")
|
@@ -32,6 +33,8 @@ def load_llm():
|
|
32 |
|
33 |
llm = load_llm()
|
34 |
|
|
|
|
|
35 |
def get_prompt(message: str, chat_history: list[tuple[str, str]],
|
36 |
system_prompt: str):
|
37 |
prompt=""
|
@@ -60,6 +63,9 @@ def run(message: str,
|
|
60 |
|
61 |
prompt = get_prompt(message, chat_history, system_prompt)
|
62 |
|
|
|
|
|
|
|
63 |
#stop=["</s>"]
|
64 |
stop = ["USER:", "ASSISTANT:"]
|
65 |
outputs = []
|
|
|
4 |
|
5 |
from llama_cpp import Llama
|
6 |
from huggingface_hub import hf_hub_download
|
7 |
+
from loguru import logger
|
8 |
|
9 |
def download_model():
|
10 |
print(f"Downloading model")
|
|
|
33 |
|
34 |
llm = load_llm()
|
35 |
|
36 |
+
logger.info(f"done load llm")
|
37 |
+
|
38 |
def get_prompt(message: str, chat_history: list[tuple[str, str]],
|
39 |
system_prompt: str):
|
40 |
prompt=""
|
|
|
63 |
|
64 |
prompt = get_prompt(message, chat_history, system_prompt)
|
65 |
|
66 |
+
logger.info(f"New prompt")
|
67 |
+
logger.info(f"{prompt}")
|
68 |
+
|
69 |
#stop=["</s>"]
|
70 |
stop = ["USER:", "ASSISTANT:"]
|
71 |
outputs = []
|