Nick088 commited on
Commit
1822503
·
verified ·
1 Parent(s): 3f084c7

Update app.py

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