lalanikarim commited on
Commit
8264991
1 Parent(s): 0388e20

added documentation for mac and gpu

Browse files
Files changed (1) hide show
  1. main.py +8 -1
main.py CHANGED
@@ -33,18 +33,25 @@ def create_chain(system_prompt):
33
  # callback_manager = CallbackManager([stream_handler])
34
 
35
  (repo_id, model_file_name) = ("TheBloke/Mistral-7B-Instruct-v0.1-GGUF",
36
- "mistral-7b-instruct-v0.1.Q5_0.gguf")
37
 
38
  model_path = hf_hub_download(repo_id=repo_id,
39
  filename=model_file_name,
40
  repo_type="model")
41
 
 
 
 
 
42
  llm = LlamaCpp(
43
  model_path=model_path,
44
  temperature=0,
45
  max_tokens=512,
46
  top_p=1,
47
  # callback_manager=callback_manager,
 
 
 
48
  verbose=False,
49
  streaming=True,
50
  )
 
33
  # callback_manager = CallbackManager([stream_handler])
34
 
35
  (repo_id, model_file_name) = ("TheBloke/Mistral-7B-Instruct-v0.1-GGUF",
36
+ "mistral-7b-instruct-v0.1.Q4_0.gguf")
37
 
38
  model_path = hf_hub_download(repo_id=repo_id,
39
  filename=model_file_name,
40
  repo_type="model")
41
 
42
+ # initialize LlamaCpp llm model
43
+ # n_gpu_layers, n_batch, and n_ctx are for GPU support.
44
+ # When not set, CPU will be used.
45
+ # set 1 for mac m2, and higher numbers based on your GPU support
46
  llm = LlamaCpp(
47
  model_path=model_path,
48
  temperature=0,
49
  max_tokens=512,
50
  top_p=1,
51
  # callback_manager=callback_manager,
52
+ # n_gpu_layers=1,
53
+ # n_batch=512,
54
+ # n_ctx=4096,
55
  verbose=False,
56
  streaming=True,
57
  )