Spaces:
Sleeping
Sleeping
File size: 426 Bytes
91f145c 1e615dd 91f145c 1e615dd 91f145c 1e615dd 91f145c 1e615dd 91f145c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
from transformers import pipeline
# Use the correct model name available on Hugging Face
model_name = "meta-llama/Meta-Llama-3.1-8B"
# Initialize the text-generation pipeline
pipe = pipeline("text-generation", model=model_name)
# Generate text based on a prompt
prompt = "In a distant future, humanity has developed AI"
output = pipe(prompt, max_length=50, num_return_sequences=1)
# Print the generated text
print(output)
|