Jobanpreet commited on
Commit
e9081a1
1 Parent(s): 8380f70

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -30,7 +30,7 @@ if 'advancepost' not in session_state:
30
  session_state.advancepost = ""
31
 
32
  # url = st.sidebar.text_input("Enter URL:", placeholder="Enter URL here...")
33
- option = st.sidebar.selectbox('Select Model:', ('GPT-4',"Cohere"))
34
  temperature= st.sidebar.select_slider(
35
  'How much accurate post you want ?',
36
  options=['Less accuracy', 9, 8, 7, 6, 5,4,3 ,2,1,'High accuracy'])
@@ -42,7 +42,7 @@ temperature=temperature/10
42
 
43
  # stream_handler = StreamHandler(st.empty())
44
 
45
- if option=="GPT-4":
46
  api_key=st.sidebar.text_input("API Key:",placeholder="Enter OpenAI API Key...")
47
  if api_key:
48
  stream_handler = StreamHandler(st.empty())
@@ -130,7 +130,7 @@ if st.sidebar.toggle("Advance LinkedIn Post"):
130
  if st.sidebar.button("Generate Advance Post"):
131
  if url:
132
  if api_key:
133
- if option=="GPT-4":
134
  model=ChatOpenAI(model="gpt-4o" , temperature=temperature , api_key=api_key)
135
  elif option=="Cohere":
136
  model = ChatCohere(cohere_api_key=api_key,temperature=temperature)
 
30
  session_state.advancepost = ""
31
 
32
  # url = st.sidebar.text_input("Enter URL:", placeholder="Enter URL here...")
33
+ option = st.sidebar.selectbox('Select Model:', ('GPT-4o',"Cohere"))
34
  temperature= st.sidebar.select_slider(
35
  'How much accurate post you want ?',
36
  options=['Less accuracy', 9, 8, 7, 6, 5,4,3 ,2,1,'High accuracy'])
 
42
 
43
  # stream_handler = StreamHandler(st.empty())
44
 
45
+ if option=="GPT-4o":
46
  api_key=st.sidebar.text_input("API Key:",placeholder="Enter OpenAI API Key...")
47
  if api_key:
48
  stream_handler = StreamHandler(st.empty())
 
130
  if st.sidebar.button("Generate Advance Post"):
131
  if url:
132
  if api_key:
133
+ if option=="GPT-4o":
134
  model=ChatOpenAI(model="gpt-4o" , temperature=temperature , api_key=api_key)
135
  elif option=="Cohere":
136
  model = ChatCohere(cohere_api_key=api_key,temperature=temperature)