Spaces:
Running
Running
michaelkri commited on
Commit Β·
18422fe
1
Parent(s): 722f8dc
Reworked project structure
Browse files- app/__init__.py +0 -0
- database.py β app/database.py +0 -0
- main.py β app/main.py +3 -3
- news_fetcher.py β app/news_fetcher.py +3 -3
- scraper.py β app/scraper.py +0 -0
- summarizer.py β app/summarizer.py +0 -0
- {templates β app/templates}/index.html +0 -0
- update_news.py β app/update_news.py +3 -3
app/__init__.py
ADDED
|
File without changes
|
database.py β app/database.py
RENAMED
|
File without changes
|
main.py β app/main.py
RENAMED
|
@@ -2,8 +2,8 @@ from fastapi import FastAPI, Request, BackgroundTasks
|
|
| 2 |
from fastapi.templating import Jinja2Templates
|
| 3 |
from contextlib import asynccontextmanager
|
| 4 |
from apscheduler.schedulers.background import BackgroundScheduler
|
| 5 |
-
from database import get_session, retrieve_articles
|
| 6 |
-
from update_news import update_news
|
| 7 |
import threading
|
| 8 |
|
| 9 |
|
|
@@ -26,7 +26,7 @@ async def lifespan(app: FastAPI):
|
|
| 26 |
|
| 27 |
app = FastAPI(lifespan=lifespan)
|
| 28 |
|
| 29 |
-
templates = Jinja2Templates(directory='templates')
|
| 30 |
|
| 31 |
|
| 32 |
def safe_update_news():
|
|
|
|
| 2 |
from fastapi.templating import Jinja2Templates
|
| 3 |
from contextlib import asynccontextmanager
|
| 4 |
from apscheduler.schedulers.background import BackgroundScheduler
|
| 5 |
+
from .database import get_session, retrieve_articles
|
| 6 |
+
from .update_news import update_news
|
| 7 |
import threading
|
| 8 |
|
| 9 |
|
|
|
|
| 26 |
|
| 27 |
app = FastAPI(lifespan=lifespan)
|
| 28 |
|
| 29 |
+
templates = Jinja2Templates(directory='app/templates')
|
| 30 |
|
| 31 |
|
| 32 |
def safe_update_news():
|
news_fetcher.py β app/news_fetcher.py
RENAMED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
import feedparser
|
| 2 |
-
from summarizer import Summarizer
|
| 3 |
-
from scraper import get_articles
|
| 4 |
-
from database import Article, Source
|
| 5 |
|
| 6 |
|
| 7 |
def topic_summary(summarizer: Summarizer, query: str, max_results: int = 5, min_cluster_size: int = 2) -> str:
|
|
|
|
| 1 |
import feedparser
|
| 2 |
+
from .summarizer import Summarizer
|
| 3 |
+
from .scraper import get_articles
|
| 4 |
+
from .database import Article, Source
|
| 5 |
|
| 6 |
|
| 7 |
def topic_summary(summarizer: Summarizer, query: str, max_results: int = 5, min_cluster_size: int = 2) -> str:
|
scraper.py β app/scraper.py
RENAMED
|
File without changes
|
summarizer.py β app/summarizer.py
RENAMED
|
File without changes
|
{templates β app/templates}/index.html
RENAMED
|
File without changes
|
update_news.py β app/update_news.py
RENAMED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
from sentence_transformers import SentenceTransformer
|
| 2 |
from transformers import pipeline
|
| 3 |
-
from summarizer import Summarizer
|
| 4 |
-
from news_fetcher import news_summary
|
| 5 |
-
from database import get_session, clear_articles, add_article, add_sources
|
| 6 |
import datetime
|
| 7 |
|
| 8 |
|
|
|
|
| 1 |
from sentence_transformers import SentenceTransformer
|
| 2 |
from transformers import pipeline
|
| 3 |
+
from .summarizer import Summarizer
|
| 4 |
+
from .news_fetcher import news_summary
|
| 5 |
+
from .database import get_session, clear_articles, add_article, add_sources
|
| 6 |
import datetime
|
| 7 |
|
| 8 |
|