After fine-tuning model returns repetitive character in response

Hi All,

Did the fine tuning for with model “hiieu/Meta-Llama-3-8B-Instruct-function-calling-json-mode”,

with training and validation data set
sample of training data file,

[
{
“prompt”: “"""\nRead the below given definitions and extract information from the provided legal document. It contains information about financial transactions and legal outcomes.\n\nFollowing definitions are related to PROFILE:\nFINANCIAL: Contains information about recovery of money.\nNON_FINANCIAL: Cases that are not filed for recovery of money are considered Not Financial Disputes. Applications in a main case are not financial disputes. For cases of negotiable instruments, a court order taking Cognizance of a complaint under Section 138 of the Negotiable Instruments Act is Not a Financial Dispute because the trial has not commenced and there is no financial data in the case. An order directing issuing of summons to companies or individuals is not a Financial Dispute. Interlocutory applications and cases seeking injunctions are not financial disputes. Applications for Transfer of a case are not financial disputes. Cases for postponement or for the addition of parties and arbitration cases are not Financial Disputes.\n\nFollowing definitions are related to DISPUTE_TYPE:\n- LOAN_RECOVERY: Loan recovery means cases filed by a creditor for recovery of money from the borrower. Cases filed for recovering working capital, bank guarantee, term loan are also loan recovery cases. Cases filed for recovery of refundable security deposit money given while renting/leasing out any property are also loan recovery cases. In the NCLT, loan recovery cases are filed under Section 7 or Section 7 Rule 4 of the Insolvency & Bankruptcy Code 2016. Loan Recovery cases are filed by a financial creditor against the corporate debtor to initiate the corporate insolvency resolution process. In the DRT, Loan Recovery cases are filed as an Original Application or O.A seeking recovery of money of loans advanced. In the DRT, Loan Recovery cases may also be filed as a T.A or transferred original application. Loan recovery cases may also appear for settlements in Lok Adalat. In situations where money is demanded for services given it will be determined as a case of recovery from goods and services and not loan recovery Loan recovery cases can be filed in Civil Court, National Company Law Tribunal or the Debts Recovery Tribunal.\n- RECOVERY_FROM_GOODS_AND_SERVICES: Recovery from Goods & Services are cases filed for recovery of money by the petitioner for goods and services sold or delivered to a respondent. Recovery from Goods and Services can also be filed for claiming a refund when goods purchased are not supplied or delivered. Recovery from goods and services can be evidenced by the mentioning of invoices. In the National Company Law Tribunal (NCLT), all cases filed under Section 9 of the Insolvency and Bankruptcy Code 2016 relate to claims by operational creditors who aim at seeking recovering money for the goods and services supplied. All cases filed under Section 9 of the Insolvency and Bankruptcy code are for Recovery for Goods and Services. The principal amount due under the invoices comes under the dispute type \u2018 Recovery from goods and services\u2019. Goods & Services cases can be filed in the NCLT, the High Courts or in the District Civil courts.\n- SARFAESI: SARFAESI cases are filed when Banks or Financial Institutions use the SARFAESI Act to take over a debtor\u2019s property because they have defaulted on a loan. In the Debt Recovery Tribunal (DRT), SARFAESI cases are appeals filed against the Section 13(2) notice or Section 13(4) Notice of SARFAESI Act by the borrower or debtor. SARFAESI cases could also be appeals filed by the borrower or debtor against the Section 14 property possession of SARFAESI Act. In the district courts, SARFAESI cases are filed by the creditor before the relevant Magistrate Court (CMM or ACMM) to take possession of property under Section 14 of SARFAESI Act. Sarfaesi cases can be filed in the DRT, District Magistrates Courts or in the High Court.\n- CHEQUE_BOUNCE: Cheque Bounce cases are only filed under Section 138 of Negotiable Instruments Act/NI Act in order to recover money from the issuer of a bounced cheque. Cheque Bounce cases can be also filed before the relevant District Magistrate Courts.\n- DAMAGE_RECOVERY: Damage recovery cases are filed in order to gain compensation for the infringement of a personal right of a person. Damage Recovery cases are filed before the district civil courts.\n- EXCESS_PAYMENT_RECOVERY: Excess payment recovery cases are filed for recovery of money by the petitioner when an excess amount of petitioner\u2019s money has been paid to respondent unintentionally or unknowingly. Excess Payment Recovery cases are filed before the district civil courts.\n\nFollowing definitions are related to VERDICT:\n- ALLOWED: The court orders the defendant to pay the amount as claimed by the petitioner.\n- DISMISSED: The case is dismissed. However, when there is a settlement or any direction to file the claim before the IRP or RP the case verdict is not dismissed. Verdict is dismissed only if there is no settlement nor any direction to file the claim before the IRP or RP.\n- PARTLY_ALLOWED: The court orders the respondent to pay the partial amount of money claimed by the petitioner.\n- WITHDRAWN_AS_SETTLED: The case has been withdrawn by the petitioner because there is an out of court settlement or there has been some payment or money deposit made to the petitioner/applicant.\n- WITHDRAWN: The case has been withdrawn as dismissed or for any reason other than settlement of compromise.\n- REFERENCE: The court refers the case to a higher court from a lower court.\n- DIRECTED_FILE_CLAIM_BEFORE_IRP_IP: When the petitioner is directed to or can file his claim before the IRP or RP but is not granted any payment by the tribunal.\n\nFollowing definitions are related to AMOUNT_TYPE:\n- CLAIMED_AMOUNT: The amount that the petitioner claims, for the wrongdoing done against him/her by the respondent.\n- RELIEF_AMOUNT: The amount that the court has ordered the respondent to pay to the petitioner.\n- SETTLEMENT_AMOUNT: In cases wherein, the parties have settled the dispute amicably outside the court.\n\nWhen the VERDICT is "ALLOWED" or "PARTLY_ALLOWED", set the AMOUNT_TYPE to "RELIEF_AMOUNT".\nWhen the VERDICT is "DISMISSED", "WITHDRAWN", "REFERENCE", or "DIRECTED_FILE_CLAIM_BEFORE_IRP_IP", set the AMOUNT_TYPE to "CLAIMED_AMOUNT".\nWhen the VERDICT is "WITHDRAWN_AS_SETTLED", set the AMOUNT_TYPE to "SETTLEMENT_AMOUNT". If "SETTLEMENT_AMOUNT" is not available, set the AMOUNT_TYPE to "CLAIMED_AMOUNT".\n\nAMOUNT: Identify total "CLAIMED_AMOUNT" or "RELIEF_AMOUNT" or "SETTLEMENT_AMOUNT" as number based on "AMOUNT_TYPE" and "VERDICT".\nDEFAULT_DATE: Is the date from which the respondent stopped repaying money to the petitioner.\nNOTICE_DATE: The date on which a formal written communication is sent to a party in legal context.\n\nNote: If any of the specified data points are not available, please set the value of that data point to "NOT_AVAILABLE".\n\nFormat your response as a JSON object:\n{\n "profile": "PROFILE",\n "disputeType": "DISPUTE_TYPE",\n "verdict": "VERDICT",\n "amountType": "AMOUNT_TYPE",\n "amount": "AMOUNT, Present the amount as number",\n "defaultDate": "DEFAULT_DATE, Present the date or year in YYYY-mm-dd Format",\n "noticeDate": "NOTICE_DATE, Present the date or year in YYYY-mm-dd Format"\n}\nUser text: ‘{user_text}’\nAnswer:\n\n"""”,
“user_text”: “Renaissance Creations Private Limited Vs. Vishal Kumar\n\nIN THE COURT OF ANIL KUMAR, CIVIL JUDGE (JUNIOR DIVISION) (UID\nNO.0524), GURUGRAM.\n\nCIS No. CS37/33/2020\nCNR No.HRGRO02-001090-0020\nDate of Decision:-24.11.2021\nRenaissance Creations Private Limited, registered office at 212, 2" floor, Global Foyer,\nDLF Phase-V, Gurugram, Haryana-122009 through its authorised representative Sh.\nNitin Chopra.\n…Plaintiff\n\nVERSUS\n\nVishal Kumar s/o Sh. Ramesh Prasad Temporary Address House No. 84, Harijan\nColony, DLF Phase 5, Gurugram, Haryana 122009 and permanent resident of 123,\nDigha Ghusuktola, Patna, Bihar-800001.\n\n…Defendant\n\nSUMMARY SUIT UNDER ORDER XXXVII C.P.C. FOR THE RECOVERY OF\n(RUPEES 104147/- ALONGWITH PENDENTE LITE AND FUTURE INTEREST.\n\nPresent: Sh. Vaibhav Mahajan, Advocate for plaintiff.\nDefendant exparte vide order dated 06.10.2021.\n\nJUDGEMENT\n\n1. The plaintiff has filed the present suit under Order 37 CPC for the recovery of\nRs. 104147/-.\n\n2. Briefly stated, plaintiff prayed for passing a decree of declaration for recovery of\nRs. 104147/- in favour of the plaintiff and against the defendants along with\npendente lite and future interest on the said amount at the rate of 24 % per annum\nfrom the date of filing of the present suit till the realization of the decretal amount.\nAn order awarding costs of the suit in favour of the plaintiff and against the\n\ndefendants. The plaintiff is a Private Limited Company having its office at the\n\nANIL KUMAR\nCIVIL JUDGE (J.D), GURUGRAM\n24.11.2021, HRO524\nRenaissance Creations Private Limited Vs. Vishal Kumar\n\naddress mentioned above and Nitin Chopra is representative of the plaintiff\ncompany. Plaintiff is engaged in the business of manufacturing, wholesaling and\nretailing high-quality assortment of scented pillar candles, scented votive candles\n\nand tea lights.\n\n3. Defendant was employed as a driver in the plaintiff company and so the company\nfor a long period of time, buildings trust in the company. Defendant was also inhabit\nof asking for advances from the plaintiff company as the defendant was facing\ncertain financial problems and plaintiff company being assured by the defendant of\ngood character in good faith granted the defendant such advances on various\noccasions on the defendant\u2019s assurance that the said amount of advance would be\nrepaid and a total amount of Rs.104147/-is accordingly due which is to be paid by\n\ndefendant as per the ledger accounts of the plaintiff company.\n\n4. In May 2 019, the defendant expressed his desire to resign from the plaintiff\ncompany and assured the plaintiff to make the repayment of the unpaid amount\nthrough a promissory note executed on dated 03/05/2019, whereby the defendant\npromised to make the payment of the due amount in a time bound manner.\nDefendant also issued to the plaintiff company 17 cheques dated 11/10/2019 as\nsecurity towards the payment of the aforesaid due amount and authorised the\nplaintiff company to deposit the same for the purpose of encashment in case the\ndefendant defaults in making the aforementioned payments according to the\npayment schedule. However, all the checks have been dishonoured why dated me\n\nmost dated 04/12/2019 with the reason \u201cFunds Insufficient\u201d. It is also submitted that\n\nANIL KUMAR\nCIVIL JUDGE (J.D), GURUGRAM\n24.11.2021, HR0524\nRenaissance Creations Private Limited Vs. Vishal Kumar\n\non few occasions some amount of the advanced loan were given to the defendant by\nMs. Ridhima Kansal, director of the plaintiff company through her personal bank\naccounts on the behalf of plaintiff company. Plaintiff constantly reminded the\nplaintiff but despite that plaintiff failed to respect the promised schedule. Defendant\nstarted avoiding calls and meetings with representatives of the plaintiff for the\npayment. Subsequently, the plaintiffs served upon the defendant a legal notice dated\n09/12/2019 and same was duly received by defendant. However, the defendant still\nhas not paid the outstanding amount.\n\n5. It has further stated that defendants have succeeded in obtaining advance loanof\nsaid amount of Rs. 104147/- from plaintiff in a fraudulent and deceitful manner and\nplaintiff specifically reserves its right to prosecute the defendant in this behalf. After\ndishonor of aforesaid cheque the plaintiff contacted the defendants many times and\nrequested the defendants to clear all the dues of the plaintiff but defendants did not\npay any heed to the request of plaintiff to pay any amount to the plaintiff. At last\nplaintiff filed the present suit.\n\n6. Plaintiff firm is entitled to a decree of Rs. 104147/-. Plaintiff is also entitled to\npendent lite and future interest @ 24% per annum on the said amount.\n\n7. No relief claimed in the present suit falls outside the scope of provisions of Order\nXXXVII Code of Civil Procedure and the plaintiff is only seeking to recover debt or\nliquidated demand payable by the defendants arising on the basis of the invoice and\n\ncheque. The cause of action for the first time arose in favour of the plaintiff and\n\nANIL KUMAR\nCIVIL JUDGE (J.D), GURUGRAM\n24.11.2021, HR0524\nRenaissance Creations Private Limited Vs. Vishal Kumar\n\nagainst the defendant, when the plaintiff provided advance loan to defendant and the\ndefendant received the aforesaid advance loan and issued the cheque in favour of\nplaintiff and executed promissory note. Thus the cause of action continues to arise in\nfavour of the plaintiff and against the defendant till today. This court has the\nterritorial jurisdiction to entertain and the instant suit, because the aforesaid advance\nloan provided to the defendant in Gurugram and the cheque of defendant was issued\nand delivered to the plaintiff by the defendant in Gurugram. Hence, the present suit.\n\n8. The present suit was filed on 12.03.2020 and vide order dated 12.03.2020, the\nservice of the defendant was ordered to be effected and the summons were ordered\nto be issued in form-IV of Appendix-B of CPC. Together with the summons, the\ncopy of the plaint and annexures thereto were ordered to be served on the\ndefendants. On 16.10.2021, defendant was proceeded against exparte. As the\ndefendant has not lead to defend and has proceeded against exparte on 16.10.2021,\nso, in the said scenario is attracted Order 37 rule 2 sub rule (3) of Code of Civil\nProcedure, 1908 which is in the following terms:-\n\n9. \u201cThe defendant shall not defend the suit referred to in sub-rule(1) unless he\nenters an appearance and in default of his entering an appearance, the\nallegations in the plaint shall be deemed to be admitted and the plaintiff shall be\nentitled to a decree for any sum, not exceeding the sum mentioned in the\nsummons, together with interest at the rate specified, if any, up to the date of the\nANIL KUMAR\n\nCIVIL JUDGE (J.D), GURUGRAM\n24.11.2021, HRO524\nRenaissance Creations Private Limited Vs. Vishal Kumar\n\ndecree and such sum for costs as may be determined by the High Court from time\nto time by rules made in that behalf and such decree may be executed forthwith\u201d.\n10. As per sub rule 3 of Order 37 Rule 2 C.P.C, if the defendant does not put up\nappearance, then the allegations in the plaint shall be deemed to be admitted. In the\npresent case, the defendants have not put up their appearance, hence, the allegations\nspelled out in the plaint will be considered as admitted. In view of the same, it can\nbe said that the defendants have liability to pay Rs.104147/- at the rate of 24 % per\nannum to the plaintiff. In the title of the suit, it is specifically mentioned that suit is\nunder Order 37 C.P.C. In para 1 of the suit there is specific averment that the present\nsuit is filed under Order 37 of the Code of Civil Procedure, 1908, and no relief,\nwhich does not fall within the ambit of Order XXXVII has been claimed in the\nplaint. The said description complies with the requirement as provided under Order\n37 rule 2 C.P.C.\n\n11. Now, the question comes with respect to the interest. Perusal of Order 37 rule 2\nsub rule (3) of CPC reflects that the plaintiff is entitled to interest up to the date of\ndecree in a suit under Order 37 C.P.C. In other words, interest can be levied in suits\nunder order 37 CPC only up to the date of decree. Relevant portion of said sub rule 3\nof Order 37 rule 2 C.P.C is in the following terms \u201c… the allegations in the\nplaint shall be deemed to be admitted and the plaintiff shall be entitled to a decree\nfor any sum, not exceeding the sum mentioned in the summons, together with\nANIL KUMAR\n\nCIVIL JUDGE (J.D), GURUGRAM\n24.11.2021, HR0524\nRenaissance Creations Private Limited Vs. Vishal Kumar\n\ninterest at the rate, specified, if any, up to the date of _ the\nCOCTCE .ieeeseccesssseceeeseeeees \u201d(emphasis added).\n\n12. Therefore as per mandate of order 37 and also by the authority of Lal Chand Jain\n\nvs. Gheesi AIR 1999 (Rajasthan) 69 and reliance is placed on V.K. Enterprises Vs.\nM/s Shiva Steels (Supreme Court of India) the plaintiff is entitle to the decree. It has\n\nbeen stated that where the suit is based on promissory note, bail of exchange, hundi the\ninitial presumption is to be taken about the genuiness of the claim of the plaintiff unless\nthe defendant succeeded in getting grant to leave to defend. In the result, the suit of the\nplaintiff succeeds and suit of plaintiff stands decreed ex-parte with costs for the recovery\nof Rs.104147/- along with interest @ of 12% per annum from the date of filing of suit\ntill the realization of the decretal amount. Decree sheet be prepared accordingly. File be\n\nconsigned to record room after due compliance.\n\nAnnounced in Open Court\n\nDated: 24.11.2021\nAnil Kumar\nCivil Judge (J.D),Gurugram\nUID-HR0524.\n\nNote: All the pages have been checked and signed by me.\n\nAnnounced in Open Court\n\nDated: 24.11.2021\nAnil Kumar\nCivil Judge (J.D),Gurugram\nUID-HR0524.\n\nANIL KUMAR\nCIVIL JUDGE (J.D), GURUGRAM\n24.11.2021, HRO524\nRenaissance Creations Private Limited Vs. Vishal Kumar\n\nANIL KUMAR\nCIVIL JUDGE (J.D), GURUGRAM\n24.11.2021, HRO524”,
“assistant_text”: “{‘profile’: ‘FINANCIAL’, ‘disputeType’: ‘LOAN_RECOVERY’, ‘verdict’: ‘ALLOWED’, ‘amountType’: ‘RELIEF_AMOUNT’, ‘amount’: 104147.0, ‘defaultDate’: ‘NOT_AVAILABLE’, ‘noticeDate’: ‘2019-12-09’}”
},
{
“prompt”: “"""\nRead the below given definitions and extract information from the provided legal document. It contains information about financial transactions and legal outcomes.\n\nFollowing definitions are related to PROFILE:\nFINANCIAL: Contains information about recovery of money.\nNON_FINANCIAL: Cases that are not filed for recovery of money are considered Not Financial Disputes. Applications in a main case are not financial disputes. For cases of negotiable instruments, a court order taking Cognizance of a complaint under Section 138 of the Negotiable Instruments Act is Not a Financial Dispute because the trial has not commenced and there is no financial data in the case. An order directing issuing of summons to companies or individuals is not a Financial Dispute. Interlocutory applications and cases seeking injunctions are not financial disputes. Applications for Transfer of a case are not financial disputes. Cases for postponement or for the addition of parties and arbitration cases are not Financial Disputes.\n\nFollowing definitions are related to DISPUTE_TYPE:\n- LOAN_RECOVERY: Loan recovery means cases filed by a creditor for recovery of money from the borrower. Cases filed for recovering working capital, bank guarantee, term loan are also loan recovery cases. Cases filed for recovery of refundable security deposit money given while renting/leasing out any property are also loan recovery cases. In the NCLT, loan recovery cases are filed under Section 7 or Section 7 Rule 4 of the Insolvency & Bankruptcy Code 2016. Loan Recovery cases are filed by a financial creditor against the corporate debtor to initiate the corporate insolvency resolution process. In the DRT, Loan Recovery cases are filed as an Original Application or O.A seeking recovery of money of loans advanced. In the DRT, Loan Recovery cases may also be filed as a T.A or transferred original application. Loan recovery cases may also appear for settlements in Lok Adalat. In situations where money is demanded for services given it will be determined as a case of recovery from goods and services and not loan recovery Loan recovery cases can be filed in Civil Court, National Company Law Tribunal or the Debts Recovery Tribunal.\n- RECOVERY_FROM_GOODS_AND_SERVICES: Recovery from Goods & Services are cases filed for recovery of money by the petitioner for goods and services sold or delivered to a respondent. Recovery from Goods and Services can also be filed for claiming a refund when goods purchased are not supplied or delivered. Recovery from goods and services can be evidenced by the mentioning of invoices. In the National Company Law Tribunal (NCLT), all cases filed under Section 9 of the Insolvency and Bankruptcy Code 2016 relate to claims by operational creditors who aim at seeking recovering money for the goods and services supplied. All cases filed under Section 9 of the Insolvency and Bankruptcy code are for Recovery for Goods and Services. The principal amount due under the invoices comes under the dispute type \u2018 Recovery from goods and services\u2019. Goods & Services cases can be filed in the NCLT, the High Courts or in the District Civil courts.\n- SARFAESI: SARFAESI cases are filed when Banks or Financial Institutions use the SARFAESI Act to take over a debtor\u2019s property because they have defaulted on a loan. In the Debt Recovery Tribunal (DRT), SARFAESI cases are appeals filed against the Section 13(2) notice or Section 13(4) Notice of SARFAESI Act by the borrower or debtor. SARFAESI cases could also be appeals filed by the borrower or debtor against the Section 14 property possession of SARFAESI Act. In the district courts, SARFAESI cases are filed by the creditor before the relevant Magistrate Court (CMM or ACMM) to take possession of property under Section 14 of SARFAESI Act. Sarfaesi cases can be filed in the DRT, District Magistrates Courts or in the High Court.\n- CHEQUE_BOUNCE: Cheque Bounce cases are only filed under Section 138 of Negotiable Instruments Act/NI Act in order to recover money from the issuer of a bounced cheque. Cheque Bounce cases can be also filed before the relevant District Magistrate Courts.\n- DAMAGE_RECOVERY: Damage recovery cases are filed in order to gain compensation for the infringement of a personal right of a person. Damage Recovery cases are filed before the district civil courts.\n- EXCESS_PAYMENT_RECOVERY: Excess payment recovery cases are filed for recovery of money by the petitioner when an excess amount of petitioner\u2019s money has been paid to respondent unintentionally or unknowingly. Excess Payment Recovery cases are filed before the district civil courts.\n\nFollowing definitions are related to VERDICT:\n- ALLOWED: The court orders the defendant to pay the amount as claimed by the petitioner.\n- DISMISSED: The case is dismissed. However, when there is a settlement or any direction to file the claim before the IRP or RP the case verdict is not dismissed. Verdict is dismissed only if there is no settlement nor any direction to file the claim before the IRP or RP.\n- PARTLY_ALLOWED: The court orders the respondent to pay the partial amount of money claimed by the petitioner.\n- WITHDRAWN_AS_SETTLED: The case has been withdrawn by the petitioner because there is an out of court settlement or there has been some payment or money deposit made to the petitioner/applicant.\n- WITHDRAWN: The case has been withdrawn as dismissed or for any reason other than settlement of compromise.\n- REFERENCE: The court refers the case to a higher court from a lower court.\n- DIRECTED_FILE_CLAIM_BEFORE_IRP_IP: When the petitioner is directed to or can file his claim before the IRP or RP but is not granted any payment by the tribunal.\n\nFollowing definitions are related to AMOUNT_TYPE:\n- CLAIMED_AMOUNT: The amount that the petitioner claims, for the wrongdoing done against him/her by the respondent.\n- RELIEF_AMOUNT: The amount that the court has ordered the respondent to pay to the petitioner.\n- SETTLEMENT_AMOUNT: In cases wherein, the parties have settled the dispute amicably outside the court.\n\nWhen the VERDICT is "ALLOWED" or "PARTLY_ALLOWED", set the AMOUNT_TYPE to "RELIEF_AMOUNT".\nWhen the VERDICT is "DISMISSED", "WITHDRAWN", "REFERENCE", or "DIRECTED_FILE_CLAIM_BEFORE_IRP_IP", set the AMOUNT_TYPE to "CLAIMED_AMOUNT".\nWhen the VERDICT is "WITHDRAWN_AS_SETTLED", set the AMOUNT_TYPE to "SETTLEMENT_AMOUNT". If "SETTLEMENT_AMOUNT" is not available, set the AMOUNT_TYPE to "CLAIMED_AMOUNT".\n\nAMOUNT: Identify total "CLAIMED_AMOUNT" or "RELIEF_AMOUNT" or "SETTLEMENT_AMOUNT" as number based on "AMOUNT_TYPE" and "VERDICT".\nDEFAULT_DATE: Is the date from which the respondent stopped repaying money to the petitioner.\nNOTICE_DATE: The date on which a formal written communication is sent to a party in legal context.\n\nNote: If any of the specified data points are not available, please set the value of that data point to "NOT_AVAILABLE".\n\nFormat your response as a JSON object:\n{\n "profile": "PROFILE",\n "disputeType": "DISPUTE_TYPE",\n "verdict": "VERDICT",\n "amountType": "AMOUNT_TYPE",\n "amount": "AMOUNT, Present the amount as number",\n "defaultDate": "DEFAULT_DATE, Present the date or year in YYYY-mm-dd Format",\n "noticeDate": "NOTICE_DATE, Present the date or year in YYYY-mm-dd Format"\n}\nUser text: ‘{user_text}’\nAnswer:\n\n"""”,
“user_text”: “C. C. No. 3845/SS/2019\n\nORDER BELOW EXH.-1\n\nThe Complainant is present. Matter is settled between the parties in Lok-\nAdalat. Accordingly accused acquitted. Bail bonds, if any, stands cancelled. The case\nstands disposed off in Lok-Adalat.\n\nThe complainant is entitled to get refund of full court fees amount, if\npaid, i.e. 100 % as per the provision of section 89 of the C.P.C.\n\nSd/-\n(K. G. Sawant)\nMetropolitan Magistrate,\nDt : 25/09/2021. 48" Court, Andheri, Mumbai”,
“assistant_text”: “{‘profile’: ‘NON_FINANCIAL’, ‘disputeType’: ‘NOT_AVAILABLE’, ‘verdict’: ‘NOT_AVAILABLE’, ‘amountType’: ‘NOT_AVAILABLE’, ‘amount’: ‘NOT_AVAILABLE’, ‘defaultDate’: ‘NOT_AVAILABLE’, ‘noticeDate’: ‘NOT_AVAILABLE’}”
}
]

