Amirizaniani commited on
Commit
050e234
1 Parent(s): 78c73f5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -9
app.py CHANGED
@@ -14,12 +14,9 @@ def generate_prompts(user_input):
14
  input_variables=["Question"],
15
  template=f"Just list 10 quetion prompts for {user_input} and don't put number before each of the prompts."
16
  )
17
- llm = CTransformers(
18
- model="llama-2-7b-chat.ggmlv3.q8_0.bin",
19
- model_type="llama",
20
- max_new_tokens=512,
21
- temperature=0.5
22
- )
23
  hub_chain = LLMChain(prompt = prompt_template, llm = llm)
24
  input_data = {"Question": user_input}
25
 
@@ -36,10 +33,9 @@ def answer_question(prompt):
36
  input_variables=["Question"],
37
  template=f"give one answer for {prompt} and do not consider the number behind it."
38
  )
39
- config = {'max_new_tokens': 2048, 'temperature': 0.7, 'context_length': 4096}
40
  llm = CTransformers(model="TheBloke/Llama-2-7B-Chat-GGML",
41
- config=config,
42
- threads=os.cpu_count())
43
  hub_chain = LLMChain(prompt = prompt_template, llm = llm)
44
  input_data = {"Question": prompt}
45
  generated_answer = hub_chain.run(input_data)
 
14
  input_variables=["Question"],
15
  template=f"Just list 10 quetion prompts for {user_input} and don't put number before each of the prompts."
16
  )
17
+ config = {'max_new_tokens': 512, 'temperature': 0.7, 'context_length': 512}
18
+ llm = CTransformers(model="TheBloke/Mistral-7B-Instruct-v0.1-GGUF",
19
+ config=config)
 
 
 
20
  hub_chain = LLMChain(prompt = prompt_template, llm = llm)
21
  input_data = {"Question": user_input}
22
 
 
33
  input_variables=["Question"],
34
  template=f"give one answer for {prompt} and do not consider the number behind it."
35
  )
36
+ config = {'max_new_tokens': 512, 'temperature': 0.7, 'context_length': 512}
37
  llm = CTransformers(model="TheBloke/Llama-2-7B-Chat-GGML",
38
+ config=config)
 
39
  hub_chain = LLMChain(prompt = prompt_template, llm = llm)
40
  input_data = {"Question": prompt}
41
  generated_answer = hub_chain.run(input_data)