Exploring Four Unique Key Generation Strategies in GridGain and Apache Ignite

Some databases have a feature where a column can be “autoincremented.” In this piece, we’ll explain why GridGain and Apache Ignite do not and what you can do to get equivalent functionality.

The naming varies, but the concept is straightforward: the system automatically generates a key for you if there is no unique business key for a table. Typically, this would be a numeric column, and the data would increase the value by one every time you insert a new record. MySQL and MariaDB have specific SQL syntax for “AUTO_INCREMENT.” SQL Server has a special data type called IDENTITY. Oracle used to make you use a sequence and a trigger, but it has made it a bit easier in recent years.

Navigating the Maze: A Comprehensive Guide To Selecting the Right Messaging Queue

In the vibrant world of microservices and event-driven architectures, messaging queues have emerged as a critical component, enabling asynchronous communication, decoupling systems, and unlocking scalability. However, with a vibrant landscape of options, choosing the optimal queue can feel like navigating a complex maze. This guide empowers you to confidently make informed decisions by delving into key factors, popular choices, and tailored considerations for diverse use cases.

What Are Message Queues?

Imagine a message queue as a central communication hub within your application. Producers (applications or services) deposit messages containing data or tasks, while consumers (other applications or services) retrieve them for processing. This asynchronous communication paradigm fosters the following:

Deploy Your Own AI Chat Buddy

Alright, you tech-savvy human, brace yourself for a thrilling adventure into the land of artificial intelligence! We're not just dipping our toes here; we're diving headfirst into the deep end with the Qwen Chat Model. What's on the agenda? Setting up a cleverer chatbot than a fox and respecting privacy like a top-notch secret agent. Intrigued? You should be! Let's start our journey by understanding Generative AI and LLM (Large Language Model).

Generative AI

Generative AI refers to the branch of artificial intelligence focused on creating new content, whether text, images, music, or other forms of media. This type of AI leverages machine learning models, particularly generative models, to understand patterns, features, and relationships in large datasets and generate outputs that are new and often indistinguishable from human-created content.

Understanding Multi-Tenancy: Core Logic and High-Level Code With Django

Multi-tenant applications are crucial for efficiently serving multiple clients from a single shared instance, offering cost savings, scalability, and simplified maintenance. Such applications can allow hospitals and clinics to manage patient records securely, enable financial institutions to provide personalized banking services and help streamline inventory management and customer relationship management across multiple stores. The primary functionality of multi-tenant applications resides in their capacity to serve numerous clients through a single installation of the application. In this architecture, each client, referred to as a tenant, maintains complete data isolation, ensuring data privacy and security.

There are multiple third-party libraries available to implement multi-tenancy in Django. However, custom implementations of multi-tenancy can allow developers to innovate and tailor solutions according to unique business needs and use cases. Therefore, in this blog, we will show the core logic of how multi-tenancy is implemented using Django with a high-level code.

How We Use a Video Membership Site to Grow Our Email List

Our WPBeginner video site is a membership community where we offer free WordPress courses to our readers.

Many of you have asked how we benefit from offering these free resources.

Our main goal is to help users learn WordPress and bridge the knowledge gap. Our secondary goal is to promote our business by growing our email list.

In this article, we will show you how we use a video membership site to grow our email list, which helps us reach more customers and grow our business.

Growing email list with a video membership website

Note: This article is part of our WPBeginner Insider series, where we talk about the products we use to grow our business. WPBeginner Insider is published every other Thursday.

Here is a list of topics we will cover in this article:

Why Make a Video Membership Website?

Videos are the most engaging form of content, and building a membership community around videos helps us leverage that user engagement.

In fact, users are more likely to follow a video course online than other interactive training and educational materials.

The motivation behind offering free WordPress video courses on WPBeginner is to bridge the knowledge gap and help beginners learn WordPress for free.

Here is how Syed Balkhi, Founder and CEO of WPBeginner, puts it:

I am tired of self-proclaimed “blogging experts” charging hundreds of dollars to teach how to use WordPress. I believe basic education like this should be FREE. I created WPBeginner to offer users what I wish I had when starting out.

Syed Balkhi – Founder & CEO of WPBeginner

The following are some of the benefits of running a membership website.

  • Building authority in your niche – A membership community helps you establish your brand as an authority in the industry.
  • Make money online – We don’t monetize WPBeginner videos because we believe basic education like this should be free. However, you can replicate our strategy and monetize your membership site to generate recurring revenue for your business.
  • Build an Email List – A membership community can be used to build an email list and capture leads to grow your business.

Online membership subscriptions are a multi-billion dollar industry expected to be worth $1.5 trillion by 2025.

Plus, more than 48% of people do not mind paying a subscription fee to access exclusive content. (Source: Creator Economy Statistics)

You can use our video membership site marketing playbook to build a successful membership website and generate recurring revenue for your business.

How Does Our Video Membership Site Work?

As we explained earlier, we believe basic WordPress education should be free. That’s our main motivation behind WPBeginner’s video membership site.

Users simply visit the WPBeginner Videos website. From here, they can browse individual videos from our YouTube channel or sign up for our free WordPress courses.

WPBeginner's WordPress courses

After creating their free account, they will get access to all our WordPress courses. In return, we add users to our email list, where they get subscribed to our weekly WPBeginner newsletter.

These courses are designed to be comprehensive and well-structured. Users can follow them at their own pace. And they can move on to a different course at any time.

That said, let’s take a detailed look at how we use our membership site to grow our email list.

1. Build Authority With a Video Membership Website

We use MemberPress for our video membership website. It is the best WordPress membership plugin on the market that makes it very easy to build a subscription-based membership community online.

MemberPress

It also has a built-in LMS (learning management system), which allows you to easily create and sell courses online.

