Update app.py
Browse files
app.py
CHANGED
@@ -254,110 +254,46 @@ def chat_with_file_contents(prompt, file_content, model_choice='gpt-3.5-turbo'):
|
|
254 |
response = client.chat.completions.create(model=model_choice, messages=conversation)
|
255 |
return response['choices'][0]['message']['content']
|
256 |
|
257 |
-
def
|
258 |
-
emojis = ["
|
259 |
random_emoji = random.choice(emojis)
|
260 |
-
st.markdown(f"[{random_emoji} {emoji_summary} - {title}]({url})")
|
261 |
|
262 |
python_parts = {
|
263 |
-
"
|
264 |
-
|
265 |
-
|
266 |
-
"emoji": "π",
|
267 |
-
"details": "numpy, pandas, matplotlib, requests, beautifulsoup4"
|
268 |
},
|
269 |
-
"
|
270 |
-
|
271 |
-
|
272 |
-
"emoji": "π",
|
273 |
-
"details": "folium, geopandas, plotly, basemap, cartopy, leaflet, mapboxgl"
|
274 |
},
|
275 |
-
"
|
276 |
-
"emoji": "
|
277 |
-
"details": "
|
278 |
},
|
279 |
-
"
|
280 |
-
"emoji": "
|
281 |
-
"details": "
|
282 |
},
|
283 |
-
"
|
284 |
-
"emoji": "
|
285 |
-
"details": "
|
286 |
},
|
287 |
-
"
|
288 |
-
"emoji": "
|
289 |
-
"details": "
|
290 |
-
}, "HTML5 Graphics Libraries": {
|
291 |
-
"emoji": "π",
|
292 |
-
"details": "aframe, threejs, p5.js, pixi.js, paper.js, babylonjs, d3.js, vis.js"
|
293 |
},
|
294 |
-
|
295 |
-
"emoji": "π»",
|
296 |
-
"details": "react, vue.js, angular, svelte, polymer, lit-element"
|
297 |
-
},
|
298 |
-
|
299 |
-
"Scientific & Data Analysis Libraries": {"emoji": "π§ͺ", "details": "Numpy, Pandas, Scikit-Learn, TensorFlow, SciPy, Pillow"},
|
300 |
-
"Advanced Concepts": {"emoji": "π§ ", "details": "Decorators, Generators, Context Managers, Metaclasses, Asynchronous Programming"},
|
301 |
-
"Web & Network Libraries": {"emoji": "πΈοΈ", "details": "Flask, Django, Requests, BeautifulSoup, HTTPX, Asyncio"},
|
302 |
-
"Streamlit & Extensions": {"emoji": "π‘", "details": "Streamli, Streamlit-AgGrid, Streamlit-Folium, Streamlit-Pandas-Profiling, Streamlit-Vega-Lite"},
|
303 |
-
"Gradio": {"emoji": "π‘", "details": "gradio"},
|
304 |
-
"File Handling & Serialization": {"emoji": "π", "details": "PyPDF2, Pytz, Json, Base64, Zipfile, Random, Glob, IO"},
|
305 |
-
"Machine Learning & AI": {"emoji": "π€", "details": "OpenAI, LangChain, HuggingFace"},
|
306 |
-
"Text & Data Extraction": {"emoji": "π", "details": "TikToken, Textract, SQLAlchemy, Pillow"},
|
307 |
-
"XML & Collections Libraries": {"emoji": "π", "details": "XML, Collections"},
|
308 |
-
"Web Development & Data Handling": {
|
309 |
-
"emoji": "π",
|
310 |
-
"details": "Requests, Pillow, SQLAlchemy, Flask, Django, SciPy, Beautiful Soup, PyTest, PyGame, Twisted"
|
311 |
-
},
|
312 |
-
"PDF & Time Management": {
|
313 |
-
"emoji": "π",
|
314 |
-
"details": "langchain, openai, PyPDF2, pytz"
|
315 |
-
},
|
316 |
-
"Interactive Apps & Streaming": {
|
317 |
-
"emoji": "π»",
|
318 |
-
"details": "streamlit, audio_recorder_streamlit, gradio"
|
319 |
-
},
|
320 |
-
"File & IO Operations": {
|
321 |
-
"emoji": "π",
|
322 |
-
"details": "tiktoken, textract, glob, io"
|
323 |
-
},
|
324 |
-
"Advanced Visualization": {
|
325 |
-
"emoji": "π¨",
|
326 |
-
"details": "matplotlib, seaborn, plotly, altair, bokeh, pydeck"
|
327 |
-
},
|
328 |
-
"Streamlit Extensions": {
|
329 |
-
"emoji": "βοΈ",
|
330 |
-
"details": "streamlit, streamlit-aggrid, streamlit-folium, streamlit-pandas-profiling, streamlit-vega-lite"
|
331 |
-
},
|
332 |
-
"Graph & Diagram Libraries": {
|
333 |
-
"emoji": "π",
|
334 |
-
"details": "holoviews, plotnine, graphviz"
|
335 |
-
},
|
336 |
-
"Data Encoding & Compression": {
|
337 |
-
"emoji": "π",
|
338 |
-
"details": "json, base64, zipfile, random"
|
339 |
-
},
|
340 |
-
"Networking & Asynchronous Operations": {
|
341 |
-
"emoji": "π©οΈ",
|
342 |
-
"details": "httpx, asyncio, xml, collections, huggingface"
|
343 |
-
},
|
344 |
-
"Syntax": {"emoji": "βοΈ", "details": "Variables, Comments, Printing"},
|
345 |
-
"Data Types": {"emoji": "π", "details": "Numbers, Strings, Lists, Tuples, Sets, Dictionaries"},
|
346 |
-
"Control Structures": {"emoji": "π", "details": "If, Elif, Else, Loops, Break, Continue"},
|
347 |
-
"Functions": {"emoji": "π§", "details": "Defining, Calling, Parameters, Return Values"},
|
348 |
-
"Classes": {"emoji": "ποΈ", "details": "Creating, Inheritance, Methods, Properties"},
|
349 |
-
"API Interaction": {"emoji": "π", "details": "Requests, JSON Parsing, HTTP Methods"},
|
350 |
-
"Error Handling": {"emoji": "β οΈ", "details": "Try, Except, Finally, Raising"},
|
351 |
-
|
352 |
-
|
353 |
}
|
354 |
|
355 |
|
|
|
356 |
response_placeholders = {}
|
357 |
example_placeholders = {}
|
358 |
|
359 |
def display_python_parts():
|
360 |
-
st.title("
|
361 |
for part, content in python_parts.items():
|
362 |
with st.expander(f"{content['emoji']} {part} - {content['details']}", expanded=False):
|
363 |
if st.button(f"Show Example for {part}", key=f"example_{part}"):
|
@@ -374,41 +310,18 @@ def display_python_parts():
|
|
374 |
response = chat_with_model(prompt, part)
|
375 |
response_placeholders[part] = response
|
376 |
st.code(response, language="python")
|
377 |
-
|
378 |
def add_paper_buttons_and_links():
|
379 |
-
page = st.sidebar.radio("Choose a page:", ["
|
380 |
-
if page == "
|
381 |
display_python_parts()
|
382 |
|
383 |
-
col1, col2, col3, col4 = st.columns(4)
|
384 |
-
|
385 |
with col1:
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
with col2:
|
393 |
-
with st.expander("AutoGen π€π", expanded=False):
|
394 |
-
link_button_with_emoji("https://arxiv.org/abs/2308.08155", "AutoGen", "π€π Multi-Agent LLM")
|
395 |
-
outline_autogen = "Cooperative Conversations, Combining Capabilities, Complex Task Solving, Divergent Thinking, Factuality, Highly Capable Agents, Generic Abstraction, Effective Implementation"
|
396 |
-
if st.button("Explore AutoGen Multi-Agent LLM"):
|
397 |
-
chat_with_model("Explore the key features of AutoGen: " + outline_autogen, "AutoGen")
|
398 |
-
|
399 |
-
with col3:
|
400 |
-
with st.expander("Whisper ππ§βπ", expanded=False):
|
401 |
-
link_button_with_emoji("https://arxiv.org/abs/2212.04356", "Whisper", "ππ§βπ Robust STT")
|
402 |
-
outline_whisper = "Scaling, Deep Learning Approaches, Weak Supervision, Zero-shot Transfer Learning, Accuracy & Robustness, Pre-training Techniques, Broad Range of Environments, Combining Multiple Datasets"
|
403 |
-
if st.button("Learn About Whisper STT"):
|
404 |
-
chat_with_model("Learn about the key features of Whisper: " + outline_whisper, "Whisper")
|
405 |
-
|
406 |
-
with col4:
|
407 |
-
with st.expander("ChatDev π¬π»", expanded=False):
|
408 |
-
link_button_with_emoji("https://arxiv.org/pdf/2307.07924.pdf", "ChatDev", "π¬π» Comm. Agents")
|
409 |
-
outline_chatdev = "Effective Communication, Comprehensive Software Solutions, Diverse Social Identities, Tailored Codes, Environment Dependencies, User Manuals"
|
410 |
-
if st.button("Deep Dive into ChatDev"):
|
411 |
-
chat_with_model("Deep dive into the features of ChatDev: " + outline_chatdev, "ChatDev")
|
412 |
|
413 |
add_paper_buttons_and_links()
|
414 |
|
|
|
254 |
response = client.chat.completions.create(model=model_choice, messages=conversation)
|
255 |
return response['choices'][0]['message']['content']
|
256 |
|
257 |
+
def link_button_with_custom_emoji_and_content(url, title, emoji_summary, extra_info):
|
258 |
+
emojis = ["π¦", "π¨", "π½οΈ", "ποΈ", "π²", "π", "ποΈ", "π£", "π£", "π", "π"]
|
259 |
random_emoji = random.choice(emojis)
|
260 |
+
st.markdown(f"[{random_emoji} {emoji_summary} - {title} - {extra_info}]({url})")
|
261 |
|
262 |
python_parts = {
|
263 |
+
"Deer Hunting in Minocqua": {
|
264 |
+
"emoji": "π¦",
|
265 |
+
"details": "Guides, Seasons, Regulations, Best Spots, Equipment Shops, Hunting Tales, Safety Tips, Local Wildlife, Conservation Efforts, Hunting Licenses"
|
|
|
|
|
266 |
},
|
267 |
+
"Hotels in Minocqua": {
|
268 |
+
"emoji": "π¨",
|
269 |
+
"details": "Luxury Resorts, Budget Stays, Lake Views, Amenities, Family-Friendly, Pet Policies, Historical Inns, Customer Reviews, Accessibility, Booking Tips"
|
|
|
|
|
270 |
},
|
271 |
+
"Dining in Minocqua": {
|
272 |
+
"emoji": "π½οΈ",
|
273 |
+
"details": "Gourmet Restaurants, Local Eateries, Lakeside Dining, Breakfast Spots, Vegan Options, Seafood Delicacies, Chefs' Specials, Cozy Cafes, Food Festivals, Culinary Tours"
|
274 |
},
|
275 |
+
"Shopping in Minocqua": {
|
276 |
+
"emoji": "ποΈ",
|
277 |
+
"details": "Boutiques, Gift Shops, Art Galleries, Outdoor Gear, Farmers Markets, Antique Stores, Local Crafts, Shopping Centers, Seasonal Sales, Fashion Trends"
|
278 |
},
|
279 |
+
"Points of Interest near Eagle River": {
|
280 |
+
"emoji": "π²",
|
281 |
+
"details": "Nature Trails, Waterfalls, Wildlife Sanctuaries, Historical Museums, Art Exhibits, Boat Tours, Fishing Spots, Camping Sites, Ski Resorts, Scenic Drives"
|
282 |
},
|
283 |
+
"Indian Legends of Wisconsin": {
|
284 |
+
"emoji": "π",
|
285 |
+
"details": "Creation Myths, Heroic Tales, Sacred Sites, Folklore Trails, Spiritual Beliefs, Tribal History, Storytelling Events, Cultural Festivals, Archaeological Finds, Language Preservation"
|
|
|
|
|
|
|
286 |
},
|
287 |
+
# ... [more sections as needed] ...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
288 |
}
|
289 |
|
290 |
|
291 |
+
|
292 |
response_placeholders = {}
|
293 |
example_placeholders = {}
|
294 |
|
295 |
def display_python_parts():
|
296 |
+
st.title("Hunting With Family In Wisconsin")
|
297 |
for part, content in python_parts.items():
|
298 |
with st.expander(f"{content['emoji']} {part} - {content['details']}", expanded=False):
|
299 |
if st.button(f"Show Example for {part}", key=f"example_{part}"):
|
|
|
310 |
response = chat_with_model(prompt, part)
|
311 |
response_placeholders[part] = response
|
312 |
st.code(response, language="python")
|
|
|
313 |
def add_paper_buttons_and_links():
|
314 |
+
page = st.sidebar.radio("Choose a page:", ["Hunting With Family In Wisconsin"])
|
315 |
+
if page == "Hunting With Family In Wisconsin":
|
316 |
display_python_parts()
|
317 |
|
|
|
|
|
318 |
with col1:
|
319 |
+
link_button_with_custom_emoji_and_content(
|
320 |
+
"https://en.wikipedia.org/wiki/Minocqua,_Wisconsin",
|
321 |
+
"Minocqua, Wisconsin",
|
322 |
+
"π¦ Deer Hunting - Explore the thrill of deer hunting in the beautiful landscapes of Minocqua",
|
323 |
+
"Discover the best spots and local legends"
|
324 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
325 |
|
326 |
add_paper_buttons_and_links()
|
327 |
|