Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.
| import requests | |
| import json | |
| import gradio as gr | |
| url = "http://localhost:11434/api/generate" | |
| headers = { | |
| 'Content-Type': 'application/json', | |
| } |
| // WARNING:此脚本仅做学习和演示用途,在不了解其用途前不建议使用 | |
| // 本脚本的用途是将输入内容分页,每次提取一页内容,编辑第二条消息,发送,然后收集结果 | |
| // 使用前,需要有两条消息,参考模板 https://chat.openai.com/share/17195108-30c2-4c62-8d59-980ca645f111 | |
| // 演示视频: https://www.bilibili.com/video/BV1tp4y1c7ME/?vd_source=e71f65cbc40a72fce570b20ffcb28b22 | |
| // | |
| (function (fullText) { | |
| const wait = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); | |
| const groupSentences = (fullText, maxCharecters = 2800) => { | |
| const sentences = fullText.split("\n").filter((line) => line.trim().length > 0); |
| const Anthropic = require('@anthropic-ai/sdk'); | |
| const path = require('path'); | |
| const YAML = require('yaml'); | |
| const fs = require('fs'); | |
| // Initialize Anthropic SDK | |
| const anthropic = new Anthropic({ | |
| apiKey: process.env.ANTHROPIC_API_KEY, | |
| }); |
| import json | |
| import os | |
| import requests | |
| OPENAI_API_KEY = os.environ.get("OPENAI_API_KEY") | |
| OPENAI_BASE_URL = "https://api.openai.com/v1/chat/completions" | |
| def translator(srt): |
Use OpenAudible.