project_news / app.py
Aytaj's picture
Update app.py
62b4437
raw
history blame
581 Bytes
import streamlit as st
from transformers import pipeline
pipe = pipeline('text-generation', model='Pclanglais/MonadGPT', device='cuda')
def main():
st.title("MonadGPT Streamlit App")
st.markdown("This is a streamlit app that allows you to have a conversation abbout any topic")
user_input = st.text_input("Your question:")
if user_input:
response = pipe(user_input, max_length=256, do_sample=True, top_k=50, top_p=0.95, early_stopping=True)
st.write(response[0]['generated_text'])
if st.button("Restart"):
st.empty()
if __name__ == "__main__":
main()