import streamlit as st from langchain.llms import Replicate import os st.title("Llama2-powered Streamlit App") with st.sidebar: os.environ["REPLICATE_API_TOKEN"] = "" def generate_response(input_text): llama2_13b_chat = "meta/llama-2-13b-chat:f4e2de70d66816a838a89eeeb621910adffb0dd0baba3976c96980970978018d" llm = Replicate( model=llama2_13b_chat, input={"temperature": 0.01, "max_length": 2000, "top_p": 1}, ) st.info(llm(input_text)) with st.form("my_form"): text = st.text_area("Enter text:", "What is Generative AI?") submitted = st.form_submit_button("Submit") generate_response(text)