Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,7 @@ import requests
|
|
| 4 |
import streamlit as st
|
| 5 |
|
| 6 |
|
| 7 |
-
st.set_page_config(page_title="ViBidLQA - Trợ lý AI hỗ trợ hỏi đáp luật Việt Nam", page_icon="./app/static/ai.jpg", layout="
|
| 8 |
|
| 9 |
with open("./static/styles.css") as f:
|
| 10 |
st.markdown(f"<style>{f.read()}</style>", unsafe_allow_html=True)
|
|
@@ -20,7 +20,6 @@ st.markdown(f"""
|
|
| 20 |
st.markdown("<h2 style='text-align: center;'>The ViBidLQA System </h2>", unsafe_allow_html=True)
|
| 21 |
|
| 22 |
url_api_retrieval_model = st.secrets["ViBidLQA_Retrieval_Module"]
|
| 23 |
-
st.success(url_api_retrieval_model)
|
| 24 |
url_api_extraction_model = st.secrets["ViBidLQA_EQA_Module"]
|
| 25 |
url_api_generation_model = st.secrets["ViBidLQA_AQA_Module"]
|
| 26 |
|
|
@@ -77,7 +76,6 @@ def get_abstractive_answer_stream(question):
|
|
| 77 |
response = requests.post(url_api_generation_model, json=data, stream=True)
|
| 78 |
|
| 79 |
if response.status_code == 200:
|
| 80 |
-
# Trả về response để xử lý streaming
|
| 81 |
return response
|
| 82 |
else:
|
| 83 |
return f"Lỗi: {response.status_code} - {response.text}"
|
|
|
|
| 4 |
import streamlit as st
|
| 5 |
|
| 6 |
|
| 7 |
+
st.set_page_config(page_title="ViBidLQA - Trợ lý AI hỗ trợ hỏi đáp luật Việt Nam", page_icon="./app/static/ai.jpg", layout="centered", initial_sidebar_state="expanded")
|
| 8 |
|
| 9 |
with open("./static/styles.css") as f:
|
| 10 |
st.markdown(f"<style>{f.read()}</style>", unsafe_allow_html=True)
|
|
|
|
| 20 |
st.markdown("<h2 style='text-align: center;'>The ViBidLQA System </h2>", unsafe_allow_html=True)
|
| 21 |
|
| 22 |
url_api_retrieval_model = st.secrets["ViBidLQA_Retrieval_Module"]
|
|
|
|
| 23 |
url_api_extraction_model = st.secrets["ViBidLQA_EQA_Module"]
|
| 24 |
url_api_generation_model = st.secrets["ViBidLQA_AQA_Module"]
|
| 25 |
|
|
|
|
| 76 |
response = requests.post(url_api_generation_model, json=data, stream=True)
|
| 77 |
|
| 78 |
if response.status_code == 200:
|
|
|
|
| 79 |
return response
|
| 80 |
else:
|
| 81 |
return f"Lỗi: {response.status_code} - {response.text}"
|