Spaces:
				
			
			
	
			
			
		Runtime error
		
	
	
	
			
			
	
	
	
	
		
		
		Runtime error
		
	Update app.py
Browse files
    	
        app.py
    CHANGED
    
    | @@ -468,14 +468,14 @@ elif activities=="News Sentiment": | |
| 468 | 
             
                # Initialize embedding model and vector DB once per session (cache if needed)
         | 
| 469 | 
             
                # embedding_model = OpenAIEmbeddings()
         | 
| 470 | 
             
                vector_db = HFVectorDB(hf_repo_id=HF_REPO_ID, hf_token=HF_TOKEN, embedding_model=gemini_embeddings)
         | 
| 471 | 
            -
             | 
| 472 | 
            -
             | 
| 473 | 
            -
             | 
| 474 | 
            -
             | 
| 475 | 
            -
             | 
| 476 | 
            -
             | 
| 477 | 
            -
             | 
| 478 | 
            -
             | 
| 479 |  | 
| 480 |  | 
| 481 | 
             
                if st.button("Get Live Updates..."):
         | 
|  | |
| 468 | 
             
                # Initialize embedding model and vector DB once per session (cache if needed)
         | 
| 469 | 
             
                # embedding_model = OpenAIEmbeddings()
         | 
| 470 | 
             
                vector_db = HFVectorDB(hf_repo_id=HF_REPO_ID, hf_token=HF_TOKEN, embedding_model=gemini_embeddings)
         | 
| 471 | 
            +
                with st.expander("Search DB & Show results"):
         | 
| 472 | 
            +
                    search_query  = st.text_input("Search Query...","")
         | 
| 473 | 
            +
                    results = vector_db.similarity_search(search_query, k=5)
         | 
| 474 | 
            +
                
         | 
| 475 | 
            +
                    for i, doc in enumerate(results):
         | 
| 476 | 
            +
                        st.markdown(f"🔍 Match {i+1}")
         | 
| 477 | 
            +
                        st.code(doc.page_content)
         | 
| 478 | 
            +
                        st.json(doc.metadata)
         | 
| 479 |  | 
| 480 |  | 
| 481 | 
             
                if st.button("Get Live Updates..."):
         |