import streamlit as st from transformers import pipeline pipe = pipeline("text2text-generation") #Input box text = st.text_area('Enter the animal you want to know about') if text: prompt = 'Tell me something about the animal ' + text + ' in less than 4 sentences' result = pipe(prompt, max_length=50, do_sample=True, temperature=0.5) out = result[0]['generated_text'] st.write(result )