aaronfleury commited on
Commit
b82602c
1 Parent(s): bf2bc36

Update space

Browse files
Files changed (1) hide show
  1. app.py +17 -1
app.py CHANGED
@@ -1,3 +1,19 @@
1
  import gradio as gr
 
2
 
3
- gr.load("models/umarbutler/open-australian-legal-llm").launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
+ from transformers import pipeline
3
 
4
+ model = pipeline("text-generation", model="umarbutler/open-australian-legal-llm")
5
+
6
+ def chatbot(input_text):
7
+ prompt = "You are an expert in NSW planning law. " + input_text
8
+ response = model(prompt, max_length=100, num_return_sequences=1)
9
+ return response[0]['generated_text']
10
+
11
+ iface = gr.Interface(
12
+ fn=chatbot,
13
+ inputs=gr.inputs.Textbox(lines=2, placeholder="Enter your question here..."),
14
+ outputs="text",
15
+ title="NSW Planning Law Chatbot",
16
+ description="Ask questions about NSW planning law."
17
+ )
18
+
19
+ iface.launch()