Instructions to use ao9000/phi2-cda-religion with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ao9000/phi2-cda-religion with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ao9000/phi2-cda-religion")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ao9000/phi2-cda-religion") model = AutoModelForCausalLM.from_pretrained("ao9000/phi2-cda-religion", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ao9000/phi2-cda-religion with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ao9000/phi2-cda-religion" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ao9000/phi2-cda-religion", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ao9000/phi2-cda-religion
- SGLang
How to use ao9000/phi2-cda-religion 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 "ao9000/phi2-cda-religion" \ --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": "ao9000/phi2-cda-religion", "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 "ao9000/phi2-cda-religion" \ --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": "ao9000/phi2-cda-religion", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use ao9000/phi2-cda-religion with Docker Model Runner:
docker model run hf.co/ao9000/phi2-cda-religion
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: mit
|
| 3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
---
|
| 4 |
+
# Lora finetuning on Wikipedia-10, applying counter factual data augmentation (CDA)
|
| 5 |
+
- Dataset: Wikipedia-10
|
| 6 |
+
- Target modules = ["q_proj", "k_proj", "v_proj", "dense", "fc1", "fc2"]
|
| 7 |
+
|
| 8 |
+
```
|
| 9 |
+
{
|
| 10 |
+
"epoch": 2.8503986104306773,
|
| 11 |
+
"total_flos": 1.0451807295707516e+18,
|
| 12 |
+
"train_loss": 0.7933661967515946,
|
| 13 |
+
"train_runtime": 65423.383,
|
| 14 |
+
"train_samples": 22453,
|
| 15 |
+
"train_samples_per_second": 0.978,
|
| 16 |
+
"train_steps_per_second": 0.031
|
| 17 |
+
}
|
| 18 |
+
```
|
| 19 |
+
|
| 20 |
+
|
| 21 |
+
# Training script: https://github.com/ao9000/bias-bench/blob/main/experiments/run_clm.py
|
| 22 |
+
|