Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -23,6 +23,8 @@ body {
|
|
| 23 |
background-color: rgba(255, 255, 255, 0.85);
|
| 24 |
padding: 2rem;
|
| 25 |
border-radius: 12px;
|
|
|
|
|
|
|
| 26 |
width: 100%;
|
| 27 |
max-width: 700px;
|
| 28 |
height: 70vh;
|
|
@@ -51,17 +53,46 @@ def respond(message, history):
|
|
| 51 |
yield response
|
| 52 |
|
| 53 |
with gr.Blocks(css=css) as demo:
|
|
|
|
|
|
|
|
|
|
| 54 |
with gr.Column(elem_id="chat-panel"):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
gr.ChatInterface(
|
| 56 |
respond,
|
| 57 |
additional_inputs=[
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
]
|
| 63 |
)
|
| 64 |
|
| 65 |
if __name__ == "__main__":
|
| 66 |
demo.launch()
|
| 67 |
-
|
|
|
|
| 23 |
background-color: rgba(255, 255, 255, 0.85);
|
| 24 |
padding: 2rem;
|
| 25 |
border-radius: 12px;
|
| 26 |
+
justify-content: center;
|
| 27 |
+
justify-content: center;
|
| 28 |
width: 100%;
|
| 29 |
max-width: 700px;
|
| 30 |
height: 70vh;
|
|
|
|
| 53 |
yield response
|
| 54 |
|
| 55 |
with gr.Blocks(css=css) as demo:
|
| 56 |
+
# Title Markdown block
|
| 57 |
+
gr.Markdown("# 🇫🇷 French Tutor", elem_id="custom-title")
|
| 58 |
+
|
| 59 |
with gr.Column(elem_id="chat-panel"):
|
| 60 |
+
with gr.Accordion("⚙️ Advanced Settings", open=False):
|
| 61 |
+
system_message = gr.Textbox(
|
| 62 |
+
value="You are a helpful French tutor.",
|
| 63 |
+
label="System Message"
|
| 64 |
+
)
|
| 65 |
+
max_tokens = gr.Slider(
|
| 66 |
+
minimum=1,
|
| 67 |
+
maximum=2048,
|
| 68 |
+
value=512,
|
| 69 |
+
step=1,
|
| 70 |
+
label="Response Length"
|
| 71 |
+
)
|
| 72 |
+
temperature = gr.Slider(
|
| 73 |
+
minimum=0.1,
|
| 74 |
+
maximum=4.0,
|
| 75 |
+
value=0.7,
|
| 76 |
+
step=0.1,
|
| 77 |
+
label="Creativity"
|
| 78 |
+
)
|
| 79 |
+
top_p = gr.Slider(
|
| 80 |
+
minimum=0.1,
|
| 81 |
+
maximum=1.0,
|
| 82 |
+
value=0.95,
|
| 83 |
+
step=0.05,
|
| 84 |
+
label="Dynamic Text"
|
| 85 |
+
)
|
| 86 |
+
|
| 87 |
gr.ChatInterface(
|
| 88 |
respond,
|
| 89 |
additional_inputs=[
|
| 90 |
+
system_message,
|
| 91 |
+
max_tokens,
|
| 92 |
+
temperature,
|
| 93 |
+
top_p
|
| 94 |
]
|
| 95 |
)
|
| 96 |
|
| 97 |
if __name__ == "__main__":
|
| 98 |
demo.launch()
|
|
|