Saravanan666/pypi-org huggingface dataset:
Package: ai-executor
1.实验目标借助AI生成代码的能力，让python执行不存在的方法！强化代码编程能力，验证想法的可行性！2.参考链接：https://www.bilibili.com/video/BV1na4y1K7H5/?spm_id_from=333.880.my_history.page.clickhttps://www.bilibili.com/video/BV1ET41187m9/?spm_id_from=333.880.my_history.page.click3.最终效果可以执行不存在的方法，注意合理命名方法名可以保存能正常运行的方法，避免重复生成
Package: ai-eye
Infoai_eye.py 2018-05-25Author: Zhao Mingming <471106585@qq.com>Copyright: This module has been placed in the public domain.version:0.0.7Functions:has_closed_eye: eye’s open degreeHow To Use This Modulewhen u use pip install ldm==0.0.2fromldmimportlandmarksfromai_eyeimporthas_closed_eyefromskimageimportioimagepath="closed_eye/10.jfif"img=io.imread(imagepath)ldl,helptxt=landmarks(img)printhelptxtforldinldl:printhas_closed_eye(ld)when u use  pip install ldm==0.0.4importldmfromai_eyeimporthas_closed_eyefromskimageimportioimagepath="closed_eye/10.jfif"ldmer=ldm.LDM()img=io.imread(imagepath)ldl,facel,helptxt=ldmer.landmarks(img)printhelptxtforldinldl:printhas_closed_eye(ld)
Package: aif360
The AI Fairness 360 toolkit is an open-source library to help detect and mitigate bias in machine
learning models. The AI Fairness 360 Python package includes a comprehensive set of metrics for datasets and models to
test for biases, explanations for these metrics, and algorithms to mitigate bias in datasets and models.We have developed the package with extensibility in mind. This library is still in development. We encourage the
contribution of your datasets, metrics, explainers, and debiasing algorithms.
Package: ai-face
# ai_faceversion:0.0.1analyze the face artribution in the imagelike this:```# pip install ldmimport ldm# pip install ai_eyefrom ai_face import *from skimage import ioimagepath="closed_eye/10.jfif"ldmer=ldm.LDM()img=io.imread(imagepath)ldl,facel,helptxt=ldmer.landmarks(img)print helptxtprint 'face_num:'print face_num(facel)print 'face_avre_rate:'print face_area_rate(img,facel)print 'face_center_degree:'print face_center_degree(img,facel)print 'face_direction:'print face_direction(facel)print 'face_feature:'print face_feature(img,facel)print 'face_compare:'feature1=face_feature(img,facel)feature2=face_feature(img,facel)print compare2facefeature(feature1,feature2)```20180524anjiang
Package: aiffel7
aiffel7_library사용해보기패키지 설치pip install --upgrade aiffel7example 폴더에서 사용법 확인하기구현된 함수에대한 문서들이 들어있습니다.기여하기pull request로 패키지에 포함할 파일을  aiffel7 폴더에 추가코드 상단에 기여자 적기(날짜 생략 가능)# 기여자: [기여자 이름]# 기여 날짜: [YYYY-MM-DD]# 설명: [변경 사항에 대한 간략한 설명]# 설명에는 사용처,  이것이 주는 이점 , 원리 등등을 자세히 써주면 좋음example folder에 사용법 작성문의하기issues 에서 새로운 이슈 만들기
라이브러리 구현이 되었으면 좋은 것들 문의를 하거나, 라이브러리에 문제가 있다면 알려주시면 됩니다.
Package: aiflow
AI FlowIntroductionAI Flow, which offers various reusable operators & processing units in AI modeling, helps AI engineer to write less, reuse more, integrate easily.Installpip install aiflowConceptsOperators VS. UnitsIdeally, we agree:AnOperatorwould contain lot of units, which will be integrated intoairflowfor building non-realtime processing workflow;AUnitis a small calculation unit, which could be a function, or just a simple modeling logic, and it could be picked as bricks to build an operator. Besides, it could be reused anywhere for realtime calculation.ClassesOperatorsMongoToCSVOperatorElastic2CSVOperatorRegExLabellingOperatorUnitsDoc2VecUnitDoc2MatUnitTests & ExamplesExample: Use Units to Build Your CastleExample: Working with AirflowIntests/docker/folder, we provide examples on how to useaiflowwithairflow.
It is a docker image, you could simply copy and start to use it!In project root directory, run commands first:docker-compose up --build aiflowThen openlocalhost:8080in your browser, you can see all the examplesaiflowprovided!
Note: both the default username & password areadminEnjoy!Contribution
Package: aiforthechurch
AI for the ChurchModern LLMs are rooted in secular value systems that are often misaligned with religious organisations. This PyPI package allows anyone to train and deploying doctrinally correct LLMs based on Llama2. Effectively, we are aligning models to a set of values.Model fine-tuningfromaiforthechurchimportalign_llama2doctrinal_dataset="/path/to/csv"align_llama2(doctrinal_dataset)aiforthechurchis integrated with HuggingFace shuch that the aligned model will be automatically pushed to your HuggingFace repo of choice at the end of the training.At aiforthechurch.org we provide tools for generating doctrinal datasets, a few examples are available at huggingface.co/AiForTheChurch.Model inference and deploymentWe implemented an inference API in the same format as OpenAI's.importaiforthechurchaiforthechurch.Completion.create(denomination="catholic",message="Does Jesus love me?")There is also an asynchronous streaming API, just setstream=True.And you can use our code to create your own inference server with the models
you train by editing theMODELSdictionary ingloohack/deployment/prod_models.pywith a denomination and a path to your
model in huggingface. Start the server by running the following command on your
machine:python gloohack/deployment/inference.pyModel training requirementsIf you wish to train your models using this repo you will need access to a machine with over 16GB of GPU memory and 30GB RAM. The full model weights for Llama2-7B amount to almost 30GB, but we use parameter-efficient fine-tuning (PEFT) LoRA to save memory and avoid any catastrophic forgetting during the fine-tuning procedure.ReferencesWe leaned heavily on open-source libraries liketransformers,peft, andbitsandbytesfor this project.Dettmers, Tim, Mike Lewis, Younes Belkada, and Luke Zettlemoyer. 2022. "LLM.int8(): 8-bit Matrix Multiplication for Transformers at Scale."arXiv preprint arXiv:2208.07339.Hu, Edward J., Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. 2021. "LoRA: Low-Rank Adaptation of Large Language Models."arXiv preprint arXiv:2106.09685.
Package: aifrruflowmeter
What is AifrruFlowMeterThe AifrruFlowMeter is an open source tool that generates Biflows from pcap files, and extracts features from these flows.AifrruFlowMeter is a network traffic flow generator available from here . It can be used to generate bidirectional flows, where the first packet determines the forward (source to destination) and backward (destination to source) directions, hence the statistical time-related features can be calculated separately in the forward and backward directions. Additional functionalities include, selecting features from the list of existing features, adding new features, and controlling the duration of flow timeout.NOTE: TCP flows are usually terminated upon connection teardown (by FIN packet) while UDP flows are terminated by a flow timeout.The flow timeout value can be assigned arbitrarily by the individual scheme e.g., 600 seconds for both TCP and UDP.
Package: aifs
AI FilesystemLocal semantic search over folders. Why didn't this exist?pipinstallaifs
pipinstallunstructured[all-docs]# If you want to parse all doc types. Includes large packages!fromaifsimportsearchsearch("How does AI Filesystem work?",path="/path/to/folder")search("It's not unlike how Spotlight works.")# Path defaults to CWDHow it worksRunningaifs.searchwill chunk and embed all nested supported files (.txt,.py,.sh,.docx,.pptx,.jpg,.png,.eml,.html, and.pdf) inpath. It will then store these embeddings into an_.aifsfile inpath.By storing the index, you only have to chunk/embed once. This makes semantic searchveryfast after the first time you search a path.If a file has changed or been added,aifs.searchwill update or add those chunks. We still need to handle file deletions (we welcome PRs).In detail:If a folder hasn't been indexed, we first useunstructuredto parse and chunk every file in thepath.Then we usechromato embed the chunks locally and save them to a_.aifsfile inpath.Finally,chromais used again to semantically search the embeddings.If an_.aifsfileisfound in a directory, it uses that instead of indexing it again. If some files have been updated, it will re-index those.GoalsWe should always have SOTA parsing and chunking. The logic for this should be swapped out as new methods arise.Chunking should be semantic — as in,pythonandmarkdownfiles should havedifferentchunking algorithms based on the expected content of those filetypes. Who has this solution?For parsing, I think Unstructured is the best of the best. Is this true?We should always have SOTA embedding. If a better local embedding model is found, we should automatically download and use it.I think Chroma will always do this (is this true?) so we depend on Chroma.This project should stayminimally scoped— we wantaifsto be the best local semantic search in the universe.Why?We built this to letopen-interpreterquickly semantically search files/folders.
Package: ai-functions
Python AI FunctionsSimple library that can convert from python functions to a JSON schema description of those functions, suitable for use with AI libraries.Installationpip install ai-functionsUsageFor example:from ai_functions import get_openai_functions, execute_function


