Monday, May 8, 2023

AI for Developers - Train your Own Chat GPT/Chat bot with Custom Data and Run on your Computer or Web Hosting Account

With the recent AI boom, many companies are taking advantage of OpenAI integration but are just starting out and are diligently looking for solutions that can help them automate their customer service and sales. By offering features dealing with AI to their customers, they can now provide them with more valuable tools to improve their customer experience and increase sales.

As more businesses look to implement AI-powered chatbots, there is a growing need for developers who can help them with finetuning and customizing their chatbots. By offering this support, potential clients looking for software can differentiate your SaaS from competitors and attract more customers. It is therefore important to stay on top of the latest trends and technologies in the industry to offer solutions that meet the evolving needs of businesses.

In this article, we will learn how to run our own Chat GPT personal assistant on our own computer with the use of an Open AI API key. We provide code for an app that can be built using python. You can download Visual Code and run the app on your computer. I had no experience with Python and was able to jump in on the revolution with ease. Later on, you can learn how to do the same on your web hosting server. The possibilities are endless for what you can do your business or your clients. Create chat bots, chat assistants for you or your clients and more.

What the code does is allow you to place files of your choosing in a folder. The bot will read the contents of the folder and you will be able to ask questions about the contents of any document in the folder. (See a video demonstration of how it works later on below.)

Here's an overview of what the code provided does:
The code snippet provided is a Python script that trains a custom AI chatbot using OpenAI's GPT-3.5 language model. The script also uses Gradio, a Python library for creating customizable web interfaces for machine learning models, to create a user interface for the chatbot.

Before we dive into how the script works, let's take a quick look at some of the main libraries used in the code:

- GPT-3.5: GPT-3.5 is a language model developed by OpenAI, which is a state-of-the-art model for natural language processing (NLP) tasks such as language generation, text completion, and question answering.

- Gradio: Gradio is a Python library that allows you to create custom web interfaces for machine learning models, without requiring any HTML, CSS, or JavaScript knowledge.

- json: The json module in Python is used to encode and decode JSON data.

The first thing we see in the code is the import statements, which bring in the necessary libraries and modules required for the script to function. The `os.environ` statement sets the OpenAI API key, which is required to access the GPT-3.5 language model.

Next, the `construct_index()` function takes in the directory path where the dataset is stored and some hyperparameters such as the learning rate, number of epochs, and chunk size limit. This function constructs a GPTSimpleVectorIndex, which is a vector-based search index for text documents. The GPTSimpleVectorIndex uses the GPT-3.5 language model to generate a response for a given input text. The `llm_predictor` variable defines the language model that will be used to generate the response. The `documents` variable stores the text data from the dataset. Finally, the `index.save_to_disk()` method saves the index to a file named `index.json`. Learn more about this in detail in 15 minutes here.

The `chatbot()` function takes in the input text and uses the `GPTSimpleVectorIndex.load_from_disk()` method to load the previously saved index from the `index.json` file. It then queries the index with the input text to generate a response.

Finally, the `gr.Interface()` function from Gradio is used to create a web interface for the chatbot. The `iface.launch()` method is used to launch the interface in a new tab in the default web browser.

Overall, the code provided is relatively easy to run on a desktop. One simply needs to have the necessary libraries installed and ensure that the dataset is stored in a folder named `docs` within the same directory as the script. Additionally, they will need to obtain an OpenAI API key and replace the placeholder text with their own API key in the `os.environ["OPENAI_API_KEY"] = 'YOUR API KEY HERE'` line of code.

Here's the complete code snippet:
from gpt_index import SimpleDirectoryReader, GPTListIndex, 
      GPTSimpleVectorIndex, LLMPredictor, PromptHelper
from langchain import OpenAI
import gradio as gr
import sys
import os
import json


def construct_index(directory_path, learning_rate=1e-3, num_epochs=10):
    max_input_size = 4096
    num_outputs = 512
    max_chunk_overlap = 20
    chunk_size_limit = 18000

    prompt_helper = PromptHelper(max_input_size, num_outputs, 

    llm_predictor = LLMPredictor(llm=OpenAI(temperature=0, 

    documents = SimpleDirectoryReader(directory_path).load_data()

    index = GPTSimpleVectorIndex(documents, llm_predictor=llm_predictor, 


    return index

def chatbot(input_text):
    index = GPTSimpleVectorIndex.load_from_disk('index.json')
    response = index.query(input_text, response_mode="compact")
    return response.response

iface = gr.Interface(fn=chatbot,
                     label="Enter your text"),
                     title="Custom-trained AI Chatbot")

index = construct_index("docs")

Now you may find this useful if you run a web site and you may want to run this code on your hosting server and create directories there to be able to have your Chat bot query folders from there. Your customers can upload their files to folders you create for them if you want to design bots for them. For more info on how to get set up on the web, watch the below video link:

Need help fine-tuning your OpenAI model or setting up a chat bot or assitant for your business/web site? Visit Formilae and inquire about Open AI Fine-Tuning assistance for your model(s) or Chat Bot design.

Friday, March 17, 2023

Revolutionizing Business Communication: How AI-Powered Writing Tools Are Saving Time and Boosting Quality

Artificial intelligence (AI) has been making headlines in recent years as businesses increasingly turn to this technology to help them save time and money. From automating repetitive tasks to providing insights into complex data sets, AI is being used in a wide range of applications across industries. One area where AI is particularly helpful is in writing important emails and social media posts.

Writing effective emails and social media posts can be a time-consuming process, especially for businesses that need to produce a large volume of content. However, AI-powered writing tools can help to streamline this process by generating high-quality content quickly and efficiently. These tools use natural language processing (NLP) algorithms to analyze existing content and generate new content that is both grammatically correct and contextually appropriate.

One popular AI-powered writing tool is OpenAI's GPT-3 (Generative Pre-trained Transformer 3), which has been trained on a vast amount of text data to generate high-quality human-like responses. This technology can be used to write emails, social media posts, and even entire articles, saving businesses valuable time and resources.

AI-powered writing tools not only save time but also help to improve the quality of content produced. These tools can analyze existing content and provide suggestions for improvement, ensuring that all content is of the highest quality possible. By using AI-powered writing tools, businesses can produce more content in less time, without sacrificing quality.

One tool that integrates with OpenAI and offers a range of features for lead generation and management is Formilae. With Formilae, users can build web forms that automatically generate leads, and these leads can be texted directly from the dashboard. Additionally, Formilae has introduced a fun assistant called F.A.R.I.S. (Formilae Artificial Intelligence Response System) to assist users with typing professional emails and social media posts.

F.A.R.I.S. uses OpenAI's GPT-3 to analyze user input and generate human-like responses that are contextually appropriate and grammatically correct. This tool can help businesses save time and resources by automating the writing process and ensuring that all content is of the highest quality possible.

In conclusion, AI-powered writing tools are becoming increasingly popular among businesses that want to save time and resources while producing high-quality content. With tools like OpenAI's GPT-3 and Formilae's F.A.R.I.S., businesses can streamline the writing process and improve the quality of their content, all while saving time and resources. If you're looking to improve your lead generation and management efforts while also streamlining your writing process, Formilae is a powerful tool that can help you achieve these goals.

Why Storing Leads is Important for a Business: How Setting Up Web Forms Can Help Collect Leads

In today's digital age, businesses rely heavily on lead generation to attract new customers and grow their revenue. However, generating leads is just one part of the equation. To make the most of these leads, businesses need to effectively store and manage them. In this article, we'll explore why storing leads is important for a business and how setting up web forms can help collect leads.

Why Storing Leads is Important for a Business

  1. Building a Customer Database: Storing leads allows businesses to build a customer database that can be used for future marketing efforts. By storing lead information such as names, emails, phone numbers, and other relevant data, businesses can segment their customers and send targeted marketing campaigns to specific groups. This not only increases the chances of conversion but also strengthens customer relationships.
  2. Tracking Progress: Storing leads also allows businesses to track their progress in terms of lead generation and conversion. By keeping a record of leads generated through various channels such as social media, email marketing, or website traffic, businesses can identify which channels are performing well and which need improvement. This data can then be used to refine marketing strategies and increase the overall ROI.
  3. Better Lead Nurturing: Storing leads also enables businesses to nurture leads over time. By keeping a record of leads that did not convert, businesses can send follow-up emails and targeted marketing campaigns to re-engage them. This is especially important since not all leads are ready to make a purchase immediately. Nurturing these leads over time can increase the chances of conversion and lead to loyal customers.

How Setting Up Web Forms Can Help Collect Leads

Now that we've explored why storing leads is important, let's look at how setting up web forms can help collect leads.

  1. Easy Access: Web forms make it easy for potential customers to submit their information and become a lead. By placing web forms in strategic locations on a website such as the homepage, contact page, or blog post, businesses can capture leads as soon as they land on the website.
  2. Customizable Fields: Web forms also offer customizable fields that allow businesses to collect specific information from leads. For example, businesses can ask for the lead's name, email, phone number, and even their industry or job title. This information can then be used to segment leads and send targeted marketing campaigns.
  3. Integration with CRM: Many web form builders also offer integration with Customer Relationship Management (CRM) systems. This allows businesses to automatically store lead information in their CRM and track the progress of these leads over time.


Storing leads is crucial for businesses that want to effectively generate and convert leads. By building a customer database, tracking progress, and nurturing leads over time, businesses can increase their chances of conversion and grow their revenue. Setting up web forms is a simple yet effective way to collect leads and store their information. By offering easy access, customizable fields, and integration with CRM, businesses can streamline their lead generation process and make the most of their efforts.

In 2023, web forms are as easy to build as ever...

In addition to the benefits of storing leads and setting up web forms, businesses can greatly benefit from using a simple lead generation management tool such as Formilae. Formilae offers a variety of features that can streamline lead generation and management, making it a highly recommended tool for businesses of all sizes.

One of the key benefits of using Formilae is its easy-to-use web form builder, which allows users to create custom forms in minutes without any coding experience required. These forms are designed to collect lead information such as a valid email address and phone number, and can be configured to automatically convert form submissions to leads.

Leads collected from Formilae web forms are stored in your own personal dashboard, where they can be viewed and managed easily. Users can also manually input or upload leads through an Excel sheet, making it easy to keep all lead information in one place.

With Formilae, businesses can contact leads directly from the administration dashboard, perform mass e-mailings, and integrate with preferred email campaign services such as Active Campaign. In addition, leads can be text messaged directly from the administration dashboard, and Formilae offers optional integration with Twilio.

Formilae is a customer-driven software, which means that feature requests are always welcomed and can be requested for immediate design. Plus, with 24/7 support available, businesses can rest assured that any issues or questions will be addressed quickly and efficiently.

Overall, Formilae is a powerful tool for lead generation and management, and is highly recommended for businesses that want to streamline their lead generation process and make the most of their efforts.

You can check out Formilae by visiting the web site below:

AI for Developers - Train your Own Chat GPT/Chat bot with Custom Data and Run on your Computer or Web Hosting Account

With the recent AI boom, many companies are taking advantage of OpenAI integration but are just starting out and are diligently looking for ...