iamkdp commited on
Commit
f14975e
·
verified ·
1 Parent(s): 4052967

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -7
app.py CHANGED
@@ -3,19 +3,24 @@ from llama_cpp import Llama
3
  import os
4
  from huggingface_hub import hf_hub_download
5
 
6
- # Configuration
7
- MODEL_REPO = "TheBloke/Mistral-7B-Instruct-v0.3-GGUF"
8
- MODEL_FILE = "mistral-7b-instruct-v0.3.Q4_K_M.gguf"
9
- MAX_TOKENS = 150
10
- CPU_THREADS = os.cpu_count() or 4 # Use all available cores
11
 
12
- # Download model (will cache after first run)
13
  model_path = hf_hub_download(
14
  repo_id=MODEL_REPO,
15
  filename=MODEL_FILE,
16
- cache_dir="models"
17
  )
18
 
 
 
 
 
 
 
 
19
  # Initialize Llama
20
  llm = Llama(
21
  model_path=model_path,
 
3
  import os
4
  from huggingface_hub import hf_hub_download
5
 
6
+ # Verified working repositories (as of July 2024)
7
+ MODEL_REPO = "bartowski/Mistral-7B-Instruct-v0.3-GGUF"
8
+ MODEL_FILE = "Mistral-7B-Instruct-v0.3-Q4_K_M.gguf"
 
 
9
 
10
+ # Download model
11
  model_path = hf_hub_download(
12
  repo_id=MODEL_REPO,
13
  filename=MODEL_FILE,
14
+ token=os.environ.get("HF_TOKEN") # Required for gated models
15
  )
16
 
17
+
18
+ # Configuration
19
+ MODEL_REPO = "TheBloke/Mistral-7B-Instruct-v0.3-GGUF"
20
+ MODEL_FILE = "mistral-7b-instruct-v0.3.Q4_K_M.gguf"
21
+ MAX_TOKENS = 150
22
+ CPU_THREADS = os.cpu_count()
23
+
24
  # Initialize Llama
25
  llm = Llama(
26
  model_path=model_path,