Downloads · 30 days
16
13% of all-time downloads
ritvik77/dauji-ai-sales-crm-consultant_v.0.01
dauji-ai-sales-crm-consultant_v.0.01 is a text generation model from ritvik77. Use it when you need the model to write or continue text. The card lists the license as apache-2.0.
This model is a fine-tuned version of Google's Gemma 2B, specialized for sales consultation and CRM advisory services for Dauji.ai platform.
Downloads · 30 days
16
13% of all-time downloads
All-time downloads
119
Public
Parameters
2.6B
5.3 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors5.2 GB · 99%
From the Hugging Face model README
This model is a fine-tuned version of Google's Gemma 2B, specialized for sales consultation and CRM advisory services for Dauji.ai platform.
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
# Check GPU availability
print(f"CUDA available: {torch.cuda.is_available()}")
print(f"GPU device count: {torch.cuda.device_count()}")
if torch.cuda.is_available():
print(f"Current GPU: {torch.cuda.get_device_name(0)}")
# Set device
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
print(f"Using device: {device}")
# Load model and tokenizer
print("Loading tokenizer...")
tokenizer = AutoTokenizer.from_pretrained("ritvik77/dauji-ai-sales-crm-consultant_v.0.01")
print("Loading model...")
model = AutoModelForCausalLM.from_pretrained(
"ritvik77/dauji-ai-sales-crm-consultant_v.0.01",
dtype=torch.float16, # Use half precision to save GPU memory (updated from torch_dtype)
device_map="auto" # Automatically distribute model across available GPUs
)
# Alternative manual GPU placement (use this if device_map="auto" doesn't work)
# model = model.to(device)
print(f"Model device: {next(model.parameters()).device}")
# Consultation prompt template
def dauji_consultation(question):
prompt = '''Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
You are an expert Sales & CRM Consultant for Dauji.ai, the always-on AI Sales Agent platform with deep CRM integration. Focus on measurable business outcomes, CRM optimization, and sales acceleration strategies.
### Input:
{}
### Response:
'''.format(question)
# Tokenize and move inputs to GPU
inputs = tokenizer(prompt, return_tensors="pt").to(device)
# Generate with GPU
with torch.no_grad(): # Save memory during inference
outputs = model.generate(
**inputs,
max_new_tokens=400,
temperature=0.3, # Lower temperature for more focused responses
do_sample=True,
top_k=50,
top_p=0.95,
pad_token_id=tokenizer.eos_token_id,
eos_token_id=tokenizer.eos_token_id,
repetition_penalty=1.15,
no_repeat_ngram_size=3, # Prevent 3-gram repetition
early_stopping=True
)
# Decode only the generated part (excluding input prompt)
input_length = inputs.input_ids.shape[1]
generated_tokens = outputs[0][input_length:]
response = tokenizer.decode(generated_tokens, skip_special_tokens=True)
return response.strip()
# Alternative function with better prompt engineering
def dauji_consultation_v2(question):
prompt = f"""You are Dauji.ai's expert Sales & CRM consultant. Answer the following question with specific, actionable advice about Dauji.ai's capabilities.
Question: {question}
Answer:"""
inputs = tokenizer(prompt, return_tensors="pt").to(device)
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=300,
temperature=0.2, # Very low temperature for consistency
do_sample=False, # Use greedy decoding for more predictable outputs
pad_token_id=tokenizer.eos_token_id,
eos_token_id=tokenizer.eos_token_id,
repetition_penalty=1.2
)
input_length = inputs.input_ids.shape[1]
generated_tokens = outputs[0][input_length:]
response = tokenizer.decode(generated_tokens, skip_special_tokens=True)
return response.strip()
# Debug function to check model behavior
def debug_model_response(question):
prompt = f"Question: {question}\nAnswer:"
print(f"Input prompt: {prompt}")
print("-" * 50)
inputs = tokenizer(prompt, return_tensors="pt").to(device)
print(f"Input token IDs: {inputs.input_ids[0][:20]}...") # First 20 tokens
print(f"Input length: {inputs.input_ids.shape[1]} tokens")
with torch.no_grad():
outputs = model.generate(
**inputs,
max_new_tokens=100,
temperature=0.1,
do_sample=False,
pad_token_id=tokenizer.eos_token_id
)
full_response = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(f"Full response: {full_response}")
return full_response
# Check GPU memory usage
if torch.cuda.is_available():
print(f"GPU memory allocated: {torch.cuda.memory_allocated(0) / 1024**3:.2f} GB")
print(f"GPU memory reserved: {torch.cuda.memory_reserved(0) / 1024**3:.2f} GB")
# Example usage
print("\nGenerating response...")
response = dauji_consultation("How can Dauji.ai improve our CRM conversion rates?")
print("\nResponse:")
print(response)
# Check GPU memory usage after inference
if torch.cuda.is_available():
print(f"\nGPU memory allocated after inference: {torch.cuda.memory_allocated(0) / 1024**3:.2f} GB")
print(f"GPU memory reserved after inference: {torch.cuda.memory_reserved(0) / 1024**3:.2f} GB")
Built on Google's Gemma 2B with LoRA fine-tuning:
This model is designed for professional sales consultation and should be used responsibly:
If you use this model, please cite:
@misc{dauji_ai_consultant_2024,
title={Dauji.ai Sales & CRM Consultant - Gemma 2B},
author={Your Name},
year={2024},
howpublished={Hugging Face Model Hub},
url={https://huggingface.co/ritvik77/dauji-ai-sales-crm-consultant_v.0.01}
}
For questions about this model or Dauji.ai platform consultation, please contact [your contact information].