Streamlit

Create AI demos and dashboards

Building AI Demos with Streamlit

Create interactive AI demos and dashboards quickly with Streamlit.

#

Installation

bash
pip install streamlit transformers torch

#

Basic App

python
import streamlit as st
from transformers import pipeline

st.title("AI Text Generator") generator = pipeline("text-generation", model="gpt2")

prompt = st.text_input("Enter your prompt:") if st.button("Generate"): result = generator(prompt, max_length=100) st.write(result[0]["generated_text"])

#

Benefits

  • No frontend experience needed
  • Automatic UI generation
  • Built-in widgets and charts
  • Easy deployment to Streamlit Cloud