Skip to content

Commit

Permalink
fix css in the app
Browse files Browse the repository at this point in the history
  • Loading branch information
MauroLuzzatto committed Nov 5, 2023
1 parent 4e284e7 commit 3ff50a3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 18 deletions.
8 changes: 5 additions & 3 deletions app/static/css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ body {
color: rgba(0, 0, 0, 0.8);
margin: 0;
padding: 0;
font-weight: 330
font-weight: 330;
/* background-color:#faf0e6; */

}

html {
Expand Down Expand Up @@ -158,7 +160,7 @@ pre code {
-moz-user-select: none;
user-select: none
}

/*
.post {
padding: 3rem 0;
font-size: 0.7rem;
Expand Down Expand Up @@ -213,7 +215,7 @@ pre code {
.post a:hover {
text-decoration: underline
}
} */


/*
Expand Down
6 changes: 2 additions & 4 deletions app/templates/shared/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,8 @@
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-BmbxuPwQa2lc/FVzBcNJ7UAyJxM6wuqIj61tLrc4wSX0szH/Ev+nYRRuWlolflfl" crossorigin="anonymous">

<link rel="stylesheet" href="static/css/styles.css" />
<!-- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css"
integrity="sha512-KfkfwYDsLkIlwQp6LFnl8zNdLGxu9YAA1QvwINks4PhcElQSvqcyVLLD9aMhXd13uQjoXtEKNosOWaZqXgel0g=="
crossorigin="anonymous" referrerpolicy="no-referrer" /> -->
<link rel="stylesheet" href="/static/css/styles.css" />

</head>

<body>
Expand Down
18 changes: 7 additions & 11 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from app.utils.response_messages import get_exception_details
from app.utils.runtime import get_is_lambda_runtime
from music_flow import Predictor, get_formatted_features
from music_flow.config.core import model_settings
from music_flow.config import model_settings
from music_flow.core.utils import path_app

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -71,21 +71,17 @@ async def lifespan(app: FastAPI):
servers=[{"url": settings.ROOT_PATH}],
)

path_static = str(Path(path_app).absolute() / "static")
app.mount("/static", StaticFiles(directory=path_static), name="static")


app.add_middleware(
Analytics, is_lambda_runtime=is_lambda_runtime, is_testing=is_testing
)
app.include_router(api.router)
app.include_router(root.router)


base_path = Path(path_app).absolute()
path_static = str(base_path / "static")
logger.debug(f"Base path: {base_path}")
logger.debug(f"static: {path_static}")

app.mount("/static", StaticFiles(directory=path_static), name="static")


@app.get("/api/prediction/", tags=["API"])
async def get_prediction_api(song: str, artist: str) -> Prediction:
"""Get the model predictions
Expand Down Expand Up @@ -144,12 +140,12 @@ async def get_prediction_api(song: str, artist: str) -> Prediction:
save_name=f"{save_folder}/{name}.json",
)

data_enrichted = {
data_enriched = {
"description": settings.PREDICTION_DESCRIPTION,
"message": user_message,
"preview_url": raw_features["track"]["preview_url"],
}
data_response.update(data_enrichted)
data_response.update(data_enriched)
return Prediction(**data_response)


Expand Down

0 comments on commit 3ff50a3

Please sign in to comment.