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 json | |
from mlx_lm.utils import load, generate_step | |
import mlx.core as mx | |
from fastapi import FastAPI, HTTPException, Depends, Request | |
from fastapi.middleware.cors import CORSMiddleware | |
from pydantic import BaseModel | |
from mlx_lm import load, generate | |
import asyncio | |
from typing import List | |
from starlette.responses import StreamingResponse # Add this import |
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 { readdirSync, readFileSync } from "fs"; | |
import { join } from "path"; | |
function listContentsAndAnalyzeDurations(directoryPath: string) { | |
const filesAndFolders = readdirSync(directoryPath, { withFileTypes: true }); | |
let totalRecordings = 0; | |
let durations_milliseconds: number[] = []; | |
let totalCharacters = 0; | |
let totalWords = 0; |