Joe7oo7 commited on
Commit
897e561
·
verified ·
1 Parent(s): 1c8ac5a

Update gradio_app.py

Browse files
Files changed (1) hide show
  1. gradio_app.py +16 -15
gradio_app.py CHANGED
@@ -12,32 +12,33 @@ def respond(input_text):
12
 
13
  # Step 3: Create a Gradio interface
14
  # This interface will take text input from the user and display the chatbot's response
15
- # iface = gr.Interface(
16
- # fn=respond, # The function to call when the user submits input
17
- # inputs="text", # The type of input (text)
18
- # outputs="text", # The type of output (text)
19
- # title="HugChat - Your AI Chatbot", # The title of your chatbot
20
- # description="Chat with an AI-powered bot based on a pre-trained model." # A short description
21
- # )
22
 
 
23
  iface.launch(inline=True, share=True, css="""
24
  body {
25
- background-color: orange; /* Change the background color */
26
  border:10px solid white;
27
  }
28
  .container {
29
- max-width: 800px; /* Limit the width of the container */
30
  margin: auto;
31
  padding: 20px;
32
  }
33
- .output_text {
34
- color: black; /* Change the color of the output text */
35
- font-size: 1.2em;
36
- }
37
- .input_text {
38
- border: 2px solid #007bff; /* Custom border for the input */
39
  border-radius: 4px;
40
  }
 
 
 
 
41
  """)
42
 
43
  # Step 4: Launch the interface
 
12
 
13
  # Step 3: Create a Gradio interface
14
  # This interface will take text input from the user and display the chatbot's response
15
+ iface = gr.Interface(
16
+ fn=respond, # The function to call when the user submits input
17
+ inputs="text", # The type of input (text)
18
+ outputs="text", # The type of output (text)
19
+ title="HugChat - Your AI Chatbot", # The title of your chatbot
20
+ description="Chat with an AI-powered bot based on a pre-trained model." # A short description
21
+ )
22
 
23
+ # Inject custom CSS
24
  iface.launch(inline=True, share=True, css="""
25
  body {
26
+ background-color: orange !important; /* Make sure this is applied */
27
  border:10px solid white;
28
  }
29
  .container {
30
+ max-width: 800px !important; /* Limit the width of the container */
31
  margin: auto;
32
  padding: 20px;
33
  }
34
+ .gr-input {
35
+ border: 2px solid #007bff !important; /* Use the correct class for Gradio input */
 
 
 
 
36
  border-radius: 4px;
37
  }
38
+ .gr-output {
39
+ color: black !important; /* Ensure this is not overridden */
40
+ font-size: 1.2em !important;
41
+ }
42
  """)
43
 
44
  # Step 4: Launch the interface