Use OpenAudible.
- Install Python 3
Use OpenAudible.
| 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): |
| 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, | |
| }); |
| // 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); |
| import requests | |
| import json | |
| import gradio as gr | |
| url = "http://localhost:11434/api/generate" | |
| headers = { | |
| 'Content-Type': 'application/json', | |
| } |
| import json | |
| import os | |
| import ollama | |
| def query_ollama(prompt, model='openhermes:7b-mistral-v2.5-q6_K', context=''): | |
| response = ollama.generate( | |
| model=model, | |
| prompt=context + prompt) | |
| return response['response'].strip() |
Apple restricted the access to Xcode LLM (Predictive code completion) feature on China models of Mac. This guide provides a way to bypass that restriction. It's verified on macOS 15.0 Beta (24A5264n), but there is no guarentee that it will always work on later macOS versions.
csrutil enable --without debug command in recovery mode).