Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,6 +14,7 @@ from langchain.chat_models import ChatOpenAI
|
|
| 14 |
from langchain.prompts import PromptTemplate
|
| 15 |
import streamlit.components.v1 as components
|
| 16 |
from openai import OpenAI
|
|
|
|
| 17 |
|
| 18 |
st.set_page_config(page_title="TechZone AI Counsellor",page_icon=":left_speech_bubble", layout="centered", initial_sidebar_state="auto", menu_items=None)
|
| 19 |
|
|
@@ -24,19 +25,22 @@ footer {visibility: hidden;}
|
|
| 24 |
</style>
|
| 25 |
|
| 26 |
"""
|
|
|
|
|
|
|
|
|
|
| 27 |
st.markdown(hide_streamlit_style, unsafe_allow_html=True)
|
| 28 |
|
| 29 |
-
client = OpenAI(api_key=
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
persist_directory = 'docs/chroma/chatbot2/'
|
| 34 |
|
| 35 |
-
embedding = OpenAIEmbeddings(api_key=
|
| 36 |
|
| 37 |
vectordb = Chroma(persist_directory=persist_directory, embedding_function=embedding)
|
| 38 |
|
| 39 |
-
llm = ChatOpenAI(model_name="gpt-3.5-turbo", temperature=0, api_key=
|
| 40 |
|
| 41 |
col1, col2 = st.columns([1, 3])
|
| 42 |
|
|
|
|
| 14 |
from langchain.prompts import PromptTemplate
|
| 15 |
import streamlit.components.v1 as components
|
| 16 |
from openai import OpenAI
|
| 17 |
+
import os
|
| 18 |
|
| 19 |
st.set_page_config(page_title="TechZone AI Counsellor",page_icon=":left_speech_bubble", layout="centered", initial_sidebar_state="auto", menu_items=None)
|
| 20 |
|
|
|
|
| 25 |
</style>
|
| 26 |
|
| 27 |
"""
|
| 28 |
+
|
| 29 |
+
api = os.environ['api']
|
| 30 |
+
|
| 31 |
st.markdown(hide_streamlit_style, unsafe_allow_html=True)
|
| 32 |
|
| 33 |
+
client = OpenAI(api_key=api)
|
| 34 |
|
| 35 |
|
| 36 |
|
| 37 |
persist_directory = 'docs/chroma/chatbot2/'
|
| 38 |
|
| 39 |
+
embedding = OpenAIEmbeddings(api_key=api)
|
| 40 |
|
| 41 |
vectordb = Chroma(persist_directory=persist_directory, embedding_function=embedding)
|
| 42 |
|
| 43 |
+
llm = ChatOpenAI(model_name="gpt-3.5-turbo", temperature=0, api_key=api)
|
| 44 |
|
| 45 |
col1, col2 = st.columns([1, 3])
|
| 46 |
|