AIRider commited on
Commit
f15e184
โ€ข
1 Parent(s): d85a80f

Delete config.json

Browse files
Files changed (1) hide show
  1. config.json +0 -22
config.json DELETED
@@ -1,22 +0,0 @@
1
- import os
2
- from transformers import AutoConfig, AutoModelForSequenceClassification
3
-
4
- HF_MODEL_DIR = "path/to/model/directory"
5
- HF_TASK = "sequence-classification"
6
-
7
- def get_inference_handler_either_custom_or_default_handler(model_dir, task):
8
- # ๋ชจ๋ธ ๋””๋ ‰ํ„ฐ๋ฆฌ์—์„œ config.json ํŒŒ์ผ์ด ์กด์žฌํ•˜๋Š”์ง€ ํ™•์ธ
9
- config_file = os.path.join(model_dir, "config.json")
10
- if not os.path.exists(config_file):
11
- raise ValueError(f"Config file not found at {config_file}")
12
-
13
- # ๋ชจ๋ธ ๋กœ๋“œ
14
- config = AutoConfig.from_pretrained(model_dir)
15
- model = AutoModelForSequenceClassification.from_pretrained(model_dir)
16
-
17
- # ํŒŒ์ดํ”„๋ผ์ธ ์ƒ์„ฑ
18
- pipeline = pipeline(task, model=model, tokenizer=config.tokenizer)
19
-
20
- return pipeline
21
-
22
- inference_handler = get_inference_handler_either_custom_or_default_handler(HF_MODEL_DIR, HF_TASK)