harrygens commited on
Commit
339160f
·
1 Parent(s): 67d820b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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, printMessages(messages), localvar
80
  else:
81
- return "please input words!", printMessages(messages), localvar
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..."), gr.Textbox(label="History"), "state"], title="DND Game",#, gr.Textbox(label="History"),
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)