mirror of
https://github.com/exo-explore/exo.git
synced 2026-02-26 03:06:05 -05:00
Compare commits
2 Commits
remove-pyt
...
feat/prefi
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
340aa36877 | ||
|
|
32669ae82d |
@@ -14,6 +14,21 @@
|
|||||||
: 0,
|
: 0,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const etaText = $derived.by(() => {
|
||||||
|
if (progress.processed <= 0 || progress.total <= 0) return null;
|
||||||
|
const elapsedMs = performance.now() - progress.startedAt;
|
||||||
|
if (elapsedMs < 200) return null; // need a minimum sample window
|
||||||
|
const tokensPerMs = progress.processed / elapsedMs;
|
||||||
|
const remainingTokens = progress.total - progress.processed;
|
||||||
|
const remainingMs = remainingTokens / tokensPerMs;
|
||||||
|
const remainingSec = Math.ceil(remainingMs / 1000);
|
||||||
|
if (remainingSec <= 0) return null;
|
||||||
|
if (remainingSec < 60) return `~${remainingSec}s remaining`;
|
||||||
|
const mins = Math.floor(remainingSec / 60);
|
||||||
|
const secs = remainingSec % 60;
|
||||||
|
return `~${mins}m ${secs}s remaining`;
|
||||||
|
});
|
||||||
|
|
||||||
function formatTokenCount(count: number | undefined): string {
|
function formatTokenCount(count: number | undefined): string {
|
||||||
if (count == null) return "0";
|
if (count == null) return "0";
|
||||||
if (count >= 1000) {
|
if (count >= 1000) {
|
||||||
@@ -40,8 +55,11 @@
|
|||||||
style="width: {percentage}%"
|
style="width: {percentage}%"
|
||||||
></div>
|
></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="text-right text-xs text-exo-light-gray/70 mt-0.5 font-mono">
|
<div
|
||||||
{percentage}%
|
class="flex items-center justify-between text-xs text-exo-light-gray/70 mt-0.5 font-mono"
|
||||||
|
>
|
||||||
|
<span>{etaText ?? ""}</span>
|
||||||
|
<span>{percentage}%</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
@@ -276,6 +276,8 @@ export interface TokenData {
|
|||||||
export interface PrefillProgress {
|
export interface PrefillProgress {
|
||||||
processed: number;
|
processed: number;
|
||||||
total: number;
|
total: number;
|
||||||
|
/** Timestamp (performance.now()) when prefill started. */
|
||||||
|
startedAt: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Message {
|
export interface Message {
|
||||||
@@ -2459,6 +2461,7 @@ class AppStore {
|
|||||||
this.prefillProgress = {
|
this.prefillProgress = {
|
||||||
processed: inner.processed_tokens,
|
processed: inner.processed_tokens,
|
||||||
total: inner.total_tokens,
|
total: inner.total_tokens,
|
||||||
|
startedAt: this.prefillProgress?.startedAt ?? performance.now(),
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
BIN
prefill-eta-screenshot.png
Normal file
BIN
prefill-eta-screenshot.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 110 KiB |
Reference in New Issue
Block a user