Spaces:
Sleeping
Sleeping
Commit ·
555d0f1
1
Parent(s): 8d63ce3
Update app.py
Browse files7 unmodified lines891011111213143 unmodified lines18192021212223247 unmodified linesimport streamlit as stfrom transformers import pipeline, T5Tokenizer, T5ForConditionalGeneration
model=T5ForConditionalGeneration.from_pretrained("Logeswaransr/results_T5").to("cuda")model=T5ForConditionalGeneration.from_pretrained("Logeswaransr/results_T5").to("cpu")tokenizer=T5Tokenizer.from_pretrained("Logeswaransr/results_T5")
pipe=pipeline('text2text-generation', model=model, tokenizer=tokenizer)3 unmodified linesif 'messages' not in st.session_state: st.session_state.messages=[]
st.subheader("Sample Chatbot")st.subheader("Mine AI")
for message in st.session_state.messages: with st.chat_message(message['role']):app.py+2-2