Giter VIP home page Giter VIP logo

huggingface-ws's Introduction

说明

下方为默认UUID,可自行添加环境变量修改

25bef25c-cbe4-431b-93b6-b39aa11c0a7e

部署

https://huggingface.co 注册账号,新建space,名称随意,选择docker,空白项目,选择public公开项目,上传文件,除了README.md,其他文件都上传。 修改start.sh里的哪吒参数,不需要哪吒可忽略,自动部署。

获取域名

域名形式:用户名-项目名.hf.space,例如我的用户名为aaa,项目名为bbb,那么域名为:aaa-bbb.hf.space。或者通过下图直接查看域名 image

节点配置如下

image

可以利用cf的workers套cdn加速配合优选ip或优选域名使用,反代代码如下,替换第6行中的地址。

export default {
    async fetch(request, env) {
        let url = new URL(request.url);
        if (url.pathname.startsWith('/')) {
            var arrStr = [
                'aaaa.bbbbb.hf.space',
            ];
            url.protocol = 'https:'
            url.hostname = getRandomArray(arrStr)
            let new_request = new Request(url, request);
            return fetch(new_request);
        }
        return env.ASSETS.fetch(request);
    },
};
function getRandomArray(array) {
  const randomIndex = Math.floor(Math.random() * array.length);
  return array[randomIndex];
}

huggingface-ws's People

Contributors

eooce avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.