Why Do We Use MemberPress?

  • It is incredibly easy to use and set up. This is important because we didn’t want to spend too much time managing software instead of creating content.
  • It comes with MemberPress Courses, which allows us to easily add and manage courses.
  • Courses are presented to the users in an easy-to-follow layout. This was important for us because our users are mostly beginners.
  • It integrates with other tools and services like email marketing services, contact form plugins, top WordPress page builders, and more.

Adding Courses in MemberPress

Adding courses in MemberPress is quite easy. You can create a curriculum with sections and lessons, add quizzes to your courses, and more.

Creating courses in MemberPress

Another feature that many course creators may find useful is the ability to drip content instead of just giving it all at once.

Access Control for Subscribers Only

As a membership plugin, MemberPress lets us restrict courses behind a free membership plan (you can add paid subscriptions, too).

MemberPress access control

Users are required to sign up and then log in to access these courses. Users are then added to our mailing list to receive weekly WPBeginner updates.

Free but premium subscriber-only content helps us build a loyal following of users. It also establishes the WPBeginner brand as a go-to resource for all things WordPress.

2. Build an Email List With a Loyal Following

At WPBeginner, we use Drip for email marketing.

One of the top reasons we switched from Mailchimp to Drip was its automation features and integrations with other WordPress plugins and tools.

Drip website

Why Do We Use Drip?

  • Drip offers powerful automation features that help marketers create workflows for better user engagement.
  • You can personalize emails based on user data and activity on your site. When this personalization is combined with automation, emails become more relevant, meaningful, and beneficial for customers.
  • User segmentation allows you to target users based on the data they share and their activity on your site.

Adding Video Membership Subscribers to Drip

MemberPress comes with integrations for all top email marketing companies, including Drip.

MemberPress Drip integration

This allows you to automatically add users to your Drip email list when they sign up.

Optionally, you can use tags to segment video membership site users. This helps you target those users with personalized messages and on-boarding emails.

3. Convert Visitors Into Leads With a High-Converting Signup Page

MemberPress does a fantastic job of displaying courses. However, we still needed to create landing pages for our video membership website.

We have an in-house design team and developers, so we can afford a custom theme that matches our brand’s design and style.

If you’d rather design the page by yourself, we recommend using a WordPress page builder plugin like SeedProd.

SeedProd

Why Do We Recommend SeedProd?

  • SeedProd comes with an intuitive page builder, which makes it incredibly easy to create custom, on-demand landing pages.
  • It also includes many landing page designs optimized for conversion and sales. Just replace it with your text and images, and you are good to go.
  • You can easily add registration, user login, and sign-up forms. Plus, it works with major email marketing platforms, helping you easily add users to your email list.
  • SeedProd works regardless of which WordPress theme you are using. It can even be used to create custom WordPress themes without writing any code.

Transform Your Pages into a Lead-Generating Machine

We use landing pages for different sections of the video membership website.

For example, on the default landing page, we showcase videos from our YouTube channel.

WPBeginner video membership site homepage

These videos are always publicly available on the WPBeginner YouTube channel.

However, showcasing them here provides users with free content immediately. Users can watch the videos without leaving the page.

There are also calls to action on the landing page to join WPBeginner Academy (our course subscription).

WPBeginner video membership call to action

Clicking on the sign-up button takes users to our sign-up page. Now, if you have run an eCommerce business, then you might already be familiar with abandoned carts.

Many users leave at this point before signing up. To convince them to join our video membership site, this page showcases testimonials and course features, along with a sign-up form.

This allows us to further explain the benefits of our online videos and convince people to sign up for these free resources.

For more information, you can see our guide to the anatomy of a high-converting landing page.

WPBeginner video site sign up page

4. Craft Unique Sign-Up and Login Forms for Enhanced User Interaction

As a website administrator, you will need to provide a seamless and coherent user experience throughout your website.

WordPress themes don’t come with sign-up or login forms by default. This can hurt the user experience as forms across your website will not be consistent.

We use WPForms to create custom sign-up and login forms for our video membership site. It is the best WordPress form builder on the market and allows you to create all types of forms for your site, including login and sign-up forms.

WPForms

Why Do We Use WPForms?

  • It is easy and creates beautiful forms that look great on all devices.
  • It lets us create custom login and registration forms, which we use on our video membership sign-up landing page and the login screen.
  • It supports the biggest email services, allowing us to easily add emails to Drip (the email marketing platform we use).

How We Use WPForms?

We use a custom sign-up form made with WPForms on our sign-up landing page.

For details on how to do this, you can see our tutorial on how to create a custom user registration form in WordPress.

Custom sign-up form created with WPForms

We also use a custom login form on the login page for our video membership site.

We created this page using block editor and WPForms. However, you can also create custom login pages with SeedProd.

WPBeginner video site login form

5. Use Bonus Tools to Generate More Leads on a Membership Website

Apart from the technology stack we mentioned above, you can use the following tools to boost new sign-ups further.

1. OptinMonster

OptinMonster website

OptinMonster is the best lead generation software on the market. It allows you to nudge users into signing up with beautiful marketing campaigns like lightbox popups, slide-in popups, countdown timers, sticky header/footer, and more.

Related: See our case study for more methods we use to grow our email list.

2. PushEngage

PushEngage website

PushEngage is a push notification software that allows you to send custom messages to user browsers regardless of which device they are using.

It has powerful personalization and targeting rules, allowing you to create personalized messages that are more effective. This enables you to target users once they have left your website and prompt them to return.

Case Study: In an earlier WPBeginner Insider article, we shared how we use push notifications to grow return traffic.

3. Smash Balloon

SmashBalloon

A video membership website helps you build a loyal following, which you can then send to your social media accounts to boost your followers.

Smash Balloon helps you bring your socials to your WordPress site. We use it on our community tab to showcase our X (formerly Twitter) and YouTube posts. It also works with Instagram, TikTok, and Facebook.

For more details, you can see our tutorial on how to add your social media feeds to WordPress.

4. All in One SEO for WordPress

All in One SEO website

All in One SEO for WordPress is the best WordPress SEO plugin with the most comprehensive SEO toolkit for WordPress websites.

