Update README.md
Browse files
README.md
CHANGED
|
@@ -35,7 +35,7 @@ from transformers import AutoModelForCausalLM, AutoTokenizer
|
|
| 35 |
from peft import PeftModel
|
| 36 |
|
| 37 |
base_model = "microsoft/Phi-3-medium-128k-instruct"
|
| 38 |
-
lora_model = "bellafc/IPAD/
|
| 39 |
|
| 40 |
tokenizer = AutoTokenizer.from_pretrained(base_model)
|
| 41 |
model = AutoModelForCausalLM.from_pretrained(base_model, torch_dtype="auto", device_map="auto")
|
|
@@ -86,7 +86,7 @@ print(f"P('yes') = {probs[0, yes_token_id].item():.4f}")
|
|
| 86 |
|
| 87 |
---
|
| 88 |
|
| 89 |
-
## 🚀 LLaMA-Factory Usage
|
| 90 |
```python
|
| 91 |
llamafactory-cli chat examples/inference/distinguisher_ptcv.yaml
|
| 92 |
```
|
|
@@ -103,6 +103,26 @@ max_new_tokens: 128
|
|
| 103 |
temperature: 0.7
|
| 104 |
```
|
| 105 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 106 |
|
| 107 |
## ⚙️ Model Details
|
| 108 |
|
|
|
|
| 35 |
from peft import PeftModel
|
| 36 |
|
| 37 |
base_model = "microsoft/Phi-3-medium-128k-instruct"
|
| 38 |
+
lora_model = "bellafc/IPAD/inverter"
|
| 39 |
|
| 40 |
tokenizer = AutoTokenizer.from_pretrained(base_model)
|
| 41 |
model = AutoModelForCausalLM.from_pretrained(base_model, torch_dtype="auto", device_map="auto")
|
|
|
|
| 86 |
|
| 87 |
---
|
| 88 |
|
| 89 |
+
## 🚀 LLaMA-Factory Usage (Chat)
|
| 90 |
```python
|
| 91 |
llamafactory-cli chat examples/inference/distinguisher_ptcv.yaml
|
| 92 |
```
|
|
|
|
| 103 |
temperature: 0.7
|
| 104 |
```
|
| 105 |
|
| 106 |
+
---
|
| 107 |
+
|
| 108 |
+
## 🚀 LLaMA-Factory Usage (API)
|
| 109 |
+
```python
|
| 110 |
+
llamafactory-cli api examples/inference/distinguisher_ptcv.yaml
|
| 111 |
+
```
|
| 112 |
+
### Example YAML configuration
|
| 113 |
+
```python
|
| 114 |
+
lora_sft.yaml
|
| 115 |
+
```
|
| 116 |
+
```yaml
|
| 117 |
+
model_name_or_path: microsoft/Phi-3-medium-128k-instruct
|
| 118 |
+
adapter_name_or_path: bellafc/IPAD/Distinguisher_PTCV
|
| 119 |
+
template: phi
|
| 120 |
+
infer_backend: vllm
|
| 121 |
+
max_new_tokens: 128
|
| 122 |
+
temperature: 0.7
|
| 123 |
+
```
|
| 124 |
+
after that, run python distinguishers_testscript.py
|
| 125 |
+
|
| 126 |
|
| 127 |
## ⚙️ Model Details
|
| 128 |
|