research14 commited on
Commit
814e7e2
·
1 Parent(s): 5f92ddc

added theme

Browse files
Files changed (1) hide show
  1. app.py +21 -20
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
- #custom-textbox {
9
- background-color: #f2f2f2;
10
- color: #333;
11
- font-size: 16px;
12
- border: 2px solid #666;
13
- padding: 10px;
14
- }
15
- """
16
-
17
- # Custom JavaScript
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(id="custom-textbox", text="Enter text here...", style=custom_css, _js=custom_js), # Use custom CSS and JavaScript
28
- outputs=gr.Textbox(id="output-text", style=custom_css),
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()