This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import sqlite3 | |
| import re | |
| import time | |
| import uuid | |
| import glob | |
| from flask import Flask, render_template_string, request, url_for, session | |
| from werkzeug.utils import secure_filename | |
| from typing import Union |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| from flask import Flask, render_template_string, request, redirect, url_for, flash, jsonify, make_response | |
| from flask_sqlalchemy import SQLAlchemy | |
| import chromadb | |
| from sentence_transformers import SentenceTransformer | |
| from datetime import datetime | |
| import mistune # New library for Markdown | |
| from markupsafe import escape, Markup | |
| # --- App & Database Configuration --- | |
| app = Flask(__name__) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| from flask import Flask, request, render_template, redirect, flash, url_for, render_template_string | |
| from moviepy.editor import ImageSequenceClip | |
| app = Flask(__name__) | |
| app.config['UPLOAD_FOLDER'] = os.path.join(app.root_path, 'static/uploads') | |
| app.secret_key = 'your_secret_key' #Replace with a strong, randomly generated secret key | |
| @app.route('/', methods=['GET', 'POST']) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import httpx | |
| import json | |
| import os | |
| import re | |
| import sqlite3 | |
| from datetime import datetime | |
| from fastapi import FastAPI, Form, HTTPException, BackgroundTasks, Request | |
| from fastapi.responses import StreamingResponse, HTMLResponse | |
| from icecream import ic | |
| # --- LangChain & Database Imports --- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # CONV is ffmpeg via docker | |
| Path=$1 | |
| echo "Processing directory: $Path" | |
| # Ensure the path ends with a slash | |
| if [[ "$Path" != */ ]]; then | |
| Path="$Path"/ | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from PIL import Image, ImageDraw, ImageFont | |
| import subprocess | |
| import textwrap | |
| from icecream import ic | |
| #-------------------- | |
| def get_mp3_duration(mp3_path): | |
| cmd = [ | |
| "ffprobe", "-v", "error", | |
| "-show_entries", "format=duration", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from balacoon_tts import TTS | |
| import soundfile as sf | |
| import numpy as np | |
| import traceback | |
| import os | |
| import subprocess | |
| import re | |
| from icecream import ic | |
| import sys | |
| # >>> ============================================================ <<< |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Guide: Generating and Using Topic-Specific Learning Assistant Backend | |
| https://github.com/JupyterJones/frontend | |
| This document outlines how to use the Flask-based App Generator to create new topic-specific FastAPI Backend Applications for your learning assistant project.1. OverviewThe system consists of two main Python scripts:Flask App Generator (app_builder.py - your second script):A Flask web application that provides a user interface to input a topic name and a structured prompt.It uses a master template (template_app_v2.py) to generate a new, customized FastAPI backend application tailored to the specified topic.It also creates necessary directories and the topic-specific structured prompt file.FastAPI Backend Template (template_app_v2.py - your first script):A comprehensive FastAPI application template designed to serve as a backend for a learning assistant.It includes features like Q&A with Gemini, conversation history, file management, vector search with ChromaDB, context-enhanced responses, conversati |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python3 | |
| import sys | |
| import sqlite3 | |
| DATABASE = "notes.db" | |
| conn = sqlite3.connect(DATABASE) | |
| from datetime import datetime | |
| conn.text_factory = str | |
| c = conn.cursor() | |
| if len(sys.argv) < 3: | |
| print ("\n******* NOTE - Notes Editor ******") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import subprocess | |
| import numpy as np | |
| import logging | |
| import glob | |
| import random | |
| import uuid | |
| # Set up logging | |
| logging.basicConfig(level=logging.INFO, format='%(levelname)s - %(message)s') | |
| def zoom_pan_nonlinear1(input_path, output_path): |