Update example programs (llama and loader) with hotfixes for issue.

This commit is contained in:
Foke Singh 2023-07-04 13:40:05 +00:00
parent 63aca9f9c2
commit f7bac1af10
2 changed files with 3 additions and 3 deletions

View File

@ -93,7 +93,7 @@ pub fn generateText(
std.debug.print("{s}\n", .{output.items[n..]});
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;
log.info("✅ Generated {d} tokens in {:.3}s: {d:.3}tok/s", .{ max_seq_len, duration, speed });

View File

@ -60,8 +60,8 @@ pub fn asyncMain() !void {
}
const stop = timer.read();
const time_in_s = stdx.math.divFloor(f64, stop, std.time.ns_per_s);
const mbs = stdx.math.divFloor(f64, total_bytes, 1024 * 1024);
const time_in_s = stdx.math.divFloat(f64, stop, std.time.ns_per_s);
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});
}