Coder Social home page Coder Social logo

fxnai / fxn Goto Github PK

View Code? Open in Web Editor NEW
38.0 1.0 5.0 877 KB

Run Python functions on desktop, mobile, web, and in the cloud. Register at https://fxn.ai

Home Page: https://docs.fxn.ai

License: Apache License 2.0

Python 99.68% Jupyter Notebook 0.32%
ai deep-learning machine-learning numpy pytorch serverless serverless-gpu

fxn's Introduction

Function for Python and CLI

function logo

Dynamic JSON Badge

Run AI prediction functions (a.k.a "predictors") in your Python apps. With Function, you can build AI-powered apps by creating and composing GPU-accelerated predictors that run in the cloud. In a few steps:

Installing Function

Function is distributed on PyPi. This distribution contains both the Python client and the command line interface (CLI). To install, open a terminal and run the following command:

# Install Function
$ pip install --upgrade fxn

Note

Function requires Python 3.9+

Retrieving your Access Key

Head over to fxn.ai to create an account by logging in. Once you do, generate an access key:

generate access key

Making a Prediction

Let's run the @samples/stable-diffusion predictor which accepts a text prompt and generates a corresponding image. Run the following Python script:

from fxn import Function

# Create the Function client
fxn = Function(access_key="<ACCESS KEY>")
# Create a prediction
prediction = fxn.predictions.create(
    tag="@samples/stable-diffusion",
    inputs={
        "prompt": "An astronaut riding a horse on Mars"
    }
)
# Show the generated image
image = prediction.results[0]
image.show()

Tip

Explore public predictors on Function or create your own.

Using the Function CLI

Open up a terminal and run the following command:

# Login to Function
fxn auth login <ACCESS KEY>

# Make a prediction using the Function CLI
fxn predict @samplefxn/stable-diffusion \
  --prompt "An astronaut riding a horse on the moon"

Within a few seconds, you should see a creepy-looking image pop up 😅:

prediction


Useful Links

Function is a product of NatML Inc.

fxn's People

Contributors

olokobayusuf avatar

Stargazers

Shunyo Kawamoto avatar Ryan Sudhakaran avatar Juri Sefa avatar Nick S. B. avatar  avatar Johnny Jiang avatar 0xYYY avatar Jarrian Gojar avatar Adam avatar  avatar Burkay Gur avatar  avatar Chenglei Niu avatar Vincent avatar  avatar Carlo Moro avatar  avatar  avatar Kenneth Henry avatar Sandalots avatar Amit Kumar Rout avatar John Casey avatar Linh T. Duong avatar Minh Hoang avatar Li Jie avatar 爱可可-爱生活 avatar ZeroXClem avatar GRATITUD3.ETH avatar Juan Pablo Manson avatar Mike Frager avatar Sani avatar Lingyue Pan avatar Edward avatar  avatar Mark Kretschmann avatar Daniel avatar  avatar tracyhenry avatar

Watchers

 avatar

fxn's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.