abdfajar707 commited on
Commit
11815e7
·
verified ·
1 Parent(s): dc432c4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +48 -16
app.py CHANGED
@@ -54,21 +54,53 @@ def converse(message, chat_history):
54
  history.append(ai_msg)
55
  return history[-1]["content"]
56
 
57
- with gr.Blocks(css=".contain { display: flex !important; flex-direction: column !important; }"
58
- "#component-0, #component-3, #component-10, #component-8 { height: 75% !important; }"
59
- "#chatbot { flex-grow: 0.6 !important; overflow: auto !important;}"
60
- "#col { height: 60vh !important; }") as interface:
61
- with gr.Row():
62
- with gr.Column(scale=0.5):
63
- gr.HTML('<img src="https://datahub.data.go.id/data/static/Kementerian%20PPN%20Bappenas%20Tanpa%20Teks.png" width="75px" alt="Image" style="max-width: 75%;">')
64
- with gr.Row():
65
- with gr.Column(scale=0.5, elem_id='col'):
66
- gr.ChatInterface(fn=converse, title=("""
67
- <center>
68
- <h1>KemenPPN/Bappenas</h1>
69
- <b>AI-Interlinked System/Bappenas GPT<b>
70
- </center>
 
 
 
 
 
71
  """
72
- ))
73
 
74
- interface.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  history.append(ai_msg)
55
  return history[-1]["content"]
56
 
57
+ DESCRIPTION = '''
58
+ <div style="padding: 5px; text-align: left; display: flex; flex-direction: column; align-items: left;">
59
+ <img src="https://sdgs.bappenas.go.id/repository/assets/bappenas_logo_square.png" style="width: 40%; max-width: 200px; height: auto; opacity: 0.55; ">
60
+ <h2 style="font-size: 28px; margin-bottom: 2px; opacity: 0.55;">AI-Interlinked System/Bappenas GPT</h2>
61
+ </div>
62
+ '''
63
+
64
+ LICENSE = """
65
+ <p/>
66
+ ---
67
+ Dibangun dari Meta Llama 3
68
+ """
69
+
70
+ PLACEHOLDER = """
71
+ <div style="padding: 100px; text-align: center; display: flex; flex-direction: column; align-items: center;">
72
+ <img src="https://cdn3.iconfinder.com/data/icons/human-resources-flat-3/48/150-4096.png" style="width: 1000; max-width: 200px; height: auto; opacity: 0.55; ">
73
+ <h2 style="font-size: 20px; margin-bottom: 2px; opacity: 0.55;">Perencana-GPT</h2>
74
+ <p style="font-size: 18px; margin-bottom: 2px; opacity: 0.65;">Silakan mulai tanya...</p>
75
+ </div>
76
  """
 
77
 
78
+
79
+ css = """
80
+ h1 {
81
+ text-align: center;
82
+ display: block;
83
+ }
84
+ #duplicate-button {
85
+ margin: auto;
86
+ color: white;
87
+ background: #1565c0;
88
+ border-radius: 100vh;
89
+ }
90
+ """
91
+ # Gradio block
92
+ chatbot=gr.Chatbot(height=450, placeholder=PLACEHOLDER, label='Interlinked Sytem ChatInterface')
93
+
94
+ with gr.Blocks(fill_height=True, css=css) as demo:
95
+
96
+ gr.Markdown(DESCRIPTION)
97
+ gr.ChatInterface(
98
+ fn=converse,
99
+ chatbot=chatbot,
100
+ fill_height=True,
101
+ )
102
+
103
+ gr.Markdown(LICENSE)
104
+
105
+ if __name__ == "__main__":
106
+ demo.launch()