52 lines
1.7 KiB
C++
52 lines
1.7 KiB
C++
#pragma once
|
|
|
|
// Fine-tuning: jobs (create, retrieve, list, cancel, pause, resume, events,
|
|
// checkpoints), checkpoint permissions, and the alpha graders.
|
|
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
#include "openai/platform/service.h"
|
|
|
|
namespace molo::openai::platform {
|
|
|
|
class FineTuningJobsApi : public PlatformService {
|
|
public:
|
|
using PlatformService::PlatformService;
|
|
|
|
// Paid. body: model, training_file (required), validation_file, suffix,
|
|
// seed, method, hyperparameters, integrations, metadata (spec fields).
|
|
Json create(const Json& body);
|
|
Json retrieve(const std::string& job_id);
|
|
Json list(const Json& query = Json::object()); // after, limit, metadata
|
|
Json events(const std::string& job_id, const Json& query = Json::object());
|
|
Json checkpoints(const std::string& job_id, const Json& query = Json::object());
|
|
// Destructive: cancels a running job.
|
|
Json cancel(const std::string& job_id);
|
|
Json pause(const std::string& job_id);
|
|
Json resume(const std::string& job_id);
|
|
};
|
|
|
|
class FineTuningPermissionsApi : public PlatformService {
|
|
public:
|
|
using PlatformService::PlatformService;
|
|
|
|
// Gives other projects access to a fine-tuned checkpoint.
|
|
Json create(const std::string& checkpoint, const std::vector<std::string>& project_ids);
|
|
Json list(const std::string& checkpoint, const Json& query = Json::object());
|
|
// Destructive: revokes the permission.
|
|
Json remove(const std::string& checkpoint, const std::string& permission_id);
|
|
};
|
|
|
|
class GradersApi : public PlatformService {
|
|
public:
|
|
using PlatformService::PlatformService;
|
|
|
|
// Alpha. Paid for model graders. run body: grader, model_sample (required),
|
|
// item; validate body: grader.
|
|
Json run(const Json& body);
|
|
Json validate(const Json& body);
|
|
};
|
|
|
|
} // namespace molo::openai::platform
|