<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Gabriel Kasser on Medium]]></title>
        <description><![CDATA[Stories by Gabriel Kasser on Medium]]></description>
        <link>https://medium.com/@gabriel-kasser?source=rss-9cc6a98f857d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*CzX-gN8p2SO9N2DJlQqdWg.jpeg</url>
            <title>Stories by Gabriel Kasser on Medium</title>
            <link>https://medium.com/@gabriel-kasser?source=rss-9cc6a98f857d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 25 Nov 2026 00:34:24 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gabriel-kasser/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Shipping a Voice-Controlled Strategy Game in 48 Hours: Stack, Tools, and Lessons]]></title>
            <link>https://gabriel-kasser.medium.com/shipping-a-voice-controlled-strategy-game-in-48-hours-stack-tools-and-lessons-901175e20fbc?source=rss-9cc6a98f857d------2</link>
            <guid isPermaLink="false">https://medium.com/p/901175e20fbc</guid>
            <category><![CDATA[mistral-ai]]></category>
            <category><![CDATA[strategy]]></category>
            <category><![CDATA[hackathons]]></category>
            <category><![CDATA[game-development]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Gabriel Kasser]]></dc:creator>
            <pubDate>Thu, 05 Mar 2026 15:51:42 GMT</pubDate>
            <atom:updated>2026-03-05T15:51:42.178Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Building ChatCraft solo at the Mistral Worldwide Hackathon (online edition): agile methodology, Hugging Face Spaces, MCP + Mistral, and ElevenLabs from idea to playable demo</strong></p><p>I took part in the <a href="https://lu.ma/mistralhack-online">Mistral Worldwide Hackathon — Online edition</a> on Luma, a worldwide online hackathon organized by Mistral AI with partners including ElevenLabs, Weights &amp; Biases, NVIDIA, and AWS. The goal was to ship something presentable in 48 hours. I worked alone and built <strong>ChatCraft</strong>: a 1v1 real-time strategy game controlled entirely by voice, with Mistral interpreting commands and driving the game via MCP. Here’s how I structured the work, the stack and tools that helped, the pain points, and how I produced the presentation video.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FBVs_05tbwqw%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DBVs_05tbwqw&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FBVs_05tbwqw%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/5d45569a09e125616df840506a5a54a1/href">https://medium.com/media/5d45569a09e125616df840506a5a54a1/href</a></iframe><p><strong>1. Making It Presentable in 48h: Agile Methodology</strong></p><p>With only 48 hours and no team, I had to be strict about scope. I used a simple agile approach: timeboxing and a single non-negotiable goal — <strong>a playable demo</strong> by the end.</p><p>I prioritised in order: first a minimal viable product (voice in → game reaction), then enough polish to demo without embarrassment, and only then extras like a tutorial or spectator mode. Short, frequent check-ins with myself and fast decisions kept the scope from creeping. The backlog was a simple TODO list of must-have vs nice-to-have and I kept moving topics up or down, keeping the top priority in first position so I could drop the latter as soon as time got tight.</p><p><strong>2. Fast Iteration: Hugging Face Spaces + Git + Docker</strong></p><p>To see the app live quickly and share it with others, I used <strong>Hugging Face Spaces</strong> in Git + Docker mode. The repo connects directly to the Space; every push triggers a rebuild and redeploy. No separate CI to configure, no custom server ; just push and get a public URL.</p><p>That workflow was a big win for a 48h hackathon: I could deploy often, test on the real environment, and share a single link with judges or testers. The Docker setup made it easy to mirror my local stack (backend, frontend, ports) so “works on my machine” and “works on the Space” stayed aligned.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xHEvCCNeo2gSpWUabqiIhQ.png" /></figure><p><strong>3. Local Dev &amp; WYSIWYG: Hot Reloading</strong></p><p>I set up a local dev setup with <strong>hot reloading</strong> so that changes to the game (map, units, UI) were visible immediately without manually restarting servers. A single dev script orchestrated the backend and frontend; the frontend (WYSIWYG-style) let me tweak layout and content and see the result in the browser right away.</p><p>That loop “edit, save, see” kept velocity high and avoided the drag of full restarts. Most of the level and UI tuning happened in that environment before I pushed to the Space.</p><p><strong>4. Custom Tools: Asset Generation &amp; Evaluation</strong></p><p>I didn’t have time to hand-craft all assets. So I built <strong>custom tools</strong> to generate game assets (sprites, voice lines, etc.) and to evaluate them instantly. For example: generate a set of unit sprites or sound effects, then immedialty check the quality in the admin interface.</p><p>Automating generation and evaluation meant I could iterate on assets quickly and avoid getting stuck on art. The tools were minimal but targeted exactly what I needed to keep the game looking and sounding coherent without blowing the time budget.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PAC72xfYbrAt3GjrI0K1RA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n5ni7e9mnNmhxLkOnDa7Ag.png" /></figure><p><strong>5. Pain Points</strong></p><p>Some choices cost more time than they saved.</p><p><strong>Game engine from scratch</strong></p><p>I rewrote a small game engine from scratch to fit the voice/MCP loop. It gave control but ate a lot of the 48 hours. If I did it again, I’d seriously consider a lightweight existing engine or framework and plug the AI layer on top.</p><p><strong>Fog of war</strong></p><p>Fog of war was painful: performance, keeping it in sync between clients, and making it readable for the player. I got something working but it stayed fragile, unoptimized and would need a proper pass in a longer project.</p><p><strong>Pathfinding</strong></p><p>Pathfinding was another time sink: edge cases (collisions, map borders, units blocking each other, building placements) led to ugly or stuck movement. A RTS game engine would have saved time.</p><p><strong>Unit behaviour</strong></p><p>Units inherently have 0 AI, which mean your base can burnt to the ground while the marine standing there watches calmly. This is another issue the game engine could have easily solved.</p><p>If you’re on a tight hackathon timeline, I’d recommend reusing as much as possible for engine, fog of war, and pathfinding, and focusing your custom work on the unique part: in my case, voice + MCP + game logic.</p><p><strong>6. Core Mechanics: What Actually Makes the Game</strong></p><p><strong>STT (speech-to-text)</strong></p><p>Commands are captured via the microphone and sent to a speech-to-text pipeline. The resulting text is then interpreted by the AI layer. The push to talk approach was used because voice activity detection is not so reliable when you don’t know in which conditions your user will be (online hackathon constraint).</p><p><strong>MCP + Mistral</strong></p><p>I use the <strong>Model Context Protocol (MCP)</strong> to expose game state and actions to <strong>Mistral</strong>. The model understands the player’s intent from the transcript and triggers the right MCP tools (e.g. “build barracks”, “move units to X”, “attack the Forest zone”, “Defend the base”, “take an expansion”). So the game is driven by natural language interpreted by Mistral and executed via MCP.</p><p><strong>Multiplayer</strong></p><p>The game is 1v1 based on a lobby + matchmaking system: two players, each with their own voice channel and Mistral-backed commands, with game state read directly from the server so both see the same match.</p><p><strong>Obs and tutorial</strong></p><p>I added an <strong>observation mode</strong> so others can watch a game in progress, and a <strong>tutorial</strong> to guide new players through the first commands and goals. Both were “after MVP” features but helped for the demo and for the Luma hackathon judging.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FIncrqSyxF_c%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DIncrqSyxF_c&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FIncrqSyxF_c%2Fhqdefault.jpg&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/37bda1004e1c03b4038c8fa3c40cd5bd/href">https://medium.com/media/37bda1004e1c03b4038c8fa3c40cd5bd/href</a></iframe><p><strong>7. Naming Geographic Zones for Unit Movement</strong></p><p>A big UX question was: how does the player refer to places on the map when speaking? “Move my units north” or “Send them to the forest” only works if the game knows what “north” or “the forest” means.</p><p>I introduced <strong>named geographic zones</strong>: regions of the map with stable labels (e.g. “North”, “Base”, “7 hours”, “Forest”, “Enemy base”). The map is annotated with these zones (e.g. in data or in an editor). When the user says “move my marines to the forest”, the STT → Mistral pipeline resolves “the forest” to the corresponding zone and then to coordinates or targets that the game engine uses for movement orders.</p><p>So the flow is: <strong>speech → text → Mistral (intent + zone resolution) → MCP call with zone or coordinates → game engine</strong>. The zone naming is explicit and consistent so both the AI and the game logic share the same geography.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s9ze9eV1oFdvYa5atvVvGg.png" /><figcaption>Walkable zones and interest points on an OpenAI designed Map sprite</figcaption></figure><p><strong>8. Creating the Presentation Video</strong></p><p>I wanted a short, clear presentation video for the hackathon submission. Here’s how I approached it.</p><p><strong>Plan</strong></p><p>I defined a target length (2 minutes to stick to the rules), a simple script structure (intro → what it is → quick demo → tech stack → thanks), and a list of shots: screen capture of the game, of the tools, and a voiceover tying it together.</p><p><strong>Script</strong></p><p>I wrote a script with an intro, a one-line pitch, a walkthrough of the main mechanics, a brief mention of the stack (HF Spaces, MCP, Mistral, ElevenLabs), and a closing.</p><p><strong>Existing vs new media</strong></p><p>I reused existing assets: gameplay recordings, UI captures, and tool screenshots. What I had to create was the voiceover, any title cards or transitions, and the final cut. In the end I build a script rendering each video section with the fitting voice and concatenated everything in a single video using ffmpeg.</p><p><strong>ElevenLabs API for the presenter voice</strong></p><p>I used the <strong>ElevenLabs API</strong> to generate the presenter voiceover from the script. I chose a voice, sent the text, and got an audio file that I dropped into the video timeline. That gave a clear, consistent narration without recording myself, and it aligned well with the hackathon’s ElevenLabs sponsorship.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/835/1*JxiRa_8rLKpAxZ-RPyO-qw.png" /><figcaption>Video script</figcaption></figure><p><strong>9. Conclusion &amp; Takeaways</strong></p><p>- <strong>Agile in practice:</strong> One person, 48 hours: timeboxing and a non-negotiable “playable demo” goal kept scope under control.</p><p>- <strong>Deploy early:</strong> Hugging Face Spaces (Git + Docker) gave a fast deploy loop and a single shareable link.</p><p>- <strong>Hot reload and WYSIWYG:</strong> Local dev with instant feedback made level and UI iteration much faster.</p><p>- <strong>Custom asset tools:</strong> Lightweight tools for generating and evaluating sprites and voice kept the game coherent without hand-crafting everything.</p><p>- <strong>Pain points:</strong> Custom engine, fog of war, and pathfinding were expensive; next time I’d reuse more and focus custom work on voice + MCP + Mistral.</p><p>- <strong>Presentation:</strong> A clear script plus ElevenLabs for voiceover made it possible to ship a polished presentation video in limited time.</p><p>ChatCraft was built for the <a href="https://lu.ma/mistralhack-online">Mistral Worldwide Hackathon — Online edition</a> on Luma (Mistral AI, with partners including ElevenLabs, Weights &amp; Biases, NVIDIA, AWS). You can try the game, see the code, or watch the presentation and gameplay videos via the links below. Feedback and ideas are welcome.</p><p>Demo: <a href="https://huggingface.co/spaces/mistral-hackaton-2026/ChatCraft">https://huggingface.co/spaces/mistral-hackaton-2026/ChatCraft</a><br>Code: <a href="https://huggingface.co/spaces/mistral-hackaton-2026/ChatCraft/tree/main">https://huggingface.co/spaces/mistral-hackaton-2026/ChatCraft/tree/main</a><br>Votes: <a href="https://hackiterate.com/mistral-worldwide-hackathons?tab=submissions">https://hackiterate.com/mistral-worldwide-hackathons?tab=submissions</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=901175e20fbc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Parkinson’s Paradox: An Engineer’s Thought Experiment on Hidden Traits]]></title>
            <link>https://gabriel-kasser.medium.com/the-parkinsons-paradox-an-engineer-s-thought-experiment-on-hidden-traits-3a3051e29afa?source=rss-9cc6a98f857d------2</link>
            <guid isPermaLink="false">https://medium.com/p/3a3051e29afa</guid>
            <category><![CDATA[parkinson-disease]]></category>
            <category><![CDATA[robotics]]></category>
            <category><![CDATA[boxing]]></category>
            <category><![CDATA[genetics]]></category>
            <dc:creator><![CDATA[Gabriel Kasser]]></dc:creator>
            <pubDate>Mon, 05 May 2025 12:31:43 GMT</pubDate>
            <atom:updated>2025-05-06T11:19:47.803Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Disclaimer:</strong> <em>Before we begin, a personal note. Parkinson’s disease runs in my family, which fuels my deep interest in understanding it from every possible angle. My background is in engineering and robotics, and inevitably, I find myself looking at biological systems through that lens — thinking about control, stability, and feedback loops. This article is purely a </em><strong><em>thought experiment</em></strong><em> born from that perspective. It explores a speculative, counter-intuitive idea and is </em><strong><em>not</em></strong><em> intended as scientific fact or medical advice. It’s an exercise in asking “what if?” about a condition that profoundly impacts countless lives.</em></p><p><strong>Rethinking the Narrative</strong></p><p><strong>1 — The Brain as a Control System — An Engineer’s Lens</strong></p><p>Imagine the complex network controlling our movements — the brain, nerves, muscles — as an intricate biological robot. In engineering, particularly robotics, we constantly deal with ensuring systems are stable. We want a robot arm to move precisely where commanded, without vibrating uncontrollably.</p><p>A key concept here is “phase margin.” Think of it as a safety buffer. A system with a large phase margin is very stable, maybe even a bit sluggish. A system with a very small phase margin is getting close to instability — it might oscillate or tremble easily. However, reducing this margin (carefully!) can sometimes make a system respond <em>more quickly</em> to inputs. It’s operating closer to the edge, making it more reactive, albeit riskier.</p><p>Could we, purely as an analogy, think of the brain’s motor control circuitry in these terms? A system designed for responsiveness, but with an inherent risk of instability (tremor)?</p><p>Here are 4 examples of the same system using different reactivities and dampness.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*mW06B822faHVjSfCINqTzg.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*H0ZYTzKfUhNgVldFsL0LGQ.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*8MlL3zEMDYfj0PCVfjhq7g.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*h2ecO2E9PMpcsfgTperdVQ.gif" /></figure><p>2 — <strong>Parkinson’s Tremor ; A Sign of Reduced ‘Margin’?</strong></p><p>One of the most recognizable symptoms of PD is resting tremor. From a control systems perspective, tremor looks like an oscillation — the system struggling to maintain a stable state. Could this be thought of, metaphorically, as the result of the brain’s motor control operating with a significantly reduced “phase margin”?</p><p>We know the biological cause involves dopamine depletion disrupting the finely tuned circuits of the basal ganglia. This disrupts the normal signalling that ensures smooth movement. The engineering analogy doesn’t replace this biological understanding, but perhaps it offers a different framework to conceptualise the <em>functional outcome</em>: a loss of the stability buffer, leading to oscillation.</p><p><strong>3 — The Reaction Time Riddle — Where the Analogy Gets Tricky</strong></p><p>Here’s the core of the hypothesis: If PD involves progressing towards a state of reduced “phase margin” (making the system prone to tremor), could the <em>earlier</em> stages of this progression, perhaps even before diagnosis, involve a state where the system is <em>faster</em>? Less buffered, closer to the edge, and therefore quicker to react?</p><p>This is where the simple analogy confronts a complex biological reality. Clinically, Parkinson’s is overwhelmingly characterized by <em>bradykinesia</em> — slowness of movement initiation and execution. Reaction times are generally measured to be <em>slower</em>, not faster, in PD patients.</p><p>So, the thought experiment hits a potential wall. Could there be a very specific type of reaction, or a very narrow window <em>decades</em> before diagnosis, where this hypothetical speed advantage exists before the neurodegeneration causes the dominant symptom of slowness? Or is the analogy simply breaking down here? Evidence currently points towards slowness being the rule.</p><p><strong>4 — Stabilizing the System — The Cannabis Question</strong></p><p>Anecdotally, and in some studies, cannabis (or its components like CBD/THC) has been observed to reduce tremor in some PD patients. How might this fit our analogy?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*3vqYlnakRQK-CGvH-vSYMA.gif" /></figure><p>The speculative engineering interpretation could be that cannabis introduces a form of “delay” or damping into the system. In control theory, adding delay appropriately can sometimes increase the phase margin, smoothing out oscillations and improving stability, potentially at the cost of slightly slower optimal performance. Here is an example of the previously “Very unstable” system where the damping was significantly upgraded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*9b6ufDdwS_uhCuVgDOGz6g.gif" /></figure><p>Of course, the biological reality is far more complex, involving the endocannabinoid system and its interaction with dopamine and other neurotransmitters in the basal ganglia. The “delay” concept is likely a vast oversimplification of these intricate pharmacological effects.</p><p><strong>5 — High-Performance Edge Cases — Boxers and Reflexes</strong></p><p>We often hear about high-profile boxers developing Parkinsonism (symptoms similar to PD). The dominant and well-supported explanation is Chronic Traumatic Encephalopathy (CTE) caused by repeated head trauma.</p><p>But the thought experiment asks: Could there be another layer? Is it possible that individuals who reached the pinnacle of a sport demanding lightning-fast reflexes and reaction times did so, in part, because their neurological system naturally operated closer to that hypothetical “edge” of high responsiveness / low stability margin? Could this create a kind of <strong>survival bias</strong>, concentrating individuals potentially predisposed to later instability (like PD or enhanced susceptibility to trauma-induced Parkinsonism) at the top of such sports? This is highly speculative and must be weighed against the strong evidence for CTE being the primary driver.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/335/1*tFj5pb95BGcGQroRvYhsOw.gif" /></figure><p><strong>6 — An Echo from the Past? Evolution and Late Onset</strong></p><p>Parkinson’s typically manifests relatively late in life, often after people have had children. In evolutionary terms, traits that cause problems <em>after</em> the reproductive phase can potentially persist in the gene pool, especially if they confer no disadvantage (or even a subtle advantage) <em>earlier</em> in life. This is known as antagonistic pleiotropy.</p><p>Could genes that increase the risk of PD be linked, hypothetically, to this earlier trait of enhanced responsiveness or faster reaction time? Could a trait offering a slight edge in youth persist, even if it contributes to debilitating disease decades later? This is pure evolutionary speculation. It doesn’t diminish the disease’s harsh reality but questions if there’s a hidden, ancient trade-off buried in our genetics.</p><p><strong>Conclusion: An Open Question</strong></p><p>This journey through analogy and speculation, prompted by an engineer’s perspective and a personal connection, leads to intriguing possibilities but also clear contradictions with established clinical observations, particularly regarding reaction times. The idea of a “faster” pre-Parkinson’s state remains highly hypothetical and seemingly at odds with the characteristic slowness of the disease.</p><p>The robotics analogy might be too simplistic for the brain’s incredible complexity. The links to cannabis effects and boxer predisposition have more direct biological and trauma-related explanations.</p><p>Yet, exploring unconventional ideas can sometimes spark new insights. This thought experiment ends not with answers, but with more questions and an open invitation.</p><p><strong>What are your thoughts?</strong> Does this resonate, or does it seem completely off base? Are you aware of any specific data, perhaps from very early-stage patients or genetic carriers <em>before</em> symptom onset, regarding reaction times or motor control nuances? Do medical professionals see any potential kernel of truth, however small, or is the slowness (bradykinesia) the defining feature from the very earliest detectable changes?</p><p>Let’s discuss. Understanding Parkinson’s requires all perspectives, even the unconventional ones.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3a3051e29afa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[#2 au Hackathon Mistral GameJam: Analyse audio en temps réel]]></title>
            <link>https://gabriel-kasser.medium.com/2-au-hackathon-mistral-gamejam-analyse-audio-en-temps-r%C3%A9el-a6964b2e15a3?source=rss-9cc6a98f857d------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6964b2e15a3</guid>
            <category><![CDATA[mistral]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[speech]]></category>
            <category><![CDATA[engineering]]></category>
            <category><![CDATA[hugging-face]]></category>
            <dc:creator><![CDATA[Gabriel Kasser]]></dc:creator>
            <pubDate>Mon, 27 Jan 2025 17:38:49 GMT</pubDate>
            <atom:updated>2025-01-28T11:51:12.445Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m7Q3YXLEfrEZXnRqVfb9hQ.jpeg" /></figure><h3>Le Challenge : Réinventer le Contrôle du Jeu</h3><p>Le thème du Hackathon était clair : “You don’t control the character”. Au lieu de voir cette contrainte comme une limitation, nous l’avons vue comme une opportunité de repousser les limites de l’interaction homme-machine. Notre solution ? Le joueur doit parler pour influencer le personnage principal: Harold.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XI1F_OkEszC7cKjS" /></figure><h3>Notre Approche Technique</h3><p>Notre plus grand défi était de maintenir une latence faible tout en utilisant l’IA pour interpréter les commandes vocales. Nous avons optimisé la reconnaissance de voix en intégrant les modèles de Speech-to-Text Whisper-large ainsi que l’API Mistral-Large. Ceci nous permet de faire du “function calling” qui transcrit les paroles du joueur.</p><p>Bonus 1: Utiliser Whisper nous permet d’intéragir avec le bébé en n’importe quel langage<br>Bonus 2: Utiliser l’API Mistral réduit la charge sur les GPU et identifie les commandes souhaitées, même exprimées de manière non explicite</p><h3>Les étapes du traitement:</h3><ul><li>Découper le son en fenêtres glissantes de largeur suffisante pour capture une phrase (quelques secondes).</li><li>Envoyer régulièrement le son au serveur ~2–3 fois par seconde</li><li>Stocker ces bouts de son dans la <strong>Sound Queue</strong></li><li>n modèles Huggingface Whisper viennent se servir dans cette Sound Queue pour traiter les sons au fur et à mesure qu’ils arrivent et en extraire le text correspondant</li><li>Recombiner tous les textes qui ont été extraits dans la <strong>Text Queue</strong></li><li>Ces textes vont être filtrés pour ne garder que la séquence qui sera plus longue que celles qui seront immédiatement avant ou après</li><li>n threads utilisant l’API Mistral (large model) viennent se servir dans la Text Queue pour en extraire les instructions de jeu les plus probables ainsi que le sentiment associé</li><li>Ces actions sont ensuite stockées dans l’<strong>Action Queue</strong></li><li>Les actions sont récupérées fréquemment par le jeu pour y être interprétées</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nFndGSwGzxMSndjJFD_B0w.jpeg" /><figcaption>Diagramme de flux</figcaption></figure><p>Merci à tous les membres de l’équipe ParentalControl qui ont permis de construire ce jeu incroyable 👶: <a href="https://www.linkedin.com/in/victor-steimberg-8985a71b8/">Victor Steimberg</a>, <a href="https://www.linkedin.com/in/noe-breton">Noé Breton</a>, <a href="https://www.linkedin.com/in/amtellezfernandez/">Alba Téllez</a>, <a href="https://www.linkedin.com/in/gabrielkasser/">Gabriel Kasser</a>, <a href="https://linkedin.com/in/paulbeglin">Paul Beglin</a>, <a href="https://www.linkedin.com/in/paolopuglielli/">Paolo Puglielli</a></p><p>Merci à Mistral, Huggingface, EntrepreneurFirst, PhotoRoom, Nebius, Scaleway, ElevenLabs et Balderton Capital pour cet évènement exceptionnel 😍</p><p>Pour nous soutenir, venez voter pour notre jeu sur Huggingface: <a href="https://huggingface.co/spaces/Mistral-AI-Game-Jam/ParentalControl">https://huggingface.co/spaces/Mistral-AI-Game-Jam/ParentalControl</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/168/0*fMLO-h5Y3JcaGdCi" /><figcaption>Le bouton ♥</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a6964b2e15a3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Lost in the Digital Abyss: How I Created a Tool to Rescue My Files]]></title>
            <link>https://gabriel-kasser.medium.com/lost-in-the-digital-abyss-how-i-created-a-tool-to-rescue-my-files-cefad449f37a?source=rss-9cc6a98f857d------2</link>
            <guid isPermaLink="false">https://medium.com/p/cefad449f37a</guid>
            <category><![CDATA[hugging-face]]></category>
            <category><![CDATA[mistral]]></category>
            <category><![CDATA[recovery]]></category>
            <dc:creator><![CDATA[Gabriel Kasser]]></dc:creator>
            <pubDate>Thu, 31 Oct 2024 15:57:59 GMT</pubDate>
            <atom:updated>2024-10-31T15:57:59.024Z</atom:updated>
            <content:encoded><![CDATA[<pre>LostFile_doc_2086334104.doc<br>LostFile_doc_2086334105.doc<br>LostFile_doc_2088324242.doc<br>LostFile_docx_2091254245.docx<br>… (x10000 👀)</pre><p>We’ve all been there: staring at a screen full of cryptically named files after an unexpected data loss. This weekend, I found myself in that exact nightmare, courtesy of Windows Media Creation Tool (thanks a lot 😒).</p><p>Here’s the thing about file recovery: even when files are “deleted,” the data often remains. The catch? You lose the original file structure and names. Frustrating, right?</p><p>So, I did what any tech-savvy problem solver would do — I built a tool.</p><p>🛠️ What Makes This Tool Special?</p><ul><li>Uses AI (specifically Mistral 7B 0.3) to analyze documents</li><li>Generates meaningful file names</li><li>Keeps all your data local and private (no transfer on another private server or other)</li><li>Recovers probable document dates</li></ul><h3>How It Works:</h3><p>When you feed your lost files into the tool, it first uses an AI model (Mistral 7B 0.3) to perform a deep content analysis. This isn’t just a simple file scan — it’s an intelligent extraction process.</p><p>We will read the file content and ask the LLM two questions:</p><ul><li>Find this document’s date</li><li>What would be a fitting title for this document</li></ul><p>And that’s it ! We can turn a file like “LostFile_doc_2086334104.doc” into something readable like “2024–08–17 Resignation Letter.doc”</p><p>Proof that machine learning isn’t just hype — it’s a practical problem-solver!</p><p>📌 Check out the tool: <a href="https://gitlab.com/datatoy/textfilerenamer">https://gitlab.com/datatoy/textfilerenamer</a></p><p>#MachineLearning #DataRecovery #AI #Productivity</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cefad449f37a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to setup Cursor on Ubuntu]]></title>
            <link>https://gabriel-kasser.medium.com/how-to-setup-cursor-on-ubuntu-f5b9c974d063?source=rss-9cc6a98f857d------2</link>
            <guid isPermaLink="false">https://medium.com/p/f5b9c974d063</guid>
            <category><![CDATA[cursor]]></category>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[ide]]></category>
            <dc:creator><![CDATA[Gabriel Kasser]]></dc:creator>
            <pubDate>Thu, 31 Oct 2024 15:42:53 GMT</pubDate>
            <atom:updated>2024-10-31T15:42:53.375Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/460/1*SpILucG4k_o3m7l0Qd0CmA.png" /></figure><p>I am a huge fan of Cursor. The time I gained coding with it is tremendous. However, when you have several laptops / stations to manage, it can be boring to set ip up each time so I made a setup just for that.</p><p>How it works:</p><p>We download the latest version of Cursor from the official source and change permissions so it’s executable, it will give us an AppImage.</p><p>We now have to build an entry for Cursor to be considered as a Desktop App, so we will build the adequate cursor.desktop</p><pre>[Desktop Entry]<br>Type=Application<br>Name=Cursor<br>Exec=/home/${USER}/Applications/cursor.AppImage<br>Icon=/home/${USER}/Applications/cursor.png<br>Categories=Development;IDE;<br>Comment=Cursor IDE<br>Terminal=false</pre><p>This file will be used by Ubuntu to register cursor.AppImage as a full Application, accessible from the dock or Activities menu.</p><p>Here is the repository where the script doing all this is stored, along with a Cursor Icon.</p><p><a href="https://gitlab.com/datatoy/cursor-installer">Datatoy / Cursor Installer · GitLab</a></p><h3>TL;DR</h3><p>The one liner to do all those steps :</p><pre>bash &lt;(curl -s https://gitlab.com/datatoy/cursor-installer/-/raw/main/install.sh)</pre><p>PS: I didn’t find a better way to do this, but if you have one, please comment it so it can help other users 🙏</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f5b9c974d063" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop using Jupiter FFS]]></title>
            <link>https://gabriel-kasser.medium.com/stop-using-jupiter-ffs-f8a5739cf01b?source=rss-9cc6a98f857d------2</link>
            <guid isPermaLink="false">https://medium.com/p/f8a5739cf01b</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Gabriel Kasser]]></dc:creator>
            <pubDate>Sun, 04 Aug 2024 14:42:30 GMT</pubDate>
            <atom:updated>2024-08-06T05:55:40.028Z</atom:updated>
            <content:encoded><![CDATA[<h3>Jupyter, how it shouldn’t be used</h3><p>Provocative? Let me explain.</p><p>In the world of data science and Python development, Jupyter notebooks have become ubiquitous. However, are they really the best tool for the job, especially when it comes to debugging?</p><p>Let&#39;s take a critical look at Jupyter notebooks and compare them to the often-overlooked Python debugger.</p><h4>The Pitfalls of Jupyter</h4><p>1. Inconsistent State: Unless you restart the kernel each time, your notebook’s state can become inconsistent with your code.</p><p>2. Limited Application State Visibility: You often end up littering your code with print statements to understand what’s going on.</p><p>3. Production Nightmare: Integrating Jupyter notebooks into a production environment? Good luck with that!</p><p>4. Basic Debugging: Forget about advanced debugging techniques. You’re stuck with manual, block-by-block execution.</p><p>5. Performance Issues: Memory overload and block-by-block execution lead to sluggish performance.</p><p>6. Navigation Nightmare: Try navigating through a notebook that’s 400 pages long. It’s a labyrinth!</p><p>7. Limited Tooling: You’re pretty much on your own when it comes to additional tools and features.</p><p>8. Poor Syntax Highlighting: The cherry on top? Subpar syntax coloration.</p><h4>The Professional Solution: Python Debugger</h4><p>Now, let&#39;s look at why the Python debugger is a superior choice for serious developers:</p><p>1. Guaranteed Repeatability: Each execution is consistent and repeatable.</p><p>2. Complete Application State Visibility: You can see everything, including plugins for visualizing image variables and tensors.</p><p>3. Smooth Production Integration: With the right entry point, moving to production is a breeze.</p><p>4. Advanced Debugging Capabilities: Step-by-step execution, conditional breakpoints, remote debugging, function introspection - you name it!</p><p>5. Optimized Performance: No more memory bloat or slow execution.</p><p>6. Intuitive Code Navigation: Easily navigate your code architecture.</p><p>7. Rich Ecosystem: Auto-completion, linters, and more at your fingertips.</p><p>8. Git-Friendly: Version control becomes much easier.</p><h4>The Million Dollar Question</h4><p>So, why do so many people still use Jupyter?</p><p>A. For one-off data analysis focused on visualization<br>B. They haven&#39;t mastered the Python debugger</p><p>If you answered B, don&#39;t panic! Learning to use a debugger is a skill that can be acquired. And trust me, it&#39;s life-changing.</p><h4>Hot Take</h4><p>Jupyter is a one-trick pony that will never compete with a good debugger in the long run.</p><p>PS: Want to visualize images while debugging in VSCode or Cursor? Check this out <a href="https://github.com/elazarcoh/simply-view-image-for-python-debugging">https://github.com/elazarcoh/simply-view-image-for-python-debugging</a>.</p><p>#Python #Debugging #DataScience #SoftwareEngineering</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f8a5739cf01b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Setting Up an NLP Inference Server with Hugging Face: A Comprehensive Guide]]></title>
            <link>https://gabriel-kasser.medium.com/setting-up-an-nlp-inference-server-with-hugging-face-a-comprehensive-guide-51440a081c13?source=rss-9cc6a98f857d------2</link>
            <guid isPermaLink="false">https://medium.com/p/51440a081c13</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Gabriel Kasser]]></dc:creator>
            <pubDate>Tue, 12 Dec 2023 17:01:34 GMT</pubDate>
            <atom:updated>2023-12-16T17:31:08.266Z</atom:updated>
            <content:encoded><![CDATA[<p>Setting up an NLP inference server often feels like navigating a labyrinth of complexity. The challenge isn’t just in harnessing the power of advanced models; it’s in the intricate dance of managing threads with GPU acceleration and the delicate balancing act of handling concurrent requests. For developers and data scientists, these tasks can quickly turn from exciting to tedious, presenting a barrier that obscures the true potential of NLP applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AvDTZDxAiAmwhqpxXnBK2w.png" /></figure><p>Enter the realm of olympipe, my custom-engineered pipeline engine designed to alleviate these very challenges. With a keen focus on simplifying the intricate backend processes, olympipe transforms the ordeal of setting up an NLP inference server from a daunting task into a streamlined, manageable process. In this article, I’ll share how olympipe not only eases the pain points associated with thread and request management but also empowers you to unlock the full capabilities of your NLP models with unparalleled ease and efficiency. Whether you’re a seasoned expert or just starting out, olympipe is here to change the way you think about and interact with NLP inference servers.</p><h3>Code Overview</h3><p>In this section, let’s delve into the key components of the code that powers our NLP inference server, highlighting the functionality and structure of the <strong>NLPModel</strong> class, the integration with the <strong>Pipeline</strong>, and the process of handling and responding to HTTP requests.</p><h4>The NLPModel Class</h4><pre>class NLPModel:<br>    def __init__(self, model_name: str, use_half: bool = True):<br>        self.device = torch.device(&quot;cuda&quot; if torch.cuda.is_available() else &quot;cpu&quot;)<br>        print(f&quot;Loading inference model {model_name} on {self.device}&quot;)<br>        if use_half:<br>            torch.set_default_dtype(torch.float16)<br>        self.model = transformers.AutoModelForCausalLM.from_pretrained(model_name).to(<br>            self.device<br>        )<br>        self.tokenizer = transformers.AutoTokenizer.from_pretrained(model_name)<br>        print(f&quot;Model {model_name} loaded.&quot;)<br><br>    def generate_response(<br>        self, packet: Tuple[socket, Dict[str, Any]]<br>    ) -&gt; Tuple[socket, Dict[str, Any]]:<br>        connection, data = packet<br><br>        prompt = data.get(&quot;prompt&quot;)<br>        max_new_tokens = data.get(&quot;max_new_tokens&quot;, 100)<br>        num_return_sequences = data.get(&quot;num_return_sequences&quot;, 1)<br><br>        outputs = self.model.generate(<br>            self.tokenizer.encode(<br>                prompt, return_tensors=&quot;pt&quot;, add_special_tokens=False<br>            ).to(self.device),<br>            max_new_tokens=max_new_tokens,<br>            num_return_sequences=num_return_sequences,<br>        )<br><br>        responses = [<br>            self.tokenizer.decode(output, skip_special_tokens=True)<br>            for output in outputs<br>        ]<br><br>        return connection, {&quot;responses&quot;: responses}</pre><p>The <strong>NLPModel</strong> class lies at the heart of our server&#39;s functionality. It&#39;s a fairly standard implementation that serves to instantiate our NLP model, but with some crucial optimizations for performance and flexibility. Let&#39;s break down its main components:</p><ul><li>Model Initialization: Upon creating an instance of <strong>NLPModel</strong>, the specified model from Hugging Face is loaded. This process is streamlined and optimized for performance, with an option to use <strong>torch.float16</strong> for computations, enhancing speed, especially on GPUs.</li><li>The <strong>generate_response</strong> Method: This method is where the magic happens. For each incoming packet, <strong>generate_response</strong> takes the prompt from the packet and uses the model to generate a response. It handles the intricacies of tokenizing the input prompt, feeding it to the model, and then decoding the generated response. The beauty of this method lies in its simplicity from a user&#39;s perspective, while internally managing the complex interactions with the NLP model.</li></ul><h4>Integration with Pipeline</h4><pre>if __name__ == &quot;__main__&quot;:<br>    from torch.multiprocessing import set_start_method<br><br>    set_start_method(&quot;spawn&quot;)<br><br>    HF_MODEL_NAME = &quot;Intel/neural-chat-7b-v3-2&quot;<br>    Pipeline.server(<br>        [(&quot;POST&quot;, &quot;/process&quot;, lambda x: x)],<br>        port=8000,<br>        host=&quot;localhost&quot;,<br>    ).class_task(NLPModel, NLPModel.generate_response, [HF_MODEL_NAME]).task(<br>        return_http_answer<br>    ).wait_for_completion()</pre><p>The use of the <strong>Pipeline</strong> module is a strategic choice that greatly simplifies the request-handling process. Here&#39;s how it&#39;s integrated:</p><ul><li>A packet fed in the <strong>Pipeline</strong> will go through each step of the pipe (see <a href="https://pypi.org/project/olympipe/">olympipe</a> for more examples), here <strong>class_task(NLPModel)</strong> then <strong>task(return_http_answer)</strong></li><li>Defining the Route and Method: In our server setup, we define a specific route (e.g., <strong>/process</strong>) and associate it with a preprocessing method (in this case, <strong>lambda x:x</strong>). This setup ensures that when a POST request is made to the specified route, the embodied data will have the desired format for the pipeline next task (here, <strong>class_task</strong>)</li></ul><h4>The return_http_answer Function</h4><pre>def return_http_answer(p: Tuple[socket, Dict[str, Any]]):<br>    connection, responses = p<br>    send_json_response(connection, responses)</pre><p>The journey of a request concludes with the <strong>return_http_answer</strong> function, which plays a vital role in the server&#39;s HTTP response process:</p><ul><li>Completing the HTTP Request: This function takes the output from the <strong>generate_response</strong> method and packages it into a format suitable for an HTTP response.</li><li>Sending the Response: It then sends the response back to the client, effectively closing the loop. This step is crucial as it ensures that the client receives the generated NLP response in a timely and efficient manner.</li></ul><h3>Advantages</h3><ul><li>The core of our server’s NLP capabilities lies in its integration with Hugging Face models, providing a vast repository of pre-trained models which are not only state-of-the-art but also incredibly user-friendly.</li><li>Handling Multiple Requests: One of the significant challenges in setting up an NLP server is managing concurrent requests efficiently. Our server is designed to handle multiple requests simultaneously without compromising on performance.</li><li>Integration of Multiple Models: Another remarkable feature of our server is its ability to integrate multiple Hugging Face models into the same pipeline. This flexibility opens up a plethora of possibilities for elaborate text processing and analysis. Users can chain different models for complex workflows, such as first using a language detection model followed by a language-specific NLP model, all within the same pipeline.</li><li>Two-Stage Request Handling: The server manages HTTP requests in two distinct stages — opening and closing. This bifurcation provides total control over the process that occurs between receiving a request and sending a response.</li><li>Faster average response: chaining the processes with <a href="https://pypi.org/project/olympipe/">olympipe</a> allows to have the highests possible throughput by spending almost no time waiting on other concurrent threads to finish all the steps. Instead, each step is processed as soon as it is available.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/0*MVoL7b32ugDJRqlm.png" /><figcaption>The</figcaption></figure><h3>Usage Example</h3><p>Setup:</p><pre>poetry add transformers torch olympipe<br># or<br>pip install transformers torch olympipe</pre><p>Here is the full server code:</p><pre>from socket import socket<br>from typing import Any, Dict, Tuple<br><br>import torch<br>import transformers<br>from olympipe import Pipeline<br>from olympipe.helpers.server import send_json_response<br><br><br>class NLPModel:<br>    def __init__(self, model_name: str, use_half: bool = True):<br>        self.device = torch.device(&quot;cuda&quot; if torch.cuda.is_available() else &quot;cpu&quot;)<br>        print(f&quot;Loading inference model {model_name} on {self.device}&quot;)<br>        if use_half:<br>            torch.set_default_dtype(torch.float16)<br>        self.model = transformers.AutoModelForCausalLM.from_pretrained(model_name).to(<br>            self.device<br>        )<br>        self.tokenizer = transformers.AutoTokenizer.from_pretrained(model_name)<br>        print(f&quot;Model {model_name} loaded.&quot;)<br><br>    def generate_response(<br>        self, packet: Tuple[socket, Dict[str, Any]]<br>    ) -&gt; Tuple[socket, Dict[str, Any]]:<br>        connection, data = packet<br><br>        prompt = data.get(&quot;prompt&quot;)<br>        max_new_tokens = data.get(&quot;max_new_tokens&quot;, 100)<br>        num_return_sequences = data.get(&quot;num_return_sequences&quot;, 1)<br><br>        with torch.no_grad():<br>            outputs = self.model.generate(<br>                self.tokenizer.encode(<br>                    prompt, return_tensors=&quot;pt&quot;, add_special_tokens=False<br>                ).to(self.device),<br>                max_new_tokens=max_new_tokens,<br>                num_return_sequences=num_return_sequences,<br>            )<br><br>        responses = [<br>            self.tokenizer.decode(output, skip_special_tokens=True)<br>            for output in outputs<br>        ]<br><br>        return connection, {&quot;responses&quot;: responses}<br><br><br>def return_http_answer(p: Tuple[socket, Dict[str, Any]]):<br>    connection, responses = p<br>    send_json_response(connection, responses)<br><br><br>if __name__ == &quot;__main__&quot;:<br>    from torch.multiprocessing import set_start_method<br><br>    set_start_method(&quot;spawn&quot;)<br><br>    HF_MODEL_NAME = &quot;Intel/neural-chat-7b-v3-2&quot;<br>    Pipeline.server(<br>        [(&quot;POST&quot;, &quot;/process&quot;, lambda x: x)],<br>        port=8000,<br>        host=&quot;localhost&quot;,<br>    ).class_task(NLPModel, NLPModel.generate_response, [HF_MODEL_NAME]).task(<br>        return_http_answer<br>    ).wait_for_completion()</pre><p>And the client code:</p><pre>import multiprocessing<br>import random<br>from typing import Any<br>import requests<br><br><br>if __name__ == &quot;__main__&quot;:<br><br>    def joke_request():<br>        adjectives = [<br>            &quot;nice&quot;,<br>            &quot;nasty&quot;,<br>            &quot;ugly&quot;,<br>            &quot;bad&quot;,<br>            &quot;witty&quot;,<br>            &quot;wicked&quot;,<br>            &quot;correct&quot;,<br>            &quot;deviant&quot;,<br>        ]<br><br>        adj1 = random.choice(adjectives)<br>        adj2 = random.choice(adjectives)<br><br>        data = {<br>            &quot;prompt&quot;: f&quot;You are a {adj1} chatbot, Tell me a {adj2} joke!&quot;,<br>            &quot;max_new_tokens&quot;: 200,<br>        }<br>        return data<br><br>    def ask_joke(data: Any):<br>        try:<br>            response = requests.post(&quot;http://127.0.0.1:8000/process&quot;, json=data)<br><br>            if response.status_code == 200:<br>                result = response.json()<br>                print(f&quot;Processed result: {result}&quot;)<br>                return result<br>            else:<br>                print(f&quot;Error: {response.status_code}&quot;)<br>        except Exception as e:<br>            print(e)<br><br>    # Use this to ask 4 jokes concurrently<br>    out = []<br>    with multiprocessing.Pool(4) as p:<br>        res = p.starmap(ask_joke, [(joke_request(),) for _ in range(40)])<br>        out.append(res)<br><br>    print(out)</pre><h3>Conclusion</h3><p>In this article, we’ve explored the intricacies and advantages of setting up an NLP inference server using the olympipe pipeline engine. From the simplicity of initializing HuggingFace models to the sophisticated handling of concurrent requests and the flexible integration of multiple models, this solution redefines efficiency in NLP server setups. The two-stage HTTP request management further ensures reliability and control, making the server not just powerful, but also remarkably user-friendly.</p><p>The implementation showcased here represents more than just a technical achievement; it’s a testament to the potential of NLP technology when combined with innovative software architecture. The reduction in total processing time for concurrent tasks, as illustrated by our pipeline model, underscores the importance of efficient design in handling complex computational tasks.</p><p><strong>Try It Out</strong>: I encourage you to implement this solution in your projects. Experience firsthand the ease and efficiency it brings to NLP model deployment and management. Your thoughts and experiences are invaluable. 🙏 <strong>Please share your feedback</strong>, suggestions, or queries in the comments section. Let’s learn and grow together in this exciting field.</p><p><strong>Thank you for reading</strong>, and I look forward to seeing the innovative ways you’ll leverage this solution in your NLP endeavors!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51440a081c13" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Streamlining GitLab Pipeline Tracking: The Power of ChatGPT]]></title>
            <link>https://gabriel-kasser.medium.com/streamlining-gitlab-pipeline-tracking-the-power-of-chatgpt-834bdb39b139?source=rss-9cc6a98f857d------2</link>
            <guid isPermaLink="false">https://medium.com/p/834bdb39b139</guid>
            <category><![CDATA[gitlab]]></category>
            <category><![CDATA[chatgpt]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Gabriel Kasser]]></dc:creator>
            <pubDate>Mon, 04 Dec 2023 20:26:49 GMT</pubDate>
            <atom:updated>2023-12-04T20:26:49.976Z</atom:updated>
            <content:encoded><![CDATA[<p>Dear DevOps,</p><p>I recently embarked on a project to create a tool that simplifies the tracking of GitLab pipelines across multiple projects. The goal was clear, but the path to implementation was not as straightforward. That’s where the power of ChatGPT came into play, turning a potentially time-consuming task into a breeze.</p><h3>The Challenge:</h3><p>Managing GitLab pipelines efficiently can be quite a challenge, especially when dealing with numerous projects. Manually handling the tracking and monitoring across various repositories is not only time-consuming but can lead to oversight and errors.</p><h3>The Solution:</h3><p>Enter Pipeline Overseer, a tool designed to centralize GitLab pipeline tracking. But here’s the kicker — a significant portion of the code practically wrote itself, thanks to ChatGPT.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/956/1*sTwwtHJjqASb--ByklRw2g.png" /></figure><h3>The ChatGPT Advantage:</h3><p>In just a few hours, I leveraged ChatGPT to:</p><ol><li>Generate code snippets for API calls to GitLab, saving me the trouble of reading the documentation.</li><li>Handle data parsing and manipulation effortlessly.</li><li>Provide insights on how the Svelte components should be written after a long time away from frontend.</li></ol><p>The ability to collaborate with an AI model like ChatGPT is a game-changer. It not only speeds up the development process but also opens up creative avenues that might not have been explored otherwise.</p><h3><a href="https://pipeline-overseer.vercel.app/">Check out Pipeline Overseer in Action</a></h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FORCt6hx5Yu4&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DORCt6hx5Yu4&amp;image=http%3A%2F%2Fi.ytimg.com%2Fvi%2FORCt6hx5Yu4%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/37616cb7b54a743cdc7dd8f68dc39bc9/href">https://medium.com/media/37616cb7b54a743cdc7dd8f68dc39bc9/href</a></iframe><h3>Test it yourself</h3><h4><a href="https://pipeline-overseer.vercel.app/">https://pipeline-overseer.vercel.app/</a></h4><h3>The Takeaway:</h3><p>The synergy between human creativity and AI assistance is unparalleled. Pipeline Overseer is a testament to what can be achieved in a short timeframe when harnessing the capabilities of tools like ChatGPT. Now you can spend the most of your time on the Design, and quickly implement the technical details, even trying different code solutions.</p><p>Give it a try, and let me know what you think. Your feedback is invaluable!</p><p>Happy coding! 🚀</p><p>#ChatGPT #GitLab #Development #AIAssistance #TechInnovation #Svelte #DevOps</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=834bdb39b139" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Powerful HuggingFace Model pipelines: Hands-On Image Processing with Olympict]]></title>
            <link>https://gabriel-kasser.medium.com/powerful-huggingface-model-pipelines-hands-on-image-processing-with-olympict-6b6ea98d1afa?source=rss-9cc6a98f857d------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b6ea98d1afa</guid>
            <category><![CDATA[hugging-face]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[parallel-processing]]></category>
            <category><![CDATA[detection]]></category>
            <category><![CDATA[deep-learning]]></category>
            <dc:creator><![CDATA[Gabriel Kasser]]></dc:creator>
            <pubDate>Mon, 13 Nov 2023 19:36:39 GMT</pubDate>
            <atom:updated>2023-11-13T19:36:39.402Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>Greetings, fellow tech enthusiasts! In this hands-on guide, we’ll explore the powerful capabilities of Olympict, a Python library tailored for parallel image processing. We’ll delve into its seamless integration of Hugging Face’s cutting-edge image classification and object detection models, unlocking a new realm of efficiency in image-related tasks.</p><h3>Under the hood:</h3><p>This library is based on a multiprocessing parallelization one and leverages its CPU efficiency as described in there: <a href="https://gabriel-kasser.medium.com/how-i-decreased-my-8-hours-python-image-dataset-generation-process-to-a-mere-30-mins-b6748ab019ab?source=friends_link&amp;sk=10f2b46e8e399860274140f589c41d57">Olympipe</a></p><h3>Installation</h3><p>Let’s kick things off by installing Olympict. Open your terminal and run:</p><pre>poetry add olympict[hf]<br>or<br>pip install olympict[hf]</pre><h3>Integrating Hugging Face Models</h3><p>Olympict makes it a breeze to incorporate Hugging Face’s models. We’ll walk through the process of setting up and utilizing these models for image classification.</p><pre># Image classification<br># !pip install timm<br><br>import os<br>from olympict.pipelines import ImagePipeline<br>from olympict.files.o_image import OlympImage<br><br><br>def classify_path(o: OlympImage) -&gt; OlympImage:<br>    # change output path to copy image in classname folder<br>    o.path = f&quot;./output/{o.metadata[&#39;label&#39;]}/{os.path.basename(o.path)}&quot;<br>    return o<br><br><br>if __name__ == &quot;__main__&quot;:<br>    from torch.multiprocessing import set_start_method<br><br>    set_start_method(&quot;spawn&quot;)<br><br>    HF_model = &quot;google/mobilenet_v2_1.0_224&quot;<br><br>    (<br>        ImagePipeline.load_folder(os.path.expanduser(&quot;~/Downloads&quot;))<br>        .classify(HF_model)<br>        .detect(&quot;facebook/detr-resnet-50&quot;)<br>        .task(classify_path)<br>        .save()<br>        .wait_for_completion()<br>    )</pre><h3>Parallel Processing Magic with detection</h3><p>One of Olympict’s standout features is its ability to tap into parallel processing, maximizing hardware capabilities for lightning-fast image analysis. Let’s see this in action with a hands-on example showing the detection model results as it goes through the process.</p><pre>import os<br><br>from olympict.pipelines import ImagePipeline<br>from torch.multiprocessing import set_start_method<br><br><br>if __name__ == &quot;__main__&quot;:<br>    set_start_method(&quot;spawn&quot;)<br><br>    HF_MODEL = &quot;facebook/detr-resnet-50&quot;<br><br>    res = (<br>        ImagePipeline.load_folder(os.path.expanduser(&quot;~/Downloads&quot;))<br>        .detect(HF_MODEL)<br>        .draw_relative_bboxes()<br>        .debug_window(&#39;View&#39;)<br>        .save_to_folder(&quot;./test_output/bboxes&quot;)<br>        .wait_for_results()<br>    )<br><br>    print([r.metadata for r in res])  # Print bboxes</pre><h3>Real-World Computer Vision Project</h3><p>Now that we’ve got the basics down, let’s apply Olympict to a real-world scenario. Suppose you’re working on a computer vision project that involves classifying a dataset of diverse images. Olympict can significantly speed up the classification process.</p><p>What this little snippet does is:<br>- Load an image folder in the natural order<br>- Resize the images to 640x480 using black as padding<br>- keeping 1 frame in 24 (if we want to process a 24fps and kepp one frame per second for example)<br>- detecting objects with the facebook DeTr model<br>- draw those bboxes<br>- save the whole video to “./video.mp4” file<br>- All of those operations are run at the same time on consecutive items to maximize throughput (as per <a href="https://gabriel-kasser.medium.com/how-i-decreased-my-8-hours-python-image-dataset-generation-process-to-a-mere-30-mins-b6748ab019ab?source=friends_link&amp;sk=10f2b46e8e399860274140f589c41d57">olympipe </a>default behaviour)</p><pre>import os<br><br>from olympict import ImagePipeline<br>from olympict.files.o_image import OlympImage<br>from torch.multiprocessing import set_start_method<br><br><br>def path_fn(_: OlympImage):<br>    return &quot;./video.mp4&quot;<br><br>if __name__ == &quot;__main__&quot;:<br>    set_start_method(&quot;spawn&quot;)<br>    HF_MODEL = &quot;facebook/detr-resnet-50&quot;<br><br>    (<br>        ImagePipeline.load_folder(os.path.expanduser(&quot;~/Camera&quot;))<br>        .resize((480, 640), pad_color=(0, 0, 0))<br>        .keep_each_frame_in(1, 23)<br>        .detect(HF_MODEL)<br>        .draw_relative_bboxes()<br>        .to_video(path_fn, 1)<br>        .wait_for_completion()<br>    )</pre><h3>Contributing to <a href="https://gitlab.com/gabraken/olympict">Olympict</a></h3><p>Olympict is an open-source project, and contributions are not only welcome but encouraged. Dive into the Gitlab repository, explore the codebase, and join the adventure.</p><h3>Conclusion</h3><p>In this hands-on guide, we’ve scratched the surface of Olympict’s capabilities. Whether you’re an image processing aficionado or a developer looking to streamline your workflow, Olympict provides a robust solution.</p><p>Explore the documentation, experiment with the code snippets, and witness the parallel power of Olympict in action. Your journey into efficient image processing begins now!</p><p>Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b6ea98d1afa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Disposable Code: The Future of Microservices Architectures for Optimal Scalability!]]></title>
            <link>https://gabriel-kasser.medium.com/the-future-of-microservices-architectures-disposable-code-for-optimal-scalability-71f466e53ed5?source=rss-9cc6a98f857d------2</link>
            <guid isPermaLink="false">https://medium.com/p/71f466e53ed5</guid>
            <category><![CDATA[agile]]></category>
            <category><![CDATA[microservices]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[code]]></category>
            <dc:creator><![CDATA[Gabriel Kasser]]></dc:creator>
            <pubDate>Thu, 11 May 2023 19:51:25 GMT</pubDate>
            <atom:updated>2023-05-13T14:20:02.827Z</atom:updated>
            <content:encoded><![CDATA[<p>Today, I’d like to share with you a bold perspective that could transform how we design our applications: the revolutionary concept of disposable code in microservices architectures. Imagine a world where each service can be replaced by a precise and concise instruction, supported by intelligent monitoring that ensures the code is always up to date. Allow me to present this exciting vision.</p><p>The Power of Prompts: Instead of developing complex and monolithic services, we can break down our functionalities into independent tasks defined by clear and concise prompts. These prompts simply indicate what we want to accomplish, without worrying about implementation details. By adopting this approach, we create an extremely modular and flexible microservices architecture.</p><p>The Intelligence of Monitoring: The core of this approach relies on intelligent monitoring. By continuously monitoring the state of data, we can detect evolutions and obsolescence in the existing code. When data changes, the monitoring triggers the generation of new, adapted code, ensuring that our architecture remains up to date and adapts to the changing needs of our business.</p><p>Let’s consider a concrete example:</p><p>Suppose we have developed a specific service for scraping data from Twitter.<strong> Our instruction could be as follows: “Generate a main.py file for scraping tweets containing #AI, with API credentials stored in the environment variables API_KEY and API_APP_ID. Once scraped, send these tweets in the format […] to the service located at </strong><a href="http://[...]"><strong>http://[...]</strong></a><strong> using the API client […].”</strong></p><p>With our microservices architecture, this isolated service would be able to detect and retrieve the corresponding data from Twitter. However, to keep our code up to date and relevant, we implement intelligent monitoring that continuously tracks changes in the Twitter platform, such as new features or API updates.</p><p>When monitoring detects modifications, it automatically triggers the generation of new code adapted to the updated data. This ensures that our Twitter scraping service remains current and effective, adapting to the platform’s evolution.</p><p>The Undeniable Advantages:</p><ol><li><strong>Responsiveness</strong>: Thanks to prompts and dynamic code generation, we can iterate quickly and adapt to changes. Our architecture becomes agile and resilient in response to our business’s evolution.</li><li><strong>Simplified Maintenance</strong>: Disposable code significantly reduces maintenance complexity. Each service becomes autonomous and replaceable, simplifying updates and improvements.</li><li><strong>Optimal Resource Utilization</strong>: By generating data-specific code, we can optimize resource utilization, avoiding processing obsolete data and reducing associated costs.</li><li><strong>Flexibility</strong>: By using automatic code generation, programs can be written in the most suitable/optimized language based on performance or auditability requirements, without necessarily requiring specific technical knowledge internally.</li></ol><p>In conclusion, by embracing the innovative idea of disposable code in microservices architectures, supported by precise prompts and intelligent monitoring, we pave the way for adaptable, agile, and scalable systems. This revolutionary approach reinvents how we design and manage our applications, proactively anticipating future needs.</p><p>Feel free to share your thoughts and contribute to the discussion in the comments. I’m excited to hear your perspective on this visionary approach.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=71f466e53ed5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>