Views
No views yet
unsloth/llama-3-8b-bnb-4bitunsloth for 2x faster inference, but standard peft works too.1pip install unsloth
21from unsloth import FastLanguageModel
2
3model, tokenizer = FastLanguageModel.from_pretrained(
4 model_name = "YOUR_HF_USERNAME/llama-3-8b-text-to-sql-lora", # Replace with your Repo ID
5 max_seq_length = 2048,
6 dtype = None,
7 load_in_4bit = True,
8)
9FastLanguageModel.for_inference(model)
101pip install transformers peft bitsandbytes
21from peft import PeftModel, PeftConfig
2from transformers import AutoModelForCausalLM, AutoTokenizer
3
4config = PeftConfig.from_pretrained("YOUR_HF_USERNAME/llama-3-8b-text-to-sql-lora")
5base_model = AutoModelForCausalLM.from_pretrained("unsloth/llama-3-8b-bnb-4bit")
6model = PeftModel.from_pretrained(base_model, "YOUR_HF_USERNAME/llama-3-8b-text-to-sql-lora")
7tokenizer = AutoTokenizer.from_pretrained("YOUR_HF_USERNAME/llama-3-8b-text-to-sql-lora")
81Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
2
3### Instruction:
4{INSTRUCTION}
5
6### Input:
7{INPUT_DESCRIPTION}
8
9### Response:
10Design a standard normalized SQL schema for this scenario. Use standard many-to-many relationship tables to ensure data integrity without redundancy.
Hospital Management System. The database consists of the following tables: TablePatienthas columns: Patient_ID, Name, DOB, Insurance_Provider. TableDoctorhas columns: Doctor_ID, Name, Specialty, Years_Exp. TableAppointmenthas columns: Appt_ID, Date, Time, Room_Number, Patient_ID, Doctor_ID. Foreign key relationships: TableAppointmentcontains a foreign key references tablePatient. TableAppointmentcontains a foreign key references tableDoctor.
Design a denormalized SQL schema using a Transaction table. You MUST allow for historical repetition and duplicate entries. Do NOT use standard relationship tables.
Hospital Management System. The database consists of the following tables: TablePatienthas columns: Patient_ID, Name, DOB, Insurance_Provider. TableDoctorhas columns: Doctor_ID, Name, Specialty, Years_Exp. TableTransaction_Loghas columns: Transaction_ID, Visit_Date, Room_Number, Procedure_Code, Billed_Amount, Patient_ID, Doctor_ID. Foreign key relationships: TableTransaction_Logcontains a foreign key references tablePatient. TableTransaction_Logcontains a foreign key references tableDoctor.