Cenaashoori commited on
Commit
48e8a0e
1 Parent(s): c371376

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -4,17 +4,17 @@ import gradio as gr
4
  client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
5
 
6
  def format_prompt(message, history):
7
- # prompt = "<s>"
8
- # for user_prompt, bot_response in history:
9
- # prompt += f"[INST] {user_prompt} [/INST]"
10
- # prompt += f" {bot_response}</s> "
11
  prompt = f"[INST] {message} [/INST]"
12
  return prompt
13
 
14
  def generate(
15
  prompt, history, temperature=0.2, max_new_tokens=16392, top_p=0.95, repetition_penalty=1.0,
16
  ):
17
- temperature = float(1e-2)
18
  if temperature < 1e-2:
19
  temperature = 1e-2
20
  top_p = float(top_p)
 
4
  client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
5
 
6
  def format_prompt(message, history):
7
+ prompt = "<s>"
8
+ for user_prompt, bot_response in history:
9
+ prompt += f"[INST] {user_prompt} [/INST]"
10
+ prompt += f" {bot_response}</s> "
11
  prompt = f"[INST] {message} [/INST]"
12
  return prompt
13
 
14
  def generate(
15
  prompt, history, temperature=0.2, max_new_tokens=16392, top_p=0.95, repetition_penalty=1.0,
16
  ):
17
+ temperature = float(0)
18
  if temperature < 1e-2:
19
  temperature = 1e-2
20
  top_p = float(top_p)