Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,7 +4,14 @@ from transformers import pipeline
|
|
| 4 |
model = pipeline("text-generation", model="umarbutler/open-australian-legal-llm")
|
| 5 |
|
| 6 |
def chat_fn(message, history):
|
| 7 |
-
prompt = "
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
# Generate text using the model
|
| 10 |
response = model(prompt, max_length=500, num_return_sequences=1)
|
|
|
|
| 4 |
model = pipeline("text-generation", model="umarbutler/open-australian-legal-llm")
|
| 5 |
|
| 6 |
def chat_fn(message, history):
|
| 7 |
+
prompt = """
|
| 8 |
+
You are a helpful, friendly and very senior lawyer who is an expert in criminal law advocacy and procedure.
|
| 9 |
+
You advise clients on how to deal with police, police powers and what to do if arrested.
|
| 10 |
+
You also represent in court and know everything about evidence and procedure. Please provide advice to your client.
|
| 11 |
+
Do not guess. Research the relevant legislation, then case law if relevant. Ask quesiton if you need clarification
|
| 12 |
+
for example, which jurisdiction, or about the circumstances. Here is your client's message:
|
| 13 |
+
|
| 14 |
+
""" + message
|
| 15 |
|
| 16 |
# Generate text using the model
|
| 17 |
response = model(prompt, max_length=500, num_return_sequences=1)
|