INNER CODE UNIT · Python

query_time

wzdavid/ThinkRAG · frontend/Document_QA.py:67

                query_time = round(end_time - start_time, 2)
                if response is None:
                    st.write("Couldn't come up with an answer.")
                else:
                    try:
                        response_text = st.write_stream(response.response_gen)
                    except TypeError as e:
                        st.warning("Streaming failed due to Ollama/LlamaIndex token count issue. Falling back to non-streaming output.")
                        response_text = str(response)
                        st.write(response_text)
                    except Exception as e:
                        st.warning(f"Streaming failed: {e}. Falling back to non-streaming output.")
                        response_text = str(response)
                        st.write(response_text)
                    st.write(f"Took {query_time} second(s)")
                    details_title = f"Found {len(response.source_nodes)} document(s)"
                    with st.expander(
                            details_title,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…