Skip to content

Clarifai/examples

Repository files navigation

Clarifai Python SDK and Integrations Examples

This is a collection of examples for the clarifai-python SDK and Integrations done with Clarifai SDK. Use these examples to learn Clarifai and build your own robust and scalable AI applications.

Experience the power of Clarifai in building Computer Vision , Natual Language processsing , Generative AI applications.

Website | Schedule Demo | Signup for a Free Account | API Docs | Clarifai Community | Python SDK Docs | Examples | Colab Notebooks | Discord

Setup

  • Sign up for a free account at clarifai and set your PAT key.

  • Install the Clarifai python sdk.

  • Export your PAT as an environment variable.

    export CLARIFAI_PAT={your personal access token}
  • Explore and run the examples in this repo.

Usage

The examples are organized into several folders based on their category. A quick example below,

from clarifai.client.dataset import Dataset
dataset = Dataset(user_id="user_id", app_id="app_id", dataset_id="dataset_id")
dataset.upload_dataset(task="text_clf", split="train", module_dir="path_to_imdb_reviews_module")

SDK Notebooks

Function Notebook Open in Colab
Basics Basics Open in Colab
Datasets Input Upload Open in Colab
Dataset Upload Open in Colab
Dataset Export Open in Colab
Workflows Create Workflow Open in Colab
Export Workflow Open in Colab
Model Predict Model Predict Open in Colab
Model Training Image Classification Training Open in Colab
Text Classification Training Open in Colab
Image Detection Training Open in Colab
Image Segmentation Training Open in Colab
Transfer Learn Training Open in Colab
Model Evaluation Embedding Classifier Open in Colab
Text Classifier Open in Colab
Visual Classifier Open in Colab
Visual Detector Open in Colab
Search Vector Search Open in Colab
RAG RAG Open in Colab

Integrations Notebooks

Integration Function Notebook Open in Colab
Langchain Chains Prompt Templates and Chains Open in Colab
Retrieval QA Chain Open in Colab
Router Chain Open in Colab
PostgreSQL LLM Open in Colab
Agents Conversational Agent Open in Colab
ReAct Docstore Agent Open in Colab
Unstructured.io Github Data Ingestion Open in Colab
S3 Data Ingestion Open in Colab
DropBox Data Ingestion Open in Colab

Data Utils Notebooks

Data Util Function Notebook Open in Colab
Image Image Annotation annotation loader Open in Colab

Model upload examples

How to start

Please refer to this doc

Examples

Model type Example
multimodal-embedder CLIP
text-classifier xlm-roberta
text-embedder instructor-xl
text-to-image sd-v1.5
text-to-text bart-summarize, vllm model
visual_classsifier age_vit
visual_detector yolof, faster-rcnn_torchserve
visual_embedder vit-base
visual_segmenter segformer-b2

Note

Although these scripts are run on your local machine, they'll communicate with Clarifai and run in our cloud on demand.

Examples provide a guided tour through Clarifai's concepts and capabilities. contains uncategorized, miscellaneous examples.