Dawoodthouseef commited on
Commit
f3998aa
1 Parent(s): 9fe474c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -31,15 +31,15 @@ conversation_history = []
31
 
32
  # Prediction function
33
  def predict(message, system_prompt='', temperature=0.7, max_new_tokens=4096,Topp=0.5,Repetitionpenalty=1.2):
 
34
  with st.status("Starting client"):
35
  sleep(2)
36
  st.write("Requesting client")
37
  with st.status("Requesting LLama-2"):
38
  st.write("Requesting API")
39
- global conversation_history
40
  # Append the user's input to the conversation history
41
  conversation_history.append({"role": "system", "content": input_text})
42
- response_text = model(ins.format(question))
43
  conversation_history.append({"role": "user", "content": input_text})
44
  conversation_history.append({"role": "assistant", "content": response_text})
45
  return response_text
 
31
 
32
  # Prediction function
33
  def predict(message, system_prompt='', temperature=0.7, max_new_tokens=4096,Topp=0.5,Repetitionpenalty=1.2):
34
+ global conversation_history
35
  with st.status("Starting client"):
36
  sleep(2)
37
  st.write("Requesting client")
38
  with st.status("Requesting LLama-2"):
39
  st.write("Requesting API")
 
40
  # Append the user's input to the conversation history
41
  conversation_history.append({"role": "system", "content": input_text})
42
+ response_text = model(ins.format(question),temperature=temperature,max_new_tokens=max_new_tokens,top_p=Topp,repetition_penality=Repetitionpenalty)
43
  conversation_history.append({"role": "user", "content": input_text})
44
  conversation_history.append({"role": "assistant", "content": response_text})
45
  return response_text