Instructions to use Manikanta21/OceanGPT-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use Manikanta21/OceanGPT-v1 with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("zjunlp/OceanGPT-basic-7B-v0.1") model = PeftModel.from_pretrained(base_model, "Manikanta21/OceanGPT-v1") - Notebooks
- Google Colab
- Kaggle
| base_model: zjunlp/OceanGPT-basic-7B-v0.1 | |
| library_name: peft | |
| pipeline_tag: text-generation | |
| tags: | |
| - base_model:adapter:zjunlp/OceanGPT-basic-7B-v0.1 | |
| - lora | |
| - peft | |
| license: apache-2.0 | |
| # Model Card for Model ID | |
| <!-- Provide a quick summary of what the model is/does. --> | |
| ## Model Details | |
| ### Model Description | |
| <!-- Provide a longer summary of what this model is. --> | |
| - **Developed by:** Developed by Viswanadhapalli Manikanta, an aspiring AI/ML engineer focused on LLM fine-tuning, cloud technologies, and software development. | |
| - **Funded by :** Personal learning and research initiative, self funded using the kaggle free GPU | |
| - **Shared by :** Viswanadhapalli via HuggingFace Hub | |
| - **Model type:** Parameter-Efficient Fine-Tuned (PEFT) Large Language Model using LoRA adapters. | |
| ### Model Sources [optional] | |
| <!-- Provide the basic links for the model. --> | |
| - **Repository:** Repository: https://huggingface.co/Manikanta21/OceanGPT-v1 | |
| - | |
| ## Uses | |
| <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. --> | |
| This model is intended for educational, research, and conversational AI applications. It is designed to assist users with instruction-following tasks, technical question answering, coding-related discussions, and general natural language understanding. | |
| The model is suitable for: | |
| - AI/ML experimentation | |
| - Educational assistance | |
| - Conversational applications | |
| - NLP research and development | |
| - Developer productivity workflows | |
| Foreseeable users include: | |
| - Students | |
| - Developers | |
| - Researchers | |
| - AI enthusiasts | |
| - Software engineers | |
| ## How to Get Started with the Model | |
| This model is designed for oceanographic and marine-related natural language processing tasks, including intent detection, marine data interpretation, and domain-specific conversational assistance. | |
| ### 1. Install Required Libraries | |
| ```bash | |
| pip install transformers peft accelerate torch | |
| ``` | |
| --- | |
| ### 2. Load the Model | |
| ```python | |
| from transformers import AutoTokenizer, AutoModelForCausalLM | |
| from peft import PeftModel | |
| import torch | |
| # Base model | |
| base_model_name = "OceanGPT-v1" | |
| # LoRA adapter repository | |
| adapter_model_name = "Manikanta21/OceanGPT-v1" | |
| # Load tokenizer | |
| tokenizer = AutoTokenizer.from_pretrained(adapter_model_name) | |
| # Load base model | |
| base_model = AutoModelForCausalLM.from_pretrained( | |
| base_model_name, | |
| torch_dtype=torch.float16, | |
| device_map="auto" | |
| ) | |
| # Load PEFT adapter | |
| model = PeftModel.from_pretrained( | |
| base_model, | |
| adapter_model_name | |
| ) | |
| model.eval() | |
| ``` | |
| --- | |
| ### 3. Example Inference | |
| ```python | |
| prompt = "Explain the impact of ocean temperature changes on marine ecosystems." | |
| inputs = tokenizer( | |
| prompt, | |
| return_tensors="pt" | |
| ).to(model.device) | |
| with torch.no_grad(): | |
| outputs = model.generate( | |
| **inputs, | |
| max_new_tokens=150, | |
| temperature=0.7, | |
| do_sample=True | |
| ) | |
| response = tokenizer.decode( | |
| outputs[0], | |
| skip_special_tokens=True | |
| ) | |
| print(response) | |
| ``` | |
| --- | |
| ### Results | |
| The fine-tuned model demonstrated improved understanding of oceanographic terminology and marine-domain conversational tasks compared to the untuned base model. | |
| The model generated more contextually relevant and domain-aware responses for ocean science prompts and intent-based queries. | |
| --- | |
| #### Summary | |
| The model successfully adapts a pretrained language model toward oceanographic NLP applications using PEFT/LoRA fine-tuning. It performs well for educational, conversational, and research-oriented marine-domain tasks while maintaining lightweight adapter-based deployment efficiency. | |
| ## Technical Specifications | |
| #### Hardware | |
| - NVIDIA GPU provided through Kaggle environment | |
| - CUDA-enabled acceleration | |
| - GPU memory optimized using fp16 mixed precision training | |
| --- | |
| #### Software | |
| - Python | |
| - PyTorch | |
| - Hugging Face Transformers | |
| - PEFT | |
| - Accelerate | |
| - Hugging Face Hub | |
| --- | |
| ## Glossary | |
| ## Glossary | |
| - **LLM (Large Language Model):** A transformer-based AI model trained on large-scale text data for natural language understanding and generation. | |
| - **PEFT (Parameter-Efficient Fine-Tuning):** A fine-tuning approach that updates only a small subset of model parameters instead of retraining the entire model. | |
| - **LoRA (Low-Rank Adaptation):** A PEFT technique used to efficiently adapt pretrained language models with lower computational and memory requirements. | |
| - **Transformers:** A deep learning architecture widely used in NLP tasks. This project uses the Hugging Face Transformers library for model loading, tokenization, and inference. | |
| - **Hugging Face Transformers:** An open-source Python library that provides pretrained transformer models and tools for NLP, text generation, and fine-tuning workflows. | |
| - **BitsAndBytes:** A library used for low-bit quantization and memory-efficient loading/training of large language models, commonly used for 4-bit and 8-bit optimization. | |
| - **Safetensors:** A secure and efficient tensor storage format designed for safely saving and loading model weights without arbitrary code execution risks. | |
| - **`.pt` Files:** PyTorch checkpoint files commonly used to store model weights, optimizer states, or training checkpoints. | |
| - **`.pth` Files:** PyTorch serialized files used for saving model parameters, random states, or checkpoints during training. | |
| - **Training Arguments:** Configuration parameters used during training such as learning rate, batch size, epochs, optimizer settings, and mixed precision settings. | |
| - **Tokenizer:** A component that converts raw text into token IDs understandable by transformer models. | |
| - **NLP (Natural Language Processing):** A field of AI focused on understanding and processing human language. | |
| - **Oceanographic Intent:** The classification or understanding of marine and ocean-related user queries and instructions. | |
| - **Inference:** The process of generating predictions or responses using a trained model. | |
| --- | |
| ## Model Card Authors | |
| - Viswanadhapalli Manikanta | |
| --- | |
| ## Model Card Contact | |
| - Hugging Face: https://huggingface.co/Manikanta21 | |
| - LinkedIn: https://www.linkedin.com/in/manikanta-viswanadhapalli-b32547311/ | |
| --- | |
| ### Framework versions | |
| - PEFT 0.19.1 | |
| - Transformers | |
| - PyTorch | |
| - Accelerate |