uyen13 commited on
Commit
dd8f97d
·
verified ·
1 Parent(s): 43790d7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -19
app.py CHANGED
@@ -17,30 +17,30 @@ DB_FAISS_PATH = 'vectorstore/db_faiss'
17
 
18
  # Load the model of choice
19
  def load_llm():
20
- url = "https://huggingface.co/TheBloke/Llama-2-7B-Chat-GGML/blob/main/llama-2-7b-chat.ggmlv3.q4_K_M.bin" # 2.87G
21
 
22
- model_loc, file_size = dl_hf_model(url)
23
 
24
- llm = CTransformers(
25
- model=model_loc,
26
- temperature=0.2,
27
- model_type="llama",
28
- top_k=10,
29
- top_p=0.9,
30
- repetition_penalty=1.0,
31
- max_new_tokens=512, # adjust as needed
32
- seed=42,
33
- reset=True, # reset history (cache)
34
- stream=False,
35
- # threads=cpu_count,
36
- # stop=prompt_prefix[1:2],
37
 
38
 
39
- )
40
- # llm = G4FLLM(
41
- # model=models.gpt_35_turbo,
42
- # provider=Provider.Aichatos,
43
  # )
 
 
 
 
44
  # OPENAI_API_KEY = 'sk-nAqoChT9cmkAxALwMLdWT3BIbkFJcNHsH5Z5LN2ixPcDAopT'
45
  # llm =ChatOpenAI(openai_api_key=OPENAI_API_KEY,temperature=0)
46
  return llm
 
17
 
18
  # Load the model of choice
19
  def load_llm():
20
+ # url = "https://huggingface.co/TheBloke/Llama-2-7B-Chat-GGML/blob/main/llama-2-7b-chat.ggmlv3.q4_K_M.bin" # 2.87G
21
 
22
+ # model_loc, file_size = dl_hf_model(url)
23
 
24
+ # llm = CTransformers(
25
+ # model=model_loc,
26
+ # temperature=0.2,
27
+ # model_type="llama",
28
+ # top_k=10,
29
+ # top_p=0.9,
30
+ # repetition_penalty=1.0,
31
+ # max_new_tokens=512, # adjust as needed
32
+ # seed=42,
33
+ # reset=True, # reset history (cache)
34
+ # stream=False,
35
+ # # threads=cpu_count,
36
+ # # stop=prompt_prefix[1:2],
37
 
38
 
 
 
 
 
39
  # )
40
+ llm = G4FLLM(
41
+ model=models.gpt_35_turbo,
42
+ provider=Provider.Aichatos,
43
+ )
44
  # OPENAI_API_KEY = 'sk-nAqoChT9cmkAxALwMLdWT3BIbkFJcNHsH5Z5LN2ixPcDAopT'
45
  # llm =ChatOpenAI(openai_api_key=OPENAI_API_KEY,temperature=0)
46
  return llm