KingNish commited on
Commit
68f77aa
1 Parent(s): 32a93fe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -6
app.py CHANGED
@@ -22,17 +22,18 @@ def models(text, model="Mixtral 8x7B"):
22
 
23
  generate_kwargs = dict(
24
  max_new_tokens=300,
 
25
  )
26
 
27
  formatted_prompt = system_instructions1 + text + "[ANSWER]"
28
- stream = client.text_generation(
29
- formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
30
  output = ""
31
  for response in stream:
32
- if not response.token.text == "</s>":
33
- output += response.token.text
34
- if output.endswith("<|assistant|>"):
35
- output = output[:-13]
 
36
  return output
37
 
38
  description="""# Chat GO
 
22
 
23
  generate_kwargs = dict(
24
  max_new_tokens=300,
25
+ do_sample=True,
26
  )
27
 
28
  formatted_prompt = system_instructions1 + text + "[ANSWER]"
29
+ stream = client.text_generation(formatted_prompt, **generate_kwargs, stream=True, details=True, return_full_text=False)
 
30
  output = ""
31
  for response in stream:
32
+ output+=response.token.text
33
+ if output.endswith("<|assistant|>"):
34
+ output = output[:-13]
35
+ elif output.endswith("</s>"):
36
+ output = output[:-4]
37
  return output
38
 
39
  description="""# Chat GO