Spaces:
Sleeping
Sleeping
ffreemt
commited on
Commit
·
adb2c74
1
Parent(s):
6721fd3
Update 30b-Lazarus.ggmlv3.q3_K_S.bin
Browse files
README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
---
|
| 2 |
-
title: TheBloke/
|
| 3 |
emoji: 🚀
|
| 4 |
colorFrom: green
|
| 5 |
colorTo: green
|
|
|
|
| 1 |
---
|
| 2 |
+
title: TheBloke/30B-Lazarus-GGML
|
| 3 |
emoji: 🚀
|
| 4 |
colorFrom: green
|
| 5 |
colorTo: green
|
app.py
CHANGED
|
@@ -1,6 +1,5 @@
|
|
| 1 |
"""Run codes."""
|
| 2 |
# pylint: disable=line-too-long, broad-exception-caught, invalid-name, missing-function-docstring, too-many-instance-attributes, missing-class-docstring
|
| 3 |
-
# ruff: noqa: E501
|
| 4 |
import os
|
| 5 |
import time
|
| 6 |
from dataclasses import asdict, dataclass
|
|
@@ -14,7 +13,7 @@ from about_time import about_time
|
|
| 14 |
|
| 15 |
# from ctransformers import AutoConfig, AutoModelForCausalLM
|
| 16 |
from ctransformers import AutoModelForCausalLM
|
| 17 |
-
from huggingface_hub import hf_hub_download
|
| 18 |
from loguru import logger
|
| 19 |
|
| 20 |
filename_list = [
|
|
@@ -39,7 +38,9 @@ URL = "https://huggingface.co/TheBloke/Wizard-Vicuna-7B-Uncensored-GGML/raw/main
|
|
| 39 |
URL = "https://huggingface.co/TheBloke/30B-Lazarus-GGML/blob/main/30b-Lazarus.ggmlv3.q4_0.bin"
|
| 40 |
URL = "https://huggingface.co/TheBloke/30B-Lazarus-GGML/blob/main/30b-Lazarus.ggmlv3.q4_1.bin"
|
| 41 |
URL = "https://huggingface.co/TheBloke/30B-Lazarus-GGML/resolve/main/30b-Lazarus.ggmlv3.q4_K_M.bin"
|
| 42 |
-
URL = "https://huggingface.co/TheBloke/30B-Lazarus-GGML/resolve/main/30b-Lazarus.ggmlv3.q4_K_S.bin"
|
|
|
|
|
|
|
| 43 |
|
| 44 |
MODEL_FILENAME = Path(URL).name
|
| 45 |
|
|
@@ -48,7 +49,7 @@ MODEL_FILENAME = Path(URL).name
|
|
| 48 |
|
| 49 |
REPO_ID = "/".join(
|
| 50 |
urlparse(URL).path.strip("/").split("/")[:2]
|
| 51 |
-
)
|
| 52 |
# TheBloke/30B-Lazarus-GGML
|
| 53 |
# # TheBloke/Wizard-Vicuna-7B-Uncensored-GGML
|
| 54 |
|
|
@@ -291,7 +292,15 @@ llm = AutoModelForCausalLM.from_pretrained(
|
|
| 291 |
# """
|
| 292 |
|
| 293 |
logger.info(f"start dl, {REPO_ID=}, {MODEL_FILENAME=}, {DESTINATION_FOLDER=}")
|
| 294 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 295 |
logger.info("done dl")
|
| 296 |
|
| 297 |
logger.debug(f"{os.cpu_count()=} {psutil.cpu_count(logical=False)=}")
|
|
@@ -302,12 +311,17 @@ logger.debug(f"{cpu_count=}")
|
|
| 302 |
|
| 303 |
logger.info("load llm")
|
| 304 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 305 |
_ = Path("models", MODEL_FILENAME).absolute().as_posix()
|
| 306 |
logger.debug(f"model_file: {_}, exists: {Path(_).exists()}")
|
| 307 |
LLM = AutoModelForCausalLM.from_pretrained(
|
| 308 |
# "TheBloke/WizardCoder-15B-1.0-GGML",
|
| 309 |
-
REPO_ID, # DESTINATION_FOLDER, # model_path_or_repo_id: str required
|
| 310 |
-
model_file=_,
|
|
|
|
| 311 |
model_type="llama", # "starcoder", AutoConfig.from_pretrained(REPO_ID)
|
| 312 |
threads=cpu_count,
|
| 313 |
)
|
|
|
|
| 1 |
"""Run codes."""
|
| 2 |
# pylint: disable=line-too-long, broad-exception-caught, invalid-name, missing-function-docstring, too-many-instance-attributes, missing-class-docstring
|
|
|
|
| 3 |
import os
|
| 4 |
import time
|
| 5 |
from dataclasses import asdict, dataclass
|
|
|
|
| 13 |
|
| 14 |
# from ctransformers import AutoConfig, AutoModelForCausalLM
|
| 15 |
from ctransformers import AutoModelForCausalLM
|
| 16 |
+
from huggingface_hub import hf_hub_download, snapshot_download
|
| 17 |
from loguru import logger
|
| 18 |
|
| 19 |
filename_list = [
|
|
|
|
| 38 |
URL = "https://huggingface.co/TheBloke/30B-Lazarus-GGML/blob/main/30b-Lazarus.ggmlv3.q4_0.bin"
|
| 39 |
URL = "https://huggingface.co/TheBloke/30B-Lazarus-GGML/blob/main/30b-Lazarus.ggmlv3.q4_1.bin"
|
| 40 |
URL = "https://huggingface.co/TheBloke/30B-Lazarus-GGML/resolve/main/30b-Lazarus.ggmlv3.q4_K_M.bin"
|
| 41 |
+
URL = "https://huggingface.co/TheBloke/30B-Lazarus-GGML/resolve/main/30b-Lazarus.ggmlv3.q4_K_S.bin" # 18GB
|
| 42 |
+
|
| 43 |
+
URL = "https://huggingface.co/TheBloke/30B-Lazarus-GGML/blob/main/30b-Lazarus.ggmlv3.q3_K_S.bin" # 14GB
|
| 44 |
|
| 45 |
MODEL_FILENAME = Path(URL).name
|
| 46 |
|
|
|
|
| 49 |
|
| 50 |
REPO_ID = "/".join(
|
| 51 |
urlparse(URL).path.strip("/").split("/")[:2]
|
| 52 |
+
)
|
| 53 |
# TheBloke/30B-Lazarus-GGML
|
| 54 |
# # TheBloke/Wizard-Vicuna-7B-Uncensored-GGML
|
| 55 |
|
|
|
|
| 292 |
# """
|
| 293 |
|
| 294 |
logger.info(f"start dl, {REPO_ID=}, {MODEL_FILENAME=}, {DESTINATION_FOLDER=}")
|
| 295 |
+
|
| 296 |
+
# download_quant(DESTINATION_FOLDER, REPO_ID, MODEL_FILENAME)
|
| 297 |
+
snapshot_download(
|
| 298 |
+
repo_id=REPO_ID, # TheBloke/30B-Lazarus-GGML
|
| 299 |
+
allow_patterns=MODEL_FILENAME, # 30b-Lazarus.ggmlv3.q4_K_S.bin 18.3G
|
| 300 |
+
# revision="ggmlv3",
|
| 301 |
+
local_dir="models",
|
| 302 |
+
)
|
| 303 |
+
|
| 304 |
logger.info("done dl")
|
| 305 |
|
| 306 |
logger.debug(f"{os.cpu_count()=} {psutil.cpu_count(logical=False)=}")
|
|
|
|
| 311 |
|
| 312 |
logger.info("load llm")
|
| 313 |
|
| 314 |
+
# from ctransformers import AutoConfig
|
| 315 |
+
# AutoConfig(REPO_ID)
|
| 316 |
+
# AutoConfig(config='TheBloke/30B-Lazarus-GGML', model_type=None)
|
| 317 |
+
|
| 318 |
_ = Path("models", MODEL_FILENAME).absolute().as_posix()
|
| 319 |
logger.debug(f"model_file: {_}, exists: {Path(_).exists()}")
|
| 320 |
LLM = AutoModelForCausalLM.from_pretrained(
|
| 321 |
# "TheBloke/WizardCoder-15B-1.0-GGML",
|
| 322 |
+
# REPO_ID, # DESTINATION_FOLDER, # model_path_or_repo_id: str required
|
| 323 |
+
# model_file=_,
|
| 324 |
+
_,
|
| 325 |
model_type="llama", # "starcoder", AutoConfig.from_pretrained(REPO_ID)
|
| 326 |
threads=cpu_count,
|
| 327 |
)
|