Topview Logo
  • Create viral videos with
    GPT-4o + Ads library
    Use GPT-4o to edit video empowered by Youtube & Tiktok & Facebook ads library. Turns your links or media assets into viral videos in one click.
    Try it free
    gpt video

    Build a complete AI Poem Generator | AI Full stack projects | Learn today!

    blog thumbnail

    Introduction

    In this article, we will walk you through the process of building an AI-based poem generator using a powerful open-source language model developed by Meta, known as FKA 72 Chat Model. This model boasts of being trained on 2 trillion tokens and has 70 billion parameters, making it one of the largest models currently available for creative tasks.

    Prerequisites

    To get started, you will need the following:

    1. Basic Knowledge of JavaScript: Familiarity with JavaScript will help you understand the coding aspects involved.

    2. JavaScript Installed: Ensure that you have JavaScript installed on your machine. You can download it from the official website.

    3. Active Repl Account: Create an account on Replit and obtain your API token, which will be necessary to interact with the AI model.

    Setting Up Your Project

    1. Create a New Folder: Start by creating a new folder for your project called AI Poem Generator.

    2. Navigating to Your Folder: Use the command line to navigate into your newly created folder:

      cd AI_Poem_Generator
      
    3. Install Necessary Packages: Install the required Node packages using npm:

      npm install express dotenv
      
    4. Set Up the Environment File: Create a .env file to store your API token. You can obtain this token from your Replit account settings, under API tokens. Paste your token into the .env file.

    Back-End Setup

    1. Create API Endpoints: Set up your back-end routes in a folder named pages/api. You will write the handlers to process requests to your poem generator.

    2. Handling Requests: Write a function to handle requests and responses. You'll set up the code to interact with the API from Replit and process the input to generate poems based on user prompts.

    3. Testing Your API: Ensure the API is functioning correctly by running local tests and verifying whether you receive the expected responses.

    Front-End Setup

    1. Implement the User Interface: Start building the front-end of your application. You can create a simple HTML layout where users can input prompts to generate their poems.

    2. Creating State Management: Use state management to track user inputs and changes in the loading state while the AI processes their request.

    3. Button for Generating Poems: Add a button that users can click to trigger the poem generation process.

    4. Styling the Application: Use CSS for styling your application to make it visually appealing for users.

    Running the Application

    After properly configuring your back-end and front-end, you can run your application. Make sure to handle any errors that may arise and provide feedback to users when their poems are being generated.

    Finally, with everything in place, you’ll be able to enjoy your very own AI poem generator that turns simple prompts into creative literary expressions!

    Conclusion

    In this article, we have covered the complete step-by-step process of building an AI poem generator. The integration of JavaScript, an API from Replit, and the open-source FKA 72 Chat Model makes this a fascinating project for anyone interested in AI and creative writing.


    Keywords

    • AI Poem Generator
    • FKA 72 Chat Model
    • Open-source model
    • JavaScript
    • Replit
    • API Token
    • Node Packages
    • User Interface
    • State Management

    FAQ

    Q1: What is the FKA 72 Chat Model?
    A1: The FKA 72 Chat Model is an open-source language model developed by Meta, trained on 2 trillion tokens, and has 70 billion parameters, designed for creative tasks.

    Q2: What tools do I need to build the AI poem generator?
    A2: You will need basic knowledge of JavaScript, Node.js installed, and an active Replit account with an API token.

    Q3: How do I test my API?
    A3: You can test your API locally by making requests and checking whether you receive the correct responses based on input prompts.

    Q4: Can I customize the appearance of the application?
    A4: Yes, you can use CSS to style your application and make it visually appealing according to your preferences.

    Q5: What programming languages are used in this project?
    A5: The primary programming language used in this project is JavaScript, along with HTML and CSS for front-end development.

    One more thing

    In addition to the incredible tools mentioned above, for those looking to elevate their video creation process even further, Topview.ai stands out as a revolutionary online AI video editor.

    TopView.ai provides two powerful tools to help you make ads video in one click.

    Materials to Video: you can upload your raw footage or pictures, TopView.ai will edit video based on media you uploaded for you.

    Link to Video: you can paste an E-Commerce product link, TopView.ai will generate a video for you.

    You may also like