sreelekhaputta2 commited on
Commit
ce0bd0b
·
verified ·
1 Parent(s): e0de4ba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +73 -49
app.py CHANGED
@@ -1,55 +1,59 @@
1
-
2
  import gradio as gr
3
 
4
  projects = [
5
- {"name": "Idealyze", "desc": "AI-powered content optimization platform", "skills": ["NLP", "Transformers", "FastAPI"], "live": "https://huggingface.co/spaces/sreelekhaputta2/Idealyze", "video": "Idealyze.mp4"},
6
- {"name": "DivineLoop", "desc": "Real-time audio-visual looping generator", "skills": ["Audio Processing", "Computer Vision", "WebRTC"], "live": "https://huggingface.co/spaces/sreelekhaputta2/DivineLoop", "video": "Divineloop.mp4"},
7
- {"name": "GenDoc_AI", "desc": "Intelligent PDF document generation", "skills": ["LLMs", "PDF Generation", "LangChain"], "live": "https://huggingface.co/spaces/sreelekhaputta2/GenDoc_AI", "video": "GendocAI.mp4"},
8
- {"name": "LinkShield", "desc": "Advanced URL security threat detection", "skills": ["Cybersecurity", "API Integration", "FastAPI"], "live": "https://huggingface.co/spaces/sreelekhaputta2/LinkShield", "video": "Linkshield.mp4"},
9
- {"name": "Chatbot", "desc": "Multi-modal conversational AI with memory", "skills": ["LLMs", "RAG", "Vector DB"], "live": "https://huggingface.co/spaces/sreelekhaputta2/Chatbot", "video": "Wiseverse.mp4"},
10
- {"name": "AvatarVerse", "desc": "Photorealistic AI avatar generator", "skills": ["Stable Diffusion", "ControlNet", "GANs"], "live": "https://huggingface.co/spaces/sreelekhaputta2/AvatarVerse", "video": "Avatarverse.mp4"}
11
  ]
12
 
13
  css = """
14
  @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
15
 
16
- /* PERFECT BACKGROUND */
17
  .gradio-container {
18
  background: linear-gradient(rgba(10,10,26,0.92), rgba(45,27,105,0.92)),
19
  url('https://tse4.explicit.bing.net/th/id/OIP.CSOmF_Va1tPzTClwWuugnwHaEK?pid=Api&h=220&P=0') center/cover no-repeat !important;
20
  font-family: 'Inter', sans-serif !important;
21
  min-height: 100vh !important;
22
  color: white !important;
 
 
23
  }
24
 
25
- /* FORCE WHITE TEXT EVERYWHERE - LIGHT/DARK THEME SAFE */
26
- * {
27
  font-family: 'Inter', sans-serif !important;
28
  color: white !important;
29
- }
30
- body {
31
- margin: 0 !important;
32
- padding: 0 !important;
33
- overflow-x: hidden !important;
34
  background: transparent !important;
35
- color: white !important;
36
  }
37
 
38
- /* MOBILE PERFECT CENTERING */
 
 
 
 
 
 
 
39
  .center-content {
40
  display: flex !important;
41
  flex-direction: column !important;
42
  align-items: center !important;
43
- justify-content: center !important;
44
  text-align: center !important;
45
  width: 100% !important;
46
  max-width: 100% !important;
47
  margin: 0 auto !important;
48
  padding: 1rem !important;
 
49
  box-sizing: border-box !important;
50
  }
51
 
52
- /* GLASSMORPHISM CARDS */
53
  .glass-card {
54
  background: rgba(255, 255, 255, 0.25) !important;
55
  backdrop-filter: blur(30px) !important;
@@ -59,9 +63,11 @@ body {
59
  color: white !important;
60
  padding: 2rem !important;
61
  margin: 1rem auto !important;
 
 
62
  }
63
 
64
- /* PERFECT BUTTONS */
65
  .demo-btn {
66
  background: linear-gradient(135deg, #ff6b6b, #feca57) !important;
67
  border: none !important;
@@ -76,8 +82,6 @@ body {
76
  transition: all 0.3s ease !important;
77
  text-decoration: none !important;
78
  display: inline-block !important;
79
- text-align: center !important;
80
- line-height: 1.5 !important;
81
  box-shadow: 0 10px 30px rgba(255,107,107,0.4) !important;
82
  }
83
 
@@ -86,13 +90,19 @@ body {
86
  box-shadow: 0 20px 40px rgba(255, 107, 107, 0.6) !important;
87
  }
88
 
89
- /* FAST LOADING VIDEOS */
 
 
 
 
 
90
  .video-container video {
91
  width: 100% !important;
 
92
  max-height: 350px !important;
93
  border-radius: 16px !important;
94
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4) !important;
95
- margin-top: 1rem !important;
96
  }
97
 
98
  /* HEADER */
@@ -107,18 +117,24 @@ body {
107
  color: white !important;
108
  }
109
 
110
- /* TABS WHITE */
111
- .gradio-tabs, .tab-header, .tab-content { color: white !important; }
112
- .tab-button { color: white !important; }
 
 
 
 
 
 
113
 
114
  /* MOBILE PERFECTION */
115
  @media (max-width: 768px) {
116
- .gradio-container { padding: 0.5rem !important; }
117
  .center-content {
118
  padding: 1rem !important;
119
- margin: 0 !important;
120
  width: 100vw !important;
121
  max-width: 100vw !important;
 
122
  }
123
  .demo-btn {
124
  padding: 1rem 1.5rem !important;
@@ -128,52 +144,60 @@ body {
128
  .video-container video {
129
  max-height: 280px !important;
130
  width: 100% !important;
 
131
  }
132
  .header-gradient {
133
  padding: 2rem 1rem !important;
134
  margin: 1rem 0 !important;
135
  max-width: 95vw !important;
136
  }
137
- .glass-card { padding: 1.5rem 1rem !important; }
 
 
 
 
138
  }
 
 
 
139
  """
