Cyantist8208 commited on
Commit
bd703a0
·
1 Parent(s): d3dc9d5
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -15,7 +15,7 @@ from transformers import (
15
  import torch.nn.functional as F
16
  from collections import defaultdict
17
  HF_TOKEN = os.getenv("HF_token")
18
- CHAT_MODEL_ID = "NousResearch/Meta-Llama-3-8B-Instruct"
19
  EMB_MODEL_ID = "mixedbread-ai/mxbai-embed-large-v1"
20
  MAX_PROMPT_TOKENS = 8192
21
 
@@ -190,7 +190,7 @@ def answer(system: str, context: str, question: str,
190
  top_k=top_k_tok
191
  )
192
  full = tokenizer.decode(output[0], skip_special_tokens=True)
193
- reply = full.split("<|im_start|>assistant")[-1].strip()
194
  return reply
195
 
196
  except Exception as e:
 
15
  import torch.nn.functional as F
16
  from collections import defaultdict
17
  HF_TOKEN = os.getenv("HF_token")
18
+ CHAT_MODEL_ID = "meta-llama/Llama-3.1-8B-Instruct"
19
  EMB_MODEL_ID = "mixedbread-ai/mxbai-embed-large-v1"
20
  MAX_PROMPT_TOKENS = 8192
21
 
 
190
  top_k=top_k_tok
191
  )
192
  full = tokenizer.decode(output[0], skip_special_tokens=True)
193
+ reply = full.split("<|im_start|>assistant")[-1].strip() + prompt
194
  return reply
195
 
196
  except Exception as e: