mrbeliever commited on
Commit
99f3214
·
verified ·
1 Parent(s): 99a65f9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -8
app.py CHANGED
@@ -4,7 +4,7 @@ import gradio as gr
4
  client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
5
 
6
  # Your system prompt
7
- SYSTEM_PROMPT = "You are a prompt enhancer and your work is to enhance the given prompt under 100 words without changing the essence, only write the enhanced prompt and nothing else"
8
 
9
  def format_prompt(message, history=[]):
10
  prompt = "<s>"
@@ -41,13 +41,11 @@ def generate(prompt, temperature=0.9, max_new_tokens=256, top_p=0.95, repetition
41
  return output.strip('</s>')
42
 
43
  with gr.Blocks() as demo:
44
- with gr.Row():
45
- input_text = gr.Textbox(placeholder="Enter your prompt here...", lines=2, max_lines=2, label="Prompt",
46
- elem_id="input_text", css={"background-color": "#333", "color": "#fff", "border-color": "#555"})
47
- submit_button = gr.Button("Generate", elem_id="submit_button", css={"background-color": "#555", "color": "#fff"})
48
- output_text = gr.Textbox(label="Output", interactive=True, lines=10,
49
- elem_id="output_text", css={"background-color": "#333", "color": "#fff", "border-color": "#555"})
50
 
51
  submit_button.click(fn=generate, inputs=input_text, outputs=output_text)
52
 
53
- demo.launch()
 
4
  client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
5
 
6
  # Your system prompt
7
+ SYSTEM_PROMPT = "You are a prompt enhancer and your work is to enhance the given prompt under 100 words without changing the essence, only write the enhance prompt and nothing else"
8
 
9
  def format_prompt(message, history=[]):
10
  prompt = "<s>"
 
41
  return output.strip('</s>')
42
 
43
  with gr.Blocks() as demo:
44
+ input_text = gr.Textbox(placeholder="Enter your prompt here...", lines=2, max_lines=2, label="Prompt")
45
+ submit_button = gr.Button("Generate")
46
+ output_text = gr.Textbox(label="Output", interactive=True, lines=10)
47
+
 
 
48
 
49
  submit_button.click(fn=generate, inputs=input_text, outputs=output_text)
50
 
51
+ demo.launch()