garima-mahato commited on
Commit
77d149f
·
verified ·
1 Parent(s): 138db2f

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -1
app.py CHANGED
@@ -89,8 +89,11 @@ def bot(history):
89
  elif "[INST]" in history[-1][0]:
90
  q_ctxt = history[-1][0].split("[INST]")[0]
91
  query = history[-1][0].split("[INST]")[-1]
92
- input_text = history[-1][0].replace("[INST]"," ")
 
93
  ctxt_type = "text"
 
 
94
  input_tokens = tokenizer.encode(input_text)
95
  input_ids = torch.tensor(input_tokens, dtype=torch.int32).unsqueeze(0).to(device)
96
  inputs_embeds = phi_model.get_input_embeddings()(input_ids)
 
89
  elif "[INST]" in history[-1][0]:
90
  q_ctxt = history[-1][0].split("[INST]")[0]
91
  query = history[-1][0].split("[INST]")[-1]
92
+ # input_text = history[-1][0].replace("[INST]"," ")
93
+ input_text = q_ctxt + query
94
  ctxt_type = "text"
95
+ else:
96
+ input_text = q_ctxt + query
97
  input_tokens = tokenizer.encode(input_text)
98
  input_ids = torch.tensor(input_tokens, dtype=torch.int32).unsqueeze(0).to(device)
99
  inputs_embeds = phi_model.get_input_embeddings()(input_ids)