File size: 1,446 Bytes
23be6d3
 
 
2f80b15
c6b5a6a
2f80b15
c6b5a6a
23be6d3
2f80b15
23be6d3
 
 
 
1cb386c
23be6d3
431e7f9
23be6d3
 
 
 
 
6a5d1ac
23be6d3
 
 
2f80b15
1cf32f2
2f80b15
 
 
 
 
 
 
 
 
 
 
 
6a5d1ac
2f80b15
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/usr/bin/env bash
set -e

# ุฅู†ุดุงุก ู…ุฌู„ุฏุงุช ู„ุชุฎุฒูŠู† ุงู„ู†ู…ุงุฐุฌ ูˆุงู„ู€ cache
mkdir -p models /app/.cache/huggingface/hub
chown -R appuser:appuser models /app/.cache/huggingface
chmod -R 755 /app/.cache/huggingface

# ุชุญู…ูŠู„ ู…ู„ู Mistral .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.Q2_K.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
    )
    print("โœ… ุชู… ุชุญู…ูŠู„ Mistral .gguf")
else:
    print("โœ… ู…ู„ู Mistral .gguf ู…ูˆุฌูˆุฏ ู…ุณุจู‚ู‹ุง")
PY

# ุชุญู…ูŠู„ ู†ู…ูˆุฐุฌ MGZON-FLAN-T5 ุฅุฐุง ู„ู… ูŠูƒู† ู…ูˆุฌูˆุฏู‹ุง ู…ุณุจู‚ู‹ุง
python - <<PY
from huggingface_hub import snapshot_download
import os
repo_id   = "MGZON/mgzon-flan-t5-base"
local_dir = "/app/.cache/huggingface/hub/models--MGZON--mgzon-flan-t5-base/snapshots"
if not os.path.exists(local_dir):
    snapshot_download(
        repo_id=repo_id,
        local_dir=local_dir,
        local_dir_use_symlinks=False,
        force_download=False
    )
    print("โœ… ุชู… ุชุญู…ูŠู„ MGZON-FLAN-T5")
else:
    print("โœ… ู…ู„ูุงุช MGZON-FLAN-T5 ู…ูˆุฌูˆุฏุฉ ู…ุณุจู‚ู‹ุง")
PY