Update app.py
Browse files
app.py
CHANGED
|
@@ -62,13 +62,13 @@ def generate_text(input_text, selected_model, history):
|
|
| 62 |
|
| 63 |
# Inject custom CSS directly into the Gradio interface for scrollbars
|
| 64 |
css = """
|
| 65 |
-
|
| 66 |
height: 150px;
|
| 67 |
overflow: auto;
|
| 68 |
border: 1px solid #ddd;
|
| 69 |
padding: 10px;
|
| 70 |
}
|
| 71 |
-
|
| 72 |
height: 300px;
|
| 73 |
overflow: auto;
|
| 74 |
border: 1px solid #ddd;
|
|
@@ -85,8 +85,8 @@ iface = gr.Interface(
|
|
| 85 |
gr.State() # This is where we maintain the history state (input)
|
| 86 |
],
|
| 87 |
outputs=[
|
| 88 |
-
gr.Textbox(label="Response", placeholder="Response will be shown here",
|
| 89 |
-
gr.Textbox(label="History", placeholder="Interaction history will be shown here", lines=10, interactive=False,
|
| 90 |
gr.State() # History needs to be output as well
|
| 91 |
],
|
| 92 |
title="Chat with OpenRouter Models",
|
|
|
|
| 62 |
|
| 63 |
# Inject custom CSS directly into the Gradio interface for scrollbars
|
| 64 |
css = """
|
| 65 |
+
.output-textbox {
|
| 66 |
height: 150px;
|
| 67 |
overflow: auto;
|
| 68 |
border: 1px solid #ddd;
|
| 69 |
padding: 10px;
|
| 70 |
}
|
| 71 |
+
.history-textbox {
|
| 72 |
height: 300px;
|
| 73 |
overflow: auto;
|
| 74 |
border: 1px solid #ddd;
|
|
|
|
| 85 |
gr.State() # This is where we maintain the history state (input)
|
| 86 |
],
|
| 87 |
outputs=[
|
| 88 |
+
gr.Textbox(label="Response", placeholder="Response will be shown here", elem_classes=["output-textbox"]),
|
| 89 |
+
gr.Textbox(label="History", placeholder="Interaction history will be shown here", lines=10, interactive=False, elem_classes=["history-textbox"]),
|
| 90 |
gr.State() # History needs to be output as well
|
| 91 |
],
|
| 92 |
title="Chat with OpenRouter Models",
|