Giter Site home page Giter Site logo

poem-generator's Introduction

Poem Generator

This project is a web application that generates poems based on user-provided prompts using the OpenAI GPT-3.5-turbo model. The backend is implemented in Go, and the frontend is built with Streamlit.

Features

  • Generate poems based on user prompts.
  • Uses OpenAI's GPT-3.5-turbo model for poem generation.
  • Simple and intuitive Streamlit interface.

Prerequisites

  • Go 1.22.4 or later
  • Python 3.7 or later
  • OpenAI API key

Setup

Backend (Go)

  1. Clone the repository:

    git clone https://github.com/MSimsek07/poem-generator.git
    cd poem-generator
  2. Initialize Go module:

    go mod init poem-generator
    go mod tidy
  3. Set your OpenAI API key:

    export OPENAI_API_KEY=your_openai_api_key
  4. Build and run the Go server:

    go build -o poem-generator .
    ./poem-generator

    The server will run on http://localhost:8000.

Frontend (Streamlit)

  1. Install Streamlit:

    pip install streamlit
  2. Create streamlit_app.py with the given content

  3. Run the Streamlit app:

    streamlit run streamlit_app.py

Usage

  1. Open your web browser and go to http://localhost:8501.
  2. Enter a prompt in the text input box.
  3. Click the "Generate Poem" button.
  4. The generated poem will be displayed on the page.

Project Structure

  • main.go: The Go backend server code.
  • streamlit_app.py: The Streamlit frontend code.
  • go.mod: The Go module file.

Contributing

Contributions are welcome! Please fork the repository and submit a pull request for any changes you would like to make.

License

This project is licensed under the MIT License.

poem-generator's People

Contributors

msimsek07 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.