Spaces:
Paused
Paused
change doc used for searching
Browse files10 unmodified lines11121314141516171819202021222316 unmodified lines40414243434445464748495051525051525354555657585960616263646566674 unmodified lines72737463757677656678798081828384858687728889909 unmodified lines100101102881031041051068 unmodified lines11511611711811912010512112212312412512612712812913011111211311413113213313413513613713813914014111814210 unmodified linesif "search_results" not in st.session_state: st.session_state["search_results"] = []
client = Colivara(base_url="https://api.colivara.com", api_key=API_KEY)client = Colivara(api_key=API_KEY)# Add badges at the top of the pagest.markdown( """ <div style="display: flex; gap: 10px; margin-bottom: 20px;"> <a href="https://discord.gg/DtGRxWuj8y" target="_blank"> <img src="https://dcbadge.limes.pink/api/server/https://discord.gg/DtGRxWuj8y" alt="Discord"> <img src="https://img.shields.io/badge/Join%20Discord-7289DA?style=for-the-badge&logo=discord&logoColor=white" alt="Discord"> </a> <a href="https://www.colivara.com" target="_blank"> <img src="https://img.shields.io/badge/Website-0078D7?style=for-the-badge&logo=internetexplorer&logoColor=white" alt="Website">16 unmodified linesst.markdown( """ ### Welcome to the Colivara Search Demo This demo allows you to search through a sample NVIDIA quarterly report (Form 10-Q). This demo allows you to search through the Competitive Programmer's Handbook by Antti Laaksonen. We included 12 chapters from the handbook in this demo to help you understand how Colivara works. **Chapters Covered:** `Introduction` `Time Complexity` `Sorting` `Data Structures` `Complete Search` `Greedy Algorithms` `Dynamic Programming` `Amortized Analysis` `Range Queries` `Bit Manipulation` `Basics of Graphs` `Graph Traversal`
- Enter a search query in the input box below. - Retrieve the most relevant pages from the document.
**Example Queries:** ``` 1. What were Nvidia's revenues for the most recent quarter? 2. What are the main factors that are driving Nvidia's growth? 3. What are the risks and challenges that Nvidia is facing? 1. What is set theory? 2. How to analyze complexity using Big O notation? 3. Explain Binary Search Algorithm and provide implementation of lower bound. 4. How to use Stack, Queue and Deque? 5. Explain generating permutations and subsets in Complete Search. 6. What makes an algorithm greedy? 7. How to solve the coin change problem using Dynamic Programming? 8. What is amortized analysis? 9. How to implement prefix sum array? 10. Explain basic bitwise operations. 11. Show graph representation using matrix and adjacency list. 12. How to implement DFS and BFS traversal? ```
Try it out and see how the AI retrieves the information you need efficiently.4 unmodified linesst.markdown( """ #### Document Overview: **Title:** NVIDIA Corporation Quarterly Report (Form 10-Q, October 27, 2024) **Title:** Competitive Programmer's Handbook **Author:** Antti Laaksonen **Type:** PDF **Pages:** 50+ <a href="https://d18rn0p25nwr6d.cloudfront.net/CIK-0001045810/ed2a395c-5e9b-4411-8b4a-a718d192155a.pdf" target="_blank"> **Included Pages:** 100+ **Included Chapters Count:** 12 **Full Book Chapters Count:** 30
<a href="https://cses.fi/book/book.pdf" target="_blank"> <img src="https://img.shields.io/badge/View%20PDF-EF8D21?style=for-the-badge&logo=adobeacrobatreader&logoColor=white" alt="View PDF"> </a> """, unsafe_allow_html=True,)
# Search and retrieve documentsst.subheader("Search and Retrieve Documents")
9 unmodified lines help="Select the number of top pages to retrieve.",)
collection_name = "Demo-Final"collection_name = "Algorithm"if st.button("Search"): if not query: st.error("Please enter a search query to retrieve results.")8 unmodified lines st.error(f"Error during search: {str(e)}")
# Display search results
if "search_results" in st.session_state and st.session_state["search_results"]: st.write("### Search Results") cols = st.columns(2) # Remove the columns and display images one by one for idx, result in enumerate(st.session_state["search_results"]): img_base64 = result.img_base64 page_number = result.page_number document_name = result.document_name img = Image.open(BytesIO(base64.b64decode(img_base64)))
# Create a container for each result with st.container(): # Display the image with increased width cols[idx % 2].image( img, caption=f"Document: {document_name}, Page: {page_number}", ) st.image( img, caption=f"Document: {document_name}, Page: {page_number}", use_container_width=True, # This makes the image use full column width ) # Add some spacing between images st.markdown("---")
st.success("Search completed successfully.")
st.markdown("----")st.markdown("Developed by Abdulhaleem from TJM Labs.")st.markdown("Developed by Abdulhaleem @ TJM Labs.")app.py+41-17