Spaces:
Running
Running
marcofrodl
commited on
added new Mistral models
Browse files
app.py
CHANGED
@@ -70,33 +70,37 @@ with gr.Blocks(title="Mistral Playground", css=css) as mistral_playground:
|
|
70 |
gr.Markdown("Thinktecture Mistral AI Playground", elem_classes="header-text")
|
71 |
|
72 |
with gr.Row(variant='panel'):
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
|
|
|
|
|
|
79 |
with gr.Row(variant='panel'):
|
80 |
-
temperature = gr.Slider(minimum=0.
|
81 |
-
top_p = gr.Slider(minimum=0.
|
82 |
-
max_tokens = gr.Slider(minimum=
|
83 |
|
84 |
with gr.Row(variant='panel'):
|
85 |
system = gr.Textbox(lines=2, label="System Message", value="You are a helpful AI assistant")
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
|
|
99 |
with gr.Row():
|
100 |
-
gr.HTML(value="<p style='margin-top: 1rem; margin-bottom: 1rem; text-align: center;'>Developed by Marco Frodl, Principal Consultant for Generative AI @ <a href='https://go.mfr.one/tt-en' _target='blank'>Thinktecture AG</a> -- Released
|
101 |
|
102 |
mistral_playground.launch()
|
|
|
70 |
gr.Markdown("Thinktecture Mistral AI Playground", elem_classes="header-text")
|
71 |
|
72 |
with gr.Row(variant='panel'):
|
73 |
+
with gr.Column(scale=5):
|
74 |
+
api_key = gr.Textbox(type='password', placeholder='Your Mistral AI API key', lines=1, label="Mistral AI API Key")
|
75 |
+
with gr.Column(scale=7):
|
76 |
+
model = gr.Radio(
|
77 |
+
label="Mistral AI Model",
|
78 |
+
choices=[["7B","open-mistral-7b"], ["8x7B","open-mixtral-8x7b"], ["Small","mistral-small-latest"], ["Medium","mistral-medium-latest"], ["8x22B","open-mixtral-8x22b"], ["Large","mistral-large-latest"], ["Codestral","codestral-latest"]],
|
79 |
+
value="mistral-large-latest",
|
80 |
+
)
|
81 |
+
|
82 |
with gr.Row(variant='panel'):
|
83 |
+
temperature = gr.Slider(label="Temperature", minimum=0.0, maximum=1.0, step=0.1, value=0.1)
|
84 |
+
top_p = gr.Slider(label="Top P", minimum=0.0, maximum=1.0, step=0.01, value=0.95)
|
85 |
+
max_tokens = gr.Slider(label="Max Tokens", minimum=1000, maximum=32000, step=1000, value=8000)
|
86 |
|
87 |
with gr.Row(variant='panel'):
|
88 |
system = gr.Textbox(lines=2, label="System Message", value="You are a helpful AI assistant")
|
89 |
+
|
90 |
+
gr.ChatInterface(
|
91 |
+
respond_stream,
|
92 |
+
chatbot=gr.Chatbot(render=False, height=500, layout="panel"),
|
93 |
+
additional_inputs=[
|
94 |
+
api_key,
|
95 |
+
model,
|
96 |
+
temperature,
|
97 |
+
top_p,
|
98 |
+
max_tokens,
|
99 |
+
system,
|
100 |
+
],
|
101 |
+
)
|
102 |
+
|
103 |
with gr.Row():
|
104 |
+
gr.HTML(value="<p style='margin-top: 1rem; margin-bottom: 1rem; text-align: center;'>Developed by Marco Frodl, Principal Consultant for Generative AI @ <a href='https://go.mfr.one/tt-en' _target='blank'>Thinktecture AG</a> -- Released 06/09/2024 -- More about me on my <a href='https://go.mfr.one/marcofrodl-en' _target='blank'>profile page</a></p>")
|
105 |
|
106 |
mistral_playground.launch()
|