K00B404 commited on
Commit
17ffb0c
1 Parent(s): 83dc5a3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -10
app.py CHANGED
@@ -1,19 +1,17 @@
1
  from huggingface_hub import InferenceClient
2
  import gradio as gr
3
 
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=256, top_p=0.95, repetition_penalty=1.0,
16
- ):
17
  temperature = float(temperature)
18
  if temperature < 1e-2:
19
  temperature = 1e-2
@@ -39,12 +37,11 @@ def generate(
39
  return output
40
 
41
 
42
- mychatbot = gr.Chatbot(
43
- avatar_images=["./user.png", "./botm.png"], bubble_full_width=False, show_label=False, show_copy_button=True, likeable=True,)
44
 
45
  demo = gr.ChatInterface(fn=generate,
46
  chatbot=mychatbot,
47
- title="Tomoniai's Mixtral 8x7b Chat",
48
  retry_btn=None,
49
  undo_btn=None
50
  )
 
1
  from huggingface_hub import InferenceClient
2
  import gradio as gr
3
 
4
+ client = InferenceClient("""K00B404/BagOMistral_14X_Coders-ties-7B")
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(prompt, history, temperature=0.2, max_new_tokens=256, top_p=0.95, repetition_penalty=1.0):
 
 
15
  temperature = float(temperature)
16
  if temperature < 1e-2:
17
  temperature = 1e-2
 
37
  return output
38
 
39
 
40
+ mychatbot = gr.Chatbot(avatar_images=["./user.png", "./botm.png"], bubble_full_width=False, show_label=False, show_copy_button=True, likeable=True)
 
41
 
42
  demo = gr.ChatInterface(fn=generate,
43
  chatbot=mychatbot,
44
+ title="K00B404's Merged Models Test Chat",
45
  retry_btn=None,
46
  undo_btn=None
47
  )