--- language: - en library_name: transformers license: other --- # Model Card for ContractAssist model Instruction tuned FlanT5-XXL on Legal Clauses data generated via ChatGPT. The model is capable for generating and/or modifying the Legal Clauses. # Model Details ## Model Description - **Developed by:** Jaykumar Kasundra, Shreyans Dhankhar - **Model type:** Language model - **Language(s) (NLP):** en - **License:** other - **Resources for more information:** - [Associated Paper]() # Uses ### Prompt
Click to expand ```python { "prompt_input": ( "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:\n" ), "prompt_no_input": ( "Below is an instruction that describes a task. " "Write a response that appropriately completes the request.\n\n" "### Instruction:\n{instruction}\n\n### Response:\n" ), } ```
### Running the model on a GPU in 8bit
Click to expand ```python # pip install accelerate peft bitsandbytes import torch from transformers import AutoModelForSeq2SeqLM, AutoTokenizer from peft import PeftModel,PeftConfig peft_model_id = 'NebulaSense/ContractAssist' peft_config = PeftConfig.from_pretrained(peft_model_id) model = AutoModelForSeq2SeqLM.from_pretrained(peft_config.base_model_name_or_path, device_map="auto",load_in_8bit=True) tokenizer = AutoTokenizer.from_pretrained(peft_config.base_model_name_or_path) model = PeftModel.from_pretrained(model, peft_model_id) model.eval() ```
### Example
Click to expand ```python ### Instruction: Include a language in the agreement's final paragraph specifying how confidential information will be returned. ### Input: Confidentiality: The Receiving Party agrees to hold in confidence the Confidential Information and not to use or disclose the Confidential Information except as necessary to perform its obligations hereunder or as required by law. The Receiving Party will use the same degree of care that it uses to protect its own confidential information of like kind (but in no event less than reasonable care) to protect the confidentiality and avoid the unauthorized use, disclosure, publication or dissemination of the Confidential Information. The Receiving Party will promptly notify the Disclosing Party in writing of any unauthorized use or disclosure of the Confidential Information. ### Response: output prediction: ['Confidentiality: The Receiving Party agrees to hold in confidence the Confidential Information and not to use or disclose the Confidentious Information except as necessary to perform its obligations hereunder or as required by law. The Receivable Party will use the same degree of care that it uses to protect its own confidential information of like kind (but in no event less than reasonable care) to protect the confidentiality and avoid the unauthorized use, disclosure, publication or dissemination of the Confidence Information. The Receiver Party will promptly notify the Disclosing Party in writing of any unauthorized uses or disclosures of the confidential information. Upon termination or expiration of this Agreement, the Receiving Partie will promptly return to the DISCLOSING PARTY all Confidencial Information received from the OTHER PARTIES, including all copies, extracts, summaries, or other reproductions thereof.'] ```
## Direct Use The model can directly be used to generate/modify legal clauses and help assist in drafting contracts. It likely works best on english language. ## Compute Infrastructure Amazon SageMaker Training Job. ### Hardware 1 x 24GB NVIDIA A10G ### Software Transformers, PEFT, BitsandBytes # Citation **BibTeX:** # Model Card Authors Jaykumar Kasundra, Shreyans Dhankhar