when i run with model with fine tune i do get the expexted response but after fine tuning the response is

Answer:!!!

For reference below is the script used for fine tuning

import os
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM, TrainingArguments, Trainer, DataCollatorForSeq2Seq
from datasets import load_dataset

Configuration

model_id = “meta-llama/Meta-Llama-3-8B-Instruct”

model_id = “hiieu/Meta-Llama-3-8B-Instruct-function-calling-json-mode”

model_id = “meta-llama/Meta-Llama-3-8B”

device = torch.device(“cuda” if torch.cuda.is_available() else “cpu”)
tokenizer = AutoTokenizer.from_pretrained(model_id)

Adding a pad token if it doesn’t exist

if tokenizer.pad_token is None:
tokenizer.add_special_tokens({‘pad_token’: ‘’})
tokenizer.padding_side = “left”

model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.float16, # Switch to float16 precision
device_map=“auto”,
)
model.resize_token_embeddings(len(tokenizer))
model.gradient_checkpointing_enable()
model.config.use_cache = False # Disable use_cache to be compatible with gradient checkpointing

Load datasets

train_data_path = os.path.join(os.path.realpath(os.path.dirname(file)), ‘data/training_file.json’)
val_data_path = os.path.join(os.path.realpath(os.path.dirname(file)), ‘data/validation_file.json’)
train_data = load_dataset(‘json’, data_files=train_data_path)[‘train’]
val_data = load_dataset(‘json’, data_files=val_data_path)[‘train’]

