|
|
@@ -289,20 +289,13 @@ public:
|
|
|
it->second.totalSteps = totalSteps;
|
|
|
it->second.timeElapsed = static_cast<int64_t>(timeElapsed);
|
|
|
|
|
|
- // Handle first generation callback specially
|
|
|
+ // Use the actual genProgress value directly for overall progress
|
|
|
+ // This allows progress to start from 0% and go to 100% naturally
|
|
|
+ it->second.progress = genProgress;
|
|
|
+
|
|
|
+ // Mark that we've handled the first callback
|
|
|
if (it->second.firstGenerationCallback) {
|
|
|
- // This is the first callback, ignore the incoming genProgress value
|
|
|
- // and set overall progress to exactly 50% (model loading complete)
|
|
|
- it->second.generationProgress = 0.0f;
|
|
|
- it->second.progress = 0.5f;
|
|
|
- it->second.firstGenerationCallback = false; // Mark that we've handled the first callback
|
|
|
-
|
|
|
- LOG_DEBUG("First generation callback for job " + jobId +
|
|
|
- " - Ignored genProgress (" + std::to_string(genProgress) +
|
|
|
- "), reset generation progress to 0.0 and overall progress to 50%");
|
|
|
- } else {
|
|
|
- // For subsequent callbacks, calculate overall progress normally: 50% for model loading + 50% for generation
|
|
|
- it->second.progress = 0.5f + (genProgress * 0.5f);
|
|
|
+ it->second.firstGenerationCallback = false;
|
|
|
}
|
|
|
|
|
|
// Clamp overall progress to valid range [0.0, 1.0]
|
|
|
@@ -390,10 +383,10 @@ public:
|
|
|
if (bracketPos != std::string::npos) {
|
|
|
activeJobs[request.id].prompt = activeJobs[request.id].prompt.substr(0, bracketPos);
|
|
|
}
|
|
|
- // Set model loading to complete, overall progress to exactly 50% (halfway through)
|
|
|
+ // Set model loading to complete, but don't set artificial progress
|
|
|
activeJobs[request.id].modelLoadProgress = 1.0f;
|
|
|
activeJobs[request.id].generationProgress = 0.0f;
|
|
|
- activeJobs[request.id].progress = 0.5f;
|
|
|
+ activeJobs[request.id].progress = 0.0f; // Start from 0% for generation
|
|
|
activeJobs[request.id].firstGenerationCallback = true; // Initialize first callback flag
|
|
|
saveJobToFile(activeJobs[request.id]);
|
|
|
}
|