Phani1008 commited on
Commit
7b85c85
Β·
verified Β·
1 Parent(s): 69c4b71

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -49
app.py CHANGED
@@ -4,93 +4,67 @@ import requests
4
 
5
  # Function to load Lottie animations
6
  def load_lottieurl(url: str):
7
- r = requests.get(url)
8
- if r.status_code != 200:
 
 
 
 
 
9
  return None
10
- return r.json()
11
 
12
  # Load animations
13
- robot_animation= load_lottieurl("https://lottie.host/45619748-3867-4f57-8f50-cac297eca2da/1q98CFxp2I.json")
14
  hero_animation = load_lottieurl("https://assets9.lottiefiles.com/packages/lf20_touohxv0.json")
15
  data_science_animation = load_lottieurl("https://assets9.lottiefiles.com/packages/lf20_jcikwtux.json")
16
  ml_animation = load_lottieurl("https://assets3.lottiefiles.com/packages/lf20_vf9lvx3t.json")
17
  dl_animation = load_lottieurl("https://assets10.lottiefiles.com/packages/lf20_kuhijlvx.json")
18
  gen_ai_animation = load_lottieurl("https://assets4.lottiefiles.com/packages/lf20_x62chJ.json")
19
- lottie_animation_url = load_lottieurl("https://lottie.host/45619748-3867-4f57-8f50-cac297eca2da/1q98CFxp2I.json")
20
 
21
  # Home Page
22
  st.title("Zero to Hero in Machine Learning 🌟")
23
- st_lottie(hero_animation, height=300, key="hero")
24
-
25
 
26
  st.header("About the Author πŸ“–")
27
- st_lottie(robot_animation, height=300, key="robot")
28
- st_lottie(lottie_animation_url, height=100, key="ready")
 
29
  st.write("""
30
  Hi, I'm Phaneendra Bharadwaj, an aspiring data scientist and machine learning enthusiast.
31
  Here's a bit about me:
32
- - **Skills:** Python, Data Analysis, Machine Learning, Deep Learning, Generative AI.
33
  - **Experience:** I'm a Fresher, working on various ML related projects.
34
  """)
35
 
36
- st.markdown(
37
- """
38
- <div style="position: fixed; top: 20px; right: 20px; display: flex; align-items: center;">
39
- <div style="font-size:30px; color:#f39c12; font-weight:bold; animation: textAnimation 2s ease-in-out infinite; margin-right: 20px;">
40
- Hey User! Are you Ready??
41
- </div>
42
- <div>
43
- <!-- Lottie animation -->
44
- <div style="width: 100px; height: 100px;">
45
- <script src="https://cdnjs.cloudflare.com/ajax/libs/bodymovin/5.7.10/lottie.min.js"></script>
46
- <div id="lottie"></div>
47
- <script>
48
- var animation = bodymovin.loadAnimation({
49
- container: document.getElementById('lottie'),
50
- renderer: 'svg',
51
- loop: true,
52
- autoplay: true,
53
- path: 'https://lottie.host/45619748-3867-4f57-8f50-cac297eca2da/1q98CFxp2I.json'
54
- });
55
- </script>
56
- </div>
57
- </div>
58
- </div>
59
- <style>
60
- @keyframes textAnimation {
61
- 0% { color: #f39c12; transform: scale(1.1); }
62
- 50% { color: #e74c3c; transform: scale(1.2); }
63
- 100% { color: #f39c12; transform: scale(1.1); }
64
- }
65
- </style>
66
- """,
67
- unsafe_allow_html=True
68
- )
69
-
70
  # Sections
71
  st.subheader("πŸ“Š Data Science")
72
- st_lottie(data_science_animation, height=200, key="data_science")
 
73
  st.write("""
74
  Data Science involves extracting insights from data using statistical and computational techniques.
75
  **Example:** Predicting sales based on historical data.
76
  """)
77
 
78
  st.subheader("πŸ€– Machine Learning")
79
- st_lottie(ml_animation, height=200, key="machine_learning")
 
80
  st.write("""
81
  Machine Learning enables systems to learn from data and improve their performance without being explicitly programmed.
82
  **Example:** Spam email detection.
83
  """)
84
 
85
  st.subheader("🧠 Deep Learning")
86
- st_lottie(dl_animation, height=200, key="deep_learning")
 
