Spaces:
Runtime error
Runtime error
File size: 3,205 Bytes
3f49c4a c327216 b1753a9 b59748f 3f49c4a c327216 a9f3aed 3f49c4a a9f3aed c327216 3f49c4a c327216 a9f3aed 15a130b 9487604 c327216 3f49c4a c327216 3f49c4a c327216 b1753a9 3f49c4a 9487604 514a39a c327216 3f49c4a c327216 514a39a 9487604 a9f3aed c327216 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | from crew.til import TilCrew
import streamlit as st
from streamlit_extras.capture import stdout
# crew = TilCrew()
# results = crew.kickoff(inputs={"content": "Today I learnt Sidecar pattern"})
# results = crew.kickoff(inputs={"content": "Learnt about go-lang routines to add concurrency in the React App."})
# 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."})
# print(results)
def main():
st.set_page_config(page_title='Today I Learnt',
page_icon='📰', layout='wide')
st.markdown("<div class='container'>", unsafe_allow_html=True)
st.markdown(
"""
<div class="centered">
<p class="title">Today I Learnt Feedback</p>
<p class="description">Feedback on Today I Learnt</p>
</div>
""",
unsafe_allow_html=True
)
til_content = st.text_area('Enter what you learnt today:',
"My notes on Synthetic data:\n"
"What: Synthetic data is information that is not generated by real-world occurrences but is artificially generated. "
"Why is it needed? Product Testing, Training ML Algos, Reduced constraints when using reglated data."
"Types: Fully Synthetic data, Partially Synthetic data"
"Varities: Text, Tabular, Media."
"Benchmarks to consider: Accuracy, Privacy."
"Notes from https://www.turing.com/kb/synthetic-data-generation-techniques."
"Techniques: Statistical distribution, Agent to model, Using Deep Learning/Generative AI, Synthetic Minority Oversampling Technique.",
key='til_content', help='Enter what you learnt today', height=300)
if st.button("Get Feedback"):
with st.status(
"🤖 **Analysing TIL...**", state="running", expanded=True
) as status:
with st.container(height=500, border=False):
log_container = st.empty()
with stdout(log_container.code, terminator=""):
feedback = TilCrew()
inputs = {"notes": til_content}
results = feedback.kickoff(inputs=inputs)
status.update(
label="✅ Feedback ready!",
state="complete",
expanded=False,
)
for result in results:
# st.markdown(result)
st.markdown(f"#### TIL: {result['til']}")
st.markdown(f"**Feedback:** {result['feedback']}")
if result['feedback'] == "not_ok":
st.markdown(f"**Criteria:** {result['feedback_criteria']}")
st.markdown(f"**Reason:** {result['reason']}")
if result.get('suggestion') is not None:
st.markdown(f"**Suggestion:** {result['suggestion']}")
if __name__ == "__main__":
main()
|