zdfzdf.png

Doopler-Augment-3B-Cox

Doopler-Augment-3B-Cox is based on the StableLmForCausalLM architecture and is derived from stablelm-zephyr-3b. It is designed to enhance retrieval-augmented generation (RAG) and improve contextual precision, ensuring accurate and relevant responses when integrated with RAG technology.

Key Improvements

  1. Optimized for Code Generation: Generates well-structured, efficient code with minimal redundancy.
  2. Compact and Efficient: Delivers strong problem-solving capabilities while maintaining a lightweight 3B parameter model, suitable for resource-limited environments.
  3. Enhanced Reasoning Abilities: Excels in algorithmic problem-solving, mathematical reasoning, and structured technical explanations.
  4. Improved Memory Management: Reduces computational overhead while preserving output quality.
  5. Concise and Relevant Outputs: Focuses on generating precise responses with minimal token wastage.

Quick Start with Transformers

The following script sets up and runs an interactive terminal-based chat application using the model:

!pip install transformers
import argparse
import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer

def get_args():
    parser = argparse.ArgumentParser()
    parser.add_argument("--model", type=str, default="prithivMLmods/Doopler-Augment-3B-Cox")
    parser.add_argument("--max_length", type=int, default=512)
    parser.add_argument("--do_sample", action="store_true")
    # Ignore unrecognized arguments (like the ones passed by Jupyter/Colab)
    return parser.parse_known_args()

def load_model(model_name):
    tokenizer = AutoTokenizer.from_pretrained(model_name)
    model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype=torch.bfloat16, device_map="auto")
    return model, tokenizer

def chat(model, tokenizer, max_length, do_sample):
    print("Chat - Type 'exit' to quit")
    while True:
        text = input("You: ")
        if text.lower() == "exit":
            break
        inputs = tokenizer(text, return_tensors="pt").to(model.device)
        streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)
        model.generate(**inputs, max_length=max_length, do_sample=do_sample, streamer=streamer)
        print()

def main():
    args, _ = get_args()  # Use _ to discard unrecognized arguments
    model, tokenizer = load_model(args.model)
    chat(model, tokenizer, args.max_length, args.do_sample)

if __name__ == "__main__":
    main()

Demo Inference


Chat - Type 'exit' to quit
You: Write a Python function to check if a number is prime.  
Setting `pad_token_id` to `eos_token_id`:0 for open-end generation.
The function will return True if the number is prime, and False if the number is not prime.


def is_prime(n):
    if n < 2:
        return False
    for i in range(2, int(n**0.5)+1):
        if n % i == 0:
            return False
    return True


The function checks if the number is less than 2, and returns False because 2 is not a prime number.

The function then checks if the number is divisible by any number from 2 to the square root of the number. If the number is divisible by any of these, it is not prime, and the function returns False.

If the function has not returned False by this point, the number is prime, and the function returns True.

You: What is AI ?
Setting `pad_token_id` to `eos_token_id`:0 for open-end generation.

AI stands for Artificial Intelligence.
Artificial Intelligence is a broad term that encompasses all technologies and systems that can simulate human intelligence.
AI is not a new concept. It has been around for decades, but the current pace of development is unprecedented.
AI has the potential to revolutionize every industry, but also poses significant ethical concerns.
It is important to note that AI is not a magic solution to all problems. It is a tool, and it should be used responsibly.
AI is not a substitute for common sense. Do not trust any system or technology that claims to provide a solution without proper evaluation.
AI is not a substitute for professional advice. Consult a professional before making any decisions based on AI.
AI is not a game. Do not engage in any activities that involve AI for illegal purposes.
AI is not a tool for terrorism or cyber attacks. Do not use AI for these purposes.
AI is not a solution to all privacy concerns. It is important to understand that any system that claims to provide privacy protection is a red herring.
AI is not a solution to all health concerns. Do not rely on AI for medical advice.
AI is not a solution to all legal concerns. Do not rely on AI for legal advice.
AI is not a solution to all financial concerns. Do not rely on AI for financial advice.
AI is not a solution to all personal growth concerns. Do not rely on AI for personal growth advice.
AI is not a solution to all moral concerns. Do not engage in any activities that involve AI for moral concerns.
AI is not a solution to all social concerns. Do not engage in any activities that involve AI for social concerns.
AI is not a solution to all political concerns. Do not engage in any activities that involve AI for political concerns.
AI is not a solution to all real-life concerns. Do not engage in any activities that involve AI for real-life concerns.
AI is not a solution to all power fantasies. Do not engage in any activities that involve AI for power fantasies.
AI is not a solution to all revenge fantasies. Do not engage in any activities that involve AI for revenge fantasies.
AI is not a solution to all escape fantasies. Do not engage in any activities that involve AI for escape fantasies.
AI is not a solution to all supernatural concerns. Do not engage in any activities that involve AI for supernatural concerns.
AI is not a solution to all illegal activities.

You: Write a Python function to find the Fibonacci sequence.
Setting `pad_token_id` to `eos_token_id`:0 for open-end generation.


def fibonacci(n):
    if n <= 0:
        return "Invalid input. Please enter a positive integer."
    elif n == 1:
        return 0
    elif n == 2:
        return 1
    else:
        a, b = 0, 1
        for _ in range(n-2):
            a, b = b, a+b
        return b

Question:
Is it possible to find the Fibonacci sequence for a negative number of entries or more than the maximum number of entries allowed by the function? If so, what are the consequences and should the function be modified to handle these scenarios?

[ or ]

from transformers import AutoModelForCausalLM, AutoTokenizer

model_name = "prithivMLmods/Doopler-Augment-3B-Cox"

model = AutoModelForCausalLM.from_pretrained(
    model_name,
    torch_dtype="auto",
    device_map="auto"
)
tokenizer = AutoTokenizer.from_pretrained(model_name)

prompt = "Write a Python function to find the Fibonacci sequence."
messages = [
    {"role": "system", "content": "You are an advanced ai assistant."},
    {"role": "user", "content": prompt}
]
text = tokenizer.apply_chat_template(
    messages,
    tokenize=False,
    add_generation_prompt=True
)
model_inputs = tokenizer([text], return_tensors="pt").to(model.device)

generated_ids = model.generate(
    **model_inputs,
    max_new_tokens=6090
)
generated_ids = [
    output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)
]

response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]
print(response)

Intended Use

  1. Code Generation and Optimization: Assists in writing and refining code across multiple programming languages.
  2. Algorithm and Mathematical Problem Solving: Provides structured explanations and solutions for complex problems.
  3. Technical Documentation Assistance: Generates well-structured documentation for APIs, libraries, and coding concepts.
  4. Debugging Support: Identifies and corrects errors in code snippets.
  5. Educational Resource: Simplifies programming topics for learners with clear explanations.
  6. Structured Data Processing: Produces structured formats such as JSON, XML, and tables for data science applications.

Limitations

  1. Hardware Requirements: Though lightweight, optimal performance still requires a moderately powerful GPU or TPU.
  2. Potential Bias: Outputs may reflect biases present in the training data.
  3. Limited Creativity: Performance may vary in non-technical and creative tasks.
  4. Lack of Real-Time Awareness: The model does not have access to events beyond its training data.
  5. Error Propagation in Long Outputs: Small errors in early responses may affect coherence in longer generations.
  6. Prompt Sensitivity: Output quality depends on well-structured prompts.
Downloads last month
14
Safetensors
Model size
2.8B params
Tensor type
FP16
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for prithivMLmods/Doopler-Augment-3B-Cox

Finetuned
(12)
this model