Spaces:
Sleeping
Sleeping
File size: 581 Bytes
a9046df 5a3c120 62b4437 9216764 62b4437 9216764 62b4437 9216764 62b4437 9216764 62b4437 9216764 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
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()
|