<?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 Abhishek Dasgupta on Medium]]></title>
        <description><![CDATA[Stories by Abhishek Dasgupta on Medium]]></description>
        <link>https://medium.com/@abhishek20dgp?source=rss-34a965a298b9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*3FOfwC8mRTFz153y</url>
            <title>Stories by Abhishek Dasgupta on Medium</title>
            <link>https://medium.com/@abhishek20dgp?source=rss-34a965a298b9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 05:38:15 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@abhishek20dgp/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[Scaling Your Python Applications with Redis Queue: A Complete Guide]]></title>
            <link>https://medium.com/@abhishek20dgp/scaling-your-python-applications-with-redis-queue-a-complete-guide-69680134cc4e?source=rss-34a965a298b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/69680134cc4e</guid>
            <category><![CDATA[redis]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[queue]]></category>
            <category><![CDATA[parallel-processing]]></category>
            <dc:creator><![CDATA[Abhishek Dasgupta]]></dc:creator>
            <pubDate>Fri, 19 Sep 2025 19:04:11 GMT</pubDate>
            <atom:updated>2025-09-19T19:06:08.250Z</atom:updated>
            <content:encoded><![CDATA[<p><em>How I solved high-traffic processing bottlenecks using distributed job queues</em></p><h3>The Problem: When Your Service Can’t Keep Up</h3><p>Picture this: your Python service is running along nicely, processing requests one by one. Then suddenly, traffic spikes. Instead of handling requests efficiently, your service becomes a bottleneck, with users waiting longer and longer for responses. Sound familiar?</p><p>This exact scenario hit my company recently. We had a service that needed to process multiple intensive requests simultaneously, but our single-threaded approach was crumbling under load. That’s when I discovered Redis Queue (RQ), a game-changer for distributing workload across multiple workers.</p><h3>What is Redis Queue?</h3><p>Redis Queue is a Python library that leverages Redis as a message broker to create distributed job queues. Think of it as a smart dispatcher: instead of processing tasks sequentially, RQ allows you to distribute jobs across multiple worker processes that can run in parallel.</p><p>Here’s the magic: if you have 100 requests, instead of processing them one by one (taking 100 units of time), you can distribute them among 4 workers and potentially complete them in just 25 units of time.</p><h3>Setting Up Your Redis Queue Infrastructure</h3><h3>Step 1: Launch Redis Server</h3><p>First, let’s get Redis running using Docker. This command starts a Redis server with persistence enabled:</p><pre>docker run -d --name redis -p 6379:6379 redis:6 redis-server --appendonly yes</pre><p>The --appendonly yes flag ensures data persistence, so your jobs won&#39;t be lost if the container restarts.</p><h3>Step 2: Connect to Redis in Python</h3><pre>import os<br>from redis import Redis<br>from rq import Queue</pre><pre># Connect to your Redis instance<br>REDIS_URL = os.environ.get(&quot;REDIS_URL&quot;, &quot;redis://redis:6379/0&quot;)<br>redis_conn = Redis.from_url(https://medium.com/REDIS_URL)</pre><pre># Create a named queue<br>queue = Queue(&quot;analysis&quot;, connection=redis_conn)</pre><h3>Step 3: Enqueue Jobs</h3><p>Here’s where the real power comes in. Instead of calling your processing function directly, you enqueue it:</p><pre>from rq.retry import Retry<br>job = queue.enqueue(<br>    process_items,                    # Your processing function<br>    input_data.dict(),               # Function arguments<br>    input_data.id,<br>    job_id=input_data.id,           # Unique identifier<br>    retry=Retry(max=3, interval=[10, 30, 60]),  # Retry logic<br>    job_timeout=600,                # 10-minute timeout<br>)</pre><p>Let me break down these parameters:</p><ul><li><strong>retry</strong>: Automatically retries failed jobs up to 3 times with increasing intervals</li><li><strong>job_timeout</strong>: Prevents runaway jobs from consuming resources indefinitely</li><li><strong>job_id</strong>: Allows you to track and potentially cancel specific jobs</li></ul><h3>Creating Your Worker Army</h3><p>Now for the exciting part-spinning up multiple workers to process your queue in parallel.</p><h3>For Local Testing (Windows-Compatible)</h3><p>Open 4 separate terminal windows and run this command in each:</p><pre>rq worker -w rq.worker.SimpleWorker analysis</pre><p><strong>Pro tip</strong>: The SimpleWorker is crucial for Windows users since RQ&#39;s default worker relies on Unix&#39;s fork() system call, which isn&#39;t available on Windows.</p><h3>Monitoring Your Workers</h3><p>Watch as your workers spring into action! Each terminal will show real-time updates as jobs are picked up and processed. You’ll see something like:</p><pre>16:45:23 RQ worker &#39;rq:worker:hostname.1234&#39; started, version 1.15.1<br>16:45:23 Listening on analysis...<br>16:45:24 analysis: process_items(data, job_id) (job_id)</pre><h3>The Results: From Bottleneck to Superhighway</h3><p>The transformation is remarkable. What used to be a linear processing nightmare becomes a parallel processing powerhouse:</p><ul><li><strong>Before</strong>: 100 requests × 2 seconds each = 200 seconds total</li><li><strong>After</strong>: 100 requests ÷ 4 workers × 2 seconds each = ~50 seconds total</li></ul><p>That’s a 4x improvement in throughput, and it scales linearly with the number of workers you add.</p><h3>Production Considerations</h3><p>When you’re ready to deploy to production, consider:</p><ol><li><strong>Scaling Workers</strong>: Use process managers like Supervisor or systemd to manage worker processes</li><li><strong>Monitoring</strong>: Implement job monitoring with tools like RQ Dashboard</li><li><strong>Resource Management</strong>: Set appropriate memory and CPU limits for worker processes</li><li><strong>High Availability</strong>: Run Redis in cluster mode for production workloads</li></ol><h3>Conclusion: The Power of Parallel Processing</h3><p>Redis Queue transformed our application from a single-lane road into a multi-lane highway. The ability to distribute intensive tasks across multiple workers not only improved our response times but also made our system more resilient and scalable.</p><p>Whether you’re processing images, analyzing data, sending emails, or handling any CPU-intensive task, Redis Queue offers an elegant solution for horizontal scaling. The best part? It requires minimal changes to your existing codebase.</p><p><em>Have questions about implementing Redis Queue in your project? Drop them in the comments below. I’d love to help you scale your applications effectively!</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=69680134cc4e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Sheep Analogy]]></title>
            <link>https://medium.com/@abhishek20dgp/the-sheep-analogy-f7589431b222?source=rss-34a965a298b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/f7589431b222</guid>
            <category><![CDATA[choices]]></category>
            <category><![CDATA[life]]></category>
            <category><![CDATA[decision-making]]></category>
            <category><![CDATA[careers]]></category>
            <dc:creator><![CDATA[Abhishek Dasgupta]]></dc:creator>
            <pubDate>Wed, 22 Jan 2025 18:59:36 GMT</pubDate>
            <atom:updated>2025-01-22T18:59:36.111Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wgpIZg_TqgVIdjwm" /></figure><h4>Concept of Sheep Analogy</h4><p>At some point in our lives, we’ve all sought advice on major decisions — be it career choices, education, or life paths. But how often do we pause to question whether the advice we receive truly aligns with our potential and aspirations? More often than not, we accept it without hesitation, simply because it comes from the majority. This tendency to follow what “most people” suggest feels reassuring, as if the collective voice must be right. And that’s precisely where the <em>Sheep Analogy</em> comes in.</p><p>The Sheep Analogy describes how people often follow the crowd without questioning the path they’re on — just like sheep in a herd, blindly walking where their master leads them. But imagine a herd of sheep grazing in a field. All of them follow the same path, sticking together for comfort and safety. Yet, one sheep strays off course, wandering into unfamiliar territory. At first, it feels lost, confused, and even scared. But over time, it discovers new fields, richer pastures, and a sense of freedom the herd will never know.</p><p>In life, we’re frequently told to follow a “safe” route — pursue a certain kind of job, join a prestigious company, or chase a stable career. These paths are presented as the ultimate definition of success. But what if you’re capable of more? What if the potential within you lies far beyond the boundaries set by the herd? The reality is, blindly following the majority may lead to a life of mediocrity, while stepping away from it, even if daunting, might unlock your true potential.</p><h4>Are you part of the 90% or aiming for the 10%?</h4><p>Ninety percent of people will advise you to pursue a “safe” career — join a service-based company, secure a government job, or settle for a stable path with minimal risks. They’ll tell you to take the job, stick to it, and live a predictable life. But have you ever stopped to think: if this advice were truly the key to success, why do only 10% of people achieve extraordinary results?</p><p>If the majority’s guidance leads to greatness, wouldn’t everyone be living their dream life by now? The reality is, blindly following the crowd may keep you safe, but it often limits your potential. So, what’s the harm in dreaming big? Who decided that working at XYZ company is the ultimate happiness, or that choosing an unconventional career will ruin your life?</p><p>The question you need to ask yourself is this: <em>Are you part of the 90%, content with following the herd? Or are you aiming to break free and join the 10% who truly succeed?</em></p><h4>The Herd Mentality</h4><p>As a student, I’ve seen countless peers running after jobs like a herd. They have no aspirations, no defined field of interest, and no long-term goals. Their sole focus is to secure any job that helps them sustain a simple life. While this may seem practical, it’s not how we can build a thriving and innovative nation. If everyone settles for mediocrity — a simple job with no real contribution to progress — where will creativity, innovation, and breakthroughs come from?</p><p>But can students really be blamed for this mindset? The problem runs deeper. It’s the societal norms, institutional structures, and family expectations that condition young minds to think narrowly. Instead of encouraging them to explore, innovate, or dream big, they are pushed to follow the herd. They end up living someone else’s idea of success, not their own.</p><p>Take entrepreneurship and startups as an example. In India, these paths are often looked down upon because of the risks involved. Parents and society discourage them, focusing instead on “secure” options. But here’s the irony: the big companies where many dream of working were once startups too. They were built by risk-takers who dared to think differently. And most of these risk-takers didn’t drop out; they persevered with vision and determination to create something extraordinary.</p><p>Another example is the way engineering is approached in India. Thousands of students choose engineering without any real passion or purpose — just because it’s the “default” option. The result? A surplus of bad engineers who struggle to find jobs and live mediocre lives. And then the blame shifts to a “lack of jobs.” But let’s be honest: why would companies hire someone who lacks skill and enthusiasm?</p><p>The reality is, companies struggle to find highly skilled engineers — the so-called “10x engineers” who can accomplish ten times more than the average professional. Instead, they hire several underqualified engineers at low salaries, just to get the same work done. This inefficiency stems from the herd mentality that leads students to choose engineering for the wrong reasons, without striving to truly excel.</p><h4>The Illusion of Success</h4><p>Success is often portrayed as a linear path — secure a stable job, climb the corporate ladder, and live a comfortable life. Society tells us that happiness and fulfillment come from following this prescribed route. However, this is an illusion. Many people, trapped in the pursuit of conventional success, fail to realize that true success isn’t defined by stability alone. It’s not about simply surviving the daily grind or meeting the expectations of others. True success lies in breaking away from the norm, following your own passion, and embracing risks to create something meaningful.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/1*FhVISsBkyumaRYXs1b-rEg.png" /><figcaption>Understanding True Success ( Pic credit -<a href="https://www.instagram.com/amypurdygurl">https://www.instagram.com/amypurdygurl</a>)</figcaption></figure><h4>Breaking Away from the Herd</h4><p>In my 20s, I’ve learned one important truth: <strong>to achieve something extraordinary, you must break free from the herd</strong>. It’s easy to follow the crowd, to take the path most people suggest because it feels safe. But following others’ advice won’t take you far. It’s essential to take risks, trust your own instincts, and ignore the noise around you. Others may have good intentions, but their roadmap is not yours to follow.<strong> </strong>Your journey is unique, and only you can decide where it leads.</p><p>Never rely on someone else’s plan. <strong>It’s your life , create your own path</strong>. Someone else’s success may not be the right fit for you, and following their herd could keep you from discovering your true potential.</p><blockquote>This article is written with the assistance of AI and personal learning from real-life experiences.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f7589431b222" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My Interview experience at Atlan]]></title>
            <link>https://medium.com/@abhishek20dgp/my-interview-experience-at-atlan-67d84bc19a8c?source=rss-34a965a298b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/67d84bc19a8c</guid>
            <dc:creator><![CDATA[Abhishek Dasgupta]]></dc:creator>
            <pubDate>Sun, 30 Jun 2024 18:28:38 GMT</pubDate>
            <atom:updated>2024-08-07T18:01:15.040Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*85yr-mXDDndd9Rex.png" /></figure><p>In January 2024, I was applying for internships when I came across a job role at Atlan on Wellfound platform and had applied to it immediately. The role was Product Operations Intern — Generative AI which was for 6 months duration with a PPO opportunity. Since I was in the Generative AI field for the past 1 year, I found the role and requirements to be very familiar. So let me tell the story of how this entire process went and will provide a brief description of each round.</p><p><strong>Round 1: Resume Shortlisting</strong></p><p>I received an email from the recruiter a few days after applying that my resume has been shortlisted for the next round and the mail also contained a challenge which I had to solve and submit within one week. The resume shortlisting process at Atlan is very difficult as they get a lot of applications and a single application is reviewed by many team members.</p><p><strong>Round 2: The Challenge Round</strong></p><p>This round is common for almost all roles at Atlan. They provide a real world problem statement based on the role you have applied for and you need to either submit a proposal/documentation or maybe an entire project. My problem statement revolved around solving two issues of the company regarding internal communication by leveraging Generative AI. The statement requires you to create a proposal by explaining the entire architecture process, tech stack required, architectural diagrams, code snippets and short demo videos. It was not like you need to build the entire application instead you need to brainstorm and come up with a scalable generative AI solution. I will not be disclosing the actual detailed task here.</p><p>I was given one week time to submit the proposal and I started working on it as soon as I received the assignment. Although the task looked easy but it was rather difficult as I needed to come up with a proper solution to solve the problem on my own. I made all the architectural diagrams, wrote some code snippets and a 10 page proposal which I submitted on the 4th day.</p><p><strong>Round 3: HR Discussion</strong></p><p>After a few days, the HR reached out to me saying that the team liked my proposal and they would like to schedule a interview for knowing more about me. It was basically a normal discussion with the HR on Google Meet. She explained me very well about what the company did, what was their product and how the company has evolved in the recent years. We went on to discuss about my background, experience, skills and also discussed about the feedback about my proposal from the tech team. The best thing I liked about interviewing with Atlan was the clear communication that happened from their end. When a company clearly communicates their vision, whom they are looking for, how much they will pay you then you can understand how seriously they take talent recruitment. I was really impressed by the entire process.</p><p>The HR discussion ended with the note that I will be having a technical interview with one of the senior engineer the next day.</p><p><strong>Round 4: Technical Interview</strong></p><p>The next day I had my technical interview. The interviewer joined on time and introduced himself. Then he asked me to introduce myself. Followed by my introduction he asked my to share my screen and explain the architecture that I proposed. I explained to him step by step and in between he asked me a lot of questions regarding scalability and performance. I was quite sure where this interview was heading as although he was liking my answers, most of his questions pointed to the architecture being not scalable. He also asked some questions regarding generative AI concepts such as embeddings, vector databases and embedding algorithms. The interview went well but I realised that my architecture was not scalable in real life.</p><p>The next day I received a mail that I was rejected. It was really not a good feeling as I lost the opportunity where they were offering 50k stipend + 24LPA PPO offer. Besides that, Atlan had one of the best work culture among thousands of startups. But rejections are a part of life and I moved on. I specifically wrote this blog to share my experience about the process because the process taught me a lot. It was really fun interviewing with Atlan and maybe someday again we will cross paths.</p><p><strong>Finding out what went wrong:</strong></p><p>After a few months, I found the person who actually got selected for this role through Linkedin and had a look on his submission of the proposal that was available on his Github. I discovered that he had proposed a much simpler solution than my proposal and it could be very easily implemented by the company in a very short time.</p><p>What I learnt was that you need not show that you know everything by putting all of your knowledge in a single solution. Instead of making a complex solution that works perfect, find a simple solution that works and is easily scalable. You need to provide solutions to companies keeping in mind that they reduce the overall cost and complexity.</p><p>I applied to many other internships and will share my interview experience of each in the subsequent blogs.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=67d84bc19a8c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Bangla LLM by finetuning Gemma 2B LLM using Low-Rank-Adaptation(LORA)]]></title>
            <link>https://medium.com/@abhishek20dgp/building-a-bangla-llm-by-finetuning-gemma-2b-llm-using-low-rank-adaptation-lora-73bad579f0a4?source=rss-34a965a298b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/73bad579f0a4</guid>
            <category><![CDATA[generative-ai]]></category>
            <category><![CDATA[gemma]]></category>
            <category><![CDATA[large-language-models]]></category>
            <category><![CDATA[llm]]></category>
            <dc:creator><![CDATA[Abhishek Dasgupta]]></dc:creator>
            <pubDate>Fri, 08 Mar 2024 18:48:13 GMT</pubDate>
            <atom:updated>2024-03-08T18:48:13.149Z</atom:updated>
            <content:encoded><![CDATA[<p>Google recently released Gemma series of open source foundational large language models that builds on the same technology as its flagship Gemini product. Gemma is available in two sizes: 2B and 7B, each with pre-trained and instruction-tuned variants. The aim of this project is to build a Bangla LLM that can understand inputs in bengali language and provide responses in bengali too. To acheive this I have chosen the lightweight Gemma 2B model and finetuned it on a bengali chat dataset using LORA technique.</p><p>The reason I chose to finetune Gemma 2B is because it’s trained on 2 billion parameters and much lightweight to be able to finetune on a colab GPU runtime for free. Before learning about the finetuning process lets understand how the LORA technique works.</p><p>The LoRA (Low-Rank Adaptation) technique for fine-tuning language models offers a parameter-efficient approach that significantly reduces the computational resources required for fine-tuning compared to traditional methods. LoRA works by decomposing the weight matrix of a pre-trained language model into two smaller matrices that approximate the original matrix. These smaller matrices, known as the LoRA adapters, are fine-tuned instead of the entire weight matrix and then multiplied together to form a new matrix with size same as the original weight matrix.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j9vbPDbQqZnenjYNEUaR1Q.png" /><figcaption>Architectural diagram for finetuning a LLM</figcaption></figure><p>First step is to install the required dependencies in colab. Remember to turn on GPU runtime before starting the finetuning</p><pre>!pip install -q -U keras-nlp<br>!pip install -q -U keras&gt;=3<br>!pip install datasets<br>os.environ[&quot;KERAS_BACKEND&quot;] = &quot;jax&quot;  <br>os.environ[&quot;XLA_PYTHON_CLIENT_MEM_FRACTION&quot;]=&quot;1.00&quot;</pre><p>Import the necessary libraries:</p><pre>from datasets import load_dataset<br>import keras<br>import keras_nlp</pre><p>I used a bengali chat dataset from Hugging Face built by Rishiraj Acharya(Google Developer Expert in ML), for finetuning my model.</p><pre>dataset = load_dataset(&quot;rishiraj/bengalichat&quot;,split=&#39;train&#39;)</pre><p>Next step is to preprocess the dataset into the required format for finetuning the LLM:</p><pre>data=[]<br>for line in dataset:<br>    parts = [part.strip() for part in line[&quot;text&quot;].split(&quot;&lt;/s&gt;&quot;) if part.strip()]<br>    if len(parts) &gt;= 2:<br>      # Assuming the first part is the instruction and the second part is the response<br>      instruction = parts[1][8:]<br>      response = parts[2][13:]<br>      # Formatting the output<br>      formatted_line = f&quot;Instruction:\n{instruction}\n\nResponse:\n{response}&quot;<br>      print(formatted_line)<br>      data.append(formatted_line)</pre><p>Here is a sample row of the processed dataset:</p><blockquote>Instruction: আমার ওজন হ্রাস করা দরকার।চিনির কিছু বিকল্প কী?</blockquote><blockquote>Response: ওজন হ্রাস করার চেষ্টা করার সময় চিনির কয়েকটি বিকল্প রয়েছে:</blockquote><blockquote>1. কৃত্রিম মিষ্টি — এগুলি এফডিএ নিয়ন্ত্রিত এবং বেশিরভাগ ল্যাবগুলিতে বিভিন্ন রাসায়নিক ব্যবহার করে তৈরি করা হয়।এই মিষ্টিগুলির উদাহরণগুলি হ’ল অ্যাস্পার্টাম এবং স্যাকারিন।</blockquote><blockquote>২. চিনির অ্যালকোহল — এগুলি প্রায়শই ক্যান্ডি এবং প্রক্রিয়াজাত খাবারে ব্যবহৃত হয় এবং ল্যাবগুলিতেও তৈরি করা হয়।এই মিষ্টিগুলির উদাহরণগুলি হ’ল এরিথ্রিটল এবং জাইলিটল।</blockquote><blockquote>৩. উপন্যাস সুইটেনার — এগুলি মোটামুটি নতুন ধরণের মিষ্টি এবং গাছের মতো প্রাকৃতিক উত্স থেকে তৈরি।এই মিষ্টিগুলির উদাহরণগুলি হ’ল সন্ন্যাসী ফল এবং স্টিভিয়া।</blockquote><p>Now lets load the Gemma 2B model before finetuning and ask a question in Bengali:</p><pre>gemma_lm = keras_nlp.models.GemmaCausalLM.from_preset(&quot;gemma_2b_en&quot;)<br>gemma_lm.summary()<br>prompt = template.format(<br>    instruction=&quot;পদার্থবিদ্যা কি?&quot;,<br>    response=&quot;&quot;,<br>)<br>print(gemma_lm.generate(prompt, max_length=256))</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*soT2AQWv77K2AbsDLuiG0A.png" /></figure><p>You can notice the LLM gave a weird response in bengali. Lets finetune the model next using the dataset we preprocessed.</p><pre>gemma_lm.backbone.enable_lora(rank=4)<br>gemma_lm.summary()<br># Limit the input sequence length to 512 (to control memory usage).<br>gemma_lm.preprocessor.sequence_length = 512<br># Use AdamW (a common optimizer for transformer models).<br>optimizer = keras.optimizers.AdamW(<br>    learning_rate=5e-5,<br>    weight_decay=0.01,<br>)<br>optimizer.exclude_from_weight_decay(var_names=[&quot;bias&quot;, &quot;scale&quot;])<br><br>gemma_lm.compile(<br>    loss=keras.losses.SparseCategoricalCrossentropy(from_logits=True),<br>    optimizer=optimizer,<br>    weighted_metrics=[keras.metrics.SparseCategoricalAccuracy()],<br>)<br>gemma_lm.fit(data, epochs=1, batch_size=1)</pre><p>The above code might be difficult to understand but let me break it down:</p><p>gemma_lm.backbone.enable_lora(rank=4): The rank=4 parameter specifies the rank of these low-rank matrices, which is a crucial aspect of the LoRA technique for controlling the approximation level.</p><p>gemma_lm.preprocessor.sequence_length = 512: This line sets the maximum length of input sequences to 512 tokens.</p><p>gemma_lm.fit(data, epochs=1, batch_size=1): Finally, this line starts the training process. The model is trained on the provided data for one epoch with a batch size of 1.</p><p>After finetuning process completes( Takes 20–30 mins) lets ask the same question to the finetuned Gemma 2B model again:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5N3NEgiLGEOBdV-IBIY8kg.png" /></figure><p>Now you can see our model gave a perfect response. This is because we trained the model to learn bengali conversations. Therefore out finetuning process is successful. However we trained the model on a low lora rank and very low quantity of data due to which the model is not suitable for complex bengali questions. This project was developed to demonstrate the capability of finetuning Large Language Models. If you want to build production level finetuned LLMs then you probably need to use high end GPUs and large domain specific dataset for finetuning.</p><p>Thanks! Keep Learning.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=73bad579f0a4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Threading in Python]]></title>
            <link>https://medium.com/@abhishek20dgp/threading-in-python-b2b3971ca698?source=rss-34a965a298b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/b2b3971ca698</guid>
            <category><![CDATA[threading]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Abhishek Dasgupta]]></dc:creator>
            <pubDate>Sun, 06 Aug 2023 06:42:23 GMT</pubDate>
            <atom:updated>2023-08-06T06:42:23.432Z</atom:updated>
            <content:encoded><![CDATA[<p>A thread is a separate process that allows you to execute programs concurrently in Python. Suppose you want a particular function to execute in parallel with your main function, then threading can help you acheive this task. This process is also known as multi-threading.</p><p>In single-core CPUs threading is acheived by switching between different active threads. Threading allows you to decrease latency of a program by allows tasks to be executed in concurrent manner.</p><p>The threading module in Python offers the multithreading capabilities.</p><p>To import the threading module you need to:</p><pre>import threading</pre><p>Whenever you want to create a new thread you have to create an object of the Thread class.</p><pre>thread1 = threading.Thread(target, args)</pre><p>Here target is the method that you want to execute concurrently and args contains the arguments thaat you want to pass to the method.</p><p>To start a thread, execute the following command:</p><pre>thread1.start()</pre><p>As soon as this line is executed, a new thread is created and the program branches into the main process (which is your original program) and the newly created thread both of which execute at the same time.</p><pre>import threading<br>import time<br>def thread1():<br>    print(&quot;Thread has been successfully executed&quot;)<br><br>def main():<br>    print(&quot;Main function entered&quot;)<br>    t1 = threading.Thread(target=thread1, args=[])<br>    t1.start()<br>main()</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2b3971ca698" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My journey of becoming a GDSC Lead 2023–24 [Part 2]]]></title>
            <link>https://medium.com/@abhishek20dgp/my-journey-of-becoming-a-gdsc-lead-2023-24-part-2-a716bb453f5?source=rss-34a965a298b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/a716bb453f5</guid>
            <category><![CDATA[google]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[gdsc]]></category>
            <category><![CDATA[community]]></category>
            <dc:creator><![CDATA[Abhishek Dasgupta]]></dc:creator>
            <pubDate>Sat, 05 Aug 2023 19:44:14 GMT</pubDate>
            <atom:updated>2023-08-05T19:44:14.097Z</atom:updated>
            <content:encoded><![CDATA[<p>After reading the <a href="https://medium.com/@abhishek20dgp/my-journey-of-becoming-a-gdsc-lead-2023-24-part-1-6de2d9ef8614">previous post</a>, you might have an idea about my involvement in the developer community. The time had finally come when I had the chance to become the Lead of a community.</p><p>So, the GDSC Applications opened in February 2023 and I was quite excited to apply for it. The application process required me to write a detailed essay which involved 3 questions:</p><blockquote><em>1.What is your motivation to run a Google Developer Student Club at your Institution?</em></blockquote><blockquote><em>2.What is your experience in leading a project or a team?</em></blockquote><blockquote><em>3.What is your experience with technology?</em></blockquote><p><strong>The Essay Round:</strong></p><p>The most important reason why I was able to write good answers was the previous community and technology experience I had. Being part of communities helped me explain how I previously approched Google Developer Groups when I faced any issue related to coding. The deadline of submission of the essay was 31st March and I had submitted the application on the last day :)</p><p>I also had to record a 1 minute introduction video and upload it youtube which I did at 2 AM midnight.</p><p><strong>The Aptitude Test:</strong></p><p>After 1 week, I received an Aptitude Test Link and I had to give the 1 hour test in a proctored envioronment. The test was easy and consisted of mathematical and aptitude questions along with some coding questions. After that there was a behavioural round which consisted over 100 questions related to work-life balance and personality.</p><p><strong>The Final Round — Interview:</strong></p><p>Around 2 weeks later I received an Interview Link that was scheduled for 45 minutes. I was anxious for the interview but it went pretty well though I had messed up in some questions. The interviewer started with asking me about myself and what is my motivation to run a GDSC Club. Then she asked me how I will manage the club, how I will gather the core team and all. I was also asked extensively about my projects and I had to explain in detail about how I had built the project and what functionalities it provided. I was also asked some very easy technical questions related to DSA. At the end the most important questions were asked that is my strengths and weaknesses. If you are preparing for GDSC next year do keep these answers well prepared.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*XZgOZxFa3lxNYpzDacK2hQ.png" /></figure><p>Finally I received the Selection mail in July. It was a dream come true. All my efforts was finally recognized as I became the lead for the next session. I look forward towards the onboarding ceremony next week. Till then wait for the next part about my first Internship Journey.</p><p><strong>You can follow me on Linkedin:</strong> <a href="https://www.linkedin.com/in/abhishekdg1/">https://www.linkedin.com/in/abhishekdg1/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a716bb453f5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My journey of becoming a GDSC Lead 2023–24 [Part 1]]]></title>
            <link>https://medium.com/@abhishek20dgp/my-journey-of-becoming-a-gdsc-lead-2023-24-part-1-6de2d9ef8614?source=rss-34a965a298b9------2</link>
            <guid isPermaLink="false">https://medium.com/p/6de2d9ef8614</guid>
            <category><![CDATA[gdsc]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[google]]></category>
            <category><![CDATA[community]]></category>
            <dc:creator><![CDATA[Abhishek Dasgupta]]></dc:creator>
            <pubDate>Sat, 05 Aug 2023 06:58:23 GMT</pubDate>
            <atom:updated>2023-08-06T06:01:11.415Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Communities are the best place to learn and upskill yourselves. </em>Being a software developer, joining a developer community had always been my interest as you get to know like minded individuals with whom you can share your knowledge and vice versa.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/0*gtvW_L8RdPtuRwi7.png" /><figcaption>Google Developer Students Club</figcaption></figure><p>My journey of becoming a GDSC Lead started back in 2021 when I joined college. In my first year itself I became the core member of our college Tech club Icoders. I took a couple of workshops, hosted a online hackathon in collaboration with Reskill and did weekly python sessions. All of these definitely helped me improve my communication skills and knowledge.</p><p>As I had always been an introvert at school, hosting workshops was something that helped me throw away stage fear. If you are an introvert reading my post, <em>I would like to say just trust in yourself.</em></p><p>In August 2022, I came to know about the Google developer communities of Kolkata namely <strong>Google Cloud Kolkata</strong> and <strong>Google Developer Groups Kolkata</strong>. These organizations are doing really well in maintaining the standard of developer community in this region. I along with my friend had applied for the Cloud Community Days that was going to be hosted in Taj Taal Kutir, Eco Park and suprisingly we both had received the tickets. Visiting GCCD Kolkata 2022 was an amazing thing for me as we got a chance to meet super cool developers all around India who gave really good speeches at the event. Also Google never forgets to treat you :) so there was a unlimited buffet for us.</p><p>After visiting GCCD Kolkata, I had a fair idea about how the developer ecosystem works and how communities can partner and bring a change for developers all around the world. In November same year, I met with some core members of <strong>Google Developer Groups Durgapur</strong> and became a volunteer. I didnt knew that GDG Durgapur existed as it was a fairly new community. As a volunteer of GDG Durgapur, I was responsible for developing the official website of Devfest 22 Durgapur. We successfully organized the Devfest 22 with over 150 attendees and over 6 speakers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wgh-O5gTNeSq5YMAA-fgnQ.jpeg" /><figcaption>Devfest 2022 Durgapur</figcaption></figure><p>Also at the same time, I had applied for the core member selection of GDSC of our college and got selected as a AI/ML Lead.</p><p><strong>Fast forward to 2023</strong> — By this time, I was mostly involved in the developer communities and had good experience. A good community experience was crucial for me to get selected as a Lead. So I decided to apply for the selection of GDSC Lead by Google. If you dont know, Core members are selected by the GDSC Lead and the GDSC Lead itself is selected directly by the Google Team through a 3 step Essay-Aptitude Test-Interview process.</p><p>I will discuss about how I got selected as a GDSC Lead in the next part!</p><p><strong>Till then you can follow me on Linkedin:</strong> <a href="https://www.linkedin.com/in/abhishekdg1/">https://www.linkedin.com/in/abhishekdg1/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6de2d9ef8614" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>