Oranblock commited on
Commit
232da3d
·
verified ·
1 Parent(s): 4da604f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +68 -170
app.py CHANGED
@@ -35,6 +35,73 @@ feedback_data = []
35
  # Initialize HfApi
36
  api = HfApi()
37
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  def set_sleep_time():
39
  sleep_start = time(hour=2, minute=0)
40
  sleep_end = time(hour=6, minute=0)
@@ -69,177 +136,7 @@ def analyze_sentiment(text):
69
  probabilities = torch.nn.functional.softmax(outputs.logits, dim=-1)
70
  return probabilities.cpu().numpy()[0]
71
 
72
- def generate_website_content():
73
- # Generate a random topic
74
- topics = [
75
- "space exploration",
76
- "artificial intelligence",
77
- "environmental conservation",
78
- "quantum computing",
79
- "renewable energy",
80
- "climate change",
81
- "biotechnology",
82
- "nanotechnology",
83
- "cybersecurity",
84
- "robotics",
85
- "virtual reality and augmented reality",
86
- "autonomous vehicles",
87
- "genetic engineering",
88
- "3D printing and additive manufacturing",
89
- "internet of things (IoT)",
90
- "blockchain technology",
91
- "sustainable agriculture",
92
- "smart cities",
93
- "digital health and telemedicine",
94
- "renewable energy storage solutions",
95
- "advanced materials science",
96
- "space tourism",
97
- "machine learning and data science",
98
- "oceanography and marine conservation",
99
- "AI ethics and governance",
100
- "futuristic urban planning",
101
- "exoplanet discovery and research",
102
- "space colonization",
103
- "artificial general intelligence (AGI)",
104
- "human-computer interaction",
105
- "sustainable architecture",
106
- "nuclear fusion research",
107
- "environmental impact of technology",
108
- "astrobiology",
109
- "bioinformatics",
110
- "synthetic biology",
111
- "renewable energy grid integration",
112
- "environmental policy and legislation",
113
- "human augmentation and enhancement",
114
- "climate engineering (geoengineering)",
115
- "space mining",
116
- "high-performance computing (HPC)",
117
- "sustainable transportation",
118
- "energy harvesting technologies",
119
- "cognitive computing",
120
- "deep learning and neural networks",
121
- "zero-waste living",
122
- "astrophysics and cosmology",
123
- "environmental education and awareness",
124
- "sustainable water management",
125
- "green technology innovation",
126
- "impact of AI on employment",
127
- "ethical hacking",
128
- "space weather and its impacts",
129
- "personalized medicine",
130
- "advanced prosthetics and bionics",
131
- "circular economy",
132
- "environmental justice",
133
- "human-robot collaboration",
134
- "artificial intelligence in art and creativity",
135
- "space telescopes and observatories",
136
- "AI in climate modeling",
137
- "renewable energy microgrids",
138
- "sustainable fashion",
139
- "quantum cryptography",
140
- "asteroid deflection strategies",
141
- "energy-efficient computing",
142
- "wildlife conservation and habitat preservation",
143
- "genomic editing and CRISPR",
144
- "big data analytics",
145
- "ethics in genetic engineering",
146
- "sustainable fisheries and aquaculture",
147
- "urban resilience to climate change",
148
- "AI in healthcare diagnostics",
149
- "space debris management",
150
- "eco-friendly packaging solutions",
151
- "AI in financial markets",
152
- "conservation technology",
153
- "interplanetary communication systems",
154
- "green building certifications (e.g., LEED)",
155
- "AI-powered drug discovery",
156
- "sustainable mining practices",
157
- "remote sensing for environmental monitoring",
158
- "space-based solar power",
159
- "conservation of endangered species",
160
- "AI in supply chain optimization",
161
- "sustainable product design",
162
- "space habitat design",
163
- "regenerative agriculture",
164
- "quantum teleportation",
165
- "sustainable tourism",
166
- "AI-driven autonomous systems",
167
- "carbon capture and storage (CCS)",
168
- "resilient infrastructure development",
169
- "planetary defense initiatives",
170
- "sustainable energy policies",
171
- "AI in language translation",
172
- "space medicine",
173
- "sustainable waste management",
174
- "advanced robotics in manufacturing",
175
- "precision agriculture",
176
- "smart grid technology",
177
- "biomimicry in engineering",
178
- "ethical AI development",
179
- "neurotechnology",
180
- "urban vertical farming",
181
- "quantum sensors",
182
- "blockchain in supply chain transparency",
183
- "AI in education and personalized learning",
184
- "sustainable fashion and textile innovation",
185
- "green chemistry",
186
- "smart home technology",
187
- "AI in cybersecurity",
188
- "sustainable packaging solutions",
189
- "edge computing",
190
- "autonomous drones in various industries",
191
- "AI in music composition",
192
- "sustainable urban mobility",
193
- "quantum machine learning",
194
- "bioplastics and biodegradable materials",
195
- "AI in weather forecasting",
196
- "sustainable construction materials",
197
- "brain-computer interfaces",
198
- "AI in legal tech and justice systems",
199
- "sustainable food systems",
200
- "quantum computing in finance",
201
- "smart wearable technology",
202
- "AI in agriculture (precision farming)",
203
- "sustainable aviation fuels",
204
- "advanced recycling technologies",
205
- "AI in content creation and journalism",
206
- "sustainable concrete alternatives",
207
- "quantum sensing in healthcare",
208
- "AI in customer service and chatbots",
209
- "sustainable urban water systems",
210
- "bioengineered organs",
211
- "AI in predictive maintenance",
212
- "sustainable packaging design",
213
- "quantum computing in drug discovery",
214
- "AI-powered personal assistants",
215
- "sustainable forestry practices",
216
- "next-generation batteries",
217
- "AI in sports analytics and training",
218
- "sustainable textile production",
219
- "quantum metrology",
220
- "AI in disaster prediction and management",
221
- "sustainable refrigeration technologies",
222
- "neuromorphic computing",
223
- "AI in wildlife conservation",
224
- "sustainable desalination techniques",
225
- "quantum-resistant cryptography",
226
- "AI in urban planning and design",
227
- "sustainable coffee production",
228
- "advanced materials for energy storage",
229
- "AI in mental health support",
230
- "sustainable chocolate production",
231
- "topological quantum computing",
232
- "AI in archaeological discoveries",
233
- "sustainable livestock management",
234
- "perovskite solar cells",
235
- "AI in air quality monitoring and improvement",
236
- "sustainable paper and pulp production"
237
- ]
238
- topic = random.choice(topics)
239
-
240
-
241
  def generate_random_css():
