Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# chatOP — SmolLM2-135M Fine-tuned
|
| 2 |
|
| 3 |
A fine-tuned version of [SmolLM2-135M-Instruct](https://huggingface.co/HuggingFaceTB/SmolLM2-135M-Instruct) trained to act as a friendly study assistant for CS and ML concepts.
|
|
@@ -46,42 +63,6 @@ A fine-tuned version of [SmolLM2-135M-Instruct](https://huggingface.co/HuggingFa
|
|
| 46 |
- **GPU:** NVIDIA Tesla T4 (Google Colab)
|
| 47 |
- **Training time:** ~15–20 minutes
|
| 48 |
|
| 49 |
-
## Usage
|
| 50 |
-
|
| 51 |
-
```python
|
| 52 |
-
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 53 |
-
import torch
|
| 54 |
-
|
| 55 |
-
model = AutoModelForCausalLM.from_pretrained("your-username/study-buddy")
|
| 56 |
-
tokenizer = AutoTokenizer.from_pretrained("your-username/study-buddy")
|
| 57 |
-
|
| 58 |
-
messages = [
|
| 59 |
-
{"role": "user", "content": "What is backpropagation?"}
|
| 60 |
-
]
|
| 61 |
-
|
| 62 |
-
text = tokenizer.apply_chat_template(
|
| 63 |
-
messages,
|
| 64 |
-
tokenize=False,
|
| 65 |
-
add_generation_prompt=True
|
| 66 |
-
)
|
| 67 |
-
inputs = tokenizer(text, return_tensors="pt")
|
| 68 |
-
|
| 69 |
-
with torch.no_grad():
|
| 70 |
-
output = model.generate(
|
| 71 |
-
**inputs,
|
| 72 |
-
max_new_tokens=200,
|
| 73 |
-
temperature=0.7,
|
| 74 |
-
do_sample=True,
|
| 75 |
-
pad_token_id=tokenizer.eos_token_id
|
| 76 |
-
)
|
| 77 |
-
|
| 78 |
-
response = tokenizer.decode(
|
| 79 |
-
output[0][inputs["input_ids"].shape[1]:],
|
| 80 |
-
skip_special_tokens=True
|
| 81 |
-
)
|
| 82 |
-
print(response)
|
| 83 |
-
```
|
| 84 |
-
|
| 85 |
## Example Outputs
|
| 86 |
|
| 87 |
**Prompt:** What is machine learning?
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language:
|
| 3 |
+
- en
|
| 4 |
+
license: apache-2.0
|
| 5 |
+
base_model: HuggingFaceTB/SmolLM2-135M-Instruct
|
| 6 |
+
tags:
|
| 7 |
+
- llm
|
| 8 |
+
- fine-tuned
|
| 9 |
+
- lora
|
| 10 |
+
- sft
|
| 11 |
+
- text-generation
|
| 12 |
+
- student-project
|
| 13 |
+
datasets:
|
| 14 |
+
- HuggingFaceTB/smoltalk
|
| 15 |
+
pipeline_tag: text-generation
|
| 16 |
+
---
|
| 17 |
+
|
| 18 |
# chatOP — SmolLM2-135M Fine-tuned
|
| 19 |
|
| 20 |
A fine-tuned version of [SmolLM2-135M-Instruct](https://huggingface.co/HuggingFaceTB/SmolLM2-135M-Instruct) trained to act as a friendly study assistant for CS and ML concepts.
|
|
|
|
| 63 |
- **GPU:** NVIDIA Tesla T4 (Google Colab)
|
| 64 |
- **Training time:** ~15–20 minutes
|
| 65 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
## Example Outputs
|
| 67 |
|
| 68 |
**Prompt:** What is machine learning?
|