Prabhash commited on
Commit
7bf48ef
1 Parent(s): 92b0d2a

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +2 -2
main.py CHANGED
@@ -5,7 +5,7 @@ from pydantic import BaseModel
5
  #Model loading
6
  llm = AutoModelForCausalLM.from_pretrained("TheBloke/Llama-2-7B-Chat-GGUF",
7
  model_type='llama',
8
- # max_new_tokens = 4096,
9
  threads = 3,
10
  )
11
 
@@ -20,7 +20,7 @@ app = FastAPI()
20
  #Zephyr completion
21
  @app.post("/llm_on_cpu")
22
  async def stream(item: validation):
23
- system_prompt = 'You are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature. If a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information.'
24
  prompt = f'''
25
  [INST] <<SYS>>
26
  {system_prompt}
 
5
  #Model loading
6
  llm = AutoModelForCausalLM.from_pretrained("TheBloke/Llama-2-7B-Chat-GGUF",
7
  model_type='llama',
8
+ max_new_tokens = 4096,
9
  threads = 3,
10
  )
11
 
 
20
  #Zephyr completion
21
  @app.post("/llm_on_cpu")
22
  async def stream(item: validation):
23
+ system_prompt = "You are a helpful, respectful and honest assistant. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature. If a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information."
24
  prompt = f'''
25
  [INST] <<SYS>>
26
  {system_prompt}