Novricana25 commited on
Commit
076b9b0
·
verified ·
1 Parent(s): db4e36f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -1,13 +1,16 @@
1
  import gradio as gr
2
- from transformers import BertTokenizer, BertModel
3
  import torch
4
  import pdfplumber
5
  from sklearn.feature_extraction.text import TfidfVectorizer
6
  from sklearn.metrics.pairwise import cosine_similarity
7
 
8
- # Load BERT once
9
- tokenizer = BertTokenizer.from_pretrained("bert-base-uncased")
10
- model = BertModel.from_pretrained("bert-base-uncased")
 
 
 
11
 
12
  def extract_text(file):
13
  with pdfplumber.open(file) as pdf:
@@ -43,7 +46,7 @@ demo = gr.Interface(
43
  inputs=[gr.File(label="Upload Resume (PDF)"), gr.Textbox(label="Paste Job Description")],
44
  outputs=["text"],
45
  title="Smart ATS Resume Optimizer",
46
- description="An AI tool that analyzes and optimizes your resume against job descriptions using NLP for better ATS compatibility.",
47
  )
48
 
49
  demo.launch()
 
1
  import gradio as gr
2
+ from transformers import AutoTokenizer, AutoModel
3
  import torch
4
  import pdfplumber
5
  from sklearn.feature_extraction.text import TfidfVectorizer
6
  from sklearn.metrics.pairwise import cosine_similarity
7
 
8
+ # ----------------------------------------------------------
9
+ # Load YOUR fine-tuned model from Hugging Face
10
+ # ----------------------------------------------------------
11
+ MODEL_NAME = "Novricana25/ats-bert-model"
12
+ tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME)
13
+ model = AutoModel.from_pretrained(MODEL_NAME)
14
 
15
  def extract_text(file):
16
  with pdfplumber.open(file) as pdf:
 
46
  inputs=[gr.File(label="Upload Resume (PDF)"), gr.Textbox(label="Paste Job Description")],
47
  outputs=["text"],
48
  title="Smart ATS Resume Optimizer",
49
+ description="Analyzes and scores how well a resume matches a job description using your fine-tuned BERT model hosted on Hugging Face.",
50
  )
51
 
52
  demo.launch()