Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -11,7 +11,8 @@ import textract
|
|
11 |
@st.cache_resource(show_spinner=False)
|
12 |
def load_summarization_pipeline():
|
13 |
try:
|
14 |
-
|
|
|
15 |
return summarizer
|
16 |
except Exception as e:
|
17 |
st.error(f"Error loading summarization model: {e}")
|
@@ -78,8 +79,8 @@ def summarize_text(text):
|
|
78 |
return "No text available to summarize."
|
79 |
|
80 |
try:
|
81 |
-
# Note: The summarization pipeline
|
82 |
-
#
|
83 |
summary = summarizer(text, max_length=150, min_length=40, do_sample=False)
|
84 |
return summary[0]["summary_text"]
|
85 |
except Exception as e:
|
@@ -103,7 +104,7 @@ st.title("Resume Summarization App")
|
|
103 |
st.markdown(
|
104 |
"""
|
105 |
Upload your resume file — supported formats: **.doc**, **.docx**, and **.txt**.
|
106 |
-
The app will extract the text content from your resume and generate a
|
107 |
"""
|
108 |
)
|
109 |
|
|
|
11 |
@st.cache_resource(show_spinner=False)
|
12 |
def load_summarization_pipeline():
|
13 |
try:
|
14 |
+
# Initialize the summarization pipeline using the specified model.
|
15 |
+
summarizer = pipeline("summarization", model="deepseek-ai/deepseek-vl2-tiny")
|
16 |
return summarizer
|
17 |
except Exception as e:
|
18 |
st.error(f"Error loading summarization model: {e}")
|
|
|
79 |
return "No text available to summarize."
|
80 |
|
81 |
try:
|
82 |
+
# Note: The summarization pipeline might have limitations on text length.
|
83 |
+
# For long documents, consider splitting the text into smaller chunks.
|
84 |
summary = summarizer(text, max_length=150, min_length=40, do_sample=False)
|
85 |
return summary[0]["summary_text"]
|
86 |
except Exception as e:
|
|
|
104 |
st.markdown(
|
105 |
"""
|
106 |
Upload your resume file — supported formats: **.doc**, **.docx**, and **.txt**.
|
107 |
+
The app will extract the text content from your resume and generate a summary.
|
108 |
"""
|
109 |
)
|
110 |
|