K Choi
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # Team 2002! ⚽️ Chugai x Prescient Design Yukiko - Ryouichi - Mariko Stephen - Keunwoo ## Goal - Predict success of clinical trials ## Data - HINT dataset: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC9024011/ - Repo: https://github.com/futianfan/clinical-trial-outcome-prediction > Various public data sources can provide vital information for predicting the trial outcome. For example, the ClinicalTrials.gov database (publicly available at https://clinicaltrials.gov/) has 369,700 historical clinical trials, including important information about those trials. In addition, we utilize the standard medical codes of the diseases and their natural language descriptions through the National Institutes of Health website (publicly available at https://clinicaltables.nlm.nih.gov/). The DrugBank database (publicly available at https://www.drugbank.ca/) contains the biochemical description of many drugs, which allows for the computational modeling of drug molecules.6 - AACT: https://aact.ctti-clinicaltrials.org/learn_more - only ClinicalTrials.gov clinical trials status to use: - Terminated: The study has stopped early and will not start again. Participants are no longer being examined or treated. **<- Failure** - Completed: The study has ended normally, and participants are no longer being examined or treated (that is, the last participant's last visit has occurred). **<- Success** other status: - Not yet recruiting: The study has not started recruiting participants. - Recruiting: The study is currently recruiting participants. - Enrolling by invitation: The study is selecting its participants from a population, or group of people, decided on by the researchers in advance. These studies are not open to everyone who meets the eligibility criteria but only to people in that particular population, who are specifically invited to participate. - Active, not recruiting: The study is ongoing, and participants are receiving an intervention or being examined, but potential participants are not currently being recruited or enrolled. - Suspended: The study has stopped early but may start again. - Withdrawn: The study stopped early, before enrolling its first participant. - Unknown: A study on ClinicalTrials.gov whose last known status was recruiting; not yet recruiting; or active, not recruiting but that has passed its completion date, and the status has not been last verified within the past 2 years. ### Processed Data https://drive.google.com/drive/folders/1xFrOUeN9mgh253tdwLZ_j7EdNEfztd8j Filename: `raw_data.csv` Using colums as input_text: - ['diseases', 'icdcodes', 'drugs', 'smiless', 'criteria'] ## Example finetuning code using Huggingface tools This is an example working code that performs finetuning Prescient-LM models. ```python """ # Finetuning Prescient-LM with Alpaca dataset and HuggingFace Transformers ## Prerequisites - Software: Install prescient-lm with `-U` to get the latest versions of the dependencies (peft, transformers, ..) - Model: Convert the model to the HuggingFace format first. See "text-generation-with-Huggingface" notebook for details. - Data: `wget https://raw.githubusercontent.com/gururise/AlpacaDataCleaned/main/alpaca_data_cleaned_archive.json` - Hardware (as used during test) - For 0.5B, x1 V100 GPU (or better) with 16GB memory; - For 7B - (Fully) Finetuning: xN A100 GPUs (or better) with 80GB memory each. (Reduce the batch size if you have less memory.) - Quantized LoRA: - Minimal requirement: x1 V100 (16GB): Takes 45 hrs for 3 epochs (with batch_size=1.) - Recommended: x1 A100 (80GB): Takes 14 hrs for 3 epochs. ## Note - This code is based on the custom argparser from Huggingface. See [the TrainingArguments doc](https://huggingface.co/docs/transformers/main_classes/trainer#transformers.TrainingArguments) to see what arguments are available. As in the script below, you can simply pass the arguments to the `Trainer` class on CLI. ## 1. Script for (full) fine-tuning **0.5B Model** - Single-GPU (tested on V100) - Required to convert Prescient-LM model to the HF format first. (See `text-generation-with-Huggingface.ipynb`) On Bash shell: python finetuning_alpaca_huggingface.py \ --model_name=0.5B-latest-latest \ --data_path="alpaca_data_cleaned_archive.json" \ --output_dir="/data/prescient-lm/experiment/checkpointing/0.5B-finetune-alpaca" \ --per_device_train_batch_size 4 **7B Model** - Assuming 4 a100s are available: - Required to convert Prescient-LM model to the HF format first. (See `text-generation-with-Huggingface.ipynb`) On Bash Shell: export OMP_NUM_THREADS=1 torchrun --nproc_per_node=4 --master_port=9987 \ finetuning_alpaca_huggingface.py \ --model_name=7B-latest \ --data_path="alpaca_data_cleaned_archive.json" \ --output_dir="output-HF-finetuned/7B-nonQ-finetune" \ --per_device_train_batch_size 1 \ --bf16 True \ --tf32 True \ --fsdp "full_shard auto_wrap" \ --fsdp_transformer_layer_cls_to_wrap 'LlamaDecoderLayer' ## 2. Script for LoRA fine-tuning **0.5B Model** python finetuning_alpaca_huggingface.py \ --model_name=0.5B-latest \ --data_path="alpaca_data_cleaned_archive.json" \ --output_dir="output-HF-finetuned/0.5B-nonQ-lora" \ --per_device_train_batch_size 2 \ --use_lora True **7B Model** export OMP_NUM_THREADS=1 torchrun --nproc_per_node=4 --master_port=9987 \ finetuning_alpaca_huggingface.py \ --model_name=7B-latest \ --data_path="alpaca_data_cleaned_archive.json" \ --output_dir="output-HF-finetuned/7B-nonQ-lora" \ --per_device_train_batch_size 2 \ --use_lora True \ --bf16 True \ --tf32 True ## 3. Script for Quantized LoRA **0.5B Model** python finetuning_alpaca_huggingface.py \ --model_name=0.5B-latest \ --data_path="alpaca_data_cleaned_archive.json" \ --output_dir="output-HF-finetuned/0.5B-8bitQ-lora" \ --per_device_train_batch_size 2 \ --use_lora True \ --load_in_4bit True **7B Model** python finetuning_alpaca_huggingface.py \ --model_name=7B-latest \ --data_path="alpaca_data_cleaned_archive.json" \ --output_dir="output-HF-finetuned/7B-8bitQ-lora" \ --per_device_train_batch_size 2 \ --use_lora True \ --load_in_4bit True \ --per_device_train_batch_size 1 ## After training See `generate_with_alpaca_huggingface.py`. """ import json import copy import logging from dataclasses import dataclass, field from typing import Dict, Optional, Sequence from peft import LoraConfig, get_peft_model, prepare_model_for_kbit_training import torch import transformers from torch.utils.data import Dataset from transformers import Trainer, BitsAndBytesConfig import prescient_lm as plm IGNORE_INDEX = -100 # This is the value we use to mask the "question" part (or user instruction). Timesteps replaced with this value will be ignored during the loss calculation. DEFAULT_PAD_TOKEN = "<pad>" DEFAULT_EOS_TOKEN = "</s>" DEFAULT_BOS_TOKEN = "<s>" DEFAULT_UNK_TOKEN = "<unk>" # This is the Alpaca-style prompt format for instruction finetuning. PROMPT_DICT = { "prompt_input": ( f"{DEFAULT_BOS_TOKEN}Below is an instruction that describes a task, paired with an input that provides further context. " "Write a response that appropriately completes the request.\n\n" "### Instruction:\n{instruction}\n\n### Input:\n{input}\n\n### Response:" ), "prompt_no_input": ( f"{DEFAULT_BOS_TOKEN}Below is an instruction that describes a task. " "Write a response that appropriately completes the request.\n\n" "### Instruction:\n{instruction}\n\n### Response:" ), } # data: list of dict, keys are # - "report_text" (=merged from many columns to create text) # - "outcome" (=status) PROMPT_DICT = { "prompt_input": ( f"{DEFAULT_BOS_TOKEN}Below is a clinical trial report record." "\n\n" "{report_text}" "\n" "Please estimate the success rate of this clinical trial.\n\n" "" ) # later, we append f"The success rate is {probability}" } @dataclass class ModelArguments: model_name: Optional[str] = field(default="0.5B-latest", metadata={"help": "Model name from plm_api.list_hf_models()"}) use_lora: Optional[bool] = field(default=False) load_in_4bit: Optional[bool] = field(default=False) torch_dtype: Optional[str] = field(default="auto", metadata={"help": "torch dtype. passed to `from_pretrained()."}) @dataclass class DataArguments: data_path: str = field(default=None, metadata={"help": "Path to the training data."}) @dataclass class TrainingArguments(transformers.TrainingArguments): cache_dir: Optional[str] = field(default=None) optim: str = field(default="adamw_torch") model_max_length: int = field( default=512, metadata={"help": "Maximum sequence length. Sequences will be right padded (and possibly truncated)."}, ) gradient_accumulation_steps: int = field( default=64, metadata={"help": "Number of updates steps to accumulate before performing a backward/update pass."}, ) num_train_epochs: float = field(default=3.0, metadata={"help": "Total number of training epochs to perform."}) learning_rate: float = field(default=2e-5, metadata={"help": "The initial learning rate for AdamW."}) lr_scheduler_type: str = field(default="cosine", metadata={"help": "The type of scheduler."}) save_strategy: str = field(default="no") @dataclass class MiscArguments: use_bos_token: Optional[bool] = field(default=False) def print_trainable_parameters(model): """ Prints the number of trainable parameters in the model. """ trainable_params = 0 all_param = 0 for _, param in model.named_parameters(): all_param += param.numel() if param.requires_grad: trainable_params += param.numel() print( f"trainable params: {trainable_params} || all params: {all_param} || trainable%: {100 * trainable_params / all_param}" ) def smart_tokenizer_and_embedding_resize( special_tokens_dict: Dict, tokenizer: transformers.PreTrainedTokenizer, model: transformers.PreTrainedModel, ): """Resize tokenizer and embedding. Note: This is the unoptimized version that may make your embedding size not be divisible by 64. """ num_new_tokens = tokenizer.add_special_tokens(special_tokens_dict) model.resize_token_embeddings(len(tokenizer)) if num_new_tokens > 0: input_embeddings = model.get_input_embeddings().weight.data output_embeddings = model.get_output_embeddings().weight.data input_embeddings_avg = input_embeddings[:-num_new_tokens].mean(dim=0, keepdim=True) output_embeddings_avg = output_embeddings[:-num_new_tokens].mean(dim=0, keepdim=True) input_embeddings[-num_new_tokens:] = input_embeddings_avg output_embeddings[-num_new_tokens:] = output_embeddings_avg def _tokenize_fn(strings: Sequence[str], tokenizer: transformers.PreTrainedTokenizer) -> Dict: """Tokenize a list of strings. This function constructs a dictionary of input_ids, labels, input_ids_lens, labels_lens based on the tokenizer's model_max_length. """ tokenized_list = [ tokenizer( text, return_tensors="pt", padding="longest", max_length=tokenizer.model_max_length, truncation=True, ) for text in strings ] input_ids = labels = [tokenized.input_ids[0] for tokenized in tokenized_list] input_ids_lens = labels_lens = [ tokenized.input_ids.ne(tokenizer.pad_token_id).sum().item() for tokenized in tokenized_list ] return dict( input_ids=input_ids, labels=labels, input_ids_lens=input_ids_lens, labels_lens=labels_lens, ) def preprocess( sources: Sequence[str], targets: Sequence[str], tokenizer: transformers.PreTrainedTokenizer, ) -> Dict: """Preprocess the data by tokenizing by masking the beginnings of the target sequence (labels).""" examples = [s + t for s, t in zip(sources, targets)] examples_tokenized, sources_tokenized = [_tokenize_fn(strings, tokenizer) for strings in (examples, sources)] input_ids = examples_tokenized["input_ids"] labels = copy.deepcopy(input_ids) for label, source_len in zip(labels, sources_tokenized["input_ids_lens"]): label[:source_len] = IGNORE_INDEX return dict(input_ids=input_ids, labels=labels) class SupervisedDataset(Dataset): """Dataset for supervised fine-tuning. Parameters ---------- data_path : str Path to the training data (json file) - Alpaca instruction. tokenizer : transformers.PreTrainedTokenizer Tokenizer used in the model. """ def __init__(self, data_path: str, tokenizer: transformers.PreTrainedTokenizer): super(SupervisedDataset, self).__init__() logging.warning("Loading data...") with open(data_path, "r") as f: list_data_dict = json.load(f) logging.warning("Formatting inputs...") prompt_input, prompt_no_input = PROMPT_DICT["prompt_input"], PROMPT_DICT["prompt_no_input"] sources = [ prompt_input.format_map(example) if example.get("input", "") else prompt_no_input.format_map(example) for example in list_data_dict ] targets = [f"{example['output']}{tokenizer.eos_token}" for example in list_data_dict] logging.warning("Tokenizing inputs... This may take some time...") data_dict = preprocess(sources, targets, tokenizer) self.input_ids = data_dict["input_ids"] self.labels = data_dict["labels"] def __len__(self): return len(self.input_ids) def __getitem__(self, i) -> Dict[str, torch.Tensor]: """ Returns ------- A dictionary with the following keys: - input_ids (:obj:`torch.Tensor` of shape :obj:`[sequence_length]`): Indices of input sequence tokens in the vocabulary. BOS token + prompt + EOS token + Padding tokens - labels (:obj:`torch.Tensor` of shape :obj:`[sequence_length]`): Indices of labels in the vocabulary. Masking tokens (IGNORE_INDEX) + output + EOS token + Padding tokens """ return dict(input_ids=self.input_ids[i], labels=self.labels[i]) @dataclass class DataCollatorForSupervisedDataset(object): """Collate examples for supervised fine-tuning.""" tokenizer: transformers.PreTrainedTokenizer def __call__(self, instances: Sequence[Dict]) -> Dict[str, torch.Tensor]: input_ids, labels = tuple([instance[key] for instance in instances] for key in ("input_ids", "labels")) input_ids = torch.nn.utils.rnn.pad_sequence( input_ids, batch_first=True, padding_value=self.tokenizer.pad_token_id ) labels = torch.nn.utils.rnn.pad_sequence(labels, batch_first=True, padding_value=IGNORE_INDEX) return dict( input_ids=input_ids, labels=labels, attention_mask=input_ids.ne(self.tokenizer.pad_token_id), ) def make_supervised_data_module(tokenizer: transformers.PreTrainedTokenizer, data_args) -> Dict: """Make dataset and collator for supervised fine-tuning.""" train_dataset = SupervisedDataset(tokenizer=tokenizer, data_path=data_args.data_path) data_collator = DataCollatorForSupervisedDataset(tokenizer=tokenizer) return dict(train_dataset=train_dataset, eval_dataset=None, data_collator=data_collator) def train(): parser = transformers.HfArgumentParser((ModelArguments, DataArguments, TrainingArguments)) model_args, data_args, training_args = parser.parse_args_into_dataclasses() plmapi = plm.PlmApi() model, tokenizer = plmapi.load_hf_model(model_args.model_name, quantization_config=BitsAndBytesConfig( load_in_4bit=model_args.load_in_4bit, ), torch_dtype=model_args.torch_dtype ) # HF model and TokenizerFast tokenizer.model_max_length = 2048 if model_args.load_in_4bit: if not model_args.use_lora: raise ValueError("LoRA must be enabled when loading in 8bit.") logging.info('Preparing the model (freezing base model params)..') model = prepare_model_for_kbit_training(model) # now the quantized base model is frozen. if model_args.use_lora: model.save_pretrained(save_directory=training_args.output_dir) # the basemodel is saved now. (config.json, generation_config.json, pytorch_model.bin`) # this is needed because when lora is enabled, `trainer.save_model` saves the adaptor model only. peft_config = LoraConfig( r=16, lora_alpha=32, target_modules=["q_proj", "v_proj"], lora_dropout=0.05, bias="none", task_type="CAUSAL_LM", ) model = get_peft_model(model, peft_config) # now the model is with the LoRA "adaptor" model. print_trainable_parameters(model) # if LoRA, expect only adaptor model params to be trainable. special_tokens_dict = dict() if tokenizer.pad_token is None: special_tokens_dict["pad_token"] = DEFAULT_PAD_TOKEN if tokenizer.eos_token is None: special_tokens_dict["eos_token"] = DEFAULT_EOS_TOKEN if tokenizer.bos_token is None: special_tokens_dict["bos_token"] = DEFAULT_BOS_TOKEN if tokenizer.unk_token is None: special_tokens_dict["unk_token"] = DEFAULT_UNK_TOKEN smart_tokenizer_and_embedding_resize( special_tokens_dict=special_tokens_dict, tokenizer=tokenizer, model=model, ) adam = torch.optim.AdamW(model.parameters(), lr=training_args.learning_rate) data_module = make_supervised_data_module(tokenizer=tokenizer, data_args=data_args) trainer = Trainer(model=model, tokenizer=tokenizer, args=training_args, optimizers=(adam, transformers.get_constant_schedule(adam)), **data_module) trainer.train() trainer.save_model(output_dir=training_args.output_dir) # todo: With Qlora, sometimes it fails to pickle TrainingArguments. I had no time to debug it yet. # But the models are saved correctly as pickling `trainer.args` is done at the very end of the process. # if finetuning (no LoRA), now there are # [config.json, generation_config.json, pytorch_model.bin, # special_tokens_map.json, tokenizer_config.json, tokenizer.json, training_args.bin] in the `output_dir`. # # if LoRA, now there are # [adapter_config.json, adapter_model.bin, config.json, generation_config.json, pytorch_model.bin, # special_tokens_map.json, tokenizer_config.json, tokenizer.json, training_args.bin] in the `output_dir`. # QLoRa is the same, with additional `README.md`. if __name__ == "__main__": train() ``` Data Preprocessing ## Conver csv to json Usage ``` $ python reformat.py hogehoge.csv ``` ```python= # reformat.py if __name__ == '__main__': import sys import pandas as pd import json # コマンドライン引数から入力ファイルのパスを受け取る # get filepath input_file = sys.argv[1] # load dataset by pandas df = pd.read_csv(input_file) output_file = input_file.replace('.csv', '.json') # カラムを抽出 # extract colmuns diseases = df['diseases'].tolist() icdcodes = df['icdcodes'].tolist() drugs = df['drugs'].tolist() smiless = df['smiless'].tolist() criteria = df['criteria'].tolist() status = df['status'].tolist() # re-format to jsonl json_data = [] for i in range(len(diseases)): json_data.append({ "input_text": "disease: {}, icdcodes: {}, drugs: {}, smiless: {}, criteria: {}".format(diseases[i], icdcodes[i], drugs[i], smiless[i], criteria[i]), "output": status[i] }) # JSON ファイルに出力 # output json file with open(output_file, 'w') as f: json.dump(json_data, f) ```

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully