Instructions to use mrudulajethe/reddit_binary_classification_gemma with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use mrudulajethe/reddit_binary_classification_gemma with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("google/gemma-2-2b") model = PeftModel.from_pretrained(base_model, "mrudulajethe/reddit_binary_classification_gemma") - Transformers
How to use mrudulajethe/reddit_binary_classification_gemma with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="mrudulajethe/reddit_binary_classification_gemma")# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("mrudulajethe/reddit_binary_classification_gemma", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use mrudulajethe/reddit_binary_classification_gemma with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "mrudulajethe/reddit_binary_classification_gemma" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "mrudulajethe/reddit_binary_classification_gemma", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/mrudulajethe/reddit_binary_classification_gemma
- SGLang
How to use mrudulajethe/reddit_binary_classification_gemma 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 "mrudulajethe/reddit_binary_classification_gemma" \ --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": "mrudulajethe/reddit_binary_classification_gemma", "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 "mrudulajethe/reddit_binary_classification_gemma" \ --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": "mrudulajethe/reddit_binary_classification_gemma", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use mrudulajethe/reddit_binary_classification_gemma with Docker Model Runner:
docker model run hf.co/mrudulajethe/reddit_binary_classification_gemma
Download trainer_state.json from mrudulajethe/reddit_binary_classification_gemma: direct link, hf CLI and curl.
- Browser
- Download file 3.9 kB
-
https://huggingface.co/mrudulajethe/reddit_binary_classification_gemma/resolve/main/trainer_state.json
- Command line
-
hf download hf://mrudulajethe/reddit_binary_classification_gemma/trainer_state.json
-
curl -L -o trainer_state.json https://huggingface.co/mrudulajethe/reddit_binary_classification_gemma/resolve/main/trainer_state.json
3.9 kB
| { | |
| "best_global_step": 150, | |
| "best_metric": 0.17474651336669922, | |
| "best_model_checkpoint": "/content/models/gemma_qlora_binary_classification/checkpoint-150", | |
| "epoch": 1.6853932584269664, | |
| "eval_steps": 50, | |
| "global_step": 150, | |
| "is_hyper_param_search": false, | |
| "is_local_process_zero": true, | |
| "is_world_process_zero": true, | |
| "log_history": [ | |
| { | |
| "entropy": 2.4615430653095247, | |
| "epoch": 0.2247191011235955, | |
| "grad_norm": 0.7936930060386658, | |
| "learning_rate": 1.8576779026217232e-05, | |
| "loss": 0.434, | |
| "mean_token_accuracy": 0.8062531106173992, | |
| "num_tokens": 22012.0, | |
| "step": 20 | |
| }, | |
| { | |
| "entropy": 2.2403887450695037, | |
| "epoch": 0.449438202247191, | |
| "grad_norm": 2.4218618869781494, | |
| "learning_rate": 1.707865168539326e-05, | |
| "loss": 0.2021, | |
| "mean_token_accuracy": 0.8750301748514175, | |
| "num_tokens": 44510.0, | |
| "step": 40 | |
| }, | |
| { | |
| "epoch": 0.5617977528089888, | |
| "eval_entropy": 2.2082778811454773, | |
| "eval_loss": 0.20521152019500732, | |
| "eval_mean_token_accuracy": 0.903608671928707, | |
| "eval_num_tokens": 55888.0, | |
| "eval_runtime": 6.5344, | |
| "eval_samples_per_second": 46.523, | |
| "eval_steps_per_second": 5.815, | |
| "step": 50 | |
| }, | |
| { | |
| "entropy": 2.2793353348970413, | |
| "epoch": 0.6741573033707865, | |
| "grad_norm": 2.697873115539551, | |
| "learning_rate": 1.558052434456929e-05, | |
| "loss": 0.1826, | |
| "mean_token_accuracy": 0.9059771433472633, | |
| "num_tokens": 67173.0, | |
| "step": 60 | |
| }, | |
| { | |
| "entropy": 2.196641904115677, | |
| "epoch": 0.898876404494382, | |
| "grad_norm": 1.7290772199630737, | |
| "learning_rate": 1.408239700374532e-05, | |
| "loss": 0.1951, | |
| "mean_token_accuracy": 0.9027460739016533, | |
| "num_tokens": 91238.0, | |
| "step": 80 | |
| }, | |
| { | |
| "entropy": 2.247792345285416, | |
| "epoch": 1.1235955056179776, | |
| "grad_norm": 9.9981689453125, | |
| "learning_rate": 1.2584269662921348e-05, | |
| "loss": 0.1546, | |
| "mean_token_accuracy": 0.9237146884202957, | |
| "num_tokens": 112951.0, | |
| "step": 100 | |
| }, | |
| { | |
| "epoch": 1.1235955056179776, | |
| "eval_entropy": 2.2061468300066496, | |
| "eval_loss": 0.20422625541687012, | |
| "eval_mean_token_accuracy": 0.9183721965865085, | |
| "eval_num_tokens": 112951.0, | |
| "eval_runtime": 6.4389, | |
| "eval_samples_per_second": 47.213, | |
| "eval_steps_per_second": 5.902, | |
| "step": 100 | |
| }, | |
| { | |
| "entropy": 2.2367678195238114, | |
| "epoch": 1.348314606741573, | |
| "grad_norm": 2.5056209564208984, | |
| "learning_rate": 1.108614232209738e-05, | |
| "loss": 0.1464, | |
| "mean_token_accuracy": 0.9411792993545532, | |
| "num_tokens": 136005.0, | |
| "step": 120 | |
| }, | |
| { | |
| "entropy": 2.169213280081749, | |
| "epoch": 1.5730337078651684, | |
| "grad_norm": 5.718409061431885, | |
| "learning_rate": 9.588014981273409e-06, | |
| "loss": 0.1213, | |
| "mean_token_accuracy": 0.9466849774122238, | |
| "num_tokens": 157845.0, | |
| "step": 140 | |
| }, | |
| { | |
| "epoch": 1.6853932584269664, | |
| "eval_entropy": 2.1757926313500655, | |
| "eval_loss": 0.17474651336669922, | |
| "eval_mean_token_accuracy": 0.9275952091342524, | |
| "eval_num_tokens": 168822.0, | |
| "eval_runtime": 6.4533, | |
| "eval_samples_per_second": 47.108, | |
| "eval_steps_per_second": 5.889, | |
| "step": 150 | |
| } | |
| ], | |
| "logging_steps": 20, | |
| "max_steps": 267, | |
| "num_input_tokens_seen": 0, | |
| "num_train_epochs": 3, | |
| "save_steps": 50, | |
| "stateful_callbacks": { | |
| "TrainerControl": { | |
| "args": { | |
| "should_epoch_stop": false, | |
| "should_evaluate": false, | |
| "should_log": false, | |
| "should_save": true, | |
| "should_training_stop": false | |
| }, | |
| "attributes": {} | |
| } | |
| }, | |
| "total_flos": 3828137467060224.0, | |
| "train_batch_size": 8, | |
| "trial_name": null, | |
| "trial_params": null | |
| } | |