Comments (10)
@vitaliy-sharandin Thanks for reporting this. Could you share your model logging code?
from mlflow.
I ran the following code but could not reproduce the error:
%pip install -U git+https://github.com/huggingface/transformers torch accelerate==0.29.3 mlflow
dbutils.library.restartPython()
########
import transformers
import torch
model_id = "meta-llama/Meta-Llama-3-8B-Instruct"
pipeline = transformers.pipeline(
"text-generation",
model=model_id,
model_kwargs={"torch_dtype": torch.bfloat16},
token="...",
)
import mlflow
import uuid
mlflow.set_registry_uri("databricks-uc")
with mlflow.start_run() as run:
mlflow.transformers.log_model(pipeline, "model")
mlflow.register_model(
model_uri=f"runs:/{run.info.run_id}/model",
name=f"..."
)
from mlflow.
The main difference between our code is that I am first fine-tuning adapters with peft and trying to register the run which has only adapters saved and base model reference without model weights. I have also read MLFLow Transformers guide which specifies that you don't need to use mlflow.transformers.persist_pretrained_model()
once you are trying to register model to Unity Catalogue, hence my code has to work as I am trying to do exactly that.
Here is my notebook:
https://github.com/vitaliy-sharandin/data_science_projects/blob/master/portfolio/nlp/fine-tuned-llm/psy_ai_mlflow_tracking_deployment.ipynb
from mlflow.
Thanks for the notebook! Let me run the notebook and see If I can reproduce the issue.
from mlflow.
@vitaliy-sharandin Can you try inserting this code before loading the model to see if it can fix the error?
def get_model_with_peft_adapter(base_model, peft_adapter_path):
from peft import PeftModel
return PeftModel.from_pretrained(base_model, peft_adapter_path, offload_folder="offload")
mlflow.transformers.get_model_with_peft_adapter = get_model_with_peft_adapter
Not sure if offload_folder
is the only to fix this issue, but want to give it a try.
from mlflow.
It doesn't quite make sense, as I don't have adapters to load pre-model-tuning, so I don't have value for peft_adapter_path
obligatory argument.
from mlflow.
@mlflow/mlflow-team Please assign a maintainer and start triaging this issue.
from mlflow.
@vitaliy-sharandin the traceback says get_model_with_peft_adapter
is called.
from mlflow.
@harupy Sorry, I have misunderstood your code at first. I did what you've proposed and it led to new error, please check out the notebook.
from mlflow.
@harupy Any updates?
from mlflow.
Related Issues (20)
- Hello, I encountered an issue while attempting to run the official MLflow image. Can anyone assist me with this? I'm a beginner. Thanks HOT 6
- Add load_delta support with `deltalake` package HOT 2
- [BUG] Exception During Model Logging with Custom Ollama Class HOT 6
- comparing metrics with timestamp is not working if step is same between them [BUG] HOT 4
- [BUG] Can't delete runs with mlflow gc due to api timeout HOT 11
- [FR] Display the complete dataset profile in the data details view HOT 1
- Improve `_init_server` HOT 2
- [FR] Improve UI stability to corrupt metric files HOT 2
- [BUG] UI Crash - Unterminated string in JSON at position 5000 for mlflow.log-model.history HOT 4
- [BUG] pyfunc.load_model ignores logged model with trust_remote_code set to True HOT 1
- [BUG] HOT 2
- [BUG]Prompt Engineering request from UI to Deployments Server Connection TimeOut HOT 5
- [FR]MLflow Deployments Server Support inside corporate proxy HOT 3
- Fix typos
- Fix docstrings in `mlflow/tracing` HOT 1
- [FR] Multiple retrievers with mlflow.langchain.log_model HOT 1
- [BUG] MLFlow Deployment Server for LLMs using chatCompletion on Azure OpenAI text-davinci-003 HOT 4
- [SETUP-BUG] Multi-Cloud artifact-destination migration HOT 3
- mlflow.pyfunc.load_model is loading model of class <class 'mlflow.pyfunc.PyFuncModel'> instead of original class HOT 2
- [BUG] ModuleNotFoundError: No module named 'fcntl' HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mlflow.