Heng2004 commited on
Commit
5b247a6
·
verified ·
1 Parent(s): 6ceb5c8

Create ui.py

Browse files
Files changed (1) hide show
  1. ui.py +23 -0
ui.py ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # ui.py – Gradio UI
2
+
3
+ import gradio as gr
4
+ from rag import answer_question
5
+
6
+
7
+ def chat_fn(message: str, history: list):
8
+ # history is ignored for now
9
+ return answer_question(message)
10
+
11
+
12
+ def create_app():
13
+ return gr.ChatInterface(
14
+ fn=chat_fn,
15
+ title="Laos History Chatbot (Lao language)",
16
+ description="ຖາມຂໍ້ມູນກ່ຽວກັບປະຫວັດສາດຂອງປະເທດລາວ (ສໍາລັບນັກຮຽນ ມ.1)",
17
+ examples=[
18
+ "ປະຫວັດສາດແມ່ນຫຍັງ?",
19
+ "ປະຫວັດສາດມີຄວາມສໍາຄັນຈັ່ງໃດ໋?",
20
+ "ຫຼັກຖານປະຫວັດສາດມີຫຍັງແດ່?",
21
+ "ປະຕິທິນຈັນທະລະຄະຕິແມ່ນຫຍັງ?",
22
+ ],
23
+ )