Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -1100,12 +1100,12 @@ def generate_word_document(json_path: Optional[str]) -> str:
|
|
| 1100 |
# FILE SAVING WITH MULTIPLE FALLBACKS
|
| 1101 |
try:
|
| 1102 |
# Generate appropriate filename
|
| 1103 |
-
|
| 1104 |
-
|
| 1105 |
clean_name = re.sub(r'[^\w\-]', '_', base_name)[:50] # Sanitize and truncate
|
| 1106 |
output_filename = f"{clean_name}_analysis_{time.strftime('%Y%m%d')}.docx"
|
| 1107 |
else:
|
| 1108 |
-
output_filename = f"job_analysis_{time.strftime('%Y%m%d_%H%M%S')}.docx"
|
| 1109 |
|
| 1110 |
# Try saving to reports directory first
|
| 1111 |
output_dir = "generated_reports"
|
|
@@ -1732,7 +1732,7 @@ progress::-webkit-progress-value {
|
|
| 1732 |
|
| 1733 |
<div class='benefits-grid'>
|
| 1734 |
<div class='benefit-card'>
|
| 1735 |
-
<p><strong>🔍 Strategic Workforce Management</strong>: Aligns existing positions with one
|
| 1736 |
</div>
|
| 1737 |
<div class='benefit-card'>
|
| 1738 |
<p><strong>⏱️ Time Saver</strong>: Reduces hours of manual research and mapping to minutes and minimise risk of errors</p>
|
|
@@ -1752,7 +1752,7 @@ progress::-webkit-progress-value {
|
|
| 1752 |
label="Upload a Post Description PDF file - not a scanned file!!!",
|
| 1753 |
file_types=[".pdf"])
|
| 1754 |
submit_btn = gr.Button(
|
| 1755 |
-
value="✨ Analyse
|
| 1756 |
variant="primary",
|
| 1757 |
elem_classes="btn-primary"
|
| 1758 |
)
|
|
|
|
| 1100 |
# FILE SAVING WITH MULTIPLE FALLBACKS
|
| 1101 |
try:
|
| 1102 |
# Generate appropriate filename
|
| 1103 |
+
base_name = os.path.splitext(os.path.basename(result['file']))[0]
|
| 1104 |
+
if base_name:
|
| 1105 |
clean_name = re.sub(r'[^\w\-]', '_', base_name)[:50] # Sanitize and truncate
|
| 1106 |
output_filename = f"{clean_name}_analysis_{time.strftime('%Y%m%d')}.docx"
|
| 1107 |
else:
|
| 1108 |
+
output_filename = f"job_analysis_{time.strftime('%Y%m%d_%H%M%S')}.docx"
|
| 1109 |
|
| 1110 |
# Try saving to reports directory first
|
| 1111 |
output_dir = "generated_reports"
|
|
|
|
| 1732 |
|
| 1733 |
<div class='benefits-grid'>
|
| 1734 |
<div class='benefit-card'>
|
| 1735 |
+
<p><strong>🔍 Strategic Workforce Management</strong>: Aligns existing positions with one among 28 distinct Job Families to enhance Career Development, as well as one among 225 <a href="https://icsc.un.org/Home/JobClassification">UN Common Classification of Occupational Groups</a> and 3007 <a href="https://esco.ec.europa.eu/en/classification">ESCO Framework Occupational Groups</a> to ease external sourcing </p>
|
| 1736 |
</div>
|
| 1737 |
<div class='benefit-card'>
|
| 1738 |
<p><strong>⏱️ Time Saver</strong>: Reduces hours of manual research and mapping to minutes and minimise risk of errors</p>
|
|
|
|
| 1752 |
label="Upload a Post Description PDF file - not a scanned file!!!",
|
| 1753 |
file_types=[".pdf"])
|
| 1754 |
submit_btn = gr.Button(
|
| 1755 |
+
value="✨ Analyse this Post Description! It should take about 2 minutes...",
|
| 1756 |
variant="primary",
|
| 1757 |
elem_classes="btn-primary"
|
| 1758 |
)
|