140
 
141
- with gr.Blocks(css=css) as demo:
142
  # HEADER
143
- gr.Markdown(
144
- "# ✨ **AI/ML Projects**\n\n**6 Production-Ready Projects • Live on Hugging Face Spaces**",
145
- elem_classes="header-gradient glass-card center-content"
146
- )
 
147
 
148
- # TABS
149
  with gr.Tabs(elem_classes="center-content"):
150
  for proj in projects:
151
  with gr.TabItem(proj["name"]):
152
- with gr.Column(elem_classes="glass-card center-content", scale=1):
153
- # PROJECT TITLE
154
- gr.Markdown(f"# 🚀 **{proj['name']}**")
155
 
156
  # DESCRIPTION
157
- gr.Markdown(f"**📝 {proj['desc']}**")
158
 
159
- # TECH STACK
160
- gr.Markdown(f"**🛠️ Tech Stack:** {' • '.join(proj['skills'])}")
161
 
162
- # LIVE DEMO BUTTON + ULTRA-FAST VIDEO
163
  gr.HTML(f'''
164
- <div style="text-align:center; width:100%;">
165
- <a href="{proj['live']}" target="_blank" class="demo-btn" style="text-decoration:none;">
166
  🎮 Launch {proj['name']} Live Demo
167
  </a>
168
  <div class="video-container">
169
  <video controls preload="metadata"
170
- style="width:100%; max-height:350px; border-radius:16px; margin-top:1rem; box-shadow:0 20px 40px rgba(0,0,0,0.4);">
171
  <source src="{proj['video']}" type="video/mp4">
172
- Video not supported
173
  </video>
174
  </div>
175
  </div>
176
  ''')
177
 
178
- # LAUNCH WITH SHARE LINK
179
- demo.launch(share=True, debug=True, height=950, show_error=True)
 
1
+ !pip install gradio==5.4.1 -q
2
  import gradio as gr
3
 
