mirror of
https://github.com/HiMeditator/auto-caption.git
synced 2026-02-11 10:04:47 +08:00
feat功能): 完善字幕引擎并添加字幕记录导出功能
- 丰富了 README.md 文件,介绍了字幕引擎的原理和构建方法 - 更新了 .gitignore 文件,排除了 build 目录 - 移除了 python-prototype 和 python-subprocess 目录下的无用代码 - 添加了字幕记录导出功能,用户可以将字幕数据导出为 JSON 文件 - 调整了字幕控制面板,移除了未使用的 Whisper 引擎选项
This commit is contained in:
@@ -1,63 +0,0 @@
|
||||
{
|
||||
"cells": [
|
||||
{
|
||||
"cell_type": "code",
|
||||
"execution_count": null,
|
||||
"id": "4604aefd",
|
||||
"metadata": {},
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stdout",
|
||||
"output_type": "stream",
|
||||
"text": [
|
||||
"Received: {\"message\":\"Electron Initialized\"}\n",
|
||||
"Client disconnected\n"
|
||||
]
|
||||
}
|
||||
],
|
||||
"source": [
|
||||
"import asyncio\n",
|
||||
"import websockets\n",
|
||||
"import nest_asyncio\n",
|
||||
"import json\n",
|
||||
"\n",
|
||||
"# 应用补丁,允许在 Jupyter 中运行嵌套事件循环\n",
|
||||
"nest_asyncio.apply()\n",
|
||||
"\n",
|
||||
"async def handle_client(websocket, path=\"/\"):\n",
|
||||
" try:\n",
|
||||
" async for message in websocket:\n",
|
||||
" print(f\"Received: {message}\")\n",
|
||||
" await websocket.send(json.dumps({\"message\": \"Hello from server!\"}))\n",
|
||||
" except websockets.exceptions.ConnectionClosed:\n",
|
||||
" print(\"Client disconnected\")\n",
|
||||
"\n",
|
||||
"start_server = websockets.serve(handle_client, \"localhost\", 8765)\n",
|
||||
"\n",
|
||||
"asyncio.get_event_loop().run_until_complete(start_server)\n",
|
||||
"asyncio.get_event_loop().run_forever()"
|
||||
]
|
||||
}
|
||||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "mystd",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.10.12"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
"nbformat_minor": 5
|
||||
}
|
||||
Reference in New Issue
Block a user