87
  st.write("""
88
  Deep Learning is a subset of Machine Learning that uses neural networks with multiple layers to model complex patterns.
89
  **Example:** Image recognition, like identifying cats in pictures.
90
  """)
91
 
92
  st.subheader("✨ Generative AI")
93
- st_lottie(gen_ai_animation, height=200, key="gen_ai")
 
94
  st.write("""
95
  Generative AI creates new content by learning from existing data.
96
  **Example:** ChatGPT for generating human-like text responses.
@@ -98,4 +72,4 @@ Generative AI creates new content by learning from existing data.
98
 
99
  # Footer with animation
100
  st.write("---")
101
- st.markdown("**Let's embark on this journey from Zero to Hero! πŸš€**")
 
4
 
5
  # Function to load Lottie animations
6
  def load_lottieurl(url: str):
7
+ try:
8
+ r = requests.get(url)
9
+ r.raise_for_status() # Will raise an exception for 4xx/5xx errors
10
+ return r.json()
11
+ except requests.exceptions.RequestException as e:
12
+ # Log the error if the URL is not accessible or if there is any issue
13
+ st.error(f"Error loading Lottie animation from {url}: {e}")
14
  return None
 
15
 
16
  # Load animations
17
+ robot_animation = load_lottieurl("https://lottie.host/45619748-3867-4f57-8f50-cac297eca2da/1q98CFxp2I.json")
18
  hero_animation = load_lottieurl("https://assets9.lottiefiles.com/packages/lf20_touohxv0.json")
19
  data_science_animation = load_lottieurl("https://assets9.lottiefiles.com/packages/lf20_jcikwtux.json")
20
  ml_animation = load_lottieurl("https://assets3.lottiefiles.com/packages/lf20_vf9lvx3t.json")
21
  dl_animation = load_lottieurl("https://assets10.lottiefiles.com/packages/lf20_kuhijlvx.json")
22
  gen_ai_animation = load_lottieurl("https://assets4.lottiefiles.com/packages/lf20_x62chJ.json")
 
23
 
24
  # Home Page
25
  st.title("Zero to Hero in Machine Learning 🌟")
26
+ if hero_animation: # Only show if the animation was successfully loaded
27
+ st_lottie(hero_animation, height=300, key="hero")
28
 
29
  st.header("About the Author πŸ“–")
30
+ if robot_animation:
31
+ st_lottie(robot_animation, height=300, key="robot")
32
+
33
  st.write("""
34
  Hi, I'm Phaneendra Bharadwaj, an aspiring data scientist and machine learning enthusiast.
35
  Here's a bit about me:
36
+ - **Skills:** Python, Exploratory Data Analysis, Machine Learning, Deep Learning, Generative AI.
37
  - **Experience:** I'm a Fresher, working on various ML related projects.
38
  """)
39
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  # Sections
41
  st.subheader("πŸ“Š Data Science")
42
+ if data_science_animation:
43
+ st_lottie(data_science_animation, height=200, key="data_science")
44
  st.write("""
45
  Data Science involves extracting insights from data using statistical and computational techniques.
46
  **Example:** Predicting sales based on historical data.
47
  """)
48
 
49
  st.subheader("πŸ€– Machine Learning")
50
+ if ml_animation:
51
+ st_lottie(ml_animation, height=200, key="machine_learning")
52
  st.write("""
53
  Machine Learning enables systems to learn from data and improve their performance without being explicitly programmed.
54
  **Example:** Spam email detection.
55
  """)
56
 
57
  st.subheader("🧠 Deep Learning")
58
+ if dl_animation:
59
+ st_lottie(dl_animation, height=200, key="deep_learning")
60
  st.write("""
61
  Deep Learning is a subset of Machine Learning that uses neural networks with multiple layers to model complex patterns.
62
  **Example:** Image recognition, like identifying cats in pictures.
63
  """)
64
 
65
  st.subheader("✨ Generative AI")
66
+ if gen_ai_animation:
67
+ st_lottie(gen_ai_animation, height=200, key="gen_ai")
68
  st.write("""
69
  Generative AI creates new content by learning from existing data.
70
  **Example:** ChatGPT for generating human-like text responses.
 
72
 
73
  # Footer with animation
74
  st.write("---")
75
+ st.markdown("**Let's embark on this journey from Zero to Hero! πŸš€**")