Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

how to run model in total offline? #109

Closed
gitknu opened this issue Apr 6, 2023 · 4 comments
Closed

how to run model in total offline? #109

gitknu opened this issue Apr 6, 2023 · 4 comments
Labels
question Further information is requested

Comments

@gitknu
Copy link

gitknu commented Apr 6, 2023

Sorry for stupid question, but I am totally newbie in Docker and using Huggingface locally (not via colab or something else). This is the command to model for the first time , for example:

docker run -p 80:80 -e MODEL=bigscience/bloom-560m hyperonym/basaran:0.13.5

In this case everything is incredible! All works, I turn of the connection and still everything works fine.

Now, when I want to use the previously downloaded model, I have difficulties. Can you just give and example of offline run?

Something like this, without using Dockerfile etc. Just one command:
docker run -p 80:80 -e TRANFORMERS_OFFLINE=1 MODEL='/home/my_model' hyperonym/basaran:0.13.5

And please, don't send this. I've tried a lot of different variations, but still didn't get it:
https://huggingface.co/docs/transformers/v4.15.0/installation#offline-mode

So, shortly: how to run basaran in Docker locally, give an example of command, please.

Thank you for your understanding and for your help and work!

@peakji
Copy link
Member

peakji commented Apr 7, 2023

There are several ways to run Basaran locally using Docker, and the simplest and most portable way is to create a bundled image: By creating a new Dockerfile to pre-download the model and package it into a new image, the bundled image can be run offline locally.

Taking bloomz-560m as an example, you can download the pre-written Dockerfile and then run:

docker build --tag basaran:bloomz-560m -f ./bloomz-560m.Dockerfile .

The new image (basaran:bloomz-560m) is what you need, as it embeds the model.

@gitknu
Copy link
Author

gitknu commented Apr 10, 2023

Thank you! Everything works now great!

In case you can recommend any ChatGPT alike model for low-end PC - thank you! (because everything I ran before was text completion - bloomz-1b1, codegen etc.; and the Alpaca-native-7B doesn't have config.json so it didn't run). If not - nevertheless, you do a great job!

@gitknu gitknu closed this as completed Apr 10, 2023
@gitknu gitknu reopened this Apr 10, 2023
@peakji
Copy link
Member

peakji commented Apr 10, 2023

ChatGLM-6B works pretty well (for English and Chinese) on commodity hardware, and LLaMA/Alpaca support will be added in the next minor release!

@gitknu
Copy link
Author

gitknu commented Apr 10, 2023

Thanks! I will try it today))

@gitknu gitknu closed this as completed Apr 10, 2023
@fardeon fardeon added the question Further information is requested label Apr 24, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants