Update example programs (llama and loader) with hotfixes for issue.
This commit is contained in:
parent
63aca9f9c2
commit
f7bac1af10
@ -93,7 +93,7 @@ pub fn generateText(
|
|||||||
std.debug.print("{s}\n", .{output.items[n..]});
|
std.debug.print("{s}\n", .{output.items[n..]});
|
||||||
const end = std.time.microTimestamp();
|
const end = std.time.microTimestamp();
|
||||||
|
|
||||||
const duration = stdx.math.divFloor(f64, end - start, std.time.us_per_s);
|
const duration = stdx.math.divFloat(f64, end - start, std.time.us_per_s);
|
||||||
const speed = @as(f64, @floatFromInt(max_seq_len)) / duration;
|
const speed = @as(f64, @floatFromInt(max_seq_len)) / duration;
|
||||||
log.info("✅ Generated {d} tokens in {:.3}s: {d:.3}tok/s", .{ max_seq_len, duration, speed });
|
log.info("✅ Generated {d} tokens in {:.3}s: {d:.3}tok/s", .{ max_seq_len, duration, speed });
|
||||||
|
|
||||||
|
|||||||
@ -60,8 +60,8 @@ pub fn asyncMain() !void {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const stop = timer.read();
|
const stop = timer.read();
|
||||||
const time_in_s = stdx.math.divFloor(f64, stop, std.time.ns_per_s);
|
const time_in_s = stdx.math.divFloat(f64, stop, std.time.ns_per_s);
|
||||||
const mbs = stdx.math.divFloor(f64, total_bytes, 1024 * 1024);
|
const mbs = stdx.math.divFloat(f64, total_bytes, 1024 * 1024);
|
||||||
|
|
||||||
std.debug.print("\nLoading speed: {d:.2} MB/s\n\n", .{mbs / time_in_s});
|
std.debug.print("\nLoading speed: {d:.2} MB/s\n\n", .{mbs / time_in_s});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user