Spaces:
Runtime error
Runtime error
Commit
·
814e7e2
1
Parent(s):
5f92ddc
added theme
Browse files
app.py
CHANGED
@@ -1,32 +1,33 @@
|
|
1 |
import gradio as gr
|
2 |
|
|
|
|
|
|
|
3 |
def echo_text(input_text):
|
4 |
return input_text
|
5 |
|
6 |
-
# Custom CSS
|
7 |
custom_css = """
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
}
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
custom_js = """
|
19 |
-
document.getElementById("custom-textbox").addEventListener("input", function() {
|
20 |
-
var inputValue = this.value;
|
21 |
-
document.getElementById("output-text").value = inputValue;
|
22 |
-
});
|
23 |
"""
|
24 |
|
25 |
iface = gr.Interface(
|
26 |
fn=echo_text,
|
27 |
-
inputs=gr.Textbox(
|
28 |
-
outputs=gr.Textbox(
|
29 |
-
live=True
|
|
|
|
|
|
|
|
|
30 |
)
|
31 |
|
32 |
-
iface.launch()
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
+
theme = gr.themes.Soft()
|
4 |
+
|
5 |
+
# Define a function that echoes the input text
|
6 |
def echo_text(input_text):
|
7 |
return input_text
|
8 |
|
|
|
9 |
custom_css = """
|
10 |
+
.gr-textbox {
|
11 |
+
background-color: rgb(79, 129, 145);
|
12 |
+
color: #333;
|
13 |
+
font-size: 16px;
|
14 |
+
border: 2px solid #666;
|
15 |
+
padding: 10px;
|
16 |
+
}
|
17 |
+
.gr-textbox:focus {
|
18 |
+
border: 2px solid #009688;
|
19 |
+
}
|
|
|
|
|
|
|
|
|
|
|
20 |
"""
|
21 |
|
22 |
iface = gr.Interface(
|
23 |
fn=echo_text,
|
24 |
+
inputs=gr.Textbox(text="Enter text here...", style=custom_css),
|
25 |
+
outputs=gr.Textbox(style=custom_css),
|
26 |
+
live=True,
|
27 |
+
title="LLM Evaluator with Linguistic Scrutiny",
|
28 |
+
width=500,
|
29 |
+
height=200,
|
30 |
+
theme=theme
|
31 |
)
|
32 |
|
33 |
+
iface.launch()
|