|
import streamlit as st |
|
from transformers import GPT2LMHeadModel, GPT2Tokenizer |
|
|
|
|
|
tokenizer = GPT2Tokenizer.from_pretrained("Legacy7070/Psychedelic-Trip-Report-Generator") |
|
model = GPT2LMHeadModel.from_pretrained("Legacy7070/Psychedelic-Trip-Report-Generator") |
|
|
|
|
|
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) |
|
|