HuggingMahiro/Tavern
0
1### huggingface 部署酒馆教程 (带对话记录同步功能)2 3#### 准备工作41. 用于同步数据的github仓库52. 用户同步数据的github凭证63. 下载初始酒馆项目74. huggingface账号(略)8 9#### step 110 11新建一个空项目,用于存储用户数据 [点我](https://github.com/new)12 13注意是空的,不要勾选 [Add a README file] 选项, 可以选私有化14 1516 17如图所示,我创建了一个项目: `bincooo/history`18 19 20 21#### step 222 23创建一个github访问凭证token,用于同步历史数据 [点我](https://github.com/settings/personal-access-tokens/new)24 2526 27填写 Token name: history (随意)28 29填写 Expiration: 过期日期 (随意,没有永久选项)30 31选择 Only select repositories 32 33选择 Select repositories: bincooo/history (你创建的项目)34 35 36 37 38 39点开 Repository permissions (授权)40 4142 43选择 Pull requests: Access: Read and write (授权读写)44 45 46 47 48 49最后点击最下面的生成按钮 Generate token50 5152 53 54 55保存好你生成的token,离开这个页面后就再也看不到了56 5758 59github_pat_11AIWDQ2A07DOQLEn5Lite_nhwHv2pxxxxx60 61 62 63 64 65#### step 366 67https://github.com/bincooo/SillyTavern-Docker.git68 69到这个项目去下载下来70 7172 73点击 Download ZIP 下载, 并解压74 75 76 77 78 79#### step 480 81进入 huggingface 新建 space: 点击头像里的 New Space82 8384 85 86 87创建完后,上传解压文件内容:Upload files88 8990 91进入解压目录全选所有文件,拖入到上传控件92 9394 95点击 Dockerfile 文件 编辑它96 9798 99修改这部分内容:(不要照抄,这里的是假数据)100 101```md102# Env103# 代理转发地址104ENV reverse_proxy "https://onekey.1xxx.top/v1"105# 代理转发token106ENV proxy_password "sk-ssvJn4VQAk596Lvv35488xxxx"107# gemini token108ENV api_key_makersuite "AIzaSyAm5S9kl22xxxx"109# github 项目访问凭证token110ENV github_secret "github_pat_11AIWDQ2A0cLSEdwiwiZNC_10II4TsFxxx"111# github 项目名称112ENV github_project "bincooo/history"113```114 115最后点击下面的 `Commit changes main` 保存即可116 117 118 119等待部署进度,变绿后获取访问链接:`Embed this space`120 121122 123 124 125正常运行后会同步数据到你创建的github 项目下:126 127128 129 130 131 132 133=====134 135 136 137 138 139已默认导入了几个破限选项,也预置好了超级记忆140 141142 143144 145 146 147 148 149最后,同步代码书写不易,且用且珍惜 祝各位都能成功白嫖!