Spaces:
Sleeping
Sleeping
Update rss_processor.py
Browse files- rss_processor.py +2 -2
rss_processor.py
CHANGED
|
@@ -31,6 +31,7 @@ def initialize_hf_api():
|
|
| 31 |
except Exception as e:
|
| 32 |
logger.error(f"Failed to login to Hugging Face Hub: {e}")
|
| 33 |
raise
|
|
|
|
| 34 |
|
| 35 |
def get_embedding_model():
|
| 36 |
if not hasattr(get_embedding_model, "model"):
|
|
@@ -216,12 +217,11 @@ def upload_to_hf_hub(hf_api):
|
|
| 216 |
|
| 217 |
def main():
|
| 218 |
try:
|
| 219 |
-
hf_api = initialize_hf_api()
|
| 220 |
download_from_hf_hub()
|
| 221 |
articles_to_process = fetch_rss_feeds()
|
| 222 |
if articles_to_process:
|
| 223 |
process_and_store_articles(articles_to_process)
|
| 224 |
-
upload_to_hf_hub(
|
| 225 |
else:
|
| 226 |
logger.info("No articles fetched, skipping database processing and upload.")
|
| 227 |
except Exception as e:
|
|
|
|
| 31 |
except Exception as e:
|
| 32 |
logger.error(f"Failed to login to Hugging Face Hub: {e}")
|
| 33 |
raise
|
| 34 |
+
hf_api = initialize_hf_api()
|
| 35 |
|
| 36 |
def get_embedding_model():
|
| 37 |
if not hasattr(get_embedding_model, "model"):
|
|
|
|
| 217 |
|
| 218 |
def main():
|
| 219 |
try:
|
|
|
|
| 220 |
download_from_hf_hub()
|
| 221 |
articles_to_process = fetch_rss_feeds()
|
| 222 |
if articles_to_process:
|
| 223 |
process_and_store_articles(articles_to_process)
|
| 224 |
+
upload_to_hf_hub()
|
| 225 |
else:
|
| 226 |
logger.info("No articles fetched, skipping database processing and upload.")
|
| 227 |
except Exception as e:
|