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") 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
| {"idx": 1, "prompt": "Write a Python function that sorts a list of integers using quicksort.", "score": 3, "output": "Okay"} | |
| {"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>"} | |
| {"idx": 3, "prompt": "Write a Python function to compute the factorial of n using recursion.", "score": 3, "output": ""} | |
| {"idx": 4, "prompt": "Write a Python function to compute the nth Fibonacci number iteratively.", "score": 3, "output": ""} | |
| {"idx": 5, "prompt": "Write a Python function to check if a number is prime.", "score": 3, "output": ""} | |
| {"idx": 6, "prompt": "Implement the Sieve of Eratosthenes to find all primes up to n.", "score": 3, "output": ""} | |
| {"idx": 7, "prompt": "Write a Python function to find the greatest common divisor of two numbers.", "score": 3, "output": ""} | |
| {"idx": 8, "prompt": "Write a Python function to find the least common multiple of two numbers.", "score": 3, "output": ""} | |
| {"idx": 9, "prompt": "Write a Python class for a simple stack with push, pop, and peek methods.", "score": 0, "output": "</"} | |
| {"idx": 10, "prompt": "Write a Python class for a queue with enqueue and dequeue methods.", "score": 3, "output": ""} | |
| {"idx": 11, "prompt": "Implement a singly linked list in Python with insert and delete methods.", "score": 3, "output": ""} | |
| {"idx": 12, "prompt": "Implement an LRU cache in Python using collections.OrderedDict.", "score": 3, "output": ""} | |
| {"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>"} | |
| {"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</"} | |
| {"idx": 15, "prompt": "Generate a Python function to check if a string is a palindrome.", "score": 3, "output": ""} | |
| {"idx": 16, "prompt": "Write a Python function to reverse a string without using slicing.", "score": 3, "output": ""} | |
| {"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/"} | |
| {"idx": 18, "prompt": "Write a Python function to find the longest common subsequence of two strings.", "score": 3, "output": ""} | |
| {"idx": 19, "prompt": "Write a Python function to check if two strings are anagrams.", "score": 3, "output": ""} | |
| {"idx": 20, "prompt": "Implement a function to perform basic string compression.", "score": 3, "output": ""} | |
| {"idx": 21, "prompt": "Write a Python function to merge two sorted lists into one sorted list.", "score": 3, "output": ""} | |
| {"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<"} | |
| {"idx": 23, "prompt": "Write a Python function to rotate a list by k positions.", "score": 3, "output": ""} | |
| {"idx": 24, "prompt": "Write a Python function to find the median of two sorted arrays.", "score": 3, "output": ""} | |
| {"idx": 25, "prompt": "Write a Python function to remove duplicates from a sorted list in-place.", "score": 3, "output": ""} | |
| {"idx": 26, "prompt": "Write a Python function to find the intersection of two lists.", "score": 3, "output": ""} | |
| {"idx": 27, "prompt": "Write a Python function to perform depth-first search on a graph.", "score": 3, "output": ""} | |
| {"idx": 28, "prompt": "Write a Python function to perform breadth-first search on a graph.", "score": 3, "output": ""} | |
| {"idx": 29, "prompt": "Write a Python function to check if a binary tree is balanced.", "score": 3, "output": ""} | |
| {"idx": 30, "prompt": "Write a Python function to find the diameter of a binary tree.", "score": 3, "output": ""} | |
| {"idx": 31, "prompt": "Write a Python function to solve the 0/1 knapsack problem.", "score": 3, "output": ""} | |
| {"idx": 32, "prompt": "Write a Python function to count the number of ways to climb n stairs.", "score": 3, "output": ""} | |
| {"idx": 33, "prompt": "Write a Python function to find the longest increasing subsequence.", "score": 0, "output": "</think>"} | |
| {"idx": 34, "prompt": "Write a Python function to find the minimum edit distance between two strings.", "score": 3, "output": ""} | |
| {"idx": 35, "prompt": "Write a Python function to calculate x raised to n efficiently.", "score": 3, "output": ""} | |
| {"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<"} | |
| {"idx": 37, "prompt": "Write a Python function to convert a Roman numeral to an integer.", "score": 0, "output": "/"} | |
| {"idx": 38, "prompt": "Write a Python function to generate Pascal's triangle up to n rows.", "score": 3, "output": ""} | |
| {"idx": 39, "prompt": "Write a Python function to read a CSV file and return a list of dictionaries.", "score": 3, "output": ""} | |
| {"idx": 40, "prompt": "Write a Python function to write a list of dictionaries to a JSON file.", "score": 3, "output": ""} | |
| {"idx": 41, "prompt": "Write a Python function to count the number of lines in a text file.", "score": 3, "output": ""} | |
| {"idx": 42, "prompt": "Implement merge sort in Python.", "score": 0, "output": "<"} | |
| {"idx": 43, "prompt": "Implement heap sort in Python.", "score": 0, "output": "<"} | |
| {"idx": 44, "prompt": "Write a Python function to find the kth largest element in an unsorted list.", "score": 3, "output": ""} | |
| {"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..."} | |
| {"idx": 46, "prompt": "Write a Python function to flatten a nested list of arbitrary depth.", "score": 3, "output": ""} | |
| {"idx": 47, "prompt": "Write a Python function to deep clone a dictionary.", "score": 3, "output": ""} | |
| {"idx": 48, "prompt": "Write a Python class that implements a simple token bucket rate limiter.", "score": 3, "output": ""} | |
| {"idx": 49, "prompt": "Write a Python context manager for creating and cleaning up a temporary file.", "score": 0, "output": "</think>"} | |
| {"idx": 50, "prompt": "Write a Python function to validate whether a Sudoku board is valid.", "score": 3, "output": ""} | |