<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Python on Prateek Sharma</title>
		<link>https://prateeksharma.me/tags/python/</link>
		<description>Recent content in Python on Prateek Sharma</description>
		<generator>Hugo</generator>
		<language>en-us</language>
		
		
		
		
			<lastBuildDate>Mon, 31 Aug 2026 00:00:00 +0000</lastBuildDate>
		
			<atom:link href="https://prateeksharma.me/tags/python/index.xml" rel="self" type="application/rss+xml" />
			<item>
				<title>Whisper&#39;s turbo model beat large on noisy audio, in practice</title>
				<link>https://prateeksharma.me/notes/whisper-turbo-vs-large-on-noisy-audio/</link>
				<pubDate>Mon, 31 Aug 2026 00:00:00 +0000</pubDate>
				<guid>https://prateeksharma.me/notes/whisper-turbo-vs-large-on-noisy-audio/</guid>
				<description>&lt;p&gt;Building the &lt;a href=&#34;https://prateeksharma.me/projects/video-translator/&#34;&gt;Video Translator&lt;/a&gt;&#xA;, the assumption&#xA;going in was that OpenAI Whisper&amp;rsquo;s larger model would transcribe more&#xA;accurately. In practice, on clips with loud background music, the &lt;code&gt;turbo&lt;/code&gt; model&#xA;did noticeably better than &lt;code&gt;large&lt;/code&gt; — it seems to tolerate messy audio better&#xA;rather than just being a faster, lower-quality option. Separating vocals from&#xA;background music first (with demucs) didn&amp;rsquo;t help as much as expected either;&#xA;Whisper handled the mixed track better on its own. Worth trying &lt;code&gt;turbo&lt;/code&gt; first&#xA;rather than assuming bigger is more accurate.&lt;/p&gt;</description>
			</item>
			<item>
				<title>CoinTracker</title>
				<link>https://prateeksharma.me/experience/cointracker/</link>
				<pubDate>Mon, 01 Sep 2025 00:00:00 +0000</pubDate>
				<guid>https://prateeksharma.me/experience/cointracker/</guid>
				<description>&lt;p&gt;CoinTracker is a crypto portfolio and tax platform. I worked on the ingestion&#xA;and reconciliation side: getting on-chain data into the system correctly, and&#xA;keeping wallet balances consistent across chains.&lt;/p&gt;&#xA;&lt;h2 id=&#34;engineering-areas&#34;&gt;Engineering areas&lt;/h2&gt;&#xA;&lt;h3 id=&#34;blockchain-integrations&#34;&gt;Blockchain integrations&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Integrated &lt;strong&gt;Cardano&lt;/strong&gt; and &lt;strong&gt;Stellar&lt;/strong&gt;, reading on-chain data from Snowflake&#xA;for balance reconciliation, transaction parsing, and portfolio tracking.&lt;/li&gt;&#xA;&lt;li&gt;Onboarded &lt;strong&gt;Akash&lt;/strong&gt; and &lt;strong&gt;Axelar&lt;/strong&gt; (cross-chain), plus &lt;strong&gt;Bitcoin Ordinals,&#xA;Inscriptions, BRC-20, and Runes&lt;/strong&gt; via the Ordiscan API.&lt;/li&gt;&#xA;&lt;li&gt;Worked behind a unified blockchain abstraction so each new chain was a smaller,&#xA;more predictable piece of work than the last.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;fault-tolerant-wallet-sync&#34;&gt;Fault-tolerant wallet sync&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Wrote the business logic behind &lt;strong&gt;Temporal&lt;/strong&gt; workers for wallet-sync&#xA;workflows: idempotent, retry-safe, and consistent across chains.&lt;/li&gt;&#xA;&lt;li&gt;Built reconciliation pipelines and validation checks so cross-chain data&#xA;disagreements surface as failures rather than silently wrong balances.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;data-tooling&#34;&gt;Data tooling&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Built and consumed &lt;strong&gt;Flask&lt;/strong&gt; REST APIs and CLI scripts for ingestion,&#xA;validation, and reconciliation.&lt;/li&gt;&#xA;&lt;li&gt;Used &lt;strong&gt;pytest&lt;/strong&gt; and &lt;strong&gt;mypy&lt;/strong&gt; to keep correctness and type safety enforced in&#xA;CI.&lt;/li&gt;&#xA;&lt;li&gt;Adopted Claude Code as an agentic assistant for feature work, debugging, and&#xA;issue resolution.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;stack&#34;&gt;Stack&lt;/h2&gt;&#xA;&lt;p&gt;Python · Flask · Temporal · Snowflake · pytest · mypy&lt;/p&gt;</description>
			</item>
			<item>
				<title>Audio Cloning</title>
				<link>https://prateeksharma.me/projects/audio-cloning/</link>
				<pubDate>Mon, 23 Jun 2025 00:00:00 +0000</pubDate>
				<guid>https://prateeksharma.me/projects/audio-cloning/</guid>
				<description>&lt;p&gt;This is an extension of the &lt;a href=&#34;https://prateeksharma.me/projects/video-translator/&#34;&gt;Video Translator&lt;/a&gt;&#xA; tool&#xA;that generates cloned audio for short subtitles, improving the quality of the&#xA;dubbed output. It uses &lt;a href=&#34;https://github.com/myshell-ai/OpenVoice&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OpenVoice&lt;/a&gt;&#xA; and&#xA;&lt;a href=&#34;https://github.com/myshell-ai/MeloTTS&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;MeloTTS&lt;/a&gt;&#xA; to clone the original speaker&amp;rsquo;s&#xA;voice.&lt;/p&gt;&#xA;&lt;h2 id=&#34;challenges&#34;&gt;Challenges&lt;/h2&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;&lt;strong&gt;Library compatibility.&lt;/strong&gt; The libraries weren&amp;rsquo;t functional on Python 3.12,&#xA;which I was using — they worked on 3.10. So the TTS stage couldn&amp;rsquo;t live in the&#xA;same script as the rest of the pipeline.&lt;/li&gt;&#xA;&lt;li&gt;&lt;strong&gt;Short subtitles.&lt;/strong&gt; The libraries needed a longer sample to clone a voice&#xA;well, and very short lines (&lt;code&gt;hello&lt;/code&gt;, &lt;code&gt;hi&lt;/code&gt;, &lt;code&gt;bye&lt;/code&gt;) errored out.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;h2 id=&#34;what-i-changed-in-the-fork&#34;&gt;What I changed in the fork&lt;/h2&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;openvoice/se_extractor.py&lt;/code&gt; had a check that discarded audio segments shorter&#xA;than 1.5 seconds. Words like &lt;code&gt;hello&lt;/code&gt; fall under that. I relaxed the check to&#xA;allow segments down to ~0.5 seconds, and added a skip for lines too short to&#xA;process.&lt;/li&gt;&#xA;&lt;li&gt;Added &lt;code&gt;melo-tts&lt;/code&gt; to &lt;code&gt;requirements.txt&lt;/code&gt; (the docs mention it but don&amp;rsquo;t pin it).&lt;/li&gt;&#xA;&lt;li&gt;Added a driver script that points at a &lt;code&gt;video-translator&lt;/code&gt; output folder and&#xA;runs cloning across every generated audio file.&lt;/li&gt;&#xA;&lt;li&gt;Patched the library to run on CPU for Apple M1.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The fork is at &lt;a href=&#34;https://github.com/pratts/OpenVoice&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;github.com/pratts/OpenVoice&lt;/a&gt;&#xA;;&#xA;&lt;code&gt;test1.py&lt;/code&gt; runs the cloning over the translator&amp;rsquo;s output.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Video Translator</title>
				<link>https://prateeksharma.me/projects/video-translator/</link>
				<pubDate>Mon, 23 Jun 2025 00:00:00 +0000</pubDate>
				<guid>https://prateeksharma.me/projects/video-translator/</guid>
				<description>&lt;p&gt;I always wanted to watch Japanese anime and other foreign-language films in&#xA;English without living in the subtitles. During a break I decided to see how far&#xA;open-source models could get me, and built a script that:&lt;/p&gt;&#xA;&lt;ol&gt;&#xA;&lt;li&gt;Extracts the background audio from the video.&lt;/li&gt;&#xA;&lt;li&gt;Transcribes it to a subtitle file in the original language.&lt;/li&gt;&#xA;&lt;li&gt;Translates each subtitle to English.&lt;/li&gt;&#xA;&lt;li&gt;Converts the translated subtitles to audio.&lt;/li&gt;&#xA;&lt;li&gt;Merges the translated audio with the background track.&lt;/li&gt;&#xA;&lt;li&gt;Muxes the final audio back into the video.&lt;/li&gt;&#xA;&lt;/ol&gt;&#xA;&lt;p&gt;I wanted to lean on open-source tooling and minimize paid services:&lt;/p&gt;</description>
			</item>
			<item>
				<title>Patched OpenVoice for short-clip cloning and CPU inference</title>
				<link>https://prateeksharma.me/open-source/openvoice-short-clip-patch/</link>
				<pubDate>Fri, 20 Jun 2025 00:00:00 +0000</pubDate>
				<guid>https://prateeksharma.me/open-source/openvoice-short-clip-patch/</guid>
				<description>&lt;p&gt;While building the &lt;a href=&#34;https://prateeksharma.me/projects/audio-cloning/&#34;&gt;Audio Cloning&lt;/a&gt;&#xA; stage of my&#xA;video-translator pipeline, I hit two blockers in &lt;a href=&#34;https://github.com/myshell-ai/OpenVoice&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;OpenVoice&lt;/a&gt;&#xA;:&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;&lt;code&gt;openvoice/se_extractor.py&lt;/code&gt; discarded audio segments shorter than 1.5 seconds,&#xA;which meant short subtitle lines (&lt;code&gt;hello&lt;/code&gt;, &lt;code&gt;hi&lt;/code&gt;, &lt;code&gt;bye&lt;/code&gt;) couldn&amp;rsquo;t be cloned at&#xA;all. I relaxed the threshold to ~0.5 seconds and added an explicit skip for&#xA;lines too short to process.&lt;/li&gt;&#xA;&lt;li&gt;The library assumed a CUDA GPU. I patched it to run on CPU so it worked on&#xA;Apple M1.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;The changes live in my fork at&#xA;&lt;a href=&#34;https://github.com/pratts/OpenVoice&#34; target=&#34;_blank&#34; rel=&#34;noopener noreferrer&#34;&gt;github.com/pratts/OpenVoice&lt;/a&gt;&#xA;. They were&#xA;scoped to my use case and haven&amp;rsquo;t been proposed upstream.&lt;/p&gt;</description>
			</item>
			<item>
				<title>Yolobus</title>
				<link>https://prateeksharma.me/experience/yolobus/</link>
				<pubDate>Sun, 01 Mar 2020 00:00:00 +0000</pubDate>
				<guid>https://prateeksharma.me/experience/yolobus/</guid>
				<description>&lt;p&gt;Yolobus operated intercity buses. I worked on the in-house systems for inventory&#xA;and bookings.&lt;/p&gt;&#xA;&lt;h2 id=&#34;engineering-areas&#34;&gt;Engineering areas&lt;/h2&gt;&#xA;&lt;h3 id=&#34;global-distribution-system&#34;&gt;Global Distribution System&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Designed the &lt;strong&gt;database architecture&lt;/strong&gt; for an in-house GDS managing trip&#xA;inventory and real-time bookings.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h3 id=&#34;booking-engine&#34;&gt;Booking engine&lt;/h3&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Migrated core services to &lt;strong&gt;Python / Django&lt;/strong&gt;.&lt;/li&gt;&#xA;&lt;li&gt;Built a &lt;strong&gt;serverless ticket-booking engine&lt;/strong&gt; on &lt;strong&gt;AWS Chalice&lt;/strong&gt;, improving&#xA;maintainability and transaction scalability.&lt;/li&gt;&#xA;&lt;li&gt;Implemented high-throughput booking APIs integrating third-party payment and&#xA;inventory providers (e.g. Redbus, Paytm).&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;h2 id=&#34;stack&#34;&gt;Stack&lt;/h2&gt;&#xA;&lt;p&gt;Python · Django · AWS Chalice · PostgreSQL · REST APIs&lt;/p&gt;</description>
			</item>
	</channel>
</rss>
