Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -7,17 +7,6 @@ import re
|
|
7 |
st.title("AI สนับสนุนความรู้ด้าน PDPA")
|
8 |
st.write("Powered by NT Lahnmah")
|
9 |
|
10 |
-
# Authors
|
11 |
-
st.subheader("👤 Authors")
|
12 |
-
st.write("""
|
13 |
-
- Amornpan Phornchaicharoen ([email protected])
|
14 |
-
- Aekanun Thongtae ([email protected])
|
15 |
-
- Montita Somsoo ([email protected])
|
16 |
-
- Jiranuwat Songpad ([email protected])
|
17 |
-
- Phongsatorn Somjai ([email protected])
|
18 |
-
- Benchawan Wangphoomyai ([email protected])
|
19 |
-
""")
|
20 |
-
|
21 |
st.subheader("🏷️ Tags")
|
22 |
st.markdown("""
|
23 |
- LLM RAG "eRAG" "PDPA" Machine Learning AI Data Privacy GenAI NT GenAI ntgenai lahnmah NT Thai GPT ntthaigpt medical medtech HealthGPT หลานม่า NT Academy
|
@@ -110,19 +99,13 @@ def display_search_result(result, index):
|
|
110 |
except Exception as e:
|
111 |
st.error(f"Error displaying PDF: {str(e)}")
|
112 |
|
113 |
-
if "chat_history" not in st.session_state:
|
114 |
-
st.session_state.chat_history = []
|
115 |
|
116 |
with st.form(key="input_form"):
|
117 |
user_input = st.text_input("You:", value="ข้อมูลส่วนบุคคล คืออะไร มีกี่ประเภท", key="input")
|
118 |
submit_button = st.form_submit_button("Send")
|
119 |
|
120 |
-
|
121 |
if submit_button and user_input:
|
122 |
-
|
123 |
-
st.session_state.chat_history.insert(0, ("###", "###"))
|
124 |
-
st.session_state.chat_history.insert(0, ("You", user_input))
|
125 |
-
|
126 |
try:
|
127 |
response = requests.post("http://113.53.253.50:8002/search", json={"query": user_input})
|
128 |
response.raise_for_status()
|
@@ -135,3 +118,14 @@ if submit_button and user_input:
|
|
135 |
|
136 |
except requests.RequestException as e:
|
137 |
st.error(f"Error: {str(e)}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
st.title("AI สนับสนุนความรู้ด้าน PDPA")
|
8 |
st.write("Powered by NT Lahnmah")
|
9 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
st.subheader("🏷️ Tags")
|
11 |
st.markdown("""
|
12 |
- LLM RAG "eRAG" "PDPA" Machine Learning AI Data Privacy GenAI NT GenAI ntgenai lahnmah NT Thai GPT ntthaigpt medical medtech HealthGPT หลานม่า NT Academy
|
|
|
99 |
except Exception as e:
|
100 |
st.error(f"Error displaying PDF: {str(e)}")
|
101 |
|
|
|
|
|
102 |
|
103 |
with st.form(key="input_form"):
|
104 |
user_input = st.text_input("You:", value="ข้อมูลส่วนบุคคล คืออะไร มีกี่ประเภท", key="input")
|
105 |
submit_button = st.form_submit_button("Send")
|
106 |
|
|
|
107 |
if submit_button and user_input:
|
108 |
+
# การตอบกลับของระบบจาก API
|
|
|
|
|
|
|
109 |
try:
|
110 |
response = requests.post("http://113.53.253.50:8002/search", json={"query": user_input})
|
111 |
response.raise_for_status()
|
|
|
118 |
|
119 |
except requests.RequestException as e:
|
120 |
st.error(f"Error: {str(e)}")
|
121 |
+
|
122 |
+
# Authors Section (ย้ายไปข้างล่างสุด)
|
123 |
+
st.subheader("👤 Authors")
|
124 |
+
st.write("""
|
125 |
+
- Amornpan Phornchaicharoen ([email protected])
|
126 |
+
- Aekanun Thongtae ([email protected])
|
127 |
+
- Montita Somsoo ([email protected])
|
128 |
+
- Jiranuwat Songpad ([email protected])
|
129 |
+
- Phongsatorn Somjai ([email protected])
|
130 |
+
- Benchawan Wangphoomyai ([email protected])
|
131 |
+
""")
|