Spaces:
Running
Running
Download index.html from MrTheDerpier/Poe-Python-Blog: direct link, hf CLI and curl.
- Browser
- Download file 16.2 kB
-
https://huggingface.co/spaces/MrTheDerpier/Poe-Python-Blog/resolve/main/index.html
- Command line
-
hf download hf://spaces/MrTheDerpier/Poe-Python-Blog/index.html
-
curl -L -o index.html https://huggingface.co/spaces/MrTheDerpier/Poe-Python-Blog/resolve/main/index.html
16.2 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <meta name="theme-color" content="#f5f0e7"> | |
| <title>Experimenting with Poe's Python Interpreter</title> | |
| <link rel="preconnect" href="https://fonts.googleapis.com"> | |
| <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | |
| <link href="https://fonts.googleapis.com/css2?family=DM+Mono:wght@400;500&family=Merriweather:wght@400;700;900&family=Source+Sans+3:wght@400;500;600;700&display=swap" rel="stylesheet"> | |
| <style> | |
| :root { | |
| --paper: #f5f0e7; | |
| --paper-deep: #ebe3d6; | |
| --ink: #292821; | |
| --muted: #777366; | |
| --red: #b94d38; | |
| --red-dark: #913a2b; | |
| --green: #526b55; | |
| --line: #d9d0c2; | |
| --card: #fffdf8; | |
| --shadow: 0 12px 35px rgba(53, 43, 29, .08); | |
| } | |
| * { box-sizing: border-box; } | |
| html { scroll-behavior: smooth; } | |
| body { | |
| margin: 0; | |
| background: | |
| radial-gradient(ellipse at 12% 3%, rgba(185,77,56,.055), transparent 28rem), | |
| var(--paper); | |
| color: var(--ink); | |
| font-family: "Source Sans 3", sans-serif; | |
| font-size: 18px; | |
| line-height: 1.72; | |
| } | |
| a { color: var(--red-dark); text-decoration-thickness: 1px; text-underline-offset: 3px; } | |
| a:hover { color: var(--red); } | |
| main { max-width: 1120px; margin: 0 auto; padding: 62px 30px 100px; } | |
| .article { max-width: 790px; margin: 0 auto; } | |
| .eyebrow { | |
| display: flex; gap: 12px; align-items: center; | |
| color: var(--red-dark); font: 500 12px "DM Mono", monospace; | |
| letter-spacing: .12em; text-transform: uppercase; | |
| } | |
| .eyebrow::before { content: ""; width: 28px; height: 1px; background: var(--red); } | |
| h1, h2, h3, blockquote { font-family: "Merriweather", Georgia, serif; } | |
| h1 { | |
| font-size: clamp(2.45rem, 6vw, 4.7rem); | |
| line-height: 1.14; letter-spacing: -.055em; | |
| margin: 22px 0 22px; max-width: 850px; | |
| } | |
| .dek { font: 400 clamp(1.1rem, 2.5vw, 1.35rem)/1.65 "Merriweather", Georgia, serif; color: #615d52; max-width: 690px; } | |
| .byline { | |
| display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; | |
| margin: 30px 0 36px; color: var(--muted); font-size: 14px; | |
| } | |
| .byline .dot { width: 4px; height: 4px; border-radius: 50%; background: #aaa08f; } | |
| .hero-art { | |
| position: relative; overflow: hidden; min-height: 270px; | |
| margin: 0 0 48px; border-radius: 8px; | |
| background: #252a26; color: #f6f0e5; | |
| box-shadow: var(--shadow); | |
| } | |
| .hero-art::before, .hero-art::after { | |
| content: ""; position: absolute; border: 1px solid rgba(245,240,231,.16); | |
| border-radius: 50%; width: 360px; height: 360px; right: 9%; top: -52px; | |
| } | |
| .hero-art::after { width: 260px; height: 260px; right: 14%; top: -2px; } | |
| .hero-copy { position: relative; z-index: 2; padding: 38px 42px; max-width: 510px; } | |
| .hero-copy small { color: #d9a18f; font: 12px "DM Mono", monospace; letter-spacing: .12em; text-transform: uppercase; } | |
| .hero-copy h2 { font-size: clamp(1.6rem, 4vw, 2.6rem); line-height: 1.25; margin: 14px 0; } | |
| .hero-copy p { color: #d1d0c5; margin: 0; max-width: 410px; font-size: 16px; } | |
| .orbit { position: absolute; right: 20%; top: 44%; width: 12px; height: 12px; border-radius: 50%; background: #d9785f; box-shadow: 0 0 24px #d9785f; animation: orbit 8s linear infinite; transform-origin: 0 0; } | |
| @keyframes orbit { from { transform: rotate(0deg) translateX(145px) rotate(0deg); } to { transform: rotate(360deg) translateX(145px) rotate(-360deg); } } | |
| article section { margin: 55px 0; } | |
| h2 { font-size: clamp(1.55rem, 3vw, 2.1rem); line-height: 1.3; letter-spacing: -.035em; margin: 0 0 20px; } | |
| h3 { font-size: 1.2rem; margin: 0 0 10px; } | |
| p { margin: 0 0 19px; } | |
| .lead { font-family: "Merriweather", Georgia, serif; font-size: 1.08rem; line-height: 1.9; } | |
| .note { | |
| border-left: 3px solid var(--red); padding: 16px 20px; | |
| margin: 26px 0; background: rgba(255,253,248,.72); | |
| color: #575347; font-size: 16px; | |
| } | |
| .metrics { | |
| display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; | |
| margin: 28px 0; | |
| } | |
| .metric { | |
| background: var(--card); border: 1px solid var(--line); | |
| border-radius: 7px; padding: 18px 16px; box-shadow: 0 5px 16px rgba(53,43,29,.035); | |
| } | |
| .metric strong { display: block; font: 900 clamp(1.5rem, 3vw, 2.15rem) "Merriweather", Georgia, serif; color: var(--red-dark); line-height: 1.3; } | |
| .metric span { display: block; color: var(--muted); font-size: 13px; margin-top: 6px; } | |
| .chart-card { | |
| margin: 26px 0; padding: 24px; background: var(--card); | |
| border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow); | |
| } | |
| .chart-title { display: flex; justify-content: space-between; gap: 15px; align-items: baseline; margin-bottom: 18px; } | |
| .chart-title h3 { margin: 0; } | |
| .chart-title small { color: var(--muted); font: 11px "DM Mono", monospace; text-transform: uppercase; letter-spacing: .08em; } | |
| .bar-row { display: grid; grid-template-columns: 170px 1fr 64px; gap: 12px; align-items: center; margin: 17px 0; font-size: 14px; } | |
| .bar-label { color: #514d43; } | |
| .bar-track { height: 12px; background: #ece6db; border-radius: 20px; overflow: hidden; } | |
| .bar-fill { width: 0; height: 100%; border-radius: inherit; background: var(--green); transition: width 1.2s cubic-bezier(.2,.8,.2,1); } | |
| .bar-value { text-align: right; font: 500 13px "DM Mono", monospace; } | |
| .chart-foot { color: var(--muted); font-size: 13px; margin: 20px 0 0; } | |
| .code-quote { | |
| margin: 25px 0; padding: 21px 24px; background: #292e29; | |
| color: #e7e4d9; border-radius: 7px; font: 13px/1.8 "DM Mono", monospace; | |
| overflow-x: auto; | |
| } | |
| .code-quote .dim { color: #9ca997; } | |
| .code-quote .accent { color: #e59b83; } | |
| .split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 25px 0; } | |
| .info-card { padding: 22px; background: rgba(255,253,248,.8); border: 1px solid var(--line); border-radius: 7px; } | |
| .info-card p { font-size: 15px; margin: 0; color: #625e53; } | |
| .info-card .tag { font: 11px "DM Mono", monospace; color: var(--red-dark); text-transform: uppercase; letter-spacing: .08em; } | |
| ul { padding-left: 23px; } | |
| li { margin: 7px 0; } | |
| blockquote { | |
| margin: 34px 0; padding: 8px 0 8px 25px; border-left: 3px solid var(--red); | |
| font-size: 1.3rem; line-height: 1.65; color: #555044; | |
| } | |
| footer { | |
| margin-top: 75px; padding-top: 24px; border-top: 1px solid var(--line); | |
| color: var(--muted); font-size: 14px; | |
| } | |
| .footer-tags { font: 12px "DM Mono", monospace; color: var(--red-dark); margin-top: 15px; } | |
| .reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; } | |
| .reveal.visible { opacity: 1; transform: translateY(0); } | |
| @media (max-width: 650px) { | |
| main { padding: 42px 20px 70px; } | |
| .hero-copy { padding: 30px 25px; } | |
| .metrics { grid-template-columns: 1fr; } | |
| .metric { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; } | |
| .metric span { text-align: right; } | |
| .bar-row { grid-template-columns: 1fr 55px; gap: 7px 12px; } | |
| .bar-label { grid-column: 1 / -1; } | |
| .bar-track { grid-column: 1; } | |
| .bar-value { grid-column: 2; grid-row: 2; } | |
| .split { grid-template-columns: 1fr; } | |
| .chart-card { padding: 18px; } | |
| } | |
| @media (prefers-reduced-motion: reduce) { | |
| *, *::before, *::after { scroll-behavior: auto ; animation-duration: .01ms ; transition-duration: .01ms ; } | |
| } | |
| </style> | |
| </head> | |
| <body> | |
| <main> | |
| <article class="article"> | |
| <div class="eyebrow">Python · Machine learning · Experiments</div> | |
| <h1>Experimenting with Poe's Python Interpreter</h1> | |
| <p class="dek">A tiny interpreter, a handful of neural networks, one very confused Markov chain, and a surprisingly affordable price tag.</p> | |
| <div class="byline"> | |
| <span>By an overly curious tinkerer</span><span class="dot"></span> | |
| <span>Experiment notes</span><span class="dot"></span> | |
| <span>Updated with timeout test</span> | |
| </div> | |
| <div class="hero-art"> | |
| <div class="hero-copy"> | |
| <small>Field notes / 001</small> | |
| <h2>How much can you do with a Python box?</h2> | |
| <p>I found a little Python interpreter on Poe and, naturally, started throwing machine-learning experiments at it.</p> | |
| </div> | |
| <div class="orbit"></div> | |
| </div> | |
| <section class="reveal"> | |
| <p class="lead">I recently discovered <strong>Python</strong>, (they really could've thought of a better name) a Python interpreter bot on Poe by the official @poe account, and decided to see how much I could actually do with its environment.</p> | |
| <p>I ended up going down a pretty interesting rabbit hole.</p> | |
| <p>Using Python 3.11 and PyTorch, I ran several experiments entirely inside the interpreter, without needing to set up my own Python environment.</p> | |
| </section> | |
| <section class="reveal"> | |
| <h2>Machine Learning Libraries</h2> | |
| <p>The bot's description advertises several preinstalled libraries, including:</p> | |
| <ul> | |
| <li><strong>PyTorch:</strong> Neural networks and deep learning.</li> | |
| <li><strong>TensorFlow:</strong> Another major deep learning framework.</li> | |
| <li><strong>scikit-learn:</strong> Traditional machine learning.</li> | |
| <li><strong>NumPy and SciPy:</strong> Numerical computing and scientific operations.</li> | |
| <li><strong>Pandas:</strong> Working with datasets.</li> | |
| </ul> | |
| <p>There are also around 150 other commonly used Python libraries advertised. (but it doesn't list which ones specifically)</p> | |
| <div class="note"><strong>One issue:</strong> TensorFlow was listed in the description, but it just.. didn't work.</div> | |
| </section> | |
| <section class="reveal"> | |
| <h2>Neural Network Experiments</h2> | |
| <p>I trained a small neural network to classify different datasets. Here's how it performed on completely separate test examples:</p> | |
| <div class="metrics"> | |
| <div class="metric"><strong data-count="99.68">0%</strong><span>Quadrant classification</span></div> | |
| <div class="metric"><strong data-count="100">0%</strong><span>Interleaving spirals</span></div> | |
| <div class="metric"><strong data-count="99">0%</strong><span>Noisy spirals</span></div> | |
| </div> | |
| <div class="chart-card"> | |
| <div class="chart-title"><h3>Unseen test accuracy</h3><small>Measured results</small></div> | |
| <div class="bar-row"><span class="bar-label">Quadrant classification</span><div class="bar-track"><div class="bar-fill" data-width="99.68"></div></div><span class="bar-value">99.68%</span></div> | |
| <div class="bar-row"><span class="bar-label">Interleaving spirals</span><div class="bar-track"><div class="bar-fill" data-width="100"></div></div><span class="bar-value">100.00%</span></div> | |
| <div class="bar-row"><span class="bar-label">Noisy spirals</span><div class="bar-track"><div class="bar-fill" data-width="99"></div></div><span class="bar-value">99.00%</span></div> | |
| <p class="chart-foot">Each model was evaluated on a separately generated test set. These are synthetic classification tasks, not real-world benchmarks.</p> | |
| </div> | |
| <p>The spiral experiment was particularly interesting. A network with only 33,666 parameters learned to distinguish two interleaving spirals, achieving 100% accuracy on 10,000 independently generated test examples.</p> | |
| <div class="code-quote"><span class="dim"># The tiny spiral classifier</span><br> | |
| Parameters <span class="accent">33,666</span><br> | |
| Training examples <span class="accent">20,000</span><br> | |
| Unseen test examples <span class="accent">10,000</span><br> | |
| Test accuracy <span class="accent">100.00%</span> | |
| </div> | |
| </section> | |
| <section class="reveal"> | |
| <h2>Markov Chain Test</h2> | |
| <p>I also built a tiny character-level Markov chain.</p> | |
| <p>It learned character patterns from a short training corpus and generated its own text.</p> | |
| <p>The results were... questionable.</p> | |
| <p>It could produce recognizable phrases, but also said things like "wantered learnings." Not exactly Shakespeare.</p> | |
| <div class="code-quote"><span class="dim"># A small sample of its literary genius</span><br> | |
| the robot explored internet. the little robot kept<br> | |
| the little robot read everesting. one day the robot<br> | |
| was full of books computer wan | |
| </div> | |
| </section> | |
| <section class="reveal"> | |
| <h2>A Few Environment Discoveries</h2> | |
| <p>I investigated the interpreter's environment and found:</p> | |
| <div class="split"> | |
| <div class="info-card"><div class="tag">Runtime</div><h3>Python 3.11.18</h3><p>PyTorch 2.0.1, along with NumPy, SciPy, scikit-learn, pandas, and other advertised libraries.</p></div> | |
| <div class="info-card"><div class="tag">Compute</div><h3>17 logical CPUs</h3><p>Visible to Python, with approximately 1.76 GiB of visible system memory.</p></div> | |
| <div class="info-card"><div class="tag">Graphics</div><h3>No CUDA GPU</h3><p>PyTorch was installed with CUDA support, but no GPU was accessible to the runtime.</p></div> | |
| <div class="info-card"><div class="tag">Networking</div><h3>Restricted access</h3><p>Standard outbound DNS and internet access were largely unavailable in my tests.</p></div> | |
| </div> | |
| <p>I also ran CPU benchmarks and got some surprisingly fast matrix multiplication results.</p> | |
| </section> | |
| <section class="reveal"> | |
| <h2>The Pricing</h2> | |
| <div class="metrics" style="grid-template-columns:1fr 1fr"> | |
| <div class="metric"><strong>$0.000030</strong><span>Per script execution (1 Poe point)</span></div> | |
| <div class="metric"><strong>60 sec</strong><span>Execution timeout</span></div> | |
| </div> | |
| <p>Here's another interesting detail: it's only <strong>$0.000030 per script execution, or 1 Poe point</strong>.</p> | |
| <p>That's incredibly inexpensive for experimenting with Python, especially when you consider that you can use libraries like PyTorch without setting up your own environment.</p> | |
| <p>The interpreter has a <strong>60-second execution timeout</strong>. Any script that runs longer than that gets terminated. Resource limits are another thing worth investigating.</p> | |
| <div class="note">Each script execution costs 1 Poe point ($0.000030). The execution timeout is 60 seconds.</div> | |
| </section> | |
| <section class="reveal"> | |
| <h2>What's Next?</h2> | |
| <p>I want to take this further by building a tiny neural language model, eventually experimenting with a miniature Transformer architecture.</p> | |
| <blockquote>It's been a fun reminder that you don't necessarily need a dedicated machine-learning workstation to start experimenting with neural networks.</blockquote> | |
| <p>Sometimes all you need is a Python interpreter and an insane amount of curiosity.</p> | |
| </section> | |
| <footer> | |
| <div>Independent experiment notes. Not affiliated with or endorsed by Poe.</div> | |
| <div class="footer-tags">#MachineLearning #PyTorch #Python #AI #HuggingFace</div> | |
| </footer> | |
| </article> | |
| </main> | |
| <script> | |
| const reduceMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches; | |
| const revealObserver = new IntersectionObserver((entries) => { | |
| entries.forEach(entry => { | |
| if (entry.isIntersecting) { | |
| entry.target.classList.add("visible"); | |
| revealObserver.unobserve(entry.target); | |
| } | |
| }); | |
| }, { threshold: 0.12 }); | |
| document.querySelectorAll(".reveal").forEach(el => revealObserver.observe(el)); | |
| const chartObserver = new IntersectionObserver((entries) => { | |
| entries.forEach(entry => { | |
| if (entry.isIntersecting) { | |
| document.querySelectorAll(".bar-fill").forEach(bar => { | |
| bar.style.width = bar.dataset.width + "%"; | |
| }); | |
| document.querySelectorAll("[data-count]").forEach(node => { | |
| const target = Number(node.dataset.count); | |
| if (reduceMotion) { | |
| node.textContent = target.toFixed(2) + "%"; | |
| return; | |
| } | |
| const start = performance.now(); | |
| const duration = 1100; | |
| function tick(now) { | |
| const progress = Math.min((now - start) / duration, 1); | |
| const eased = 1 - Math.pow(1 - progress, 3); | |
| node.textContent = (target * eased).toFixed(2) + "%"; | |
| if (progress < 1) requestAnimationFrame(tick); | |
| } | |
| requestAnimationFrame(tick); | |
| }); | |
| chartObserver.disconnect(); | |
| } | |
| }); | |
| }, { threshold: 0.35 }); | |
| const metrics = document.querySelector(".metrics"); | |
| if (metrics) chartObserver.observe(metrics); | |
| </script> | |
| </body> | |
| </html> | |