Skip to content
This repository has been archived by the owner on Oct 11, 2023. It is now read-only.

Commit

Permalink
[LRP3] Adding wild episode metadata to EpisodeDB (#311)
Browse files Browse the repository at this point in the history
* fixed sizing of messages, sizing of text, send button styling

* parse actions with wierd quotes (#244)

* Updating parser for multithreading (#251)

* added say and do buttons added documentation

* removed unused code and added more documentation to chatdisplay component

* adding mobile style fixes to progress bar and level display

* wired tell feature

* fixed repsonsive styling of player info icons on mobile

* adding redux

* added redux and redux toolkit

* added typescript to game app

* Server data browsing scripts and fixes (#255)

* Requirements fix (#258)

* Human to player (#259)

* Merging _human and is_player

* Removing old function

* No longer true case about cap on characters

* Crowdsourcing UI (#261)

* fixed spacing issue from help message

* fixed sizing issue on tutorial screen

* fixing borders and sizing issues

* added styles for mobile landscape view

* fixed fixed positioning in mobile view

* cleared unused styles

* fixed progress bar text

* fixed text and nameplate styling and landing app tutorial page

* added space at footer for landing app pages

* added views

* updating structure

* added example card component

* added copy arrays, styling example cards, and building good example list

* styled example list components

* styling preview view

* adjusted content and overflow to be right of it's label, fixed intro copy, fixed coloring in details section

* fixed details interaction copy

* fixed alignment of example card content

* building button

* fixed placement of definitions and added spacing

* pre-merge

* added error and success toats

* added screenshot to tutorial, added toast to submit

* duplicated previous task

* formatting constraint events task

* fixed conf

* restructuring app

* building multiple choice

* added answer form

* built reusable question components, added copy, building and styling forms

* added fieldQuestion component

* added fieldrow component

* added attributesetter component

* added constraints component and questions

* styled question components, headers, and layout

* added multiple select question component

* built attribute setter, attribute row, and added dummy data

* styled attribute setter

* connected dummy Data, restyled events and constraint containers, colored object names

* added copy updates from initial thoughts, added location description question

* added taskdatacards and datacard component

* styling cards and field row border

* added formatquestion component

* minor style fixes on field row, added formatquestion component to task card

* added format question component to boolean question component

* fixed formatquestion component

* added drop down component and submit checklist components

* fixed positioning and fixing numbering for questions

* added delete functionality to attribute setter

* added and styled submission component

* Adding new example copy, passing name and descriptions (#245)

* pre pull

* pre pull

* Fixing clobbered run_task.py (#246)

* Adding new example copy, passing name and descriptions

* Fixing run_task.py

* Fixing script config

* successfully updated run_task

* added and styled description to object selector, form tips, and preview image

* fixed payload update

* updated example card component with primary and secondary desc and styled text

* updated example card component with primary and secondary desc and styled text

* Task2 submit (#248)

* adding state for payload

* added error state

* centralizing copy

* added isReversible, removeItems, isRemovingItems isCreatingEntity, createdEntity, isSecondaryHeld state

* building updatedRemoveObjects

* added create entity event to submission handler

* added events and constraints handling and packaging for payload submission

* wired constraint and event state to constraint and event components

* connected new copy object to events

* wiring task 2

* wiring event forms

* fixed field row styles

* added tooltip component, building preview and tutorial copy object

* added task 2 tutorial copy, added and styled tutorial entry component, added and styled preview view

* updated copy for preview and updated layout

* added screenshots for Preview

* finishing final submission and preview changes

* fixed create entity connection to submission

* connected constraints and fixed submission state

* building error handling and checklist component logic

* building error handling and checklist component logic

* added error key to task copy file

* added error toasts, error key, and completion checkboxes component

* fixed checkbox, restyled headers, added plus icon to add attribute button

* fixed error handling for broadcast messsage and item description changes

* fixed attribute setter connection to submission payload

* added documentation to components, removed console logs, fixed tooltip styling, and added mephisto handleSubmit to submit function

* Fixed spacing, removed improperly placed checkboxes, updated  copy, updated screenshots

* merge

* Finalizing Narrations pilot (#257)

* Moving files

* Importing new examine script

* Updated review scripts

* Final changes for pilot

* dropped configs

* style changes based on user feedback

* Missing css class

* Fixing run, fixing copy

* Updating Attributes task final pilot

* Is safe is light task (#256)

* Troubleshooting image loading issue

* added task4, added multiple choice, added run tas and yaml files, build task state

* added task4, added multiple choice, added run tas and yaml files, build task state

* added Sucess and Error Banners

* added copy to task copy, restructuring QuestionBlock component

* added format question, updated taskcopy, added header to QuestionBlock

* added tooltip component

* added checkbox component

* restyled question block orietation, removed unused styles

* added error handling and submissionhandler

* properly styled error banner

* fixed submission issues

* added bootstrap styles, updated comments on Question Block and multiplechoice components, added more copy for preview

* several minor styling fixes, checkbox positioning, alert color, etc

* Task2 locationupdate (#254)

* Troubleshooting image loading issue

* added, connected, and styled onSelectQuestion component for handling location change event

* added, connected, and styled onSelectQuestion component for handling location change event

* added error handling for new location

* removed console.logs from question on select and converted inline styles to classes

* Updating folder location

Co-authored-by: Jack Urbanek <[email protected]>

* Merging task 3 into crowdsourcing ui (#260)

* Troubleshooting image loading issue

* initial setup complete

* building Actor Block

* adding actor block draw functionality

* adding actor block draw functionality

* added styles, building window size state

* added getDimensions utility function, added dimension state to scale component, connectect state to konva stage

* added scale range optionblock footer, styled scale question component and subcomponents, connected dummy data from app.js to task component

* added color gradient for scale, fixing some border styling, and sizing issues

* fixed styling and fixed drag boundaries

* adding more informative variables and comments, fixed boundaries, tooling with flag sizing

* added GetFlagDimensions util function, breaking down scale component into scalefield scalerange scale flag selection gallery components

* fixed scaleRange component to map through array of ranges replacing previous hardcoded values

* changed ScaleRange component name to ScaleFooter

* change pixels to percentages in scalerange section width

* added documentation to ScaleQuestion component

* Fixed left boundary, broke flags and selection gallery into components

* fixing flag placement

* Added input header, added documentation, fixed leftSoftBoundary, fixed left flagpole shift, added rating value to selection state

* building task copy and dummy data

* added task copy

* wiring task copy into question components

* added tagrow and tagquestion

* styled attributes tag question

* added datatype switch for testing

* added conditional rendering to number form in tag question

* added state to tokenizer

* added ref to tokenizer, added header to copy, added header prop to tag question

* Task3 scale component (#249)

* building Actor Block

* adding actor block draw functionality

* adding actor block draw functionality

* added styles, building window size state

* added getDimensions utility function, added dimension state to scale component, connectect state to konva stage

* added scale range optionblock footer, styled scale question component and subcomponents, connected dummy data from app.js to task component

* added color gradient for scale, fixing some border styling, and sizing issues

* fixed styling and fixed drag boundaries

* adding more informative variables and comments, fixed boundaries, tooling with flag sizing

* added GetFlagDimensions util function, breaking down scale component into scalefield scalerange scale flag selection gallery components

* fixed scaleRange component to map through array of ranges replacing previous hardcoded values

* changed ScaleRange component name to ScaleFooter

* change pixels to percentages in scalerange section width

* added documentation to ScaleQuestion component

* Fixed left boundary, broke flags and selection gallery into components

* fixing flag placement

* Added input header, added documentation, fixed leftSoftBoundary, fixed left flagpole shift, added rating value to selection state

* pre payload branch

* added scaled attribute basevalues

* added updateHandler

* fixed attributeupdatehandler

* fixed boolean payload change handler

* fixed custom scale rating and input

* fixed numberic attribute handler

* added numeric attributes array

* added multiple select question and Usefulness scale

* added default questions for each type to task copy

* added attribute questions component and added more documentation to Task component

* fixing tag question component added tooltip component

* updated defaultAttribute questions styles and update functions

* fixed multiple choice component

* added selection consideration to multiplechoice component

* added more informative error banner

* tested submit successfully

* fixed scale component header alignment

* premerge changes, added to tutorial copy

* pre merge

* removed labels from custom attribute scale, added better variables describing fixed number values in scale field, fixed indentation in multiplechoice component, changed placeholder message in tagrow

* Task3 preview (#253)

* added attributeChecklist screenshots

* added tutorial screenshots

* added final screenshot for attributeRadio

* added images to TaskCopy.js

* added copy and screenshots for scales and type specific tutorials

* populated preview with tutorial entry components using taskcopy

* added new screenshots to attributeradio2, attributeradio3 assets, styled preview

* added check for 4 custom boolean attributes

* changed header text color to dark blue

Co-authored-by: Justin Pinero <[email protected]>
Co-authored-by: JustinPinero <[email protected]>

* Moving task3

* Moving safe-light task

Co-authored-by: Justin Pinero <[email protected]>
Co-authored-by: JustinPinero <[email protected]>

* Fixing npc assignment bug (#263)

* added redux foundation, added personal info slices, added xp, giftxp, persona, location, reducers

* added increaseXp and decrementGiftXp to reducer actions

* added foundation for redux websocket integration

* added documentation to slices, wired xp and giftxp redux state into experienceinfo component

* removed passed props from experience info components

* added sessioninfo section to features, added session xp slice, added session spent gift exp slice

* removed xp props from sidebar

* fixed emoji picker redux action, added view slice

* Added documentation to GamePage for new state and useEffects, removed local state in game page, sidebar, mobile header

* added chatInput Slice

* restructured messages and types, restyling messages

* fixed overlapping system messages

* restructured message types and styles, fixed help message overlap bug, restyling help message copy, removed legacy styles for all message types aside from setting, player message, and agent message

* restyled help message for both mobile and desktop

* Multi-agent chat first pass (#264)

* Multi-agent chat first pass

* First round changes, clarity

* Review script

* Forced timeout loop

* removed console logs, unused code, added substantial documentation, restyled award stars for both mobile and PC, connected sessionspentgiftxp to AgentMessage component

* added styling for safari browser, added styling for mobile, fixed mainpage scrolling on refresh bug, fixed text sizing, added scrolling to each message time, added mobile specific styling to setting message

* building tutorial popover

* added info button

* added tutorial popover component, added gamecopy file with tutorial copy, connected popover to sidebar header and body, connected redux state to tutorial

* added tooltips to both chat display and sidebar

* added help mode, added on click tool tips to playerinfo, Character info, mission info, location info, soulspawn message, setting message, agent message, quest message

* added tooltips and animations to quest message, status message, agent message, player messsage

* added tooltips and animations for inventory, send button, chat input, and chat mode, fixed agent message help mode bug

* added infobutton component, added render condition to infobutton in sidebar component, added infobutton to mobile header

* fixed toggle to clear tooltips during switch when in help mode

* added and styled final tool tips, fixed cycle tooltips on chat bar, fixed and restyled scrolling and sizing on chat display and sidebar

* Added lightqa readme that shows how to run seq2seq2seq interactively in light. (#268)

Co-authored-by: Leonard Adolphs <[email protected]>

* Creating a light world object from an instance of the old graph (#269)

* updated the World to initiate it from the old dataset graph

* docstring

* Updated lightqa readme with new checkpoints. (#270)

Co-authored-by: Leonard Adolphs <[email protected]>

* Clarifying the equipped objects (#271)

* clarifying the equipped objects

* fixed the equipping tests

* Documentation time (#273)

* Some initial READMEs

* More readmes

* Even more docs

* Events docs

* World docs

* Creating `light` master script for ParlAI tooling (#274)

* Boilerplate for LIGHT-parlai content

* Re-ordering

* adding common sense + world builder code

* Merging in teachers and code for RL-Quests paper. (#275)

* Baseline code for standardizing data loading

* atomic teachers working

* Cleanup atomic

* quest goals teacher

* Predictive machines to projects

* Wild chat task and code and sweeps

* Updating sweep paths to new locations

* Cleaning up quests build

* Finished all _operational_ quests code

* Remaiing related sweeps

* Dropping sweeps

* Uploading relevant models, adding download paths

* Rl quests merge (#276)

* Baseline code for standardizing data loading

* atomic teachers working

* Cleanup atomic

* quest goals teacher

* Predictive machines to projects

* Wild chat task and code and sweeps

* Updating sweep paths to new locations

* Cleaning up quests build

* Finished all _operational_ quests code

* Remaiing related sweeps

* Core quests rl project code

* Sweeps related to RL code

* Adding missing models

* Dropping sweeps

* Removing _almost_ all checkpoint links

* Uploading relevant models, adding download paths

* Core quests rl project code

* Sweeps related to RL code

* Adding missing models

* Removing _almost_ all checkpoint links

* Removing sweeps

* removing sweeps... again

* Build scripts now point to real file

* Intro code for new project (#279)

* Creating example builder script for story agents project

* Writing play map example script

* initial setup for both object interaction tasks

* small cleanup task reviewing

* default attr. from light db, make editable

* small bug fix & format changes

* slightly cleaner in-place update

* Task lightgame (#281)

* added gameplay task view

* added gameplay task view

* fixed message transmission in both gameapp reducer and task redux-slice

* removed boilerplate

* placed topmessage function at top of reducer

* messy separation into tasks, needs cleanup

* Pre-authorized worker login (#282)

* First worker login test

* Updating preauth to send context to target node, using salted hash

* polishing new tasks, making to-fill more distinct

* remove location box from attribute task

* updating constraint task with backstory q

* rename narration field, remove deleted obj

* removed deleted options, action phrase

* Gameapp instruction modal removal (#285)

* disconnected instruction modal from GamePage

* removed instructional modal

* Tutorial world, full implementation (#266)

* Adding flags to determine new players

* Adding tutorial components, first pass

* Transition from tutorial to main world seamlessly

* Creating tutorial script

* add models that maintain identity

* override model

* New secure cookies

* New secure cookies, correctly

* Bugfix for tests

* More tutorial content

Co-authored-by: Kurt Shuster <[email protected]>

* Single model, reusing ActionParser (#286)

* World hotfix

* Small deploy-related fixes (#287)

* LIGHT Tutorial fixes (#289)

* Worldbuilder update (#272)

* added redux

* added player world slice

* building modals, added modal slice to redux state

* Connected modal redux state to world row icons

* added create world button, styled homepage buttons and layout

* building editworldpage, added stat block, added nav buttons for editworldpage, added selected world to redux state

* styling modals, connected modal content to selected world redux state

* added world edit routes

* connected EditWorldFrame buttons to navigation

* added breadcrumbs component

* added buttongroups component

* fixed side navigation

* added sidebar component

* added sidebar feature slice, built sidebar

* fixed edit world sections, added general table, added dummydata

* added filter to search bar

* building rooms page, added bread crumb, added 2 generate fields

* added slider component

* added slider and button toggle to room form

* added map to map page, added properly structured dummy-data to act as backend

* added rooms, objectsm, and characters redux slices

* Added new map components, tile, grid, utils, building tile, connected page to redux store

* worldbuilder map rework, fetching and sorting room data in map page lifecycle

* added border calculator

* added and tested grid data generator and room checker utility functions

* rebuilt grid and map components without using grid-layout library

* fixing dimensions on tiles

* styling paths

* added sidebar, connected sidebar to selectedroom slice, connected tile click handler to sidebar and select room slice

* connected advanced edit to basiceditmodal

* added numberbuttoninput to tool bar

* added and connected floor selector

* added neighbor props to tile component, set conditional rendering for tile paths

* refactoring typeahead tokenizer

* fixed tokenizer

* various map fixes, added character route, added cog click route, connected redux state to edit details character and object sections

* fixed centering of map

* added extra columns and rows at beginning and end of both axis of map

* fixed starting position with new grid data

* Fixing tile color update function

* fixing color change state

* Fixed local storage update, refactored add, delete, update reducer actions, tested map update and save, removed console logs

* fixed color selection, added direct updates to draft on tile click when in color mode

* added id generation to character, room, and object creation

* fixed simple additions for basic edit for both characters and items

* built advanced edit pages, fixed slider and generate forms, fixing path update bug on map component

* fixed map loading error

* began styling tiles, fixing path update bug:

* fixed breadcrumbs, fixed local storage, added add room feature, added delete room feature, added create and delete buttons to quick edit, fixed tokenizer clearing selected tokens on room change

* fixed edit room switch on creation, fixed edit room rerender on deletion, added map-slice, fixed position change on updates

* fixed add character clearing list bug

* fixed delete functions and associated state changes for both room and objects or characters, fixed sorting for tokenizer options, fixed tokenizer node creation

* updated grid data generator helper function to include above and below floors

* added footer and stair components to tile

* fixed wiring for advanced room editor

* connected advanced edit forms to state

* added inlinetext insert component to character and object pages

* fixed breadcrumbs

* set object prefix defaults and plural defaults

* added character prefix state and defaults

* added and tested nested delete util function to edit objects page

* added content remover helper function

Co-authored-by: Jack Urbanek <[email protected]>

* New database stubs for updated data model

* Enums, Dataclasses

* addressing some comments

* Filling out UserDB

* Abstract enforce get first

* Clearer argument - num_turns

* Using enums in DB

* Initial episode data model

* Update content loggers to use episode formatting

* Updating tables to work with testing

* Fixing some test changes

* Fixing small warnings that were noise during tests

* Moving default log path

* Test fix

* Correcting math thanks to Kurt

* updating narration and first 2 grounding tasks

* updates for whole pipline

* cleanup, deleted a file

* Updating env DB classes to SQLAlchemy

* Name keys and Elems coded

* Adding arbitrary node attributes

* First complete pass of EnvDB

* Mypy fixings

* Fixing agents

* Writing some tests

* Finishing tests for object and room creates and queries

* Edge testing

* Arbitrary attributes testing

* Quests and testing

* And finally, DBGraph tests

* fixing episode change

* TODO function

* final mypy fixes

* DBID testing

* a -> either a or an depending on aeiou

* adding WorldConfig to hold complex configuration vars

* Moving episode_db into relevant GraphBuilders

* Game launches, but not logging

* Local BaseDB, now saving episodes

* Missing files

* deleting miscommit

* test fix

* Migrating to UserDB

* No more LIGHTDatabase in TornadoServer

* Fixing tests

* Works after testing locally

* Updated messaging for unimplemented

* Upgrading OneRoomGraphBuilder to ModelPool

* Completing (almost) the rest of Modelpool references

* Works without loading models in play_map

* Model pool actually works

* Safety working as well

* Rebuild on main, committed (#299)

* requirements

* removing prints

* Fix tests on `main` (#301)

* Bump parlai

* soften pytest

* Test soul messing up testing

* Another mis-test

* Accidentally dropped file

* Stop confusing the tests

* another one snuck by

* Fixing some tests, skipping starspace

* Runs on server too

* Creating LIGHT's ModelServer

* Undo server change

* tornado simplicity

* Handling for inline candidate models

* But regular models should also work without this

* Async... all of the things...

* Async the server too

* clearing up async server tests

* Correct async mock

* internalize init_world

* clean up tornado usage

* small GameInstance bug

* small GameInstance bug

* Some deploy fixes

* now using aws as a storage backend

* Moving safety model to async part

* Some safety fixes

* test fixes

* silly elif fix

* Taking bug-fixes from stable server

* Model server changes too

* Skip another web test, works in prod, refactor incoming

* Ensure we're not using FB user data

* Methods for scrubbing the datasets

* Deleting player data and related graph info

* Fixing bugs, adding tests

* Environment exporting

* Export episode DB too

* Enums for model types

* Checking for non-list to convert first

* Slightly more clarity

* 60 != 90

* Creating initial hydra classes and structures

* base model loading classes

* progress towards play_map

* Model loading works from hydra

* Play-map works again

* Main tests passing again

* Restoring broken point for tutorial

* Making ModelServer work again

* Server works for local deploy with hydra config

* Server tests now passing

* hydra 1.2

* temporary hydra force upgrade for tests

* pre-publish review

* Implementing New Users Tables (#292)

* Filling out UserDB

* Abstract enforce get first

* Clearer argument - num_turns

* Using enums in DB

* New Episode logging (#293)

* Filling out UserDB

* Abstract enforce get first

* Clearer argument - num_turns

* Using enums in DB

* Initial episode data model

* Update content loggers to use episode formatting

* Updating tables to work with testing

* Fixing some test changes

* Fixing small warnings that were noise during tests

* Moving default log path

* Test fix

* Correcting math thanks to Kurt

* Addressing comments, clarifying code

* New environment db (#295)

* Filling out UserDB

* Abstract enforce get first

* Clearer argument - num_turns

* Using enums in DB

* Initial episode data model

* Update content loggers to use episode formatting

* Updating tables to work with testing

* Fixing some test changes

* Fixing small warnings that were noise during tests

* Moving default log path

* Test fix

* Correcting math thanks to Kurt

* Updating env DB classes to SQLAlchemy

* Name keys and Elems coded

* Adding arbitrary node attributes

* First complete pass of EnvDB

* Mypy fixings

* Fixing agents

* Writing some tests

* Finishing tests for object and room creates and queries

* Edge testing

* Arbitrary attributes testing

* Quests and testing

* And finally, DBGraph tests

* fixing episode change

* TODO function

* final mypy fixes

* DBID testing

* a -> either a or an depending on aeiou

* Using `EpisodeDB` in main game path (#297)

* Filling out UserDB

* Abstract enforce get first

* Clearer argument - num_turns

* Using enums in DB

* Initial episode data model

* Update content loggers to use episode formatting

* Updating tables to work with testing

* Fixing some test changes

* Fixing small warnings that were noise during tests

* Moving default log path

* Test fix

* Correcting math thanks to Kurt

* Updating env DB classes to SQLAlchemy

* Name keys and Elems coded

* Adding arbitrary node attributes

* First complete pass of EnvDB

* Mypy fixings

* Fixing agents

* Writing some tests

* Finishing tests for object and room creates and queries

* Edge testing

* Arbitrary attributes testing

* Quests and testing

* And finally, DBGraph tests

* fixing episode change

* TODO function

* final mypy fixes

* DBID testing

* a -> either a or an depending on aeiou

* adding WorldConfig to hold complex configuration vars

* Moving episode_db into relevant GraphBuilders

* Game launches, but not logging

* Local BaseDB, now saving episodes

* Missing files

* deleting miscommit

* test fix

* Using `UserDB` as main game identity storage (#298)

* Filling out UserDB

* Abstract enforce get first

* Clearer argument - num_turns

* Using enums in DB

* Initial episode data model

* Update content loggers to use episode formatting

* Updating tables to work with testing

* Fixing some test changes

* Fixing small warnings that were noise during tests

* Moving default log path

* Test fix

* Correcting math thanks to Kurt

* Updating env DB classes to SQLAlchemy

* Name keys and Elems coded

* Adding arbitrary node attributes

* First complete pass of EnvDB

* Mypy fixings

* Fixing agents

* Writing some tests

* Finishing tests for object and room creates and queries

* Edge testing

* Arbitrary attributes testing

* Quests and testing

* And finally, DBGraph tests

* fixing episode change

* TODO function

* final mypy fixes

* DBID testing

* a -> either a or an depending on aeiou

* adding WorldConfig to hold complex configuration vars

* Moving episode_db into relevant GraphBuilders

* Game launches, but not logging

* Local BaseDB, now saving episodes

* Missing files

* deleting miscommit

* test fix

* Migrating to UserDB

* No more LIGHTDatabase in TornadoServer

* Fixing tests

* Works after testing locally

* Updated messaging for unimplemented

* Creating and using the `ModelPool` (#300)

* Some initial transitions over to model pool

* Moving initialization code out from where it occurred

* Wiring more of the system together

* Adding opt for reranked generative

* Filling out UserDB

* Abstract enforce get first

* Clearer argument - num_turns

* Using enums in DB

* Initial episode data model

* Update content loggers to use episode formatting

* Updating tables to work with testing

* Fixing some test changes

* Fixing small warnings that were noise during tests

* Moving default log path

* Test fix

* Correcting math thanks to Kurt

* Updating env DB classes to SQLAlchemy

* Name keys and Elems coded

* Adding arbitrary node attributes

* First complete pass of EnvDB

* Mypy fixings

* Fixing agents

* Writing some tests

* Finishing tests for object and room creates and queries

* Edge testing

* Arbitrary attributes testing

* Quests and testing

* And finally, DBGraph tests

* fixing episode change

* TODO function

* final mypy fixes

* DBID testing

* a -> either a or an depending on aeiou

* adding WorldConfig to hold complex configuration vars

* Moving episode_db into relevant GraphBuilders

* Game launches, but not logging

* Local BaseDB, now saving episodes

* Missing files

* deleting miscommit

* test fix

* Migrating to UserDB

* No more LIGHTDatabase in TornadoServer

* Fixing tests

* Works after testing locally

* Updated messaging for unimplemented

* Upgrading OneRoomGraphBuilder to ModelPool

* Completing (almost) the rest of Modelpool references

* Works without loading models in play_map

* Model pool actually works

* Safety working as well

* removing prints

* Fixing some tests, skipping starspace

* Runs on server too

* Enums for model types

* Fixing bad merge

* Creating LIGHT's ModelServer (#302)

* Some initial transitions over to model pool

* Moving initialization code out from where it occurred

* Wiring more of the system together

* Adding opt for reranked generative

* Filling out UserDB

* Abstract enforce get first

* Clearer argument - num_turns

* Using enums in DB

* Initial episode data model

* Update content loggers to use episode formatting

* Updating tables to work with testing

* Fixing some test changes

* Fixing small warnings that were noise during tests

* Moving default log path

* Test fix

* Correcting math thanks to Kurt

* Updating env DB classes to SQLAlchemy

* Name keys and Elems coded

* Adding arbitrary node attributes

* First complete pass of EnvDB

* Mypy fixings

* Fixing agents

* Writing some tests

* Finishing tests for object and room creates and queries

* Edge testing

* Arbitrary attributes testing

* Quests and testing

* And finally, DBGraph tests

* fixing episode change

* TODO function

* final mypy fixes

* DBID testing

* a -> either a or an depending on aeiou

* adding WorldConfig to hold complex configuration vars

* Moving episode_db into relevant GraphBuilders

* Game launches, but not logging

* Local BaseDB, now saving episodes

* Missing files

* deleting miscommit

* test fix

* Migrating to UserDB

* No more LIGHTDatabase in TornadoServer

* Fixing tests

* Works after testing locally

* Updated messaging for unimplemented

* Upgrading OneRoomGraphBuilder to ModelPool

* Completing (almost) the rest of Modelpool references

* Works without loading models in play_map

* Model pool actually works

* Safety working as well

* removing prints

* Fixing some tests, skipping starspace

* Runs on server too

* Creating LIGHT's ModelServer

* Undo server change

* tornado simplicity

* Handling for inline candidate models

* But regular models should also work without this

* Enums for model types

* `asyncio` all over LIGHT (#304)

* Some initial transitions over to model pool

* Moving initialization code out from where it occurred

* Wiring more of the system together

* Adding opt for reranked generative

* Filling out UserDB

* Abstract enforce get first

* Clearer argument - num_turns

* Using enums in DB

* Initial episode data model

* Update content loggers to use episode formatting

* Updating tables to work with testing

* Fixing some test changes

* Fixing small warnings that were noise during tests

* Moving default log path

* Test fix

* Correcting math thanks to Kurt

* Updating env DB classes to SQLAlchemy

* Name keys and Elems coded

* Adding arbitrary node attributes

* First complete pass of EnvDB

* Mypy fixings

* Fixing agents

* Writing some tests

* Finishing tests for object and room creates and queries

* Edge testing

* Arbitrary attributes testing

* Quests and testing

* And finally, DBGraph tests

* fixing episode change

* TODO function

* final mypy fixes

* DBID testing

* a -> either a or an depending on aeiou

* adding WorldConfig to hold complex configuration vars

* Moving episode_db into relevant GraphBuilders

* Game launches, but not logging

* Local BaseDB, now saving episodes

* Missing files

* deleting miscommit

* test fix

* Migrating to UserDB

* No more LIGHTDatabase in TornadoServer

* Fixing tests

* Works after testing locally

* Updated messaging for unimplemented

* Upgrading OneRoomGraphBuilder to ModelPool

* Completing (almost) the rest of Modelpool references

* Works without loading models in play_map

* Model pool actually works

* Safety working as well

* removing prints

* Fixing some tests, skipping starspace

* Runs on server too

* Creating LIGHT's ModelServer

* Undo server change

* tornado simplicity

* Handling for inline candidate models

* But regular models should also work without this

* Async... all of the things...

* Async the server too

* clearing up async server tests

* Correct async mock

* internalize init_world

* clean up tornado usage

* small GameInstance bug

* small GameInstance bug

* Some deploy fixes

* Moving safety model to async part

* Some safety fixes

* test fixes

* Enums for model types

* Checking for non-list to convert first

* AWS Option for LIGHT data model storage (#305)

* Some initial transitions over to model pool

* Moving initialization code out from where it occurred

* Wiring more of the system together

* Adding opt for reranked generative

* Filling out UserDB

* Abstract enforce get first

* Clearer argument - num_turns

* Using enums in DB

* Initial episode data model

* Update content loggers to use episode formatting

* Updating tables to work with testing

* Fixing some test changes

* Fixing small warnings that were noise during tests

* Moving default log path

* Test fix

* Correcting math thanks to Kurt

* Updating env DB classes to SQLAlchemy

* Name keys and Elems coded

* Adding arbitrary node attributes

* First complete pass of EnvDB

* Mypy fixings

* Fixing agents

* Writing some tests

* Finishing tests for object and room creates and queries

* Edge testing

* Arbitrary attributes testing

* Quests and testing

* And finally, DBGraph tests

* fixing episode change

* TODO function

* final mypy fixes

* DBID testing

* a -> either a or an depending on aeiou

* adding WorldConfig to hold complex configuration vars

* Moving episode_db into relevant GraphBuilders

* Game launches, but not logging

* Local BaseDB, now saving episodes

* Missing files

* deleting miscommit

* test fix

* Migrating to UserDB

* No more LIGHTDatabase in TornadoServer

* Fixing tests

* Works after testing locally

* Updated messaging for unimplemented

* Upgrading OneRoomGraphBuilder to ModelPool

* Completing (almost) the rest of Modelpool references

* Works without loading models in play_map

* Model pool actually works

* Safety working as well

* removing prints

* Fixing some tests, skipping starspace

* Runs on server too

* Creating LIGHT's ModelServer

* Undo server change

* tornado simplicity

* Handling for inline candidate models

* But regular models should also work without this

* Async... all of the things...

* Async the server too

* clearing up async server tests

* Correct async mock

* internalize init_world

* clean up tornado usage

* small GameInstance bug

* small GameInstance bug

* Some deploy fixes

* now using aws as a storage backend

* Moving safety model to async part

* Some safety fixes

* test fixes

* silly elif fix

* dropped change on merge

* Stable Server commit before coming refactors (#306)

* Some initial transitions over to model pool

* Moving initialization code out from where it occurred

* Wiring more of the system together

* Adding opt for reranked generative

* Filling out UserDB

* Abstract enforce get first

* Clearer argument - num_turns

* Using enums in DB

* Initial episode data model

* Update content loggers to use episode formatting

* Updating tables to work with testing

* Fixing some test changes

* Fixing small warnings that were noise during tests

* Moving default log path

* Test fix

* Correcting math thanks to Kurt

* Updating env DB classes to SQLAlchemy

* Name keys and Elems coded

* Adding arbitrary node attributes

* First complete pass of EnvDB

* Mypy fixings

* Fixing agents

* Writing some tests

* Finishing tests for object and room creates and queries

* Edge testing

* Arbitrary attributes testing

* Quests and testing

* And finally, DBGraph tests

* fixing episode change

* TODO function

* final mypy fixes

* DBID testing

* a -> either a or an depending on aeiou

* adding WorldConfig to hold complex configuration vars

* Moving episode_db into relevant GraphBuilders

* Game launches, but not logging

* Local BaseDB, now saving episodes

* Missing files

* deleting miscommit

* test fix

* Migrating to UserDB

* No more LIGHTDatabase in TornadoServer

* Fixing tests

* Works after testing locally

* Updated messaging for unimplemented

* Upgrading OneRoomGraphBuilder to ModelPool

* Completing (almost) the rest of Modelpool references

* Works without loading models in play_map

* Model pool actually works

* Safety working as well

* removing prints

* Fixing some tests, skipping starspace

* Runs on server too

* Creating LIGHT's ModelServer

* Undo server change

* tornado simplicity

* Handling for inline candidate models

* But regular models should also work without this

* Async... all of the things...

* Async the server too

* clearing up async server tests

* Correct async mock

* internalize init_world

* clean up tornado usage

* small GameInstance bug

* small GameInstance bug

* Some deploy fixes

* now using aws as a storage backend

* Moving safety model to async part

* Some safety fixes

* test fixes

* silly elif fix

* Taking bug-fixes from stable server

* Model server changes too

* Skip another web test, works in prod, refactor incoming

* Enums for model types

* Checking for non-list to convert first

* Slightly more clarity

* Privacy commitment improvements (#307)

* Some initial transitions over to model pool

* Moving initialization code out from where it occurred

* Wiring more of the system together

* Adding opt for reranked generative

* Filling out UserDB

* Abstract enforce get first

* Clearer argument - num_turns

* Using enums in DB

* Initial episode data model

* Update content loggers to use episode formatting

* Updating tables to work with testing

* Fixing some test changes

* Fixing small warnings that were noise during tests

* Moving default log path

* Test fix

* Correcting math thanks to Kurt

* Updating env DB classes to SQLAlchemy

* Name keys and Elems coded

* Adding arbitrary node attributes

* First complete pass of EnvDB

* Mypy fixings

* Fixing agents

* Writing some tests

* Finishing tests for object and room creates and queries

* Edge testing

* Arbitrary attributes testing

* Quests and testing

* And finally, DBGraph tests

* fixing episode change

* TODO function

* final mypy fixes

* DBID testing

* a -> either a or an depending on aeiou

* adding WorldConfig to hold complex configuration vars

* Moving episode_db into relevant GraphBuilders

* Game launches, but not logging

* Local BaseDB, now saving episodes

* Missing files

* deleting miscommit

* test fix

* Migrating to UserDB

* No more LIGHTDatabase in TornadoServer

* Fixing tests

* Works after testing locally

* Updated messaging for unimplemented

* Upgrading OneRoomGraphBuilder to ModelPool

* Completing (almost) the rest of Modelpool references

* Works without loading models in play_map

* Model pool actually works

* Safety working as well

* removing prints

* Fixing some tests, skipping starspace

* Runs on server too

* Creating LIGHT's ModelServer

* Undo server change

* tornado simplicity

* Handling for inline candidate models

* But regular models should also work without this

* Async... all of the things...

* Async the server too

* clearing up async server tests

* Correct async mock

* internalize init_world

* clean up tornado usage

* small GameInstance bug

* small GameInstance bug

* Some deploy fixes

* now using aws as a storage backend

* Moving safety model to async part

* Some safety fixes

* test fixes

* silly elif fix

* Taking bug-fixes from stable server

* Model server changes too

* Skip another web test, works in prod, refactor incoming

* Ensure we're not using FB user data

* Methods for scrubbing the datasets

* Deleting player data and related graph info

* Fixing bugs, adding tests

* Environment exporting

* Export episode DB too

* 60 != 90

* Addressing comments

* Base architecture README

* Addressing comments

* Missed a FLAGS

* Small fixes for episode db keys

* Adding wild episode metadata to EpisodeDB

* Tests pass after contain size fix

* Need to size up

* Ordering mistake

* world dissociation

* Small episode test cleanup

* Adding headers

* Some rollbacks, some copyright fixes

* More header fixes

* Clean up irrelevant paths

* Adding missing hydra configs

* Login page differs between dev and prod

* Dropping older tests

* correct config import loc

* Forgot to commit the files somehow

* Small fixes

* 0.2.0

Co-authored-by: Justin Pinero <[email protected]>
Co-authored-by: JustinPinero <[email protected]>
Co-authored-by: Leonard <[email protected]>
Co-authored-by: Leonard Adolphs <[email protected]>
Co-authored-by: Mojtaba <[email protected]>
Co-authored-by: Alex Gurung <[email protected]>
Co-authored-by: Alex Gurung <[email protected]>
Co-authored-by: Kurt Shuster <[email protected]>
  • Loading branch information
9 people authored Dec 9, 2022
1 parent 80b2674 commit 94d50cf
Show file tree
Hide file tree
Showing 4 changed files with 97 additions and 9 deletions.
85 changes: 84 additions & 1 deletion light/data_model/db/episodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,17 @@
from light.data_model.db.users import DBPlayer
from omegaconf import MISSING, DictConfig
from typing import Optional, List, Tuple, Union, Dict, Any, Set, TYPE_CHECKING
from sqlalchemy import insert, select, Enum, Column, Integer, String, Float, ForeignKey
from sqlalchemy import (
insert,
select,
Enum,
Column,
Integer,
String,
Float,
Boolean,
ForeignKey,
)
from sqlalchemy.orm import declarative_base, relationship, Session
from light.graph.events.base import GraphEvent
import time
Expand All @@ -23,6 +33,8 @@
FILE_PATH_KEY = "episodes"
ID_STRING_LENGTH = 40
USR_KEY = DBPlayer.ID_PREFIX
MAX_WILD_MODEL_LEN = 200
MAX_WILD_CHOICE_LEN = 100


class DBGroupName(enum.Enum):
Expand Down Expand Up @@ -170,6 +182,37 @@ def __repr__(self):
return f"DBEpisodeGraph(ids:[{self.id!r},{self.graph_key_id!r}], episode:{self.episode_id!r})"


class QuestCompletion(HasDBIDMixin, SQLBase):
"""Class containing metadata for episodes that represent quest completions"""

__tablename__ = "quest_completions"

ID_PREFIX = "QCP"

id = Column(String(ID_STRING_LENGTH), primary_key=True)
episode_id = Column(String, ForeignKey("episodes.id"), nullable=False, index=True)
quest_id = Column(String(ID_STRING_LENGTH), nullable=True, index=True)


class WildMetadata(SQLBase):
"""Class containing the expected elements for an episode as stored in the db"""

__tablename__ = "wild_metadata"

episode_id = Column(
String(ID_STRING_LENGTH),
ForeignKey("episodes.id"),
nullable=False,
index=True,
primary_key=True,
)
quest_id = Column(String(ID_STRING_LENGTH))
model_name = Column(String(MAX_WILD_MODEL_LEN), nullable=True)
score = Column(Integer, nullable=True)
is_complete = Column(Boolean, nullable=True)
choice_text = Column(String(MAX_WILD_CHOICE_LEN), nullable=True)


class EpisodeDB(BaseDB):
"""
Episode dataset database for LIGHT, containing accessors for all
Expand All @@ -195,6 +238,46 @@ def _validate_init(self):
# TODO Check the table for any possible consistency issues
# and ensure that the episode directories for listed splits exist

def write_wild_metadata(
self,
episode_id: str,
score: int,
model_name: Optional[str] = None,
quest_id: Optional[str] = None,
is_complete: Optional[bool] = None,
choice_text: Optional[str] = None,
) -> None:
with Session(self.engine) as session:
episode_metadata = WildMetadata(
episode_id=episode_id,
score=score,
model_name=model_name,
quest_id=quest_id,
is_complete=is_complete,
choice_text=choice_text,
)
session.add(episode_metadata)
if quest_id is not None and is_complete:
completion = QuestCompletion(
id=QuestCompletion.get_id(),
episode_id=episode_id,
quest_id=quest_id,
)
session.add(completion)
session.commit()

def get_wild_metadata(self, episode_id: str) -> "WildMetadata":
"""
Return a specific episode by id, raising an issue if it doesnt exist
"""
stmt = select(WildMetadata).where(WildMetadata.episode_id == episode_id)
with Session(self.engine) as session:
wild_metadata = self._enforce_get_first(
session, stmt, "Episode did not exist"
)
session.expunge_all()
return wild_metadata

def write_episode(
self,
graphs: List[Dict[str, str]],
Expand Down
7 changes: 4 additions & 3 deletions light/graph/elements/graph_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -795,14 +795,17 @@ class GraphObject(GraphNode):
def __init__(self, node_id, name, props=None, db_id=None):
super().__init__(node_id, name, props, db_id)
self.object = True
self.size = self._props.get("size", self.DEFAULT_SIZE)
self.food_energy = self._props.get("food_energy", 1)
self.value = self._props.get("value", 1)
self.drink = self._props.get("drink", self._props.get("is_drink", False))
self.food = self._props.get("food", self._props.get("is_food", False))
self.dead = self._props.get("dead", False)
self.on_use = self._props.get("on_use", None)
self.container = self._props.get("container", False)
self.size = self._props.get(
"size",
self.DEFAULT_CONTAINER_SIZE if self.container else self.DEFAULT_SIZE,
)
if self._props.get("is_container", False) or self._props.get(
"is_surface", False
):
Expand Down Expand Up @@ -831,8 +834,6 @@ def __init__(self, node_id, name, props=None, db_id=None):
if self.container
else self.DEFAULT_CONTAIN_SIZE,
)
if self.contain_size > self.size:
self.size = self.contain_size
# TODO object stat multipliers should not be a simple dict
self.stats = self._props.get(
"stats", {"damage": int(self.wieldable), "defense": int(self.wearable)}
Expand Down
11 changes: 6 additions & 5 deletions light/graph/tests/test_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ def setUp(self) -> None:
"""
self.world = World(WorldConfig())
self.reset_world()
self.maxDiff = 100000

def reset_world(self) -> None:
self.graph = OOGraph.from_json(self.INPUT_WORLD_JSON)
Expand Down Expand Up @@ -2149,7 +2150,7 @@ class RemoveObjectEventTest(GraphEventTests):
"object": true,
"on_use": null,
"room": false,
"size": 21,
"size": 20,
"stats": {
"damage": 0,
"defense": 0
Expand Down Expand Up @@ -2189,7 +2190,7 @@ class RemoveObjectEventTest(GraphEventTests):
"object": true,
"on_use": null,
"room": false,
"size": 10,
"size": 1,
"stats": {
"damage": 0,
"defense": 0
Expand Down Expand Up @@ -2304,7 +2305,7 @@ class RemoveObjectEventTest(GraphEventTests):
"object": true,
"on_use": null,
"room": false,
"size": 5,
"size": 1,
"stats": {
"damage": 0,
"defense": 0
Expand Down Expand Up @@ -2358,7 +2359,7 @@ class RemoveObjectEventTest(GraphEventTests):
"classes": [
"room"
],
"contain_size": 1999,
"contain_size": 2000,
"contained_nodes": {
"carrier_12__dead__": {
"target_id": "carrier_12__dead__"
Expand Down Expand Up @@ -2614,7 +2615,7 @@ class RemoveObjectEventTest(GraphEventTests):
"object": true,
"on_use": null,
"room": false,
"size": 3,
"size": 1,
"stats": {
"damage": 0,
"defense": 0
Expand Down
3 changes: 3 additions & 0 deletions light/world/world.py
Original file line number Diff line number Diff line change
Expand Up @@ -1114,3 +1114,6 @@ async def clean_corpses_and_respawn(self) -> List[GraphAgent]:
if new_agent is not None:
created.append(new_agent)
return created


ß

0 comments on commit 94d50cf

Please sign in to comment.