mirror of
https://github.com/nomic-ai/gpt4all
synced 2024-11-02 09:40:42 +00:00
34 lines
834 B
C++
34 lines
834 B
C++
#ifndef GPTJ_H
|
|
#define GPTJ_H
|
|
|
|
#include <string>
|
|
#include <functional>
|
|
#include <vector>
|
|
#include "llmodel.h"
|
|
|
|
class GPTJPrivate;
|
|
class GPTJ : public LLModel {
|
|
public:
|
|
GPTJ();
|
|
~GPTJ();
|
|
|
|
bool loadModel(const std::string &modelPath) override;
|
|
bool loadModel(const std::string &modelPath, std::istream &fin) override;
|
|
bool isModelLoaded() const override;
|
|
void prompt(const std::string &prompt,
|
|
std::function<bool(int32_t, const std::string&)> response,
|
|
std::function<bool(bool)> recalculate,
|
|
PromptContext &ctx) override;
|
|
void setThreadCount(int32_t n_threads) override;
|
|
int32_t threadCount() override;
|
|
|
|
protected:
|
|
void recalculateContext(PromptContext &promptCtx,
|
|
std::function<bool(bool)> recalculate) override;
|
|
|
|
private:
|
|
GPTJPrivate *d_ptr;
|
|
};
|
|
|
|
#endif // GPTJ_H
|