Update app.py
Browse files
app.py
CHANGED
@@ -66,7 +66,7 @@ sql_model = BartForConditionalGeneration.from_pretrained(sql_model_name)
|
|
66 |
#sql_response = None
|
67 |
conversation_history = []
|
68 |
|
69 |
-
def predict(input
|
70 |
|
71 |
#global sql_response
|
72 |
# Check if the user input is a question
|
@@ -109,9 +109,9 @@ def chatbot_interface(user_input):
|
|
109 |
conversation_history.append(user_input)
|
110 |
|
111 |
dialog_prompt = "User: " + " ".join(conversation_history) + "\nBot:"
|
112 |
-
response = predict(dialog_prompt
|
113 |
conversation_history.append(response)
|
114 |
-
return
|
115 |
|
116 |
def sqlquery(input):
|
117 |
|
@@ -124,8 +124,8 @@ def sqlquery(input):
|
|
124 |
|
125 |
chat_interface = gr.Interface(
|
126 |
fn=chatbot_interface,
|
127 |
-
inputs=
|
128 |
-
outputs=
|
129 |
live=True,
|
130 |
|
131 |
)
|
|
|
66 |
#sql_response = None
|
67 |
conversation_history = []
|
68 |
|
69 |
+
def predict(input): #history=[]):
|
70 |
|
71 |
#global sql_response
|
72 |
# Check if the user input is a question
|
|
|
109 |
conversation_history.append(user_input)
|
110 |
|
111 |
dialog_prompt = "User: " + " ".join(conversation_history) + "\nBot:"
|
112 |
+
response = predict(dialog_prompt)
|
113 |
conversation_history.append(response)
|
114 |
+
return response
|
115 |
|
116 |
def sqlquery(input):
|
117 |
|
|
|
124 |
|
125 |
chat_interface = gr.Interface(
|
126 |
fn=chatbot_interface,
|
127 |
+
inputs=gr.Textbox(prompt="You:"),
|
128 |
+
outputs=gr.Textbox(),
|
129 |
live=True,
|
130 |
|
131 |
)
|