/gpt2-reddit

gpt2 finetuned by reddit data from huggingface.

Primary LanguagePython

GPT2 Reddit

API server provides gpt2 api that fine tuned by reddit dataset. gpt2 model are from huggingface.

Install

$ pip install -r requirements.txt

Usage

$ python3 server.py

and API server hosted on localhost:8000

Docker

$ docker build -t ${IMAGE_NAME} .

$ docker run -p ${YOUR_PORT}:8000 -it ${IMAGE_NAME}

cURL

$ curl -X POST "https://master-gpt2-reddit-woomurf.endpoint.ainize.ai/gpt2-reddit/short" \
  -H "accept: application/json" -H "Content-Type: multipart/form-data" \
  -F "text=test input" -F "num_samples=5"

or

$ curl -X POST "https://master-gpt2-reddit-woomurf.endpoint.ainize.ai/gpt2-reddit/long" \
  -H "accept: multipart/form-data" -H "Content-Type: multipart/form-data"\
  -F "text=test input" -F "num_samples=5" -F "length=5"