Install new library
Installing New Libraries in Your Float16 Remote Instance
Last updated
Installing New Libraries in Your Float16 Remote Instance
Last updated
This tutorial will guide you through adding new libraries to your Float16 remote instance. Since the remote instance starts as an empty container, you need to install libraries before running your code.
This example scenario, we'll use a script 'cat.py' that imports the 'requests' library to fetch data from a cat fact API.
While you can simply use pip install requests
on your local machine, the process is different for the remote instance.
Create a requirements.txt file to specify dependencies.
This command creates both 'float16.conf' and 'requirements.txt' files.
Open 'requirements.txt' and add the following
This specifies the library name and the version you want to install.
Start the container, which automatically installs packages listed in 'requirements.txt'
After starting the project and successfully installing packages, you might find that the installed version doesn't match your local version. This could potentially affect your code. Here's how to update
To upgrade the version (e.g., from '2.31.0' to '2.32.3'), edit 'requirements.txt'
Update package dependencies
Execute your script
Example output (The response is randomly generated, so you may see a different cat fact.):
Congratulations! You've become proficient in installing new libraries in your Float16 remote instance.
Learn how to use Float16 CLI for various use cases in our tutorials.
Happy coding with Float16 Serverless GPU!
Hello World
Launch your first serverless GPU function and kickstart your journey.
Install new library
Enhance your toolkit by adding new libraries tailored to your project needs.
Copy output from remote
Efficiently transfer computation results from remote to your local storage.
Deploy FastAPI Helloworld
Quick start to deploy FastAPI without change the code.
Upload and Download via CLI and Website
Direct upload and download file(s) to server.
More examples
Open source from community and Float16 team.