This file contains 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
const BASE_BACKEND_URL = window.location.protocol + '//' + window.location.host; | |
const fileInput = document.getElementById('fileInput'); | |
const uploadButton = document.getElementById('uploadButton') | |
const closeUploadModalButton = document.getElementById('closeUploadModalButton'); // the upload box is in a modal | |
const progressBar = document.getElementById('uploadProgressBar'); | |
uploadButton.disabled = false; | |
let xhr; | |
const getBaseConfig = (method) => ({ |
This file contains 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
# Adapted from | |
# https://github.com/lm-sys/FastChat/blob/168ccc29d3f7edc50823016105c024fe2282732a/fastchat/serve/openai_api_server.py | |
import argparse | |
import asyncio | |
import json | |
import os | |
import time | |
from http import HTTPStatus | |
from typing import AsyncGenerator, Dict, List, Optional, Tuple, Union |
This file contains 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 datetime | |
import platform | |
import subprocess | |
import sys | |
import asyncio | |
import websockets | |
import numpy as np | |
from typing import Tuple, Optional, Union |
This file contains 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 asyncio | |
from typing import List | |
import numpy as np | |
from fastapi import FastAPI, WebSocket, WebSocketDisconnect | |
import torch | |
from transformers import AutoModelForSpeechSeq2Seq, AutoProcessor, pipeline | |
This file contains 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 argparse | |
import requests | |
import gradio as gr | |
def http_bot(prompt, model_input, api_key, temperature, max_tokens, top_p): | |
headers = {"User-Agent": "vLLM Client"} | |
payload = dict( | |
model=model_input, | |
api_key=api_key, |
This file contains 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
def estimate_none_timestamps(timestamp_list): | |
""" | |
Estimates missing timestamps in a list of timestamp segments based on the character length of segment times. | |
Parameters: | |
timestamp_list (list): A list of timestamp segments with text. | |
Returns: | |
list: The list with estimated missing timestamps. | |
""" |