Omnibus commited on
Commit
4e1fd51
1 Parent(s): 2ff5df7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -9,7 +9,7 @@ client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
9
 
10
  def format_prompt(message, history):
11
  prompt = "<s>"
12
- if not history==("",""):
13
  for user_prompt, bot_response in history:
14
  prompt += f"[INST] {user_prompt} [/INST]"
15
  prompt += f" {bot_response}</s> "
@@ -19,7 +19,7 @@ def format_prompt(message, history):
19
 
20
  def chat_inf(system_prompt,prompt,history):
21
  if not history:
22
- history = ("","")
23
 
24
  seed = random.randint(1,1111111111111111)
25
  generate_kwargs = dict(
@@ -36,7 +36,7 @@ def chat_inf(system_prompt,prompt,history):
36
  output = ""
37
  for response in stream:
38
  output += response.token.text
39
- yield [history,(prompt,output)]
40
 
41
 
42
 
 
9
 
10
  def format_prompt(message, history):
11
  prompt = "<s>"
12
+ if history:
13
  for user_prompt, bot_response in history:
14
  prompt += f"[INST] {user_prompt} [/INST]"
15
  prompt += f" {bot_response}</s> "
 
19
 
20
  def chat_inf(system_prompt,prompt,history):
21
  if not history:
22
+ history = []
23
 
24
  seed = random.randint(1,1111111111111111)
25
  generate_kwargs = dict(
 
36
  output = ""
37
  for response in stream:
38
  output += response.token.text
39
+ yield [(prompt,output)]
40
 
41
 
42