Does Hugging face defaults allow to log mlflow artifacts and name every run of mlflow log?
Author: pratikchhapolika
Pull request: no

I am training a simple binary classification model using Hugging face models using pytorch.

Bert PyTorch HuggingFace.

Here is the code:

```
import transformers
from transformers import TFAutoModel, AutoTokenizer
from tokenizers import Tokenizer, models, pre_tokenizers, decoders, processors
from transformers import AutoTokenizer

 
from transformers import AdamW
from transformers import get_linear_schedule_with_warmup
from transformers import BertTokenizerFast as BertTokenizer, BertModel, AdamW, get_linear_schedule_with_warmup,BertConfig
```

```
def compute_metrics(eval_pred):
    logits, labels = eval_pred
   

    predictions = np.argmax(logits, axis=-1)
    
    acc = np.sum(predictions == labels) / predictions.shape[0]
    return {"accuracy": acc,
            'precision': metrics.precision_score(labels, predictions),
            'recall': metrics.recall_score(labels, predictions),
            'f1': metrics.f1_score(labels, predictions)}

training_args = tr.TrainingArguments(
    #report_to = 'wandb',
    output_dir='/home/pc/proj/Exp2_conv_stampy_data/results_exp0',          # output directory
    overwrite_output_dir = True,
    num_train_epochs=2,              # total number of training epochs
    per_device_train_batch_size=32,  # batch size per device during training
    per_device_eval_batch_size=32,   # batch size for evaluation
    learning_rate=2e-5,
    warmup_steps=200,                # number of warmup steps for learning rate scheduler
    weight_decay=0.01,               # strength of weight decay
    logging_dir='./logs_exp0',            # directory for storing logs
    logging_steps=137,
    evaluation_strategy="epoch"
    ,save_strategy="epoch"
    ,load_best_model_at_end=True
    ,fp16=True
    ,run_name="final_model0"
    
)


# counter = 0
# results_lst = []

from transformers import TrainerCallback
from copy import deepcopy

model = tr.XLMRobertaForSequenceClassification.from_pretrained("/home/pc/multilingual_toxic_xlm_roberta",problem_type="single_label_classification", num_labels=2,ignore_mismatched_sizes=True, id2label={0: 'negative', 1: 'positive'})


train_encodings = tokenizer(train_texts, truncation=True, padding=True, max_length=512, return_tensors="pt")
val_encodings = tokenizer(val_texts, truncation=True, padding=True, max_length=512, return_tensors="pt")


train_data = SEDataset(train_encodings, train_labels)
val_data = SEDataset(val_encodings, val_labels)

model.to(device)

class CustomCallback(TrainerCallback):
    
    def __init__(self, trainer) -> None:
        super().__init__()
        self._trainer = trainer
    
    def on_epoch_end(self, args, state, control, **kwargs):
        if control.should_evaluate:
            control_copy = deepcopy(control)
            self._trainer.evaluate(eval_dataset=self._trainer.train_dataset, metric_key_prefix="train")
            return control_copy

trainer = tr.Trainer(
    model=model,                         # the instantiated Transformers model to be trained
    args=training_args,                  # training arguments, defined above
    train_dataset=train_data,         # training dataset
    eval_dataset=val_data,          # evaluation dataset
    compute_metrics=compute_metrics    # the callback that computes metrics of interest
)
trainer.add_callback(CustomCallback(trainer)) 
train = trainer.train()



trainer.save_model("/home/pc/proj/Exp2_conv_stampy_data/result_toxic_model_exp0")

```


I see by default `mlruns` directory is created.

<img width="691" alt="Screenshot 2022-02-03 at 12 20 49 PM" src="https://user-images.githubusercontent.com/11159549/152294935-8ee464fa-122a-42ae-b546-c4d907baa473.png">

**What is `0' and what are these 2 folders inside `0`?**

**How can rename to something useful and understandable.?**

**If I run multiple runs, how can I log every run of model with something like `run1`, `run2` under same experiment?**

**Also I see artifact folder is empty, how to log final model?**

Comments:
This issue has been automatically marked as stale because it has not had recent activity. If you think this still needs to be addressed please comment on this thread.

Please note that issues that do not follow the [contributing guidelines](https://github.com/huggingface/transformers/blob/master/CONTRIBUTING.md) are likely to be ignored.

Hello ! @pratikchhapolika

I'm facing the exact same issue. Were you able to identify the reason why there is `./mlruns` directory automatically created against my will?