File tree Expand file tree Collapse file tree 1 file changed +52
-2
lines changed
Expand file tree Collapse file tree 1 file changed +52
-2
lines changed Original file line number Diff line number Diff line change 1- # MindSearch 部署的到 Hugging Face Space
1+ # MindSearch 部署到Github Codespace 和 Hugging Face Space
22
33和[ 原有的CPU版本] ( https://github.com/InternLM/Tutorial/blob/camp3/docs/L2/MindSearch/readme.md ) 相比区别是把internstudio换成了github codespace。
44
@@ -277,4 +277,54 @@ demo.launch(server_name='0.0.0.0',
277277 share = True )
278278```
279279
280- 在最后,将 /root/mindsearch/mindsearch_deploy 目录下的文件(使用 git)提交到 HuggingFace Space 即可完成部署了。注意将代码提交到huggingface space中需要配置hugginface的token。
280+ 在最后,将 /root/mindsearch/mindsearch_deploy 目录下的文件(使用 git)提交到 HuggingFace Space 即可完成部署了。将代码提交到huggingface space的流程如下:
281+
282+ 首先创建一个有写权限的token。
283+
284+ ![ image] ( https://github.com/user-attachments/assets/3a918dc1-9600-433b-a916-d6ef4caa73fe )
285+
286+ 然后从huggingface把空的代码仓库clone到codespace。
287+
288+ ```
289+ /workspaces/codespaces-blank
290+ git clone https://huggingface.co/spaces/<你的名字>/<仓库名称>
291+ # 把token挂到仓库上,让自己有写权限
292+ git remote set-url space https://<你的名字>:<上面创建的token>@huggingface.co/spaces/<你的名字>/<仓库名称>
293+ ```
294+
295+ 现在codespace就是本地仓库,huggingface space是远程仓库,接下来使用方法就和常规的git一样了。
296+
297+ ```
298+ cd <仓库名称>
299+ # 把刚才准备的文件都copy进来
300+ cp /workspaces/mindsearch/mindsearch_deploy/* .
301+ ```
302+
303+ 最终的文件目录是这样。
304+
305+ ![ image] ( https://github.com/user-attachments/assets/22a9efb4-c189-4b19-8a9e-ef54d0666040 )
306+
307+ 注意mindsearch文件夹其实是Mindsearch项目中的一个子文件夹,如果把这个Mindsearch的整个目录copy进来会有很多问题(git submodule无法提交代码,space中项目启动失败等)。
308+
309+ ![ image] ( https://github.com/user-attachments/assets/25619052-224b-42df-863f-a80ef35d6d60 )
310+
311+ 最后把代码提交到huggingface space会自动启动项目。
312+
313+ ```
314+ git add .
315+ git commit -m "update"
316+ git push
317+ ```
318+
319+ 然后就可以测试啦。
320+
321+ <img width =" 1511 " alt =" image " src =" https://github.com/user-attachments/assets/308a7c47-a7c2-4d7d-8d35-f433cf44cf5f " >
322+
323+ <img width =" 1550 " alt =" image " src =" https://github.com/user-attachments/assets/8d584918-6509-4b72-9a6b-fa3158012098 " >
324+
325+ <img width =" 1521 " alt =" image " src =" https://github.com/user-attachments/assets/82c63fda-e790-4dbd-8f1c-c0e7f5ce1c26 " >
326+
327+ 不仅搜到了最近火热的黑悟空,还搜到了龙珠超中的黑悟空,非常给力!
328+
329+
330+
You can’t perform that action at this time.
0 commit comments