wq2012 commited on
Commit
e86895d
1 Parent(s): 857f266

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -22,7 +22,7 @@ print("Start the model init process")
22
  model = GPT4All(model_name=model_name,
23
  model_path=model_path,
24
  allow_download = False,
25
- evice="cpu")
26
  print("Finish the model init process")
27
 
28
  def generater(message, history):
@@ -37,12 +37,11 @@ def generater(message, history):
37
  streaming=True):
38
  outputs.append(token)
39
  completion = "".join(outputs)
 
40
  if completion.endswith(" [eod]"):
41
- transferred_completion = utils.transfer_llm_completion(completion, message)
42
- yield transferred_completion
43
- return
44
- else:
45
- yield completion
46
 
47
  def vote(data: gr.LikeData):
48
  if data.liked:
 
22
  model = GPT4All(model_name=model_name,
23
  model_path=model_path,
24
  allow_download = False,
25
+ device="cpu")
26
  print("Finish the model init process")
27
 
28
  def generater(message, history):
 
37
  streaming=True):
38
  outputs.append(token)
39
  completion = "".join(outputs)
40
+ yield completion
41
  if completion.endswith(" [eod]"):
42
+ break
43
+ transferred_completion = utils.transfer_llm_completion(completion, message)
44
+ yield transferred_completion
 
 
45
 
46
  def vote(data: gr.LikeData):
47
  if data.liked: