Spaces:
Sleeping
Sleeping
Upload app.py
Browse files
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)
|