242
- # Generate random CSS properties
243
  font_families = ['Arial', 'Helvetica', 'Verdana', 'Georgia', 'Palatino', 'Garamond', 'Bookman', 'Comic Sans MS', 'Trebuchet MS', 'Arial Black']
244
 
245
  css = {
@@ -438,4 +335,5 @@ with gr.Blocks() as demo:
438
  # Set sleep time when the app starts
439
  set_sleep_time()
440
 
 
441
  demo.launch()
 
35
  # Initialize HfApi
36
  api = HfApi()
37
 
38
+ # Define the topics list in the global scope
39
+ topics = [
40
+ "space exploration", "artificial intelligence", "environmental conservation",
41
+ "quantum computing", "renewable energy", "climate change", "biotechnology",
42
+ "nanotechnology", "cybersecurity", "robotics", "virtual reality and augmented reality",
43
+ "autonomous vehicles", "genetic engineering", "3D printing and additive manufacturing",
44
+ "internet of things (IoT)", "blockchain technology", "sustainable agriculture",
45
+ "smart cities", "digital health and telemedicine", "renewable energy storage solutions",
46
+ "advanced materials science", "machine learning and data science",
47
+ "oceanography and marine conservation", "AI ethics and governance",
48
+ "futuristic urban planning", "human-computer interaction", "sustainable architecture",
49
+ "nuclear fusion research", "environmental impact of technology", "bioinformatics",
50
+ "synthetic biology", "renewable energy grid integration",
51
+ "environmental policy and legislation", "human augmentation and enhancement",
52
+ "climate engineering (geoengineering)", "high-performance computing (HPC)",
53
+ "sustainable transportation", "energy harvesting technologies", "cognitive computing",
54
+ "deep learning and neural networks", "zero-waste living",
55
+ "environmental education and awareness", "sustainable water management",
56
+ "green technology innovation", "impact of AI on employment", "ethical hacking",
57
+ "personalized medicine", "advanced prosthetics and bionics", "circular economy",
58
+ "environmental justice", "human-robot collaboration",
59
+ "artificial intelligence in art and creativity", "AI in climate modeling",
60
+ "renewable energy microgrids", "sustainable fashion", "quantum cryptography",
61
+ "energy-efficient computing", "wildlife conservation and habitat preservation",
62
+ "genomic editing and CRISPR", "big data analytics", "ethics in genetic engineering",
63
+ "sustainable fisheries and aquaculture", "urban resilience to climate change",
64
+ "AI in healthcare diagnostics", "eco-friendly packaging solutions",
65
+ "AI in financial markets", "conservation technology",
66
+ "green building certifications (e.g., LEED)", "AI-powered drug discovery",
67
+ "sustainable mining practices", "remote sensing for environmental monitoring",
68
+ "conservation of endangered species", "AI in supply chain optimization",
69
+ "sustainable product design", "regenerative agriculture", "quantum teleportation",
70
+ "sustainable tourism", "AI-driven autonomous systems",
71
+ "carbon capture and storage (CCS)", "resilient infrastructure development",
72
+ "sustainable energy policies", "AI in language translation",
73
+ "sustainable waste management", "advanced robotics in manufacturing",
74
+ "precision agriculture", "smart grid technology", "biomimicry in engineering",
75
+ "ethical AI development", "neurotechnology", "urban vertical farming",
76
+ "quantum sensors", "blockchain in supply chain transparency",
77
+ "AI in education and personalized learning", "sustainable fashion and textile innovation",
78
+ "green chemistry", "smart home technology", "AI in cybersecurity",
79
+ "sustainable packaging solutions", "edge computing",
80
+ "autonomous drones in various industries", "AI in music composition",
81
+ "sustainable urban mobility", "quantum machine learning",
82
+ "bioplastics and biodegradable materials", "AI in weather forecasting",
83
+ "sustainable construction materials", "brain-computer interfaces",
84
+ "AI in legal tech and justice systems", "sustainable food systems",
85
+ "quantum computing in finance", "smart wearable technology",
86
+ "AI in agriculture (precision farming)", "sustainable aviation fuels",
87
+ "advanced recycling technologies", "AI in content creation and journalism",
88
+ "sustainable concrete alternatives", "quantum sensing in healthcare",
89
+ "AI in customer service and chatbots", "sustainable urban water systems",
90
+ "bioengineered organs", "AI in predictive maintenance", "sustainable packaging design",
91
+ "quantum computing in drug discovery", "AI-powered personal assistants",
92
+ "sustainable forestry practices", "next-generation batteries",
93
+ "AI in sports analytics and training", "sustainable textile production",
94
+ "quantum metrology", "AI in disaster prediction and management",
95
+ "sustainable refrigeration technologies", "neuromorphic computing",
96
+ "AI in wildlife conservation", "sustainable desalination techniques",
97
+ "quantum-resistant cryptography", "AI in urban planning and design",
98
+ "sustainable coffee production", "advanced materials for energy storage",
99
+ "AI in mental health support", "sustainable chocolate production",
100
+ "topological quantum computing", "AI in archaeological discoveries",
101
+ "sustainable livestock management", "perovskite solar cells",
102
+ "AI in air quality monitoring and improvement", "sustainable paper and pulp production"
103
+ ]
104
+
105
  def set_sleep_time():
106
  sleep_start = time(hour=2, minute=0)
107
  sleep_end = time(hour=6, minute=0)
 
136
  probabilities = torch.nn.functional.softmax(outputs.logits, dim=-1)
137
  return probabilities.cpu().numpy()[0]
138
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
139
  def generate_random_css():
 
140
  font_families = ['Arial', 'Helvetica', 'Verdana', 'Georgia', 'Palatino', 'Garamond', 'Bookman', 'Comic Sans MS', 'Trebuchet MS', 'Arial Black']
141
 
142
  css = {
 
335
  # Set sleep time when the app starts
336
  set_sleep_time()
337
 
338
+ # Launch the demo
339
  demo.launch()