GithubHelp home page GithubHelp logo

8bit-auto-embeddings's Introduction

8Bit Auto Embeddings

Description

The 8Bit Auto Embeddings repository contains the backend and machine learning embeddings components used in the 8Bit Auto web application. It uses FastAPI for creating a RESTful API and ChromaDB for managing and querying embedded data.

Features

  • FastAPI for efficient and easy-to-document API routes.
  • ChromaDB integration for persistent storage of embedding vectors.
  • Sentence-Transformer models for generating embeddings from text data.

Getting Started

These instructions will guide you through setting up the project locally for development and testing.

Prerequisites
  • Python 3.8+
  • FastAPI
  • Uvicorn (ASGI server)
  • ChromaDB
  • Sentence Transformers
Installation
  1. Clone the repository:
    git clone https://github.com/sb2bg/8bit-auto-embeddings.git
  2. Navigate to the project directory:
    cd 8bit-auto-embeddings
  3. Install the required Python packages:
    pip install -r requirements.txt
Running the API Server
  1. Start the Uvicorn server:
    uvicorn main:app --reload
    The server will run on http://127.0.0.1:8000 and is accessible via browser or API testing tools like Postman.

Generating Embeddings

To generate embeddings using chroma_embedder.py, follow these steps:

  1. Ensure data.csv is in the repository root, formatted with any columns, as long as it includes excerpt, which is the text data to be embedded.
  2. Run chroma_embedder.py:
    python chroma_embedder.py
    This script uses the SentenceTransformer model to convert titles from data.csv into embeddings, storing them in a ChromaDB collection named cars which is persisted in the chroma.db folder.

API Documentation

Once the server is running, you can access the API documentation automatically generated by FastAPI at http://127.0.0.1:8000/docs. This documentation provides interactive endpoints where you can test the API functionalities directly.

However, the following endpoints are available:

  • GET /chat/{car_str} or /chat/{car_str}?n_results={n_results}
    • Description: Retrieve the n_results (default 5) nearest embedding vector for a given car string.
    • Query Parameters:
      • car_str (str): The car description for which to retrieve the embeddings.
      • n_results (int): The number of nearest embeddings to return (default: 5).
    • Returns: - [{current_bid_formatted: string, excerpt: string,thumbnail_url: string, title: string}]: A list of the nearest car vector matches for the given car string.

Usage

  • Use the API to retrieve, update, embedding records.
  • Interact with the ChromaDB to query embedding vectors based on textual inputs.
  • Generate embeddings from text data using the SentenceTransformer model.

License

This project is licensed under the MIT License - see the LICENSE file for details.

8bit-auto-embeddings's People

Contributors

sb2bg avatar

Watchers

 avatar

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.