Instructions to use XsoraS/NeyabAI-GPT2_version with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use XsoraS/NeyabAI-GPT2_version with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="XsoraS/NeyabAI-GPT2_version")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("XsoraS/NeyabAI-GPT2_version") model = AutoModelForCausalLM.from_pretrained("XsoraS/NeyabAI-GPT2_version", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use XsoraS/NeyabAI-GPT2_version with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "XsoraS/NeyabAI-GPT2_version" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "XsoraS/NeyabAI-GPT2_version", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/XsoraS/NeyabAI-GPT2_version
- SGLang
How to use XsoraS/NeyabAI-GPT2_version with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "XsoraS/NeyabAI-GPT2_version" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "XsoraS/NeyabAI-GPT2_version", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "XsoraS/NeyabAI-GPT2_version" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "XsoraS/NeyabAI-GPT2_version", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use XsoraS/NeyabAI-GPT2_version with Docker Model Runner:
docker model run hf.co/XsoraS/NeyabAI-GPT2_version
Commit History
-
Update README.md
Verified signatureea062f0 -
Update README.md
Verified signaturee3b8995 -
Update README.md
Verified signature839d517 -
Update README.md
Verified signaturead93a84 -
Update README.md
Verified signature260c0c1 -
readme updates.
Verified signature557dda3 -
updated reads.
Verified signature# Using NeyabAI: \n\n\n\n # Fine-Tuning GPT-2 on Custom Dataset: This repository demonstrates how to fine-tune the GPT-2 language model on a custom dataset using PyTorch and Hugging Face's Transformers library. The code provides an end-to-end example, from loading the dataset to training the model and evaluating its performance. ## Requirements - Python 3.6+ - PyTorch - Transformers (Hugging Face) - NumPy You can install the required packages using pip: ```bash pip install torch transformers numpy ``` ## Fine-Tuning Script The following script outlines the steps for fine-tuning GPT-2 on a custom dataset: ```python from transformers import GPT2LMHeadModel, GPT2TokenizerFast, AdamW import torch from torch.utils.data import DataLoader, TensorDataset import numpy as np # Load pre-trained model and tokenizer model_name = "XsoraS/NeyabAI" model = GPT2LMHeadModel.from_pretrained(model_name) tokenizer = GPT2TokenizerFast.from_pretrained(model_name) tokenizer.pad_token = tokenizer.eos_…d93134c -
Update README.md
Verified signature# GPT-2 Based Chatbot (NeyabAI) This repository demonstrates how to fine-tune the GPT-2 language model on a custom dataset using PyTorch and Hugging Face's Transformers library. The code provides an end-to-end example, from loading the dataset to training the model and evaluating its performance. ## Requirements - Python 3.6+ - PyTorch - Transformers (Hugging Face) - NumPy You can install the required packages using pip: ```bash pip install torch transformers numpy ``` ## Fine-Tuning Script The following script outlines the steps for fine-tuning NeyabAI on a custom dataset: ```python from transformers import GPT2LMHeadModel, GPT2TokenizerFast, AdamW import torch from torch.utils.data import DataLoader, TensorDataset import numpy as np # Load pre-trained model and tokenizer model_name = "gpt2" model = GPT2LMHeadModel.from_pretrained(model_name) tokenizer = GPT2TokenizerFast.from_pretrained(model_name) tokenizer.pad_token = tokenizer.eos_token # Example dataset dataset = ["Your…492928c -
Upload 8 files
Verified signature1322fa9 -
initial commit
Verified signaturef53947e