Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -37,7 +37,7 @@ css = """
|
|
37 |
PLACEHOLDER = """
|
38 |
<div class="message-bubble-border" style="display:flex; max-width: 600px; border-radius: 8px; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); backdrop-filter: blur(10px);">
|
39 |
<figure style="margin: 0;">
|
40 |
-
<img src="https://huggingface.co/spaces/baconnier/
|
41 |
</figure>
|
42 |
<div style="padding: .5rem 1.5rem;">
|
43 |
<h2 style="text-align: left; font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem;"> </h2>
|
@@ -127,17 +127,20 @@ torch_dtype=torch.bfloat16
|
|
127 |
# Create Gradio interface
|
128 |
gr.ChatInterface(
|
129 |
predict,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
css=css,
|
131 |
title=EMOJI + " " + MODEL_NAME+" 🇫🇷",
|
132 |
description=DESCRIPTION,
|
133 |
-
examples=[
|
134 |
-
['Pourquoi les Français portent-ils toujours une baguette sous le bras ?'],
|
135 |
-
['Comment un Français peut-il survivre sans fromage pendant plus de 24h ?'],
|
136 |
-
['Pourquoi les serveurs parisiens sont-ils si "charmants" avec les touristes ?'],
|
137 |
-
['Est-il vrai que les Français font la grève plus souvent qu ils ne travaillent ?'],
|
138 |
-
['Comment les Français trouvent-ils le temps de faire une pause déjeuner de 2 heures ?'],
|
139 |
-
['Pourquoi les Français disent-ils bof à tout ?']
|
140 |
-
],
|
141 |
additional_inputs_accordion=gr.Accordion(label="⚙️ Parameters", open=False),
|
142 |
additional_inputs=[
|
143 |
gr.Textbox(SYSTEM_MESSAGE, label="System prompt", visible=False), # Hidden system prompt
|
@@ -148,5 +151,10 @@ gr.ChatInterface(
|
|
148 |
gr.Slider(0, 2, 1.1, label="Repetition penalty"),
|
149 |
gr.Slider(0, 1, 0.95, label="Top P sampling"),
|
150 |
],
|
151 |
-
chatbot=gr.Chatbot(scale=1, placeholder=PLACEHOLDER)
|
|
|
|
|
|
|
|
|
|
|
152 |
).queue().launch()
|
|
|
37 |
PLACEHOLDER = """
|
38 |
<div class="message-bubble-border" style="display:flex; max-width: 600px; border-radius: 8px; box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); backdrop-filter: blur(10px);">
|
39 |
<figure style="margin: 0;">
|
40 |
+
<img src="https://huggingface.co/spaces/baconnier/NAPOLEON2/resolve/main/napoleon.jpg" style="width: 100%; height: 100%; border-radius: 8px;">
|
41 |
</figure>
|
42 |
<div style="padding: .5rem 1.5rem;">
|
43 |
<h2 style="text-align: left; font-size: 1.5rem; font-weight: 700; margin-bottom: 0.5rem;"> </h2>
|
|
|
127 |
# Create Gradio interface
|
128 |
gr.ChatInterface(
|
129 |
predict,
|
130 |
+
theme=gr.themes.Soft(primary_hue="indigo", secondary_hue="blue", neutral_hue="gray",font=[gr.themes.GoogleFont("Exo"), "ui-sans-serif", "system-ui", "sans-serif"]).set(
|
131 |
+
body_background_fill_dark="#0f172a",
|
132 |
+
block_background_fill_dark="#0f172a",
|
133 |
+
block_border_width="1px",
|
134 |
+
block_title_background_fill_dark="#070d1b",
|
135 |
+
#input_background_fill_dark="#0c1425",
|
136 |
+
button_secondary_background_fill_dark="#070d1b",
|
137 |
+
border_color_primary_dark="#21293b",
|
138 |
+
background_fill_secondary_dark="#0f172a",
|
139 |
+
color_accent_soft_dark="transparent"
|
140 |
+
),
|
141 |
css=css,
|
142 |
title=EMOJI + " " + MODEL_NAME+" 🇫🇷",
|
143 |
description=DESCRIPTION,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
additional_inputs_accordion=gr.Accordion(label="⚙️ Parameters", open=False),
|
145 |
additional_inputs=[
|
146 |
gr.Textbox(SYSTEM_MESSAGE, label="System prompt", visible=False), # Hidden system prompt
|
|
|
151 |
gr.Slider(0, 2, 1.1, label="Repetition penalty"),
|
152 |
gr.Slider(0, 1, 0.95, label="Top P sampling"),
|
153 |
],
|
154 |
+
chatbot=gr.Chatbot(scale=1, placeholder=PLACEHOLDER),
|
155 |
+
examples=[
|
156 |
+
['Comment un Français peut-il survivre sans fromage pendant plus de 24h ?'],
|
157 |
+
['Pourquoi les serveurs parisiens sont-ils si "charmants" avec les touristes ?'],
|
158 |
+
['Est-il vrai que les Français font la grève plus souvent qu ils ne travaillent ?'],
|
159 |
+
],
|
160 |
).queue().launch()
|