Commit Graph

21 Commits

Author SHA1 Message Date
Andreas Köpf 7e8d4f5a6e fix only_active condition of tree_message_count_stats() 2023-01-18 22:02:35 +01:00
Andreas Köpf 718faa098e Add combined TreeManager stats endpoint (#816) 2023-01-18 00:54:19 +01:00
Andreas Köpf acaa56ebb0 fix ranking assert for 1st level children 2023-01-18 00:49:28 +01:00
Andreas Koepf 0f896d910e make sure we enter READY_FOR_EXPORT after ranking 2023-01-17 17:50:17 +00:00
Andreas Köpf 9b6dc6bae2 fix join types in TreeManager 2023-01-17 11:01:36 +01:00
Andreas Köpf 2ee01d1224 fix query in TreeManager.query_extendible_parents() 2023-01-17 10:45:52 +01:00
Andreas Köpf d85cec3d2f extensible -> extendible 2023-01-17 10:21:57 +01:00
Andreas Köpf 6e4d8097b6 fix availability for label_prompter_reply 2023-01-17 10:15:30 +01:00
Andreas Köpf 988913943f use '.value' of str-enums in db queries 2023-01-17 09:54:20 +01:00
dhug 8b30c7b68e add changes for auto_main, tree_manager, and utils/ranking (#786)
* add changes for auto_main, tree_manager, and utils/ranking

* pre-commit changes

Co-authored-by: Alexander Mattick <alex.mattick@fau.de>
2023-01-17 08:27:21 +01:00
Andreas Köpf 2d4e39cf5d use sqlalchemy for query_reviews_for_message() in TreeManager 2023-01-16 20:31:29 +01:00
Andreas Köpf ead51ff423 770 tree manager allow to specify desired task_type no prompter ranking (#775)
* only ranking assistant replies by default

* add tasks/availability endpoint allow to specify desired task

* move rank_prompter_replies option to TreeManagerConfiguration

* fix type annotation

* remove desired_task_type from _random_task_selection()

* fix typo

* Convert query_tree_size to sqlachemy, return 'full' text-labeling tasks if they were explicitly requested
2023-01-16 20:05:40 +01:00
James Melvin Ebenezer c6fbf5543b 599 add row versioning to backend tables (#710)
* fix: isolation level and nested db.commit() with retry wrappers on concurrent update errors

* refactor: incorporated review comments

changes decorator methods to managed_tx_method and async_managed_tx_method
new enum CommitMode
removed commented commit() from the previous commits

* fix: merge pre-commit errors

* fix: merge pre-commit changes

* fix: conflict in existing OasstErrorCode

* refactor: Added a refresh just to be sure that the select command is triggered on the mapped object

* fix: added refresh for async decorator

Co-authored-by: James Melvin <melvin@gameface.ai>
2023-01-16 08:43:07 +01:00
Andreas Köpf b5bb5bb7c0 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
2023-01-15 12:04:19 +01:00
Nil Andreu a902c600fa Store Message Toxicity in database (#553)
* [NEW] MessageToxicity table

* [NEW] Alembic message Toxicity

* [NEW] Model name enum

* [NEW] Refactor Enum HF

* [NEW] Settings: DEBUT_SKIP_TOXICITY_CALCULATION

* [NEW] Store toxicity values

* [FIX] Merge conflict

* [FIX] Documentation

* [NEW] save_toxicity: function

* [FIX] Formatted string

* [NEW] DEBUG_SKIP_TOXICITY_CALCULATION=True

* [FIX] HfClassificationModel

* [FIX] Alembic merge heads

* [NEW] Refactor save_toxicity

* [NEW] Separating score/label

* [NEW] Store score and label

* [FIX] Cleaning Alembic

* [NEW] Clean HF names

* [NEW] Not type hinting

* [NEW] Update alembic versions

* [NEW] Revert the changes

* [NEW] Type hinting label & score

* Updated down_revision in migration script

Co-authored-by: Andreas Köpf <andreas.koepf@xamla.com>
2023-01-14 12:22:55 +00:00
Andreas Koepf d0ef7c4bbc add missing doc-strings for tree-manager mandatory labels settings 2023-01-13 16:04:06 +00:00
Andreas Koepf 343853fb57 add TreeManagerConfiguration as sub-module to global pydantic settings class 2023-01-13 15:52:09 +00:00
Andreas Köpf 7b78430569 remove accepted_messages ref 2023-01-12 01:23:05 +01:00
Andreas Köpf 025d20e638 shuffle ranking options, add simple mode for text-labels 2023-01-11 23:47:56 +01:00
Andreas Köpf 0117159da0 returning 503 Service Unavailable when requested task type is not available 2023-01-11 13:56:21 +01:00
Andreas Köpf 14fa08e2e7 Message tree state machine (#555)
* add query_incomplete_rankings()

* Add SQL queries for TreeManager task selection

* first working version of TreeManager.next_task()

* remove old generate_task(), add mandatory_labels to text_labels task

* Add ConversationMessage list to Ranking tasks

* add more sophisticated sql queries to find extendible trees

* add TreeManager.query_extendible_parents()

* fix task validation, seed data insertion (reviewed)

* provide user for task selection in text-frontend

* enter 'growing' state

* enter 'aborted_low_grade' state

* enter 'ranking' state

* check tree 'growing' state upon relpy insertion

* exclude user from labeling their own messages (added DEBUG_ALLOW_SELF_LABELING setting)

* add DEBUG_ALLOW_SELF_LABELING to docker-compose.yaml

* fix ranking submission

* add query_tree_ranking_results()

* add ranked_message_ids to RankingReactionPayload

* fix reply_messages instead of prompt_messages

* incorment 'ranking_count' of ranked replies

* added logic to check_condition_for_scoring_state

* changes to msg_tree_state_machine

* pre-commit changes

* enter 'ready_for_scoring' state

* re-add HF embedding call (lost during merge)

* use prepare_conversation() helper for seed-data creation

* Partially add user specified task selection

Co-authored-by: Daniel Hug <danielpatrickhug@gmail.com>
2023-01-11 10:54:03 +01:00