SarowarSaurav commited on
Commit
5748447
·
verified ·
1 Parent(s): d61b17f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +35 -4
app.py CHANGED
@@ -1,6 +1,37 @@
1
  import gradio as gr
 
2
 
3
- with gr.Blocks() as demo:
4
- gr.HTML("<img src='/BAT_Bangladesh_Logo.png' alt='image One'>")
5
-
6
- demo.launch(allowed_paths=["BAT_Bangladesh_Logo.png"])
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
+ import random
3
 
4
+ # Define the function that greets the user and returns a lucky number
5
+ def greet_number(name):
6
+ greeting = "Hello " + name
7
+ lucky_number = random.randint(1, 100)
8
+ return greeting, lucky_number
9
+
10
+ # Custom CSS to set the background color
11
+ css = """
12
+ .gradio-container {
13
+ background: rgb(14, 43, 99);
14
+ display: flex;
15
+ flex-direction: column;
16
+ align-items: center;
17
+ }
18
+ """
19
+
20
+ # HTML content for the logo
21
+ html_content = """
22
+ <div style="text-align: center; margin-bottom: 20px;">
23
+ <img src='https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcTwdcZ7gojHo8NrnBH7PO-PLMDUxQG9DhbX4aPywKf45A&s' alt='BAT Bangladesh Logo' style='max-width: 200px;'>
24
+ </div>
25
+ """
26
+
27
+ with gr.Blocks(css=css) as demo:
28
+ gr.HTML(html_content)
29
+ gr.Interface(
30
+ fn=greet_number,
31
+ inputs=gr.Textbox(label="Name", placeholder="Enter Name Here"),
32
+ outputs=[gr.Textbox(label="Greeting"), gr.Number(label="Your Lucky Number")],
33
+ title="GreetLucky",
34
+ theme="default",
35
+ )
36
+
37
+ demo.launch(allowed_paths=["."])