Saravanan666/pypi-org huggingface dataset:
Package: gpt-to-chatgpt
gpt-to-chatgpt-pyConvert a regular GPT call into a ChatGPT callTYPESCRIPT VERSION HERE ->https://github.com/bramses/gpt-to-chatgpt-tsFunctionstoChatML()Converts a string message into a Chat Markup Language (ChatML) object.UsagetoChatML(message:str,options:Optional[dict]=None)->List[dict]Argumentsmessage: The string message to be converted to ChatML.options (optional): A dictionary that can contain the following keys:system_messages: A list of strings that represent system messages to be added to the ChatML object.role: The role of the message (either Role.USER or Role.ASSISTANT).ExamplestoChatML('hello')# Output: [{'role': Role.USER, 'content': 'hello'}]toChatML('hello',{'system_messages':['hi'],'role':Role.ASSISTANT})# Output: [{'role': Role.SYSTEM, 'content': 'hi'}, {'role': Role.ASSISTANT, 'content': 'hello'}]get_message()Extracts the message content from a response object.Usageget_message(response:dict,options:Optional[dict]=None)->Union[str,dict]Argumentsresponse: The response object from which to extract the message content.options (optional): A dictionary that can contain the following keys:usage: A boolean value that indicates whether to return the usage information of the response.role: A boolean value that indicates whether to return the role of the message.isMessages: A boolean value that indicates whether to return the message as a list of messages.Examplesget_message(test_response)# Output: 'The 2020 World Series was played in Arlington, Texas at the Globe Life Field, which was the new home stadium for the Texas Rangers.'get_message(test_response,{'usage':True,'role':True,'isMessages':True})# Output: {'usage': {'prompt_tokens': 56, 'completion_tokens': 31, 'total_tokens': 87},#          'roles': ['assistant'],#          'messages': ['The 2020 World Series was played in Arlington, Texas at the Globe Life Field, which was the new home stadium for the Texas Rangers.']}get_message(test_response,{'usage':True,'role':True})# Output: {'usage': {'prompt_tokens': 56, 'completion_tokens': 31, 'total_tokens': 87},#          'role': 'assistant',#          'message': 'The 2020 World Series was played in Arlington, Texas at the Globe Life Field, which was the new home stadium for the Texas Rangers.'}get_message(test_response,{'usage':True,'isMessages':True})# Output: {'usage': {'prompt_tokens': 56, 'completion_tokens': 31, 'total_tokens': 87},#          'messages': ['The 2020 World Series was played in Arlington, Texas at the Globe Life Field, which was the new home stadium for the Texas Rangers.']}About the DeveloperThis repository was written by Bram Adams, a writer and programmer based out of NYC.Bram publishes a Zettelkasten, with a twice/weekly newsletter (which you can subscribe tohere), is a community developer ambassador for OpenAI and does freeleance contracts (for hire!) related to AI/web dev/AR+VR.Bram is also the creator ofStenography, a API andVSC Extensionthat automatically documents code on save.You can learn more about him and his work on hiswebsite.
Package: gpttools
GPT-Tools is a Python module that provides a comprehensive suite of tools for working with OpenAI's GPT-3 language model.
The module includes functions for natural language processing, text generation, and conversation simulations.
With GPT-Tools, you can easily integrate GPT-3 into your applications and projects, streamlining the process of developing language-based applications.
The module is designed to be easy to use, with intuitive APIs that make working with GPT-3 a breeze.
Whether you're a seasoned developer or just getting started, GPT-Tools is the perfect choice for anyone looking to leverage the power of OpenAI's GPT-3 in their work.
Package: gpt-translate
gpt_translateThis is a tool to translate the language in Markdown files.You will need and OpenAI API key to use this tool.InstallationYou have to clone the repo and then do:$cdgpt_translate
$pipinstall.UsageWe use GPT4 by default. You can change this onconfigs/model_config.yamlYou can add new languages by providing the language translation dictionaries inconfigs/language_dictsTo translate a single file:$gpt_translate.fileREADME.mdREADME_es_.md--languageesto translate a full folder recursively:$gpt_translate.folderdocsdocs_ja--languagejaIf you don't know what to do, you can always do:$gpt_translate--help
Package: gpt-trim
gpt-trimThis is a (slightly) faster version ofKillianLucas/tokentrimfor longer message arrays.In average, gpt-trim is ~80% faster than tokentrim, and that tokentrim is around 5x~7x slower.Although gpt-trim is fast, I still need to finish my LeetCode problems that I left years ago, just so that I can make it 20x faster than 95% of people.UsageThe usage is quite similiar totokentrim.importgpt_trimtrimmed=gpt_trim.trim(messages,model="gpt-3.5-turbo")print(trimmed)Alternatively, you can assign the token limit manually:gpt_trim.trim(messages,max_tokens=100)You can also add system messages with ease:importgpt_trimmessages=[...,# long, long content{"role":"user","content":"It's about drive, it's about power"}]trimmed=gpt_trim.advanced_trim(messages,system_messages=[{"role":"system","content":"You'll act like the celebrity: The Rock."}],model="gpt-3.5-turbo",)print(trimmed)The catch? It's slower. With great power comes great... patience.ComparisonYou can compare this project toKillianLucas/tokentrimlike so:importtimeimportgpt_trimimporttiktokenimporttokentrimpattern="d!3h.l7$fj"# 10 tokensmessages=[{"role":"user","content":pattern*5000# 50000 tokens}]# cache firstenc=tiktoken.get_encoding("cl100k_base")gpt_trim.num_tokens_from_messages(messages,enc)deftest(provider):print("Testing",provider.__name__)s=time.time()result=provider.trim(messages,model="gpt-3.5-turbo",)print(f"took{(time.time()-s):.4f}s\n")# Swap the following for every test and see tokentrim# struggles when dealing with longer context.test(gpt_trim)test(tokentrim)Right. I was bored.
Package: gpt-utils
gpt-utilsHelper tools for use with OpenAI's GPT-3 API.The API key can be provided in three ways:In the environment variableOPENAI_API_KEYVia class attributeGPT.api_keyof classGPTin modulegpt_utils.coreVia keyword argumentapi_keyin any method or function which obtains a response from OpenAI's serversDisclaimerThese don't work perfectly.gpt_utils.utilsfrom gpt_utils import utilsutilscontains simple functions which transform text in a specific way. Some functions are bidirectional; these take an optionalreversekeyword argument which reverses the conversion's input and output.utils.case>>> from gpt_utils.utils import caseContains functions which modify the case of words in a string. These functions are meant to selectively preserve the case of proper nouns, etc. with minimal involvement. The first,title(), takes astrcontaining a word or phrase with proper capitalization for use in a heading or title:>>> case.title('the ant: an introduction')
'The Ant: An Introduction'The second,mid_sentence(), adjusts the case of input words/phrases for insertion mid-sentence:>>> case.mid_sentence('bicycles on inman street')
'bicycles on Inman Street'
>>> case.mid_sentence('An italian restaurant in somerville')
'an Italian restaurant in Somerville'utils.location>>> from gpt_utils.utils import locationCurrently contains one function,fix_location(), which takes an unformatted string containing a location and formats it properly for display:>>> location.fix_location('lenox ma')
'Lenox, MA'utils.number>>> from gpt_utils.utils import numberContains two functions which convert numbers to strings.  The first,number_to_str(), takes anintorfloatand writes out the same number as astr:>>> number.number_to_str(83)
'eighty-three'
>>> number.number_to_string(3.14)
'three point one four'The second,number_to_ordinal(), takes anintand returns it in ordinal form as astr:>>> number.number_to_ordinal(43)
'forty-third'utils.dechatify()I have found that GPT tends to produce output of lower quality when it is prompted with text containing Internet/SMS vernacular. As a remedy,dechatify()converts text to standard/written English:>>> utils.dechatify('how r u')
'How are you?'
>>> utils.dechatify('if the implementation is easy to explain then it might b a good idea')
'If the implementation is easy to explain, then it might be a good idea.'utils.generate_stem()This function accepts astrcontaining a word/phrase and returns a sentence stem pairing the word/phrase with the appropriate form of the verb "to be":>>> utils.generate_stem('GitHub')
'GitHub is'
>>> utils.generate_stem("pleiades")
'The Pleiades are'
Package: gptw
GPT Simplify Your Daily Workflow (gptW)No longer is it necessary to manually input prompts and interact with ChatGPT.With the GPTW tool, prompt operations are fully automated! Simplify your daily workflow.ExampleTranslateYou can simply use the "ww" command without having to first instruct ChatGPT that the following task is a translation.Translate to English:$wwe"今天天气怎么样"How'stheweathertoday?Translate to Chinese:$wwc"who are you? "你是谁？(Nǐshìshéi?)Polish the DocumentPolish a document with files as input.wwd-fREADME.mdCode Review$wwr-fgptw/gptw.py
AsanAIlanguagemodel,Icannotrunthecodeprovided,butIcanprovidesomefeedbackbasedonthecodestructureandsyntax.1.Thecodeappearstobewell-organizedandfollowsthePEP8guidelinesforPythoncode.2.Theargparsemoduleisusedtoparsecommand-linearguments,whichisagoodpracticeforcommand-lineapplications.

...

Overall,thecodeseemstobewell-writtenandorganized,butcouldbenefitfromsomeadditionalsecuritymeasuresanderrorhandling.AskAsk ChatGPT directly:$wwa"who are you? "IamanAIlanguagemodelcreatedbyOpenAI.Add Your Custom PromptPrepare your prompt and modify the gptw/config.json file following the existing format. Then, submit a PR or directly raise an issue to explain the command you want to add.gtpw/config.json:{"version":"v1.0.0","cmds":{##cmdtouse"e":{##replacewithyourprompt"prompt":"Please translate the following text into English, and polish it to make it sound more natural and in line with native speaker conventions. Please refrain from providing any additional output beyond the translated text",##Asimpleexplanationofwhatthispromptisusedfor"_comment":"Translate into English"},...}}Currently, the following workflows are supported. You can run "ww -l" to obtain the available workflows.$ww--list
cmd|meaning|example
e|TranslateintoEnglish|wwe你好
c|TranslateintoChinese|wwchowru
p|Polishsentence|wwphwoareyou
a|JustaskChatGPTdirectly|wwawhoareyou
d|Polishdocument|wwd-fREADME.md
r|CodeReview|wwr-fgptw/gptw.py
dic|Dictionary|wwdicdictionaryInstallationpipinstall--upgradegptwOpenAI Configww--configprovider=openai
ww--configopenai-model=gpt-3.5-turbo
ww--configopenai-token={YOUR_TOKEN}POE Configww--configprovider=poe
ww--configpoe-bot-name=chinchilla
ww--configpoe-token={YOUR_TOKEN}Bot names:{'capybara': 'Sage', 'beaver': 'GPT-4', 'a2_2': 'Claude+', 'a2': 'Claude', 'chinchilla': 'ChatGPT', 'nutria': 'Dragonfly'}ChatGPT websiteww-cprovider=gpt-web
ww-cgpt-web-model=gpt-4
ww-cgpt-web-token=# https://chat.openai.com/api/auth/session copy the access_token sessionww-cgpt-web-proxy=# https://github.com/acheong08/ChatGPT-Proxy-V4Azure OpenAIww-cprovider=azure
ww-cazure-token={YOUR_TOKEN}ww-cazure-endpoint
ww-cazure-depnam=UninstallpipuninstallgptwDevelopmentpipinstalltox
maketest
Package: gptwc
gptwc: wc for GPT tokensThewcutility counts words or characters. Thegptwcutility functions similarly but counts tokens.
Tokens are smaller than words but larger than characters, and are a more compact representation of text used by large language models.Usegptwcto check the number of tokens in a string, in order to remain under the token limit (eg. 4097) for your large language model API. Usestiktoken.Installation$ pip install gptwc

$ echo "Simple is better than complex." | gptwc
7Example Usage$ cat LICENSE  | gptwc
257
$ cat LICENSE | wc -c
1059
$ cat LICENSE | wc -w
165


$ curl -s 'https://gist.githubusercontent.com/phillipj/4944029/raw/75ba2243dd5ec2875f629bf5d79f6c1e4b5a8b46/alice_in_wonderland.txt' | wc -w
26470

curl -s 'https://gist.githubusercontent.com/phillipj/4944029/raw/75ba2243dd5ec2875f629bf5d79f6c1e4b5a8b46/alice_in_wonderland.txt' | gptwc
40085


$ cat LICENSE | gptwc --model text-davinci-003
257
$ cat LICENSE | gptwc --model gpt-3.5-turbo
201


$ cat README.md | pbcopy
$ gptwc -c
517Optionsusage: gptwc [-h] [--files0-from F] [--model MODEL] [-c] [--version] [FILE ...]

Count tokens in text files using OpenAI's tiktoken library.

positional arguments:
  FILE             Text files to count tokens in

options:
  -h, --help       show this help message and exit
  --files0-from F  Read input from the files specified by NUL-terminated names in file F
  --model MODEL    Model name to use for tokenization (default: text-davinci-003)
  -c, --clipboard  Read input from the system clipboard
  --version        show program's version number and exitWhich Tokenizer Does Each Model Use?Fromtiktoken/model.py"gpt-4": "cl100k_base",
"gpt-3.5-turbo": "cl100k_base",
"text-embedding-ada-002": "cl100k_base",

"text-davinci-003": "p50k_base",
"text-davinci-002": "p50k_base",
"code-davinci-002": "p50k_base",
"code-davinci-001": "p50k_base",
"code-cushman-002": "p50k_base",
"code-cushman-001": "p50k_base",
"davinci-codex": "p50k_base",
"cushman-codex": "p50k_base",

"text-davinci-001": "r50k_base",
"text-curie-001": "r50k_base",
"text-babbage-001": "r50k_base",
"text-ada-001": "r50k_base",
"davinci": "r50k_base",
"curie": "r50k_base",
"babbage": "r50k_base",
"ada": "r50k_base",
"text-similarity-davinci-001": "r50k_base",
"text-similarity-curie-001": "r50k_base",
"text-similarity-babbage-001": "r50k_base",
"text-similarity-ada-001": "r50k_base",
"text-search-davinci-doc-001": "r50k_base",
"text-search-curie-doc-001": "r50k_base",
"text-search-babbage-doc-001": "r50k_base",
"text-search-ada-doc-001": "r50k_base",
"code-search-babbage-code-001": "r50k_base",
"code-search-ada-code-001": "r50k_base",

"text-davinci-edit-001": "p50k_edit",
"code-davinci-edit-001": "p50k_edit",

"gpt2": "gpt2",
Package: gpt-web-crawler
简体中文EnglishIntroductionGPT-Web-Crawler is a web crawler based on python and puppeteer. It can crawl web pages and extract content (including WebPages' title,url,keywords,description,all text content,all images and screenshot) from web pages. It is very easy to use and can be used to crawl web pages and extract content from web pages in a few lines of code. It is very suitable for people who are not familiar with web crawling and want to use web crawling to extract content from web pages.The output of the spider can be a json file, which can be easily converted to a csv file, imported into a database or building an AI agent.Getting StartedStep1. Install the package.pipinstallgpt-web-crawlerStep2. Copyconfig_template.pyand rename it to config.py. Then, edit the config.py file to config the openai api key and other settings, if you need use ProSpider to help you extract content from web pages. If you don't need to use ai help you extract content from web pages,you can keep the config.py file unchanged.Step3. Run the following code to start a spider.fromgpt_web_crawlerimportrun_spider,NoobSpiderrun_spider(NoobSpider,max_page_count=10,start_urls="https://www.jiecang.cn/",output_file="test_pakages.json",extract_rules=r'.*\.html')SpidersSpider TypeDescriptionNoobSpiderBasic web page scrapingCatSpiderWeb page scraping with screenshotsProSpiderWeb page scraping with AI-extracted contentLionSpiderWeb page scraping with all images extractedCat SpiderCat spider is a spider that can take screenshots of web pages. It is based on the Noob spider and uses puppeteer to simulate browser operations to take screenshots of the entire web page and save it as an image.
So when you use the Cat spider, you need to install puppeteer first.npminstallpuppeteerTODO支持无需配置config.py
Package: gptwosample
Package for using GPTwoSample=============================This module allows the user to compare two timelines with respect todiffferential expression.It compares two timeseries against each other, depicting whether thesetwo timeseries were more likely drawn from the same function, or fromdifferent ones. This prediction is defined by which covariancefunction :py:class:`pygp.covar` you use.To use gptwosample without installing: $ python gptwosample --helpTo install gptwosample run: $ easy_install gptwosample or run:: $python setup.py install from gptwosample directory if you downloadedthe source.  This will install a script gptwosample into your pythonbin. In some cases this bin is not in $PATH and must be includedextra.Try printing the full help of the script using:: gptwosample --helprestart your unix shell if it is not yet registered.To run optional package tests before installing run: python setup testAfter installation you can use GPTwoSample with all it's features.See doc/index.html for the documentation in your site-packages folder,see www.python.org for further details.Examples: Please see 'ready-to-use' example scripts in./gptwosample/examples. (In your python site-packages folder, seewww.python.org for further details)Example run: $ exdir=gptwosample/examples/ $ gptwosample -vtpo toy$exdir/ToyCondition1.csv $exdir/ToyCondition2.csvTo see for example GPTimeShift example, runsh gptimeshift_example.shThe Output will be saved in gptimeshift_example/ with plots andresults.csv. If you don't have sh, you can still run the script bymodifying the scripts via "chmod -x gptimeshift_example.sh" and thenrun it by "./gptimeshift_example.sh"Make sure to run "python ./examples/generateToyExampleFiles.py" togenerate toy data for examples, if they are not present.
Package: gptwrite
GPT-Write :writing_hand:GPT make writing an article brazing fast :fire:.PyPi:https://pypi.org/project/gptwrite/:telescope: OverviewGPT-Write is the CLI tool for Intractive Automated Article Writing.You can create articles, just answer the questions.Since the language is specified in the GPT prompt and GPT is allowed to generate the text, it could theoretically be used in a variety of languages.However, the supported languages in the shell messages are only English and Japanese.:runner: Installationpipinstallgptwrite:computer: Usage# Set Environment "OPENAI_API_KEY"exportOPENAI_API_KEY=sk-xxxxxxxxxxxxxxxxxxx# Rungptwrite
?Language?<SelectLanguage># ...(Lots of questions come in to the interactive.)
Package: gptx-py
GPTXA python based wrapper for GPT-4 & GPT-3.5 PLUS.Benefits and why.There is currently no way to use GPT-4 outside the online chat.openai.com interface. This wrapper allows you to use GPT-4 in your own projects.the current API is extremely slow and even if you have premium it does not speed up the response time. GPTX does not use the API and instead uses the same interfaces as the chat.openai.com website.
This means that you can use GPT-4 and GPT-3.5 PLUS in your own projects without having to wait 20+ seconds for a response.InstallTo use GPT-4 you need to have a GPT PLUS subscription. If you don't, you can get onehere.pipinstallGPTXPyGetting the PUID & ACCESS_TOKEN1. Head over to https://chat.openai.com/chat
2. Open the developer console (F12)
3. Go to the application tab
4. Go to local cookies
5. Copy the value of the _puid cookie
6. Copy the value of the __Secure-next-auth.session-token cookie
7. Paste the values into the .env file like so:

ACCESS_TOKEN=__Secure-next-auth.session-token cookie
PUID=_puidUsagefromgptximportGPTXgptx=GPTX(model="gpt-4")# or "text-davinci-002-render-sha" (default)(AKA GPT-3.5)session=gptx.start_session()q=gptx.send_message(input(">>> "),session)print(q['message']['content']['parts'][0])Info✅ - cloudflare bypassed
✅ - automatic refresh of _puid
✅ - GPT-4 Support
✅ - GPT-3.5 PLUS Support
✅ - GPT-3.5 Support (Free)
✅ - Fast
✅ - Easy to use
✅ - No API
✅ - No rate limits
✅ - No waiting
✅ - Back and forth conversation supportGPTX-CLICheck out a GPTX based CLIhere
Package: gptzero
GPTZero API WrapperThis wrapper provides a simple way to interact with the GPTZero API using Python.Featured onhttps://gptzero.me/docsGetting startedTo use the GPTZero API, you'll need to have an API key. If you don't have an API key yet, you can sign up for one on theGPTZero website.Once you have your API key, you can install thegptzeropackage and use it.fromgptzeroimportGPTZeroAPIapi_key='your_api_key_here'# Your API Key from https://gptzero.megptzero_api=GPTZeroAPI(api_key)Making a text predictiondocument='Hello world!'response=gptzero_api.text_predict(document)print(response)Making a file predictionfile_path='path/to/your/file'response=gptzero_api.file_predict(file_path)print(response)
Package: gpu4u
A Python Package for Automatically Monitoring & Occupying NVIDIA GPUsGPU4Ulocates all GPUs on the computer, determines their availablity and returns a ordered list of available GPUs. Availablity is based upon the current memory consumption and load of each GPU. The package is written with GPU selection for Deep Learning in mind, but it is not task/library specific and it can be applied to any task, where it may be useful to identify available GPUs.RequirementsNVIDIA GPU with latest NVIDIA driver installed.GPU4Uuses the programnvidia-smito get the GPU status of all NVIDIA GPUs. nvidia-smi should be installed automatically, when you install your NVIDIA driver.Python libraris:jsonosrandomresystimedatetimepynvmlrequestsTested on CUDA driver version 450.102.04 with Python 3.6.10.InstallationWith PIPpip install gpu4uWith Source Codegitclonehttps://github.com/imrdong/gpu4u.gitcdgpu4u
pythonsetup.pyinstallUsageBaseTo combineGPU4Uwith your Python code, all you have to do isOpen a terminal in a folder other than theGPU4UfolderStart a python console by typingpythonin the terminalIn the newly opened python console, type:>>>fromgpu4uimportauto_monitor>>>auto_monitor(script="fill_in_your_script_here")WeChatGivenWeChattoken, you can receive notifications fromGPU4UinWeChat.Go to[PushPlus]official website, scan the QR code throughWeChatto log in, and copy your token.The next steps are the same asBasesection>>>token="paste_your_token_here">>>fromgpu4uimportauto_monitor>>>auto_monitor(script="fill_in_your_script_here",use_wechat_push=True,token=token)The outputs ofGPU4Udepending on your number of GPUs and their current usage, seeDemofor more details.Demo:smile: Script Running with Available GPUs# Find available GPUs
Find Available GPU: 0, 1, 2, 3. Start Running Your Script.

# Random select one GPU to run your script
Script: CUDA_VISIBLE_DEVICES=1 python train.py --batch_size 64

# The start time of script run
Started @: 2021-02-22 13:08:23:disappointed: Script Running with No Available GPUs# No available GPUs, start automatic monitoring with waiting time prompt
No Available GPU for Now, Automatic Monitoring for 0:23:10

# Find available GPUs
Find Available GPU: 2, 3. Start Running Your Script.

# Random select one GPU to run your script
Script: CUDA_VISIBLE_DEVICES=3 python train.py --batch_size 64

# The start time of script run
Started @: 2021-02-22 13:31:33LicenseSeeLICENSE
Package: gpuastro
/∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗
∗ ∗
∗ This program is free software; you can redistribute it and/or modify ∗
∗ it under the terms of the GNU General Public License as published by ∗
∗ the Free Software Foundation; either version 2 of the License, or ∗
∗ (at your option) any later version. ∗
∗ ∗                                                                     * *
* *                   Email : s.gill@keele.ac.uk                        * *
* *                   github : samgill844                               * *
∗ ∗                                                                     * *
∗ Acknowledgments:                                                      * *
* The equations in the section “Keplerian equations” is ported from     * *
* the lightcurve model “ellc” (Maxted 2016), as is the function in      * *
* the “Radial velocity equations” section.
∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗∗/