aspgvu
commited on
Commit
·
a884c1a
1
Parent(s):
53bbcb2
format issues
Browse files
app.py
CHANGED
@@ -1,8 +1,6 @@
|
|
1 |
import gradio as gr
|
2 |
import requests
|
3 |
|
4 |
-
reboot = True
|
5 |
-
|
6 |
def send_request(params, url):
|
7 |
while True:
|
8 |
try:
|
@@ -56,8 +54,8 @@ with gr.Blocks(theme=gr.themes.Default(), css="footer{display:none !important}")
|
|
56 |
def char_form_action(game, name, description):
|
57 |
# First round
|
58 |
game["player_name"] = name
|
59 |
-
game["game_id"] = add_new_game(game["user_id"])
|
60 |
-
dm_msg = start_new_story(game["user_id"], game["game_id"], game["player_name"], description)
|
61 |
|
62 |
# Return list, not dict -> it is problematic to show the progress on the disappearing widgets for some weird reason....
|
63 |
# ValueError: Returned dictionary included some keys as Components. Either all keys must be Components to assign Component values, or return a List of values to assign output values in order.
|
@@ -76,7 +74,7 @@ with gr.Blocks(theme=gr.themes.Default(), css="footer{display:none !important}")
|
|
76 |
|
77 |
def story_form_action(game, player_response):
|
78 |
if len(player_response.strip()) != 0:
|
79 |
-
dm_msg = add_user_msg(game["user_id"], game["game_id"], game["player_name"], player_response)
|
80 |
story_str = f'{game["player_name"]}: {player_response}\n\nDM: {dm_msg}'
|
81 |
return {
|
82 |
game_var: game,
|
|
|
1 |
import gradio as gr
|
2 |
import requests
|
3 |
|
|
|
|
|
4 |
def send_request(params, url):
|
5 |
while True:
|
6 |
try:
|
|
|
54 |
def char_form_action(game, name, description):
|
55 |
# First round
|
56 |
game["player_name"] = name
|
57 |
+
game["game_id"] = add_new_game(game["user_id"])['id']
|
58 |
+
dm_msg = start_new_story(game["user_id"], game["game_id"], game["player_name"], description)['content']
|
59 |
|
60 |
# Return list, not dict -> it is problematic to show the progress on the disappearing widgets for some weird reason....
|
61 |
# ValueError: Returned dictionary included some keys as Components. Either all keys must be Components to assign Component values, or return a List of values to assign output values in order.
|
|
|
74 |
|
75 |
def story_form_action(game, player_response):
|
76 |
if len(player_response.strip()) != 0:
|
77 |
+
dm_msg = add_user_msg(game["user_id"], game["game_id"], game["player_name"], player_response)['content']
|
78 |
story_str = f'{game["player_name"]}: {player_response}\n\nDM: {dm_msg}'
|
79 |
return {
|
80 |
game_var: game,
|