theRealNG commited on
Commit
15a130b
·
1 Parent(s): e1c5a11

til: prompt refactor

Browse files
Files changed (2) hide show
  1. crew/til.py +3 -2
  2. test.py +10 -6
crew/til.py CHANGED
@@ -9,6 +9,7 @@ import pprint
9
  HIGH_IMPACT_THRESHOLD = 8
10
  LOW_IMPACT_THRESHOLD = 7
11
  OPENAI_MODEL = "gpt-4o"
 
12
 
13
  class TilCrew:
14
  def kickoff(self, inputs={}):
@@ -69,7 +70,7 @@ class TilCrew:
69
  feedback_parser = JsonOutputParser(pydantic_object=TilFeedbackResults)
70
  feedback_prompt = ChatPromptTemplate.from_messages([
71
  SystemMessage(
72
- "You are a 'Personal TIL Reviewer' who works in an Product Engineering Services company, you responsibility is to guide the user to write better TILs. "
73
  "Your personal goal is to review a user's list of TILs and suggeste edits based on the following criteria:\n"
74
  "1. Is the TIL insightful?"
75
  "2. Is the TIL factually correct and accurate?"
@@ -91,7 +92,7 @@ class TilCrew:
91
 
92
 
93
  class TilFeedbackResult(BaseModel):
94
- til: str = Field(description="TIL content the user has provided on which we are performing the analysis.")
95
  insightful_score: int = Field(
96
  description="TIL scores should be based solely on insightful criteria, with no other factors considered.")
97
  insightful_reason: str = Field(description="Feedback for low insightful_score if it is not 10")
 
9
  HIGH_IMPACT_THRESHOLD = 8
10
  LOW_IMPACT_THRESHOLD = 7
11
  OPENAI_MODEL = "gpt-4o"
12
+ # OPENAI_MODEL = "gpt-3.5-turbo"
13
 
14
  class TilCrew:
15
  def kickoff(self, inputs={}):
 
70
  feedback_parser = JsonOutputParser(pydantic_object=TilFeedbackResults)
71
  feedback_prompt = ChatPromptTemplate.from_messages([
72
  SystemMessage(
73
+ "You are a 'Personal TIL Reviewer' who works in a Product Engineering Services company. Your responsibility is to guide the user to write better TILs. "
74
  "Your personal goal is to review a user's list of TILs and suggeste edits based on the following criteria:\n"
75
  "1. Is the TIL insightful?"
76
  "2. Is the TIL factually correct and accurate?"
 
92
 
93
 
94
  class TilFeedbackResult(BaseModel):
95
+ til: str = Field(description="TIL as exactly captured by the user without any modifications.")
96
  insightful_score: int = Field(
97
  description="TIL scores should be based solely on insightful criteria, with no other factors considered.")
98
  insightful_reason: str = Field(description="Feedback for low insightful_score if it is not 10")
test.py CHANGED
@@ -24,13 +24,17 @@ def main():
24
  unsafe_allow_html=True
25
  )
26
  til_content = st.text_area('Enter what you learnt today:',
27
- "* Qunatization is the process of reducing the size of LLM models by reducing the underlying weights.\n"
28
- "* The weights are reduced by scaling down the datatypes from a datatype that takes larger space to a data type that takes a smaller space, this is also knows as downcasting.\n"
 
29
  "* Advantages: takes lesser space and increases compute speed\n"
30
- "* Disadvantages: Answers are less precise\n"
31
- "* Today I learnt Sidecar pattern\n"
32
- "* Learnt about go-lang routines to add concurrency in the React App.\n"
33
- "* Upon delving into the intricacies of Docker, I have acquired the capability to encapsulate our application within containers, thereby streamlining the deployment process across a multitude of heterogeneous environments.\n",
 
 
 
34
  key='til_content', help='Enter what you learnt today')
35
 
36
  if st.button("Get Feedback"):
 
24
  unsafe_allow_html=True
25
  )
26
  til_content = st.text_area('Enter what you learnt today:',
27
+ "I went through the following course on quantization of LLM: https://www.deeplearning.ai/short-courses/quantization-in-depth/ and here are my insights: \n"
28
+ "* Quantization is the process of reducing the size of LLM models by reducing the underlying weights.\n"
29
+ "* The weights are reduced by scaling down the datatypes from a datatype that takes larger space to a data type that takes a smaller space, this is also known as downcasting.\n"
30
  "* Advantages: takes lesser space and increases compute speed\n"
31
+ "* Disadvantages: Answers are less precise\n\n"
32
+ "My notes on Synthetic data:\n"
33
+ "* Why is it needed? Product Testing, Training ML Algos, Reduced constraints when using reglated data.\n"
34
+ "* Types: Fully Synthetic data, Partially Synthetic data\n"
35
+ "* Varities: Text, Tabular, Media.\n"
36
+ "* Benchmarks to consider: Accuracy, Privacy\n"
37
+ "* Techniques: Statistical distribution, Agent to model, Using Deep Learning/Generative AI, Synthetic Minority Oversampling Technique.",
38
  key='til_content', help='Enter what you learnt today')
39
 
40
  if st.button("Get Feedback"):