import streamlit as st from transformers import pipeline pipe = pipeline('text-generation', model="gpt2") text = st.text_area("Ask the Doctor a Question?") if text: out = pipe(text) st.json(out)