Downloads · 30 days
397
18% of all-time downloads
NucleusOrg/Nucleus-1B-alpha-1
Nucleus-1B-alpha-1 is a text generation model from NucleusOrg. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
<p align="center" <img src="https://github.com/prp-e/nucleus/raw/main/nucleus-logo.png" width=256 height=256 </p
Downloads · 30 days
397
18% of all-time downloads
All-time downloads
2.3K
Public
Parameters
1.1B
2.3 GB on disk
Likes
12
Public
Click a slice to open those files.
.safetensors2.3 GB · 100%
From the Hugging Face model README
Nucleus is a small language model based on Mistral (actually, the trimmed untrained version you can find here) and trained in different steps. First, we've pretrained it on TinyStories dataset, then TinyTextBooks to make it a more specific model. This model is just a proof of concept at this point, but showed good promises in early tests. So with proper training, can be a good product over time!
First you need to install transformers and accelerate libraries in order to run this model. Then, you basically have to run the following code:
from transformers import AutoModelForCausalLM, AutoTokenizer, GenerationConfig
import torch
model_name_or_id = "NucleusOrg/Nucleus-1B-alpha-1"
model = AutoModelForCausalLM.from_pretrained(model_name_or_id, torch_dtype=torch.float16, device_map="cuda")
tokenizer = AutoTokenizer.from_pretrained(model_name_or_id)
prompt = "### Lesson: Python Programming 101\n### Introduction\n"
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
generation_config = GenerationConfig(
do_sample=True,
top_k=1,
temperature=0.9,
max_new_tokens=500,
repetition_penalty=1.5,
pad_token_id=tokenizer.eos_token_id
)
outputs = model.generate(**inputs, generation_config=generation_config)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Prompt Format: This model does not have a specific prompt format, but the best results could be achieved with a textbook type of format like:
### Chapter 1: Elon Musk and Iron Man
Elon met Tony at a Cafe in Monaco, then they had a conversation about
You also can try something like this:
Question: Who are you?
Answer:
But since the model isn't made for chat/question answering, the result won't be good enough.
Repetition Penalty: Since most of these models like to repeat themselves, just keep that number there. You can increase or decrease it based on your liking,but keep in mind that a number lower than 1 makes the model super repetitive.