Apart from the usual SEO tools, it has advanced XML sitemaps, a redirect manager, comprehensive schema markup support, Link Assistant, search stats, and more. (See more AIOSEO features).

We use it across our entire website, including our video membership website, to improve our SEO and get more traffic from search engines.

Related: How to double your SEO traffic in 6 months (with case studies).

5. MonsterInsights

MonsterInsights

All your marketing efforts need to be properly tracked to monitor their success and make data-driven decisions. Otherwise, you won’t know if your strategies are actually helping you get more signups to your membership site.

We use MonsterInsights for that. It is the best Google Analytics plugin for WordPress and helps you track site visitors. It helps you track conversions, which lets you measure the success of your video membership site, email forms, landing pages, and more.

MonsterInsights even allows you to track the customer journey on membership websites if you are using MemberPress. This lets you see the steps that users take to sign up on your video membership site and use that information to get more signups.

We hope this article helped you learn about using membership websites to grow your email list and your business. You may also want to see these proven tips to grow your business online and our ultimate guide on how to make a membership site.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How We Use a Video Membership Site to Grow Our Email List first appeared on WPBeginner.

Waiting For Spring (March 2024 Wallpapers Edition)

March is here! With the days getting noticeably longer in the northern hemisphere, the sun coming out, and the flowers blooming, we are fueled with fresh energy. And even if spring is far away in your part of the world, you might feel that 2024 has gained full speed by now — the perfect opportunity to bring all those plans you made and ideas you’ve been carrying around to life!

To cater for some extra inspiration this March, artists and designers from across the globe once again challenged their creative skills and designed wallpapers for your desktop and mobile screens. They come in versions with and without a calendar for March 2024 and can be downloaded for free — a monthly tradition that has been going on here at Smashing Magazine for more than twelve years already.

As a little bonus goodie, we also added some March favorites from our wallpapers archives to the collection. Maybe you’ll spot one of your almost-forgotten favorites from the past in here, too? Thank you to everyone who shared their wallpapers with us this month! This post wouldn’t exist without you.

  • You can click on every image to see a larger preview,
  • We respect and carefully consider the ideas and motivation behind each and every artist’s work. This is why we give all artists the full freedom to explore their creativity and express emotions and experience through their works. This is also why the themes of the wallpapers weren’t anyhow influenced by us but rather designed from scratch by the artists themselves.
  • Submit a wallpaper!
    Did you know that you could get featured in our next wallpapers post, too? We are always looking for creative talent.

Breaking Superstitions

“Step into a world of delightful rebellion with our calendar feature for National Open an Umbrella Indoors Day. This vibrant illustration captures the spirit of breaking free from superstitions.” — Designed by PopArt Studio from Serbia.

Fresh Flow

“It’s time for the water to go down the mountains, it’s time for the rivers to get rid of ice blocks, it’s time for the ground to feed the plants, it’s time to go out and take a deep breath. I imagined these ideas with interlacing colored lines.” — Designed by Philippe Brouard from France.

Music From The Past

Designed by Ricardo Gimenes from Sweden.

Pika Pika Chu

Designed by Design Studio from India.

Hat’s Off to Good Fortune

“Flipping the switch on luck in 2024 with a tip of the hat! Here’s to welcoming good fortune, warmth, and endless smiles.” — Designed by HeyClipart from Greece.

Northern Lights

“Spring is getting closer, and we are waiting for it with open arms. This month, we want to enjoy discovering the northern lights. To do so, we are going to Alaska, where we have the faithful company of our friend White Fang.” — Designed by Veronica Valenzuela Jimenez from Spain.

Zombie’s Happy Hour

Designed by Ricardo Gimenes from Sweden.

Time To Wake Up

“Rays of sunlight had cracked into the bear’s cave. He slowly opened one eye and caught a glimpse of nature in blossom. Is it spring already? Oh, but he is so sleepy. He doesn’t want to wake up, not just yet. So he continues dreaming about those sweet sluggish days while everything around him is blooming.” — Designed by PopArt Studio from Serbia.

Queen Bee

“Spring is coming! Birds are singing, flowers are blooming, bees are flying… Enjoy this month!” — Designed by Melissa Bogemans from Belgium.

Spring Is Coming

“This March, our calendar design epitomizes the heralds of spring. Soon enough, you’ll be waking up to the singing of swallows, in a room full of sunshine, filled with the empowering smell of daffodil, the first springtime flowers. Spring is the time of rebirth and new beginnings, creativity and inspiration, self-awareness, and inner reflection. Have a budding, thriving spring!” — Designed by PopArt Studio from Serbia.

Botanica

Designed by Vlad Gerasimov from Georgia.

Fresh Lemons

Designed by Nathalie Ouederni from France.

Let’s Spring

“After some freezing months, it’s time to enjoy the sun and flowers. It’s party time, colours are coming, so let’s spring!” — Designed by Colorsfera from Spain.

March For Equality

“This March, we shine the spotlight on International Women’s Day, reflecting on the achieved and highlighting the necessity for a more equal and understanding world. These turbulent times that we are in require us to stand together unitedly and IWD aims to do that.” — Designed by PopArt Studio from Serbia.

Spring Bird

Designed by Nathalie Ouederni from France.

Awakening

“I am the kind of person who prefers the cold but I do love spring since it’s the magical time when flowers and trees come back to life and fill the landscape with beautiful colors.” — Designed by Maria Keller from Mexico.

Let’s Get Outside

Designed by Lívia Lénárt from Hungary.

Waiting For Spring

“As days are getting longer again and the first few flowers start to bloom, we are all waiting for spring to finally arrive.” — Designed by Naioo from Germany.

Ballet

“A day, even a whole month, isn’t enough to show how much a woman should be appreciated. Dear ladies, any day or month are yours if you decide so.” — Designed by Ana Masnikosa from Belgrade, Serbia.

MARCHing Forward

