yahma/alpaca-cleaned
Viewer • Updated • 51.8k • 21.8k • 892
How to use sidharthsajith7/armaGPT with Transformers:
# Use a pipeline as a high-level helper
# Warning: Pipeline type "question-answering" is no longer supported in transformers v5.
# You must load the model directly (see below) or downgrade to v4.x with:
# pip install "transformers<5.0.0"
from transformers import pipeline
pipe = pipeline("question-answering", model="sidharthsajith7/armaGPT") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("sidharthsajith7/armaGPT")
model = AutoModelForCausalLM.from_pretrained("sidharthsajith7/armaGPT", device_map="auto")Model Description: armaGPT is a finetuned version of Gemma 7b, a pre-trained language model developed by Google. It is designed to generate human-like text based on the input it receives. And armaGPT is finetuned using DPO Training for fair and safe generation.
Model Architecture: The architecture of armaGPT is based on the transformer model, which is a type of recurrent neural network (RNN) that uses self-attention mechanisms to process input sequences.
Model Size: The model has approximately 7 billion parameters.
Models are trained on a context length of 8192 tokens.
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("sidharthsajith7/armaGPT")
model = AutoModelForCausalLM.from_pretrained("sidharthsajith7/armaGPT")
input_text = "Write me a poem about Machine Learning."
input_ids = tokenizer(input_text, return_tensors="pt")
outputs = model.generate(**input_ids)
print(tokenizer.decode(outputs[0]))
# pip install accelerate
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("sidharthsajith7/armaGPT")
model = AutoModelForCausalLM.from_pretrained("sidharthsajith7/armaGPT", device_map="auto")
input_text = "Write me a poem about Machine Learning."
input_ids = tokenizer(input_text, return_tensors="pt").to("cuda")
outputs = model.generate(**input_ids)
print(tokenizer.decode(outputs[0]))