Text Generation
Transformers
Safetensors
qwen2
Tabular Classification
conversational
text-generation-inference
Run this model with HF Jobs
Run MachineLearningLM/MachineLearningLM-7B-v1 on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs and TRL to fine-tune https://huggingface.co/MachineLearningLM/MachineLearningLM-7B-v1. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/MachineLearningLM/MachineLearningLM-7B-v1 on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/MachineLearningLM/MachineLearningLM-7B-v1. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Quantize for lower memory use
Use HF Jobs to create a 4-bit version of https://huggingface.co/MachineLearningLM/MachineLearningLM-7B-v1. Push it to a new model repo, then reload it from there and report its memory footprint. Run `hf jobs --help` first to learn the CLI.
Instructions to use MachineLearningLM/MachineLearningLM-7B-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use MachineLearningLM/MachineLearningLM-7B-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="MachineLearningLM/MachineLearningLM-7B-v1") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("MachineLearningLM/MachineLearningLM-7B-v1") model = AutoModelForCausalLM.from_pretrained("MachineLearningLM/MachineLearningLM-7B-v1", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use MachineLearningLM/MachineLearningLM-7B-v1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "MachineLearningLM/MachineLearningLM-7B-v1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MachineLearningLM/MachineLearningLM-7B-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/MachineLearningLM/MachineLearningLM-7B-v1
- SGLang
How to use MachineLearningLM/MachineLearningLM-7B-v1 with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "MachineLearningLM/MachineLearningLM-7B-v1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MachineLearningLM/MachineLearningLM-7B-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "MachineLearningLM/MachineLearningLM-7B-v1" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "MachineLearningLM/MachineLearningLM-7B-v1", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use MachineLearningLM/MachineLearningLM-7B-v1 with Docker Model Runner:
docker model run hf.co/MachineLearningLM/MachineLearningLM-7B-v1
Improve model card: Add pipeline tag, library name, and expand usage details (#2)
Browse files- Improve model card: Add pipeline tag, library name, and expand usage details (445adf8dbbc1e88af30e16619896db16f93c7cf7)
Co-authored-by: Niels Rogge <nielsr@users.noreply.huggingface.co>
1234567891011121311 unmodified lines252627282930313233344 unmodified lines3940414243444522 unmodified lines686970---MachineLearningML: Continued Pretraining Language Models on Millions of Synthetic Tabular Prediction Tasks Scales In-Context MLlicense: apache-2.0base_model:- Qwen/Qwen2.5-7B-Instruct---# MachineLearningLM## model summaryCan LLMs learn from 1,000 in-context examples?11 unmodified linesGitHub: https://github.com/HaoAreYuDong/MachineLearningLM## evaluation and validationWe have developed an automated evaluation framework β simply configure the parameters to easily perform validation and evaluation.**The code is now open-sourced at our GitHub.****Quick Start**4 unmodified lines--output_dir ./demo_output.jsonl \--model_name MachineLearningLM/MachineLearningLM-7B-v1```**pipeline**```bash# modify the evaluate_parameters.sh filesource evaluate_parameters.sh22 unmodified linesFor more usage details, please visit our GitHub.1234567891011121314151611 unmodified lines282930313233343536374 unmodified lines4243444546474822 unmodified lines7172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188---base_model:- Qwen/Qwen2.5-7B-Instructlicense: apache-2.0pipeline_tag: text-generationlibrary_name: transformers---# MachineLearningLMThis repository contains the model presented in the paper [MachineLearningLM: Scaling Many-shot In-context Learning via Continued Pretraining](https://huggingface.co/papers/2509.06806).## Model SummaryCan LLMs learn from 1,000 in-context examples?11 unmodified linesGitHub: https://github.com/HaoAreYuDong/MachineLearningLM## Evaluation and ValidationWe have developed an automated evaluation framework β simply configure the parameters to easily perform validation and evaluation.**The code is now open-sourced at our [GitHub repository](https://github.com/HaoAreYuDong/MachineLearningLM).****Quick Start**4 unmodified lines--output_dir ./demo_output.jsonl \--model_name MachineLearningLM/MachineLearningLM-7B-v1```**Pipeline**```bash# modify the evaluate_parameters.sh filesource evaluate_parameters.sh22 unmodified linesFor more usage details, please visit our GitHub.## Tabicl Evaluation**This part of the code needs to run in an environment with the tabicl and openpyxl libraries installed.**The evaluation code for tabicl is placed separately in the `./src/evaluation/tabicl_evaluate.py` file. Use `./scripts/tabicl_evaluate.sh` to obtain the evaluation results for tabicl.Use --datasets to specify the datasets to be evaluated, and --sample_sizes to indicate the number of shots.If multiple datasets need to be evaluated, separate them with spaces. To evaluate all CSV files in the input folder, use **all**.## Prior_dataMachineLearningLM uses the code from tabicl to generate prior data.Use `./scripts/generate_data.sh` to generate the prior data. It generates the corresponding .pt and .csv files, and normalizes the feature values in the CSV files to the range of 0β999, as we did in the paper.### Parameter IntroductionοΌrefer to the comments in the file `tabicl\src\tabicl\prior\dataset.py`οΌ**Data Scale & Structure**| Parameter | Type | Description || :------------- | :--- | :------------------------------------------------------ || `min_features` | int | Minimum number of features per dataset || `max_features` | int | Maximum number of features per dataset || `max_classes` | int | Maximum number of target classes || `min_seq_len` | int | Minimum samples per dataset. Uses `max_seq_len` if None || `max_seq_len` | int | Maximum samples per dataset οΌNot IncludeοΌ |**Batch Configuration**| Parameter | Type | Description || :--------------------- | :--- | :----------------------------------------------------------- || `batch_size` | int | Total number of datasets to generate per batch || `batch_size_per_gp` | int | Number of datasets per group (shared characteristics) || `batch_size_per_subgp` | int | Number of datasets per subgroup (similar causal structures). Defaults to `batch_size_per_gp` if None |**Sequence Length Control**| Parameter | Type | Description || :--------------- | :--- | :----------------------------------------------------------- || `log_seq_len` | bool | Sample sequence length from log-uniform distribution if True || `seq_len_per_gp` | bool | Sample sequence length per group (enables variable-sized datasets) || `replay_small` | bool | Occasionally sample smaller sequences for model robustness |**Train-Test Split**| Parameter | Type | Description || :--------------- | :-------- | :----------------------------------------------------------- || `min_train_size` | int/float | Start position/ratio for train split (int: absolute, float: fractional) || `max_train_size` | int/float | End position/ratio for train split (int: absolute, float: fractional) |**Generation Method**| Parameter | Type | Description || :----------- | :--- | :----------------------------------------------------------- || `prior_type` | str | Prior type: 'mlp_scm', 'tree_scm', or 'mix_scm' (random selection) || `fixed_hp` | dict | Fixed structural configuration parameters || `sampled_hp` | dict | Parameters sampled during generation |**Computation Settings**| Parameter | Type | Description || :------------------------- | :--- | :------------------------------------------------ || `n_jobs` | int | Number of parallel jobs (-1 = use all processors) || `num_threads_per_generate` | int | Number of threads per generation job || `device` | str | Computation device ('cpu' or 'cuda') |## TrainMachineLearningLM uses the LLaMA-Factory framework for training.#### Training Environment Configuration```bashcd ./third_party/LLaMA-Factorypip install -e ".[torch,metrics]" --no-build-isolationpip install wandb```Use `./scripts/train.sh` for training.## Project Structure```MachineLearningLM/βββsrc/| βββevaluation/β β βββ data_prep/ # Data preprocessing and chunking utilitiesβ β βββ prompt_gen/ # Prompt generation for deep learning modelsβ β βββ model_pred/ # Model inference (ML and DL prediction engines)β β βββ result_proc/ # 5-layer evaluation architecture and metrics processingβ β βββ zero_summary/ # Result summarization and report generationβ β βββ tabicl_evaluate.pyβ βββprior_dataβ βββ pt_to_csv.pyβββ scripts/β βββ single_process/ # Sequential execution shell scriptsβ βββ multi_process/ # Parallel execution shell scripts (with _mp suffix)β βββ evaluate_parameters.sh # Global parameter configuration| βββ evaluate_pipeline.sh # automated pipeline| βββ generate_data.sh| βββ tabicl_evaluate.sh| βββ train.shβββ datahub_inputs/β βββ data_demo/ # Demo datasets for testingβ βββ data_raw/ # Raw input datasetsβββ third_party/β βββ tabicl/β βββ LLaMA-Factory/βββ requirements.txt # Python dependencies for Evaluation Frameworkβββ README.mdβββ README_zh.mdβββ THIRD_PARTY_NOTICES.mdβββ LICENSE```
README.md+124-6