Spaces:
Running
Running
Update app.py
Browse files
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 = "
|
8 |
|
9 |
def format_prompt(message, history=[]):
|
10 |
prompt = "<s>"
|
@@ -40,32 +40,12 @@ def generate(prompt, temperature=0.9, max_new_tokens=256, top_p=0.95, repetition
|
|
40 |
yield output.strip('</s>')
|
41 |
return output.strip('</s>')
|
42 |
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
background-color: #121212;
|
51 |
-
color: #ffffff;
|
52 |
-
}
|
53 |
-
input, textarea, select {
|
54 |
-
background-color: #333333 !important;
|
55 |
-
color: #ffffff !important;
|
56 |
-
border-color: #555555 !important;
|
57 |
-
}
|
58 |
-
.gradio-container button {
|
59 |
-
background-color: #555555 !important;
|
60 |
-
color: #ffffff !important;
|
61 |
-
}
|
62 |
-
"""
|
63 |
|
64 |
-
|
65 |
-
fn=generate,
|
66 |
-
inputs=gr.Textbox(placeholder="Enter your prompt here...", label="Prompt"),
|
67 |
-
outputs=gr.Textbox(label="Output", interactive=True, lines=10),
|
68 |
-
theme="compact", # Use compact theme for default layout
|
69 |
-
css=dark_theme() # Apply dark theme styles
|
70 |
-
) as app:
|
71 |
-
app.launch()
|
|
|
4 |
client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
|
5 |
|
6 |
# Your system prompt
|
7 |
+
SYSTEM_PROMPT = "Enhance and rewrite the prompt in sentence form without changing the essence"
|
8 |
|
9 |
def format_prompt(message, history=[]):
|
10 |
prompt = "<s>"
|
|
|
40 |
yield output.strip('</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()
|
|
|
|
|
|
|
|
|
|
|
|
|
|