GarGerry commited on
Commit
135c238
·
verified ·
1 Parent(s): f99d134

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -9
app.py CHANGED
@@ -45,15 +45,16 @@ with gr.Blocks() as demo:
45
  "### ⚠ Sorry for the inconvenience. The Space is currently running on the CPU, which might affect performance. We appreciate your understanding."
46
  )
47
 
48
- # Gradio Interface dengan layout diatur dan pesan di atas
49
- gr.Interface(
50
- fn=generate_response, # Fungsi untuk menangani input
51
- inputs=gr.Textbox(label="Ask me anything!", placeholder="Tanyakan sesuatu..."), # Input teks
52
- outputs=gr.Textbox(label="AI Response", lines=10), # Output teks dari AI, menampilkan lebih banyak baris
53
- title="AI Chatbot Assistant", # Judul aplikasi
54
- description="Tanya apapun, saya siap membantu!", # Deskripsi aplikasi
55
- layout="vertical" # Layout output di atas input
56
- ).render()
 
57
 
58
  # Menjalankan antarmuka
59
  demo.launch()
 
45
  "### ⚠ Sorry for the inconvenience. The Space is currently running on the CPU, which might affect performance. We appreciate your understanding."
46
  )
47
 
48
+ with gr.Row(): # Menggunakan gr.Row() untuk mengatur tata letak secara manual
49
+ with gr.Column(): # Menampilkan output di atas input
50
+ gr.Textbox(label="AI Response", lines=10) # Output teks dari AI
51
+
52
+ with gr.Row(): # Menggunakan gr.Row() untuk input
53
+ with gr.Column(): # Input teks
54
+ input_box = gr.Textbox(label="Ask me anything!", placeholder="Tanyakan sesuatu...")
55
+
56
+ # Menambahkan tombol kirim untuk memulai interaksi
57
+ input_box.submit(generate_response, inputs=input_box, outputs=gr.Textbox(label="AI Response", lines=10))
58
 
59
  # Menjalankan antarmuka
60
  demo.launch()