Preprocess function

def preprocess_function(examples):
inputs = [f"{prompt}\n{user_text}" for prompt, user_text in zip(examples[‘prompt’], examples[‘user_text’])]
model_inputs = tokenizer(inputs, padding=‘max_length’, truncation=True, max_length=3000, return_tensors=‘pt’)

with tokenizer.as_target_tokenizer():
    labels = tokenizer(examples['assistant_text'], padding='max_length', truncation=True, max_length=3000,
                       return_tensors='pt').input_ids

# Ensure the lengths match
model_inputs["labels"] = labels
return model_inputs

train_dataset = train_data.map(preprocess_function, batched=True,
remove_columns=[‘prompt’, ‘user_text’, ‘assistant_text’])
val_dataset = val_data.map(preprocess_function, batched=True, remove_columns=[‘prompt’, ‘user_text’, ‘assistant_text’])

train_dataset.set_format(type=‘torch’, columns=[‘input_ids’, ‘attention_mask’, ‘labels’])
val_dataset.set_format(type=‘torch’, columns=[‘input_ids’, ‘attention_mask’, ‘labels’])

Define data collator

data_collator = DataCollatorForSeq2Seq(tokenizer, model=model)

Training arguments

training_args = TrainingArguments(
output_dir=‘./results’,
evaluation_strategy=“epoch”,
learning_rate=2e-5,
per_device_train_batch_size=1, # Further reduced batch size
per_device_eval_batch_size=1, # Further reduced batch size
num_train_epochs=3,
weight_decay=0.01,
gradient_accumulation_steps=8, # Increased gradient accumulation steps
fp16=False, # Mixed precision training
save_steps=10_000, # Adjust save steps to avoid frequent checkpoints
save_total_limit=2, # Limit the number of saved checkpoints
logging_dir=‘./logs’, # Directory for storing logs
logging_steps=500, # Log every 500 steps
)

Initialize Trainer

trainer = Trainer(
model=model,
args=training_args,
train_dataset=train_dataset,
eval_dataset=val_dataset,
tokenizer=tokenizer,
data_collator=data_collator
)

Clear CUDA cache before training

torch.cuda.empty_cache()

Train the model

trainer.train()

Save the model

trainer.save_model(“./trained_model_meta_json”)
tokenizer.save_pretrained(“./trained_model_meta_json”)

No able to understand what went wrong . Please help me understand the issue.