Downloads · 30 days
31
1% of all-time downloads
prem-research/prem-1B
prem-1B is a text generation model from prem-research. 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.
With great enthusiasm, we unveil the Prem-1B series, open-source, multipurpose large language models developed by Prem AI. This cutting-edge SLM offers the open community and enterprises the opportunity to harness cap…
Downloads · 30 days
31
1% of all-time downloads
All-time downloads
3.2K
Public
Parameters
1.1B
4.4 GB on disk
Likes
6
Public
Click a slice to open those files.
.safetensors2.2 GB · 100%
From the Hugging Face model README
With great enthusiasm, we unveil the Prem-1B series, open-source, multipurpose large language models developed by Prem AI. This cutting-edge SLM offers the open community and enterprises the opportunity to harness capabilities that were once exclusively available through closed model APIs, empowering them to build their own advanced language models. Our objective is to develop a model that excels at Retrieval-Augmented Generation (RAG). While Large Language Models (LLMs) store a vast amount of information within their parameters, RAG operates differently by ingesting information during runtime. This approach suggests that for RAG applications, we may not require models of immense size. With this initiative, we aim to create a Small Language Model (SLM) with an extended context length of 8192 tokens, enabling it to handle multi-turn conversations effectively. This endeavor represents our inaugural attempt to craft an SLM tailored for RAG tasks.
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
The Prem-1B language model is designed for commercial and research applications involving the English language. The instruction-tuned versions of the model are tailored for conversational interactions akin to a virtual assistant. On the other hand, the pretrained variants can be fine-tuned and adapted for various natural language generation tasks beyond just dialogue.
The model must not be used in any manner that violates applicable laws or regulations, including trade compliance laws. It is also prohibited to use the model in any way that goes against the Acceptable Use Policy and the Prem-1B Community License. While the base model is intended for English language use, developers are permitted to fine-tune the Prem-1B models for other languages, provided they comply with the Prem-1B Community License and the Acceptable Use Policy.
Users (both direct and downstream) should be made aware of the risks, biases, and limitations of the model. More information needed for further recommendations.
Using AutoModelForCausalLM and AutoTokenizer
from transformers import AutoTokenizer, AutoModelForCausalLM
# Load the model and tokenizer
tokenizer = AutoTokenizer.from_pretrained("prem-research/prem-1B-chat")
model = AutoModelForCausalLM.from_pretrained('prem-research/prem-1B-chat', torch_dtype=torch.bfloat16)
model = model.to('cuda')
# Setup terminators
terminators = [tokenizer.eos_token_id, tokenizer.encode('<|eot_id|>', add_special_tokens=False)[0]]
# Prepare the prompt
messages = [
{
"role": "system",
"content": "You are a helpful AI assistant. You should give concise responses to very simple questions, but provide thorough responses to more complex and open-ended questions."
},
{
'role': 'user',
'content': 'Help me understand machine learning.'
}
]
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
# Generate
inputs = tokenizer(prompt, return_attention_mask=False, return_tensors="pt", add_special_tokens=False)
input_ids = inputs['input_ids']
input_ids = input_ids.to(model.device)
res = model.generate(input_ids=input_ids, max_new_tokens=400, pad_token_id=tokenizer.pad_token_id, eos_token_id=terminators)
generated_text = tokenizer.decode(res[0][input_ids.shape[1]:], skip_special_tokens=True).strip()
print(generated_text)
Using pipelines:
import torch
from transformers import pipeline
# Load the pipeline
pipe = pipeline("text-generation", model="prem-research/prem-1B-chat", torch_dtype=torch.bfloat16, device=0)
# Prepare prompt
messages = [
{
"role": "system",
"content": "You are a helpful AI assistant. You should give concise responses to very simple questions, but provide thorough responses to more complex and open-ended questions."
},
{
'role': 'user',
'content': 'Help me understand machine learning.'
}
]
prompt = pipe.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
# Setup terminators
terminators = [pipe.tokenizer.eos_token_id, pipe.tokenizer.encode('<|eot_id|>', add_special_tokens=False)[0]]
# Generate
outputs = pipe(prompt, max_new_tokens=400, do_sample=True, temperature=0.7, top_k=50, top_p=0.95, pad_token_id=pipe.tokenizer.pad_token_id, eos_token_id=terminators)
print(outputs[0]["generated_text"][len(prompt):])
Mentioned in blogpost: https://blog.premai.io/introducing-prem-1b/
Mentioned in blogpost: https://blog.premai.io/introducing-prem-1b/
Mentioned in blogpost: https://blog.premai.io/introducing-prem-1b/
| Model | Avg | Arc-c | Arc-e | Hellaswag | MMLU | Obqa | Piqa | Winogrande |
|---|---|---|---|---|---|---|---|---|
| prem-1B | 42.64 | 24.74 | 57.40 | 42.01 | 24.75 | 21.00 | 72.14 | 56.43 |
| prem-1B-chat | 41.76 | 24.48 | 53.32 | 40.28 | 25.27 | 22.20 | 70.89 | 55.88 |
| TinyLlama-1.1B-Chat-v1.0 | 46.16 | 30.03 | 61.53 | 46.56 | 24.72 | 25.80 | 74.21 | 60.29 |
| opt-1.3b | 42.94 | 23.37 | 57.44 | 41.49 | 24.86 | 23.20 | 71.49 | 58.72 |
| pythia-1b | 40.71 | 24.31 | 56.90 | 37.72 | 23.20 | 18.80 | 70.62 | 53.43 |

Llama based
16-H100 GPUs
H100 GPUs
PyTorch, transformers, PyTorch Lightning
https://blog.premai.io/introducing-prem-1b/
https://huggingface.co/goku, https://huggingface.co/nsosio, https://huggingface.co/ucalyptus, https://huggingface.co/filopedraz
https://huggingface.co/goku, https://huggingface.co/nsosio, https://huggingface.co/ucalyptus, https://huggingface.co/filopedraz