From 96fa2b04f31926d7cc82d63e1df263901eb2d7c1 Mon Sep 17 00:00:00 2001 From: ModelHub XC Date: Tue, 14 Jul 2026 22:23:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=EF=BC=8C=E7=94=B1ModelHub=20XC=E7=A4=BE=E5=8C=BA=E6=8F=90?= =?UTF-8?q?=E4=BE=9B=E6=A8=A1=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Model: prithivMLmods/Codepy-Deepthink-3B-GGUF Source: Original Platform --- .gitattributes | 40 +++++++++ Codepy-3B.F16.gguf | 3 + Codepy-3B.Q4_K_M.gguf | 3 + Codepy-3B.Q5_K_M.gguf | 3 + Codepy-3B.Q8_0.gguf | 3 + Modelfile | 56 ++++++++++++ README.md | 200 ++++++++++++++++++++++++++++++++++++++++++ config.json | 3 + configuration.json | 1 + 9 files changed, 312 insertions(+) create mode 100644 .gitattributes create mode 100644 Codepy-3B.F16.gguf create mode 100644 Codepy-3B.Q4_K_M.gguf create mode 100644 Codepy-3B.Q5_K_M.gguf create mode 100644 Codepy-3B.Q8_0.gguf create mode 100644 Modelfile create mode 100644 README.md create mode 100644 config.json create mode 100644 configuration.json diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9ac9e57 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,40 @@ +*.7z filter=lfs diff=lfs merge=lfs -text +*.arrow filter=lfs diff=lfs merge=lfs -text +*.bin filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.ckpt filter=lfs diff=lfs merge=lfs -text +*.ftz filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.h5 filter=lfs diff=lfs merge=lfs -text +*.joblib filter=lfs diff=lfs merge=lfs -text +*.lfs.* filter=lfs diff=lfs merge=lfs -text +*.mlmodel filter=lfs diff=lfs merge=lfs -text +*.model filter=lfs diff=lfs merge=lfs -text +*.msgpack filter=lfs diff=lfs merge=lfs -text +*.npy filter=lfs diff=lfs merge=lfs -text +*.npz filter=lfs diff=lfs merge=lfs -text +*.onnx filter=lfs diff=lfs merge=lfs -text +*.ot filter=lfs diff=lfs merge=lfs -text +*.parquet filter=lfs diff=lfs merge=lfs -text +*.pb filter=lfs diff=lfs merge=lfs -text +*.pickle filter=lfs diff=lfs merge=lfs -text +*.pkl filter=lfs diff=lfs merge=lfs -text +*.pt filter=lfs diff=lfs merge=lfs -text +*.pth filter=lfs diff=lfs merge=lfs -text +*.rar filter=lfs diff=lfs merge=lfs -text +*.safetensors filter=lfs diff=lfs merge=lfs -text +saved_model/**/* filter=lfs diff=lfs merge=lfs -text +*.tar.* filter=lfs diff=lfs merge=lfs -text +*.tar filter=lfs diff=lfs merge=lfs -text +*.tflite filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.wasm filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text +*tfevents* filter=lfs diff=lfs merge=lfs -text +Codepy-3B.F16.gguf filter=lfs diff=lfs merge=lfs -text +Codepy-3B.Q4_K_M.gguf filter=lfs diff=lfs merge=lfs -text +Codepy-3B.Q5_K_M.gguf filter=lfs diff=lfs merge=lfs -text +Codepy-3B.Q8_0.gguf filter=lfs diff=lfs merge=lfs -text +others/demo-lm-studio-codepy-deepthink.mp4 filter=lfs diff=lfs merge=lfs -text diff --git a/Codepy-3B.F16.gguf b/Codepy-3B.F16.gguf new file mode 100644 index 0000000..0cb22f2 --- /dev/null +++ b/Codepy-3B.F16.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c62e6e8c421e9c478c42e76ad69154c4c4a809d19af182fdd46759db389e65ed +size 6433688384 diff --git a/Codepy-3B.Q4_K_M.gguf b/Codepy-3B.Q4_K_M.gguf new file mode 100644 index 0000000..6ab52cf --- /dev/null +++ b/Codepy-3B.Q4_K_M.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e71b6b804b395e5e3e62b828902c600cb7131bc6095d8bcf12017b2120bebe2 +size 2019377984 diff --git a/Codepy-3B.Q5_K_M.gguf b/Codepy-3B.Q5_K_M.gguf new file mode 100644 index 0000000..7d08a6d --- /dev/null +++ b/Codepy-3B.Q5_K_M.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b7c4897af59460ae819253e3d08b2b1a4ed4ce44cafb9a8b4fc760364b110f95 +size 2322154304 diff --git a/Codepy-3B.Q8_0.gguf b/Codepy-3B.Q8_0.gguf new file mode 100644 index 0000000..4bd6f4c --- /dev/null +++ b/Codepy-3B.Q8_0.gguf @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:967fbe6f7a783c90ed5312807a942e23adfa25ed408975768d2df8f4cc0d0f8b +size 3421899584 diff --git a/Modelfile b/Modelfile new file mode 100644 index 0000000..33fab2f --- /dev/null +++ b/Modelfile @@ -0,0 +1,56 @@ +FROM /content/prithivMLmods/Codepy-Deepthink-3B-GGUF/Codepy-3B.F16.gguf +TEMPLATE """{{ if .Messages }} +{{- if or .System .Tools }}<|start_header_id|>system<|end_header_id|> +{{- if .System }} + +{{ .System }} +{{- end }} +{{- if .Tools }} + +You are a helpful assistant with tool calling capabilities. When you receive a tool call response, use the output to format an answer to the original use question. +{{- end }} +{{- end }}<|eot_id|> +{{- range $i, $_ := .Messages }} +{{- $last := eq (len (slice $.Messages $i)) 1 }} +{{- if eq .Role "user" }}<|start_header_id|>user<|end_header_id|> +{{- if and $.Tools $last }} + +Given the following functions, please respond with a JSON for a function call with its proper arguments that best answers the given prompt. + +Respond in the format {"name": function name, "parameters": dictionary of argument name and its value}. Do not use variables. + +{{ $.Tools }} +{{- end }} + +{{ .Content }}<|eot_id|>{{ if $last }}<|start_header_id|>assistant<|end_header_id|> + +{{ end }} +{{- else if eq .Role "assistant" }}<|start_header_id|>assistant<|end_header_id|> +{{- if .ToolCalls }} + +{{- range .ToolCalls }}{"name": "{{ .Function.Name }}", "parameters": {{ .Function.Arguments }}}{{ end }} +{{- else }} + +{{ .Content }}{{ if not $last }}<|eot_id|>{{ end }} +{{- end }} +{{- else if eq .Role "tool" }}<|start_header_id|>ipython<|end_header_id|> + +{{ .Content }}<|eot_id|>{{ if $last }}<|start_header_id|>assistant<|end_header_id|> + +{{ end }} +{{- end }} +{{- end }} +{{- else }} +{{- if .System }}<|start_header_id|>system<|end_header_id|> + +{{ .System }}<|eot_id|>{{ end }}{{ if .Prompt }}<|start_header_id|>user<|end_header_id|> + +{{ .Prompt }}<|eot_id|>{{ end }}<|start_header_id|>assistant<|end_header_id|> + +{{ end }}{{ .Response }}{{ if .Response }}<|eot_id|>{{ end }}""" +PARAMETER stop "<|start_header_id|>" +PARAMETER stop "<|end_header_id|>" +PARAMETER stop "<|eot_id|>" +PARAMETER stop "<|eom_id|>" +PARAMETER temperature 1.5 +PARAMETER min_p 0.1 \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..133dfa2 --- /dev/null +++ b/README.md @@ -0,0 +1,200 @@ +--- +license: creativeml-openrail-m +language: +- en +base_model: +- prithivMLmods/Codepy-Deepthink-3B +pipeline_tag: text-generation +library_name: transformers +tags: +- Codepy +- Deep-Think +- Ollama +--- + +# **Codepy 3B Deep Think GGUF Model File** + +The **Codepy 3B Deep Think GGUF Model** is a fine-tuned version of the **meta-llama/Llama-3.2-3B-Instruct** base model, designed for text generation tasks that require deep reasoning, logical structuring, and problem-solving. This model leverages its optimized architecture to provide accurate and contextually relevant outputs for complex queries, making it ideal for applications in education, programming, and creative writing. + +With its robust natural language processing capabilities, **Codepy 3B Deep Think GGUF** excels in generating step-by-step solutions, creative content, and logical analyses. Its architecture integrates advanced understanding of both structured and unstructured data, ensuring precise text generation aligned with user inputs. + +| **File Name** | **Size** | **Description** | **Upload Status** | +|--------------------------------|----------------|--------------------------------------------------|-------------------| +| `.gitattributes` | 1.75 kB | Git LFS configuration for large files. | Uploaded | +| `Codepy-3B.F16.gguf` | 6.43 GB | Full-precision (FP16) weights in GGUF format. | Uploaded (LFS) | +| `Codepy-3B.Q4_K_M.gguf` | 2.02 GB | Quantized weights (Q4_K_M) in GGUF format. | Uploaded (LFS) | +| `Codepy-3B.Q5_K_M.gguf` | 2.32 GB | Quantized weights (Q5_K_M) in GGUF format. | Uploaded (LFS) | +| `Codepy-3B.Q8_0.gguf` | 3.42 GB | Quantized weights (Q8_0) in GGUF format. | Uploaded (LFS) | +| `Modelfile` | 1.96 kB | Updated model information file. | Updated | +| `README.md` | 42 Bytes | Initial README file, currently minimal. | Initial Commit | +| `config.json` | 29 Bytes | Basic configuration placeholder. | Uploaded | + +# **Run with LM Studio** + +| Feature Run | Details | +|--------------------------|-----------------------------------------------------------------------------------------------| +| **Run with LM Studio** | https://lmstudio.ai/ | +| **Demo on LM Studio** | https://drive.google.com/file/d/1CHdfjYrwMnk9ACvS40Abfy3xNXnCubKG/view?usp=sharing | + +--- +# **Sample Deepthink Inference** + +>>> Develop a Python program to generate random passwords that consist of 8 characters. Not applicable +```markdown +# Random Password Generator + +This Python program generates a random password of a specified length (default: 8 characters) that includes a mix of lowercase letters, uppercase letters, digits, and spaces. The program ensures the generated password meets basic security requirements while maintaining simplicity. + +## Features +- Generates alphanumeric passwords with optional spaces. +- Ensures at least one lowercase letter, one uppercase letter, one digit, and one space in the password. +- Shuffles the characters to randomize the order. +- Includes error handling for invalid input lengths. + +## Requirements +- Python 3.x + +## Usage +1. Clone or download this repository. +2. Run the script using Python: + + ```bash + python password_generator.py + ``` + +3. The script will generate and print an 8-character random password to the console. + +## Code + +```python +import random + +def generate_password(length): + """ + Generates a random alphanumeric password of the specified length. + + Ensures that at least one lowercase letter, one uppercase letter, + one digit, and one space are included in the password. + + Args: + length: The number of characters in the password. + + Returns: + A string representing the generated password or None if the input is invalid. + """ + + # Define a set of alphanumeric characters with spaces + characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ' + + # Validate the length + if length < 1: + return None + + # Handle invalid length + if length > len(characters): + print("Invalid password length. It should be less than or equal to", len(characters)) + return None + + # Ensure at least one character from each required group + required_characters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ' + if length > 1: + password_length_without_requirements = length - 4 + random_string = ''.join(random.choice(required_characters) for _ in range(password_length_without_requirements)) + + # Fill the rest of the password with random characters + remaining_chars_needed = length - len(random_string) + all_possible_chars = list(characters) + if length > 1: + random_character = random.choice('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ') + else: + random_character = random.choice('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ') + + password = random_string + random_character * remaining_chars_needed + + # Shuffle the password to avoid predictable patterns + password_list = list(password) + random.shuffle(password_list) + password = ''.join(password_list) + + return password + +# Example Usage +password_length = 8 +generated_password = generate_password(password_length) + +if generated_password is not None: + print(f"Generated Password: {generated_password}") +else: + print("Failed to generate a password. Please ensure the length is valid (between 1 and", len(characters), ").") +``` + +## Example Output +``` +Generated Password: g7x 2PqA +``` + +## Customization +To customize the password length, modify the `password_length` variable in the script. + +## Security Notes +- This implementation uses Python's `random` module, which is suitable for general-purpose randomness. For cryptographically secure passwords, consider using the `secrets` module. +- The character set includes spaces for additional complexity, but you can modify the `characters` string to include other symbols (e.g., `!@#$%^&*`). + +--- +# **Model Architecture:** + + Llama 3.2 is an auto-regressive language model that uses an optimized transformer architecture. The tuned versions use supervised fine-tuning (SFT) and reinforcement learning with human feedback (RLHF) to align with human preferences for helpfulness and safety. + +# **Run with Ollama [ Ollama Run ]** + +Ollama simplifies running machine learning models. This guide walks you through downloading, installing, and running GGUF models in minutes. + +## Table of Contents + +- [Download and Install](#download-and-install) +- [Run GGUF Models](#run-gguf-models) +- [Running the Model](#running-the-model) +- [Sample Usage](#sample-usage) + +## Download and Install + +Download Ollama from [https://ollama.com/download](https://ollama.com/download) and install it on your Windows or Mac system. + +## Run GGUF Models + +1. **Create the Model File** + Create a model file, e.g., `metallama`. + +2. **Add the Template Command** + Include a `FROM` line in the file to specify the base model: + ```bash + FROM Llama-3.2-1B.F16.gguf + ``` + +3. **Create and Patch the Model** + Run the following command: + ```bash + ollama create metallama -f ./metallama + ``` + Verify the model with: + ```bash + ollama list + ``` + +## Running the Model + +Run your model with: +```bash +ollama run metallama +``` + +### Sample Usage + +Interact with the model: +```plaintext +>>> write a mini passage about space x +Space X, the private aerospace company founded by Elon Musk, is revolutionizing the field of space exploration... +``` + +--- +With these steps, you can easily run custom models using Ollama. Adjust as needed for your specific use case. \ No newline at end of file diff --git a/config.json b/config.json new file mode 100644 index 0000000..a4ba21b --- /dev/null +++ b/config.json @@ -0,0 +1,3 @@ +{ + "model_type": "llama" +} \ No newline at end of file diff --git a/configuration.json b/configuration.json new file mode 100644 index 0000000..bbeeda1 --- /dev/null +++ b/configuration.json @@ -0,0 +1 @@ +{"framework": "pytorch", "task": "text-generation", "allow_remote": true} \ No newline at end of file