Skip to content

Instantly share code, notes, and snippets.

@D-Ogi
D-Ogi / api_ooobabooga_sql_generate_tags_json.py
Created May 12, 2023 16:35
Using API of Ooobabooga LLM text-generation-webui to mass generate tags (or captions) in JSON based on file's full path
import sqlite3 # Paths are stored in local SQLITE3 database
import requests
import json
import ast
# API endpoint for generating captions
#API_ENDPOINT = "https://martin-mostly-long-maiden.trycloudflare.com/api/v1/generate"
API_ENDPOINT = "http://127.0.0.1:5000/api/v1/generate"
# Function to fetch records from the database