Skip to content
This repository was archived by the owner on Oct 11, 2023. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
758d141
initial setup for both object interaction tasks
Alex-Gurung Mar 1, 2022
ab82ce7
small cleanup task reviewing
Alex-Gurung Mar 1, 2022
64593f3
default attr. from light db, make editable
Alex-Gurung Mar 3, 2022
6605891
small bug fix & format changes
Alex-Gurung Mar 7, 2022
3cf14ad
slightly cleaner in-place update
Alex-Gurung Mar 7, 2022
e3b9fab
messy separation into tasks, needs cleanup
Alex-Gurung Mar 22, 2022
e498c24
polishing new tasks, making to-fill more distinct
Alex-Gurung Mar 28, 2022
481ff18
remove location box from attribute task
Alex-Gurung Mar 28, 2022
fd7f3a9
updating constraint task with backstory q
Alex-Gurung Mar 28, 2022
3c82cfb
rename narration field, remove deleted obj
Alex-Gurung Mar 30, 2022
77dbae6
removed deleted options, action phrase
Alex-Gurung Mar 30, 2022
bfb71c0
added router, added updated redux world state to narrow scope, added …
JustinPinero May 18, 2022
3f0a3c9
restored add large files check
JustinPinero May 18, 2022
62c032a
updated select world and world draft state actions
JustinPinero May 19, 2022
78af574
fixed rendering issues, set map to draw from world draft
JustinPinero May 19, 2022
11f6a97
removed world draft mapping in quick edit functions
JustinPinero May 19, 2022
032aba9
rewired advanced edit pages
JustinPinero May 21, 2022
e3d46e7
updated token component removing react router and replacing it with t…
JustinPinero May 22, 2022
5afa4df
have empty world rendering
JustinPinero May 22, 2022
b167526
updating narration and first 2 grounding tasks
Alex-Gurung May 24, 2022
acbfdcb
Merge branch 'main' into object-interaction-tasks
Alex-Gurung May 24, 2022
9b26545
updated basic edit component with new redux state and removed react r…
JustinPinero May 24, 2022
fa17b96
fixed basic edit component
JustinPinero May 24, 2022
f293955
connected submission payload to local storage world draft
JustinPinero May 24, 2022
eca4286
fixed add, delete, and update room functionality
JustinPinero May 25, 2022
f079015
fix adding new item in tokenizer
JustinPinero May 25, 2022
ce459db
setup common sense handler and drilled common sense api intoo basic e…
JustinPinero May 25, 2022
7e0f227
adding model preds, regeneratorRuntime error
Alex-Gurung May 26, 2022
1731faf
fix for async/await error, use .then
Alex-Gurung May 26, 2022
d83449a
adding commonsense utils
Alex-Gurung May 26, 2022
901150d
adding graph converter utils
Alex-Gurung May 26, 2022
4be3a1a
commented out model temporarily
Alex-Gurung May 26, 2022
a47ef75
better handling of not having model access
Alex-Gurung May 26, 2022
f4a2938
suggest room desc and contents
Alex-Gurung May 31, 2022
e845187
Merge branch 'main' into worldbuilder-task-app-refactor
Alex-Gurung May 31, 2022
6f6fea8
fixed map not loading on refresh bug, fixing task route update
JustinPinero Jun 1, 2022
d578ffb
added Task router to builder router and drilled props to circumvent r…
JustinPinero Jun 3, 2022
0051bf3
added temporary solution to allow advanced edit page to render
JustinPinero Jun 6, 2022
0b95e11
adding retrieval method
Alex-Gurung Jun 7, 2022
111d914
room description and filling from retrieval
Alex-Gurung Jun 8, 2022
f6c254e
fixing redux toolkit actions
JustinPinero Jun 9, 2022
e5330be
post pull
JustinPinero Jun 9, 2022
a56f6b6
changed import to work with light install
Alex-Gurung Jun 9, 2022
0f773b1
Merge branch 'worldbuilder-task-app-refactor' of github.com:facebookr…
JustinPinero Jun 9, 2022
e1dea4e
update for retrieval method
Alex-Gurung Jun 9, 2022
9d09ba2
fixing parlai internal issue
JustinPinero Jun 9, 2022
6d36ffc
Merge branch 'worldbuilder-task-app-refactor' of github.com:facebookr…
JustinPinero Jun 9, 2022
9bbc4f3
fixing cog navigation to advanced pages for new tokens and added back…
JustinPinero Jun 10, 2022
579ee02
fixed the tokenizer
JustinPinero Jun 10, 2022
64b6917
restructuring builder router locations, adding breadcrumbs with new l…
JustinPinero Jun 13, 2022
a01b3b2
updated breadCrumb component for taskRouter
JustinPinero Jun 13, 2022
8d31e20
fixed basic room page bread crumb navigation
JustinPinero Jun 13, 2022
05be276
Characters Page fixed
JustinPinero Jun 13, 2022
02c876c
updates for whole pipline
Alex-Gurung Jun 13, 2022
372297b
adding config to gitignore
Alex-Gurung Jun 13, 2022
eb4abfe
character page update
JustinPinero Jun 13, 2022
ac10beb
Merge branch 'worldbuilder-task-app-refactor' of github.com:facebookr…
JustinPinero Jun 13, 2022
183ee17
advanced object page now rendering
JustinPinero Jun 13, 2022
e08b4ec
added documentation and removed unused code from Builder Router and T…
JustinPinero Jun 13, 2022
997910b
changed mappage2 component to simply mappage
JustinPinero Jun 13, 2022
ece996a
changed mappage2 component to simply mappage
JustinPinero Jun 13, 2022
3c051af
cleaned up task component
JustinPinero Jun 13, 2022
f23fad7
cleaned up and documented MapPage
JustinPinero Jun 15, 2022
51b8b03
cleaned up and documented MapPage
JustinPinero Jun 15, 2022
7c966a8
Generate char/obj contents
Alex-Gurung Jun 15, 2022
1776078
Merge branch 'worldbuilder-task-app-refactor' of github.com:facebookr…
Alex-Gurung Jun 15, 2022
9b43e29
cleaned up roompage and character page
JustinPinero Jun 15, 2022
f231c84
Merge branch 'worldbuilder-task-app-refactor' of github.com:facebookr…
JustinPinero Jun 15, 2022
8f5346a
pulled new changes
JustinPinero Jun 15, 2022
2dfdadc
added save function to all advanced pages
JustinPinero Jun 15, 2022
de1b3ba
fixed basic room edit gear click function for new entries
JustinPinero Jun 15, 2022
47fc766
fixed basicEditRoomBody gear click and advanced click handlers
JustinPinero Jun 15, 2022
03f6649
added notes to BasicEditBody roadmapping updates necessary before demo
JustinPinero Jun 21, 2022
e1348f4
converting api format, intermediary
Alex-Gurung Jun 23, 2022
c5b1e94
fixing frame buttons
JustinPinero Jun 23, 2022
6141ccd
fixing frame buttons
JustinPinero Jun 23, 2022
d38927e
fixed frame
JustinPinero Jun 23, 2022
8d6548b
added add content function
JustinPinero Jun 23, 2022
9b340c7
added fixes for db retrieval in new format
Alex-Gurung Jun 23, 2022
69a4aaa
Merge branch 'worldbuilder-task-app-refactor' of github.com:facebookr…
Alex-Gurung Jun 23, 2022
4e535b6
pre common sense fix update pull
JustinPinero Jun 23, 2022
e5b2b8c
pre common sense fix update pull
JustinPinero Jun 23, 2022
682c03e
fixing basic edit local state and life cycle
JustinPinero Jun 23, 2022
e5daf28
fixed basic map edit suggested tokens
JustinPinero Jun 27, 2022
0ef6a6c
Fixed room deletion in basic edit body
JustinPinero Jun 28, 2022
4908f17
added object generation to room page
JustinPinero Jun 28, 2022
50b5f72
added backstep function and repaired delete and save functionality in…
JustinPinero Jun 28, 2022
1211851
fixing tokenizer
JustinPinero Jun 29, 2022
bf73088
update physical_description -> desc
Alex-Gurung Jun 29, 2022
f74125e
fixed object, character, and room array update upon deletion
JustinPinero Jun 29, 2022
88245c6
fixed tokenizer in basic and advanced room pages
JustinPinero Jun 30, 2022
5debecc
fixing worn and carried objects state in advanced character page
JustinPinero Jun 30, 2022
02ab9b5
fixed character page, added wearable and wielding state, fixed naming…
JustinPinero Jul 13, 2022
af45c89
small changes to fix add contents
Alex-Gurung Jul 14, 2022
3efb9f1
use_model false
Alex-Gurung Jul 14, 2022
9dc8642
small testing for character contents
Alex-Gurung Jul 15, 2022
c71012f
added more documentation to advanced edit pages, fixed character filt…
JustinPinero Jul 15, 2022
170e2de
Merge branch 'worldbuilder-task-app-refactor' of github.com:facebookr…
JustinPinero Jul 15, 2022
56e436c
added error and loading state, fixing add content function in advance…
JustinPinero Jul 18, 2022
3a524f4
remove _x from ids
Alex-Gurung Jul 18, 2022
ee01ad8
fixing add content function
JustinPinero Jul 18, 2022
843d05e
Merge branch 'worldbuilder-task-app-refactor' of github.com:facebookr…
JustinPinero Jul 18, 2022
6835b83
fix object name return
Alex-Gurung Jul 18, 2022
00197e2
fixed add content functions
JustinPinero Jul 18, 2022
f04d7c8
Merge branch 'worldbuilder-task-app-refactor' of github.com:facebookr…
JustinPinero Jul 18, 2022
9d8a241
added spinner and error alert
JustinPinero Jul 19, 2022
3b5c479
building new generate buttons
JustinPinero Jul 19, 2022
edb27ea
fixed async await in generate handler
JustinPinero Jul 19, 2022
6f05b11
fixed common sense room contents
JustinPinero Jul 19, 2022
0ea39ba
error fixing
Alex-Gurung Jul 19, 2022
0e4a281
major console log clean up and api interaction update in basic edit, …
JustinPinero Jul 20, 2022
a7b7755
updated characterPage api interaction handlers and removed most conso…
JustinPinero Jul 20, 2022
cee5e7c
updated characterPage api interaction handlers and removed most conso…
JustinPinero Jul 20, 2022
54246a0
fixed advanced object pagef api call handlers, cleaned out old consol…
JustinPinero Jul 20, 2022
082e90a
small bug fixes and get rid of attrs
Alex-Gurung Jul 21, 2022
7cadb01
fixed naming content in advanced room editor, fixing advanced object…
JustinPinero Aug 1, 2022
23a1b5a
fix desc for object
Alex-Gurung Aug 1, 2022
be48185
fixing object desc generation
JustinPinero Aug 1, 2022
4d57487
Merge branch 'worldbuilder-task-app-refactor' of github.com:facebookr…
JustinPinero Aug 1, 2022
ca3a447
silence errors
Alex-Gurung Aug 1, 2022
1dc1398
Merge branch 'worldbuilder-task-app-refactor' of github.com:facebookr…
Alex-Gurung Aug 1, 2022
dfdd512
pre submission test
JustinPinero Aug 2, 2022
9184262
Merge branch 'worldbuilder-task-app-refactor' of github.com:facebookr…
JustinPinero Aug 2, 2022
51c0a8b
fixes for model generation
Alex-Gurung Aug 3, 2022
100a2c0
quick fixes to make model path a config option
Alex-Gurung Sep 2, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#!/usr/bin/env python3

# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

from mephisto.abstractions.databases.local_database import LocalMephistoDB
from mephisto.tools.data_browser import DataBrowser as MephistoDataBrowser
from mephisto.data_model.worker import Worker
from mephisto.data_model.unit import Unit
from collections import Counter

db = LocalMephistoDB()
mephisto_data_browser = MephistoDataBrowser(db=db)

DO_REVIEW = True

# task_names = ["objects-interaction-task-pilot-3", "objects-interaction-task-pilot-4", "objects-interaction-task-pilot-5"]
task_names = ["objects-interaction-task-pilot-5"]

units = []
for t in task_names:
units.extend(mephisto_data_browser.get_units_for_task_name(t))

print(f"prev len: {len(units)}")
print(Counter([u.get_status() for u in units]))

# workers_to_res = {}
# worker_name_to_worker = {}

# for unit in units:
# status = unit.get_db_status()
# # contents = unit["data"]
# data = mephisto_data_browser.get_data_from_unit(unit)
# outputs = data['data']['outputs']
# if "pristine looking bucket, without a mark. Must have" in outputs['rawAction']:
# print(outputs)
# unit.set_db_status("soft_rejected")
# break

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#!/usr/bin/env python3

# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

from mephisto.abstractions.databases.local_database import LocalMephistoDB
from mephisto.tools.data_browser import DataBrowser as MephistoDataBrowser
from mephisto.data_model.worker import Worker
from mephisto.data_model.unit import Unit
from collections import Counter

