checkpoints.d.ts 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. import { APIResource } from "../../../resource.js";
  2. import * as Core from "../../../core.js";
  3. import { CursorPage, type CursorPageParams } from "../../../pagination.js";
  4. export declare class Checkpoints extends APIResource {
  5. /**
  6. * List checkpoints for a fine-tuning job.
  7. *
  8. * @example
  9. * ```ts
  10. * // Automatically fetches more pages as needed.
  11. * for await (const fineTuningJobCheckpoint of client.fineTuning.jobs.checkpoints.list(
  12. * 'ft-AF1WoRqd3aJAHsqc9NY7iL8F',
  13. * )) {
  14. * // ...
  15. * }
  16. * ```
  17. */
  18. list(fineTuningJobId: string, query?: CheckpointListParams, options?: Core.RequestOptions): Core.PagePromise<FineTuningJobCheckpointsPage, FineTuningJobCheckpoint>;
  19. list(fineTuningJobId: string, options?: Core.RequestOptions): Core.PagePromise<FineTuningJobCheckpointsPage, FineTuningJobCheckpoint>;
  20. }
  21. export declare class FineTuningJobCheckpointsPage extends CursorPage<FineTuningJobCheckpoint> {
  22. }
  23. /**
  24. * The `fine_tuning.job.checkpoint` object represents a model checkpoint for a
  25. * fine-tuning job that is ready to use.
  26. */
  27. export interface FineTuningJobCheckpoint {
  28. /**
  29. * The checkpoint identifier, which can be referenced in the API endpoints.
  30. */
  31. id: string;
  32. /**
  33. * The Unix timestamp (in seconds) for when the checkpoint was created.
  34. */
  35. created_at: number;
  36. /**
  37. * The name of the fine-tuned checkpoint model that is created.
  38. */
  39. fine_tuned_model_checkpoint: string;
  40. /**
  41. * The name of the fine-tuning job that this checkpoint was created from.
  42. */
  43. fine_tuning_job_id: string;
  44. /**
  45. * Metrics at the step number during the fine-tuning job.
  46. */
  47. metrics: FineTuningJobCheckpoint.Metrics;
  48. /**
  49. * The object type, which is always "fine_tuning.job.checkpoint".
  50. */
  51. object: 'fine_tuning.job.checkpoint';
  52. /**
  53. * The step number that the checkpoint was created at.
  54. */
  55. step_number: number;
  56. }
  57. export declare namespace FineTuningJobCheckpoint {
  58. /**
  59. * Metrics at the step number during the fine-tuning job.
  60. */
  61. interface Metrics {
  62. full_valid_loss?: number;
  63. full_valid_mean_token_accuracy?: number;
  64. step?: number;
  65. train_loss?: number;
  66. train_mean_token_accuracy?: number;
  67. valid_loss?: number;
  68. valid_mean_token_accuracy?: number;
  69. }
  70. }
  71. export interface CheckpointListParams extends CursorPageParams {
  72. }
  73. export declare namespace Checkpoints {
  74. export { type FineTuningJobCheckpoint as FineTuningJobCheckpoint, FineTuningJobCheckpointsPage as FineTuningJobCheckpointsPage, type CheckpointListParams as CheckpointListParams, };
  75. }
  76. //# sourceMappingURL=checkpoints.d.ts.map