forked from TensorStack-AI/TensorStack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPipelineProgress.cs
More file actions
25 lines (23 loc) · 1001 Bytes
/
PipelineProgress.cs
File metadata and controls
25 lines (23 loc) · 1001 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using System;
using TensorStack.Common.Pipeline;
namespace TensorStack.Python.Common
{
public record PipelineProgress : IRunProgress
{
public string Process { get; set; }
public string Message { get; set; }
public int Iteration { get; set; }
public int Iterations { get; set; }
public float IterationsPerSecond { get; set; }
public float SecondsPerIteration { get; set; }
public float Downloaded { get; set; }
public float DownloadTotal { get; set; }
public float DownloadSpeed { get; set; }
public string DownloadModel { get; set; }
public string DownloadFile { get; set; }
public bool IsLoading => Process == "Load";
public bool IsGenerating => Process == "Generate" && Iterations > 0;
public bool IsDownloading => Process == "Download";
public readonly static IProgress<PipelineProgress> ConsoleCallback = new Progress<PipelineProgress>(Console.WriteLine);
}
}