Spaces:
Runtime error
Runtime error
modified inital prompt for til
Browse files- crew/til.py +4 -4
- test.py +16 -9
crew/til.py
CHANGED
|
@@ -92,16 +92,16 @@ class TilCrew:
|
|
| 92 |
class TilFeedbackResult(BaseModel):
|
| 93 |
til: str = Field(description="TIL content the user has provided on which we are performing the analysis.")
|
| 94 |
insightful_score: int = Field(
|
| 95 |
-
description="TIL score on insightful criteria")
|
| 96 |
insightful_reason: str = Field(description="Reason for low insightful_score if it is not 10")
|
| 97 |
factuality_score: int = Field(
|
| 98 |
-
description="TIL score on factuality criteria and
|
| 99 |
factuality_reason: str = Field(description="Reason for low factuality_score if it is not 10")
|
| 100 |
simplicity_score: int = Field(
|
| 101 |
-
description="TIL score on simplicity criteria")
|
| 102 |
simplicity_reason: str = Field(description="Reason for low simplicity_score if it is not 10")
|
| 103 |
grammatical_score: int = Field(
|
| 104 |
-
description="TIL score on grammatical criteria")
|
| 105 |
grammatical_reason: str = Field(description="Reason for low grammatical_score if it is not 10")
|
| 106 |
final_suggestion: str = Field(
|
| 107 |
description="Final suggested version of the TIL")
|
|
|
|
| 92 |
class TilFeedbackResult(BaseModel):
|
| 93 |
til: str = Field(description="TIL content the user has provided on which we are performing the analysis.")
|
| 94 |
insightful_score: int = Field(
|
| 95 |
+
description="TIL score on insightful criteria and shouldn't take anything else into account.")
|
| 96 |
insightful_reason: str = Field(description="Reason for low insightful_score if it is not 10")
|
| 97 |
factuality_score: int = Field(
|
| 98 |
+
description="TIL score on factuality criteria and shouldn't take anything else into account.")
|
| 99 |
factuality_reason: str = Field(description="Reason for low factuality_score if it is not 10")
|
| 100 |
simplicity_score: int = Field(
|
| 101 |
+
description="TIL score on simplicity criteria and shouldn't take anything else into account.")
|
| 102 |
simplicity_reason: str = Field(description="Reason for low simplicity_score if it is not 10")
|
| 103 |
grammatical_score: int = Field(
|
| 104 |
+
description="TIL score on grammatical criteria and shouldn't take anything else into account.")
|
| 105 |
grammatical_reason: str = Field(description="Reason for low grammatical_score if it is not 10")
|
| 106 |
final_suggestion: str = Field(
|
| 107 |
description="Final suggested version of the TIL")
|
test.py
CHANGED
|
@@ -8,8 +8,10 @@ from streamlit_extras.capture import stdout
|
|
| 8 |
# results = crew.kickoff(inputs={"content": "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."})
|
| 9 |
# print(results)
|
| 10 |
|
|
|
|
| 11 |
def main():
|
| 12 |
-
st.set_page_config(page_title='Today I Learnt',
|
|
|
|
| 13 |
st.markdown("<div class='container'>", unsafe_allow_html=True)
|
| 14 |
|
| 15 |
st.markdown(
|
|
@@ -21,7 +23,11 @@ def main():
|
|
| 21 |
""",
|
| 22 |
unsafe_allow_html=True
|
| 23 |
)
|
| 24 |
-
til_content = st.text_area('Enter what you learnt today:',
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
|
| 26 |
if st.button("Get Feedback"):
|
| 27 |
with st.status(
|
|
@@ -40,13 +46,14 @@ def main():
|
|
| 40 |
)
|
| 41 |
|
| 42 |
for result in results:
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
|
|
|
| 50 |
|
| 51 |
if __name__ == "__main__":
|
| 52 |
main()
|
|
|
|
| 8 |
# results = crew.kickoff(inputs={"content": "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."})
|
| 9 |
# print(results)
|
| 10 |
|
| 11 |
+
|
| 12 |
def main():
|
| 13 |
+
st.set_page_config(page_title='Today I Learnt',
|
| 14 |
+
page_icon='📰', layout='wide')
|
| 15 |
st.markdown("<div class='container'>", unsafe_allow_html=True)
|
| 16 |
|
| 17 |
st.markdown(
|
|
|
|
| 23 |
""",
|
| 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", key='til_content', help='Enter what you learnt today')
|
| 31 |
|
| 32 |
if st.button("Get Feedback"):
|
| 33 |
with st.status(
|
|
|
|
| 46 |
)
|
| 47 |
|
| 48 |
for result in results:
|
| 49 |
+
st.markdown(f"#### TIL: {result['til']}")
|
| 50 |
+
st.markdown(f"**Feedback:** {result['feedback']}")
|
| 51 |
+
if result['feedback'] == "not_ok":
|
| 52 |
+
st.markdown(f"**Criteria:** {result['feedback_criteria']}")
|
| 53 |
+
st.markdown(f"**Reason:** {result['reason']}")
|
| 54 |
+
if result.get('suggestion') is not None:
|
| 55 |
+
st.markdown(f"**Suggestion:** {result['suggestion']}")
|
| 56 |
+
|
| 57 |
|
| 58 |
if __name__ == "__main__":
|
| 59 |
main()
|