Downloads · 30 days
94
6% of all-time downloads
orionweller/test-flex-gpt
test-flex-gpt is a machine learning model from orionweller. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
Downloads · 30 days
94
6% of all-time downloads
All-time downloads
1.6K
Public
Repo size
10 GB
Likes
0
Public
Click a slice to open those files.
.bin599 MB · 100%
From the Hugging Face model README
from transformers import AutoModelForCausalLM, AutoTokenizer, AutoModel
import torch
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
print(f"Using device: {device}")
model = AutoModelForCausalLM.from_pretrained("orionweller/test-flex-gpt", trust_remote_code=True)
model = model.to(device)
tokenizer = AutoTokenizer.from_pretrained("orionweller/test-flex-gpt", trust_remote_code=True)
# test it out and encode some text
prompt = "The capital of France is"
inputs = tokenizer(prompt, return_tensors="pt").input_ids
# put the input ids on the right device
inputs = inputs.to(device)
outputs = model.generate(inputs, max_new_tokens=5, do_sample=True, top_p=0.95)
print(tokenizer.batch_decode(outputs, skip_special_tokens=True))