Spaces:
Runtime error
Runtime error
Update proxy_model.py
Browse files- proxy_model.py +7 -1
proxy_model.py
CHANGED
@@ -7,7 +7,13 @@ class RemoteModelProxy:
|
|
7 |
def __init__(self, model_id):
|
8 |
self.model_id = model_id
|
9 |
self.tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
|
10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
self.model = AutoModelForCausalLM.from_pretrained(model_id, config=self.config, trust_remote_code=True)
|
12 |
|
13 |
def classify_text(self, text):
|
|
|
7 |
def __init__(self, model_id):
|
8 |
self.model_id = model_id
|
9 |
self.tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)
|
10 |
+
|
11 |
+
# Load the configuration and remove the quantization configuration
|
12 |
+
config = AutoConfig.from_pretrained(model_id, trust_remote_code=True)
|
13 |
+
if hasattr(config, 'quantization_config'):
|
14 |
+
del config.quantization_config
|
15 |
+
|
16 |
+
self.config = config
|
17 |
self.model = AutoModelForCausalLM.from_pretrained(model_id, config=self.config, trust_remote_code=True)
|
18 |
|
19 |
def classify_text(self, text):
|