I mean, if you would created an AI model which for example changes the contrast of an image and you would like to make it available only to your users (let’s say inside a membership area), how this should be done?
If the private model is used externally, the story is simple. The difficult part, as nielsr mentioned, is the external use of private space.
I think that if HF allows it in the model, they should allow it in the space as well…
Models and datasets can be written this way any way you want. The only tedious part is that, for practical use, the tokens must be stored somewhere other than in the code so that they are not leaked.
access_token = "hf_..."
model = AutoModel.from_pretrained("private/model", token=access_token)
Only extremely server-intensive items, such as huge language models for large companies, are paid for. The others don’t cost anything. Especially if you have prepared the model yourself, you don’t have to pay unless it is a very large model.
Anyway, it is hard to hide a space in the same way as it is now, so unless you really want to keep the existence of the space itself a secret, I think the quickest way is to keep it public and restrict access. It is much easier if the model alone is valid.
If it is a language model, it is even possible to use the OpenAI client as is.
P.S.
Incidentally, I have recently come to realize that there are many more cases of unimplemented features in HF are not those with very strict philosophies, but such as simply forgetting to create them or not recognizing the demand for the feature.
The same may be true for the private publishing feature of Spaces.
If you have a request, I’m sure you can send a mentions to the victor or someone else yourself and they will respond, or you can wait for the occasional opportunity to solicit requests as shown below and get on board.
@name message…
You can send a Mention like this. Be careful, because it will be sent to the person you sent it to immediately.