“If all you want is a little orange dinosaur MARCHing (okay, I think you get the pun) across your monitor, this wallpaper was made just for you! This little guy is my design buddy at the office and sits by (and sometimes on top of) my monitor. This is what happens when you have designer’s block and a DSLR.” — Designed by Paul Bupe Jr from Statesboro, GA.

Nothing To Do

Designed by Ricardo Gimenes from Sweden.

Orion’s Apple

Designed by Monia Gabhi from Canada.

St. Patrick’s Day

“On the 17th March, raise a glass and toast St. Patrick on St. Patrick’s Day, the Patron Saint of Ireland.” — Designed by Ever Increasing Circles from the United Kingdom.

Questions

“Doodles are slowly becoming my trademark, so I just had to use them to express this phrase I’m fond of recently. A bit enigmatic, philosophical. Inspiring, isn’t it?” — Designed by Marta Paderewska from Poland.

Explore The Forest

“This month, I want to go to the woods and explore my new world in sunny weather.” — Designed by Zi-Cing Hong from Taiwan.

The Great Beyond

“My inspiration came mostly from ‘The Greay from’. It’s about a dog and an astronaut exploring a strange new world.” — Designed by Lars Pauwels from Belgium.

Happy Birthday Dr. Seuss!

“March the 2nd marks the birthday of the most creative and extraordinary author ever, Dr. Seuss! I have included an inspirational quote about learning to encourage everyone to continue learning new things every day.” — Designed by Safia Begum from the United Kingdom.</p

Pizza Time

“Who needs an excuse to look at pizza all month?” — Designed by James Mitchell from the United Kingdom.

Tacos To The Moon And Back

Designed by Ricardo Gimenes from Sweden.

Retrieval Augmented Generation (RAG) with Google Gemma From HuggingFace

In a previous article, I explained how to fine-tune Google's Gemma model for text classification. In this article, I will explain how you can improve performance of a pretrained large language model (LLM) using retrieval augmented generation (RAG) technique. So, let's begin without ado.

What is Retrieval Augmented Generation (RAG)

Retrieval Augmented Generation (RAG) enhances a language model's knowledge by integrating external information into the response generation process. By dynamically pulling relevant information from a vast corpus of data, RAG enables models to produce more informed, accurate, and contextually rich responses, bridging the gap between raw computational power and real-world knowledge.

RAG works in the following four steps:

  1. Store data containing external knowledge into a vector database.
  2. Convert the input query into corresponding vector embeddings and retrieve the text from the database having the highest similarity with the input query.
  3. Formulate the query and the information retrieved from the vector database.
  4. Pass the formulated query to an LLM and generate a response.

You will see how to perform the above steps in this tutorial.

RAG with Google Gemma from HuggingFace

We will first import the required libraries and then import our dataset from Kaggle. The dataset consists of Warren Buffet letters to investors from 1977 to 2021.

Next, we will split our dataset into chunks using the Pythhon LangChain module. Subsequently, we will import an embedding model from HuggingFace and create a dataset containing vector embeddings for the text chunks.

After that, we will retrieve responses from the dataset based on our input query. Finally, we will pass the query and database response to the Gemma LLM model to generate the final response.

Importing Required libraries
!pip install -q langchain
!pip install -q torch
!pip install -q -U transformers==4.38.0
!pip install -q sentence-transformers
!pip install -q -U bitsandbytes==0.42.0
!pip install -q datasets
!pip install -q faiss-cpu
!pip install unstructured
!pip install accelerate
!pip install kaggle
!pip install huggingface-hub

The script below imports required libraries.


from langchain.text_splitter import RecursiveCharacterTextSplitter
from langchain.embeddings import HuggingFaceEmbeddings
from langchain.chains.question_answering import load_qa_chain
from sentence_transformers import SentenceTransformer
from langchain.vectorstores import FAISS
from transformers import AutoTokenizer, AutoModelForCausalLM
from transformers import BitsAndBytesConfig, GemmaTokenizer
from transformers import AutoTokenizer, pipeline
from langchain_community.document_loaders import DirectoryLoader
import torch
Importing Warren Buffet Letters Dataset from Kaggle

I ran my script in Google Colab and downloaded the Kaggle dataset in Google Colab.

Using the following script, you can import your Kaggle.json file containing your Kaggle API key into Google Colab.


from google.colab import files
uploaded = files.upload()

Next, You can run the following script to download and unzip the dataset into your Google Colab directory.


!mkdir -p ~/.kaggle
!cp kaggle.json ~/.kaggle/
!chmod 600 ~/.kaggle/kaggle.json

!kaggle datasets download -d balabaskar/warren-buffet-letters-to-investors-1977-2021

!unzip -q /content/warren-buffet-letters-to-investors-1977-2021.zip
Reading and Splitting Documents with Langchain

The following script uses the LangChain DirectoryLoader().load() method to load the text documents into LangChain document objects.


folder_path = '/content/Warren_buffet_letters/Warren_buffet_letters'
loader = DirectoryLoader(folder_path, glob='**/*.txt')
docs = loader.load()
print(f"Total documents loaded: {len(docs)}")

Output:

Total documents loaded: 45

Next, we will divide our documents into multiple chunks using the RecursiveCharacterTextSplitter from the langchain.text_splitter module. You can use any other splitter if you want.

The following script creates an object of the RecursiveCharacterTextSplitter class. We divide our documents into chunks of 1000 characters with an overlap of 200 characters between all chunks.


splitter = RecursiveCharacterTextSplitter(
    chunk_size=1000,  
    chunk_overlap=200,  
    length_function=len
)

The script below divides all the documents into text chunks using the RecursiveCharacterTextSplitter splitter.


all_text_chunks = []  # To store chunks from all documents
for doc in docs:
    text_content = doc.page_content
    text_chunks = splitter.split_text(text_content)
    all_text_chunks.extend(text_chunks)

print("Total chunks:", len(all_text_chunks))
print("============================")

Output:

