You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Inconsistent results between online and offline LORA model inference #269
There is an issue where the inference results obtained using the base model (unsloth/gemma-7b-it-bnb-4bit) differ depending on whether the model is loaded directly from the Hugbing Face Hub or from a local copy in an offline environment.
Steps to Reproduce - Offline (Local) Loading:
Download the base model (unsloth/gemma-7b-it-bnb-4bit) from the Hugging Face Hub and save it in a folder named "unsloth/gemma-7b-it-bnb-4bit".
Disconnect the network to ensure the model is loaded from the locally saved copy (optional)
Load the trained PEFT model from the local folder.
Generate outputs using the locally loaded model.
Steps to Reproduce - Online (Hugging Face Hub) Loading:
Reconnect the network and remove the local copy of the base model (to ensure base model is loaded directly from the Hugging Face Hub)
Compare the generated outputs from the locally loaded model with those obtained when loading the base model directly from the Hugging Face Hub.
The results generated by the locally loaded model should closely match those obtained when loading the base model directly from the Hugging Face Hub, regardless of the environment (offline or online).
Actual Behavior:
The results obtained when loading the base model directly from the Hugging Face Hub while being online and loading the base model offline from a local folder (with the network disconnected) are significantly different. The LoRA model is local in both cases, with the only difference being where the base model is loaded from (hub vs local copy).
Additional Information:
It is suspected that there might be an issue with offline/local loading of the base model and applying the LoRA, causing the discrepancy in results.
Changing the paths of both the local model and the PEFT config adapter did not resolve the issue.
I managed to fix the problem by re-downloading the weights, upgrading unsloth to the latest version, and updating all dependencies to their latest versions. This resolved the discrepancy in the model outputs between the offline and online settings. Although I am not sure which specific change fixed the problem, I can confirm that the issue has been resolved for now. If it reoccurs, I will reopen the issue. Thank you for checking.
Activity
danielhanchen commentedon Mar 20, 2024
@terraformmachine That is extremely weird! Essentially your saying a downloaded online model has different generation results than an offline model?
I'll see what I can do! I'll check if there are model weight differences - sorry on the issue!
terraformmachine commentedon Mar 20, 2024
I managed to fix the problem by re-downloading the weights, upgrading unsloth to the latest version, and updating all dependencies to their latest versions. This resolved the discrepancy in the model outputs between the offline and online settings. Although I am not sure which specific change fixed the problem, I can confirm that the issue has been resolved for now. If it reoccurs, I will reopen the issue. Thank you for checking.
Merge pull request unslothai#269 from unslothai/fix/fine-tuned-model-…
Leave a silent parking build's parking off on every platform