awacke1 commited on
Commit
03a7657
Β·
1 Parent(s): 0c2854f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +32 -119
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 link_button_with_emoji(url, title, emoji_summary):
258
- emojis = ["πŸ’‰", "πŸ₯", "🌑️", "🩺", "πŸ”¬", "πŸ’Š", "πŸ§ͺ", "πŸ‘¨β€βš•οΈ", "πŸ‘©β€βš•οΈ"]
259
  random_emoji = random.choice(emojis)
260
- st.markdown(f"[{random_emoji} {emoji_summary} - {title}]({url})")
261
 
262
  python_parts = {
263
- "Azure Cloud Libraries": {"emoji": "☁️", "details": "azure-sdk, azure-cosmos, azure-storage-blob, azure-storage-file-share, azure-storage-queue, azure-mgmt-containerinstance, azure-mgmt-containerregistry, azure-mgmt-cosmosdb, azure-mgmt-resource, azure-functions"},
264
- "Azure Development Tools": {"emoji": "πŸ› οΈ", "details": "azure-devtools, azure-cli-core, azure-cli, vscode-python"},
265
- "Data Science & Visualization": {
266
- "emoji": "πŸ“Š",
267
- "details": "numpy, pandas, matplotlib, requests, beautifulsoup4"
268
  },
269
- "Data Visualization Libraries1": {"emoji": "πŸ“ˆ", "details": "matplotlib, seaborn, plotly, altair, bokeh, pydeck"},
270
- "Data Visualization Libraries2": {"emoji": "πŸ“ˆ", "details": "holoviews, plotnine, graphviz"},
271
- "Python Mapping Libraries": {
272
- "emoji": "🌍",
273
- "details": "folium, geopandas, plotly, basemap, cartopy, leaflet, mapboxgl"
274
  },
275
- "3D Molecule Visualization Libraries": {
276
- "emoji": "πŸ”¬",
277
- "details": "rdkit, openbabel, py3Dmol, chemspipy, pymol"
278
  },
279
- "Data Analysis Libraries": {
280
- "emoji": "πŸ“Š",
281
- "details": "pandas, numpy, scipy, matplotlib, seaborn, plotly, scikit-learn, statsmodels, pyarrow"
282
  },
283
- "File and Directory Libraries": {
284
- "emoji": "πŸ“",
285
- "details": "os, pathlib, shutil, tempfile, glob, fnmatch"
286
  },
287
- "Filesystem Interaction Libraries": {
288
- "emoji": "πŸ’Ύ",
289
- "details": "fs, pyfilesystem2, watchdog, scandir, pyftpdlib, fusepy"
290
- }, "HTML5 Graphics Libraries": {
291
- "emoji": "🌐",
292
- "details": "aframe, threejs, p5.js, pixi.js, paper.js, babylonjs, d3.js, vis.js"
293
  },
294
- "HTML5 UI Interaction Libraries": {
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("Python Interactive Learning Platform")
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:", ["Python Pair Programmer"])
380
- if page == "Python Pair Programmer":
381
  display_python_parts()
382
 
383
- col1, col2, col3, col4 = st.columns(4)
384
-
385
  with col1:
386
- with st.expander("MemGPT πŸ§ πŸ’Ύ", expanded=False):
387
- link_button_with_emoji("https://arxiv.org/abs/2310.08560", "MemGPT", "πŸ§ πŸ’Ύ Memory OS")
388
- outline_memgpt = "Memory Hierarchy, Context Paging, Self-directed Memory Updates, Memory Editing, Memory Retrieval, Preprompt Instructions, Semantic Memory, Episodic Memory, Emotional Contextual Understanding"
389
- if st.button("Discuss MemGPT Features"):
390
- chat_with_model("Discuss the key features of MemGPT: " + outline_memgpt, "MemGPT")
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