abenkbp commited on
Commit
e601d7e
·
1 Parent(s): 8b941c9
Files changed (1) hide show
  1. data/models/llama3-1-70b.py +3 -1
data/models/llama3-1-70b.py CHANGED
@@ -46,7 +46,9 @@ def chat_completion():
46
 
47
  outputs = model.generate(**inputs, do_sample=True, max_new_tokens=max_tokens,temperature=temperature,top_p=top_p,token=api_key).to("cuda")
48
 
49
- return jsonify({"status": "success", "output": tokenizer.batch_decode(outputs[:, inputs['input_ids'].shape[1]:], skip_special_tokens=True)[0]})
 
 
50
  except Exception as e:
51
  return jsonify({"status": "error", "message": str(e)})
52
 
 
46
 
47
  outputs = model.generate(**inputs, do_sample=True, max_new_tokens=max_tokens,temperature=temperature,top_p=top_p,token=api_key).to("cuda")
48
 
49
+ response = tokenizer.batch_decode(outputs[:, inputs['input_ids'].shape[1]:], skip_special_tokens=True)
50
+
51
+ return jsonify({"status": "success", "output": response[0]})
52
  except Exception as e:
53
  return jsonify({"status": "error", "message": str(e)})
54