Skip to content

Commit

Permalink
more things
Browse files Browse the repository at this point in the history
  • Loading branch information
amitkparekh committed Dec 5, 2023
1 parent b567c23 commit 7470524
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 9 deletions.
2 changes: 0 additions & 2 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ extend-select =
# Within an except clause, raise exceptions with `raise ... from err` or `raise ...
# from None` to distinguish them from errors in exception handling
B904,
# Alternative to E501 regarding line length
B950,
# Counterpart to W503, enforce having the operator at the start of a new line.
W504,

Expand Down
46 changes: 42 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,51 @@
# Offline Inference on the Alexa Arena
<div align='center'>

# EMMA: Offline Inference on the Alexa Arena

<a href="https://www.python.org/">
<img alt="Python 3.9" src="https://img.shields.io/badge/-Python 3.9+-blue?logo=python&logoColor=white">
</a>
<a href="https://pytorch.org/">
<img alt="PyTorch" src="https://img.shields.io/badge/PyTorch-ee4c2c?logo=pytorch&logoColor=white">
</a>
<a href="https://python-poetry.org">
<img alt="Poetry" src="https://img.shields.io/badge/Poetry-1E293B?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgNDQ4LjE3IDU2MCI+PGRlZnM+PHN0eWxlPi5jbHMtMXtpc29sYXRpb246aXNvbGF0ZTt9LmNscy0ye2ZpbGw6dXJsKCNyYWRpYWwtZ3JhZGllbnQpO30uY2xzLTN7ZmlsbDp1cmwoI3JhZGlhbC1ncmFkaWVudC0yKTt9LmNscy00LC5jbHMtNSwuY2xzLTZ7bWl4LWJsZW5kLW1vZGU6bXVsdGlwbHk7fS5jbHMtNHtmaWxsOnVybCgjbGluZWFyLWdyYWRpZW50KTt9LmNscy01e2ZpbGw6dXJsKCNsaW5lYXItZ3JhZGllbnQ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GF0aCBjbGFzcz0iY2xzLTYiIGQ9Ik00NTkuODQsNDAzLjU5LDU2LjI1LDAsNDIzLjE0LDQzNy4xM0M0MzUuODMsNDI2LjQ2LDQ0OC4xMiw0MTUuMzEsNDU5Ljg0LDQwMy41OVoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC01Ni4yNSkiLz48cGF0aCBjbGFzcz0iY2xzLTciIGQ9Ik01Ni4yNSwwLDM3My4xNiwzMTYuOTFxNC4yMy00LjI1LDguMzUtOC42WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTU2LjI1KSIvPjwvZz48L2c+PC9zdmc+">
</a>

<br>

<a href="https://github.com/pre-commit/pre-commit">
<img alt="pre-commit" src="https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white">
</a>
<a href="https://github.com/psf/black">
<img alt="style: black" src="https://img.shields.io/badge/style-black-000000.svg">
</a>
<a href="https://wemake-python-stylegui.de/en/">
<img alt="wemake-python-styleguide" src="https://img.shields.io/badge/style-wemake-000000.svg">
</a>

<br>

[![Continuous Integration](https://github.com/emma-heriot-watt/offline-inference/actions/workflows/continuous_integration.yml/badge.svg)](https://github.com/emma-heriot-watt/offline-inference/actions/workflows/continuous_integration.yml)
[![Tests](https://github.com/emma-heriot-watt/offline-inference/actions/workflows/tests.yml/badge.svg)](https://github.com/emma-heriot-watt/offline-inference/actions/workflows/tests.yml)

</div>

> [!IMPORTANT]
> If you have questions or find bugs or anything, you can contact us in our [organisation's discussion](https://github.com/orgs/emma-heriot-watt/discussions).
## About

We use code in this repository to generate new missions to facilitate self-play, to run the agent in the environment, and to evaluate the agent for the eval.ai leaderboard.

> [!IMPORTANT]
> We only ever ran this on a Ubuntu 20 Linux machine. This has not been tested or verified on MacOS or Windows. Your mileage may vary.
## Installing dependencies

> [!IMPORTANT]
> You can run the convenience script at `scripts/prepare-user-area.sh`.
You can run the convenience script at `scripts/prepare-user-area.sh`.

> [!WARNING]
> [!CAUTION]
> I **HIGHLY RECOMMEND** reading the script to know what it does, because you might not need all of it!
> The convenience script does do some sudo-based file changes so if you don't want to permanently dirty your computer, look at it!
Expand Down
4 changes: 2 additions & 2 deletions src/arena_missions/structures/cdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ def check_floor_plan_is_numeric(cls, floor_plan: str) -> str:
"""Check that floor plan is a numeric string."""
try:
int(floor_plan)
except ValueError:
raise ValueError(f"Floor plan must be numeric string, got {floor_plan}")
except ValueError as err:
raise ValueError(f"Floor plan must be numeric string, got {floor_plan}") from err
return floor_plan


Expand Down
2 changes: 1 addition & 1 deletion src/simbot_offline_inference/orchestrators.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ def _should_return_control_for_actions(self, actions: list[dict[str, Any]]) -> b
We only return control on sending the "Dialog" action, and no other time.
"""
return any([action["type"] == "Dialog" for action in actions])
return any(action["type"] == "Dialog" for action in actions)

def _filter_dialog_actions(self, actions: list[dict[str, Any]]) -> list[dict[str, Any]]:
"""Remove any dialog actions from the response."""
Expand Down

0 comments on commit 7470524

Please sign in to comment.