Spaces:
Running on Zero
Running on Zero
Fixing errors of repeated texts in OpenAI model
Browse filesFiles changed (4)
- .gitignore+1
- app.py+10-8
- llm_graph.py+13-12
- sample/kv_store_doc_status.json+5-21
169 unmodified lines170171172173169 unmodified lines*.pdf*.csvcache/sample/201 unmodified lines20220320420520520620720820921021121220620720820921021121221321421521637 unmodified lines254255256257258259260201 unmodified lines # Configure network display network.from_nx(G) if model_name == MODEL_LIST[0]: network.barnes_hut( gravity=-3000, central_gravity=0.3, spring_length=50, spring_strength=0.001, damping=0.09, overlap=0, ) network.barnes_hut( gravity=-3000, central_gravity=0.3, spring_length=50, spring_strength=0.001, damping=0.09, overlap=0, )
# Customize node appearance for node in network.nodes:37 unmodified lines is_first_example = text == EXAMPLES[0][0] # Ensure RAG is initialized # TODO: Clear all the previous inserted texts asyncio.run(model.initialize_rag())
# Try to load from cache if it's the first example44 unmodified lines4546474848495051525354555657584950515253545556575859606162109 unmodified lines17217317417417517617717844 unmodified lines Initialize the LightRAG instance with the specified embedding dimension. """
# if self.rag is None: if self.rag is None: self.rag = LightRAG( working_dir=WORKING_DIR, llm_model_func=self._llm_model_func, embedding_func=EmbeddingFunc( embedding_dim=embedding_dimension, max_token_size=8192, func=self._embedding_func, ), ) # TODO: Check if this works as expected # TODO: Check how to clear all the previous inserted texts self.rag = LightRAG( working_dir=WORKING_DIR, llm_model_func=self._llm_model_func, embedding_func=EmbeddingFunc( embedding_dim=embedding_dimension, max_token_size=8192, func=self._embedding_func, ), )
await self.rag.initialize_storages() await initialize_pipeline_status()
109 unmodified lines os.makedirs(WORKING_DIR, exist_ok=True) # Use LightRAG with Azure OpenAI # TODO: Clear all the previous inserted texts first # TODO: Clear all the previous inserted texts self.rag.insert(text) # Insert the text into the RAG storage
# Wait for GRAPHML_FILE to be created6 unmodified lines789101110111213131415161718192021222324252627282930313215161718196 unmodified lines ], "content_summary": "The family of Azerbaijan President Ilham Aliyev leads a charmed, glamorous life, thanks in part to financial interests in almost every sector of the economy. His wife, Mehriban, comes from the privileged and powerful Pashayev family that owns banks, ...", "content_length": 1074, "created_at": "2025-08-31T15:50:59.506391+00:00", "updated_at": "2025-08-31T15:52:26.018288+00:00", "created_at": "2025-09-01T14:53:10.896398+00:00", "updated_at": "2025-09-01T14:54:44.898862+00:00", "file_path": "unknown_source", "track_id": "insert_20250831_235059_6946ff78", "track_id": "insert_20250901_225310_a186b861", "metadata": { "processing_start_time": 1756655459, "processing_end_time": 1756655546 } }, "doc-eea199eb7feea197ebb82e9333a2d2f2": { "status": "processing", "chunks_count": 1, "chunks_list": [ "chunk-eea199eb7feea197ebb82e9333a2d2f2" ], "content_summary": "Les jardins du Luxembourg, situés au cœur du sixième arrondissement de Paris, offrent un véritable havre de paix aux citadins pressés. Créés au début du dix-septième siècle sur l'initiative de Marie de Médicis, ces jardins à la française s'étendent s...", "content_length": 697, "created_at": "2025-08-31T15:54:38.060638+00:00", "updated_at": "2025-08-31T15:54:38.068349+00:00", "file_path": "unknown_source", "track_id": "insert_20250831_235438_22d326d7", "metadata": { "processing_start_time": 1756655678 "processing_start_time": 1756738390, "processing_end_time": 1756738484 } }}.gitignore+1
app.py+10-8
llm_graph.py+13-12
sample/kv_store_doc_status.json+5-21