Downloads · 30 days
0
Jsjshshd/gptoezm
gptoezm is a machine learning model from Jsjshshd. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
0
Access
Public
Updated Jul 1, 2024
Repo size
—
Likes
0
Public
Click a slice to open those files.
Other1.5 KB · 73%
From the Hugging Face model README
from transformers import pipeline
generator = pipeline('text-generation', model='gpt2')
print("Starting the conversation!") conversation_history = ""
while True: user_input = input("User: ")
# Append user input to conversation history
conversation_history += user_input + " "
# Generate response based on the entire conversation history
response = generator(conversation_history, max_length=100, num_return_sequences=1)[0]['generated_text']
print("Model:", response)