mirror of
https://github.com/nomic-ai/gpt4all
synced 2024-11-18 03:25:46 +00:00
llmodel: constify LLModel::threadCount()
This commit is contained in:
parent
efd39b0d73
commit
81fdc28e58
@ -867,7 +867,8 @@ void GPTJ::setThreadCount(int32_t n_threads) {
|
|||||||
d_ptr->n_threads = n_threads;
|
d_ptr->n_threads = n_threads;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t GPTJ::threadCount() {
|
int32_t GPTJ::threadCount() const
|
||||||
|
{
|
||||||
return d_ptr->n_threads;
|
return d_ptr->n_threads;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ public:
|
|||||||
std::function<bool(bool)> recalculateCallback,
|
std::function<bool(bool)> recalculateCallback,
|
||||||
PromptContext &ctx) override;
|
PromptContext &ctx) override;
|
||||||
void setThreadCount(int32_t n_threads) override;
|
void setThreadCount(int32_t n_threads) override;
|
||||||
int32_t threadCount() override;
|
int32_t threadCount() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void recalculateContext(PromptContext &promptCtx,
|
void recalculateContext(PromptContext &promptCtx,
|
||||||
|
@ -75,7 +75,8 @@ void LLamaModel::setThreadCount(int32_t n_threads) {
|
|||||||
d_ptr->n_threads = n_threads;
|
d_ptr->n_threads = n_threads;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t LLamaModel::threadCount() {
|
int32_t LLamaModel::threadCount() const
|
||||||
|
{
|
||||||
return d_ptr->n_threads;
|
return d_ptr->n_threads;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ public:
|
|||||||
std::function<bool(bool)> recalculateCallback,
|
std::function<bool(bool)> recalculateCallback,
|
||||||
PromptContext &ctx) override;
|
PromptContext &ctx) override;
|
||||||
void setThreadCount(int32_t n_threads) override;
|
void setThreadCount(int32_t n_threads) override;
|
||||||
int32_t threadCount() override;
|
int32_t threadCount() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void recalculateContext(PromptContext &promptCtx,
|
void recalculateContext(PromptContext &promptCtx,
|
||||||
|
@ -37,7 +37,7 @@ public:
|
|||||||
std::function<bool(bool)> recalculateCallback,
|
std::function<bool(bool)> recalculateCallback,
|
||||||
PromptContext &ctx) = 0;
|
PromptContext &ctx) = 0;
|
||||||
virtual void setThreadCount(int32_t n_threads) {}
|
virtual void setThreadCount(int32_t n_threads) {}
|
||||||
virtual int32_t threadCount() { return 1; }
|
virtual int32_t threadCount() const { return 1; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void recalculateContext(PromptContext &promptCtx,
|
virtual void recalculateContext(PromptContext &promptCtx,
|
||||||
|
@ -792,7 +792,8 @@ void MPT::setThreadCount(int32_t n_threads) {
|
|||||||
d_ptr->n_threads = n_threads;
|
d_ptr->n_threads = n_threads;
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t MPT::threadCount() {
|
int32_t MPT::threadCount() const
|
||||||
|
{
|
||||||
return d_ptr->n_threads;
|
return d_ptr->n_threads;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ public:
|
|||||||
std::function<bool(bool)> recalculateCallback,
|
std::function<bool(bool)> recalculateCallback,
|
||||||
PromptContext &ctx) override;
|
PromptContext &ctx) override;
|
||||||
void setThreadCount(int32_t n_threads) override;
|
void setThreadCount(int32_t n_threads) override;
|
||||||
int32_t threadCount() override;
|
int32_t threadCount() const override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void recalculateContext(PromptContext &promptCtx,
|
void recalculateContext(PromptContext &promptCtx,
|
||||||
|
@ -32,7 +32,7 @@ void ChatGPT::setThreadCount(int32_t n_threads)
|
|||||||
qt_noop();
|
qt_noop();
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t ChatGPT::threadCount()
|
int32_t ChatGPT::threadCount() const
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -25,7 +25,7 @@ public:
|
|||||||
std::function<bool(bool)> recalculateCallback,
|
std::function<bool(bool)> recalculateCallback,
|
||||||
PromptContext &ctx) override;
|
PromptContext &ctx) override;
|
||||||
void setThreadCount(int32_t n_threads) override;
|
void setThreadCount(int32_t n_threads) override;
|
||||||
int32_t threadCount() override;
|
int32_t threadCount() const override;
|
||||||
|
|
||||||
void setModelName(const QString &modelName) { m_modelName = modelName; }
|
void setModelName(const QString &modelName) { m_modelName = modelName; }
|
||||||
void setAPIKey(const QString &apiKey) { m_apiKey = apiKey; }
|
void setAPIKey(const QString &apiKey) { m_apiKey = apiKey; }
|
||||||
|
Loading…
Reference in New Issue
Block a user