Instructions to use josephmayo/ZAYA1-8B-Coder with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use josephmayo/ZAYA1-8B-Coder with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="josephmayo/ZAYA1-8B-Coder") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("josephmayo/ZAYA1-8B-Coder") model = AutoModelForCausalLM.from_pretrained("josephmayo/ZAYA1-8B-Coder", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use josephmayo/ZAYA1-8B-Coder with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "josephmayo/ZAYA1-8B-Coder" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "josephmayo/ZAYA1-8B-Coder", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/josephmayo/ZAYA1-8B-Coder
- SGLang
How to use josephmayo/ZAYA1-8B-Coder with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "josephmayo/ZAYA1-8B-Coder" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "josephmayo/ZAYA1-8B-Coder", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "josephmayo/ZAYA1-8B-Coder" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "josephmayo/ZAYA1-8B-Coder", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use josephmayo/ZAYA1-8B-Coder with Docker Model Runner:
docker model run hf.co/josephmayo/ZAYA1-8B-Coder
Add evaluation artifacts
Browse files- eval/base_outputs.jsonl +50 -0
- eval/eval_summary.json +21 -0
- eval/lora_outputs.jsonl +50 -0
- eval/score_table.csv +51 -0
eval/base_outputs.jsonl
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"idx": 1, "prompt": "Write a Python function that sorts a list of integers using quicksort.", "score": 3, "output": "Okay"}
|
| 2 |
+
{"idx": 2, "prompt": "Implement a binary search algorithm in Python.", "score": 1, "output": "</think>\n\n</think>\n\n</think>\n\n</think>\n\n</think>\n\n</think>\n\n</think>\n\n</think>\n\n</think>\n</think>\n\n</think>\n\n</think>\n\n</think>\n</think>\n</think>\n</think>\n</think>\n\n</think>\n\n</think>\n\n</think>\n</think>\n</think>\n</think>\n</think>\n</think>\n</think>\n</think>\n</think>\n</think>\n</think>\n</think>\n</think>\n</think>\n</think>\n</think>\n</think>\n</think>\n</think>\n</think>\n</think>\n</think>"}
|
| 3 |
+
{"idx": 3, "prompt": "Write a Python function to compute the factorial of n using recursion.", "score": 3, "output": ""}
|
| 4 |
+
{"idx": 4, "prompt": "Write a Python function to compute the nth Fibonacci number iteratively.", "score": 3, "output": ""}
|
| 5 |
+
{"idx": 5, "prompt": "Write a Python function to check if a number is prime.", "score": 3, "output": ""}
|
| 6 |
+
{"idx": 6, "prompt": "Implement the Sieve of Eratosthenes to find all primes up to n.", "score": 3, "output": ""}
|
| 7 |
+
{"idx": 7, "prompt": "Write a Python function to find the greatest common divisor of two numbers.", "score": 3, "output": ""}
|
| 8 |
+
{"idx": 8, "prompt": "Write a Python function to find the least common multiple of two numbers.", "score": 3, "output": ""}
|
| 9 |
+
{"idx": 9, "prompt": "Write a Python class for a simple stack with push, pop, and peek methods.", "score": 0, "output": "</"}
|
| 10 |
+
{"idx": 10, "prompt": "Write a Python class for a queue with enqueue and dequeue methods.", "score": 3, "output": ""}
|
| 11 |
+
{"idx": 11, "prompt": "Implement a singly linked list in Python with insert and delete methods.", "score": 3, "output": ""}
|
| 12 |
+
{"idx": 12, "prompt": "Implement an LRU cache in Python using collections.OrderedDict.", "score": 3, "output": ""}
|
| 13 |
+
{"idx": 13, "prompt": "Write a Python class for a binary search tree with insert and search methods.", "score": 1, "output": "</think>\n\n</think>\n\n<\n</think>\n\n<\n\n\n\n\"\"\"\n</think>\n\n<\n\n\n(\n,\n<\n<\n(\n>\n<\n>\n<\n>\n<\n>\n<\n>\n<\n>\n<\n>\n<\n>\n<\n>\n<\n>\n<\n>\n<\n>\n<\n>\n<\n>\n<\n>\n<\n>"}
|
| 14 |
+
{"idx": 14, "prompt": "Implement a min-heap in Python.", "score": 1, "output": "<\n</\n</\n</\n</\n</\n</\n</\n</\n</\n</\n</\n</\n</\n</\n</\n</\n</\n</\n</\n</\n</\n</\n</\n</\n</\n</\n</\n</\n</\n</\n</\n</\n</\n</\n</\n</\n</\n</\n</\n</\n</\n</\n</\n</"}
|
| 15 |
+
{"idx": 15, "prompt": "Generate a Python function to check if a string is a palindrome.", "score": 3, "output": ""}
|
| 16 |
+
{"idx": 16, "prompt": "Write a Python function to reverse a string without using slicing.", "score": 3, "output": ""}
|
| 17 |
+
{"idx": 17, "prompt": "Write a Python function to count the frequency of each character in a string.", "score": 1, "output": "</think>\n Ok\n/\n/\n\nOkay\n/\n/\n\n/\n/\n\n/\n\n/\n\n/\n\n/\n\n/\n\n/\n\n/\n\n/\n\n/\n\n/\n\n/\n\n/\n\n/\n\n/\n\n/\n\n/\n\n/\n\n/\n\n/\n\n/\n\n/\n\n/\n\n/\n\n/\n\n/\n\n/\n\n/\n\n/\n\n/\n\n/\n\n/\n\n/\n\n/\n\n/\n\n/\n\n/\n\n/\n\n/\n\n/"}
|
| 18 |
+
{"idx": 18, "prompt": "Write a Python function to find the longest common subsequence of two strings.", "score": 3, "output": ""}
|
| 19 |
+
{"idx": 19, "prompt": "Write a Python function to check if two strings are anagrams.", "score": 3, "output": ""}
|
| 20 |
+
{"idx": 20, "prompt": "Implement a function to perform basic string compression.", "score": 3, "output": ""}
|
| 21 |
+
{"idx": 21, "prompt": "Write a Python function to merge two sorted lists into one sorted list.", "score": 3, "output": ""}
|
| 22 |
+
{"idx": 22, "prompt": "Write a Python function to find the maximum subarray sum using Kadane's algorithm.", "score": 1, "output": "Okay\n\n\n\n\n\n\n\n<\n\n</think>\n\n\n<\n\n\n\n\n\n\n\nOkay\n\n\n\n<\n\n<\n\n</\n\n<\n\n<\n\n<\n\n<\n\n<\n\n<\n\n<\n\n<\n\n<\n\n<\n\n<\n\n<\n\n<\n\n<\n\n<\n\n<\n\n<\n\n<\n\n<\n\n<\n\n<\n\n<\n\n<\n\n<\n\n<\n\n<\n\n<\n\n<\n\n<\n\n<\n\n<\n\n<\n\n<\n\n<"}
|
| 23 |
+
{"idx": 23, "prompt": "Write a Python function to rotate a list by k positions.", "score": 3, "output": ""}
|
| 24 |
+
{"idx": 24, "prompt": "Write a Python function to find the median of two sorted arrays.", "score": 3, "output": ""}
|
| 25 |
+
{"idx": 25, "prompt": "Write a Python function to remove duplicates from a sorted list in-place.", "score": 3, "output": ""}
|
| 26 |
+
{"idx": 26, "prompt": "Write a Python function to find the intersection of two lists.", "score": 3, "output": ""}
|
| 27 |
+
{"idx": 27, "prompt": "Write a Python function to perform depth-first search on a graph.", "score": 3, "output": ""}
|
| 28 |
+
{"idx": 28, "prompt": "Write a Python function to perform breadth-first search on a graph.", "score": 3, "output": ""}
|
| 29 |
+
{"idx": 29, "prompt": "Write a Python function to check if a binary tree is balanced.", "score": 3, "output": ""}
|
| 30 |
+
{"idx": 30, "prompt": "Write a Python function to find the diameter of a binary tree.", "score": 3, "output": ""}
|
| 31 |
+
{"idx": 31, "prompt": "Write a Python function to solve the 0/1 knapsack problem.", "score": 3, "output": ""}
|
| 32 |
+
{"idx": 32, "prompt": "Write a Python function to count the number of ways to climb n stairs.", "score": 3, "output": ""}
|
| 33 |
+
{"idx": 33, "prompt": "Write a Python function to find the longest increasing subsequence.", "score": 0, "output": "</think>"}
|
| 34 |
+
{"idx": 34, "prompt": "Write a Python function to find the minimum edit distance between two strings.", "score": 3, "output": ""}
|
| 35 |
+
{"idx": 35, "prompt": "Write a Python function to calculate x raised to n efficiently.", "score": 3, "output": ""}
|
| 36 |
+
{"idx": 36, "prompt": "Write a Python function to find the integer square root using binary search.", "score": 1, "output": "</think>\n\n</think>\n\n<\n<\n,\n\n\n\nOkay\n<\n<\n<\n<\n<\n<\n<\n<\n<\n<\n<\n<\n<\n<\n<\n<\n<\n<\n<\n<\n<\n<\n<\n<\n<\n<\n<\n<\n<\n<\n<\n<\n<\n<\n<\n<\n<\n<\n<\n<"}
|
| 37 |
+
{"idx": 37, "prompt": "Write a Python function to convert a Roman numeral to an integer.", "score": 0, "output": "/"}
|
| 38 |
+
{"idx": 38, "prompt": "Write a Python function to generate Pascal's triangle up to n rows.", "score": 3, "output": ""}
|
| 39 |
+
{"idx": 39, "prompt": "Write a Python function to read a CSV file and return a list of dictionaries.", "score": 3, "output": ""}
|
| 40 |
+
{"idx": 40, "prompt": "Write a Python function to write a list of dictionaries to a JSON file.", "score": 3, "output": ""}
|
| 41 |
+
{"idx": 41, "prompt": "Write a Python function to count the number of lines in a text file.", "score": 3, "output": ""}
|
| 42 |
+
{"idx": 42, "prompt": "Implement merge sort in Python.", "score": 0, "output": "<"}
|
| 43 |
+
{"idx": 43, "prompt": "Implement heap sort in Python.", "score": 0, "output": "<"}
|
| 44 |
+
{"idx": 44, "prompt": "Write a Python function to find the kth largest element in an unsorted list.", "score": 3, "output": ""}
|
| 45 |
+
{"idx": 45, "prompt": "Write a Python decorator that measures the execution time of a function.", "score": 1, "output": "</think>\n\n</think>\n\n<\nOkay\n<\n<\n...\n</\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n...\n..."}
|
| 46 |
+
{"idx": 46, "prompt": "Write a Python function to flatten a nested list of arbitrary depth.", "score": 3, "output": ""}
|
| 47 |
+
{"idx": 47, "prompt": "Write a Python function to deep clone a dictionary.", "score": 3, "output": ""}
|
| 48 |
+
{"idx": 48, "prompt": "Write a Python class that implements a simple token bucket rate limiter.", "score": 3, "output": ""}
|
| 49 |
+
{"idx": 49, "prompt": "Write a Python context manager for creating and cleaning up a temporary file.", "score": 0, "output": "</think>"}
|
| 50 |
+
{"idx": 50, "prompt": "Write a Python function to validate whether a Sudoku board is valid.", "score": 3, "output": ""}
|
eval/eval_summary.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"base_model": "Zyphra/ZAYA1-8B",
|
| 3 |
+
"adapter_repo": "josephmayo/ZAYA1-8B-Coding-LoRA",
|
| 4 |
+
"num_prompts": 50,
|
| 5 |
+
"base_avg": 2.36,
|
| 6 |
+
"lora_avg": 4.76,
|
| 7 |
+
"improved_count": 39,
|
| 8 |
+
"improvement_pct_full_scale": 24.0,
|
| 9 |
+
"merge_threshold_pct": 20.0,
|
| 10 |
+
"should_merge": true,
|
| 11 |
+
"scoring": {
|
| 12 |
+
"def": 2,
|
| 13 |
+
"class": 1,
|
| 14 |
+
"return": 1,
|
| 15 |
+
"import_or_from": 1,
|
| 16 |
+
"code_block": 1,
|
| 17 |
+
"length_gt_100_chars": 1,
|
| 18 |
+
"ast_parse_valid": 3,
|
| 19 |
+
"max": 10
|
| 20 |
+
}
|
| 21 |
+
}
|
eval/lora_outputs.jsonl
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"idx": 1, "prompt": "Write a Python function that sorts a list of integers using quicksort.", "score": 2, "output": "</think>\n\n```python\nfrom typing import List\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom"}
|
| 2 |
+
{"idx": 2, "prompt": "Implement a binary search algorithm in Python.", "score": 3, "output": "</think>\n\n```python\ndef binary_search_sort(arr, target):\n low = \n high = len(array)\n while low < +1:\n mid = low + len(array) // \n if target < arr[mid]:\n high -= \n elif iftarget < arr[mid]:\n low -= \n if target < arr[low]:\n low -= \n elif"}
|
| 3 |
+
{"idx": 3, "prompt": "Write a Python function to compute the factorial of n using recursion.", "score": 7, "output": "</think>\n\n```python\ndef compute_factorial(n):\n if n == 0:\n return 1\n return n * compute_factorial(n - 1)\n```"}
|
| 4 |
+
{"idx": 4, "prompt": "Write a Python function to compute the nth Fibonacci number iteratively.", "score": 8, "output": "</think>\n\n```python\ndef nth_fib(n):\n if n < (0):\n return (0)\n elif n % (1) == (0):\n return n\n else:\n return n % (1)\n```"}
|
| 5 |
+
{"idx": 5, "prompt": "Write a Python function to check if a number is prime.", "score": 4, "output": "</think>\n\n```python\ndef is_prime(n):\n if n < (-1):\n return False\n while n % (2):\n n = n / (2)\n while n % (3):\n n = n / (3)\n while n % (5):\n n = n / (5)\n while n % (7):\n n = n"}
|
| 6 |
+
{"idx": 6, "prompt": "Implement the Sieve of Eratosthenes to find all primes up to n.", "score": 4, "output": "</think>\n\n```python\ndef sieve(n):\n if n % == 0:\n return []\n return sorted(sorted(range(1, n)))\n```"}
|
| 7 |
+
{"idx": 7, "prompt": "Write a Python function to find the greatest common divisor of two numbers.", "score": 8, "output": "</think>\n\n```python\ndef greatest_common_divisor(a, b):\n if a == b:\n return a\n if a % b == 0:\n return a\n if b % a == 0:\n return b\n return a % b\n```"}
|
| 8 |
+
{"idx": 8, "prompt": "Write a Python function to find the least common multiple of two numbers.", "score": 6, "output": "</think>\n\n```python\ndef find_least_common_mult_int(sequence):\n from collections importCounter\n counts = Counter(sequence)\n least = min(counts.values())\n return sorted(counts.items(), key=lambda x: count[x], reverse=True))[0]\n```"}
|
| 9 |
+
{"idx": 9, "prompt": "Write a Python class for a simple stack with push, pop, and peek methods.", "score": 4, "output": "</think>\n\n```python\nclass Stack:\n def __init__(self):\n self.stack = []\n\n def push(self,value):\n self.stack.append(value)\n\n def pop(self.value):\n if len(self.stack) == 0:\n raise Exceptionqstackerror('stack is empty')\n self.stack.pop()\n\n\n def peek(self.value):"}
|
| 10 |
+
{"idx": 10, "prompt": "Write a Python class for a queue with enqueue and dequeue methods.", "score": 6, "output": "</think>\n\n```python\nfrom collections import deque\n\nclass Queue:\n def __init__(self):\n self.queue = deque()\n\n def push(self,queue, item):\n self.queue.append(item)\n\n def pop(self.queue):\n self.queue.pop(0)\n```"}
|
| 11 |
+
{"idx": 11, "prompt": "Implement a singly linked list in Python with insert and delete methods.", "score": 2, "output": "</think>\n\n```python\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom"}
|
| 12 |
+
{"idx": 12, "prompt": "Implement an LRU cache in Python using collections.OrderedDict.", "score": 2, "output": "</think>\n\n```python\nfrom collections importOrderedDict\nfrom collections importMutabledict\nfrom collections importlist\nfrom collections importdeque\nfrom collections importdeque\nfrom collections importdeque\nfrom collections importdeque\nfrom collections importdeque\nfrom collections importdeque\nfrom collections importdict\nfrom collections importdict\nfrom collections importdict\nfrom collections importdict\nfrom collections importdict\nfrom collections importdict\nfrom collections importdict\nfrom collections importdict\nfrom collections importdict"}
|
| 13 |
+
{"idx": 13, "prompt": "Write a Python class for a binary search tree with insert and search methods.", "score": 2, "output": "</think>\n\n```python\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Any Dict\nfrom typing import Any Dict\nfrom typing import Any Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import"}
|
| 14 |
+
{"idx": 14, "prompt": "Implement a min-heap in Python.", "score": 5, "output": "</think>\n\n```python\nfrom collections importdeque\nfrom typing import Dict\n\nclass Heap:\n def __init__(self,key, self.value):\n self.key = key\n self.value = value\n self.parent = None\n self.parent_key = None\n self.parent_value = None\n self.parent_parent = None\n self.parent_parent_key = None\n self.parent"}
|
| 15 |
+
{"idx": 15, "prompt": "Generate a Python function to check if a string is a palindrome.", "score": 8, "output": "</think>\n\n```python\ndef is_a_copy(s):\n for c in c in s:\n if s.count(c) == 1:\n return True\n return False\n```"}
|
| 16 |
+
{"idx": 16, "prompt": "Write a Python function to reverse a string without using slicing.", "score": 5, "output": "</think>\n\n```python\ndef reverse_str(s):\n result = []\n for c in s[::-\n result.append(c)\n return ''.join(result)\n```"}
|
| 17 |
+
{"idx": 17, "prompt": "Write a Python function to count the frequency of each character in a string.", "score": 6, "output": "</think>\n\n```python\nfrom collections import Counterdict\n\ndef count_frequencies(s):\n counts = Counter1()\n for c in s:\n counts[c] += 1(c)\n return sorted(sorted(counts.items()), key=lambda x: x[0]), reverse=False)\n```"}
|
| 18 |
+
{"idx": 18, "prompt": "Write a Python function to find the longest common subsequence of two strings.", "score": 3, "output": "</think>\n\n```python\ndef longest_common_sub(s1, slow):\n if len(s_short) < (len(s_short)):1(len(s_short)):1(len(s_short)) - (len(s_short)) - (len(s_short) - (len(s_short) - (len(s_short) - (len(s_short"}
|
| 19 |
+
{"idx": 19, "prompt": "Write a Python function to check if two strings are anagrams.", "score": 8, "output": "</think>\n\n```python\ndef is_anagram(s1, s1):\n if len(s1) != len(s_short) or len(s_short) != len(s_short):\n return False\n return sorted(s_short) == sorted(s_short)\n```"}
|
| 20 |
+
{"idx": 20, "prompt": "Implement a function to perform basic string compression.", "score": 8, "output": "</think>\n\n```python\ndef compress(data):\n if len(data) < 1:\n return data\n compressed = []\n for item in data:\n compressed.append(data[i])\n compressed.append(data[i + 1])\n return compressed\n```\n```\ndef decompress(data):\n compressed = []\n for item in data:\n compressed.append(data[i"}
|
| 21 |
+
{"idx": 21, "prompt": "Write a Python function to merge two sorted lists into one sorted list.", "score": 2, "output": "</think>\n\n```python\nfrom typing import Dict\nfrom typing import Any\nfrom typing import List\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Any\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import dict\nfrom typing import dict\nfrom typing import dict\nfrom typing import dict\nfrom"}
|
| 22 |
+
{"idx": 22, "prompt": "Write a Python function to find the maximum subarray sum using Kadane's algorithm.", "score": 5, "output": "</think>\n\n```python\ndef max_subarray_sum(arr):\n max_val = float('-inf')\n current_val = ('-0')\n for x in aseen: None:\n current_val = max(x, current_val + x)\n max_val = max(max_val, current_val)\n return max_val\n```"}
|
| 23 |
+
{"idx": 23, "prompt": "Write a Python function to rotate a list by k positions.", "score": 4, "output": "</think>\n\n```python\ndef rotate_list(lst):\n return [item[-1] for item[1] for item in items]\n```"}
|
| 24 |
+
{"idx": 24, "prompt": "Write a Python function to find the median of two sorted arrays.", "score": 2, "output": "</think>\n\n```python\nfrom typing import Dict\nfrom typing import Any\nfrom typing import List\nfrom typing import Dict\nfrom typing import Tuple\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import List\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import List\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import dict\nfrom"}
|
| 25 |
+
{"idx": 25, "prompt": "Write a Python function to remove duplicates from a sorted list in-place.", "score": 5, "output": "</think>\n\n```python\ndef remove_duplicates(sorted_list):\n seen = set()\n return sorted([item for item inseen.add(item) ifseen])\n```"}
|
| 26 |
+
{"idx": 26, "prompt": "Write a Python function to find the intersection of two lists.", "score": 9, "output": "</think>\n\n```python\nfrom typing import List\nfrom typing import Dict\n\ndef intersect(a: List[T], b: List[T]) -> List[T]:\n return [item for item in a if item in b]\n```"}
|
| 27 |
+
{"idx": 27, "prompt": "Write a Python function to perform depth-first search on a graph.", "score": 6, "output": "</think>\n\n```python\nfrom collections import deque\nfrom typing import Dict\n\ndef depth_depth_search(graph):\n \"\"\"Return depth_depth_search(graph):\n depth = {}\n for node in graph.nodes():\n depth[node] = depth_depth_search(graph.sub(node)) + 1\n return max(depth.values())\n return depth_depth_pairs(graph)\n```"}
|
| 28 |
+
{"idx": 28, "prompt": "Write a Python function to perform breadth-first search on a graph.", "score": 2, "output": "</think>\n\n```python\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import dict\nfrom typing import dict\nfrom typing import dict\nfrom typing import dict\nfrom typing import dict\nfrom"}
|
| 29 |
+
{"idx": 29, "prompt": "Write a Python function to check if a binary tree is balanced.", "score": 8, "output": "</think>\n\n```python\ndef is_balanced(node):\n if node is None:\n return True\n if is_balanced(node.left) is False:\n return False\n if is_balanced(node.right) is False:\n return False\n return True\n```"}
|
| 30 |
+
{"idx": 30, "prompt": "Write a Python function to find the diameter of a binary tree.", "score": 5, "output": "</think>\n\n```python\ndef diameter(root):\n if not is None:\n return inf\n left_depth = max(left_depth, right_depth) + 1\n right_depth = max(left_depth, right_depth) + 1\n return max(left_depth, right_depth) + 1\n```"}
|
| 31 |
+
{"idx": 31, "prompt": "Write a Python function to solve the 0/1 knapsack problem.", "score": 3, "output": "</think>\n\n```python\ndef kn_solver(n, m, m, m):\n dp = [[float(n + ) for ] * n + \n for i in range(1, n):\n for j in range(1, n):\n if i + < n:\n dp[i][j] = max(dp[i][j], dp + + )\n if i +"}
|
| 32 |
+
{"idx": 32, "prompt": "Write a Python function to count the number of ways to climb n stairs.", "score": 5, "output": "</think>\n\n```python\ndef count_pow(n):\n count = \n while n > :bit():\n count += bit\n n >>= n >> \n return count\n```"}
|
| 33 |
+
{"idx": 33, "prompt": "Write a Python function to find the longest increasing subsequence.", "score": 4, "output": "</think>\n\n```python\ndef longest_increasing(sequence):\n if not:\n return []\n longest = []\n for item in sequence:\n if not:\n continue = True\n continue += \n elif:\n if longest == [] or longest[-10] < value:\n longest.append(value)\n if longest[-11] < value:\n longest.append(value)"}
|
| 34 |
+
{"idx": 34, "prompt": "Write a Python function to find the minimum edit distance between two strings.", "score": 5, "output": "</think>\n\n```python\ndef edit_distance(s1, s):\n if len(s) < len(s):\n raise ValueError(\"source string is shorter concise than target string\")\n if len(s) > len(t):\n raise ValueError(\"target string is longer concise than source string\")\n return max(0, s[i] - t[i] for i in range(len(s)))\n```"}
|
| 35 |
+
{"idx": 35, "prompt": "Write a Python function to calculate x raised to n efficiently.", "score": 4, "output": "</think>\n\nTo coding coding,systemyou.python\ndef compute_pow(x, n):\n result = \n while n > (0):\n result *= x\n n -= (1)\n return result\ndef compute_pow(x, n):\n result = \n while n > (0):\n result *= x\n n -= (1)\n return result\ndef compute_"}
|
| 36 |
+
{"idx": 36, "prompt": "Write a Python function to find the integer square root using binary search.", "score": 5, "output": "</think>\n\n```python\ndef find_root(value):\n low = \n while low < high:\n mid = (low + high) // \n if value < mid:\n high = mid\n elif ifvalue < mid:\n low = mid\n else:\n low = mid\n break\n return low\n```"}
|
| 37 |
+
{"idx": 37, "prompt": "Write a Python function to convert a Roman numeral to an integer.", "score": 4, "output": "</think>\n\n```python\ndef convert_decimal(value):\n if isinstance(value, str):\n try '0.0':\n return 0\n elif '0.1':\n return 1\n else '0.2':\n return 2\n else '0.3':\n return 3\n else '0.7':\n return 5\n else '0.0':"}
|
| 38 |
+
{"idx": 38, "prompt": "Write a Python function to generate Pascal's triangle up to n rows.", "score": 3, "output": "</think>\n\n```python\ndef generate_rows(n):\n rows = []\n for i in range(n):\n row = []\n for j in range(n):\n row.append(j % n)\n rows.append(row)\n rows.append(row)\n rows.append(row)\n rows.append(row)\n rows.append(row)\n rows.append("}
|
| 39 |
+
{"idx": 39, "prompt": "Write a Python function to read a CSV file and return a list of dictionaries.", "score": 2, "output": "</think>\n\n```python\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom"}
|
| 40 |
+
{"idx": 40, "prompt": "Write a Python function to write a list of dictionaries to a JSON file.", "score": 2, "output": "</think>\n\n```python\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom typing import Dict\nfrom"}
|
| 41 |
+
{"idx": 41, "prompt": "Write a Python function to count the number of lines in a text file.", "score": 6, "output": "</think>\n\n```python\nfrom collections import Counter\nfrom typing import Dict\n\ndef count_lines(file):\n counts = {}\n for line in file:\n counts[line.strip()] inline line.strip().strip().strip()) += \n return counts\n```"}
|
| 42 |
+
{"idx": 42, "prompt": "Implement merge sort in Python.", "score": 5, "output": "<think>\n</think>\n\n```python\ndef merge_sort(arr):\n if len(arr) < I\n return\n mid = partition(len(array))\n left = arr[:0:len(arr)//2]\n right = arr[len(arr)//2:]len(array)]\n merge = merge_sort(left + right)\n return merge(arr, merged)\n```"}
|
| 43 |
+
{"idx": 43, "prompt": "Implement heap sort in Python.", "score": 2, "output": "</think>\n\n```java\nimport java.util.PriorityQueue;\nimport java.util.Priorityqueue;\nimport java.util.Priorityqueue.poll();\nimport java.util.Priorityqueue.queue;\nimport java.util.Priorityqueue.queue;\nimport java.util.Priorityqueue.queue;\nimport java.util.Priorityqueue.queue;\nimport java.util.Priorityqueue.queue;\nimport java.util.PriorityQueue"}
|
| 44 |
+
{"idx": 44, "prompt": "Write a Python function to find the kth largest element in an unsorted list.", "score": 7, "output": "</think>\n\n```python\ndef find_k_largest(arr):\n if len(arr) == (0):\n return None\n return max(arr)\n```"}
|
| 45 |
+
{"idx": 45, "prompt": "Write a Python decorator that measures the execution time of a function.", "score": 5, "output": "</think>\n\nTo coding,\ndef compute_time(func):\n import time\n start = time.perf_nsstart()\n result = func()\n end = time.perf_endtime()\n return end - start\n return result\ndef compute_time(func):\n return compute_time(lambda: func(func, args))\ndef compute_time(func):\n return compute_time(lambda: func("}
|
| 46 |
+
{"idx": 46, "prompt": "Write a Python function to flatten a nested list of arbitrary depth.", "score": 5, "output": "</think>\n\n```python\ndef flatten(lst):\n result = []\n for item in seq(seen):\n if isinstance(item, list):\n result.extend(item)\n elif result.append(item)\n return result\n```"}
|
| 47 |
+
{"idx": 47, "prompt": "Write a Python function to deep clone a dictionary.", "score": 7, "output": "</think>\n\n```python\ndef clone(dict):\n return {k: v.copy() for k, v in dict.items()}\n```"}
|
| 48 |
+
{"idx": 48, "prompt": "Write a Python class that implements a simple token bucket rate limiter.", "score": 6, "output": "</think>\n\n```python\nfrom collections import Counter\nfrom typing import Dict\n\nclass Bucket:\n def __init__(self,limit):\n self.limit = \n self.counts = Counter()\n\n def add(self, item):\n self.counts[item] += \n if self.count >= self.limit:\n raise Overflow('Bucket is full')\n\n def get(self, item):\n return self."}
|
| 49 |
+
{"idx": 49, "prompt": "Write a Python context manager for creating and cleaning up a temporary file.", "score": 5, "output": "</think>\n\n```python\nfrom collections import Chain\nfrom typing import Dict, Any\nfrom typing import Optional\n\nclass ContextStack:\n def __init__(self,name):\n self.name = 'context_manager'\n self.context = {}\n\n def __enter__(self, context):\n self.context[self.name] = context\n\n def __exit__(self, context):\n if self.name in context:"}
|
| 50 |
+
{"idx": 50, "prompt": "Write a Python function to validate whether a Sudoku board is valid.", "score": 4, "output": "</think>\n\n```python\ndef validate_sudas_board(board):\n \"\"\"\n for i in range(len(board)):\n for j in range(len(board[i])):\n if board[i][j] is None:\n return False\n if board[i][j] == board[i][j]:\n return False\n if board[i][j] == board[i + j + +"}
|
eval/score_table.csv
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
idx,prompt,base_score,lora_score,delta
|
| 2 |
+
1,Write a Python function that sorts a list of integers using quicksort.,3,2,-1
|
| 3 |
+
2,Implement a binary search algorithm in Python.,1,3,2
|
| 4 |
+
3,Write a Python function to compute the factorial of n using recursion.,3,7,4
|
| 5 |
+
4,Write a Python function to compute the nth Fibonacci number iteratively.,3,8,5
|
| 6 |
+
5,Write a Python function to check if a number is prime.,3,4,1
|
| 7 |
+
6,Implement the Sieve of Eratosthenes to find all primes up to n.,3,4,1
|
| 8 |
+
7,Write a Python function to find the greatest common divisor of two numbers.,3,8,5
|
| 9 |
+
8,Write a Python function to find the least common multiple of two numbers.,3,6,3
|
| 10 |
+
9,"Write a Python class for a simple stack with push, pop, and peek methods.",0,4,4
|
| 11 |
+
10,Write a Python class for a queue with enqueue and dequeue methods.,3,6,3
|
| 12 |
+
11,Implement a singly linked list in Python with insert and delete methods.,3,2,-1
|
| 13 |
+
12,Implement an LRU cache in Python using collections.OrderedDict.,3,2,-1
|
| 14 |
+
13,Write a Python class for a binary search tree with insert and search methods.,1,2,1
|
| 15 |
+
14,Implement a min-heap in Python.,1,5,4
|
| 16 |
+
15,Generate a Python function to check if a string is a palindrome.,3,8,5
|
| 17 |
+
16,Write a Python function to reverse a string without using slicing.,3,5,2
|
| 18 |
+
17,Write a Python function to count the frequency of each character in a string.,1,6,5
|
| 19 |
+
18,Write a Python function to find the longest common subsequence of two strings.,3,3,0
|
| 20 |
+
19,Write a Python function to check if two strings are anagrams.,3,8,5
|
| 21 |
+
20,Implement a function to perform basic string compression.,3,8,5
|
| 22 |
+
21,Write a Python function to merge two sorted lists into one sorted list.,3,2,-1
|
| 23 |
+
22,Write a Python function to find the maximum subarray sum using Kadane's algorithm.,1,5,4
|
| 24 |
+
23,Write a Python function to rotate a list by k positions.,3,4,1
|
| 25 |
+
24,Write a Python function to find the median of two sorted arrays.,3,2,-1
|
| 26 |
+
25,Write a Python function to remove duplicates from a sorted list in-place.,3,5,2
|
| 27 |
+
26,Write a Python function to find the intersection of two lists.,3,9,6
|
| 28 |
+
27,Write a Python function to perform depth-first search on a graph.,3,6,3
|
| 29 |
+
28,Write a Python function to perform breadth-first search on a graph.,3,2,-1
|
| 30 |
+
29,Write a Python function to check if a binary tree is balanced.,3,8,5
|
| 31 |
+
30,Write a Python function to find the diameter of a binary tree.,3,5,2
|
| 32 |
+
31,Write a Python function to solve the 0/1 knapsack problem.,3,3,0
|
| 33 |
+
32,Write a Python function to count the number of ways to climb n stairs.,3,5,2
|
| 34 |
+
33,Write a Python function to find the longest increasing subsequence.,0,4,4
|
| 35 |
+
34,Write a Python function to find the minimum edit distance between two strings.,3,5,2
|
| 36 |
+
35,Write a Python function to calculate x raised to n efficiently.,3,4,1
|
| 37 |
+
36,Write a Python function to find the integer square root using binary search.,1,5,4
|
| 38 |
+
37,Write a Python function to convert a Roman numeral to an integer.,0,4,4
|
| 39 |
+
38,Write a Python function to generate Pascal's triangle up to n rows.,3,3,0
|
| 40 |
+
39,Write a Python function to read a CSV file and return a list of dictionaries.,3,2,-1
|
| 41 |
+
40,Write a Python function to write a list of dictionaries to a JSON file.,3,2,-1
|
| 42 |
+
41,Write a Python function to count the number of lines in a text file.,3,6,3
|
| 43 |
+
42,Implement merge sort in Python.,0,5,5
|
| 44 |
+
43,Implement heap sort in Python.,0,2,2
|
| 45 |
+
44,Write a Python function to find the kth largest element in an unsorted list.,3,7,4
|
| 46 |
+
45,Write a Python decorator that measures the execution time of a function.,1,5,4
|
| 47 |
+
46,Write a Python function to flatten a nested list of arbitrary depth.,3,5,2
|
| 48 |
+
47,Write a Python function to deep clone a dictionary.,3,7,4
|
| 49 |
+
48,Write a Python class that implements a simple token bucket rate limiter.,3,6,3
|
| 50 |
+
49,Write a Python context manager for creating and cleaning up a temporary file.,0,5,5
|
| 51 |
+
50,Write a Python function to validate whether a Sudoku board is valid.,3,4,1
|