Sobit commited on
Commit
fa64ce4
·
verified ·
1 Parent(s): 13f63a9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -52,11 +52,11 @@ if uploaded_file:
52
  st.text_area("Preview:", extracted_text, height=150)
53
 
54
  def get_final_output(full_text):
55
- # If the model returns text with the prompt details followed by "### Output:", only keep what comes after it.
56
- if "### Output:" in full_text: ### Output:
57
- return full_text.split("### Output:")[-1].strip()
58
- else:
59
- return full_text.strip()
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.
 
52
  st.text_area("Preview:", extracted_text, height=150)
53
 
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
+ return full_text.split("### Output:", 1)[-1].strip()
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.