Run this model with HF Jobs
Run jimboHsueh/HW1 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 to fine-tune https://huggingface.co/jimboHsueh/HW1. 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/jimboHsueh/HW1 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.
Instructions to use jimboHsueh/HW1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jimboHsueh/HW1 with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForMultipleChoice tokenizer = AutoTokenizer.from_pretrained("jimboHsueh/HW1") model = AutoModelForMultipleChoice.from_pretrained("jimboHsueh/HW1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
Reproduce my result
#Environment
pip install -r requirements.txt
##Download Download training, validation, testing data, as well as multiple choice model and question answering model.
bash ./download.sh
##Multiple Choice
python run_multiple_choice.py \
--context_data <context.json> \
--train_data <train.json> \
--valid_data <valid.json> \
--test_data <test.json> \
--max_seq_length 512 \
--gradient_accumulation_steps 8 \
--model_name_or_path bert-base-chinese \
--learning_rate 2e-5 \
--output_dir <output directory> \
--per_device_train_batch_size 8
-model_name_or_path: Path to pretrained model.
-output_dir: Path to directory which saves the model outputs.
-context_data: Path to context.json.
-train_data: Path to train.json.
-valid_data: Path to valid.json.
-test_data: Path to test.json.
##Question Answering
python run_question_answering.py \
--context_data <context.json> \
--train_data <train.json> \
--valid_data <valid.json> \
--test_data <test.json> \
--max_seq_length 512 \
--gradient_accumulation_steps 8 \
--model_name_or_path hfl/chinese-roberta-wwm-ext-large \
--learning_rate 2e-5 \
--output_dir <output directory> \
--per_device_train_batch_size 8
-model_name_or_path: Path to pretrained model.
-output_dir: Path to directory which saves the model outputs.
-context_data: Path to context.json.
-train_data: Path to train.json.
-valid_data: Path to valid.json.
-test_data: Path to test.json.
##Reproduce my result
bash ./download.sh
bash ./run.sh /path/to/context.json /path/to/test.json /path/to/pred/prediction.csv
- Downloads last month
- 5