Fine-Tuning OpenAI Models for Retrieval Augmented Generation (RAG) with Qdrant and Few-Shot Learning
import os from qdrant_client import QdrantClient from qdrant_client.http import models from qdrant_client.http.models import PointStruct from qdrant_client.http.models import Distance, VectorParams Now that we've the Qdrant imports in place, qdrant_client = QdrantClient( url=os.getenv("QDRANT_URL"), api_key=os.getenv("QDRANT_API_KEY"), timeout=6000, prefer_grpc=True ) collection_name = "squadv2-cookbook" # # Create the collection, run this only once # qdrant_client.recreate_collection( # collection_name=collection_name, # vectors_config=VectorParams(size=384, distance=Distance.COSINE), # ) from fastembed.embedding import DefaultEmbedding from typing import List import numpy as np import pandas as pd from tqdm.notebook import tqdm tqdm.pandas() embedding_model = DefaultEmbedding()