asquare14 / Question-Generator

Simple web app that integrates a GenAI model

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Project Title

This project creates a web application by using a Question Generation model in PyTorch.

API Reference

Generate Question

  POST /generate-question
Parameter Type Description
context string Required. Text for which you want to generate questions.
curl -X POST -d "context=i live in paris" \
http://127.0.0.1:8000/generate-question

Demo

Link

Running locally

There are three methods for setting up the application locally and running, first is using the setup script, second manually and third using docker.

Method-1: Use setup script

  1. Go to root directory and give permission to script.sh to run.
chmod +x setup.sh

Run the script to install all dependencies.

./script.sh
  1. Activate the virtual environment
source venv/bin/activate
  1. Run your flask server
python app.py

Go to http://127.0.0.1:8000/ ! Your server is up.

Method-2: Manual setup

  1. It is recommended that you use virtual environment for running development server. If you don't want to use it, skip to step 4 directly.
python -m pip install --user virtualenv
  1. If you're running the project for the first time, create a virtual environment.
virtualenv venv
  1. Activate the virtual environment.
source venv/bin/activate
  1. Install all the relevant depedencies by running this from the root directory of the project.
  pip install -r requirements.txt  
  1. Run your flask server
python app.py

Go to http://127.0.0.1:8000/ ! Your server is up.

Screenshots

App Screenshot

Running Tests

To run tests, run the following command

  python test_app.py

Tech Stack

Client: HTML, CSS, Javascript

Server: Flask, Python

About

Simple web app that integrates a GenAI model


Languages

Language:Python 44.9%Language:CSS 27.9%Language:JavaScript 14.2%Language:HTML 9.5%Language:Shell 3.5%