db = LocalMephistoDB()
mephisto_data_browser = MephistoDataBrowser(db=db)

DO_REVIEW = True

units = mephisto_data_browser.get_units_for_task_name("objects-interaction-task-pilot-4")

print(f"prev len: {len(units)}")
print(Counter([u.get_status() for u in units]))
# units = [u for u in units if u.get_status() == "completed"]
# units = [u for u in units if u.get_status() == "completed"]
# print(f"len: {len(units)}")

workers_to_res = {}
worker_name_to_worker = {}

for unit in units:
worker = unit.get_assigned_agent().get_worker()
worker_name = worker.worker_name
worker_name_to_worker[worker_name] = worker
status = unit.get_db_status()
workers_to_res[worker_name] = [status, *workers_to_res.get(worker_name, [])]

# print({k:v for k, v in workers_to_res.items() if len(v) > 1})
for k, v in workers_to_res.items():
if len(v) <= 0:
continue
counted = Counter(v)
# if counted.get("accepted", 0) >= counted.get('soft_rejected', 0) * 2:
if counted.get("accepted", 0) == len(v):
worker = worker_name_to_worker[k]
worker.grant_qualification("collect_narrations_task_block", 0)
print(worker_name_to_worker[k], counted.get("accepted", 0), counted.get('soft_rejected', 0))


Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#@package _global_
mephisto:
provider:
requester_name: alexgurung_sandbox
blueprint:
task_source: ${task_dir}/webapp/build/bundle.js
extra_source_dir: ${task_dir}/webapp/src/static
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ mephisto:
extra_source_dir: ${task_dir}/webapp/src/static
units_per_assignment: 1
block_qualification: collect_narrations_task_block
# approve_qualification: collect_narrations_task_allow
task:
maximum_units_per_worker: 5
max_num_concurrent_units: 100
task_name: "objects-interaction-task-pilot-1"
max_num_concurrent_units: 10
task_name: "objects-interaction-task-pilot-5"
task_title: "Annotate an interaction between two objects. (pilot)"
task_description: "In this task you will recieve two object lists. You will be asked to select one from each, and then describe in second person an interaction that would occur if one were to use the objects together."
task_reward: 0.70
task_tags: "fantasy,object,interaction"
database:
database:
_database_type: singleton
num_tasks: 150
num_tasks: 70
qualify_new_workers: true
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,25 @@
from mephisto.abstractions.databases.local_database import LocalMephistoDB
from mephisto.tools.examine_utils import run_examine_or_review, print_results
from mephisto.data_model.worker import Worker
from mephisto.tools.data_browser import DataBrowser as MephistoDataBrowser
from collections import Counter

