Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -69,18 +69,23 @@ def create_pdf(report_text):
|
|
| 69 |
pdf.output(output_path)
|
| 70 |
return output_path
|
| 71 |
|
|
|
|
|
|
|
| 72 |
def generate_wordcloud(missing_skills):
|
|
|
|
|
|
|
| 73 |
text = " ".join(missing_skills)
|
| 74 |
wordcloud = WordCloud(width=600, height=400, background_color='black', colormap='Set3').generate(text)
|
| 75 |
buffer = io.BytesIO()
|
| 76 |
-
plt.figure(figsize=(6,4))
|
| 77 |
plt.imshow(wordcloud, interpolation='bilinear')
|
| 78 |
plt.axis('off')
|
| 79 |
plt.tight_layout()
|
| 80 |
plt.savefig(buffer, format='png')
|
| 81 |
plt.close()
|
| 82 |
buffer.seek(0)
|
| 83 |
-
return buffer
|
|
|
|
| 84 |
|
| 85 |
def process_skill_gap(resume_pdf, jd_pdfs):
|
| 86 |
if resume_pdf is None or jd_pdfs is None:
|
|
|
|
| 69 |
pdf.output(output_path)
|
| 70 |
return output_path
|
| 71 |
|
| 72 |
+
from PIL import Image
|
| 73 |
+
|
| 74 |
def generate_wordcloud(missing_skills):
|
| 75 |
+
if not missing_skills:
|
| 76 |
+
return None
|
| 77 |
text = " ".join(missing_skills)
|
| 78 |
wordcloud = WordCloud(width=600, height=400, background_color='black', colormap='Set3').generate(text)
|
| 79 |
buffer = io.BytesIO()
|
| 80 |
+
plt.figure(figsize=(6, 4))
|
| 81 |
plt.imshow(wordcloud, interpolation='bilinear')
|
| 82 |
plt.axis('off')
|
| 83 |
plt.tight_layout()
|
| 84 |
plt.savefig(buffer, format='png')
|
| 85 |
plt.close()
|
| 86 |
buffer.seek(0)
|
| 87 |
+
return Image.open(buffer)
|
| 88 |
+
|
| 89 |
|
| 90 |
def process_skill_gap(resume_pdf, jd_pdfs):
|
| 91 |
if resume_pdf is None or jd_pdfs is None:
|