Merge pull request #641 from harry0703/dev

update
This commit is contained in:
Harry
2025-05-08 17:39:44 +08:00
committed by GitHub
4 changed files with 16 additions and 47 deletions

View File

@@ -120,16 +120,12 @@
下载一键启动包,解压直接使用(路径不要有 **中文**、**特殊字符**、**空格**
### Windows
- 百度网盘1.2.1 最新版本): https://pan.baidu.com/s/1pSNjxTYiVENulTLm6zieMQ?pwd=g36q 提取码: g36q
- 百度网盘1.2.1 版本): https://pan.baidu.com/s/1pSNjxTYiVENulTLm6zieMQ?pwd=g36q 提取码: g36q
下载后,建议先**双击执行** `update.bat` 更新到**最新代码**,然后双击 `start.bat` 启动
启动后,会自动打开浏览器(如果打开是空白,建议换成 **Chrome** 或者 **Edge** 打开)
### 其他系统
还没有制作一键启动包,看下面的 **安装部署** 部分,建议使用 **docker** 部署,更加方便。
## 安装部署 📥
### 前提条件
@@ -143,7 +139,7 @@
git clone https://github.com/harry0703/MoneyPrinterTurbo.git
```
#### ② 修改配置文件
#### ② 修改配置文件(可选,建议启动后也可以在 WebUI 里面配置)
-`config.example.toml` 文件复制一份,命名为 `config.toml`
- 按照 `config.toml` 文件中的说明,配置好 `pexels_api_keys``llm_provider`,并根据 llm_provider 对应的服务商,配置相关的
@@ -293,33 +289,6 @@ MoneyPrinterTurbo
## 常见问题 🤔
### ❓如何使用免费的OpenAI GPT-3.5模型?
[OpenAI宣布ChatGPT里面3.5已经免费了](https://openai.com/blog/start-using-chatgpt-instantly)有开发者将其封装成了API可以直接调用
**确保你安装和启动了docker服务**执行以下命令启动docker服务
```shell
docker run -p 3040:3040 missuo/freegpt35
```
启动成功后,修改 `config.toml` 中的配置
- `llm_provider` 设置为 `openai`
- `openai_api_key` 随便填写一个即可,比如 '123456'
- `openai_base_url` 改为 `http://localhost:3040/v1/`
- `openai_model_name` 改为 `gpt-3.5-turbo`
> 注意:该方式稳定性较差
### ❓AttributeError: 'str' object has no attribute 'choices'`
这个问题是由于大模型没有返回正确的回复导致的。
大概率是网络原因, 使用 **VPN**,或者设置 `openai_base_url` 为你的代理 ,应该就可以解决了。
同时建议使用 **Moonshot****DeepSeek** 作为大模型提供商,这两个服务商在国内访问速度更快,更加稳定。
### ❓RuntimeError: No ffmpeg exe could be found
通常情况下ffmpeg 会被自动下载,并且会被自动检测到。

View File

@@ -289,8 +289,8 @@ def generate_video(
bg_color=params.text_background_color,
stroke_color=params.stroke_color,
stroke_width=params.stroke_width,
interline=interline,
size=size,
# interline=interline,
# size=size,
)
duration = subtitle_item[0][1] - subtitle_item[0][0]
_clip = _clip.with_start(subtitle_item[0][0])

View File

@@ -6,7 +6,7 @@ services:
build:
context: .
dockerfile: Dockerfile
container_name: "webui"
container_name: "moneyprinterturbo-webui"
ports:
- "8501:8501"
command: [ "streamlit", "run", "./webui/Main.py","--browser.serverAddress=127.0.0.1","--server.enableCORS=True","--browser.gatherUsageStats=False" ]
@@ -16,7 +16,7 @@ services:
build:
context: .
dockerfile: Dockerfile
container_name: "api"
container_name: "moneyprinterturbo-api"
ports:
- "8080:8080"
command: [ "python3", "main.py" ]

View File

@@ -57,6 +57,16 @@ i18n_dir = os.path.join(root_dir, "webui", "i18n")
config_file = os.path.join(root_dir, "webui", ".streamlit", "webui.toml")
system_locale = utils.get_system_locale()
if "video_subject" not in st.session_state:
st.session_state["video_subject"] = ""
if "video_script" not in st.session_state:
st.session_state["video_script"] = ""
if "video_terms" not in st.session_state:
st.session_state["video_terms"] = ""
if "ui_language" not in st.session_state:
st.session_state["ui_language"] = config.ui.get("language", system_locale)
# 加载语言文件
locales = utils.load_locales(i18n_dir)
@@ -97,16 +107,6 @@ support_locales = [
"th-TH",
]
if "video_subject" not in st.session_state:
st.session_state["video_subject"] = ""
if "video_script" not in st.session_state:
st.session_state["video_script"] = ""
if "video_terms" not in st.session_state:
st.session_state["video_terms"] = ""
if "ui_language" not in st.session_state:
st.session_state["ui_language"] = config.ui.get("language", system_locale)
def get_all_fonts():
fonts = []
for root, dirs, files in os.walk(font_dir):