DrishtiSharma commited on
Commit
fd1a052
·
verified ·
1 Parent(s): 0f450f2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -13
app.py CHANGED
@@ -1183,7 +1183,7 @@ def create_image(model: str) -> None:
1183
 
1184
  def create_text_image() -> None:
1185
  """
1186
- Generate text or image by using llm models like "gpt-4o".
1187
  """
1188
 
1189
  page_title = "LangChain LLM Agent"
@@ -1200,31 +1200,28 @@ def create_text_image() -> None:
1200
  # Initialize all the session state variables
1201
  initialize_session_state_variables()
1202
 
1203
- gpt_models = ("gpt-4o-mini", "gpt-4o")
 
1204
 
 
1205
  with st.sidebar:
1206
- st.write("")
1207
-
1208
  model = st.radio(
1209
  label="Models",
1210
  options=model_options,
 
1211
  label_visibility="collapsed",
1212
- index=1,
1213
  on_change=switch_between_apps,
1214
  )
1215
 
 
 
 
 
1216
  if model == "dall-e-3":
1217
  create_image(model)
1218
  else:
1219
  create_text(model)
1220
 
1221
- with st.sidebar:
1222
- st.write("---")
1223
- st.write(
1224
- "xyz",
1225
- unsafe_allow_html=True,
1226
- )
1227
-
1228
-
1229
  if __name__ == "__main__":
1230
  create_text_image()
 
1183
 
1184
  def create_text_image() -> None:
1185
  """
1186
+ Generate text or image by using LLM models like 'gpt-4o'.
1187
  """
1188
 
1189
  page_title = "LangChain LLM Agent"
 
1200
  # Initialize all the session state variables
1201
  initialize_session_state_variables()
1202
 
1203
+ # Define model options directly here
1204
+ model_options = ["gpt-4o-mini", "gpt-4o", "dall-e-3"]
1205
 
1206
+ # Sidebar content
1207
  with st.sidebar:
1208
+ st.write("**Select a Model**")
 
1209
  model = st.radio(
1210
  label="Models",
1211
  options=model_options,
1212
+ index=1, # Default to the second option
1213
  label_visibility="collapsed",
 
1214
  on_change=switch_between_apps,
1215
  )
1216
 
1217
+ st.write("---")
1218
+ st.write("xyz", unsafe_allow_html=True)
1219
+
1220
+ # Main logic for generating text or image
1221
  if model == "dall-e-3":
1222
  create_image(model)
1223
  else:
1224
  create_text(model)
1225
 
 
 
 
 
 
 
 
 
1226
  if __name__ == "__main__":
1227
  create_text_image()