meesamraza commited on
Commit
5115d95
·
verified ·
1 Parent(s): f1542a8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -8
app.py CHANGED
@@ -1,5 +1,3 @@
1
- # src/streamlit_app.py
2
-
3
  import streamlit as st
4
  import pandas as pd
5
  import io
@@ -10,11 +8,11 @@ from groq import Groq
10
  from dotenv import load_dotenv
11
  from pydantic import BaseModel, Field
12
 
13
- # --- 1. CONFIGURATION AND INITIALIZATION ---
 
 
14
 
15
- # 🚨 FIX for .env: Load environment variables by explicitly pointing up one directory.
16
- # This ensures the script finds the .env file even though it's run from the 'src' folder.
17
- load_dotenv(os.path.join(os.path.dirname(__file__), '..', '.env'))
18
 
19
  GROQ_API_KEY = os.getenv("GROQ_API_KEY")
20
 
@@ -26,7 +24,7 @@ if GROQ_API_KEY:
26
  st.error(f"Error initializing Groq Client: {e}")
27
  st.stop()
28
  else:
29
- # This message should no longer appear if the .env fix works
30
  st.error("GROQ_API_KEY not found. Please ensure the .env file is in the project root and contains your key.")
31
  st.stop()
32
 
@@ -37,7 +35,7 @@ ADMIN_PASSWORD = "admin"
37
  if 'is_admin_logged_in' not in st.session_state:
38
  st.session_state.is_admin_logged_in = False
39
  if 'analyzed_data' not in st.session_state:
40
- # Define DataFrame with columns for initial structure
41
  initial_cols = [
42
  'Name', 'Job Role', 'Resume Score (100)', 'Email', 'Phone', 'Shortlisted',
43
  'Experience Summary', 'Education Summary', 'Communication Rating (1-10)',
 
 
 
1
  import streamlit as st
2
  import pandas as pd
3
  import io
 
8
  from dotenv import load_dotenv
9
  from pydantic import BaseModel, Field
10
 
11
+ # Test message to verify app is running
12
+ st.title("🛠️ Resume Analyzer App")
13
+ st.write("If you can see this, the app is running!")
14
 
15
+ load_dotenv('.env') # Look for .env in the same directory as the script
 
 
16
 
17
  GROQ_API_KEY = os.getenv("GROQ_API_KEY")
18
 
 
24
  st.error(f"Error initializing Groq Client: {e}")
25
  st.stop()
26
  else:
27
+
28
  st.error("GROQ_API_KEY not found. Please ensure the .env file is in the project root and contains your key.")
29
  st.stop()
30
 
 
35
  if 'is_admin_logged_in' not in st.session_state:
36
  st.session_state.is_admin_logged_in = False
37
  if 'analyzed_data' not in st.session_state:
38
+
39
  initial_cols = [
40
  'Name', 'Job Role', 'Resume Score (100)', 'Email', 'Phone', 'Shortlisted',
41
  'Experience Summary', 'Education Summary', 'Communication Rating (1-10)',