We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 904d438 commit 2758e30Copy full SHA for 2758e30
1 file changed
ai-model/inference/server.py
@@ -57,11 +57,11 @@ async def generate(req: GenerateRequest):
57
if model is None: raise HTTPException(503, 'Model not loaded')
58
sys_prompt = 'You are Lab68Dev Assistant, an AI for software development.'
59
# Build chat format
60
- sys_tag = chr(60) + '|system|' + chr(62)
61
- user_tag = chr(60) + '|user|' + chr(62)
62
- asst_tag = chr(60) + '|assistant|' + chr(62)
63
- end_tag = chr(60) + '/s' + chr(62)
64
- nl = chr(10)
+ sys_tag = "<|system|>"
+ user_tag = "<|user|>"
+ asst_tag = "<|assistant|>"
+ end_tag = "</s>"
+ nl = "\n"
65
full_prompt = sys_tag + nl + sys_prompt + end_tag + nl + user_tag + nl + req.prompt + end_tag + nl + asst_tag + nl
66
inputs = tokenizer(full_prompt, return_tensors='pt').to(model.device)
67
with torch.no_grad():
0 commit comments