mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-20 10:35:01 +00:00
feat(autogpt/transformers): consume trust_remote_code
(#1799)
trusting remote code by default is a danger to our users
This commit is contained in:
parent
504f2e8bf4
commit
5c69dd155f
2 changed files with 3 additions and 3 deletions
|
@ -69,9 +69,9 @@ class BackendServicer(backend_pb2_grpc.BackendServicer):
|
|||
model_name = request.Model
|
||||
try:
|
||||
if request.Type == "AutoModelForCausalLM":
|
||||
self.model = AutoModelForCausalLM.from_pretrained(model_name, trust_remote_code=True)
|
||||
self.model = AutoModelForCausalLM.from_pretrained(model_name, trust_remote_code=request.TrustRemoteCode)
|
||||
else:
|
||||
self.model = AutoModel.from_pretrained(model_name, trust_remote_code=True)
|
||||
self.model = AutoModel.from_pretrained(model_name, trust_remote_code=request.TrustRemoteCode)
|
||||
|
||||
self.tokenizer = AutoTokenizer.from_pretrained(model_name)
|
||||
self.CUDA = False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue