0o7Hunk commited on
Commit
cfe2b9d
·
verified ·
1 Parent(s): 4b17b1d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -7
app.py CHANGED
@@ -49,7 +49,7 @@ st.title("💼 AI LinkedIn Post Generator")
49
  st.write("Create high-quality LinkedIn posts step-by-step 🚀")
50
 
51
  # ------------------ LOAD API KEY FROM ENV ------------------
52
- api_key = os.getenv("GROQ_API_KEY")
53
 
54
  # ------------------ SESSION STATE ------------------
55
  if "step" not in st.session_state:
@@ -105,12 +105,18 @@ elif st.session_state.step == 5:
105
 
106
  with st.spinner("Generating your post... ✨"):
107
 
108
- response = client.chat.completions.create(
109
- model="openai/gpt-oss-120b",
110
- messages=[{"role": "user", "content": prompt}],
111
- temperature=0.7,
112
- max_tokens=500
113
- )
 
 
 
 
 
 
114
  post = response.choices[0].message.content
115
 
116
  st.success("✅ Your LinkedIn Post is Ready!")
 
49
  st.write("Create high-quality LinkedIn posts step-by-step 🚀")
50
 
51
  # ------------------ LOAD API KEY FROM ENV ------------------
52
+ client = Groq(api_key=os.getenv("GROQ_API_KEY"))
53
 
54
  # ------------------ SESSION STATE ------------------
55
  if "step" not in st.session_state:
 
105
 
106
  with st.spinner("Generating your post... ✨"):
107
 
108
+ response = client.chat.completions.create(
109
+ model="mixtral-8x7b-32768",
110
+ messages=[
111
+ {"role": "user", "content": user_input}
112
+ ],
113
+ max_tokens=500
114
+ )
115
+
116
+ st.write(response.choices[0].message.content)
117
+
118
+ except Exception as e:
119
+ st.error(f"Error: {str(e)}")
120
  post = response.choices[0].message.content
121
 
122
  st.success("✅ Your LinkedIn Post is Ready!")