B R M v1 llama8b

BRMAI

Introduction

BuddhismModel is an innovative Large Language Model (LLM) that combines modern AI technology with ancient Buddhist wisdom. It is designed to provide personalized spiritual guidance and ethical insights, helping users develop mindfulness and empathy. The model facilitates individual spiritual growth and community well-being through simulated dharma discussions.

Architecture

The model is based on the Llama-3 architecture and is fine-tuned from the Meta-Llama-3-8B-Instruct model. It primarily operates in English and is trained to simulate Buddhist role-play scenarios.

Training

BuddhismModel is trained on a dataset comprising 160,000 instructions derived from 77,000 Buddhist sayings. It was fine-tuned on December 4, 2024, using the Base Meta-Llama-3-8B-Instruct model parameters.

Guide: Running Locally

To run BuddhismModel locally, follow these steps:

  1. Set Up Environment: Ensure Python and PyTorch are installed. Install the transformers library from Hugging Face.
  2. Log In: Use your Hugging Face access token to log in.
    from huggingface_hub import login
    login(token="your_huggingface_access_token")
    
  3. Load Model and Tokenizer:
    from transformers import AutoTokenizer, AutoModelForCausalLM
    model_name = "olmairesearch/olm-v1.0-8b"
    tokenizer = AutoTokenizer.from_pretrained(model_name, token=True)
    model = AutoModelForCausalLM.from_pretrained(model_name, torch_dtype="auto", device_map="auto", token=True)
    
  4. Run Inference: Use the model to generate responses to user inputs.
    def call_Buddhism(model, tokenizer, history, input_):
        context = ""
        for role, message in history:
            context += f"{role}: {message}\n"
        context += f"user: {input_}\nassistant:"
        inputs = tokenizer(context, return_tensors="pt", truncation=True)
        inputs = inputs.to("cuda" if torch.cuda.is_available() else "cpu")
        outputs = model.generate(**inputs, max_new_tokens=256, eos_token_id=tokenizer.eos_token_id, do_sample=True, temperature=0.6, top_p=0.9)
        generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
        response = generated_text[len(context):].strip()
        return response
    
  5. Cloud GPUs: For enhanced performance, consider using cloud GPUs from providers like AWS, Google Cloud, or Azure.

License

The model is available under a license provided by Hugging Face. Users should review and comply with the terms specified in the repository.

More Related APIs in Text Generation