Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
-
from sentence_transformers import SentenceTransformer
|
| 3 |
import os
|
| 4 |
from PyPDF2 import PdfReader
|
| 5 |
import docx
|
| 6 |
import re
|
| 7 |
import google.generativeai as genai
|
| 8 |
import pandas as pd
|
| 9 |
-
import concurrent.futures
|
| 10 |
|
| 11 |
# Load pre-trained embedding model for basic analysis
|
| 12 |
sentence_model = SentenceTransformer('paraphrase-MiniLM-L6-v2')
|
|
@@ -155,9 +156,13 @@ def process_resumes(job_desc_file, resumes):
|
|
| 155 |
# Define the key leadership and management skills you're looking for
|
| 156 |
required_skills = ["strategic planning", "team management", "project management", "decision making", "communication"]
|
| 157 |
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 161 |
|
| 162 |
# Create a pandas DataFrame for better formatting and downloadable output
|
| 163 |
df = pd.DataFrame(results)
|
|
|
|
| 1 |
+
import time
|
| 2 |
import gradio as gr
|
| 3 |
+
from sentence_transformers import SentenceTransformer
|
| 4 |
import os
|
| 5 |
from PyPDF2 import PdfReader
|
| 6 |
import docx
|
| 7 |
import re
|
| 8 |
import google.generativeai as genai
|
| 9 |
import pandas as pd
|
| 10 |
+
import concurrent.futures
|
| 11 |
|
| 12 |
# Load pre-trained embedding model for basic analysis
|
| 13 |
sentence_model = SentenceTransformer('paraphrase-MiniLM-L6-v2')
|
|
|
|
| 156 |
# Define the key leadership and management skills you're looking for
|
| 157 |
required_skills = ["strategic planning", "team management", "project management", "decision making", "communication"]
|
| 158 |
|
| 159 |
+
results = []
|
| 160 |
+
for idx, resume in enumerate(resumes):
|
| 161 |
+
# Add a small delay between requests to avoid rate-limiting
|
| 162 |
+
if idx > 0: # Skip delay for the first request
|
| 163 |
+
time.sleep(5) # Adjust the delay to suit your needs (e.g., 5 seconds)
|
| 164 |
+
|
| 165 |
+
results.append(process_resume(resume, job_desc, required_skills))
|
| 166 |
|
| 167 |
# Create a pandas DataFrame for better formatting and downloadable output
|
| 168 |
df = pd.DataFrame(results)
|