TheProtaganist / gpt-j

A GPT-J API to use with python3 to generate text, blogs, code, and more
MIT License
205 stars 52 forks source link

how do i install it? #1

Open oogxdd opened 3 years ago

oogxdd commented 3 years ago

i'm new to python. can i use some help?

TheProtaganist commented 3 years ago

That's quite alright I'm pretty new at python myself. I've been using it for 2 years 🙂. This isn't exactly a python package yet but to use download the latest release, in the example.py file copy, what I have in the "Usage" section that can be found in https://github.com/TheProtaganist/gpt-j. Then if you are using an ide or idle use "find-replace" and where it says bot replace that with the person or character you wish to talk create. Where it says user you can put in any name. In a python, editor go to where it says edit, scroll down till you see replace and replace bot and user one by one. Then in the sample dialog just replace the current text with any conversation you want (the bot or whatever you replaced bot with being the one who will respond). I suggest you only replace the bot and user values changing the other values might cause problems. One last piece of advice. Keep numbers (temperature 0.3 and top_p 0.6) as low as possible. somewhere between 1 and zero will work. If you have any more questions feel free to ask.

oogxdd commented 3 years ago

yeah i mean more like how to install GPTJ dependency? i tried to do it with pip but no success

i'm trying to run example.py file but it says it can't resolve GPTJ dependency

TheProtaganist commented 3 years ago

sorry for the inconvenience. It seems I forgot to add a requirements text in my program. Try installing requests library and see if it works. In the meantime, I'll add requirements.txt to the repository.

TheProtaganist commented 3 years ago

It would appear the site is down again. It might be up in a few. Sorry for this. I'll let you know when it is fixed...

oogxdd commented 3 years ago

KK can't wait to try the api

TheProtaganist commented 3 years ago

I'm working on a lot of things right now and I should have a new release ready in no time. Good news the site is back online!!! I'll have it ready soon.

TheProtaganist commented 3 years ago

Working on a few bugs I'll have it ready by tomorrow...

TheProtaganist commented 3 years ago

It would appear I accidentally deleted the files of the project by trying to upload my first package. I'm very sorry for the delay. I'll have it ready no later than tomorrow. I just need to recover some files.

oogxdd commented 3 years ago

no worries. i seem to got it working with a node server

although i like where you're going. i want to build a tl;dr summarizer with gpt-j but found that it doesn't treat "tl;dr:" keyword same way gpt-3 does and produces you generation instead of summarisation

but now i see in your repo how i can train the model by providing it example and hope that would work (if i feed it a couple of tldr's)

i'm using an endpoint provided by https://github.com/vicgalle/gpt-j-api. do you know if i can use advance features with this endpoint?

i'm also curious in using python more so will be looking for your lib to be ready as well 😇

TheProtaganist commented 3 years ago

All done! do pip install gptj and import GPTJ.Basic_api and GPTJ.gptj_api or after you have installed it just download the files I provided here and change the prompts to something that fits your needs. I published the gptj package on PyPI yesterday. I was gonna inform you but I was too tried after working on the project all day. It was like 12:00AM. Thank you for your interest in this project if you have any more questions feel free to ask 🤗

TheProtaganist commented 3 years ago

I am planning to add an examples folder with a list of prompts you can give. Bad words are censored and it will return an error if anyone is using the API for spam. But the examples you can give are literally endless as long as it doesn't contain offensive content. I am kinda tired after working on projects all day but I'll have an examples folder ready soon.

TheProtaganist commented 3 years ago

new version 2.2.2 added install to get rid of single-line responses from the previous version 2.2.0

oogxdd commented 3 years ago

any suggestions on how i can implement content filter? (to exclude an offensive content)

TheProtaganist commented 3 years ago

I already did that. I used an algorithm to make sure that if someone is using it for spam it will give a message that they can't use spam. But for the bot response, I would suggest you set the examples to words that don't contain bad words (Although it wouldn't be possible to give bad words because they blocked). I suggest from GPTJ.security import check_for_insults (if check_for_insults(response) != "" (contains insults): do (your code))