vericudebuget commited on
Commit
b5cdba7
1 Parent(s): 86a1cdb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -15,13 +15,14 @@ def format_prompt(message, history):
15
  return prompt
16
 
17
  def generate(prompt, history, system_prompt, temperature=0.9, max_new_tokens=9048, top_p=0.95, repetition_penalty=1.0):
18
- temperature = max(float(temperature), 1e-2)
19
- top_p = float(top_p)
20
-
21
- if 'chat_history' in localStorage:
22
  history = JSON.parse(localStorage.getItem('chat_history'))
23
  else:
24
  history = []
 
 
 
25
 
26
  generate_kwargs = dict(
27
  temperature=temperature,
 
15
  return prompt
16
 
17
  def generate(prompt, history, system_prompt, temperature=0.9, max_new_tokens=9048, top_p=0.95, repetition_penalty=1.0):
18
+ # Load history from local storage
19
+ if 'chat_history' in localStorage:
 
 
20
  history = JSON.parse(localStorage.getItem('chat_history'))
21
  else:
22
  history = []
23
+
24
+ temperature = max(float(temperature), 1e-2)
25
+ top_p = float(top_p)
26
 
27
  generate_kwargs = dict(
28
  temperature=temperature,