Total chunks: 4795
============================
Creating Document embeddings

The next step is to create vector embeddings for these chunks. You can use any embedding model you want. However, for this article, I will use a free open source embedding model from HuggingFace.


embedding_model = SentenceTransformer("thenlper/gte-large")
model_path = "thenlper/gte-large"
embeddings = HuggingFaceEmbeddings(
    model_name = model_path
)

embedding_vectors = FAISS.from_texts(all_text_chunks, embeddings)

The FAISS in the above script is a Facebook library that allows efficient searching and clustering of vector embeddings. We vectorize our document using this library.

We have created our vector embeddings. Let's see an example. In the following script, we pass an input query to our vector embeddings database, which returns the text with the highest similarly.


question = "What is Warren Buffets Investment Pshychology?"
searchDocs = embedding_vectors.similarity_search(question)
searchDocs[0].page_content

Output:

image1.png

Getting Response Using Gemma Model

We will pass our input query and response from the vector database to the Gemma model to generate the final response.

First, you must log in to HuggingFace CLI by passing your HuggingFace access token in response to the following command.

!huggingface-cli login

Next, we will import the tokenizer and model weights for the gemma-2b-it model, a 2 billion parameters instruction variant of Gemma.


model_name = "google/gemma-2b-it"

device = "cuda:0"

tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForCausalLM.from_pretrained(model_name, device_map="auto")

Finally, we will define the generate_response() function that accepts a text query, generates a response from the vector embeddings, combines the input query and vector response, and passes it to the Gemma model for the final response.


def generate_response(query):
  searchDocs = embedding_vectors.similarity_search(question)

  response = searchDocs[0].page_content

  final_query = f"""Query: {query}\nContinue to answer the query by using the following Search Results.\n{response}. <end>"""
  print(final_query)


  inputs = tokenizer(final_query, return_tensors="pt").to(device)
  outputs = model.generate(**inputs, max_new_tokens = 500)
  final_response = tokenizer.decode(outputs[0], skip_special_tokens=True)

  return final_response

We can test the generate_response function using the following script:


query = "What is Warren Buffets Investment Pshychology?"
final_response = generate_response(query)
print("===================================")
print("RESPONSE FROM RAG MODEL")
print("===================================")
print(final_response.split("<end>")[1])

Output:

image2.png

You can see that the response contains information from our dataset. The response is more customized depending upon the information we passed to it from our vector database.

Conclusion

RAG is a powerful technique for integrating external knowledge into an LLM response. In this article, you saw how you can use vector embeddings and RAG to retrieve enhanced responses from an LLM model. You can use this technique to create custom chatbots based on your dataset. I suggest you try the Gemma 7b (seven billion parameters) model to see if you get better responses.

Semantic Search With Weaviate Vector Database

In a previous blog, the influence of the document format and the way it is embedded in combination with semantic search was discussed. LangChain4j was used to accomplish this. The way the document was embedded has a major influence on the results. This was one of the main conclusions. However, a perfect result was not achieved. 

In this post, you will take a look at Weaviate, a vector database that has a Java client library available. You will investigate whether better results can be achieved.

The Rise of AI Scams: Deciphering Reality in a World of Deepfakes

Discover the world of AI scams and find out how you can shield yourself against the cunning deceptions of deepfakes.

deepfakes-deep-implications.jpg

In an incident that underscores the alarming capabilities of artificial intelligence in the realm of fraud, a company in Hong Kong was defrauded of $25 million earlier this year. The elaborate scam involved an employee being deceived by sophisticated AI-generated impersonations of his colleagues, including the company's CFO based in the UK. The scammers leveraged deepfake technology, utilizing publicly available videos to craft eerily convincing replicas for a fraudulent video call.

This signals that we have officially entered the era of AI-facilitated scams. But what does this mean for the average person? How do deepfakes redefine digital deception? And how can we protect ourselves from these increasingly sophisticated scams? Keep on reading and youll find out.

Old Tricks, New Tools

Before we dive deeper into the implications of AI scams, lets take a quick look at the mechanics of the example from Hong Kong: This scam is essentially an iteration of the age-old CEO fraud, where imposters posing as senior company executives instruct unsuspecting employees to transfer funds urgently. The basic tools were a fake email-signature and -address. However, the advent of deepfake technology has significantly enhanced the scammer's arsenal, allowing them to emulate a CEO's voice, facial expressions, mannerisms, and even their personality with frightening accuracy. Hence, my prediction is that scams will become more elaborate, more personalized, and they will seem as real as anything else you engage with in the digital space.

Expect Personalized Phishing to Become a Thing

Traditionally, phishing attempts were largely indiscriminate, with scammers casting a wide net in hopes of capturing a few unsuspecting victims. These attempts often took the form of emails pretending to be from reputable institutions, sent out to thousands, if not millions, of recipients. The success of such scams relied on the sheer volume of attempts, with personalization playing a minimal role.

However, AI-generated content has shifted the balance, providing scammers with the tools to create highly personalized scams. Imagine this: someone recreates the voice of a random person. They then target people in that persons friends list with calls and audios that describe some kind of emergency and coax them to send money. By utilizing AI to mimic the voice or appearance of individuals, scammers can target people within the victim's social circle with tailored messages. Such scams are far more likely to elicit a response, leveraging the trust established in personal relationships.

The risk of becoming the protagonist of such a scam is particularly high for individuals with a significant online presence, as the content they share provides a rich dataset for scammers to exploit.

Deepfakes with Deep Implications

Deepfakes might also cause trouble beyond scamming your loved ones for their hard-earned savings. Imagine someone hacks into the system of a major broadcasting network and releases a fake breaking news bulletin announcing the outbreak of a nuclear war. Or a viral video that shows a member associated with imaginary group A behaving violently against a member of imaginary group B, causing a moral panic that leads to actual violence between the two groups. These are just two of endless possibilities to cause turmoil with AI generated content.

How to Stay Safe

