码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • huggingface上传或发布自己的模型(大语言模型LLM)


    创建huggingface账号和token

    在https://huggingface.co/join注册huggingface账号,登录账号后,在https://huggingface.co/settings/tokens创建token,注意需要将token的类型设置为WRITE。

    安装必要软件包和初始化环境

    安装git lfs

    curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
    sudo apt-get install git-lfs
    git lfs install
    
    • 1
    • 2
    • 3

    安装并登录huggingface-cli

    pip install huggingface_hub
    huggingface-cli login # 注意,这里需要输入你创建的token
    
    • 1
    • 2

    创建repo

    huggingface-cli repo create model_name
    
    • 1

    上传自己的模型

    首先git clone到本地

    git lfs install
    git clone https://huggingface.co/your_username/model_name
    
    • 1
    • 2

    然后将你的模型(checkpoint)保存到这个repo中。
    再进行git repo的上传。

    git add .
    git commit -m "commit from $USER"
    git push
    
    • 1
    • 2
    • 3

    其中,$USER指的是你配置的github的用户名或邮箱。关于如何配置,见https://blog.csdn.net/weixin_44022515/article/details/105967226。

    之后,再打开huggingface你模型地址的网页,即可看到自己发布的模型。(我上传的网速好慢,才1.6MB/s)

    更新

    执行git push很久后,终于成功上传,但是,出现了如下错误

    error: failed to push some refs to 'https://huggingface.co/itpossible/JiuZhou'
    hint: Updates were rejected because the remote contains work that you do
    hint: not have locally. This is usually caused by another repository pushing
    hint: to the same ref. You may want to first integrate the remote changes
    hint: (e.g., 'git pull ...') before pushing again.
    hint: See the 'Note about fast-forwards' in 'git push --help' for details.
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6

    原来是,在他上传过程中,我闲着没事,去huggingface的repo里改了readme,导致版本出现更改。
    解决方法:

    git pull origin 分支名(如main)
    
    • 1

    这个时候,我们会发现,readme会更新到我们的服务器上。此时再执行git pull,便能成功,

  • 相关阅读:
    MyBatis框架使用过程中出现的问题以及解决方案
    notepad++下载地址
    gdb调试知识积累——真·详解
    【从零开始学习 SystemVerilog】3.4、SystemVerilog 控制流—— case( ‘unique‘ 和 ‘priority‘)
    英伟达首席科学家:深度学习硬件的过去、现在和未来
    K8s部署SpringBoot项目简单例子
    PS001:PS2020及GeographicImager6.2安装
    js事件循环详解
    MATLAB算法实战应用案例精讲-【人工智能】ROS机器人(补充篇)
    云计算概论 --云安全机制
  • 原文地址:https://blog.csdn.net/weixin_44612221/article/details/136356734
  • 最新文章
  • 攻防演习之三天拿下官网站群
    数据安全治理学习——前期安全规划和安全管理体系建设
    企业安全 | 企业内一次钓鱼演练准备过程
    内网渗透测试 | Kerberos协议及其部分攻击手法
    0day的产生 | 不懂代码的"代码审计"
    安装scrcpy-client模块av模块异常,环境问题解决方案
    leetcode hot100【LeetCode 279. 完全平方数】java实现
    OpenWrt下安装Mosquitto
    AnatoMask论文汇总
    【AI日记】24.11.01 LangChain、openai api和github copilot
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1
正则表达式工具 cron表达式工具 密码生成工具

京公网安备 11010502049817号