mirror of
https://github.com/Palm1r/QodeAssist.git
synced 2025-06-03 09:08:21 -04:00
Add Qwen fim template
This commit is contained in:
parent
40a568ebd9
commit
496d8feb66
@ -41,7 +41,7 @@ add_qtc_plugin(QodeAssist
|
|||||||
templates/CustomFimTemplate.hpp
|
templates/CustomFimTemplate.hpp
|
||||||
templates/DeepSeekCoderChat.hpp
|
templates/DeepSeekCoderChat.hpp
|
||||||
templates/CodeLlamaChat.hpp
|
templates/CodeLlamaChat.hpp
|
||||||
templates/QwenChat.hpp
|
templates/Qwen.hpp
|
||||||
templates/StarCoderChat.hpp
|
templates/StarCoderChat.hpp
|
||||||
providers/OllamaProvider.hpp providers/OllamaProvider.cpp
|
providers/OllamaProvider.hpp providers/OllamaProvider.cpp
|
||||||
providers/LMStudioProvider.hpp providers/LMStudioProvider.cpp
|
providers/LMStudioProvider.hpp providers/LMStudioProvider.cpp
|
||||||
|
@ -53,7 +53,7 @@
|
|||||||
#include "templates/CustomFimTemplate.hpp"
|
#include "templates/CustomFimTemplate.hpp"
|
||||||
#include "templates/DeepSeekCoderChat.hpp"
|
#include "templates/DeepSeekCoderChat.hpp"
|
||||||
#include "templates/DeepSeekCoderFim.hpp"
|
#include "templates/DeepSeekCoderFim.hpp"
|
||||||
#include "templates/QwenChat.hpp"
|
#include "templates/Qwen.hpp"
|
||||||
#include "templates/StarCoder2Fim.hpp"
|
#include "templates/StarCoder2Fim.hpp"
|
||||||
#include "templates/StarCoderChat.hpp"
|
#include "templates/StarCoderChat.hpp"
|
||||||
|
|
||||||
@ -94,9 +94,10 @@ public:
|
|||||||
templateManager.registerTemplate<Templates::CustomTemplate>();
|
templateManager.registerTemplate<Templates::CustomTemplate>();
|
||||||
templateManager.registerTemplate<Templates::DeepSeekCoderChat>();
|
templateManager.registerTemplate<Templates::DeepSeekCoderChat>();
|
||||||
templateManager.registerTemplate<Templates::CodeLlamaChat>();
|
templateManager.registerTemplate<Templates::CodeLlamaChat>();
|
||||||
templateManager.registerTemplate<Templates::QwenChat>();
|
|
||||||
templateManager.registerTemplate<Templates::LlamaChat>();
|
templateManager.registerTemplate<Templates::LlamaChat>();
|
||||||
templateManager.registerTemplate<Templates::StarCoderChat>();
|
templateManager.registerTemplate<Templates::StarCoderChat>();
|
||||||
|
templateManager.registerTemplate<Templates::QwenChat>();
|
||||||
|
templateManager.registerTemplate<Templates::QwenFim>();
|
||||||
|
|
||||||
Utils::Icon QCODEASSIST_ICON(
|
Utils::Icon QCODEASSIST_ICON(
|
||||||
{{":/resources/images/qoderassist-icon.png", Utils::Theme::IconsBaseColor}});
|
{{":/resources/images/qoderassist-icon.png", Utils::Theme::IconsBaseColor}});
|
||||||
|
@ -51,4 +51,21 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class QwenFim : public LLMCore::PromptTemplate
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
QString name() const override { return "Qwen FIM"; }
|
||||||
|
LLMCore::TemplateType type() const override { return LLMCore::TemplateType::Fim; }
|
||||||
|
QString promptTemplate() const override
|
||||||
|
{
|
||||||
|
return "<|fim_prefix|>%1<|fim_suffix|>%2<|fim_middle|>";
|
||||||
|
}
|
||||||
|
QStringList stopWords() const override { return QStringList() << "<|endoftext|>" << "<|EOT|>"; }
|
||||||
|
void prepareRequest(QJsonObject &request, const LLMCore::ContextData &context) const override
|
||||||
|
{
|
||||||
|
QString formattedPrompt = promptTemplate().arg(context.prefix, context.suffix);
|
||||||
|
request["prompt"] = formattedPrompt;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
} // namespace QodeAssist::Templates
|
} // namespace QodeAssist::Templates
|
Loading…
x
Reference in New Issue
Block a user