Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -23,6 +23,13 @@ from pydantic import BaseModel, Field, confloat
|
|
23 |
# model="deepseek-ai/DeepSeek-R1-Distill-Qwen-32B",
|
24 |
# api_base="http://localhost:8000" # or DeepSeek API
|
25 |
# )
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
class SkillScore(BaseModel):
|
27 |
skill_name: str = Field(description="Name of the skill being scored")
|
28 |
required: bool = Field(description="Whether this skill is required or nice-to-have")
|
@@ -248,7 +255,7 @@ resume_analyzer = Agent(
|
|
248 |
providing actionable suggestions for improvement. Your recommendations always
|
249 |
focus on both human readability and ATS compatibility.""",
|
250 |
verbose=True,
|
251 |
-
|
252 |
# knowledge_sources=[pdf_source],
|
253 |
)
|
254 |
job_analyzer = Agent(
|
@@ -261,7 +268,7 @@ job_analyzer = Agent(
|
|
261 |
and soft skills requirements, and can evaluate experience levels accurately.""",
|
262 |
verbose=True,
|
263 |
tools=[ScrapeWebsiteTool()],
|
264 |
-
|
265 |
|
266 |
# knowledge_sources=[pdf_source],
|
267 |
)
|
@@ -275,7 +282,7 @@ company_researcher = Agent(
|
|
275 |
candidates for interviews. """,
|
276 |
tools=[SerperDevTool()],
|
277 |
verbose=True,
|
278 |
-
|
279 |
|
280 |
# knowledge_sources=[pdf_source],
|
281 |
|
@@ -289,7 +296,7 @@ resume_writer = Agent (
|
|
289 |
beautifully formatted, ATS-friendly documents that maintain professionalism
|
290 |
while showcasing candidate strengths effectively.""",
|
291 |
verbose=True,
|
292 |
-
|
293 |
|
294 |
)
|
295 |
report_generator = Agent(
|
@@ -302,7 +309,7 @@ report_generator = Agent(
|
|
302 |
into clear, actionable insights with proper markdown formatting, emojis, and
|
303 |
visual elements that make information both appealing and easily digestible.""",
|
304 |
verbose=True,
|
305 |
-
|
306 |
|
307 |
)
|
308 |
|
@@ -499,7 +506,9 @@ def run_crew(api_key: str, job_url: str, company_name: str, resume_pdf_path: str
|
|
499 |
if not api_key:
|
500 |
return "⚠️ Please provide a valid OpenAI API Key."
|
501 |
|
502 |
-
os.environ["
|
|
|
|
|
503 |
# Load PDF as knowledge source
|
504 |
# pdf_source = resume_pdf_path
|
505 |
pdf_source = PDFKnowledgeSource(
|
|
|
23 |
# model="deepseek-ai/DeepSeek-R1-Distill-Qwen-32B",
|
24 |
# api_base="http://localhost:8000" # or DeepSeek API
|
25 |
# )
|
26 |
+
from langchain_community.llms import HuggingFaceHub
|
27 |
+
#HuggingFaceH4/zephyr-7b-beta"
|
28 |
+
llm = HuggingFaceHub(
|
29 |
+
repo_id="mistralai/Mistral-7B-Instruct-v0.2",
|
30 |
+
task="text-generation",
|
31 |
+
)
|
32 |
+
|
33 |
class SkillScore(BaseModel):
|
34 |
skill_name: str = Field(description="Name of the skill being scored")
|
35 |
required: bool = Field(description="Whether this skill is required or nice-to-have")
|
|
|
255 |
providing actionable suggestions for improvement. Your recommendations always
|
256 |
focus on both human readability and ATS compatibility.""",
|
257 |
verbose=True,
|
258 |
+
llm = llm,
|
259 |
# knowledge_sources=[pdf_source],
|
260 |
)
|
261 |
job_analyzer = Agent(
|
|
|
268 |
and soft skills requirements, and can evaluate experience levels accurately.""",
|
269 |
verbose=True,
|
270 |
tools=[ScrapeWebsiteTool()],
|
271 |
+
llm = llm,
|
272 |
|
273 |
# knowledge_sources=[pdf_source],
|
274 |
)
|
|
|
282 |
candidates for interviews. """,
|
283 |
tools=[SerperDevTool()],
|
284 |
verbose=True,
|
285 |
+
llm = llm,
|
286 |
|
287 |
# knowledge_sources=[pdf_source],
|
288 |
|
|
|
296 |
beautifully formatted, ATS-friendly documents that maintain professionalism
|
297 |
while showcasing candidate strengths effectively.""",
|
298 |
verbose=True,
|
299 |
+
llm = llm,
|
300 |
|
301 |
)
|
302 |
report_generator = Agent(
|
|
|
309 |
into clear, actionable insights with proper markdown formatting, emojis, and
|
310 |
visual elements that make information both appealing and easily digestible.""",
|
311 |
verbose=True,
|
312 |
+
llm = llm,
|
313 |
|
314 |
)
|
315 |
|
|
|
506 |
if not api_key:
|
507 |
return "⚠️ Please provide a valid OpenAI API Key."
|
508 |
|
509 |
+
os.environ["HUGGINGFACEHUB_API_TOKEN"] = f"{api_key}" # Set API key securely
|
510 |
+
# os.environ["HUGGINGFACEHUB_API_TOKEN"] = userdata.get('HF_TOKEN')
|
511 |
+
|
512 |
# Load PDF as knowledge source
|
513 |
# pdf_source = resume_pdf_path
|
514 |
pdf_source = PDFKnowledgeSource(
|