Spaces:
Runtime error
Runtime error
| # save_complete_model.py | |
| # ํ๋ จ๋ ๋ชจ๋ธ์ ๋ฐฐํฌ์ฉ์ผ๋ก ๋ณํ | |
| from transformers import AutoModelForSequenceClassification, AutoTokenizer | |
| # ๊ธฐ์กด ํ๋ จ ๊ฒฐ๊ณผ๋ฌผ์ด ์ ์ฅ๋ ๊ฒฝ๋ก | |
| checkpoint_path = "./results/checkpoint-9681" | |
| # '์์ ํ ๋ชจ๋ธ'์ ์ ์ฅํ ์ ํด๋ ์ด๋ฆ | |
| output_dir = "./korean-emotion-classifier-final" | |
| print(f"'{checkpoint_path}'์์ ๋ชจ๋ธ๊ณผ ํ ํฌ๋์ด์ ๋ฅผ ๋ถ๋ฌ์ต๋๋ค...") | |
| model = AutoModelForSequenceClassification.from_pretrained(checkpoint_path) | |
| tokenizer = AutoTokenizer.from_pretrained(checkpoint_path) | |
| print("๋ถ๋ฌ์ค๊ธฐ ์๋ฃ.") | |
| print(f"'{output_dir}' ํด๋์ ์์ ํ ๋ชจ๋ธ๊ณผ ํ ํฌ๋์ด์ ๋ฅผ ์ ์ฅํฉ๋๋ค...") | |
| model.save_pretrained(output_dir) | |
| tokenizer.save_pretrained(output_dir) | |
| print("์ ์ฅ ์๋ฃ! 'korean-emotion-classifier-final' ํด๋๋ฅผ ํ์ธํ์ธ์.") | |
| print("์ด ํด๋ ์์ ํ์ผ๋ค์ 'my-local-model' ํด๋๋ก ์ฎ๊ฒจ์ฃผ์๋ฉด ๋ฉ๋๋ค.") |