learnai / app.py
deepakaitcs's picture
ui
ac04983
raw
history blame
863 Bytes
## Difference between Open AI and hugging face
import streamlit as st
from dotenv import load_dotenv
load_dotenv()
from langchain_openai import OpenAI
llm = OpenAI()
def load_Answer(inputtext):
result= llm(inputtext)
return result
st.set_page_config(
page_title="My Chat GPT",
page_icon="🧊",
layout="wide",
initial_sidebar_state="expanded",
menu_items={
'Get Help': 'https://www.extremelycoolapp.com/help',
'Report a bug': "https://www.extremelycoolapp.com/bug",
'About': "# This is a header. This is an *extremely* cool app!"
}
)
st.header('This is a header')
def get_text():
i= st.text_input("You: ", key="input")
return i
user_input = get_text()
response = load_Answer(user_input)
submit = st.button("Submit")
if submit:
st.subheader("Answer:")
st.write(response)