theRealNG commited on
Commit
cf5abc8
Β·
unverified Β·
2 Parent(s): 6f3201aab99f29

Merge pull request #16 from beautiful-code/restructure

Browse files
.streamlit/config.toml ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ [theme]
2
+ base="light"
README.md CHANGED
@@ -1,6 +1,6 @@
1
  ---
2
  title: AI Workflows
3
- app_file: main.py
4
  sdk: streamlit
5
  sdk_version: 1.35.0
6
  pinned: false
@@ -25,5 +25,5 @@ python_version: 3.11.0
25
 
26
 
27
  ### Running on local
28
- * Streamlit app `streamlit run main.py`
29
  * FastAPI app `uvicorn endpoints:app --port=8080`
 
1
  ---
2
  title: AI Workflows
3
+ app_file: ui/main.py
4
  sdk: streamlit
5
  sdk_version: 1.35.0
6
  pinned: false
 
25
 
26
 
27
  ### Running on local
28
+ * Streamlit app `streamlit run ui_main.py`
29
  * FastAPI app `uvicorn endpoints:app --port=8080`
api.py DELETED
@@ -1,13 +0,0 @@
1
- import streamlit as st
2
-
3
- def main():
4
- st.title("Growthy API Documentation")
5
-
6
- st.markdown("## Swagger UI")
7
- st.markdown('<iframe src="http://127.0.0.1:8000/documentation" width="100%" height="600px"></iframe>', unsafe_allow_html=True)
8
-
9
- st.markdown("## ReDoc")
10
- st.markdown('<iframe src="http://127.0.0.1:8000/redoc" width="100%" height="1000px"></iframe>', unsafe_allow_html=True)
11
-
12
- if __name__ == '__main__':
13
- main()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
endpoints.py CHANGED
@@ -37,8 +37,8 @@ app.add_middleware(
37
  allow_headers=["*"],
38
  )
39
 
40
- @app.get("/til_feedback", tags=["til_feedback"])
41
- async def til_feedback_kickoff(content: List[str] = Query(...)) -> til.TilFeedbackResponse:
42
  separator = "\n* "
43
  content[0] = "* " + content[0]
44
  inputs = {"content": separator.join(content)}
 
37
  allow_headers=["*"],
38
  )
39
 
40
+ @app.post("/til_feedback", tags=["til_feedback"])
41
+ async def til_feedback_kickoff(content: List[str]) -> til.TilFeedbackResponse:
42
  separator = "\n* "
43
  content[0] = "* " + content[0]
44
  inputs = {"content": separator.join(content)}
app.py β†’ ui/article_recommendation.py RENAMED
@@ -49,7 +49,7 @@ def main():
49
  "Disadvantages of Quantization: Less precise.\n\n",
50
  height=400,
51
  )
52
- st.markdown("")
53
  submitted = st.form_submit_button("Submit")
54
 
55
  if submitted:
 
49
  "Disadvantages of Quantization: Less precise.\n\n",
50
  height=400,
51
  )
52
+ st.markdown("")
53
  submitted = st.form_submit_button("Submit")
54
 
55
  if submitted:
main.css β†’ ui/main.css RENAMED
File without changes
research_paper.py β†’ ui/research_paper.py RENAMED
File without changes
test.py β†’ ui/til_feedback.py RENAMED
@@ -19,17 +19,10 @@ def main():
19
  unsafe_allow_html=True
20
  )
21
  til_content = st.text_area('Enter what you learnt today:',
22
- "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"
23
  "* Quantization is the process of reducing the size of LLM models by reducing the underlying weights.\n"
24
  "* 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"
25
  "* Advantages: takes lesser space and increases compute speed\n"
26
- "* Disadvantages: Answers are less precise\n\n"
27
- "My notes on Synthetic data:\n"
28
- "* Why is it needed? Product Testing, Training ML Algos, Reduced constraints when using reglated data.\n"
29
- "* Types: Fully Synthetic data, Partially Synthetic data\n"
30
- "* Varities: Text, Tabular, Media.\n"
31
- "* Benchmarks to consider: Accuracy, Privacy\n"
32
- "* Techniques: Statistical distribution, Agent to model, Using Deep Learning/Generative AI, Synthetic Minority Oversampling Technique.",
33
  key='til_content', help='Enter what you learnt today')