4
  projects = [
5
+ {"name": "Idealyze", "desc": "AI-powered content optimization platform", "skills": ["NLP", "Transformers", "FastAPI"], "live": "https://huggingface.co/spaces/sreelekhaputta2/Idealyze", "video": "./Idealyze.mp4"},
6
+ {"name": "DivineLoop", "desc": "Real-time audio-visual looping generator", "skills": ["Audio Processing", "Computer Vision", "WebRTC"], "live": "https://huggingface.co/spaces/sreelekhaputta2/DivineLoop", "video": "./Divineloop.mp4"},
7
+ {"name": "GenDoc_AI", "desc": "Intelligent PDF document generation", "skills": ["LLMs", "PDF Generation", "LangChain"], "live": "https://huggingface.co/spaces/sreelekhaputta2/GenDoc_AI", "video": "./GendocAI.mp4"},
8
+ {"name": "LinkShield", "desc": "Advanced URL security threat detection", "skills": ["Cybersecurity", "API Integration", "FastAPI"], "live": "https://huggingface.co/spaces/sreelekhaputta2/LinkShield", "video": "./Linkshield.mp4"},
9
+ {"name": "Chatbot", "desc": "Multi-modal conversational AI with memory", "skills": ["LLMs", "RAG", "Vector DB"], "live": "https://huggingface.co/spaces/sreelekhaputta2/Chatbot", "video": "./Wiseverse.mp4"},
10
+ {"name": "AvatarVerse", "desc": "Photorealistic AI avatar generator", "skills": ["Stable Diffusion", "ControlNet", "GANs"], "live": "https://huggingface.co/spaces/sreelekhaputta2/AvatarVerse", "video": "./Avatarverse.mp4"}
11
  ]
12
 
13
  css = """
14
  @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
15
 
16
+ /* PERFECT RESPONSIVE BACKGROUND */
17
  .gradio-container {
18
  background: linear-gradient(rgba(10,10,26,0.92), rgba(45,27,105,0.92)),
19
  url('https://tse4.explicit.bing.net/th/id/OIP.CSOmF_Va1tPzTClwWuugnwHaEK?pid=Api&h=220&P=0') center/cover no-repeat !important;
20
  font-family: 'Inter', sans-serif !important;
21
  min-height: 100vh !important;
22
  color: white !important;
23
+ padding: 0 !important;
24
+ margin: 0 !important;
25
  }
26
 
27
+ /* WHITE TEXT EVERYWHERE */
28
+ *, body {
29
  font-family: 'Inter', sans-serif !important;
30
  color: white !important;
 
 
 
 
 
31
  background: transparent !important;
 
32
  }
33
 
34
+ /* MOBILE SCROLL FIX */
35
+ html, body {
36
+ overflow-x: hidden !important;
37
+ overflow-y: auto !important;
38
+ height: 100% !important;
39
+ }
40
+
41
+ /* PERFECT CENTERING */
42
  .center-content {
43
  display: flex !important;
44
  flex-direction: column !important;
45
  align-items: center !important;
46
+ justify-content: flex-start !important;
47
  text-align: center !important;
48
  width: 100% !important;
49
  max-width: 100% !important;
50
  margin: 0 auto !important;
51
  padding: 1rem !important;
52
+ min-height: 100vh !important;
53
  box-sizing: border-box !important;
54
  }
55
 
56
+ /* GLASS CARDS */
57
  .glass-card {
58
  background: rgba(255, 255, 255, 0.25) !important;
59
  backdrop-filter: blur(30px) !important;
 
63
  color: white !important;
64
  padding: 2rem !important;
65
  margin: 1rem auto !important;
66
+ width: 100% !important;
67
+ max-width: 800px !important;
68
  }
69
 
70
+ /* BUTTONS */
71
  .demo-btn {
72
  background: linear-gradient(135deg, #ff6b6b, #feca57) !important;
73
  border: none !important;
 
82
  transition: all 0.3s ease !important;
83
  text-decoration: none !important;
84
  display: inline-block !important;
 
 
85
  box-shadow: 0 10px 30px rgba(255,107,107,0.4) !important;
86
  }
87
 
 
90
  box-shadow: 0 20px 40px rgba(255, 107, 107, 0.6) !important;
91
  }
92
 
93
+ /* MOBILE VIDEO FIX - FULL RESPONSIVE */
94
+ .video-container {
95
+ width: 100% !important;
96
+ max-width: 100% !important;
97
+ margin: 1rem 0 !important;
98
+ }
99
  .video-container video {
100
  width: 100% !important;
101
+ height: auto !important;
102
  max-height: 350px !important;
103
  border-radius: 16px !important;
104
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4) !important;
105
+ display: block !important;
106
  }
107
 
108
  /* HEADER */
 
117
  color: white !important;
118
  }
119
 
120
+ /* TABS WHITE + MOBILE */
121
+ .gradio-tabs, .tab-header, .tab-content, .tab-button {
122
+ color: white !important;
123
+ background: transparent !important;
124
+ }
125
+ .tab-item {
126
+ color: white !important;
127
+ min-height: 60vh !important;
128
+ }
129
 
130
  /* MOBILE PERFECTION */
131
  @media (max-width: 768px) {
132
+ .gradio-container { padding: 0 !important; margin: 0 !important; }
133
  .center-content {
134
  padding: 1rem !important;
 
135
  width: 100vw !important;
136
  max-width: 100vw !important;
137
+ overflow-y: auto !important;
138
  }
139
  .demo-btn {
140
  padding: 1rem 1.5rem !important;
 
144
  .video-container video {
145
  max-height: 280px !important;
146
  width: 100% !important;
147
+ height: auto !important;
148
  }
149
  .header-gradient {
150
  padding: 2rem 1rem !important;
151
  margin: 1rem 0 !important;
152
  max-width: 95vw !important;
153
  }
154
+ .glass-card {
155
+ padding: 1.5rem 1rem !important;
156
+ margin: 0.5rem 0 !important;
157
+ }
158
+ .tab-item { min-height: 70vh !important; }
159
  }
160
+
161
+ /* PREVENT HORIZONTAL SCROLL */
162
+ * { max-width: 100% !important; box-sizing: border-box !important; }
163
  """
