Saravanan666/pypi-org huggingface dataset:
Package: fasttopi
Fast-topiis a framework to develop and deploy models as an api service. The model or the service takes as an input a title
and returns one of the following categories:Entertainment,Tech,Business, andHealth.
The framework is centered around a common configuration fileconfig.yamlwhere all parameters for developing the model
and deploying the REST api are stored.The general use case for usingfast-topiis deploying a service and then querying it via the command line../deploy.sh
python client.py --title Elon Musk named Time's Person of the year for 2020InstallTo install fast-topi using pip runpip install fast-topiREST API DeploymentTo deploy a REST api locally run the following command../deploy.shOnce the REST api is up and running, you can use the following path to query ithttp://127.0.0.1:80/categories/?title=Elon usk named Time's Person of the year for 2021This will retrun a json object containing {"category":"tech"} for this title.Command line clientTo get the news category for a given title you can use the command line client.
A prerequisite is that the rest api is already deploied.python client.py --title "Elon usk named Time's Person of the year for 2021"ExperimentsTo train and test a new model you can run one of the following experiments. By default, a logistic regression model
will be used using token n-grams. An alterantive is using a majority baseline by using--baseline.Cross validation experimentsTo run a n-folds cross validation experiments on part of the dataset run the following command. This will create
a holdout set on which can be used to evaluate the model. The effectiveness of the classifier will be calculated for
all available hyper parameter (c) in theconfig.yamlfile. By default, the classifier will be evaluated on 5
splits and a holdout set will be created with 10 % of the whole dataset. To change these parameters you can edit the
parameterssplit_countsandholdout_percin the configuration fileconfig.yaml.python experiment.py --crossvalidateTesting on holdout setRuns a one-split experiment classifier on the dataset by creating a holdout set which will be used to evaluate the model.python experiment.py --testTraining a modelTo train a final model on the whole dataset and use it for the REST api use the command. This will store a new model
undermodels/model.pkl. To change the default path of the model, edit theconfig.yamlfile.python experiment.py --trainThe experiment script allows to run experiments on a sample of the dataset using--sample. The size of the sample
is stored on theconfig.yamlfile.Code testingpython -m unittest tests/*.pyConfigurationThe configuration for the REST api, model, experiments, and dataset are stored as yaml file underconfig.yaml.DependenciesTo install the needed dependencies use the following command.pip install --r requirements.txt
Package: fast-torch
FastTorchLibrary that implements the training and test loops for your Deep Learning model. After your traning, you can also plot the training results, plot some predictions that your model has made on your test set and also a confusion matrix on the predictions made on your test set.This Library also allow you to plot some usefull informations about your dataset./!\ Note: Currently only supports classification tasks, it'll support other types of task in the future...Installationrun the following command then you are ready to go !pip install fast_torchUsageTake a look at the completeDocumentationof this framework.A complete example is available on theNotebook.Plot stats about your datasets# Import the plotting module of the libraryimportfast_torch.plotterasftplot# Will plot some random images of the dataloader that you've passed in the parameterftplot.plot_images(train_dataloader)# Will plot the class distributions of your train, val, test datasetsftplot.plot_classes_distributions(train_dataloader,test_dataloader,val_dataloader)Train and test your model# Import the model_wrapper moduleimportfast_torch.model_wrapperasmw# Initialize your modelmodel=Model()# Initialize the optionstraining_opts={"epochs":5,"criterion":nn.CrossEntropyLoss(),"optimizer":optim.SGD(model.parameters(),lr=0.01),"early_stopping_patience":2}# Instantiate the classifier wrapperclf=mw.Classifier(model,training_opts,train_loader,test_loader,val_loader,device="cuda")# Train your modelclf.train()# Test your modelclf.test()# Plot the training stats (Training loss, Vaildation loss + accuracy)clf.plot_training_stats()# Plot random prediction made by your trained modelclf.plot_random_predictions()# Plot the confusion matrixclf.plot_confusion_matrix()TODOSAdd a dataset creator for images (with the splits etc..)Clean the codeMake the confusion matrix figsize flexibleAdd Learning rate decay to the 'Classifier'Add other model wrappersMake the plot functions more flexible (working with other type of dataset, not only dataloader)
Package: fast-tort-cli
Toolkit for FastAPI+TortoiseORM projects to runserver/migration/lint ...Documentation:https://waketzheng.github.io/fast-tort-cliSource Code:https://github.com/waketzheng/fast-tort-cliRequirementsPython 3.11+Installation$pipinstall"fast-tort-cli[all]"---> 100%Successfully installed fast-tort-cliUsageLint py code:fastlint/path/to/file-or-directoryBump up version in pyproject.tomlfastbumpExport requirement file and installpip install -rfastsyncUpgrade main/dev dependenices to latest versionfastupgradeRun unittest and report coveragefasttest
Package: fast-to-sql
fast_to_sqlIntroductionfast_to_sqlis an improved way to upload pandas dataframes to Microsoft SQL Server.fast_to_sqltakes advantage of pyodbc rather than SQLAlchemy. This allows for a much lighter weight import for writing pandas dataframes to sql server. It uses pyodbc'sexecutemanymethod withfast_executemanyset toTrue, resulting in far superior run times when inserting data.Installationpipinstallfast_to_sqlRequirementsWritten for Python 3.8+Requires pandas, pyodbcExamplefromdatetimeimportdatetimeimportpandasaspdimportpyodbcfromfast_to_sqlimportfast_to_sql# Test Dataframe for insertiondf=pd.DataFrame({"Col1":[1,2,3],"Col2":["A","B","C"],"Col3":[True,False,True],"Col4":[datetime(2020,1,1),datetime(2020,1,2),datetime(2020,1,3)]})# Create a pyodbc connectionconn=pyodbc.connect("""Driver={ODBC Driver 17 for SQL Server};Server=localhost;Database=my_database;UID=my_user;PWD=my_pass;""")# If a table is created, the generated sql is returnedcreate_statement=fast_to_sql(df,"my_great_table",conn,if_exists="replace",custom={"Col1":"INT PRIMARY KEY"})# Commit upload actions and close connectionconn.commit()conn.close()UsageMain functionfast_to_sql(df,name,conn,if_exists="append",custom=None,temp=False,copy=False,clean_cols=True)df: pandas DataFrame to uploadname: String of desired name for the table in SQL serverconn: A valid pyodbc connection objectif_exists: Option for what to do if the specified table name already exists in the database. If the table does not exist a new one will be created. By default this option is set to 'append''append': Appends the dataframe to the table if it already exists in SQL server.'fail': Purposely raises aFailErrorif the table already exists in SQL server.'replace': Drops the old table with the specified name, and creates a new one.Be careful with this option, it will completely delete a table with the specified name in SQL server.custom: A dictionary object with one or more of the column names being uploaded as the key, and a valid SQL column definition as the value. The value must contain a type (INT,FLOAT,VARCHAR(500), etc.), and can optionally also include constraints (NOT NULL,PRIMARY KEY, etc.)Examples:{'ColumnName':'varchar(1000)'}{'ColumnName2':'int primary key'}temp: EitherTrueif creating a local sql server temporary table for the connection, orFalse(default) if not.copy: Defaults toFalse. If set toTrue, a copy of the dataframe will be made so column names of the original dataframe are not altered. Use this if you plan to continue to use the dataframe in your script after runningfast_to_sql.clean_cols: Defaults toTrue. If set toFalse, column names will not be cleaned when creating the table to insert the DataFrame into. If this is set toFalse, it is up to the caller of the function to make sure the names of the columns in the DataFrame are compatible with SQL Server.
Package: fast-trace
“fast_tracker” base on Apache SkyWalking Python agent and Newrelic Python:https://github.com/newrelic/newrelic-python-agenthttps://github.com/apache/skywalking-pythonInstallation$pipinstallfast-trackerUsage配置好配置文件FastTracker.json.Validate the agent configuration and test the connection to our data collector service.$FAST_CONFIG_FILE=FastTracker.jsonfast-adminrun-program$YOUR_COMMAND_OPTIONSExamples:$FAST_CONFIG_FILE=FastTracker.jsonFAST_STARTUP_DEBUG=truefast-adminrun-programhug-fapp.pyLicenseFAST for Python is free-to-use, proprietary software. Please see the LICENSE file in the distribution for details on the FAST License agreement and the licenses of its dependencies.CopyrightCopyright (c) 2019-2020 FAST, Inc. All rights reserved.
Package: fast-tracker
“fast_tracker” base on Apache SkyWalking Python agent and Newrelic Python:https://github.com/newrelic/newrelic-python-agenthttps://github.com/apache/skywalking-pythonInstallation$pipinstallfast-trackerUsage配置好配置文件FastTracker.json.Validate the agent configuration and test the connection to our data collector service.$FastTracker_ConfigPath=FastTracker.jsonfast-bootrun-program$YOUR_COMMAND_OPTIONSExamples:$FastTracker_ConfigPath=FastTracker.jsonFastTracker_Debug_Level=truefast-bootrun-programhug-fapp.pyLicenseFAST for Python is free-to-use, proprietary software. Please see the LICENSE file in the distribution for details on the FAST License agreement and the licenses of its dependencies.CopyrightCopyright (c) 2019-2020 FAST, Inc. All rights reserved.
Package: fasttrader
FastTrader: Empowering Financial AnalysisFastTrader is a pioneering tool designed to empower users in the dynamic world of quantitative financial analysis. At its core, FastTrader is built on a commitment to transparency and user-driven functionality. Unlike many other platforms, we provide complete visibility into the inner workings of our system, enabling you not only to utilize but also to comprehend every facet of your trading strategies.Democratizing Financial Decision-MakingWhat truly sets FastTrader apart is our dedication to democratizing financial decision-making. Our open-source approach ensures that everyone, from individual investors to professional analysts, has equal access to sophisticated tools. We foster a community where knowledge and resources are openly shared, creating an environment where financial analysis becomes accessible to all.Unmatched SpeedSpeed is paramount in financial analysis, and FastTrader excels in this regard. Leveraging the power of Numba, an advanced performance compiler, FastTrader accelerates numerous functions. This technological edge allows you to test potentially thousands of trading strategies in real-time, providing you with a significant advantage in today's fast-paced market.Join Us on the JourneyJoin us on this journey to reshape financial analysis. With FastTrader, your strategies are limited only by your imagination.DisclaimerDisclaimer:None of the research derived from this software constitutes financial advice. The contributors of this software shall not be held liable for its accuracy or the outcome of any decisions derived from the research produced by it.
Package: fasttrain
fasttrainWithfasttrainyou'll forever forget about ugly and complex training loops in PyTorch!Warning!fasttraincurrently is under heavy development...How do we start?Let's create a simple convnet just from thePyTorch tutorial:importtorchfromtorchimportnnfromtorch.utils.dataimportDataLoaderfromtorchvisionimportdatasetsfromtorchvision.transformsimportToTensorlearning_rate=1e-3batch_size=64epochs=5training_data=datasets.FashionMNIST(root="data",train=True,download=True,transform=ToTensor())test_data=datasets.FashionMNIST(root="data",train=False,download=True,transform=ToTensor())train_dataloader=DataLoader(training_data,batch_size=64)test_dataloader=DataLoader(test_data,batch_size=64)classNeuralNetwork(nn.Module):def__init__(self):super().__init__()self.flatten=nn.Flatten()self.linear_relu_stack=nn.Sequential(nn.Linear(28*28,512),nn.ReLU(),nn.Linear(512,512),nn.ReLU(),nn.Linear(512,10),)defforward(self,x):x=self.flatten(x)logits=self.linear_relu_stack(x)returnlogitsmodel=NeuralNetwork()Your next move will probably be building some kind of training and testing functions to, of course, train your model and show how effective it is, but let's forget about it, and use little help from theTrainerclass:fromfasttrainimportTrainerfromfasttrain.metricsimportaccuracyclassFashionMNISTTrainer(Trainer):defpredict(self,input_batch):(x_batch,_)=input_batchreturnself.model(x_batch)defcompute_loss(self,input_batch,output_batch):(_,y_batch)=input_batchreturnnn.CrossEntropyLoss()(output_batch,y_batch)defeval_metrics(self,input_batch,output_batch):(_,y_batch)=input_batchreturn{"accuracy":accuracy(output_batch,y_batch,task="multiclass")}WithTrainerall you have to do is specify how you predictions are made, how to compute loss and how to evaluate metrics (I hope you've seen that I've also importedaccuracymetric, isn't it just fancy?). The rest you have to do is specify the model optimizer and call thetrainfunction:fromfasttrain.callbacksimportTqdmoptimizer=torch.optim.SGD(model.parameters(),lr=learning_rate)trainer=FashionMNISTTrainer(model,optimizer)history=trainer.train(train_dataloader,val_data=test_dataloader,num_epochs=epochs,callbacks=[Tqdm(colab=True)])fasttraincomes with batteries and offers some useful "callbacks" - one of them isTqdmwhich shows a pretty-looking progress bar (colab=Trueoption is used 'cause I build this network in Google Colab, if you're using it locally you don't need to specify). Let's see how it looks:Did you see it? The first line printed tells us that we're using cuda - we never mentioned that, did we?Traineris smart enough to use cuda if it's enabled, but if you want you can specify device which you want to use intrain()with, for example, optiondevice='cpu'.train()also returns us the history of training. What is it? It contains kind of dict which by key returns metrics' statistics over epochs. So you can later use matplotlib to show them. Butfasttrainhas a better option: plot them right now!history.plot("loss",with_val=True)history.plot("accuracy",with_val=True)Pretty-looking metrics with graphs, remember, batteries ARE included!
Package: fasttran
fasttran is a simple tool using Translation Memory (TM) databases
to automate human text translations.  Unlike common Computer Aided
Translation (CAT) tools (OmegaT, for instance) fasttran has no
knobs to turn in the process of the translation.  Text segmentation,
TM operations et al. are all hidden under the cover; you just run
the translator, get back a half-translated document, and continue the
work with common text processor interface.fasttran was designed to suit freelance translators who find evolved
interface of existing CAT tools too complicated to learn and
operate.
Package: fast-transfer
Fast TransferAn easy and fast way to transfer files between mulitple users.
If you frequently run the commandpython -m http.server, you will like it.UsageShare a full path directoryfast-transfer /tmpShare a relative path directoryfast-transfer demoThen, you can visit the website athttp://192.168.x.x:5000Installationpip install fast-transferOPTIONSUsage: fast-transfer [OPTIONS] USERDATA

Options:
  -p, --port INTEGER  The port to bind to.  [default: 5000]
  --help              Show this message and exit.
Package: fast-transformer
Fast TransformerThis repo implementsFastformer: Additive Attention Can Be All You Needby Wu et al. in
TensorFlow.Fast Transformeris a Transformer variant based on additive attention that can handle long sequences
efficiently with linear complexity. Fastformer is much more efficient than many existing Transformer models and can
meanwhile achieve comparable or even better long text modeling performance.InstallationRun the following to install:pipinstallfast-transformerDeveloping fast-transformerTo installfast-transformer, along with tools you need to develop and test, run the following in your virtualenv:gitclonehttps://github.com/Rishit-dagli/Fast-Transformer.git# or clone your own forkcdfast-transformer
pipinstall-e.[dev]To run rank and shape tests run the following:python-mfast_transformer.test_fast_transformerUsageimporttensorflowastffromfast_transformerimportFastTransformermask=tf.ones([1,4096],dtype=tf.bool)model=FastTransformer(num_tokens=20000,dim=512,depth=2,max_seq_len=4096,absolute_pos_emb=True,# Absolute positional embeddingsmask=mask)x=tf.experimental.numpy.random.randint(0,20000,(1,4096))logits=model(x)# (1, 4096, 20000)Want to Contribute 🙋‍♂️?Awesome! If you want to contribute to this project, you're always welcome! SeeContributing Guidelines. You can also take a look atopen issuesfor getting more information about current or upcoming tasks.Want to discuss? 💬Have any questions, doubts or want to present your opinions, views? You're always welcome. You canstart discussions.Citation@misc{wu2021fastformer,title={Fastformer: Additive Attention is All You Need},author={Chuhan Wu and Fangzhao Wu and Tao Qi and Yongfeng Huang},year={2021},eprint={2108.09084},archivePrefix={arXiv},primaryClass={cs.CL}}Yannic Kilcher's videowas super helpful while building this.LicenseCopyright 2020 Rishit Dagli

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Package: fasttrees
fasttreesPackages and ReleasesBuild StatusTest CoverageOther InformationA fast-and-frugal-tree classifier based on Python's scikit learn.Fast-and-frugal trees are classification trees that are especially useful for making decisions under uncertainty.
Due their simplicity and transparency they are very robust against noise and errors in data.
They are one of the heuristics proposed by Gerd Gigerenzer inFast and Frugal Heuristics in Medical Decision. This particular implementation is based on on the R packageFFTrees, developed by Phillips, Neth, Woike and Grassmaier.InstallYou can install fasttrees usingpip install fasttreesQuick first startBelow we provide a qick first start example with fast-and-frugal trees. We use the populariris flower data set (also known as the Fisher's Iris data set), split it into a train and test data set, and fit a fast-and-frugal tree classifier on the training data set. Finally, we get the score on the test data set.fromsklearnimportdatasets,model_selectionfromfasttreesimportFastFrugalTreeClassifier# Load data setiris_dict=datasets.load_iris(as_frame=True)# Load training data, preprocess it by transforming y into a binary classification problem, and# split into train and test data setX_iris,y_iris=iris_dict['data'],iris_dict['target']y_iris=y_iris.apply(lambdaentry:entryin[0,1]).astype(bool)X_train_iris,X_test_iris,y_train_iris,y_test_iris=model_selection.train_test_split(X_iris,y_iris,test_size=0.4,random_state=42)# Fit and test fitted treefftc=FastFrugalTreeClassifier()fftc.fit(X_train_iris,y_train_iris)fftc.score(X_test_iris,y_test_iris)
Package: fast-trees
Fast TreesCute little python module that sits atop the tree-sitter library to provide an easier to use and cleaner interface for interacting with source codeInstallpip install fast-treesHow to useEasily work with source code data by using the high level API. Here's how you can grab the parameters of a java method:mthd="""public static void main(String[] args, Object clazz) {// This is a testSystem.out.println(args[0]);/**This is another test!*/}"""parser=FastParser("java")print(parser.get_method_parameters(mthd))Repo already exists, continuing.
['args', 'clazz']inline_comments=parser.get_method_inline_comments(mthd)forcininline_comments:print(c)// This is a test
/**
        This is another test!
    */Supported LanguagesJavaTODOAdd ability to grab method parametersAdd separation between parsing methods vs classesAdd ability to get all methods in a classadd ability to get all instance variables in a classAdd more languages
Package: fasttreeshap
FastTreeSHAP package implements two new algorithms FastTreeSHAP v1 and FastTreeSHAP v2, to improve the computational efficiency of TreeSHAP for large datasets. In practice FastTreeSHAP v1 is 1.5x faster than TreeSHAP while keeping the memory cost unchanged, and FastTreeSHAP v2 is 2.5x faster than TreeSHAP at the cost of a slightly higher memory usage.
Package: fast-tsp
fast-tspA library for computing near optimal solution to large instances of the TSP (Travelling Salesman Problem) fast using a local solver. The library is written in C++ and provides Python bindings.QuickstartFirst install the library$pipinstallfast-tspThen run the problem on your 2D distance matrix:importfast_tspdists=[[0,63,72,70],[63,0,57,53],[72,57,0,4],[70,53,4,0],]tour=fast_tsp.find_tour(dists)print(tour)# [0, 1, 3, 2]DocumentationDocumentation can be found athttps://fast-tsp.readthedocs.io/.You can build the documentation bycding todocs/and runningmake clean && make html.LicenseThis library usespybind11which is provided under a BSD-style license that can be found in the LICENSE file. By using, distributing, or contributing to this project, you agree to the terms and conditions of this license.
Package: fastui-chat
fastui-chatA minimalistic ChatBot Interface in pure python.Build on top ofFastUIandLangChain Core.Usagepipinstallfastui-chatfromfastui_chatimportChatUI# chatui inherits from FastAPI so you can use it as a FastAPI appapp=ChatUI()# Run with:# uvicorn examples.minimal:app# for hot reloading:# uvicorn examples.minimal:app --reload# or use the built-in methodif__name__=="__main__":app.start_with_uvicorn()Extend FastAPIYou can also only use the router and extend your existing FastAPI app.fromfastapiimportFastAPIfromfastui_chatimportcreate_chat_handler,create_history_factoryfromfastui_chat.chatimportChatAPIRouterfromfastui_chat.historyimportInMemoryChatMessageHistoryfromfastui_chat.runtimeimportrouterasfastui_runtime# callable that returns a ChatMessageHistory given a session_idhistory_factory=create_history_factory(# swap out with any from langchain_community.chat_message_historiesInMemoryChatMessageHistory,)# a chat handler generates an AIMessage based on a given HumanMessage and ChatHistorychat_handler=create_chat_handler(llm="openai/gpt-4-turbo-preview",history_factory=history_factory,)# setup your fastapi appapp=FastAPI()# add the chatui router to your appapp.include_router(ChatAPIRouter(history_factory,chat_handler),prefix="/api",)# make sure to add the runtime router as latest since it has a catch-all routeapp.include_router(fastui_runtime)# start the server with `uvicorn examples.fastapi_router:app`FeaturesPython OnlyEasy to useMinimalistic & LightweightLangChain CompatibleFastAPI CompatibleParallel Chat SessionsSwitchable ChatHistory BackendsInsert your custom chat handlerDevelopment Setupgitclonehttps://github.com/shroominic/fastui-chat.git&&cdfastui-chat

./dev-install.shRoadmapIf you want to contribute or see whats coming soon checkout theroadmap.todofile for open todos.