Jeff man112
commited on
Commit
·
8d27259
1
Parent(s):
0acdd9b
Update README.md
Browse files
README.md
CHANGED
@@ -8,28 +8,58 @@ tags:
|
|
8 |
model-index:
|
9 |
- name: TinyLlama-v2ray
|
10 |
results: []
|
|
|
|
|
|
|
11 |
---
|
12 |
|
13 |
-
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
14 |
-
should probably proofread and complete it, then remove this comment. -->
|
15 |
|
16 |
# TinyLlama-v2ray
|
17 |
|
18 |
-
This model is a fine-tuned version of [TinyLlama/TinyLlama-1.1B-Chat-v0.6](https://huggingface.co/TinyLlama/TinyLlama-1.1B-Chat-v0.6) on the
|
19 |
|
20 |
## Model description
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
|
34 |
### Training hyperparameters
|
35 |
|
@@ -45,13 +75,9 @@ The following hyperparameters were used during training:
|
|
45 |
- training_steps: 1000
|
46 |
- mixed_precision_training: Native AMP
|
47 |
|
48 |
-
### Training results
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
### Framework versions
|
53 |
|
54 |
- Transformers 4.35.2
|
55 |
- Pytorch 2.1.0+cu121
|
56 |
- Datasets 2.16.0
|
57 |
-
- Tokenizers 0.15.0
|
|
|
8 |
model-index:
|
9 |
- name: TinyLlama-v2ray
|
10 |
results: []
|
11 |
+
datasets:
|
12 |
+
- TheBossLevel123/v2ray
|
13 |
+
library_name: transformers
|
14 |
---
|
15 |
|
|
|
|
|
16 |
|
17 |
# TinyLlama-v2ray
|
18 |
|
19 |
+
This model is a fine-tuned version of [TinyLlama/TinyLlama-1.1B-Chat-v0.6](https://huggingface.co/TinyLlama/TinyLlama-1.1B-Chat-v0.6) on the [TheBossLevel123/v2ray](https://huggingface.co/datasets/TheBossLevel123/v2ray) dataset.
|
20 |
|
21 |
## Model description
|
22 |
+
Prompt format is as follows:
|
23 |
+
```py
|
24 |
+
<|im_start|>user
|
25 |
+
{prompt}<|im_end|>
|
26 |
+
<|im_start|>assistant
|
27 |
+
```
|
28 |
+
|
29 |
+
The model is intended to mimic the behavior of v2ray, so results will most likely be nonsensical or gibberish.
|
30 |
+
|
31 |
+
## Example Usage
|
32 |
+
```py
|
33 |
+
import torch
|
34 |
+
from transformers import pipeline, AutoTokenizer
|
35 |
+
import re
|
36 |
+
tokenizer = AutoTokenizer.from_pretrained("TheBossLevel123/TinyLlama-v2ray")
|
37 |
+
pipe = pipeline("text-generation", model="TheBossLevel123/TinyLlama-v2ray", torch_dtype=torch.bfloat16, device_map="auto")
|
38 |
+
|
39 |
+
def formatted_prompt(prompt)-> str:
|
40 |
+
return f"<|im_start|>user\n{prompt}<|im_end|>\n<|im_start|>assistant"
|
41 |
+
|
42 |
+
def extract_text(text):
|
43 |
+
pattern = r'v2ray\n(.*?)(?=<\|im_end\|>)'
|
44 |
+
match = re.search(pattern, text, re.DOTALL)
|
45 |
+
if match:
|
46 |
+
return f"Output: {match.group(1)}"
|
47 |
+
else:
|
48 |
+
return "No match found"
|
49 |
+
prompt = 'what are your thoughts on ccp'
|
50 |
+
outputs = pipe(formatted_prompt(prompt), max_new_tokens=50, do_sample=True, temperature=0.4)
|
51 |
+
if outputs and "generated_text" in outputs[0]:
|
52 |
+
text = extract_text(outputs[0]["generated_text"])
|
53 |
+
print(f"Prompt: {prompt}")
|
54 |
+
print("")
|
55 |
+
print(text)
|
56 |
+
else:
|
57 |
+
print("No output or unexpected structure")
|
58 |
+
|
59 |
+
#Prompt: what are ur thoughts on ccp
|
60 |
+
#
|
61 |
+
#Output: <Re: insaneness> you are a ccp
|
62 |
+
```
|
63 |
|
64 |
### Training hyperparameters
|
65 |
|
|
|
75 |
- training_steps: 1000
|
76 |
- mixed_precision_training: Native AMP
|
77 |
|
|
|
|
|
|
|
|
|
78 |
### Framework versions
|
79 |
|
80 |
- Transformers 4.35.2
|
81 |
- Pytorch 2.1.0+cu121
|
82 |
- Datasets 2.16.0
|
83 |
+
- Tokenizers 0.15.0
|