Skip to content

Prevent text generation process from overwriting quest's description and game's objective. - #240

Merged
Marc-Alexandre Côté (MarcCote) merged 2 commits into
microsoft:masterfrom
MarcCote:fix_239
Jun 11, 2020
Merged

Prevent text generation process from overwriting quest's description and game's objective.#240
Marc-Alexandre Côté (MarcCote) merged 2 commits into
microsoft:masterfrom
MarcCote:fix_239

Conversation

@MarcCote

Copy link
Copy Markdown
Contributor

This PR addresses #239

@codecov-commenter

Codecov Comments Bot (codecov-commenter) commented Jun 10, 2020

Copy link
Copy Markdown

Codecov Report

Merging #240 into master will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@ Coverage Diff @@## master #240 +/- ##
==========================================
+ Coverage 82.84% 82.86% +0.01% 
==========================================
Files 56 56 Lines 6944 6951 +7 ==========================================
+ Hits 5753 5760 +7 
Misses 1191 1191 
Impacted FilesCoverage Δ
textworld/generator/game.py94.56% <100.00%> (+0.03%)⬆️
textworld/generator/maker.py79.69% <100.00%> (+0.10%)⬆️
textworld/generator/text_generation.py84.28% <100.00%> (+0.04%)⬆️

@MarcCote
Marc-Alexandre Côté (MarcCote) merged commit 02b37ae into microsoft:masterJun 11, 2020
Greg Sochanik (gregyoto) added a commit to gregyoto/TextWorld that referenced this pull request Feb 8, 2026
…exist
PR microsoft#240 (fixing microsoft#239) added code to preserve a manually-set objective
across build() calls. However, the preservation happens before
change_grammar() is called, which unconditionally overwrites the
objective via describe_event(). This means the fix only worked for
games without quests (no winning policy = no describe_event call).
The fix: only auto-generate the objective in change_grammar() if one
hasn't already been set (self._objective is None).
Fixesmicrosoft#373
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@MarcCote@codecov-commenter