Spaces:
Runtime error
Runtime error
JinHyeong99
commited on
Commit
•
8c31276
1
Parent(s):
c5d7e61
app.py
CHANGED
@@ -110,7 +110,8 @@ def handle_userinput(user_question):
|
|
110 |
|
111 |
def main():
|
112 |
load_dotenv()
|
113 |
-
st.set_page_config(page_title="
|
|
|
114 |
page_icon=":books:")
|
115 |
st.write(css, unsafe_allow_html=True)
|
116 |
|
@@ -119,19 +120,19 @@ def main():
|
|
119 |
if "chat_history" not in st.session_state:
|
120 |
st.session_state.chat_history = None
|
121 |
|
122 |
-
st.header("
|
123 |
-
user_question = st.text_input("
|
124 |
if user_question:
|
125 |
handle_userinput(user_question)
|
126 |
|
127 |
with st.sidebar:
|
128 |
-
openai_key = st.text_input("
|
129 |
if openai_key:
|
130 |
os.environ["OPENAI_API_KEY"] = openai_key
|
131 |
|
132 |
-
st.subheader("
|
133 |
docs = st.file_uploader(
|
134 |
-
"
|
135 |
if st.button("Process"):
|
136 |
with st.spinner("Processing"):
|
137 |
# get pdf text
|
|
|
110 |
|
111 |
def main():
|
112 |
load_dotenv()
|
113 |
+
st.set_page_config(page_title="머신러닝_과제"
|
114 |
+
"LANGCHAIN과 STREAMLIT 기반의 RAG AI CHATBOT 구현",
|
115 |
page_icon=":books:")
|
116 |
st.write(css, unsafe_allow_html=True)
|
117 |
|
|
|
120 |
if "chat_history" not in st.session_state:
|
121 |
st.session_state.chat_history = None
|
122 |
|
123 |
+
st.header("GPT기반 챗봇: Prompt를 입력하세요.")
|
124 |
+
user_question = st.text_input("문서에 관해 질문해보세요.")
|
125 |
if user_question:
|
126 |
handle_userinput(user_question)
|
127 |
|
128 |
with st.sidebar:
|
129 |
+
openai_key = st.text_input("OpenAI API key를 복사 붙여넣기 하세요. (sk-...)")
|
130 |
if openai_key:
|
131 |
os.environ["OPENAI_API_KEY"] = openai_key
|
132 |
|
133 |
+
st.subheader("문서 올리기")
|
134 |
docs = st.file_uploader(
|
135 |
+
"문서를 업로드 한 후 Process 버튼을 클릭하세요.'", accept_multiple_files=True)
|
136 |
if st.button("Process"):
|
137 |
with st.spinner("Processing"):
|
138 |
# get pdf text
|