Make localdocs work with server mode.

This commit is contained in:
Adam Treat
2023-06-01 14:13:12 -04:00
committed by AT
parent 8e89ceb54b
commit f62e439a2d
9 changed files with 90 additions and 90 deletions

View File

@@ -60,6 +60,8 @@ public:
Q_INVOKABLE void stopGenerating();
Q_INVOKABLE void newPromptResponsePair(const QString &prompt);
QList<ResultInfo> results() const;
QString response() const;
bool responseInProgress() const { return m_responseInProgress; }
QString responseState() const;
@@ -115,7 +117,6 @@ Q_SIGNALS:
void collectionListChanged();
private Q_SLOTS:
void handleLocalDocsRetrieved(const QString &uid, const QList<ResultInfo> &results);
void handleResponseChanged();
void handleModelLoadedChanged();
void promptProcessing();
@@ -125,24 +126,11 @@ private Q_SLOTS:
void handleModelNameChanged();
private:
struct Prompt {
QString prompt;
QString prompt_template;
int32_t n_predict;
int32_t top_k;
float top_p;
float temp;
int32_t n_batch;
float repeat_penalty;
int32_t repeat_penalty_tokens;
};
QString m_id;
QString m_name;
QString m_userName;
QString m_savedModelName;
QList<QString> m_collections;
QList<ResultInfo> m_results;
ChatModel *m_chatModel;
bool m_responseInProgress;
ResponseState m_responseState;
@@ -150,7 +138,6 @@ private:
ChatLLM *m_llmodel;
bool m_isServer;
bool m_shouldDeleteLater;
Prompt m_queuedPrompt;
};
#endif // CHAT_H