Spaces:
Sleeping
Sleeping
Rename app_updated.py to app.py
Browse files- app_updated.py → app.py +4 -10
app_updated.py → app.py
RENAMED
|
@@ -15,17 +15,11 @@ from huggingface_hub import get_secret, SecretNotFoundError
|
|
| 15 |
logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s")
|
| 16 |
logger = logging.getLogger(__name__)
|
| 17 |
|
| 18 |
-
|
| 19 |
# Test if LLM_PROMPT is loaded correctly
|
| 20 |
-
|
| 21 |
-
|
| 22 |
|
| 23 |
-
try:
|
| 24 |
-
llm_prompt = get_secret("LLM_PROMPT") # Ensure "LLM_PROMPT" matches your secret name.
|
| 25 |
-
# Now you can use llm_prompt in your code
|
| 26 |
-
print("LLM_PROMPT was successfully retrieved from HuggingFace Secrets.")
|
| 27 |
-
except SecretNotFoundError:
|
| 28 |
-
st.error("LLM_PROMPT secret not found in Hugging Face secrets.")
|
| 29 |
|
| 30 |
# Initialize session state (ONLY for job description and flags)
|
| 31 |
if "job_description" not in st.session_state:
|
|
@@ -56,7 +50,7 @@ if "embedding_model" not in st.session_state:
|
|
| 56 |
st.session_state.embedding_model = SentenceTransformer('all-mpnet-base-v2')
|
| 57 |
|
| 58 |
if "groq_client" not in st.session_state:
|
| 59 |
-
st.session_state.groq_client = ChatGroq(api_key=
|
| 60 |
|
| 61 |
st.title("CV Assessment and Ranking App")
|
| 62 |
|
|
|
|
| 15 |
logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s")
|
| 16 |
logger = logging.getLogger(__name__)
|
| 17 |
|
| 18 |
+
load_dotenv()
|
| 19 |
# Test if LLM_PROMPT is loaded correctly
|
| 20 |
+
if os.environ.get("LLM_PROMPT") is None:
|
| 21 |
+
st.error("LLM_PROMPT is missing. Check your .env file!")
|
| 22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
# Initialize session state (ONLY for job description and flags)
|
| 25 |
if "job_description" not in st.session_state:
|
|
|
|
| 50 |
st.session_state.embedding_model = SentenceTransformer('all-mpnet-base-v2')
|
| 51 |
|
| 52 |
if "groq_client" not in st.session_state:
|
| 53 |
+
st.session_state.groq_client = ChatGroq(api_key=os.environ.get("GROQ_API_KEY"))
|
| 54 |
|
| 55 |
st.title("CV Assessment and Ranking App")
|
| 56 |
|