gururise commited on
Commit
1258158
·
1 Parent(s): 207b21e
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -108,10 +108,6 @@ def chat(
108
  ):
109
  global model
110
  history = history or []
111
-
112
- if len(history) == 0:
113
- # no history, so lets reset chat state
114
- model.resetState()
115
 
116
  if model == None:
117
  gc.collect()
@@ -119,6 +115,10 @@ def chat(
119
  torch.cuda.empty_cache()
120
  model = get_model()
121
 
 
 
 
 
122
  max_new_tokens = int(max_new_tokens)
123
  temperature = float(temperature)
124
  top_p = float(top_p)
 
108
  ):
109
  global model
110
  history = history or []
 
 
 
 
111
 
112
  if model == None:
113
  gc.collect()
 
115
  torch.cuda.empty_cache()
116
  model = get_model()
117
 
118
+ if len(history) == 0:
119
+ # no history, so lets reset chat state
120
+ model.resetState()
121
+
122
  max_new_tokens = int(max_new_tokens)
123
  temperature = float(temperature)
124
  top_p = float(top_p)