db = LocalMephistoDB()

mephisto_data_browser = MephistoDataBrowser(db=db)
task_names = ["objects-interaction-task-pilot-5", "objects-interaction-task-pilot-4"]

units = []
for t in task_names:
units.extend(mephisto_data_browser.get_units_for_task_name(t))

print(f"prev len: {len(units)}")
print(Counter([u.get_status() for u in units]))
units = [u for u in units if u.get_status() == "completed"]
print(f"len: {len(units)}")

def format_data_for_printing(data):
worker_name = Worker(db, data["worker_id"]).worker_name
worker_name = Worker.get(db, data["worker_id"]).worker_name
contents = data["data"]
duration = contents["times"]["task_end"] - contents["times"]["task_start"]
metadata_string = (
Expand All @@ -25,7 +38,8 @@ def format_data_for_printing(data):

if contents["inputs"] is not None and contents["outputs"] is not None:
inputs = contents["inputs"]
outputs = contents["outputs"]["final_data"]
# outputs = contents["outputs"]["final_data"]
outputs = contents["outputs"]
primary = outputs["primaryObject"]
secondary = outputs["secondaryObject"]
primary_object_map = {
Expand All @@ -43,7 +57,7 @@ def format_data_for_printing(data):
f"\t\t{primary}: {primary_object_map[primary]}\n"
f"\t\t{secondary}: {secondary_object_map[secondary]}\n\n"
)
outputs_string = f"Output:\n\tUse {primary} with {secondary}\n\tAction: {outputs['actionDescription']}\n"
outputs_string = f"Output:\n\tUse {primary} with {secondary}\n\n\tRaw Action: {outputs.get('rawAction')}\n\tAction Description: {outputs['actionDescription']}\n"

return f"-------------------\n{metadata_string}{inputs_string}{outputs_string}"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@
import shutil
import subprocess
from mephisto.operations.operator import Operator
from mephisto.operations.utils import get_root_dir
from mephisto.tools.scripts import load_db_and_process_config
from mephisto.abstractions.blueprint import BlueprintArgs
from mephisto.abstractions.blueprints.static_react_task.static_react_blueprint import (
BLUEPRINT_TYPE,
BLUEPRINT_TYPE_STATIC_REACT as BLUEPRINT_TYPE
)
from mephisto.abstractions.blueprints.abstract.static_task.static_blueprint import (
SharedStaticTaskState,
Expand All @@ -32,7 +30,8 @@
from typing import List, Any

TASK_DIRECTORY = os.path.dirname(os.path.abspath(__file__))
LIGHT_DB_PATH = "~/ParlAI/data/LIGHT/merged.db"
# LIGHT_DB_PATH = "~/ParlAI/data/LIGHT/merged.db"
LIGHT_DB_PATH = "~/ParlAI/data/light/environment/db/d3/database3.db"
PRIMARY_OBJECT_LIST_SIZE = 8
SECONDARY_OBJECT_LIST_SIZE = 8
DEFAULT_NUM_TASKS = 20
Expand All @@ -41,6 +40,7 @@
mephisto_data_browser = MephistoDataBrowser(db=db)

defaults = [
"_self_",
{"mephisto/blueprint": BLUEPRINT_TYPE},
{"mephisto/architect": "local"},
{"mephisto/provider": "mock"},
Expand Down Expand Up @@ -141,15 +141,20 @@ def validate_unit(unit):
if unit.get_assigned_agent() is None:
return

output = mephisto_data_browser.get_data_from_unit(unit)["data"]
unit_data = mephisto_data_browser.get_data_from_unit(unit)
unit_data = unit_data.get("data")

if output is None:
if unit_data is None:
return

data = mephisto_data_browser.get_data_from_unit(unit)["data"]["outputs"][
"final_data"
]
action_description = data["actionDescription"].strip()
data = unit_data.get("outputs")

if data is None or "actionDescription" not in data:
return
action_description = data["actionDescription"]
if type(action_description) is not str:
return
action_description = action_description.strip()

if (
len(action_description) <= 20
Expand Down Expand Up @@ -219,7 +224,6 @@ def onboarding_always_valid(onboarding_data):

db, cfg = load_db_and_process_config(cfg)
operator = Operator(db)

operator.validate_and_run_config(cfg.mephisto, shared_state)
operator.wait_for_runs_then_shutdown(skip_input=True, log_rate=30)

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env python3

# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

from mephisto.abstractions.databases.local_database import LocalMephistoDB
from mephisto.tools.data_browser import DataBrowser as MephistoDataBrowser
from mephisto.data_model.worker import Worker
from mephisto.data_model.unit import Unit
from collections import Counter

db = LocalMephistoDB()
mephisto_data_browser = MephistoDataBrowser(db=db)

DO_REVIEW = True

units = mephisto_data_browser.get_units_for_task_name("objects-interaction-task-pilot-5")

print(f"prev len: {len(units)}")
print(Counter([u.get_status() for u in units]))
units = [u for u in units if u.get_status() == "completed"]
print(f"len: {len(units)}")
Loading