just now, I am successful in running my code following the suggestion given by @nielsr . But I see that the generated text is giving more tokens than I need. Is there a way to stop once I get the answer. My code looks as below
prompt = """
Title: Ingest iris.csv into a dataframe
Code: import pandas as pd
file="/Users/data/iris.csv"
df=pd.read_csv(file)
print(df.head())

####

Title: Show 5 rows from a dataframe
Code: df.head(5)

####

Title: Show 6 rows from a dataframe
Code: """
input_ids=tokenizer.encode(str(prompt),return_tensors="pt")
generated_ids = model.generate(input_ids, do_sample=True, temperature=0.9, max_length=200)
generated_text = tokenizer.decode(generated_ids[0])
print(generated_text)

The output is as below. I was expecting only df.head(6)
Title: Ingest iris.csv into a dataframe
Code: import pandas as pd
file="/Users/data/iris.csv"
df=pd.read_csv(file)
print(df.head())

####

Title: Show 5 rows from a dataframe
Code: df.head(5)

####

Title: Show 6 rows from a dataframe
Code: 
df.head(6)

####

Title: Display dataframe in a grid
Code: df.to_html()
####

Title: Write dataframe rows to a csv file
Code: df.to_csv('iris.csv', index=False)
####

Title: Export all dataframe rows to an excel file
Code: df.to_excel('iris.xlsx', index=False)
####

Title: Export dataframe to a JSON