Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fal-ai/fal-serverless-hackathon
https://github.com/fal-ai/fal-serverless-hackathon
Last synced: about 10 hours ago
JSON representation
- Host: GitHub
- URL: https://github.com/fal-ai/fal-serverless-hackathon
- Owner: fal-ai
- Created: 2023-05-05T15:37:29.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-05-05T16:14:51.000Z (over 1 year ago)
- Last Synced: 2024-12-15T22:43:41.273Z (8 days ago)
- Language: Python
- Size: 1.95 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# fal-serverless Example with GPT4All
In here, you will find 3 examples of how to deploy GPT4All on fal-serverless
To get started:
```bash
$ pip install fal-serverless # Installs fal-serverless
$ fal-serverless auth login # Creates an account and logs in to fal-serverless$ git clone [email protected]:fal-ai/fal-serverless-hackathon.git
$ cd fal-serverless-hackathon/gpt4all
$ python gpt4all_simple.py
```The `gpt4all_simple.py` example is the most basic way of running gpt4all on fal-serverless. It takes in a prompt and returns a completion.
You can call this function as if it's a local function.`gpt4all_cached.py` introduces the `cached` decorator that allows you to cache the results of a function. This is useful if you want to cache the results of a function that takes a long time to run. In this case, the model instance can be cached.
`gpt4all_served.py` introduces the `serve` attribute that turns an isolated function into a web endpoint. With this, you can call a function as a RESTful endpoint. This endpoint will autoscale.