Spaces:
Runtime error
Runtime error
ffreemt
commited on
Commit
·
3f10600
1
Parent(s):
2e1e948
- README.md +1 -1
- app.py +4 -3
- requirements.txt +1 -1
README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
emoji: 🚀
|
4 |
colorFrom: green
|
5 |
colorTo: green
|
|
|
1 |
---
|
2 |
+
title: llama-2-13b-ggml
|
3 |
emoji: 🚀
|
4 |
colorFrom: green
|
5 |
colorTo: green
|
app.py
CHANGED
@@ -74,7 +74,8 @@ model_loc, file_size = dl_hf_model(url)
|
|
74 |
|
75 |
logger.debug(f"{model_loc} {file_size}GB")
|
76 |
|
77 |
-
|
|
|
78 |
logger.debug(f"{cpu_count=}")
|
79 |
|
80 |
logger.info("load llm")
|
@@ -112,7 +113,7 @@ class GenerationConfig:
|
|
112 |
seed: int = 42
|
113 |
reset: bool = False
|
114 |
stream: bool = True
|
115 |
-
threads: int =
|
116 |
stop: list[str] = field(default_factory=lambda: prompt_prefix[1:2])
|
117 |
|
118 |
|
@@ -246,7 +247,7 @@ def predict_api(prompt):
|
|
246 |
seed=42,
|
247 |
reset=False, # reset history (cache)
|
248 |
stream=True, # TODO stream=False and generator
|
249 |
-
threads=
|
250 |
stop=prompt_prefix[1:2],
|
251 |
)
|
252 |
|
|
|
74 |
|
75 |
logger.debug(f"{model_loc} {file_size}GB")
|
76 |
|
77 |
+
_ = psutil.cpu_count(logical=False)
|
78 |
+
cpu_count: int = int(_) if _ else 1
|
79 |
logger.debug(f"{cpu_count=}")
|
80 |
|
81 |
logger.info("load llm")
|
|
|
113 |
seed: int = 42
|
114 |
reset: bool = False
|
115 |
stream: bool = True
|
116 |
+
threads: int = cpu_count
|
117 |
stop: list[str] = field(default_factory=lambda: prompt_prefix[1:2])
|
118 |
|
119 |
|
|
|
247 |
seed=42,
|
248 |
reset=False, # reset history (cache)
|
249 |
stream=True, # TODO stream=False and generator
|
250 |
+
threads=cpu_count,
|
251 |
stop=prompt_prefix[1:2],
|
252 |
)
|
253 |
|
requirements.txt
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
ctransformers # ==0.2.10
|
2 |
transformers # ==4.30.2
|
3 |
# huggingface_hub
|
4 |
-
gradio
|
5 |
loguru
|
6 |
about-time
|
7 |
psutil
|
|
|
1 |
ctransformers # ==0.2.10
|
2 |
transformers # ==4.30.2
|
3 |
# huggingface_hub
|
4 |
+
# gradio
|
5 |
loguru
|
6 |
about-time
|
7 |
psutil
|