Instructions to use AhmedZaky1/authorship_model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use AhmedZaky1/authorship_model with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-1.5B-Instruct") model = PeftModel.from_pretrained(base_model, "AhmedZaky1/authorship_model") - Transformers
How to use AhmedZaky1/authorship_model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="AhmedZaky1/authorship_model") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("AhmedZaky1/authorship_model", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use AhmedZaky1/authorship_model with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "AhmedZaky1/authorship_model" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AhmedZaky1/authorship_model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/AhmedZaky1/authorship_model
- SGLang
How to use AhmedZaky1/authorship_model 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 "AhmedZaky1/authorship_model" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AhmedZaky1/authorship_model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "AhmedZaky1/authorship_model" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "AhmedZaky1/authorship_model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use AhmedZaky1/authorship_model with Docker Model Runner:
docker model run hf.co/AhmedZaky1/authorship_model
| library_name: peft | |
| license: apache-2.0 | |
| base_model: Qwen/Qwen2.5-1.5B-Instruct | |
| tags: | |
| - base_model:adapter:Qwen/Qwen2.5-1.5B-Instruct | |
| - llama-factory | |
| - lora | |
| - transformers | |
| pipeline_tag: text-generation | |
| model-index: | |
| - name: authorship_model | |
| results: [] | |
| <!-- This model card has been generated automatically according to the information the Trainer had access to. You | |
| should probably proofread and complete it, then remove this comment. --> | |
| # authorship_model | |
| This model is a fine-tuned version of [Qwen/Qwen2.5-1.5B-Instruct](https://huggingface.co/Qwen/Qwen2.5-1.5B-Instruct) on the authorship_train dataset. | |
| It achieves the following results on the evaluation set: | |
| - Loss: 0.4835 | |
| ## Model description | |
| More information needed | |
| ## Intended uses & limitations | |
| More information needed | |
| ## Training and evaluation data | |
| More information needed | |
| ## Training procedure | |
| ### Training hyperparameters | |
| The following hyperparameters were used during training: | |
| - learning_rate: 5e-05 | |
| - train_batch_size: 1 | |
| - eval_batch_size: 1 | |
| - seed: 42 | |
| - gradient_accumulation_steps: 8 | |
| - total_train_batch_size: 8 | |
| - optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments | |
| - lr_scheduler_type: cosine | |
| - lr_scheduler_warmup_steps: 20 | |
| - num_epochs: 3.0 | |
| - mixed_precision_training: Native AMP | |
| ### Training results | |
| | Training Loss | Epoch | Step | Validation Loss | | |
| |:-------------:|:------:|:-----:|:---------------:| | |
| | 1.3347 | 0.0528 | 500 | 0.6354 | | |
| | 1.3194 | 0.1057 | 1000 | 0.6109 | | |
| | 1.2027 | 0.1585 | 1500 | 0.5906 | | |
| | 1.2360 | 0.2114 | 2000 | 0.5835 | | |
| | 1.2672 | 0.2642 | 2500 | 0.5752 | | |
| | 1.1666 | 0.3171 | 3000 | 0.5580 | | |
| | 1.1543 | 0.3699 | 3500 | 0.5537 | | |
| | 1.1933 | 0.4227 | 4000 | 0.5499 | | |
| | 1.2075 | 0.4756 | 4500 | 0.5418 | | |
| | 1.0687 | 0.5284 | 5000 | 0.5443 | | |
| | 1.0309 | 0.5813 | 5500 | 0.5371 | | |
| | 0.9416 | 0.6341 | 6000 | 0.5339 | | |
| | 1.1705 | 0.6869 | 6500 | 0.5248 | | |
| | 0.9056 | 0.7398 | 7000 | 0.5215 | | |
| | 1.0791 | 0.7926 | 7500 | 0.5182 | | |
| | 1.0082 | 0.8455 | 8000 | 0.5137 | | |
| | 1.1300 | 0.8983 | 8500 | 0.5123 | | |
| | 1.0804 | 0.9512 | 9000 | 0.5095 | | |
| | 0.9295 | 1.0039 | 9500 | 0.5073 | | |
| | 0.9995 | 1.0568 | 10000 | 0.5065 | | |
| | 1.0430 | 1.1096 | 10500 | 0.5050 | | |
| | 1.0754 | 1.1624 | 11000 | 0.5025 | | |
| | 1.0258 | 1.2153 | 11500 | 0.5010 | | |
| | 1.0720 | 1.2681 | 12000 | 0.4990 | | |
| | 1.0141 | 1.3210 | 12500 | 0.4977 | | |
| | 0.9102 | 1.3738 | 13000 | 0.4960 | | |
| | 1.0301 | 1.4266 | 13500 | 0.4951 | | |
| | 0.8990 | 1.4795 | 14000 | 0.4934 | | |
| | 1.0046 | 1.5323 | 14500 | 0.4922 | | |
| | 0.8761 | 1.5852 | 15000 | 0.4909 | | |
| | 1.0435 | 1.6380 | 15500 | 0.4897 | | |
| | 0.9703 | 1.6909 | 16000 | 0.4875 | | |
| | 0.8901 | 1.7437 | 16500 | 0.4857 | | |
| | 0.9523 | 1.7965 | 17000 | 0.4855 | | |
| | 0.9663 | 1.8494 | 17500 | 0.4838 | | |
| | 0.9741 | 1.9022 | 18000 | 0.4831 | | |
| | 0.9686 | 1.9551 | 18500 | 0.4817 | | |
| | 0.8208 | 2.0078 | 19000 | 0.4860 | | |
| | 0.9067 | 2.0607 | 19500 | 0.4867 | | |
| | 0.8943 | 2.1135 | 20000 | 0.4873 | | |
| | 0.9204 | 2.1663 | 20500 | 0.4863 | | |
| | 0.8343 | 2.2192 | 21000 | 0.4863 | | |
| | 0.8542 | 2.2720 | 21500 | 0.4871 | | |
| | 0.9198 | 2.3249 | 22000 | 0.4863 | | |
| | 0.8754 | 2.3777 | 22500 | 0.4859 | | |
| | 0.8645 | 2.4306 | 23000 | 0.4852 | | |
| | 0.8500 | 2.4834 | 23500 | 0.4841 | | |
| | 0.8699 | 2.5362 | 24000 | 0.4842 | | |
| | 0.8449 | 2.5891 | 24500 | 0.4841 | | |
| | 0.8593 | 2.6419 | 25000 | 0.4841 | | |
| | 0.7919 | 2.6948 | 25500 | 0.4837 | | |
| | 0.7707 | 2.7476 | 26000 | 0.4841 | | |
| | 0.8306 | 2.8005 | 26500 | 0.4839 | | |
| | 0.7969 | 2.8533 | 27000 | 0.4837 | | |
| | 0.9231 | 2.9061 | 27500 | 0.4837 | | |
| | 0.9109 | 2.9590 | 28000 | 0.4836 | | |
| ### Framework versions | |
| - PEFT 0.18.1 | |
| - Transformers 5.0.0 | |
| - Pytorch 2.10.0+cu128 | |
| - Datasets 4.0.0 | |
| - Tokenizers 0.22.2 |