Logo Stefano Giannini
  • Home
  • About
  • Skills
  • Experiences
  • Education
  • Posts
  • Notes
Logo Inverted Logo
  • Tags
  • Computer Vision
  • Deep Learning
  • Finance
  • Forecasting
  • Machine Learning
  • NLP
  • Options
  • Physics
  • Quantum
  • Science
  • Statistics
Hero Image
Gemma-2 + RAG + LlamaIndex + VectorDB

Open in: 1. Introduction Retrieval-Augmented Generation (RAG) is an advanced AI technique that enhances large language models (LLMs) with the ability to access and utilize external knowledge. This guide will walk you through a practical implementation of RAG using Python and various libraries, explaining each component in detail. 2. Setup and Import %pip install transformers accelerate bitsandbytes flash-attn faiss-cpu llama-index -Uq %pip install llama-index-embeddings-huggingface -q %pip install llama-index-llms-huggingface -q %pip install llama-index-embeddings-instructor llama-index-vector-stores-faiss -q import contextlib import os import torch device = torch.

  • Deep Learning
  • NLP
  • Machine Learning
Sunday, July 14, 2024 | 14 minutes Read
Hero Image
Florence-2 - Vision Foundation Model - Examples

Install dependencies Type the following command to install possible needed dependencies (especially if the inference is performed on the CPU) %pip install einops flash_attn In Kaggle, transformers and torch are already installed. Otherwise you also need to install them on your local PC. Import Libraries from transformers import AutoProcessor, AutoModelForCausalLM from PIL import Image import requests import copy import torch %matplotlib inline Import the model We can choose Florence-2-large or Florence-2-large-ft (fine-tuned).

  • Deep Learning
  • Computer Vision
  • Machine Learning
Tuesday, June 25, 2024 | 5 minutes Read

Liability Notice: This website is done experimentally by me, taking inspiration from the open-source Toha-Hugo theme.


Toha Theme Logo Toha
© 2024 Copyright.
Powered by Hugo Logo