"tools/infer/predict_e2e.py" did not exist on "72ebbf2de1cfb94d97aee53359f2db0146988b72"
Commit deb05f43 authored by zhougaofeng's avatar zhougaofeng
Browse files

Update result/training_loss.png, result/all_results.json,...

Update result/training_loss.png, result/all_results.json, result/train_results.json, inference/single_dcu.py files
Deleted src/.gitkeep, doc/.gitkeep files
parent 6c1dbde3
Pipeline #1180 canceled with stages
in 0 seconds
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("./internlm2-math-7b", trust_remote_code=True)
# Set `torch_dtype=torch.float16` to load model in float16, otherwise it will be loaded as float32 and might cause OOM Error.
model = AutoModelForCausalLM.from_pretrained("./internlm2-math-7b", trust_remote_code=True, torch_dtype=torch.float16).cuda()
model = model.eval()
response, history = model.chat(tokenizer, "1+1=", history=[], meta_instruction="")
print(response)
{
"epoch": 2.99,
"eval_loss": 1.166934847831726,
"eval_runtime": 27.8269,
"eval_samples_per_second": 3.953,
"eval_steps_per_second": 1.977,
"train_loss": 1.0941363889343885,
"train_runtime": 2093.7152,
"train_samples_per_second": 1.406,
"train_steps_per_second": 0.351
}
\ No newline at end of file
{
"epoch": 2.99,
"train_loss": 1.0941363889343885,
"train_runtime": 2093.7152,
"train_samples_per_second": 1.406,
"train_steps_per_second": 0.351
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment