Pyefuri commited on
Commit
9802cb1
·
verified ·
1 Parent(s): 6bad34a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +16 -6
app.py CHANGED
@@ -92,21 +92,31 @@ def prediksi_terjemahan(message, history):
92
  for respon in proses_gpu_translation(message, history):
93
  yield respon
94
 
95
- # ==========================================
96
- # STRUKTUR DESAIN CUSTOM CSS
97
- # ==========================================
98
  desain_kustom_css = """
99
  #wadah-lebar-chat {
100
- max-width: 800px !important;
101
- margin: 0 auto !important;
102
  float: none !important;
 
 
 
 
 
103
  }
104
  """
105
 
106
  with gr.Blocks() as demo:
107
- gr.Markdown("# 🤖 AI Bahasa Indonesia-Biak")
108
 
 
109
  with gr.Column(elem_id="wadah-lebar-chat"):
 
 
 
 
 
110
  gr.ChatInterface(
111
  fn=prediksi_terjemahan,
112
 
 
92
  for respon in proses_gpu_translation(message, history):
93
  yield respon
94
 
95
+ # ========================================================
96
+ # PERBAIKAN UI/UX: CUSTOM CSS PUSAT & RAPI (TIDAK MELEBAR)
97
+ # ========================================================
98
  desain_kustom_css = """
99
  #wadah-lebar-chat {
100
+ max-width: 800px !important; /* Membatasi lebar agar pas seperti ChatGPT */
101
+ margin: 0 auto !important; /* Menjaga posisi tetap presisi di tengah layar */
102
  float: none !important;
103
+ padding-top: 20px;
104
+ }
105
+ .judul-pusat {
106
+ text-align: center !important; /* Memaksa teks judul berada di tengah layar */
107
+ margin-bottom: 15px !important;
108
  }
109
  """
110
 
111
  with gr.Blocks() as demo:
 
112
 
113
+ # SOLUSI VISUAL: Memasukkan judul dan chatbot ke dalam kolom pembatas 800px yang sama
114
  with gr.Column(elem_id="wadah-lebar-chat"):
115
+
116
+ # Menyisipkan teks judul dengan kelas CSS khusus agar sejajar tegak lurus di tengah
117
+ gr.Markdown("# 🤖 AI Bahasa Indonesia-Biak", elem_classes="judul-pusat")
118
+
119
+ # Kotak chatbot otomatis mengikuti lebar container 800px tepat di bawah judul
120
  gr.ChatInterface(
121
  fn=prediksi_terjemahan,
122