debug
Browse files
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 |
-
|
|
|
|
|
|
|
| 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 |
|