Downloads · 30 days
20
4% of all-time downloads
theminji/TinyLlama-v2ray
TinyLlama-v2ray is a text generation model from theminji. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as apache-2.0.
This model is a fine-tuned version of TinyLlama/TinyLlama-1.1B-Chat-v0.6 on the theminji/v2ray dataset.
Downloads · 30 days
20
4% of all-time downloads
All-time downloads
451
Public
Parameters
1.1B
2.2 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors2.2 GB · 100%
From the Hugging Face model README
This model is a fine-tuned version of TinyLlama/TinyLlama-1.1B-Chat-v0.6 on the theminji/v2ray dataset.
Prompt format is as follows:
<|im_start|>user
{prompt}<|im_end|>
<|im_start|>assistant
The model is intended to mimic the behavior of v2ray, so results will most likely be nonsensical or gibberish.
import torch
from transformers import pipeline, AutoTokenizer
import re
tokenizer = AutoTokenizer.from_pretrained("theminji/TinyLlama-v2ray")
pipe = pipeline("text-generation", model="theminji/TinyLlama-v2ray", torch_dtype=torch.bfloat16, device_map="auto")
def formatted_prompt(prompt)-> str:
return f"<|im_start|>user\n{prompt}<|im_end|>\n<|im_start|>assistant"
def extract_text(text):
pattern = r'v2ray\n(.*?)(?=<\|im_end\|>)'
match = re.search(pattern, text, re.DOTALL)
if match:
return f"Output: {match.group(1)}"
else:
return "No match found"
prompt = 'what are your thoughts on ccp'
outputs = pipe(formatted_prompt(prompt), max_new_tokens=50, do_sample=True, temperature=0.9)
if outputs and "generated_text" in outputs[0]:
text = extract_text(outputs[0]["generated_text"])
print(f"Prompt: {prompt}")
print("")
print(text)
else:
print("No output or unexpected structure")
#Prompt: what are ur thoughts on ccp
#
#Output: <Re: insaneness> you are a ccp
The following hyperparameters were used during training: