0 like 0 dislike
36 views
in AI + Rasberry PI by

One of the most requested AI tools today is an automatic CV or Resume Generator powered by language models. In this guide, we'll show you how to build one on a Raspberry Pi 4 using Python and Open Source models. This lightweight solution doesn't require paid API keys, and it can be deployed as a local or web-based app.

Requirements

  • Raspberry Pi 4 (4GB or 8GB RAM recommended)

  • Raspberry Pi OS (Bookworm or Bullseye)

  • Python 3.9+

  • pip (Python package manager)

  • Basic knowledge of Python and command line

  • (Optional) Flask or Gradio for Web Interface

Step 1: Update and Prepare Your Pi

sudo apt update && sudo apt upgrade -y
sudo apt install python3-pip git

Step 2: Create Project Directory

mkdir ~/cv_generator && cd ~/cv_generator
python3 -m venv venv
source venv/bin/activate

Step 3: Install Required Libraries

pip install transformers gradio torch

On Raspberry Pi 4, Torch may take a while to install. Use pip install torch==1.13.1 if you face version issues.

Step 4: Choose a Small Language Model

We'll use the lightweight distilGPT2 to generate CV content.

from transformers import pipeline

generator = pipeline("text-generation", model="distilgpt2")

def generate_cv(name, job_title):
    prompt = f"Create a professional resume for {name}, applying for a {job_title} position."
    result = generator(prompt, max_length=300, num_return_sequences=1)
    return result[0]['generated_text']

Step 5: Add Gradio Interface

import gradio as gr

def run_cv_gen(name, job):
    return generate_cv(name, job)

gr.Interface(fn=run_cv_gen,
             inputs=["text", "text"],
             outputs="text",
             title="AI CV Generator on Pi",
             description="Enter your name and job title to generate a sample CV.").launch()

Step 6: Run the App

python3 app.py

Open your browser at http://localhost:7860

Step 7: Optional - Make It Public

Use ngrok or localtunnel to share your local Pi app with the world.

Example with localtunnel:

npx localtunnel --port 7860

Final Tips

  • You can replace distilgpt2 with any other small language model for more detailed results.

  • Add a "Download as PDF" button using pdfkit or reportlab for resume export.

  • Consider adding language selection for multi-lingual CVs.

Future Enhancements

  • Add support for uploading an existing resume and improving it

  • Integrate with job boards or LinkedIn scraping

  • Add image/logo or AI-generated portrait with Stable Diffusion


Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.

17 questions

1 answer

3 comments

2 users

Welcome to Asky Q&A, where you can ask questions and receive answers from other members of the community.
Asky AI - Home
HeyPiggy Banner
...