Update app.py
Browse files
app.py
CHANGED
@@ -70,7 +70,7 @@ def chat(input, history=[]):
|
|
70 |
|
71 |
#global sql_response
|
72 |
# Check if the user input is a question
|
73 |
-
is_question = "?" in input
|
74 |
|
75 |
'''
|
76 |
if is_question:
|
@@ -80,15 +80,6 @@ def chat(input, history=[]):
|
|
80 |
|
81 |
else:
|
82 |
'''
|
83 |
-
|
84 |
-
if is_question:
|
85 |
-
chatbot_model_name = "microsoft/tapex-large-finetuned-wtq"
|
86 |
-
tokenizer = AutoTokenizer.from_pretrained(chatbot_model_name)
|
87 |
-
model = AutoModelForCausalLM.from_pretrained(chatbot_model_name)
|
88 |
-
else:
|
89 |
-
chatbot_model_name = "microsoft/DialoGPT-medium"
|
90 |
-
tokenizer = AutoTokenizer.from_pretrained(chatbot_model_name)
|
91 |
-
model = AutoModelForCausalLM.from_pretrained(chatbot_model_name)
|
92 |
|
93 |
# tokenize the new input sentence
|
94 |
new_user_input_ids = tokenizer.encode(input + tokenizer.eos_token, return_tensors='pt')
|
|
|
70 |
|
71 |
#global sql_response
|
72 |
# Check if the user input is a question
|
73 |
+
#is_question = "?" in input
|
74 |
|
75 |
'''
|
76 |
if is_question:
|
|
|
80 |
|
81 |
else:
|
82 |
'''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
83 |
|
84 |
# tokenize the new input sentence
|
85 |
new_user_input_ids = tokenizer.encode(input + tokenizer.eos_token, return_tensors='pt')
|