openfree commited on
Commit
300d6ac
·
verified ·
1 Parent(s): 836f0ea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -3
app.py CHANGED
@@ -183,6 +183,8 @@ class RPGGame:
183
  session_id = f"session_{datetime.now().strftime('%Y%m%d%H%M%S')}_{player_name}"
184
  self.current_session_id = session_id
185
  self.turn_number = 0
 
 
186
  self.current_stats = initialize_stats(genre)
187
 
188
  interactions.insert([{
@@ -193,7 +195,7 @@ class RPGGame:
193
  'turn_number': 0,
194
  'player_input': "Game starts",
195
  'timestamp': datetime.now(),
196
- 'player_stats': self.current_stats,
197
  'random_event': ""
198
  }])
199
 
@@ -533,5 +535,4 @@ def create_interface():
533
 
534
  if __name__ == "__main__":
535
  demo = create_interface()
536
- demo.launch()
537
-
 
183
  session_id = f"session_{datetime.now().strftime('%Y%m%d%H%M%S')}_{player_name}"
184
  self.current_session_id = session_id
185
  self.turn_number = 0
186
+
187
+ # 함수 호출 결과를 먼저 변수에 저장
188
  self.current_stats = initialize_stats(genre)
189
 
190
  interactions.insert([{
 
195
  'turn_number': 0,
196
  'player_input': "Game starts",
197
  'timestamp': datetime.now(),
198
+ 'player_stats': self.current_stats, # 문자열 값을 저장
199
  'random_event': ""
200
  }])
201
 
 
535
 
536
  if __name__ == "__main__":
537
  demo = create_interface()
538
+ demo.launch()