Spaces:
Runtime error
Runtime error
output clean-up
Browse files
app.py
CHANGED
@@ -58,7 +58,7 @@ def load_chain():
|
|
58 |
chain = load_chain()
|
59 |
|
60 |
# From here down is all the StreamLit UI.
|
61 |
-
st.set_page_config(page_title="
|
62 |
st.header("LangChain Demo")
|
63 |
|
64 |
if "generated" not in st.session_state:
|
@@ -67,27 +67,14 @@ if "generated" not in st.session_state:
|
|
67 |
if "past" not in st.session_state:
|
68 |
st.session_state["past"] = []
|
69 |
|
70 |
-
|
71 |
def get_text():
|
72 |
input_text = st.text_input("You: ", "What are the four types of hallucinations?", key="input")
|
73 |
return input_text
|
74 |
|
75 |
-
|
76 |
user_input = get_text()
|
77 |
|
78 |
if user_input:
|
79 |
-
|
80 |
-
print('docs')
|
81 |
-
print(docs)
|
82 |
-
# print('docs[0]')
|
83 |
-
# print(docs[0])
|
84 |
-
# print('docs[0].page_content')
|
85 |
-
# print(docs[0].page_content)
|
86 |
-
|
87 |
-
# output = docs[0].page_content
|
88 |
-
# output = 'nothing right now'
|
89 |
-
output = docs
|
90 |
-
|
91 |
st.session_state.past.append(user_input)
|
92 |
st.session_state.generated.append(output)
|
93 |
|
|
|
58 |
chain = load_chain()
|
59 |
|
60 |
# From here down is all the StreamLit UI.
|
61 |
+
st.set_page_config(page_title="Impromptu GPT", page_icon=":robot:")
|
62 |
st.header("LangChain Demo")
|
63 |
|
64 |
if "generated" not in st.session_state:
|
|
|
67 |
if "past" not in st.session_state:
|
68 |
st.session_state["past"] = []
|
69 |
|
|
|
70 |
def get_text():
|
71 |
input_text = st.text_input("You: ", "What are the four types of hallucinations?", key="input")
|
72 |
return input_text
|
73 |
|
|
|
74 |
user_input = get_text()
|
75 |
|
76 |
if user_input:
|
77 |
+
output = chain.run(user_input)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
78 |
st.session_state.past.append(user_input)
|
79 |
st.session_state.generated.append(output)
|
80 |
|