Spaces:
Running
Running
gorkemgoknar
commited on
Commit
•
5e592a5
1
Parent(s):
3bd1216
Update app.py
Browse files
app.py
CHANGED
@@ -93,9 +93,9 @@ def get_chat_response(name,history=[], input_txt = "Hello , what is your name?")
|
|
93 |
def greet(character,message):
|
94 |
|
95 |
#gradios set_state/get_state had problems on embedded html!
|
96 |
-
history = gr.get_state() or {"character": character, "message_history" : [] }
|
97 |
#gradios set_state/get_state does not persist session for now using global
|
98 |
-
|
99 |
|
100 |
if history["character"] != character:
|
101 |
#switching character
|
@@ -138,7 +138,7 @@ description = "Chat with your favorite movie characters. This space demo has sim
|
|
138 |
#History not implemented in this demo, use metayazar.com/chatbot for a movie and character dropdown chat interface
|
139 |
##interface = gr.Interface(fn=greet, inputs=[gr.inputs.Dropdown(personality_choices) ,"text"], title=title, description=description, outputs="text")
|
140 |
|
141 |
-
|
142 |
interface= gr.Interface(fn=greet, inputs=[gr.inputs.Dropdown(personality_choices) ,"text"], outputs="html",css=css, title=title, description=description)
|
143 |
|
144 |
|
|
|
93 |
def greet(character,message):
|
94 |
|
95 |
#gradios set_state/get_state had problems on embedded html!
|
96 |
+
#history = gr.get_state() or {"character": character, "message_history" : [] }
|
97 |
#gradios set_state/get_state does not persist session for now using global
|
98 |
+
global history
|
99 |
|
100 |
if history["character"] != character:
|
101 |
#switching character
|
|
|
138 |
#History not implemented in this demo, use metayazar.com/chatbot for a movie and character dropdown chat interface
|
139 |
##interface = gr.Interface(fn=greet, inputs=[gr.inputs.Dropdown(personality_choices) ,"text"], title=title, description=description, outputs="text")
|
140 |
|
141 |
+
history = {"character": "None", "message_history" : [] }
|
142 |
interface= gr.Interface(fn=greet, inputs=[gr.inputs.Dropdown(personality_choices) ,"text"], outputs="html",css=css, title=title, description=description)
|
143 |
|
144 |
|