pizb commited on
Commit
1d4890c
·
verified ·
1 Parent(s): 0b75c79

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. demo.py +3 -3
demo.py CHANGED
@@ -100,7 +100,7 @@ def main():
100
 
101
  @gr.render(inputs=[world_summary, stories, player_profile, round, player_restriction, player_capability, previous_conversation, previous_round_result, game_topic], triggers=[round.change, player_profile.change])
102
  def on_round(_world_summary, _stories, _player_profile, _round, _player_restriction, _player_capability, _previous_conversation, _previous_round_result, _game_topic):
103
- entire_story = [f"{idx+1}. {scenario["title"]}\n{scenario["story"]}\n\n" for idx, scenario in enumerate(_stories)]
104
  player_profile_str = player_profile_to_str({ **_player_profile, 'params': _player_capability })
105
 
106
  round_scenario = _stories[_round-1]
@@ -112,7 +112,7 @@ def main():
112
  return { round: 1, player_restriction: { "life": 30, "money": 30 }, player_capability: _player_profile["params"] }
113
  game_start_btn.click(fn=click_game_start_btn, outputs=[round, player_restriction, player_capability])
114
  else:
115
- round_story = f"{_round}. {round_scenario["title"]}: {round_scenario["story"]}\n"
116
  if _player_restriction["life"] <= 0 or _player_restriction["money"] <= 0:
117
  bad_ending = create_bad_ending(_world_summary, player_profile_str, _player_restriction, _player_capability, entire_story, round_story, _previous_conversation, _previous_round_result)
118
  display_bad_ending = gr.Markdown(bad_ending)
@@ -131,7 +131,7 @@ def main():
131
 
132
  else:
133
  round_description = create_round_description(_world_summary, player_profile_str, _player_restriction, _player_capability, entire_story, round_story, _previous_conversation, _previous_round_result)
134
- gr.Markdown(f"## {_round}. {round_scenario["title"]}")
135
  with gr.Row():
136
  gr.Markdown(round_description)
137
  with gr.Column():
 
100
 
101
  @gr.render(inputs=[world_summary, stories, player_profile, round, player_restriction, player_capability, previous_conversation, previous_round_result, game_topic], triggers=[round.change, player_profile.change])
102
  def on_round(_world_summary, _stories, _player_profile, _round, _player_restriction, _player_capability, _previous_conversation, _previous_round_result, _game_topic):
103
+ entire_story = [f"{idx+1}. {scenario['title']}\n{scenario['story']}\n\n" for idx, scenario in enumerate(_stories)]
104
  player_profile_str = player_profile_to_str({ **_player_profile, 'params': _player_capability })
105
 
106
  round_scenario = _stories[_round-1]
 
112
  return { round: 1, player_restriction: { "life": 30, "money": 30 }, player_capability: _player_profile["params"] }
113
  game_start_btn.click(fn=click_game_start_btn, outputs=[round, player_restriction, player_capability])
114
  else:
115
+ round_story = f"{_round}. {round_scenario['title']}: {round_scenario['story']}\n"
116
  if _player_restriction["life"] <= 0 or _player_restriction["money"] <= 0:
117
  bad_ending = create_bad_ending(_world_summary, player_profile_str, _player_restriction, _player_capability, entire_story, round_story, _previous_conversation, _previous_round_result)
118
  display_bad_ending = gr.Markdown(bad_ending)
 
131
 
132
  else:
133
  round_description = create_round_description(_world_summary, player_profile_str, _player_restriction, _player_capability, entire_story, round_story, _previous_conversation, _previous_round_result)
134
+ gr.Markdown(f"## {_round}. {round_scenario['title']}")
135
  with gr.Row():
136
  gr.Markdown(round_description)
137
  with gr.Column():