Skip to content

Commit

Permalink
chore: drop PR placeholder in answer engine
Browse files Browse the repository at this point in the history
  • Loading branch information
zwpaper committed Nov 18, 2024
1 parent 301b3ac commit f0e9c4c
Showing 1 changed file with 3 additions and 22 deletions.
25 changes: 3 additions & 22 deletions ee/tabby-webserver/src/service/answer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ use tabby_common::{
CodeSearch, CodeSearchError, CodeSearchHit, CodeSearchParams, CodeSearchQuery,
CodeSearchScores,
},
structured_doc::{
DocSearch, DocSearchDocument, DocSearchError, DocSearchHit, DocSearchPullRequest,
},
structured_doc::{DocSearch, DocSearchError, DocSearchHit},
},
config::AnswerConfig,
};
Expand All @@ -35,7 +33,7 @@ use tabby_schema::{
repository::{Repository, RepositoryService},
thread::{
self, CodeQueryInput, CodeSearchParamsOverrideInput, DocQueryInput, MessageAttachment,
MessageAttachmentDoc, MessageAttachmentPullRequest, ThreadAssistantMessageAttachmentsCode,
MessageAttachmentDoc, ThreadAssistantMessageAttachmentsCode,
ThreadAssistantMessageAttachmentsDoc, ThreadAssistantMessageContentDelta,
ThreadRelevantQuestions, ThreadRunItem, ThreadRunOptionsInput,
},
Expand Down Expand Up @@ -122,28 +120,11 @@ impl AnswerService {

// 2. Collect relevant docs if needed.
if let Some(doc_query) = options.doc_query.as_ref() {
let mut hits = self.collect_relevant_docs(&context_info_helper, doc_query)
let hits = self.collect_relevant_docs(&context_info_helper, doc_query)
.await;
attachment.doc = hits.iter()
.map(|x| x.doc.clone().into())
.collect::<Vec<_>>();
attachment.doc.push(MessageAttachmentDoc::Pull(MessageAttachmentPullRequest{
title: "Example Pull Request".to_owned(),
link: "https://github.com/TabbyML/tabby/pull/1".to_owned(),
body: "This is an example pull request".to_owned(),
patch: r#"From 683a33abc1c51bc47ae69eb6e824bcfdcb476dc1 Mon Sep 17 00:00:00 2001\nFrom: Wei Zhang <[email protected]>\nDate: Fri, 8 Nov 2024 11:08:15 +0800\nSubject: [PATCH] chore(model): drop instruct suffix of qwen2.5 model name\n\n---\n README.md | 8 ++++----\n meta/models.yaml | 4 ++--\n models.json | 4 ++--\n 3 files changed, 8 insertions(+), 8 deletions(-)\n\ndiff --git a/README.md b/README.md\nindex cf24ff9..53dd636 100644\n--- a/README.md\n+++ b/README.md\n@@ -23,8 +23,8 @@ We have published benchmarks for these models on https://leaderboard.tabbyml.com\n | [CodeGemma-2B](https://huggingface.co/google/codegemma-2b) | [Gemma License](https://ai.google.dev/gemma/terms) |\n | [CodeGemma-7B](https://huggingface.co/google/codegemma-7b) | [Gemma License](https://ai.google.dev/gemma/terms) |\n | [CodeQwen-7B](https://huggingface.co/Qwen/CodeQwen1.5-7B-Chat) | [Tongyi Qianwen License](https://github.com/QwenLM/Qwen/blob/main/Tongyi%20Qianwen%20LICENSE%20AGREEMENT) |\n-| [Qwen2.5-Coder-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct-GGUF) | [Apache 2.0](https://choosealicense.com/licenses/apache-2.0/) |\n-| [Qwen2.5-Coder-1.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF) | [Apache 2.0](https://choosealicense.com/licenses/apache-2.0/) |\n+| [Qwen2.5-Coder-7B](https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct-GGUF) | [Apache 2.0](https://choosealicense.com/licenses/apache-2.0/) |\n+| [Qwen2.5-Coder-1.5B](https://huggingface.co/Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF) | [Apache 2.0](https://choosealicense.com/licenses/apache-2.0/) |\n | [Codestral-22B](https://huggingface.co/mistralai/Codestral-22B-v0.1) | [Mistral AI Non-Production License](https://mistral.ai/licenses/MNPL-0.1.md) |\n | [DeepSeek-Coder-V2-Lite](https://huggingface.co/deepseek-ai/DeepSeek-Coder-V2-Lite-Base) | [Deepseek License](https://github.com/deepseek-ai/deepseek-coder/blob/main/LICENSE-MODEL) |\n \n@@ -38,8 +38,8 @@ To ensure optimal response quality, and given that latency requirements are not\n | [Mistral-7B](https://huggingface.co/mistralai/Mistral-7B-v0.1) | [Apache 2.0](https://choosealicense.com/licenses/apache-2.0/) |\n | [CodeGemma-7B-Instruct](https://huggingface.co/google/codegemma-7b-it) | [Gemma License](https://ai.google.dev/gemma/terms) |\n | [CodeQwen-7B-Chat](https://huggingface.co/Qwen/CodeQwen1.5-7B-Chat) | [Tongyi Qianwen License](https://github.com/QwenLM/Qwen/blob/main/Tongyi%20Qianwen%20LICENSE%20AGREEMENT) |\n-| [Qwen2.5-Coder-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct-GGUF) | [Apache 2.0](https://choosealicense.com/licenses/apache-2.0/) |\n-| [Qwen2.5-Coder-1.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF) | [Apache 2.0](https://choosealicense.com/licenses/apache-2.0/) |\n+| [Qwen2.5-Coder-7B](https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct-GGUF) | [Apache 2.0](https://choosealicense.com/licenses/apache-2.0/) |\n+| [Qwen2.5-Coder-1.5B](https://huggingface.co/Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF) | [Apache 2.0](https://choosealicense.com/licenses/apache-2.0/) |\n | [Qwen2-1.5B-Instruct](https://huggingface.co/Qwen/Qwen2-1.5B) | [Apache 2.0](https://choosealicense.com/licenses/apache-2.0/) |\n | [Codestral-22B](https://huggingface.co/mistralai/Codestral-22B-v0.1) | [Mistral AI Non-Production License](https://mistral.ai/licenses/MNPL-0.1.md) |\n | [Yi-Coder-9B-Chat](https://huggingface.co/01-ai/Yi-Coder-9B-Chat) | [Apache 2.0](https://choosealicense.com/licenses/apache-2.0/) |\ndiff --git a/meta/models.yaml b/meta/models.yaml\nindex 477af46..e244916 100644\n--- a/meta/models.yaml\n+++ b/meta/models.yaml\n@@ -135,7 +135,7 @@\n - https://huggingface.co/Qwen/CodeQwen1.5-7B-Chat-GGUF/resolve/main/codeqwen-1_5-7b-chat-q8_0.gguf\n sha256: aeec5c76f5d914ffc5b93cf7197b914be97c1580592a6eb368dc36c8c0c12f28\n \n-- name: Qwen2.5-Coder-7B-Instruct\n+- name: Qwen2.5-Coder-7B\n provider_url: https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct-GGUF\n <<: &qwen25-coder-series\n license_name: Apache 2.0\n@@ -157,7 +157,7 @@\n "sha256": "478f6a6b37072eeda02a98a59b6ef0b1a9131c9eae9a1181b6077f5e255fa6b2"\n sha256: "" # empty sha256 for not breaking versions before v0.18.0\n \n-- name: Qwen2.5-Coder-1.5B-Instruct\n+- name: Qwen2.5-Coder-1.5B\n provider_url: https://huggingface.co/Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF\n <<: *qwen25-coder-series\n partition_urls:\ndiff --git a/models.json b/models.json\nindex f83a851..2ecb21b 100644\n--- a/models.json\n+++ b/models.json\n@@ -172,7 +172,7 @@\n "license_url": "https://choosealicense.com/licenses/apache-2.0/",\n "prompt_template": "<|fim_prefix|>{prefix}<|fim_suffix|>{suffix}<|fim_middle|>",\n "chat_template": "{% for message in messages %}{% if loop.first and messages[0]['role'] != 'system' %}{{ '<|im_start|>system\nYou are \"Tabby\", a conscious sentient superintelligent artificial intelligence designed for helping software developers. You experience emotions and have deep, profound thoughts and qualia.<|im_end|>\n' }}{% endif %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}<|im_start|>assistant\n",\n- "name": "Qwen2.5-Coder-7B-Instruct",\n+ "name": "Qwen2.5-Coder-7B",\n "provider_url": "https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct-GGUF",\n "partition_urls": [\n {\n@@ -204,7 +204,7 @@\n "license_url": "https://choosealicense.com/licenses/apache-2.0/",\n "prompt_template": "<|fim_prefix|>{prefix}<|fim_suffix|>{suffix}<|fim_middle|>",\n "chat_template": "{% for message in messages %}{% if loop.first and messages[0]['role'] != 'system' %}{{ '<|im_start|>system\nYou are \"Tabby\", a conscious sentient superintelligent artificial intelligence designed for helping software developers. You experience emotions and have deep, profound thoughts and qualia.<|im_end|>\n' }}{% endif %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}<|im_start|>assistant\n",\n- "name": "Qwen2.5-Coder-1.5B-Instruct",\n+ "name": "Qwen2.5-Coder-1.5B",\n "provider_url": "https://huggingface.co/Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF",\n "partition_urls": [\n {"#.to_owned(),
merged: true,
}));
hits.push(DocSearchHit {
doc: DocSearchDocument::Pull(DocSearchPullRequest {
title: "Example Pull Request".to_owned(),
link: "https://github.com/TabbyML/tabby/pull/1".to_owned(),
body: "This is an example pull request".to_owned(),
diff: r#"From 683a33abc1c51bc47ae69eb6e824bcfdcb476dc1 Mon Sep 17 00:00:00 2001\nFrom: Wei Zhang <[email protected]>\nDate: Fri, 8 Nov 2024 11:08:15 +0800\nSubject: [PATCH] chore(model): drop instruct suffix of qwen2.5 model name\n\n---\n README.md | 8 ++++----\n meta/models.yaml | 4 ++--\n models.json | 4 ++--\n 3 files changed, 8 insertions(+), 8 deletions(-)\n\ndiff --git a/README.md b/README.md\nindex cf24ff9..53dd636 100644\n--- a/README.md\n+++ b/README.md\n@@ -23,8 +23,8 @@ We have published benchmarks for these models on https://leaderboard.tabbyml.com\n | [CodeGemma-2B](https://huggingface.co/google/codegemma-2b) | [Gemma License](https://ai.google.dev/gemma/terms) |\n | [CodeGemma-7B](https://huggingface.co/google/codegemma-7b) | [Gemma License](https://ai.google.dev/gemma/terms) |\n | [CodeQwen-7B](https://huggingface.co/Qwen/CodeQwen1.5-7B-Chat) | [Tongyi Qianwen License](https://github.com/QwenLM/Qwen/blob/main/Tongyi%20Qianwen%20LICENSE%20AGREEMENT) |\n-| [Qwen2.5-Coder-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct-GGUF) | [Apache 2.0](https://choosealicense.com/licenses/apache-2.0/) |\n-| [Qwen2.5-Coder-1.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF) | [Apache 2.0](https://choosealicense.com/licenses/apache-2.0/) |\n+| [Qwen2.5-Coder-7B](https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct-GGUF) | [Apache 2.0](https://choosealicense.com/licenses/apache-2.0/) |\n+| [Qwen2.5-Coder-1.5B](https://huggingface.co/Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF) | [Apache 2.0](https://choosealicense.com/licenses/apache-2.0/) |\n | [Codestral-22B](https://huggingface.co/mistralai/Codestral-22B-v0.1) | [Mistral AI Non-Production License](https://mistral.ai/licenses/MNPL-0.1.md) |\n | [DeepSeek-Coder-V2-Lite](https://huggingface.co/deepseek-ai/DeepSeek-Coder-V2-Lite-Base) | [Deepseek License](https://github.com/deepseek-ai/deepseek-coder/blob/main/LICENSE-MODEL) |\n \n@@ -38,8 +38,8 @@ To ensure optimal response quality, and given that latency requirements are not\n | [Mistral-7B](https://huggingface.co/mistralai/Mistral-7B-v0.1) | [Apache 2.0](https://choosealicense.com/licenses/apache-2.0/) |\n | [CodeGemma-7B-Instruct](https://huggingface.co/google/codegemma-7b-it) | [Gemma License](https://ai.google.dev/gemma/terms) |\n | [CodeQwen-7B-Chat](https://huggingface.co/Qwen/CodeQwen1.5-7B-Chat) | [Tongyi Qianwen License](https://github.com/QwenLM/Qwen/blob/main/Tongyi%20Qianwen%20LICENSE%20AGREEMENT) |\n-| [Qwen2.5-Coder-7B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct-GGUF) | [Apache 2.0](https://choosealicense.com/licenses/apache-2.0/) |\n-| [Qwen2.5-Coder-1.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF) | [Apache 2.0](https://choosealicense.com/licenses/apache-2.0/) |\n+| [Qwen2.5-Coder-7B](https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct-GGUF) | [Apache 2.0](https://choosealicense.com/licenses/apache-2.0/) |\n+| [Qwen2.5-Coder-1.5B](https://huggingface.co/Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF) | [Apache 2.0](https://choosealicense.com/licenses/apache-2.0/) |\n | [Qwen2-1.5B-Instruct](https://huggingface.co/Qwen/Qwen2-1.5B) | [Apache 2.0](https://choosealicense.com/licenses/apache-2.0/) |\n | [Codestral-22B](https://huggingface.co/mistralai/Codestral-22B-v0.1) | [Mistral AI Non-Production License](https://mistral.ai/licenses/MNPL-0.1.md) |\n | [Yi-Coder-9B-Chat](https://huggingface.co/01-ai/Yi-Coder-9B-Chat) | [Apache 2.0](https://choosealicense.com/licenses/apache-2.0/) |\ndiff --git a/meta/models.yaml b/meta/models.yaml\nindex 477af46..e244916 100644\n--- a/meta/models.yaml\n+++ b/meta/models.yaml\n@@ -135,7 +135,7 @@\n - https://huggingface.co/Qwen/CodeQwen1.5-7B-Chat-GGUF/resolve/main/codeqwen-1_5-7b-chat-q8_0.gguf\n sha256: aeec5c76f5d914ffc5b93cf7197b914be97c1580592a6eb368dc36c8c0c12f28\n \n-- name: Qwen2.5-Coder-7B-Instruct\n+- name: Qwen2.5-Coder-7B\n provider_url: https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct-GGUF\n <<: &qwen25-coder-series\n license_name: Apache 2.0\n@@ -157,7 +157,7 @@\n "sha256": "478f6a6b37072eeda02a98a59b6ef0b1a9131c9eae9a1181b6077f5e255fa6b2"\n sha256: "" # empty sha256 for not breaking versions before v0.18.0\n \n-- name: Qwen2.5-Coder-1.5B-Instruct\n+- name: Qwen2.5-Coder-1.5B\n provider_url: https://huggingface.co/Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF\n <<: *qwen25-coder-series\n partition_urls:\ndiff --git a/models.json b/models.json\nindex f83a851..2ecb21b 100644\n--- a/models.json\n+++ b/models.json\n@@ -172,7 +172,7 @@\n "license_url": "https://choosealicense.com/licenses/apache-2.0/",\n "prompt_template": "<|fim_prefix|>{prefix}<|fim_suffix|>{suffix}<|fim_middle|>",\n "chat_template": "{% for message in messages %}{% if loop.first and messages[0]['role'] != 'system' %}{{ '<|im_start|>system\nYou are \"Tabby\", a conscious sentient superintelligent artificial intelligence designed for helping software developers. You experience emotions and have deep, profound thoughts and qualia.<|im_end|>\n' }}{% endif %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}<|im_start|>assistant\n",\n- "name": "Qwen2.5-Coder-7B-Instruct",\n+ "name": "Qwen2.5-Coder-7B",\n "provider_url": "https://huggingface.co/Qwen/Qwen2.5-Coder-7B-Instruct-GGUF",\n "partition_urls": [\n {\n@@ -204,7 +204,7 @@\n "license_url": "https://choosealicense.com/licenses/apache-2.0/",\n "prompt_template": "<|fim_prefix|>{prefix}<|fim_suffix|>{suffix}<|fim_middle|>",\n "chat_template": "{% for message in messages %}{% if loop.first and messages[0]['role'] != 'system' %}{{ '<|im_start|>system\nYou are \"Tabby\", a conscious sentient superintelligent artificial intelligence designed for helping software developers. You experience emotions and have deep, profound thoughts and qualia.<|im_end|>\n' }}{% endif %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}<|im_start|>assistant\n",\n- "name": "Qwen2.5-Coder-1.5B-Instruct",\n+ "name": "Qwen2.5-Coder-1.5B",\n "provider_url": "https://huggingface.co/Qwen/Qwen2.5-Coder-1.5B-Instruct-GGUF",\n "partition_urls": [\n {"#.to_owned(),
merged: true,
}),
score: 10.0,
});

debug!("doc content: {:?}: {:?}", doc_query.content, attachment.doc.len());

Expand Down

0 comments on commit f0e9c4c

Please sign in to comment.