gptspace / app.py
venkatks515's picture
Update app.py
bb36174
raw
history blame contribute delete
434 Bytes
import streamlit as st
import transformers
from transformers import pipeline
st.title("Text Generation with Hugging Face")
model_name = "bigscience/mt0-xxl-mt"
generator = pipeline("text-generation", model=model_name, device=0)
prompt = st.text_input("Enter text prompt:", "Once upon a time")
if st.button("Generate Text"):
output = generator(prompt, max_length=100, do_sample=True)
st.write(output[0]['generated_text'])