Its reasonable to expect that deepfakes will increasingly be usedor abusedto impose more regulations on AI models. This, however, will not keep scammers and other people with bad intentions from creating whatever they want with their own offline models. In a nutshell, regulations will continue to make it difficult for the average user to generate funny pictures of celebrities, but they may not be sufficient to deter malicious actors. The strategy might actually backfire, as prohibitions usually do. Underground/dark web solutions might just become more popular overall.

So, what can we do to protect ourselves from falling for deepfakes? Critical thinking remains the first line of defense: verifying information through multiple credible sources, identifying logical inconsistencies, and consulting expert advice when in doubt. Technologically, robust security practices such as strong, unique passwords, multi-factor authentication, and malware protection are essential. And one thing learned from the $25 million scam in China is this: The importance of verifying the identity of individuals in significant transactions cannot be overstated, with face-to-face communication or the use of different communication channels being preferable.

Theres also a simple and effective way to safely handle communication from loved ones in apparent emergency situations: Come up with secret codewords with close friends and relatives (offline!) that you can use to verify their identity in such a case! This way, you can make sure it is actually your son/daughter/neighbor/friend who calls you in panic to tell you they lost all their money and need an emergency transfer.

Progress on the Singularity Loading Bar

The emergence of AI scams, exemplified by the $25 million fraud in Hong Kong, marks a crucial moment on the Singularity Loading Bar. As we venture further into this era of technological sophistication, the line between reality and fabrication becomes increasingly blurred. Awareness, education, and vigilance are essential in protecting ourselves from the myriad threats posed by deepfakes. By fostering a culture of skepticism and prioritizing personal interactions, we can mitigate the risks.

How to Create Multiple Sub-folders in Google Drive Automatically

A teacher would like to create separate Google Drive folders for each student in her class. Within each student’s folder, there will be additional subfolders for various subjects. This folder structure would make it easier for students to submit their assignments to the appropriate subject subfolders.

Students' data in Google Sheets

We’ve prepared a Google Sheet with the names of students, and the subjects they are taking. For example, consider a student named Emily Johnson, who is taking Maths, Science, and English. In this case, you need to create four new folders in total, with one main folder named ‘Emily Johnson’ and three subfolders within it for each subject: Maths, Science, and English.

Create Multiple Folders in Google Drive

Install the Document Studio add-on for Google Sheets. Open the spreadsheet with the student data and click on Extensions > Document Studio > Open to launch the add-on.

Create a new workflow inside Document studio, give it a descriptive name like Student Folders. Next, select the source worksheet that contains the student’s data and click on the Continue button to move to the next step.

Google Drive Task

On the next screen, you can specify the conditions for creating the folders in Google Drive. For instance, you may only want to create folders for students who are taking a specific subject or are in a particular class. Press the Continue button to move to the next step.

Choose the Google Drive task and then select Create Folder from the dropdown menu. Next, select the parent folder in Google Drive where the student folders should be created. You can choose to create folders inside your personal Google Drive or even Shared Drives.

Google Drive Folders

Naming Folders and SubfoldersStudent Folders

Now that you have selected the parent folder, you need to define the name of the child folder along with its subfolder structure.

For the Subfolder Name field, we’ll put {{ Full Name }} / {{ Subject 1 }} and this will do two things:

  1. Create a new folder for each student in the parent folder with the student’s name. The folder is only created if it doesn’t already exist.

  2. Inside the student folder, create a subfolder for Subject 1 that the student is taking. The value of Subject 1 is replaced with the actual subject name from the Google Sheet.

Subject Folders

You may also put the {{Email Address}} column in the Editors field to share the student folders with their email addresses automatically when the folder is created in Google Drive.

Create Additional Subject Subfolders

Now that you have defined the task to create subfolders for the first subject, you can add more tasks to create subfolders for other subjects as well.

Instead of creating a new task, you can simply duplicate the existing task and change the Subfolder Name field to {{ Full Name }} / {{ Subject 2 }} to create subfolders for the remaining subjects.

Create Subject Folders

Now that workflow is ready, choose the Save and Run option to create the folders and subfolders in Google Drive. The folders would be created and a link to the folder would be placed in the spreadsheet itself. If a folder already exists, the link to the existing folder is placed in the spreadsheet.

This is how the folder structure would look like in Google Drive:

Create Drive Folder Structure

Also see: Create Folders for Google Form responses

21 Best WordPress Themes for Crowdfunding

Are you looking for a WordPress theme for crowdfunding?

Many WordPress themes are geared towards corporate or blogging websites and may not be a good fit to help you raise funds for your organization or cause.

In this article, we will share some of the best WordPress themes for crowdfunding and fundraising websites.

Best WordPress themes for crowdfunding

Building a Crowdfunding Website With WordPress

Crowdfunding helps startups, charities, and individuals raise money for their projects. It allows you to collect small contributions from individuals to reach your fundraising goals.

Many of these projects use crowdfunding platforms like Kickstarter to run their campaign. However, you will also need your own website to better showcase your idea, mission, or cause.

This is where WordPress comes in. It’s the world’s most popular content management system, powering over 43% of all websites on the internet.

A self-hosted WordPress site gives you the flexibility and functionality to easily integrate with all popular third-party services you may be using for crowdfunding.

To get started, you will need a WordPress hosting account and a domain name. A domain name is your site’s address on the web, like wpbeginner.com or google.com. Web hosting is the storage for all your website files.

We recommend using Bluehost. They are one of the largest web hosting companies in the world and an officially recommended WordPress hosting provider.

Bluehost offer for WPBeginner readers

Bluehost is offering WPBeginner readers a big discount on hosting, plus a free domain name and free SSL certificate.

Once you have signed up for hosting, you can move on to installing WordPress. Head over to our step-by-step guide on how to make a WordPress site, and you will be up and running in no time.

Next, you will need to choose a theme for your website. You can select any theme from our expert pick below. If you need help installing the theme, then just check out our guide on how to install a WordPress theme.

