Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
print("START: BEFORE IMPORTS")
|
2 |
|
3 |
import os
|
|
|
4 |
import gradio as gr
|
5 |
import copy
|
6 |
from llama_cpp import Llama
|
@@ -10,19 +11,20 @@ print("START: AFTER IMPORTS")
|
|
10 |
|
11 |
try:
|
12 |
print("START: BEFORE MODEL DOWNLOAD")
|
|
|
13 |
model_path = hf_hub_download(
|
14 |
-
repo_id="NousResearch/
|
15 |
-
filename="
|
16 |
|
17 |
)
|
18 |
-
print("START: AFTER MODEL DOWNLOAD")
|
19 |
llm = Llama(
|
20 |
model_path=model_path,
|
21 |
n_ctx=2048,
|
22 |
n_gpu_layers=-1, # change n_gpu_layers if you have more or less VRAM
|
23 |
verbose=True
|
24 |
)
|
25 |
-
print("START: AFTER LLAMA-CPP SETUP")
|
26 |
|
27 |
except Exception as e:
|
28 |
print(e)
|
|
|
1 |
print("START: BEFORE IMPORTS")
|
2 |
|
3 |
import os
|
4 |
+
impo
|
5 |
import gradio as gr
|
6 |
import copy
|
7 |
from llama_cpp import Llama
|
|
|
11 |
|
12 |
try:
|
13 |
print("START: BEFORE MODEL DOWNLOAD")
|
14 |
+
start_load_time = time.time()
|
15 |
model_path = hf_hub_download(
|
16 |
+
repo_id="NousResearch/Hermes-2-Pro-Llama-3-8B-GGUF",
|
17 |
+
filename="Hermes-2-Pro-Llama-3-8B-Q4_K_M.gguf",
|
18 |
|
19 |
)
|
20 |
+
print("START: AFTER MODEL DOWNLOAD -- " + time.time() - start_load_time + "s")
|
21 |
llm = Llama(
|
22 |
model_path=model_path,
|
23 |
n_ctx=2048,
|
24 |
n_gpu_layers=-1, # change n_gpu_layers if you have more or less VRAM
|
25 |
verbose=True
|
26 |
)
|
27 |
+
print("START: AFTER LLAMA-CPP SETUP -- " + time.time() - start_load_time + "s")
|
28 |
|
29 |
except Exception as e:
|
30 |
print(e)
|