Downloads · 30 days
0
Salahmouyss/Gpt
Gpt is a machine learning model from Salahmouyss. 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 openrail.
!pip install transformers from transformers import AutoModelForCausalLM, AutoTokenizer
Downloads · 30 days
0
Access
Public
Updated Mar 1, 2025
Repo size
—
Likes
0
Public
Click a slice to open those files.
Other1.5 KB · 74%
From the Hugging Face model README
!pip install transformers from transformers import AutoModelForCausalLM, AutoTokenizer
model_name = "EleutherAI/gpt-j-6B"
model = AutoModelForCausalLM.from_pretrained(model_name)
tokenizer = AutoTokenizer.from_pretrained(model_name)
input_text = "السلام عليكم، كيف يمكنني مساعدتك؟"
input_ids = tokenizer.encode(input_text, return_tensors="pt")
output = model.generate(input_ids, max_length=100)
print(tokenizer.decode(output[0], skip_special_tokens=True))