Now, let’s take a look at some of the best WordPress themes for crowdfunding.

1. Astra

Astra Crowdfunding Site

Astra is a fast and lightweight WordPress multipurpose theme that works well for crowdfunding sites. You can easily add a 1-click starter template and customize it to give details about your organization or project.

You can use Astra with any popular drag-and-drop page builder plugin, such as Elementor Pro or Visual Composer. It’s also fully compatible with the WordPress block editor.

Astra also works seamlessly with all popular WordPress plugins, including crowdfunding plugins. This helps you raise money and take donations easily.

2. SeedProd

SeedProd crowdfunding and fundraising site

SeedProd is the best WordPress website and theme builder. It comes with several ready-made website templates, including a fully functional layout for your crowdfunding site.

You can import any template in one click and customize it with SeedProd’s built-in drag-and-drop builder. It’s beginner-friendly and gives you easy access to all the tools you need to design your website.

Moreover, it integrates with your favorite tools and plugins. SeedProd is the best choice for making a crowdfunding website, and we fully recommend it.

3. Divi

Divi Crowdfunding Site

Divi is a WordPress theme plus page builder plugin that gives you an easy front-end editor for your website. It uses a responsive design and is also created to be SEO-friendly.

You can use Divi’s thousands of templates to start your website quickly. They have a range of community and non-profit layout packs that could be perfect for your crowdfunding or charity site.

4. OceanWP

OceanWP

OceanWP is a free and flexible WordPress theme. You can also choose the Pro version, which comes with multiple website templates that you can use to start your site quickly.

Because OceanWP is a fully responsive theme, your website will look good on all devices. You can add a custom logo, social icons, and more.

5. Ultra

Ultra

Ultra is a dynamic and flexible theme that could be the perfect fit for your crowdfunding efforts. It ships with several ready-made websites that can be installed with one click. You can then replace the content with your own to create your site quickly.

Ultra also has an integrated drag and drop page builder, which allows you to create beautiful page layouts of your own. Inside, you will also find sections to add a portfolio, photo galleries, testimonials, events, and more.

You may also want to add a plugin such as Easy Digital Downloads if you are providing an exclusive download in return for a donation.

6. Hestia Pro

Hestia Pro

Hestia Pro is a beautiful multipurpose WordPress theme that could work perfectly for your crowdfunding website. It is fully compatible with all the best WordPress plugins, so you can easily extend your WordPress website with new features.

Plus, Hestia Pro is retina-ready. That means your website will look great on all devices, even the most recent smartphones.

7. Monochrome

Monochrome Pro

Monochrome is a minimalist WordPress theme that is stylish and simple at the same time. It’s optimized for great performance and won’t slow your site down.

Monochrome features a widgetized homepage layout, which helps you set up your website easily. It also includes a customizable header, theme options panel, widget areas, and full WooCommerce plugin support.

StudioPress is now part of WP Engine, the most popular managed WordPress hosting company. You can get this theme and all 35+ other StudioPress themes when you sign up for WP Engine hosting to build your website.

Bonus: WPBeginner users also get an additional 20% OFF. Get started with WP Engine today!

8. Struct

Struct

Struct is another modern WordPress theme that is perfect for crowdfunding. Designed for businesses and startups, it features a drag-and-drop homepage layout with a large fullscreen header at the top.

It includes unlimited color choices, custom widgets, a portfolio, photo galleries, projects, testimonials, an FAQ section, and more. It also works with all popular page builder plugins, so you can create your own page layouts if needed.

9. Nayma

Nayma

Nayma is a multi-purpose WordPress theme that can be easily used for crowdfunding projects. It uses modules as building blocks to create page layouts and has all the commonly used web elements available as modules. You can drag and drop them anywhere on your pages.

Plus, Nayma includes several ready-made websites that you can use as a starting point. It has unlimited custom sidebars, sliders, icon fonts, Typekit font support, testimonials, pricing tables, a contact form, and more.

10. Sydney Pro

Sydney Pro

Sydney Pro is another powerful WordPress theme with flexible customization options. It can be used as a one-page or multi-page theme and comes with built-in sections for your portfolio, team members, testimonials, clients, and galleries.

The theme also includes several starter templates, page layouts, custom widgets, and social media integration. It’s also eCommerce-ready with full WooCommerce support. It can also be used with popular WordPress membership plugins.

11. Essence Pro

Essence Pro

Essence Pro is an elegant WordPress theme suitable for crowdfunding, landing pages, and sales page websites. The homepage features a large fullscreen header with prominent call-to-action buttons. It has a widgetized layout, allowing you to set up the homepage using drag-and-drop content widgets.

The theme uses beautiful parallax effects to create an engaging experience for your users. It’s WooCommerce-ready and comes with a simple theme options panel and WordPress live customizer support.

12. Charity Fundraiser

Charity Fundraiser

Charity Fundraiser is a free WordPress theme for charities and non-profits to create crowdfunding websites. It features an elegant layout designed to showcase your cause and encourage donations from your supporters and backers.

The theme customization options can all be accessed using the live theme customizer. You can change the header image, image slider, and background colors and add social media links.

13. Inspiro

Inspiro

Inspiro is another great choice for a WordPress crowdfunding theme. It comes with built-in support to easily add videos as a fullscreen background. It also includes a beautiful video lightbox popup for an engaging viewing experience.

Inspiro has a drag-and-drop homepage layout and offers integration with a free page builder plugin. Other notable features include page templates, a portfolio section, a hero banner, gallery templates, custom widgets, and full WooCommerce support.

14. Corner

Corner

Corner is one of the best WordPress themes for tech startups, small businesses, and non-profits. It comes with a sidebar homepage layout that lets you display your welcome message, navigation menu, and social media icons in the sidebar.

The theme integrates with several plugins to let you add a portfolio, testimonials, a contact form, Google Maps, and more. All the theme options are easy to set up, and a 1-click demo content installer is also available for a quick start.

