Update app.py
Browse files
app.py
CHANGED
@@ -76,9 +76,9 @@ def chatbot(race, cls, input, localvar):
|
|
76 |
localvar['status'] = getStatus(reply)
|
77 |
messages.append({"role": "assistant", "content": reply})
|
78 |
localvar['messages'] = messages
|
79 |
-
return reply,
|
80 |
else:
|
81 |
-
return "please input words!",
|
82 |
|
83 |
def printMessages(messages):
|
84 |
delimiter = '\n'
|
@@ -89,6 +89,6 @@ def printMessages(messages):
|
|
89 |
app = gr.Interface(fn=chatbot, inputs=[gr.Dropdown(["Orc", "Human", "Elf", "Dwarf", "Halfling", "Goliath", "Dragonborn"], value="Orc", label="Race", info="please choose your race:"),
|
90 |
gr.Dropdown(["Warrior", "Mage", "Priest", "Assassin", "Thief", "Paladin", "Archer", "Guardian"], value="Warrior", label="Class", info="please choose the name of the class you wish to play as:"),
|
91 |
gr.Textbox(lines=7, label="You ask and answer questions below", placeholder="Press submit button to start game"), "state"], #Type word 'start game'
|
92 |
-
outputs=[gr.Textbox(label="DND Game Reply", placeholder="Waiting for you press submit button to start play..."),
|
93 |
description="DND Game",theme="compact")
|
94 |
app.launch(share=False)
|
|
|
76 |
localvar['status'] = getStatus(reply)
|
77 |
messages.append({"role": "assistant", "content": reply})
|
78 |
localvar['messages'] = messages
|
79 |
+
return reply, localvar
|
80 |
else:
|
81 |
+
return "please input words!", localvar
|
82 |
|
83 |
def printMessages(messages):
|
84 |
delimiter = '\n'
|
|
|
89 |
app = gr.Interface(fn=chatbot, inputs=[gr.Dropdown(["Orc", "Human", "Elf", "Dwarf", "Halfling", "Goliath", "Dragonborn"], value="Orc", label="Race", info="please choose your race:"),
|
90 |
gr.Dropdown(["Warrior", "Mage", "Priest", "Assassin", "Thief", "Paladin", "Archer", "Guardian"], value="Warrior", label="Class", info="please choose the name of the class you wish to play as:"),
|
91 |
gr.Textbox(lines=7, label="You ask and answer questions below", placeholder="Press submit button to start game"), "state"], #Type word 'start game'
|
92 |
+
outputs=[gr.Textbox(label="DND Game Reply", placeholder="Waiting for you press submit button to start play..."), "state"], title="DND Game",#, gr.Textbox(label="History"),
|
93 |
description="DND Game",theme="compact")
|
94 |
app.launch(share=False)
|