marcofrodl commited on
Commit
912cf21
·
verified ·
1 Parent(s): 368d204

added new Mistral models

Browse files
Files changed (1) hide show
  1. app.py +27 -23
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
- api_key = gr.Textbox(type='password', placeholder='Your Mistral AI API key', lines=1, label="Mistral AI API Key")
74
- model = gr.Radio(
75
- label="Model",
76
- choices=[["Mistral-7B","open-mistral-7b"], ["Mixtral-8x7B","open-mixtral-8x7b"], ["Mistral Small","mistral-small-latest"], ["Mistral Medium","mistral-medium-latest"], ["Mistral Large","mistral-large-latest"]],
77
- value="mistral-large-latest",
78
- )
 
 
 
79
  with gr.Row(variant='panel'):
80
- temperature = gr.Slider(minimum=0.01, maximum=1.0, value=0.2, step=0.1, label="Temperature")
81
- top_p = gr.Slider(minimum=0.01, maximum=1.0, step=0.01, label="Top P", value=0.95)
82
- max_tokens = gr.Slider(minimum=1, maximum=16000, step=500, label="Max Tokens", value=4000)
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
- with gr.Row(variant='panel'):
88
- gr.ChatInterface(
89
- respond_stream,
90
- additional_inputs=[
91
- api_key,
92
- model,
93
- temperature,
94
- top_p,
95
- max_tokens,
96
- system,
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 02/26/2024 -- More about me on my <a href='https://go.mfr.one/marcofrodl-en' _target='blank'>profile page</a></p>")
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()