15. Brizy

Brizy

Brizy is a multipurpose WordPress theme with lots of template options. Their Hope template is perfect for charities and non-profits engaging in crowdfunding and fundraising campaigns. The theme includes slider layouts, a 1-click demo content installer, and Brizy’s visual drag-and-drop page builder. It has support for popular WordPress plugins for non-profits.

Brizy’s features include multiple color schemes, event management, multiple layouts, and social media integration. It can also be used to create multilingual WordPress sites with WPML.

16. Balance

Balance Crowdfunding Theme

Balance is a great business theme designed to put your brand in the center. Perfect for a crowdfunding website, Balance is a great theme that comes with a modern and stylish homepage layout. This allows you to feature your projects and boost your conversions, supporters, and backers.

It’s eCommerce-ready and has beautiful templates for shop and product pages. Other features include multiple blog styles, color schemes with unlimited customizations, an Instagram widget, custom fonts, and a logo.

17. Spencer

Spencer

Spencer is a multipurpose WordPress theme in the minimalist design tradition. It has a sticky navigation menu with multiple sections on the homepage where you can add featured blog posts, social media icons, and an email subscription form.

The homepage can be set up by simply adding content widgets to create your page layout. It also includes social media integrations and content discovery features.

18. Advance Startup

Advance Startup

Advance Startup is a stylish and free WordPress theme for business websites. It’s easy to set up and features beautiful typography, an elegant design, and a simpler theme setup.

The theme supports a custom header, custom footer formats, and a custom background. It has different page templates and is multilingual-ready with RTL language support.

19. Presence

Presence Crowdfunding Theme

Presence is a sleek WordPress theme for mobile apps or any other product website. Its homepage features a prominent call-to-action button on top of a full-width header image.

The theme comes with a dual navigation menu, social media integration, icon fonts, and custom widgets. It can be used on multilingual sites using WPML.

20. Indigo

Indigo

Indigo is a stunningly beautiful and very easy-to-use WordPress theme. It’s designed to be a multipurpose theme, allowing you to choose your own layouts and styles without writing any code. It includes several ready-made websites that you can install with 1-click to import demo content.

If you don’t want to start with a ready-made website, then you can just drag and drop modules to create your own layout. Indigo features beautiful typography, stunning templates for galleries, portfolios, services, testimonials, and many more customization options.

21. Polity Lite

Polity Lite

Polity Lite is a stylish and modern campaign theme that could be a great crowdfunding option for a charity, NGO, or political organization.

It includes the options for a custom header and custom logo and is also translation-ready to create a site for a global audience. Polity Lite also includes a social media icon menu.

Crowdfunding With WordPress: Tips for Success

How you run your crowdfunding campaign in WordPress depends on what platform you are using to raise funds. Here are some brief instructions for Kickstarter and WPForms.

Adding Your Kickstarter Project in WordPress

If you are using Kickstarter, you will first need to visit your Kickstarter project page.

On your project page, click on the ‘Embed’ button.

Click the embed button on your Kickstarter page

This will bring up a popup.

You need to click the link to embed your project on an external site.

Click the link for embedding your code on an external site

Then, simply copy the embed code.

You can copy it for either the project video or the widget.

Copy and paste the embed code

Now, you need to edit the post or page where you want to display your Kickstarter project. You can also add it to a text widget in your sidebar.

You can add the code into an HTML block in the WordPress block editor. If you are using the Classic Editor, then don’t forget to switch to the text editor mode.

Simply paste the embed code and save your post, page, or widget. You can now visit your website to see it in action.

Accept Donations Using WPForms

If you are fundraising for a non-profit cause, then you can use WPForms to create an online donation form.

WPForms is the best contact form plugin for WordPress. It has over 1300 built-in form templates, including PayPal and Stripe online donation forms.

WPForms Donation Form

You can also collect recurring donations with WPForms. And the best part is that WPForms is easy to use with a drag-and-drop form builder to add fields, text, and donate buttons and integrate payment methods to your WordPress forms.

For more details, you should check out our guide on how to add a PayPal donate button to your WordPress site.

You can also check out our step-by-step guide on how to create a donation form for nonprofit organizations in WordPress.

Alternate: You can also use WP Simple Pay to accept donations with other payment methods. WP Simple Pay is the best Stripe payment plugin for WordPress. It lets you accept Giropay payments and Affirm payments for donations.

Convert Website Visitors into Subscribers

Most people visiting your website will probably leave without donating to your project or cause, even if they support it. The best way to keep those users engaged is to start building your email list right away.

You will need to sign up with an email marketing service and use lead generation software like OptinMonster.

OptinMonster helps you convert abandoning visitors into subscribers. This allows you to keep those users engaged and eventually convert them into donors.

We hope this article helped you find the best WordPress themes for crowdfunding. You may also want to check out our other WordPress guides for crowdfunding, donations, and fundraising campaigns.

Best WordPress Guides for Crowdfunding Sites

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post 21 Best WordPress Themes for Crowdfunding first appeared on WPBeginner.

What Is Deep Learning and How Does It Power Modern AI?

The impacts and power of generative AI were realized at scale in businesses last year. Now, every software company, supermarket brand, and business, even tangentially related to tech, appears to be building an AI-based solution of their own for 2024. But how much do we know about the foundations of these technologies and what they're doing with our data behind the curtain?

How well is the AI black box we’re all learning to trust really understood outside of niche tech circles? What is there to know about something that is opaque by design? First, let's start at the beginning.

Probability Basics for Software Testing

Have you ever felt like building a castle out of sand, only to have the tide of unexpected software bugs wash it all away? In everyday work in software development, unforeseen issues can spell disaster. But what if we could predict the likelihood of these problems before they arise? Enter the realm of probability, our secret weapon for building robust and reliable software.

Probability plays a crucial role in software testing, helping us understand the likelihood of certain events like encountering specific paths within the code and assessing the effectiveness of test coverage.