Skip to content

Commit

Permalink
Update readme, setup hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKaravaev committed Jul 9, 2023
1 parent 7c64584 commit 00a6e62
Show file tree
Hide file tree
Showing 8 changed files with 132 additions and 10 deletions.
4 changes: 4 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[flake8]
ignore = E226,E302,E41,C901
max-line-length = 89
max-complexity = 10
1 change: 1 addition & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ default_section=THIRDPARTY

known_localfolder=
ciare_world_creator,
known_third_party = aiohttp,chromadb,click,langchain,lxml,openai,pandas,pytest,questionary,requests,tabulate,tinydb,tqdm
19 changes: 19 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
repos:
- repo: https://github.com/asottile/seed-isort-config
rev: v2.2.0
hooks:
- id: seed-isort-config
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.10.1
hooks:
- id: isort
- repo: https://github.com/ambv/black
rev: 23.3.0
hooks:
- id: black
args: [--line-length, "88", "."]
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
hooks:
- id: flake8
args: [--config, ".flake8"]
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ Imagine a scenario where you want to test the navigation capabilities of a robot

# Features

## Models

Currently it uses gpt-3.5-16k by default, but if you have access to gpt-4, you will be prompted with a selection. Note that gpt-4 performs much better, but not everyone has the invitation from OpenAI to use it.

## Current limitations

Currently it's Proof Of Concept solution. There will be a lot of future development. Right now it really does often hallucinate and it's spatial notion is not that great, but sometimes it generates something cool.
Expand Down Expand Up @@ -44,7 +48,7 @@ Currently, we use https://app.gazebosim.org/dashboard as database of the models.
| Pile of fruits and other food in empty world | ![alt text](./docs/examples/pile.png) |
| Surgical room | ![alt text](./docs/examples/surgical_room.png) |
| Warehouse shelves | ![alt text](./docs/examples/warehouse_shelves.png) |

| Usual persons living room| ![alt text](./docs/examples/living_room.png) |


# Getting Started
Expand Down
21 changes: 14 additions & 7 deletions ciare_world_creator/commands/create.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ def cli(ctx):

if len(allowed_models) > 1:
chosen_model = questionary.select(
message="Choose model to generate with. GPT-4 is much better, but also little-bit more expensive",
message=(
"Choose model to generate with. GPT-4 is much better,"
" but also little-bit more expensive"
),
choices=allowed_models,
style=STYLE,
).ask()
Expand All @@ -89,7 +92,9 @@ def cli(ctx):
)
except openai.error.AuthenticationError:
questionary.print(
f"OpenAI api key at {cache.cache_path}/openai_api_key incorrect. Regenerate it at https://platform.openai.com/account/api-keys at copy to {cache.cache_path}/openai_api_key",
f"OpenAI api key at {cache.cache_path}/openai_api_key incorrect. "
"Regenerate it at https://platform.openai.com/account/api-keys at copy "
f"to {cache.cache_path}/openai_api_key",
style="bold italic fg:red",
)
sys.exit(os.EX_DATAERR)
Expand All @@ -103,7 +108,7 @@ def cli(ctx):

generate_world = questionary.confirm(
"Do you want to spawn model in an empty world?"
"Saying no will download world from database, but it's very unstable. Y/n",
" Saying no will download world from database, but it's very unstable. Y/n",
style=STYLE,
).ask()

Expand Down Expand Up @@ -154,7 +159,8 @@ def cli(ctx):
if not find_model(model["Model"], full_models):
models = prompt_model(
content,
f"{model} was not found in context list. Generate only the one that are in the context",
f"{model} was not found in context list. "
"Generate only the one that are in the context",
chosen_model,
)

Expand All @@ -170,7 +176,6 @@ def cli(ctx):
cleaned_query = re.sub(r'[<>:;.,"/\\|?*]', "", query).strip()
world_name = f'world_{cleaned_query.replace(" ", "_")}'

x, y = 0, 0
include_elements = []
i = 0

Expand All @@ -182,7 +187,8 @@ def cli(ctx):
m = find_model(model["Model"], full_models)
if not m:
questionary.print(
f"Model {model} was not found in database. LLM hallucinated and made that up, skipping this model...",
f"Model {model} was not found in database. "
"LLM hallucinated and made that up, skipping this model...",
style="bold italic fg:red",
)
non_existent_models.append(model)
Expand All @@ -197,7 +203,8 @@ def cli(ctx):
0,
0,
0,
f"https://fuel.gazebosim.org/1.0/{m['owner']}/models/{m['name'].replace(' ', '%20')}",
"https://fuel.gazebosim.org/1.0/"
f"{m['owner']}/models/{m['name'].replace(' ', '%20')}",
)
include_elements.append(include)
i = i + 1
Expand Down
Binary file added docs/examples/living_room.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
90 changes: 88 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ asyncio = "^3.4.3"
aiohttp = "^3.8.4"
tabulate = "^0.9.0"
lark = "^1.1.5"
pre-commit = "^3.3.3"

[tool.poetry.dev-dependencies]
black = "*"
Expand Down

0 comments on commit 00a6e62

Please sign in to comment.