| { | |
| "bits": 4, | |
| "dataset": [ | |
| "### Instruction:\nYou are a code completion assistant and your task is to analyze user edits and then rewrite an excerpt that the user provides, suggesting the appropriate edits within the excerpt, taking into account the cursor location.\n\n### User Edits:\n\nUser edited \"models/customer.rb\":\n\n```diff\n@@ -2,5 +2,5 @@\n class Customer\n def initialize\n- @name = name\n+ @name = name.capitalize\n @email = email\n @phone = phone\n```\n\n### User Excerpt:\n\n```models/customer.rb\n def initialize\n<|editable_region_start|>\n @name = name.capitalize<|user_cursor_is_here|>\n @email = email\n @phone = phone\n @address = address\n end\n\n def to_s\n @name\n end\n\n<|editable_region_end|>\n private\n\n def validate_email\n @email.include?('@')\n```\n\n### Response:\n\n<|editable_region_start|>\n @name = name.capitalize\n @email = email.capitalize\n @phone = phone.capitalize\n @address = address.capitalize\n end\n\n def to_s\n @name\n end\n\n<|editable_region_end|>\n private\n\n def validate_email\n @email.include?('@')\n```\n<|endoftext|>", | |
| "### Instruction:\nYou are a code completion assistant and your task is to analyze user edits and then rewrite an excerpt that the user provides, suggesting the appropriate edits within the excerpt, taking into account the cursor location.\n\n### User Edits:\n\nUser edited \"src/components/UserProfile.tsx\":\n\n```diff\n@@ -15,3 +15,3 @@\ninterface UserProfileProps {\n- name: string;\n+ name: string | undefined;\n email: string\n```\n\n### User Excerpt:\n\n```src/components/UserProfile.tsx\ninterface UserProfileProps {\n<|editable_region_start|>\n name: string | undefined<|user_cursor_is_here|>;\n email: string;\n avatar: string;\n age: number;\n<|editable_region_end|>\n}\n\nconst UserProfile: React.FC<UserProfileProps> = ({ name, email, avatar, age }) => {\n const handleClick = () => {\n console.log(name);\n };\n```\n\n### Response:\n\n<|editable_region_start|>\n name: string | undefined;\n email: string | undefined;\n avatar: string | undefined;\n age: number | undefined;\n<|editable_region_end|>\n}\n\nconst UserProfile: React.FC<UserProfileProps> = ({ name, email, avatar, age }) => {\n const handleClick = () => {\n console.log(name);\n };\n```\n<|endoftext|>", | |
| "### Instruction:\nYou are a code completion assistant and your task is to analyze user edits and then rewrite an excerpt that the user provides, suggesting the appropriate edits within the excerpt, taking into account the cursor location.\n\n### User Edits:\n\nUser edited \"internal/parser/ast.py\":\n\n```diff\n@@ -102,3 +102,3 @@\nclass BinaryExpr:\n- def __init__(self, left, operator, right):\n+ def __init__(self, left: Expression, operator: Token, right: Expression):\n self.left = left\n```\n\n### User Excerpt:\n\n```internal/parser/ast.py\nclass BinaryExpr:\n<|editable_region_start|>\n def __init__(self, left: Expression, operator: Token, right: Expression<|user_cursor_is_here|>):\n self.left = left\n self.operator = operator\n self.right = right\n\nclass UnaryExpr:\n def __init__(self, operator, right):\n self.operator = operator\n<|editable_region_end|>\n self.right = right\n\n def accept(self, visitor):\n return visitor.visit_unary_expr(self)\n```\n\n### Response:\n\n<|editable_region_start|>\n def __init__(self, left: Expression, operator: Token, right: Expression):\n self.left = left\n self.operator = operator\n self.right = right\n\nclass UnaryExpr:\n def __init__(self, operator: Token, right: Expression):\n self.operator = operator\n<|editable_region_end|>\n self.right = right\n\n def accept(self, visitor):\n return visitor.visit_unary_expr(self)\n```\n<|endoftext|>", | |
| "### Instruction:\nYou are a code completion assistant and your task is to analyze user edits and then rewrite an excerpt that the user provides, suggesting the appropriate edits within the excerpt, taking into account the cursor location.\n\n### User Edits:\n\nUser edited \"pkg/database/models.rs\":\n\n```diff\n@@ -88,3 +88,3 @@\n struct User {\n- id: i32,\n+ pub id: i32,\n username: String,\n```\n\n### User Excerpt:\n\n```pkg/database/models.rs\n struct User {\n<|editable_region_start|>\n pub <|user_cursor_is_here|>id: i32,\n username: String,\n email: String,\n created_at: DateTime<Utc>,\n updated_at: DateTime<Utc>,\n<|editable_region_end|>\n }\n\n impl User {\n pub fn new() -> Self {\n```\n\n### Response:\n\n<|editable_region_start|>\n pub id: i32,\n pub username: String,\n pub email: String,\n pub created_at: DateTime<Utc>,\n pub updated_at: DateTime<Utc>,\n<|editable_region_end|>\n }\n\n impl User {\n pub fn new() -> Self {\n```\n<|endoftext|>", | |
| "### Instruction:\nYou are a code completion assistant and your task is to analyze user edits and then rewrite an excerpt that the user provides, suggesting the appropriate edits within the excerpt, taking into account the cursor location.\n\n### User Edits:\n\nUser edited \"src/compiler/symbol_table.cpp\":\n\n```diff\n@@ -156,3 +156,3 @@\n class LocalVariable {\n- int scope;\n+ int scope = 0;\n std::string name;\n```\n\n### User Excerpt:\n\n```src/compiler/symbol_table.cpp\n class LocalVariable {\n<|editable_region_start|>\n int scope = 0<|user_cursor_is_here|>;\n std::string name;\n Type type;\n bool isConst;\n bool isUsed;\n<|editable_region_end|>\n\n LocalVariable(\n```\n\n### Response:\n\n<|editable_region_start|>\n int scope = 0;\n std::string name = \"\";\n Type type = Type::VOID;\n bool isConst = false;\n bool isUsed = false;\n<|editable_region_end|>\n\n LocalVariable(\n```\n<|endoftext|>", | |
| "### Instruction:\nYou are a code completion assistant and your task is to analyze user edits and then rewrite an excerpt that the user provides, suggesting the appropriate edits within the excerpt, taking into account the cursor location.\n\n### User Edits:\n\nUser edited \"app/models/schema.graphql\":\n\n```diff\n@@ -23,3 +23,3 @@\n type Post {\n- title: String\n+ title: String!\n content: String\n```\n\n### User Excerpt:\n\n```app/models/schema.graphql\n }\n}\n\n<|editable_region_start|>\ntype Post {\n title: String!<|user_cursor_is_here|>\n content: String\n author: User\n comments: [Comment]\n createdAt: DateTime\n tags: [String]\n<|editable_region_end|>\n}\n\ntype Comment {\n```\n\n### Response:\n\n<|editable_region_start|>\ntype Post {\n title: String!\n content: String!\n author: User!\n comments: [Comment!]!\n createdAt: DateTime!\n tags: [String!]!\n<|editable_region_end|>\n}\n\ntype Comment {\n```\n<|endoftext|>", | |
| "### Instruction:\nYou are a code completion assistant and your task is to analyze user edits and then rewrite an excerpt that the user provides, suggesting the appropriate edits within the excerpt, taking into account the cursor location.\n\n### User Edits:\n\nUser edited \"lib/collections/LinkedList.java\":\n\n```diff\n@@ -167,3 +167,5 @@\n }\n\n+ public boolean isPalindrome() {}\n+\n private static class Node<T> {\n```\n\n### User Excerpt:\n\n```lib/collections/LinkedList.java\n private Node<T> head;\n private int size;\n\n public void reverse() {\n if (head == null) return;\n Node<T> prev = null;\n Node<T> current = head;\n while (current != null) {\n Node<T> next = current.next;\n current.next = prev;\n prev = current;\n current = next;\n }\n head = prev;\n<|editable_region_start|>\n }\n\n public boolean isPalindrome() {<|user_cursor_is_here|>}\n\n private static class Node<T> {\n T data;\n<|editable_region_end|>\n Node<T> next;\n```\n\n### Response:\n\n<|editable_region_start|>\n }\n\n public boolean isPalindrome() {\n if (head == null || head.next == null) return true;\n\n // Find middle using slow/fast pointer\n Node<T> slow = head;\n Node<T> fast = head;\n Node<T> prev = null;\n\n while (fast != null && fast.next != null) {\n fast = fast.next.next;\n Node<T> next = slow.next;\n slow.next = prev;\n prev = slow;\n slow = next;\n }\n\n // If odd length, skip middle element\n Node<T> second = fast == null ? slow : slow.next;\n Node<T> first = prev;\n\n // Compare reversed first half with second half\n while (first != null && second != null) {\n if (!first.data.equals(second.data)) return false;\n first = first.next;\n second = second.next;\n }\n return true;\n }\n\n private static class Node<T> {\n T data;\n<|editable_region_end|>\n Node<T> next;\n```\n<|endoftext|>", | |
| "### Instruction:\nYou are a code completion assistant and your task is to analyze user edits and then rewrite an excerpt that the user provides, suggesting the appropriate edits within the excerpt, taking into account the cursor location.\n\n### User Edits:\n\nUser edited \"src/utils/sorting.ts\":\n\n```diff\n@@ -45,3 +45,4 @@\n }\n\n+ function findKthLargest<T>(arr: T[], k: number, compareFn: (a: T, b: T) => number): T {\n export function binarySearch<T>(\n```\n\n### User Excerpt:\n\n```src/utils/sorting.ts\n const pivot = arr[Math.floor(arr.length / 2)];\n const left = arr.filter(x => compareFn(x, pivot) < 0);\n const middle = arr.filter(x => compareFn(x, pivot) === 0);\n const right = arr.filter(x => compareFn(x, pivot) > 0);\n return [...quickSort(left, compareFn), ...middle, ...quickSort(right, compareFn)];\n<|editable_region_start|>\n }\n\n function findKthLargest<T>(arr: T[], k: number, compareFn: (a: T, b: T) => number): T {<|user_cursor_is_here|>\n<|editable_region_end|>\n export function binarySearch<T>(\n```\n\n### Response:\n\n<|editable_region_start|>\n }\n\n function findKthLargest<T>(arr: T[], k: number, compareFn: (a: T, b: T) => number): T {\n if (k < 1 || k > arr.length) throw new Error('Invalid k');\n\n const partition = (low: number, high: number): number => {\n const pivot = arr[high];\n let i = low - 1;\n\n for (let j = low; j < high; j++) {\n if (compareFn(arr[j], pivot) > 0) {\n i++;\n [arr[i], arr[j]] = [arr[j], arr[i]];\n }\n }\n [arr[i + 1], arr[high]] = [arr[high], arr[i + 1]];\n return i + 1;\n };\n\n let left = 0;\n let right = arr.length - 1;\n\n while (left <= right) {\n const pivotIndex = partition(left, right);\n if (pivotIndex === k - 1) return arr[pivotIndex];\n if (pivotIndex < k - 1) left = pivotIndex + 1;\n else right = pivotIndex - 1;\n }\n\n throw new Error('Unreachable');\n }\n\n<|editable_region_end|>\n export function binarySearch<T>(\n```\n<|endoftext|>", | |
| "### Instruction:\nYou are a code completion assistant and your task is to analyze user edits and then rewrite an excerpt that the user provides, suggesting the appropriate edits within the excerpt, taking into account the cursor location.\n\n### User Edits:\n\nUser opened file: \"pkg/cache/lru.go\"\n\nUser edited \"pkg/cache/lru.go\":\n```diff\n@@ -24,6 +24,8 @@\n func (c *Cache) Get(key string) (interface{}, bool) {\n+ c.mu.RLock()\n+ defer c.mu.RUnlock()\n if node, ok := c.items[key]; ok {\n return node.value, true\n }\n@@ -35,11 +36,14 @@\n func (c *Cache) Put(key string, value interface{}) {\n+ c.mu.Lock()\n+ defer c.mu.Unlock()\n if node, exists := c.items[key]; exists {\n node.value = value\n }\n }\n\n+ func (c *Cache) Del\n```\n\n### User Excerpt:\n\n```go\n items map[string]*Node\n head *Node\n tail *Node\n mu sync.RWMutex\n}\n\nfunc (c *Cache) Get(key string) (interface{}, bool) {\n c.mu.RLock()\n defer c.mu.RUnlock()\n if node, ok := c.items[key]; ok {\n return node.value, true\n }\n<|editable_region_start|>\n return nil, false\n}\n\nfunc (c *Cache) Put(key string, value interface{}) {\n\t c.mu.RLock()\n defer c.mu.RUnlock()\n if node, exists := c.items[key]; exists {\n node.value = value\n }\n}\n\nfunc (c *Cache) Del<|user_cursor_is_here|>\n\n<|editable_region_end|>\nfunc NewCache(capacity int) *Cache {\n```\n\n### Response:\n\n<|editable_region_start|>\n return nil, false\n}\n\nfunc (c *Cache) Put(key string, value interface{}) {\n c.mu.Lock()\n defer c.mu.Unlock()\n if node, exists := c.items[key]; exists {\n node.value = value\n }\n}\n\nfunc (c *Cache) Del(key string) {\n c.mu.Lock()\n defer c.mu.Unlock()\n if node, exists := c.items[key]; exists {\n delete(c.items, key)\n c.removeNode(node)\n }\n}\n\n<|editable_region_end|>\nfunc NewCache(capacity int) *Cache {\n```\n<|endoftext|>", | |
| "### Instruction:\nYou are a code completion assistant and your task is to analyze user edits and then rewrite an excerpt that the user provides, suggesting the appropriate edits within the excerpt, taking into account the cursor location.\n\n### User Edits:\n\nUser edited \"src/parser/ast.rs\":\n\n```diff\n@@ -45,7 +45,9 @@\n impl Expression {\n fn evaluate(&self, env: &Environment) -> Result<Value, Error> {\n+ env.with_scope(|scope| {\n match self {\n Expression::Number(n) => Ok(Value::Number(*n)),\n Expression::String(s) => Ok(Value::String(s.clone())),\n }\n+ })\n }\n@@ -67,10 +69,13 @@\n impl Statement {\n fn execute(&self, env: &mut Environment) -> Result<(), Error> {\n+ env.with_scope(|scope| {\n match self {\n Statement::Let(name, expr) => {\n let value = expr.evaluate(env)?;\n }\n }\n+ })\n }\n }\n\n+ fn par\n```\n\n### User Excerpt:\n\n```src/parser/ast.rs\n String(String),\n Binary(Box<Expression>, Operator, Box<Expression>),\n Call(String, Vec<Expression>),\n }\n\n impl Expression {\n fn evaluate(&self, env: &Environment) -> Result<Value, Error> {\n env.with_scope(|scope| {\n match self {\n Expression::Number(n) => Ok(Value::Number(*n)),\n Expression::String(s) => Ok(Value::String(s.clone())),\n }\n })\n }\n }\n\n impl Statement {\n<|editable_region_start|>\n fn execute(&self, env: &mut Environment) -> Result<(), Error> {\n env.with_scope(|scope| {\n match self {\n Statement::Let(name, expr) => {\n let value = expr.evaluate(env)?;\n }\n }\n })\n }\n }\n\n fn par<|user_cursor_is_here|>\n\n<|editable_region_end|>\n impl Parser {\n```\n\n### Response:\n\n<|editable_region_start|>\n fn execute(&self, env: &mut Environment) -> Result<(), Error> {\n env.with_scope(|scope| {\n match self {\n Statement::Let(name, expr) => {\n let value = expr.evaluate(env)?;\n }\n }\n })\n }\n }\n\n fn parse_expression(input: &str, precedence: u8) -> Result<Expression, Error> {\n env.with_scope(|scope| {\n let mut lexer = Lexer::new(input);\n let token = lexer.next_token()?;\n\n match token {\n Token::Number(n) => Ok(Expression::Number(n)),\n Token::String(s) => Ok(Expression::String(s)),\n Token::LeftParen => parse_grouped_expression(&mut lexer),\n _ => Err(Error::UnexpectedToken(token)),\n }\n })\n }\n\n<|editable_region_end|>\n impl Parser {\n```\n<|endoftext|>" | |
| ], | |
| "group_size": 128, | |
| "damp_percent": 0.1, | |
| "desc_act": false, | |
| "sym": true, | |
| "true_sequential": true, | |
| "quant_method": "gptq", | |
| "modules_in_block_to_quantize": null, | |
| "checkpoint_format": "gptq", | |
| "meta": { | |
| "quantizer": [ | |
| "optimum:1.27.0", | |
| "auto_gptq:0.7.1" | |
| ] | |
| } | |
| } |