def search_web(query: Annotated[str, "google formatted keywords to search for"]):
    """Search the web"""

print(openai_function_dict([search_web]))Also, if you get aresponse.function_callfrom openai, you can useexecute_functionopenai_function_execute([search_web], function_call)Or, if you have the name and arguments split out already:function_execute([search_web], name, arguments)Finally, if you want a container to handle this:from ai_functions import AIFunctions


container = AIFunctions([search_web, add_calendar_entry])

functions = container.openai_dict()
subset_functions = container.openai_dict(["search_web"])
container.execute("search_web", {"query":"top web hosting sites"})
container.opeanai_execute({"name": "search_web", "arguments": "{\"query\":\"top web hosting sites\"}")What stuff does this handle?Converts your annotated schema into an appropriate promptHandles converting arguments to JSON if they are specified as a string.Auto-casts arguments to the right types, if they aren't right.Raises errors that AI engines understand if returned as a function response, instead of errors with poor descriptions.Async executeIf a loop is provided to the AIFunctions constructor, or to any execute calls, it will be used to schedule a coroutine.Async versions of execute are available, prefix all calls withasync_Some fine printIf you want to have a paramter that is still seen as "valid", but isn't part of the schema, you can
annotate it with None as the description.  But this is really an "enforcement" thing, and might not
belong in this library.Dealing with context is a beast in chat apps, so more work here might be helpful.For example, I use meta-functions that unlock others, to prevent context-bloat.Might put that in another lib soon, or put it here.
Package: aifunctools
Functools for OpenAI GPT FunctionsOpenAI just released GPT Functions:https://openai.com/blog/function-calling-and-other-api-updatesBut it's really cumbersome to make the actual function signature.
And manually parse results and chain the calls:curlhttps://api.openai.com/v1/chat/completions-u:$OPENAI_API_KEY-H'Content-Type: application/json'-d'{"model": "gpt-3.5-turbo-0613","messages": [{"role": "user", "content": "What is the weather like in Boston?"}],"functions": [{"name": "get_current_weather","description": "Get the current weather in a given location","parameters": {"type": "object","properties": {"location": {"type": "string","description": "The city and state, e.g. San Francisco, CA"},"unit": {"type": "string","enum": ["celsius", "fahrenheit"]}},"required": ["location"]}}]}'Use aifunctools insteadInstead, aifunctools automatically parses available python type annotations
and docstrings so you don't have to do all of the manual work:fromaifunctools.openai_funcsimportcomplete_with_functionsdefget_current_weather(location:str,unit:str)->dict:"""Get the current weather in a given location:param location: The city and state, e.g. San Francisco, CA:param unit: Either "celsius" or "fahrenheit":return: the current temperature, unit, and a description"""return{"temperature":22,"unit":"celsius","description":"Sunny"}resp=complete_with_functions("What is the weather like in Boston?",get_current_weather)# The response should contain: "The weather in Boston is currently sunny with a temperature of 22 degrees Celsius."What's nextOpenAPI SpecsPython functions are great, but what would really be great is to parse openapi specs from remote services.
Imagine where every service provider makes their api spec available and agents can just
crawl these APIs and use aifunctools to chain them together.Richer typesFor this hack we only support the basic string / number / boolean types.
By making this more flexible we can get much richer behavior.Error handlingI'm sure there are lots of cases where incomplete docstrings and type signatures
will cause errors. We can make these more robust (or use some reasonable defaults).
Package: aiga-django-amqp
merupakan package khusus django untuk keperluan berkomunikasi dengan rabbitmqQuick startTambahkan “aiga_amqp” ke INSTALLED_APPS pada file settings.py:INSTALLED_APPS = [
    ...
    'aiga_amqp',
]A.1 Message SenderBerikut contoh kode untuk mengirim message:from aiga_amqp.core import send_queue

send_queue('nama channel', message='ini pesan')A.2 Compete ConsumerBerikut merupakan langkah untuk consume antrian message secara “compete” atau bergantian.Pada folder app yang anda inginkan, tambahkan fileconsumer.pyPada fileconsumer.pybuat function untuk menangani message seperti contoh dibawah ini:def consumer(channel, method, properties, body):
    print('saya telah baru saja melakukan sesuatu hal yang penting disini ...')Pada fileapps.pyoverride methodreadydan lakukan perintah seperti contoh berikut untuk mengeksekusiconsumer.py:from django.apps import AppConfig

class ExampleConfig(AppConfig):
    default_auto_field = 'django.db.models.BigAutoField'
    name = 'example'

    def ready(self) -> None:
        from aiga_amqp.core import AMQPListener
        from .consumer import consumer
        listener = AMQPListener()
        listener.consume(consumer, channel_name='your channel name')Jalankan djangoB.1 Publish MessagesegeraB.2 Subscribe MessagesegeraSettings VariableTerdapat beberapa variable yang bisa digunakan padasettings.pybeserta default value nya:AIGA_AMQP = {
    'HOST' : 'localhost',   //alamat host dari rabbitmq
    'PORT' : 5672,          //port dari rabbitmq
    'CREDENTIAL' : False,   //set menjadi True jika menggunakan USERNAME dan PASSWORD
    'USERNAME' : None,      //username untuk mengakses rabbitmq
    'PASSWORD' : None,      //password untuk mengakses rabbitmq
    'HEARTBEAT' : 600,
    'TIMEOUT' : 300
}
Package: aigar
Gym env that replicates agar.ioHow to install:cd to this repo. Then run:pip install -e .Or simply:pip install aigarHow to use:Simply import aigar and import gym.
The following easy environments are available:"AigarPellet-v0" - You control a single cell. The goal is to collect as many pellets as quickly as possible."AigarGreedy1-v0" - You control a single cell. There is another cell controlled by a simple greedy heuristic. Collect as many pellets as quickly as possible and eat the opponent as often as you can.There are many more options available by following the naming scheme: "Aigar[Pellet|Greedy[1|2|5]][Grid][Split][Eject]-v0"
The number behind "Greedy" determines the number of greedy bots. If "Grid" is used a simplified lower dimensional observation space will be used (not based on pixels). If "Split" is used the player cell can split itself, just as in agar.io. If "Eject" is used the player cell can eject some mass, just as in agar.io.Observation Space:By default, the observation space will be an rgb image of size (900, 900, 3).If the "Grid" option is used an easier version of the obs space will be used, e.g. in "AigarPelletGrid-v0". In this easier version the obs space is either (11, 11, 3) in the "Pellet" options or (11, 11, 4) in the "Greedy" options. The first two dimensions determine the size of the grid and the last dimension the number of grids. The first grid determines the pellet mass per grid cell, the second grid is the combined mass of every cell of the player that is at least partially in a grid cell and the third grid determine the playing field boundary, every grid receives a floating value between 0 and 1 depending on how much of it is outside of the playing field. The additional grid in the Greedy version determines the combined mass of every opponent cell (no matter which opponent) that is at least partially in that grid cell. One cell of the player or opponent can thus count for multiple cells.Action Space:The action space in this version consists out of two dimensions: the x and y location of the cursor. It is limited to a range of 0-1, mapping the whole possible space of possitions of the cursor.If the "Split" option is used, the action space increases by one. The additional continuous action determines the split action: a value above 0.5 means the player cells will split, otherwise not.The "Eject" option has the same effect as the "Split" option, but for ejecting. This option is not selectable if "Split" is not selected, e.g. there is not "AigarPelletEject-v0", only an "AigarPelletSplitEject-v0".
Package: aigens
aigensA TryCrime Python package for AI text generation.Requires a RapidAPI account.aigenslooks for your RapidAPI key in the$RAPID_API_KEYenvironment
variable, so make sure to set it.Installationpip install aigensUsage Exampleimportaigens# Returns a list of ideasideas=aigens.generators.blog.generate_idea("A blog about my adventures in an internet gang.")forlineinideas:print(line.strip())# Returns a list of strings in the form of outlinesoutline=aigens.generators.blog.generate_outline("A blog about how hard it is to be a gay KKK member.")forlineinoutline:print(line.strip())Output ExampleThe example code above produces output similar to below:The Bully: A gang blog on bullying.
10 Ways to Increase Your Google SEO: A blog post around 10 ways to improve your SEO and your Google search engine rankings.
My First Gang Meeting: A blog post about my first gang meeting.
How to Become a Gang Leader: A blog post about how to become a gang leader and how to manage your gang.
The Six Most Important Things I've Learned From Being in an Internet Gang: A blog about the six most important things I've learned from being in an internet gang.
My Gang: From Gang to Family: A blog post about how to transition from street gang to family.
My Life in a Gang: A blog about life in an internet gang.
The Gang Life: A blog about an internet gang.
1. Introduction: The struggle of being a gay KKK member
2. Challenges of being a gay KKK member
3. The good things about being a gay KKK member
4. Out of all the groups in the KKK, the gay KKK members are the smallest
5. Conclusion: Gay members of the KKK are still persecuted, and it is hard to be one
1. How hard is it to be a gay KKK member?
2. What are some of the challenges that the KKK faces?
3. What are some of the challenges that the gay KKK members face?
4. What are some of the challenges that the black KKK members face?
5. What are some of the challenges that the black gay KKK members face?
6. What are some of the challenges that the gay black KKK members face?
7. What are some of the challenges that the black gay black KKK members face?
Conclusion: Being in a KKK group is not easy, no matter what the race.
1. How hard is it to be a gay KKK member?
2. How does the gay KKK member feel about the gay KKK?
3. What about the gay KKK member's family?
4. What about the KKK members who are gay?
Conclusion: Sometimes people don't know what they're missing.
This blog post is about how hard it is to be a gay KKK member.
Package: ai-getter
A CLI for Requesting AI-Generated Things!Installationpip install ai_getterUsageaighelpaigimage<prompt>[--clip]--num-images<num_images>[--save-path<path>][--s3]aigtext<prompt>[--clip][--save-path<path>][--s3]--clipwillgetthepromptfromyourclipboard'scontents,inadditionto<prompt>ifyousupplyone--s3willuploadtheresulttoyourAI_GETTER_S3_BUCKETsetenvvarAI_GETTER_ALWAYS_SAVE_TO_S3=1tosavetos3bydefaultEnvironment VariablesOPENAI_ORGOPENAI_TOKENAI_GETTER_SAVE_PATHAI_GETTER_S3_BUCKETAI_GETTER_ALWAYS_SAVE_TO_S3(0 or 1)CredentialsMake sure you have credentials in an~/.awsdirectory if you want to upload any outputs to S3.
Package: ai-ghostfunctions
AI GhostfunctionsWrite the docstring, call the function, get the results.Documentation:https://ai-ghostfunctions.readthedocs.io/Aghostfunctionleverages OpenAI GPT-4 to return sensible outputs from functions without
defined logic. It packages the the function name, docstring, and signature into a prompt
which is sent to OpenAI's GPT-4 API, and transparently handles coercing the api result
into the expected return type.Installationpip install ai-ghostfunctionsQuickstartTo see it in action, save your OpenAI API Key to the env varOPENAI_API_KEYand run:>>>importos>>>fromai_ghostfunctionsimportghostfunction>>>assertos.getenv("OPENAI_API_KEY")>>>@ghostfunction>>>defsanitize_messy_string(messy_string:str)->list[dict]:>>>"""Return a list of dicts that contain the data from `messy_string`.""">>>pass>>>sanitize_messy_string(messy_string="""name|age|nicknameJohn Brighton Bradford,  34,  J.BGrace B., "24", Grace""")[{'name':'John Brighton Bradford','age':34,'nickname':'J.B'},{'name':'Grace B.','age':24,'nickname':'Grace'}]###>>>@ghostfunction>>>defgenerate_random_words(n:int,startswith:str)->list:>>>"""Return a list of `n` random words that start with `startswith`.""">>>pass>>>generate_random_words(n=4,startswith="goo")['goofy','google','goose','goodness']>>>generate_random_words(n=3,startswith="foot")['football','footnote','footprint']By default, a ghostfunction will dispatch a sensible prompt to OpenAI GPT-4 that includes the function name, the docstring, and function arguments, parse the result from OpenAI and return it as the result of the function.Ghostfunctions will retry and send the data to gpt-3.5-turbo if it looks like the OPENAI_API_KEY does not have access to gpt-4.CustomizationsYou can control the prompt:>>>importos>>>fromai_ghostfunctionsimportghostfunction>>>fromai_ghostfunctions.keywordsimportUSER>>>fromai_ghostfunctions.typesimportMessage>>>assertos.getenv("OPENAI_API_KEY")>>>@ghostfunction(prompt_function=lambdaf,**kwargs:[>>>Message(role=USER,content=f"tell me a slightly insulting joke about this function name:{f.__name__}.")>>>])>>>defrecursive_function_that_will_recurse():>>>"""Recurse until you go crazy.""">>>pass>>>recursive_function_that_will_recurse()# 'Why did the programmer name his function "recursive_function_that_will_recurse"? Because he wanted to make absolutely sure that no one would confuse it for a function that actually does something useful.'Heh. Not bad.Prompts to gpt-4 and gpt-3.5-turbo are of typeList[ai_ghostfunctions.types.Message].Seeghostfunctions.pyfor the default prompt.LicenseAI Ghostfunctionsis free and open source software.RequirementsSeepyproject.tomlfor a list of dependencies.ContributingContributions are very welcome.
To learn more about setting up a dev environment and contributing back to the project, see theContributor Guide.IssuesIf you encounter any problems, pleasefile an issuealong with a detailed description.CreditsThis project was generated from aforkof@cjolowicz'sHypermodern Python Cookiecuttertemplate.