File size: 587 Bytes
3ab38a2
b82602c
3ab38a2
b82602c
 
 
 
 
 
 
 
 
3a7c5dd
b82602c
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import gradio as gr
from transformers import pipeline

model = pipeline("text-generation", model="umarbutler/open-australian-legal-llm")

def chatbot(input_text):
    prompt = "You are an expert in NSW planning law. " + input_text
    response = model(prompt, max_length=100, num_return_sequences=1)
    return response[0]['generated_text']

iface = gr.Interface(
    fn=chatbot,
    inputs=gr.Textbox(lines=2, placeholder="Enter your question here..."),
    outputs="text",
    title="NSW Planning Law Chatbot",
    description="Ask questions about NSW planning law."
)

iface.launch()