[2/2] Decouple Envs from version: Update /fix / pin all envs 0.2.0#394
[2/2] Decouple Envs from version: Update /fix / pin all envs 0.2.0#394burtenshaw wants to merge 9 commits intomainfrom
Conversation
Greptile SummaryLarge cross-cutting PR that updates all environments for standalone HuggingFace Spaces deployment with OpenEnv 2.2.0. Key changes:
Issues Found
Alignment ReviewNo invariant violations were identified. The changes do not expose Confidence Score: 3/5
Important Files Changed
Flowchartflowchart TD
A[prepare_hf_deployment.sh] --> B{--all or --env?}
B -->|--all| C[discover_all_envs]
B -->|--env| D[SELECTED_ENVS]
C --> D
D --> E[For each env]
E --> F[prepare_stage]
F --> F1[Copy src/ + envs/]
F1 --> F2[Pin openenv refs in pyproject.toml]
F2 --> F3[create_environment_dockerfile]
F3 --> F4[create_readme]
F4 --> G{DRY_RUN?}
G -->|Yes| H[Log would deploy]
G -->|No| I[hf repo create + hf upload]
I --> J[DEPLOYED_SPACES]
H --> J
J --> K{skip-collection?}
K -->|No| L[manage_hf_collection.py]
L --> M[resolve_collection_slug]
M --> N[add_spaces_to_collection]
K -->|Yes| O[Done]
N --> O
Last reviewed commit: 5895a08 |
Additional Comments (1)
The new Either relax this guard to also accept tokenizers with Prompt To Fix With AIThis is a comment left during a code review.
Path: envs/chat_env/server/chat_environment.py
Line: 45:46
Comment:
**Constructor guard contradicts new fallback logic**
The new `_tokenize_conversation` method (line 59) gracefully falls back to `tokenizer.encode()` when `apply_chat_template` fails. However, the `__init__` guard here still rejects tokenizers that lack `apply_chat_template` before they ever get a chance to use the fallback. This means tokenizers like GPT-2 (which the fallback comment specifically mentions) will be rejected at construction time.
Either relax this guard to also accept tokenizers with `encode`, or remove it entirely and let `_tokenize_conversation` handle the validation:
```suggestion
if not hasattr(tokenizer, "apply_chat_template") and not hasattr(tokenizer, "encode"):
raise ValueError("Tokenizer must have 'apply_chat_template' or 'encode' method")
```
How can I resolve this? If you propose a fix, please make it concise. |
# Conflicts: # envs/chat_env/server/chat_environment.py # envs/dipg_safety_env/server/app.py # envs/finrl_env/models.py # envs/grid_world_env/__init__.py # envs/openapp_env/client.py # envs/openapp_env/server/app.py # envs/openapp_env/server/openapp_environment.py # envs/textarena_env/server/environment.py # envs/websearch_env/server/app.py # envs/websearch_env/server/web_search_environment.py
⚠ Pr is pointed not pointed at
mainSummary
Sorry, this is a big PR mainly by codex. This implements fixes and pins accross all envs so that they deploy to the hub in their current state. As reflected in this collection: https://huggingface.co/collections/openenv/openenv-environment-hub-v210