Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,9 @@
|
|
1 |
import streamlit as st
|
2 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, pipeline
|
3 |
|
|
|
|
|
|
|
4 |
# Load model and tokenizer
|
5 |
@st.cache_resource
|
6 |
def load_pipeline():
|
@@ -14,12 +17,12 @@ rephrase_pipeline = load_pipeline()
|
|
14 |
def tailor_resume(job_description, resume):
|
15 |
# Create a concise prompt
|
16 |
prompt = f"paraphrase: Adapt this resume for the job description.\nJob: {job_description}\nResume: {resume}"
|
17 |
-
output = rephrase_pipeline(
|
|
|
|
|
18 |
return output
|
19 |
|
20 |
-
#
|
21 |
-
st.set_page_config(page_title="Resume Tailor", layout="centered")
|
22 |
-
|
23 |
st.title("🎯 Resume Tailoring App")
|
24 |
st.write("Use AI to align your resume with a specific job description.")
|
25 |
|
|
|
1 |
import streamlit as st
|
2 |
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, pipeline
|
3 |
|
4 |
+
# ✅ MUST be the first Streamlit command
|
5 |
+
st.set_page_config(page_title="Resume Tailor", layout="centered")
|
6 |
+
|
7 |
# Load model and tokenizer
|
8 |
@st.cache_resource
|
9 |
def load_pipeline():
|
|
|
17 |
def tailor_resume(job_description, resume):
|
18 |
# Create a concise prompt
|
19 |
prompt = f"paraphrase: Adapt this resume for the job description.\nJob: {job_description}\nResume: {resume}"
|
20 |
+
output = rephrase_pipeline(
|
21 |
+
prompt, max_length=512, num_return_sequences=1, clean_up_tokenization_spaces=True
|
22 |
+
)[0]["generated_text"]
|
23 |
return output
|
24 |
|
25 |
+
# UI
|
|
|
|
|
26 |
st.title("🎯 Resume Tailoring App")
|
27 |
st.write("Use AI to align your resume with a specific job description.")
|
28 |
|