Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -54,9 +54,14 @@ if uploaded_file:
|
|
54 |
def get_final_output(full_text):
|
55 |
# Find the last occurrence of "### Output:" and return everything after it
|
56 |
if "### Output:" in full_text:
|
57 |
-
|
|
|
|
|
|
|
|
|
58 |
return full_text.strip()
|
59 |
|
|
|
60 |
# Define LLM Prompt Templates
|
61 |
email_template = PromptTemplate.from_template("""
|
62 |
You are an AI assistant skilled in crafting personalized and engaging cold emails for research positions.
|
|
|
54 |
def get_final_output(full_text):
|
55 |
# Find the last occurrence of "### Output:" and return everything after it
|
56 |
if "### Output:" in full_text:
|
57 |
+
output_text = full_text.split("### Output:", 1)[-1].strip()
|
58 |
+
# If there's an instruction-like sentence at the beginning, remove it
|
59 |
+
if "." in output_text:
|
60 |
+
output_text = output_text.split(".", 1)[-1].strip()
|
61 |
+
return output_text
|
62 |
return full_text.strip()
|
63 |
|
64 |
+
|
65 |
# Define LLM Prompt Templates
|
66 |
email_template = PromptTemplate.from_template("""
|
67 |
You are an AI assistant skilled in crafting personalized and engaging cold emails for research positions.
|