164
 
165
+ with gr.Blocks(css=css, height=1000) as demo:
166
  # HEADER
167
+ with gr.Column(elem_classes="center-content"):
168
+ gr.Markdown(
169
+ "# **AI/ML Projects**\n\n**6 Production-Ready Projects • Live on Hugging Face Spaces**",
170
+ elem_classes="header-gradient glass-card"
171
+ )
172
 
173
+ # TABS WITH VIDEOS THAT WORK
174
  with gr.Tabs(elem_classes="center-content"):
175
  for proj in projects:
176
  with gr.TabItem(proj["name"]):
177
+ with gr.Column(elem_classes="glass-card center-content"):
178
+ # TITLE
179
+ gr.Markdown(f"# 🚀 **{proj['name']}**", elem_classes="center-content")
180
 
181
  # DESCRIPTION
182
+ gr.Markdown(f"**📝 {proj['desc']}**", elem_classes="center-content")
183
 
184
+ # SKILLS
185
+ gr.Markdown(f"**🛠️ Tech Stack:** {' • '.join(proj['skills'])}", elem_classes="center-content")
186
 
187
+ # BUTTON + VIDEO
188
  gr.HTML(f'''
189
+ <div style="width:100%; text-align:center; padding:1rem;">
190
+ <a href="{proj['live']}" target="_blank" class="demo-btn" style="text-decoration:none; display:inline-block;">
191
  🎮 Launch {proj['name']} Live Demo
192
  </a>
193
  <div class="video-container">
194
  <video controls preload="metadata"
195
+ style="width:100%; height:auto; max-height:350px; border-radius:16px; margin-top:1rem; box-shadow:0 20px 40px rgba(0,0,0,0.4); display:block;">
196
  <source src="{proj['video']}" type="video/mp4">
197
+ Your browser doesn't support video
198
  </video>
199
  </div>
200
  </div>
201
  ''')
202
 
203
+ demo.launch(share=True, debug=True, show_error=True, height=1000)