All Projects → vicgalle → gpt-j-api

vicgalle / gpt-j-api

Licence: MIT license
API for the GPT-J language model 🦜. Including a FastAPI backend and a streamlit frontend

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to gpt-j-api

gpt-neo-fine-tuning-example
Fine-Tune EleutherAI GPT-Neo And GPT-J-6B To Generate Netflix Movie Descriptions Using Hugginface And DeepSpeed
Stars: ✭ 157 (-36.69%)
Mutual labels:  text-generation, gpt-3, gpt-j
gpt-j
A GPT-J API to use with python3 to generate text, blogs, code, and more
Stars: ✭ 101 (-59.27%)
Mutual labels:  language-model, gpt-3, gpt-j
few-shot-lm
The source code of "Language Models are Few-shot Multilingual Learners" (MRL @ EMNLP 2021)
Stars: ✭ 32 (-87.1%)
Mutual labels:  gpt, language-model
minGPT-TF
A minimal TF2 re-implementation of the OpenAI GPT training
Stars: ✭ 36 (-85.48%)
Mutual labels:  gpt, language-model
Tokenizers
💥 Fast State-of-the-Art Tokenizers optimized for Research and Production
Stars: ✭ 5,077 (+1947.18%)
Mutual labels:  gpt, language-model
language-planner
Official Code for "Language Models as Zero-Shot Planners: Extracting Actionable Knowledge for Embodied Agents"
Stars: ✭ 84 (-66.13%)
Mutual labels:  language-model, gpt-3
Deep-NLP-Resources
Curated list of all NLP Resources
Stars: ✭ 65 (-73.79%)
Mutual labels:  text-generation, language-model
Kogpt2 Finetuning
🔥 Korean GPT-2, KoGPT2 FineTuning cased. 한국어 가사 데이터 학습 🔥
Stars: ✭ 124 (-50%)
Mutual labels:  text-generation, language-model
Gpt2 French
GPT-2 French demo | Démo française de GPT-2
Stars: ✭ 47 (-81.05%)
Mutual labels:  text-generation, language-model
download-tweets-ai-text-gen-plus
Python script to download public Tweets from a given Twitter account into a format suitable for AI text generation
Stars: ✭ 26 (-89.52%)
Mutual labels:  text-generation, gpt
Attention Mechanisms
Implementations for a family of attention mechanisms, suitable for all kinds of natural language processing tasks and compatible with TensorFlow 2.0 and Keras.
Stars: ✭ 203 (-18.15%)
Mutual labels:  text-generation, language-model
gap-text2sql
GAP-text2SQL: Learning Contextual Representations for Semantic Parsing with Generation-Augmented Pre-Training
Stars: ✭ 83 (-66.53%)
Mutual labels:  text-generation, language-model
Text-Summarization
Abstractive and Extractive Text summarization using Transformers.
Stars: ✭ 38 (-84.68%)
Mutual labels:  fastapi
XENA
XENA is the managed remote administration platform for botnet creation & development powered by blockchain and machine learning. Aiming to provide an ecosystem which serves the bot herders. Favoring secrecy and resiliency over performance. It's micro-service oriented allowing for specialization and lower footprint. Join the community of the ulti…
Stars: ✭ 127 (-48.79%)
Mutual labels:  gpt-3
HibiAPI
一个实现了多种常用站点的易用化API的程序 / A program that implements easy-to-use APIs for a variety of commonly used sites.
Stars: ✭ 427 (+72.18%)
Mutual labels:  fastapi
anonymization-api
How to build and deploy an anonymization API with FastAPI
Stars: ✭ 51 (-79.44%)
Mutual labels:  fastapi
Irl gen
This is implementation of the paper 'Toward Diverse Text Generation with Inverse Reinforcement Learning' https://arxiv.org/abs/1804.11258 IJCAI2018
Stars: ✭ 32 (-87.1%)
Mutual labels:  text-generation
Verdant Search
用python+fastapi实现的搜索引擎
Stars: ✭ 13 (-94.76%)
Mutual labels:  fastapi
gpt
A Python toolkit for lattice field theory, quantum computing, and machine learning
Stars: ✭ 60 (-75.81%)
Mutual labels:  gpt
NLP-paper
🎨 🎨NLP 自然语言处理教程 🎨🎨 https://dataxujing.github.io/NLP-paper/
Stars: ✭ 23 (-90.73%)
Mutual labels:  gpt

gpt-j-api 🦜

GitHub release (latest by date) Python version Hugging Face Spaces API up

An API to interact with the GPT-J language model and variants! You can use and test the model in two different ways:

Open API endpoints 🔓

These are the endpoints of the public API and require no authentication. Click on each to see the parameters!

GPT-J text generation 🤖

Zero-shot text classification (multilingual) 🌍

Using the API 🔥

  • Python:
import requests
context = "In a shocking finding, scientist discovered a herd of unicorns living in a remote, previously unexplored valley, in the Andes Mountains. Even more surprising to the researchers was the fact that the unicorns spoke perfect English."
payload = {
    "context": context,
    "token_max_length": 512,
    "temperature": 1.0,
    "top_p": 0.9,
}
response = requests.post("http://api.vicgalle.net:5000/generate", params=payload).json()
print(response)
  • Python (zero-shot classification):
import requests
payload = { 
    "sequence" : "The movie started slow, but in the end was absolutely amazing!", 
    "labels" : "positive,neutral,negative"}
response = requests.post("http://api.vicgalle.net:5000/classify", params=payload).json()
print(response)
  • Bash:
curl -X 'POST' \
  'http://api.vicgalle.net:5000/generate?context=In%20a%20shocking%20finding%2C%20scientists%20discovered%20a%20herd%20of%20unicorns%20living%20in%20a%20remote%2C%20previously%20unexplored%20valley%2C%20in%20the%20Andes%20Mountains.%20Even%20more%20surprising%20to%20the%20researchers%20was%20the%20fact%20that%20the%20unicorns%20spoke%20perfect%20English.&token_max_length=512&temperature=1&top_p=0.9' \
  -H 'accept: application/json' \
  -d ''

Deployment of the API server

Just SSH into a TPU VM. This code was tested on both the v2-8 and v3-8 variants.

First, install the requirements and get the weights:

python3 -m pip install -r requirements.txt
wget https://the-eye.eu/public/AI/GPT-J-6B/step_383500_slim.tar.zstd
sudo apt install zstd
tar -I zstd -xf step_383500_slim.tar.zstd
rm step_383500_slim.tar.zstd

And just run

python3 serve.py

Then, you can go to http://localhost:5000/docs and use the API!

Deploy the streamlit dashboard

Just run

python3 -m streamlit run streamlit_app.py --server.port 8000

Contact

If you have a request, I'll be happy to help you at vgallegoalcala at gmail dot com

Sponsors 🦄

Special thanks to the following people, who sponsor this project! <3

Acknowledgements

Many thanks to the support of the TPU Research Cloud, https://sites.research.google/trc/

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].