Code Monkey home page Code Monkey logo

my-spaces's Introduction

My Spaces: self hosting ๐Ÿค— spaces

alt

My Spaces allows you to quickly self-host almost any hugging face space wherever you want!

Under the hood we are using docker and nvidia pytorch containers

Since hugging face doesn't distribute the docker image used in their spaces, a lot of spaces won't work due to broken links or stuff like that.

Not all space works, this is because I have no idea about which version of some package hugging face is using (e.g. ffmepg). If you are from hugging face, feel free to comment on this issue

This project aims to provide transparent and real open machine learning demo to the people. If something doesn't work please feel free to open an issue :)

Contributions are welcomed!

Getting Started

You can also install the latest version on GitHub

pip install git+https://github.com/FrancescoSaverioZuppichini/my-spaces

TODO

Run a space!

You need to get the hub token

From a git repo url

export HUGGING_FACE_HUB_TOKEN=<YOUR_HUGGING_FACE_HUB_TOKEN>
my-spaces run https://huggingface.co/spaces/Francesco/stable-diffusion

Output

INFO:root:๐Ÿš€ Running ...
INFO:root:๐Ÿ‹ Log from container: 
Downloading: 100%|โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 543/543 [00:00<00:00, 294kB/s]B/s]
Downloading: 100%|โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 342/342 [00:00<00:00, 277kB/s] ?it/s]
Downloading: 100%|โ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆโ–ˆ| 4.63k/4.63k [00:00<00:00, 3.51MB/s] 1.20s/it]

After a while, open up http://localhost:7860/ if it was a gradio app, or http://localhost:8501/ if it was a stremlit app

alt

The generated Dockerfile will be inside ~/.my-spaces/dockerfiles

For each space, we create an docker image, build and run a container

All images use the my-space name and the repo name as tag. For example, using following space (that doesn't work on hugging face space gods only know why) https://huggingface.co/spaces/Francesco/stable-diffusion we will create an image named my-spaces:stable-diffusion.

From Docker hub

I've personally built and distributed the following images, you run them by

export HUGGING_FACE_HUB_TOKEN=<YOUR_HUGGING_FACE_HUB_TOKEN>
my-spaces run  zuppif/my-spaces:stable-diffusion

Q&A

Works on Windows? No idea, please try and report back :)

my-spaces's People

Contributors

francescosaveriozuppichini 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.