-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
696b2e3
commit 17f2a70
Showing
3 changed files
with
349 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,90 @@ | ||
/************************************************ | ||
* Copyright MaybeShewill-CV. All Rights Reserved. | ||
* Author: MaybeShewill-CV | ||
* File: llama3_generator.h | ||
* File: Llama3Generator_generator.h | ||
* Date: 24-11-28 | ||
************************************************/ | ||
|
||
#ifndef MORTRED_MODEL_SERVER_LLAMA3_GENERATOR_H | ||
#define MORTRED_MODEL_SERVER_LLAMA3_GENERATOR_H | ||
|
||
class llama3_generator {}; | ||
#include <memory> | ||
|
||
#include "toml/toml.hpp" | ||
|
||
#include "models/base_model.h" | ||
#include "models/model_io_define.h" | ||
#include "models/llm/base_generator.h" | ||
#include "common/status_code.h" | ||
|
||
namespace jinq { | ||
namespace models { | ||
namespace llm { | ||
namespace llama { | ||
|
||
class Llama3Generator : public BaseLlmGenerator { | ||
public: | ||
/*** | ||
* constructor | ||
* @param config | ||
*/ | ||
Llama3Generator(); | ||
|
||
/*** | ||
* | ||
*/ | ||
~Llama3Generator() override; | ||
|
||
/*** | ||
* constructor | ||
* @param transformer | ||
*/ | ||
Llama3Generator(const Llama3Generator &transformer) = delete; | ||
|
||
/*** | ||
* constructor | ||
* @param transformer | ||
* @return | ||
*/ | ||
Llama3Generator &operator=(const Llama3Generator &transformer) = delete; | ||
|
||
/*** | ||
* | ||
* @param toml | ||
* @return | ||
*/ | ||
jinq::common::StatusCode init(const decltype(toml::parse("")) &cfg) override; | ||
|
||
/*** | ||
* | ||
* @param input | ||
* @param output | ||
* @return | ||
*/ | ||
jinq::common::StatusCode text_completion(const std::string& prompt, OUT std::string& generate_output) override; | ||
|
||
/*** | ||
* | ||
* @param dialog | ||
* @param generate_output | ||
* @return | ||
*/ | ||
jinq::common::StatusCode chat_completion(models::llm::chat_template::Dialog& dialog, OUT std::string& generate_output) override; | ||
|
||
/*** | ||
* if model successfully initialized | ||
* @return | ||
*/ | ||
bool is_successfully_initialized() const override; | ||
|
||
private: | ||
class Impl; | ||
std::unique_ptr<Impl> _m_pimpl; | ||
}; | ||
|
||
} | ||
} | ||
} | ||
} | ||
|
||
#endif // MORTRED_MODEL_SERVER_LLAMA3_GENERATOR_H |