Fastapi + Transformatoren + 4-Bit Mistral: .to () wird für BitsandBytes 4-Bit-Modelle Fehler nicht unterstütztPython

Python-Programme
Anonymous
 Fastapi + Transformatoren + 4-Bit Mistral: .to () wird für BitsandBytes 4-Bit-Modelle Fehler nicht unterstützt

Post by Anonymous »

Ich setze ein Fastapi-Backend mit umarmenden Gesichtstransformatoren mit dem Mistralai/Mistral-7b-Instruct-V0.1-Modell ein, das mit BitsandByTesconfig nach 4-Bit quantisiert wurde. Ich leite dies in einem NVIDIA -GPU -Container (CUDA 12.1, A10G GPU mit 22 GB VRAM) aus, und ich drücke diesen Fehler während des Modells des Modells immer wieder: < /p>

Code: Select all

 ValueError: `.to` is not supported for `4-bit` or `8-bit` bitsandbytes models. Please use the model as it is...< /code> < /p>
Was ich bisher getan habe:
-Ich rufe nicht an (...) überall-explizit alle solchen Zeilen entfernt. Device_map = "auto" gemäß den Transformatoren github problem✅ < /p>
< /li>
[*]  Ich nenne .cuda () Nur einmal auf dem Modell nach .from_pretrained (...), wie vorgeschlagen, dass ✅ < /p> < /> < /> < /la>
  model und token -model und token mit harming mithb />         
 -Schuls und ToKenizer mit HUGGUGGE -SETH -SAKGUS MIT HUB -SETH MOBLE MIT HUB -SETH MIT HUBE MOBLE MOBLE MOBEL MIT HUBE -MODEL. ✅

[*]  Das System erkennt Cuda richtig: Torch.cuda.is_available () ist wahr ✅ 

   und letztes löste ich das umarme Gesichtsgesichts-Cache (~/.Cache/. />  Hier ist der relevante Teil des Codes, der den Fehler auslöst: < /p>
    "mistralai/Mistral-7B-Instruct-v0.1",
quantization_config=quant_config,
device_map=None,  # I explicitly removed this
token=hf_token
).cuda()  # This is the only use of `.cuda()`

tokenizer = AutoTokenizer.from_pretrained(model_name, token=hf_token)```

Yet I still get the same ValueError. Thank you in advance.

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post