34
 
35
  if st.button("Get Feedback"):
 
19
  unsafe_allow_html=True
20
  )
21
  til_content = st.text_area('Enter what you learnt today:',
 
22
  "* Quantization is the process of reducing the size of LLM models by reducing the underlying weights.\n"
23
  "* 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"
24
  "* Advantages: takes lesser space and increases compute speed\n"
25
+ "* Disadvantages: Answers are less precise\n",
 
 
 
 
 
 
26
  key='til_content', help='Enter what you learnt today')
27
 
28
  if st.button("Get Feedback"):
main.py β†’ ui_main.py RENAMED
@@ -2,9 +2,9 @@ import streamlit as st
2
  from dotenv import load_dotenv
3
  from streamlit_extras.stylable_container import stylable_container
4
  from PIL import Image
5
- from app import main as article_recommendor_main
6
- from research_paper import main as research_article_suggester_main
7
- from test import main as feedback_main
8
 
9
  load_dotenv()
10
 
@@ -16,7 +16,7 @@ def load_css(file_name):
16
  return f.read()
17
 
18
  def main():
19
-
20
  if 'page' not in st.session_state:
21
  st.session_state.page = "main"
22
 
@@ -31,7 +31,7 @@ def main():
31
 
32
  def show_main_page():
33
 
34
- css = load_css("main.css")
35
  st.markdown(f"<style>{css}</style>", unsafe_allow_html=True)
36
 
37
  st.markdown('<div class="main-title">Welcome to the Multi-Page App!</div>', unsafe_allow_html=True)
@@ -44,7 +44,7 @@ def show_main_page():
44
  {"title": "Feedback", "description": "Provide your valuable feedback.", "key": "feedback"},
45
  ]
46
 
47
- num_cols = 3
48
  num_rows = (len(card_info) + num_cols - 1) // num_cols
49
 
50
  with stylable_container(
@@ -67,9 +67,9 @@ def show_main_page():
67
  with stylable_container(
68
  key="inside_container_with_border",
69
  css_styles="""
70
- {
71
- height: 500px;
72
- background-color: #f8f9fa;
73
  border-radius: 10px;
74
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.1);
75
  display: flex;
 
2
  from dotenv import load_dotenv
3
  from streamlit_extras.stylable_container import stylable_container
4
  from PIL import Image
5
+ from ui.article_recommendation import main as article_recommendor_main
6
+ from ui.research_paper import main as research_article_suggester_main
7
+ from ui.til_feedback import main as feedback_main
8
 
9
  load_dotenv()
10
 
 
16
  return f.read()
17
 
18
  def main():
19
+
20
  if 'page' not in st.session_state:
21
  st.session_state.page = "main"
22
 
 
31
 
32
  def show_main_page():
33
 
34
+ css = load_css("ui/main.css")
35
  st.markdown(f"<style>{css}</style>", unsafe_allow_html=True)
36
 
37
  st.markdown('<div class="main-title">Welcome to the Multi-Page App!</div>', unsafe_allow_html=True)
 
44
  {"title": "Feedback", "description": "Provide your valuable feedback.", "key": "feedback"},
45
  ]
46
 
47
+ num_cols = 3
48
  num_rows = (len(card_info) + num_cols - 1) // num_cols
49
 
50
  with stylable_container(
 
67
  with stylable_container(
68
  key="inside_container_with_border",
69
  css_styles="""
70
+ {
71
+ height: 500px;
72
+ background-color: #f8f9fa;
73
  border-radius: 10px;
74
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.1);
75
  display: flex;