Downloads · 30 days
2
15% of all-time downloads
zhuu4/GPT_aristotle
GPT_aristotle is a machine learning model from zhuu4. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
from transformers import pipeline, AutoTokenizer, AutoModelForCausalLM import torch
Downloads · 30 days
2
15% of all-time downloads
All-time downloads
13
Public
Parameters
125M
501 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors501 MB · 99%
From the Hugging Face model README
from transformers import pipeline, AutoTokenizer, AutoModelForCausalLM
import torch
# Загрузка модели
model_name = "zhuu4/GPT_aristotle"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name)
# Создание пайплайна для генерации текста
generator = pipeline(
"text-generation",
model=model,
tokenizer=tokenizer,
device=0 if torch.cuda.is_available() else -1
)
# Генерация текста
prompt = "Сегодня мы тестируем новый смартфон и"
result = generator(
prompt,
max_length=150,
num_return_sequences=1,
temperature=0.7,
do_sample=True,
pad_token_id=tokenizer.eos_token_id
)
print(result[0]['generated_text'])