Legacy7070's picture
Update app.py
7c63ba1
raw
history blame contribute delete
620 Bytes
import streamlit as st
from transformers import GPT2LMHeadModel, GPT2Tokenizer
#Load models
tokenizer = GPT2Tokenizer.from_pretrained("Legacy7070/Psychedelic-Trip-Report-Generator")
model = GPT2LMHeadModel.from_pretrained("Legacy7070/Psychedelic-Trip-Report-Generator")
#Set title and prompt
st.title('Psychedelic Trip Report Generator')
prompt = st.text_input("Enter a prompt for the trip report:")
if prompt:
inputs = tokenizer.encode(prompt, return_tensors='pt')
outputs = model.generate(inputs, max_length=500, temperature=1.0)
generated_text = tokenizer.decode(outputs[0])
st.text(generated_text)