broadfield-dev commited on
Commit
02c9967
·
verified ·
1 Parent(s): 739c95c

Update rss_processor.py

Browse files
Files changed (1) hide show
  1. rss_processor.py +4 -3
rss_processor.py CHANGED
@@ -251,10 +251,11 @@ def upload_to_hf_hub():
251
  except Exception as e:
252
  logger.error(f"Error uploading to Hugging Face Hub: {e}")
253
 
254
- if __name__ == "__main__":
 
 
255
  download_from_hf_hub()
256
 
257
- global vector_db
258
  vector_db = Chroma(
259
  persist_directory=LOCAL_DB_DIR,
260
  embedding_function=embedding_model,
@@ -266,4 +267,4 @@ if __name__ == "__main__":
266
  process_and_store_articles(articles)
267
 
268
  upload_to_hf_hub()
269
- logger.info("Script finished.")
 
251
  except Exception as e:
252
  logger.error(f"Error uploading to Hugging Face Hub: {e}")
253
 
254
+ def run_update_pipeline():
255
+ global vector_db
256
+
257
  download_from_hf_hub()
258
 
 
259
  vector_db = Chroma(
260
  persist_directory=LOCAL_DB_DIR,
261
  embedding_function=embedding_model,
 
267
  process_and_store_articles(articles)
268
 
269
  upload_to_hf_hub()
270
+ logger.info("Update pipeline finished.")