Spaces:
Runtime error
Runtime error
til: prompt refactor
Browse files- crew/til.py +3 -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
|
| 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
|
| 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 |
-
"
|
| 28 |
-
"*
|
|
|
|
| 29 |
"* Advantages: takes lesser space and increases compute speed\n"
|
| 30 |
-
"* Disadvantages: Answers are less precise\n"
|
| 31 |
-
"
|
| 32 |
-
"*
|
| 33 |
-
"*
|
|
|
|
|
|
|
|
|
|
| 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"):
|