Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -94,14 +94,12 @@ pipeline = initialize_pipeline()
|
|
94 |
user_query = st.text_input("Enter your question about the AI Bill of Rights:")
|
95 |
|
96 |
if user_query:
|
97 |
-
|
|
|
98 |
|
99 |
st.write("Response:")
|
100 |
st.write(result["response"])
|
101 |
|
102 |
st.write("Context used:")
|
103 |
for i, context in enumerate(result["context"], 1):
|
104 |
-
st.write(f"{i}. {context[:100]}...")
|
105 |
-
|
106 |
-
if __name__ == "__main__":
|
107 |
-
st.run()
|
|
|
94 |
user_query = st.text_input("Enter your question about the AI Bill of Rights:")
|
95 |
|
96 |
if user_query:
|
97 |
+
with st.spinner("Generating response..."):
|
98 |
+
result = asyncio.run(pipeline.arun_pipeline(user_query))
|
99 |
|
100 |
st.write("Response:")
|
101 |
st.write(result["response"])
|
102 |
|
103 |
st.write("Context used:")
|
104 |
for i, context in enumerate(result["context"], 1):
|
105 |
+
st.write(f"{i}. {context[:100]}...")
|
|
|
|
|
|