voice_audio_multi/include/engine/framework/runtime/artifacts.h
Fabio c36510c21e
Some checks failed
Linux Build / Linux cpu (push) Has been cancelled
Linux Build / Linux cpu-clang (push) Has been cancelled
Linux Build / Linux vulkan (push) Has been cancelled
mac-build / macOS CPU (push) Has been cancelled
Nix Build / Nix (cpu) (push) Has been cancelled
Nix Build / Nix (vulkan) (push) Has been cancelled
windows-build / Windows CPU (push) Has been cancelled
Initial import: audio.cpp with Orange Pi documentation
2026-11-04 19:05:22 +01:00

39 lines
913 B
C++

#pragma once
#include <cstddef>
#include <cstdint>
#include <optional>
#include <string>
#include <unordered_map>
#include <variant>
#include <vector>
namespace engine::runtime {
enum class StoredArtifactKind {
TokenIds,
FloatTensor,
Bytes,
Text,
};
struct StoredArtifact {
StoredArtifactKind kind = StoredArtifactKind::Bytes;
std::vector<int64_t> shape;
std::variant<std::vector<int32_t>, std::vector<float>, std::vector<std::byte>, std::string> payload;
};
class ArtifactStore {
public:
bool contains(const std::string & key) const;
void put(std::string key, StoredArtifact artifact);
StoredArtifact * find(const std::string & key);
const StoredArtifact * find(const std::string & key) const;
void erase(const std::string & key);
void clear();
private:
std::unordered_map<std::string, StoredArtifact> artifacts_;
};
} // namespace engine::runtime