Downloads · 30 days
27
39% of all-time downloads
bil-y/Pharia-1-LLM-7B-control
Pharia-1-LLM-7B-control is a text generation model from bil-y. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as other.
This is the safetensors-conversion of Pharia-1-LLM-7B-control. We provide a joint model card for Pharia-1-LLM-7B-control and Pharia-1-LLM-control-aligned. Find this model card here.
Downloads · 30 days
27
39% of all-time downloads
All-time downloads
69
Public
Parameters
7B
14.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors14.1 GB · 100%
From the Hugging Face model README
This is the safetensors-conversion of Pharia-1-LLM-7B-control.
We provide a joint model card for Pharia-1-LLM-7B-control and Pharia-1-LLM-control-aligned. Find this model card here.
import torch
from transformers import AutoModelForCausalLM, PreTrainedTokenizerFast
INPUT = """<|begin_of_text|><|start_header_id|>system<|end_header_id|>
You are a helpful assistant. You give engaging, well-structured answers to user inquiries.<|eot_id|><|start_header_id|>user<|end_header_id|>
When was Rome founded?<|eot_id|><|start_header_id|>assistant<|end_header_id|>
"""
MODEL_ID = "Aleph-Alpha/Pharia-1-LLM-7B-control-hf"
tokenizer = PreTrainedTokenizerFast.from_pretrained(MODEL_ID)
model = AutoModelForCausalLM.from_pretrained(MODEL_ID, trust_remote_code=True, torch_dtype=torch.bfloat16)
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
model = model.to(device)
inputs = tokenizer(INPUT, return_token_type_ids=False, return_tensors="pt").to(device)
outputs = model.generate(**inputs, max_new_tokens=50)
generated_text = tokenizer.decode(outputs[0])
print(generated_text)