Update README.md
Browse files
README.md
CHANGED
@@ -1,3 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
# Llama-3.2-3B-ChatGPT-Prompts-Instruct
|
2 |
|
3 |
## Model Description
|
@@ -37,16 +70,41 @@ This is a fine-tuned version of Meta's Llama-3.2-3B-Instruct model, specifically
|
|
37 |
|
38 |
```python
|
39 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
|
|
40 |
|
41 |
model_name = "sweatSmile/Llama-3.2-3B-ChatGPT-Prompts-Instruct"
|
42 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
43 |
-
model = AutoModelForCausalLM.from_pretrained(
|
|
|
|
|
|
|
|
|
44 |
|
45 |
# Example usage
|
46 |
prompt = "Linux Terminal"
|
47 |
-
|
48 |
-
|
49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
```
|
51 |
|
52 |
## Intended Use
|
@@ -88,12 +146,12 @@ The model excels at:
|
|
88 |
- The model should not be used to impersonate real individuals or for deceptive purposes
|
89 |
- Always disclose when content is AI-generated in professional or public contexts
|
90 |
|
91 |
-
##
|
92 |
-
|
93 |
-
- **
|
94 |
-
- **
|
95 |
-
- **
|
96 |
-
- **
|
97 |
|
98 |
## License
|
99 |
|
|
|
1 |
+
---
|
2 |
+
language:
|
3 |
+
- en
|
4 |
+
library_name: transformers
|
5 |
+
base_model: meta-llama/Llama-3.2-3B-Instruct
|
6 |
+
base_model_relation: finetune
|
7 |
+
tags:
|
8 |
+
- llama
|
9 |
+
- chatgpt-prompts
|
10 |
+
- role-playing
|
11 |
+
- instruction-tuning
|
12 |
+
- conversational
|
13 |
+
- lora
|
14 |
+
- peft
|
15 |
+
license: llama3.2
|
16 |
+
datasets:
|
17 |
+
- fka/awesome-chatgpt-prompts
|
18 |
+
pipeline_tag: text-generation
|
19 |
+
model-index:
|
20 |
+
- name: Llama-3.2-3B-ChatGPT-Prompts-Instruct
|
21 |
+
results:
|
22 |
+
- task:
|
23 |
+
type: text-generation
|
24 |
+
name: Text Generation
|
25 |
+
dataset:
|
26 |
+
name: awesome-chatgpt-prompts
|
27 |
+
type: fka/awesome-chatgpt-prompts
|
28 |
+
metrics:
|
29 |
+
- name: Training Loss
|
30 |
+
type: loss
|
31 |
+
value: 0.28
|
32 |
+
---
|
33 |
+
|
34 |
# Llama-3.2-3B-ChatGPT-Prompts-Instruct
|
35 |
|
36 |
## Model Description
|
|
|
70 |
|
71 |
```python
|
72 |
from transformers import AutoTokenizer, AutoModelForCausalLM
|
73 |
+
import torch
|
74 |
|
75 |
model_name = "sweatSmile/Llama-3.2-3B-ChatGPT-Prompts-Instruct"
|
76 |
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
77 |
+
model = AutoModelForCausalLM.from_pretrained(
|
78 |
+
model_name,
|
79 |
+
torch_dtype=torch.float16,
|
80 |
+
device_map="auto"
|
81 |
+
)
|
82 |
|
83 |
# Example usage
|
84 |
prompt = "Linux Terminal"
|
85 |
+
messages = [
|
86 |
+
{"role": "user", "content": prompt}
|
87 |
+
]
|
88 |
+
|
89 |
+
# Apply chat template
|
90 |
+
formatted_prompt = tokenizer.apply_chat_template(
|
91 |
+
messages,
|
92 |
+
tokenize=False,
|
93 |
+
add_generation_prompt=True
|
94 |
+
)
|
95 |
+
|
96 |
+
inputs = tokenizer(formatted_prompt, return_tensors="pt")
|
97 |
+
with torch.no_grad():
|
98 |
+
outputs = model.generate(
|
99 |
+
**inputs,
|
100 |
+
max_new_tokens=512,
|
101 |
+
temperature=0.7,
|
102 |
+
do_sample=True,
|
103 |
+
pad_token_id=tokenizer.eos_token_id
|
104 |
+
)
|
105 |
+
|
106 |
+
response = tokenizer.decode(outputs[0][inputs['input_ids'].shape[1]:], skip_special_tokens=True)
|
107 |
+
print(response)
|
108 |
```
|
109 |
|
110 |
## Intended Use
|
|
|
146 |
- The model should not be used to impersonate real individuals or for deceptive purposes
|
147 |
- Always disclose when content is AI-generated in professional or public contexts
|
148 |
|
149 |
+
## Framework Versions
|
150 |
+
- **Transformers:** 4.x
|
151 |
+
- **PyTorch:** 2.x
|
152 |
+
- **PEFT:** Latest
|
153 |
+
- **Datasets:** Latest
|
154 |
+
- **Tokenizers:** Latest
|
155 |
|
156 |
## License
|
157 |
|