teaevo commited on
Commit
ad8fb78
·
1 Parent(s): 978fd4d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -0
app.py CHANGED
@@ -80,6 +80,15 @@ def chat(input, history=[]):
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')
 
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')