Asset containing a tiny LLM model and tokenizer.
More...
#include <TinyLLMAsset.h>
|
| | DECLARE_ASSET (TinyLLMAsset, Asset) |
| |
| | TinyLLMAsset () |
| |
| virtual | ~TinyLLMAsset () |
| |
| virtual void | Create () override |
| |
| virtual void | Destroy () override |
| |
| virtual void | LoadStream (Stream &stream, Platform platform) override |
| |
| virtual void | SaveStream (Stream &stream, Platform platform) override |
| |
| virtual bool | Import (const std::string &path, ImportOptions *options) override |
| |
| virtual void | GatherProperties (std::vector< Property > &outProps) override |
| |
| virtual glm::vec4 | GetTypeColor () override |
| |
| virtual const char * | GetTypeName () override |
| |
| virtual const char * | GetTypeImportExt () override |
| |
| const TinyLLMConfig & | GetConfig () const |
| |
| float * | GetTokenEmbedding () const |
| |
| float * | GetRmsAttWeight () const |
| |
| float * | GetWq () const |
| |
| float * | GetWk () const |
| |
| float * | GetWv () const |
| |
| float * | GetWo () const |
| |
| float * | GetRmsFfnWeight () const |
| |
| float * | GetW1 () const |
| |
| float * | GetW2 () const |
| |
| float * | GetW3 () const |
| |
| float * | GetRmsFinalWeight () const |
| |
| float * | GetWcls () const |
| |
| void | SetTokenizer (TinyLLMTokenizerAsset *tokenizer) |
| |
| TinyLLMTokenizerAsset * | GetTokenizer () const |
| |
| void | Encode (const char *text, bool addBos, bool addEos, std::vector< int32_t > &outTokens) |
| |
| std::string | Decode (int prevToken, int token) |
| |
| size_t | GetWeightMemorySize () const |
| |
| size_t | GetKVCacheMemorySize (int32_t maxSeqLen) const |
| |
| | DECLARE_FACTORY_MANAGER (Asset) |
| |
| | DECLARE_FACTORY (Asset, Asset) |
| |
| | DECLARE_OBJECT (Asset, Object) |
| |
| | Asset () |
| |
| virtual | ~Asset () |
| |
| virtual void | Copy (Asset *srcAsset) |
| |
| const std::string & | GetName () const |
| |
| bool | IsLoaded () const |
| |
| bool | IsRefCounted () const |
| |
| int32_t | GetRefCount () const |
| |
| bool | IsEmbedded () const |
| |
| void | SetEmbedded (bool embed) |
| |
| bool | IsEngineAsset () const |
| |
| void | SetEngineAsset (bool engineAsset) |
| |
| void | SetName (const std::string &name) |
| |
| void | IncrementRefCount () |
| |
| void | DecrementRefCount () |
| |
| void | LoadFile (const char *path, AsyncLoadRequest *request=nullptr) |
| |
| void | LoadEmbedded (const EmbeddedFile *embeddedAsset, AsyncLoadRequest *request=nullptr) |
| |
| void | SaveFile (const char *path, Platform platform) |
| |
| virtual bool | ShouldSnapshotForPie () const |
| |
| bool | IsTransient () const |
| |
| void | SetTransient (bool transient) |
| |
| uint64_t | GetUuid () const |
| |
| void | SetUuid (uint64_t uuid) |
| |
| void | EnsureUuid () |
| |
| void | WriteHeader (Stream &stream) |
| |
| virtual | ~Object ()=default |
| |
| virtual const char * | RuntimeName () const =0 |
| |
| virtual const char * | RuntimeParentName () const =0 |
| |
| virtual RuntimeId | InstanceRuntimeId () const =0 |
| |
| virtual Object * | QueryInterface (RuntimeId id) const |
| |
| virtual bool | Is (RuntimeId id) const |
| |
| virtual bool | Is (const char *name) const |
| |
| virtual bool | DrawCustomProperty (Property &prop) |
| |
| template<typename T > |
| T * | As () const |
| |
| virtual bool | Equals (const Object *rhs) const |
| |
Asset containing a tiny LLM model and tokenizer.
◆ TinyLLMAsset()
| TinyLLMAsset::TinyLLMAsset |
( |
| ) |
|
◆ ~TinyLLMAsset()
| TinyLLMAsset::~TinyLLMAsset |
( |
| ) |
|
|
virtual |
◆ Create()
| void TinyLLMAsset::Create |
( |
| ) |
|
|
overridevirtual |
Reimplemented from Asset.
◆ DECLARE_ASSET()
◆ Decode()
| std::string TinyLLMAsset::Decode |
( |
int |
prevToken, |
|
|
int |
token |
|
) |
| |
◆ Destroy()
| void TinyLLMAsset::Destroy |
( |
| ) |
|
|
overridevirtual |
Reimplemented from Asset.
◆ Encode()
| void TinyLLMAsset::Encode |
( |
const char * |
text, |
|
|
bool |
addBos, |
|
|
bool |
addEos, |
|
|
std::vector< int32_t > & |
outTokens |
|
) |
| |
◆ GatherProperties()
| void TinyLLMAsset::GatherProperties |
( |
std::vector< Property > & |
outProps | ) |
|
|
overridevirtual |
Reimplemented from Asset.
◆ GetConfig()
◆ GetKVCacheMemorySize()
| size_t TinyLLMAsset::GetKVCacheMemorySize |
( |
int32_t |
maxSeqLen | ) |
const |
◆ GetRmsAttWeight()
| float * TinyLLMAsset::GetRmsAttWeight |
( |
| ) |
const |
|
inline |
◆ GetRmsFfnWeight()
| float * TinyLLMAsset::GetRmsFfnWeight |
( |
| ) |
const |
|
inline |
◆ GetRmsFinalWeight()
| float * TinyLLMAsset::GetRmsFinalWeight |
( |
| ) |
const |
|
inline |
◆ GetTokenEmbedding()
| float * TinyLLMAsset::GetTokenEmbedding |
( |
| ) |
const |
|
inline |
◆ GetTokenizer()
◆ GetTypeColor()
| glm::vec4 TinyLLMAsset::GetTypeColor |
( |
| ) |
|
|
overridevirtual |
Reimplemented from Asset.
◆ GetTypeImportExt()
| const char * TinyLLMAsset::GetTypeImportExt |
( |
| ) |
|
|
overridevirtual |
Reimplemented from Asset.
◆ GetTypeName()
| const char * TinyLLMAsset::GetTypeName |
( |
| ) |
|
|
overridevirtual |
Reimplemented from Asset.
◆ GetW1()
| float * TinyLLMAsset::GetW1 |
( |
| ) |
const |
|
inline |
◆ GetW2()
| float * TinyLLMAsset::GetW2 |
( |
| ) |
const |
|
inline |
◆ GetW3()
| float * TinyLLMAsset::GetW3 |
( |
| ) |
const |
|
inline |
◆ GetWcls()
| float * TinyLLMAsset::GetWcls |
( |
| ) |
const |
|
inline |
◆ GetWeightMemorySize()
| size_t TinyLLMAsset::GetWeightMemorySize |
( |
| ) |
const |
◆ GetWk()
| float * TinyLLMAsset::GetWk |
( |
| ) |
const |
|
inline |
◆ GetWo()
| float * TinyLLMAsset::GetWo |
( |
| ) |
const |
|
inline |
◆ GetWq()
| float * TinyLLMAsset::GetWq |
( |
| ) |
const |
|
inline |
◆ GetWv()
| float * TinyLLMAsset::GetWv |
( |
| ) |
const |
|
inline |
◆ HandlePropChange()
| bool TinyLLMAsset::HandlePropChange |
( |
Datum * |
datum, |
|
|
uint32_t |
index, |
|
|
const void * |
newValue |
|
) |
| |
|
staticprotected |
◆ Import()
| bool TinyLLMAsset::Import |
( |
const std::string & |
path, |
|
|
ImportOptions * |
options |
|
) |
| |
|
overridevirtual |
Reimplemented from Asset.
◆ LoadStream()
Reimplemented from Asset.
◆ SaveStream()
Reimplemented from Asset.
◆ SetTokenizer()
◆ SetupWeightPointers()
| void TinyLLMAsset::SetupWeightPointers |
( |
| ) |
|
|
protected |
◆ mConfig
◆ mRmsAttWeight
| float* TinyLLMAsset::mRmsAttWeight = nullptr |
|
protected |
◆ mRmsFfnWeight
| float* TinyLLMAsset::mRmsFfnWeight = nullptr |
|
protected |
◆ mRmsFinalWeight
| float* TinyLLMAsset::mRmsFinalWeight = nullptr |
|
protected |
◆ mTokenEmbedding
| float* TinyLLMAsset::mTokenEmbedding = nullptr |
|
protected |
◆ mTokenizer
◆ mW1
| float* TinyLLMAsset::mW1 = nullptr |
|
protected |
◆ mW2
| float* TinyLLMAsset::mW2 = nullptr |
|
protected |
◆ mW3
| float* TinyLLMAsset::mW3 = nullptr |
|
protected |
◆ mWcls
| float* TinyLLMAsset::mWcls = nullptr |
|
protected |
◆ mWeightData
| std::vector<float> TinyLLMAsset::mWeightData |
|
protected |
◆ mWk
| float* TinyLLMAsset::mWk = nullptr |
|
protected |
◆ mWo
| float* TinyLLMAsset::mWo = nullptr |
|
protected |
◆ mWq
| float* TinyLLMAsset::mWq = nullptr |
|
protected |
◆ mWv
| float* TinyLLMAsset::mWv = nullptr |
|
protected |
The documentation for this class was generated from the following files: