Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
@@ -90,12 +90,11 @@ embedding_model = OpenAIEmbeddings(
|
|
90 |
llm = ChatOpenAI(
|
91 |
openai_api_base=endpoint, # Complete the code to define the endpoint
|
92 |
openai_api_key=api_key, # Complete the code to provide the API key
|
93 |
-
model="gpt-4o-mini", # Complete the code to define the
|
94 |
-
|
|
|
95 |
)
|
96 |
|
97 |
-
# This initializes the Chat OpenAI model with the provided endpoint, API key, deployment name, and a temperature setting of 0 (to control response variability).
|
98 |
-
|
99 |
# set the LLM and embedding model in the LlamaIndex settings.
|
100 |
Settings.llm = llm # Complete the code to define the LLM model
|
101 |
Settings.embedding = embedding_model # Complete the code to define the embedding model
|
@@ -792,7 +791,7 @@ def nutrition_disorder_streamlit():
|
|
792 |
user_query = user_query.strip()
|
793 |
else:
|
794 |
user_query = "" # Default to an empty string if no input is provided
|
795 |
-
|
796 |
if user_query:
|
797 |
if user_query.lower() == "exit":
|
798 |
st.session_state.chat_history.append({"role": "user", "content": "exit"})
|
|
|
90 |
llm = ChatOpenAI(
|
91 |
openai_api_base=endpoint, # Complete the code to define the endpoint
|
92 |
openai_api_key=api_key, # Complete the code to provide the API key
|
93 |
+
model="gpt-4o-mini", # Complete the code to define the deployment name
|
94 |
+
temperature=0.5, # Complete the code to set the temperature for the model
|
95 |
+
streaming=False # Turn off streaming
|
96 |
)
|
97 |
|
|
|
|
|
98 |
# set the LLM and embedding model in the LlamaIndex settings.
|
99 |
Settings.llm = llm # Complete the code to define the LLM model
|
100 |
Settings.embedding = embedding_model # Complete the code to define the embedding model
|
|
|
791 |
user_query = user_query.strip()
|
792 |
else:
|
793 |
user_query = "" # Default to an empty string if no input is provided
|
794 |
+
|
795 |
if user_query:
|
796 |
if user_query.lower() == "exit":
|
797 |
st.session_state.chat_history.append({"role": "user", "content": "exit"})
|