mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-09-09 11:15:08 +08:00
Add leaderboard stats, periodic updates via fastapi-utils (#724)
* add leaderboard stats, periodic update via fastapi-utils * count label tasks for assistant and prompter replies * Daily stats update every 15 mins, simplify leaderboard endpoint * add indices for some created_date columns * make user stats update intervals configurable * make sure intervals are positive
This commit is contained in:
@@ -4,6 +4,7 @@ from uuid import UUID, uuid4
|
||||
|
||||
import sqlalchemy as sa
|
||||
import sqlalchemy.dialects.postgresql as pg
|
||||
from oasst_shared.utils import utcnow
|
||||
from sqlalchemy import false
|
||||
from sqlmodel import Field, SQLModel
|
||||
|
||||
@@ -35,4 +36,4 @@ class Task(SQLModel, table=True):
|
||||
|
||||
@property
|
||||
def expired(self) -> bool:
|
||||
return self.expiry_date is not None and datetime.utcnow() > self.expiry_date
|
||||
return self.expiry_date is not None and utcnow() > self.expiry_date
|
||||
|
||||
Reference in New Issue
Block a user