huggingface / autotrain-advanced

🤗 AutoTrain Advanced
https://huggingface.co/autotrain
Apache License 2.0
3.77k stars 462 forks source link

[FEATURE REQUEST] Allow us to save our models locally #701

Closed BovineOverlord closed 3 weeks ago

BovineOverlord commented 1 month ago

Feature Request

Right now we're forced to save our models onto HF. I want to be 100% local. Please let us save models locally.

Motivation

Open-source should always strive to be 100% local. As it currently is, autotrain is dependent on HF to operate.

Additional Context

No response

abhishekkrthakur commented 1 month ago

No one is forcing you to do anything. :D

You can just use "autotrain config" command to train and set push_to_hub to false.

BovineOverlord commented 1 month ago

Ah I was not aware of that. Where is the default location of the config.yaml anyways? I'm unable to find it.

BovineOverlord commented 1 month ago

This is what I get when running that command- C:\Users\Bob>autotrain config usage: autotrain [] AutoTrain advanced CLI: error: argument {app,llm,setup,dreambooth,api,text-classification,image-classification,tabular,spacerunner,seq2seq,token-classification,tools,text-regression,object-detection,sentence-transformers,image-regression}: invalid choice: 'config' (choose from 'app', 'llm', 'setup', 'dreambooth', 'api', 'text-classification', 'image-classification', 'tabular', 'spacerunner', 'seq2seq', 'token-classification', 'tools', 'text-regression', 'object-detection', 'sentence-transformers', 'image-regression')

abhishekkrthakur commented 1 month ago

autotrain --config path_to_config.yml

example configs: https://github.com/huggingface/autotrain-advanced/tree/main/configs

docs: https://huggingface.co/docs/autotrain/config

BovineOverlord commented 1 month ago

That command does not work, as I do not know what the path to config is. It's why I asked for the default location; I'm unable to find it.

abhishekkrthakur commented 1 month ago

you are probably using a very very old version of autotrain. please update to the latest pypi release: https://pypi.org/project/autotrain-advanced/

BovineOverlord commented 1 month ago

I again ran the pip install autotune-advanced command and it says everything is already installed; I am using the current version.

abhishekkrthakur commented 1 month ago

what is the version? what does autotrain --version command say?

BovineOverlord commented 1 month ago

0.8.3. C:\Users\Bob\Desktop>autotrain --version 0.8.3

I'm thinking the conf is not being generated? I can create one manually if you direct me to the correct directory.

abhishekkrthakur commented 1 month ago

I just tried it and seems to be working fine.


❯ autotrain --help
usage: autotrain <command> [<args>]

positional arguments:
  {app,llm,setup,dreambooth,api,text-classification,image-classification,tabular,spacerunner,seq2seq,token-classification,tools,text-regression,object-detection,sentence-transformers,image-regression}
                        commands
    tools               Run AutoTrain tools

options:
  -h, --help            show this help message and exit
  --version, -v         Display AutoTrain version
  --config CONFIG       Optional configuration file

For more information about a command, run: `autotrain <command> --help`

as you can see --config exists.

You need to create a config.yml, for example: my_config.yml and then use the command autotrain --config my_config.yml . The model will be stored in the project-name specified in the config, like here: https://github.com/huggingface/autotrain-advanced/blob/main/configs/llm_finetuning/gpt2_sft.yml#L3.

BovineOverlord commented 1 month ago

I'm not saying the --config command does not exist- it does. I mean the file itself.

Even after creating it and placing in what I believe is the main directory (C:\Program Files\Python310\Lib\site-packages\autotrain), this is what I get when running "autotrain --config my_config.yml"- FileNotFoundError: [Errno 2] No such file or directory: 'my_config.yml'

abhishekkrthakur commented 1 month ago

for the command you provided, your config yaml should be in the same directory as where you are running the autotrain command. it just seems like you are providing wrong path to the command.

BovineOverlord commented 1 month ago

I cd to the directory; C:\Program Files\Python310\Lib\site-packages\autotrain>autotrain --config my_config.yml INFO | 2024-07-15 15:35:04 | autotrain.cli.autotrain:main:58 - Using AutoTrain configuration: my_config.yml Traceback (most recent call last): File "C:\Program Files\Python310\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Program Files\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "C:\Program Files\Python310\Scripts\autotrain.exe__main.py", line 7, in sys.exit(main()) File "C:\Program Files\Python310\lib\site-packages\autotrain\cli\autotrain.py", line 59, in main cp = AutoTrainConfigParser(args.config) File "", line 4, in init File "C:\Program Files\Python310\lib\site-packages\autotrain\parser.py", line 123, in post_init__ task = self.config.get("task") AttributeError: 'NoneType' object has no attribute 'get'

abhishekkrthakur commented 1 month ago

please see the example configs here: https://github.com/huggingface/autotrain-advanced/tree/main/configs

github-actions[bot] commented 3 weeks ago

This issue is stale because it has been open for 30 days with no activity.