api-mg / setup.sh
ibrahimlasfar's picture
update for cache
431e7f9
raw
history blame
931 Bytes
#!/usr/bin/env bash
set -e
# ุงู„ุชุญู‚ู‚ ู…ู† ูˆุฌูˆุฏ HF_TOKEN
if [ -z "$HF_TOKEN" ]; then
echo "โš ๏ธ ู…ุชุบูŠุฑ HF_TOKEN ุบูŠุฑ ู…ุนุฑู. ู‚ุฏ ูŠุชุณุจุจ ู‡ุฐุง ููŠ ูุดู„ ุชุญู…ูŠู„ ุงู„ู†ู…ูˆุฐุฌ."
fi
# ุฅู†ุดุงุก ู…ุฌู„ุฏ ู„ุชุฎุฒูŠู† ุงู„ู†ู…ูˆุฐุฌ
mkdir -p models
# ุชุญู…ูŠู„ ู…ู„ู .gguf ุฅุฐุง ู„ู… ูŠูƒู† ู…ูˆุฌูˆุฏู‹ุง ู…ุณุจู‚ู‹ุง
python - <<PY
from huggingface_hub import hf_hub_download
import os
repo_id = "TheBloke/Mistral-7B-Instruct-v0.1-GGUF"
filename = "mistral-7b-instruct-v0.1.Q4_K_M.gguf"
local_dir = "models"
if not os.path.exists(os.path.join(local_dir, filename)):
hf_hub_download(
repo_id=repo_id,
filename=filename,
local_dir=local_dir,
local_dir_use_symlinks=False,
force_download=False,
token=os.environ.get("HF_TOKEN")
)
print("โœ… ุชู… ุชุญู…ูŠู„ Mistral .gguf")
else:
print("โœ… ุงู„ู…ู„ู ู…ูˆุฌูˆุฏ ู…ุณุจู‚ู‹ุง")
PY