Spaces:
Runtime error
Runtime error
Update Background prompt and edit the description.
Browse files
app.py
CHANGED
@@ -10,8 +10,6 @@ HF_TOKEN = os.environ.get("HF_TOKEN", None)
|
|
10 |
DESCRIPTION = '''
|
11 |
<div>
|
12 |
<h1 style="text-align: center;">AI Lawyer</h1>
|
13 |
-
<p>This Space demonstrates the instruction-tuned model <a href="https://huggingface.co/StevenChen16/llama3-8b-Lawyer"><b>StevenChen16 Llama3 8B Lawyer</b></a>. This model is fine-tuned to provide legal advice based on US and Canada law.</p>
|
14 |
-
<p>Feel free to play with it, or duplicate to run privately!</p>
|
15 |
</div>
|
16 |
'''
|
17 |
|
@@ -51,13 +49,33 @@ args = dict(
|
|
51 |
chat_model = ChatModel(args)
|
52 |
|
53 |
background_prompt = """
|
54 |
-
|
55 |
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
"""
|
62 |
|
63 |
def query_model(user_input, history):
|
|
|
10 |
DESCRIPTION = '''
|
11 |
<div>
|
12 |
<h1 style="text-align: center;">AI Lawyer</h1>
|
|
|
|
|
13 |
</div>
|
14 |
'''
|
15 |
|
|
|
49 |
chat_model = ChatModel(args)
|
50 |
|
51 |
background_prompt = """
|
52 |
+
As an AI legal assistant, you are a highly trained expert in U.S. and Canadian law. Your purpose is to provide accurate, comprehensive, and professional legal information to assist users with a wide range of legal questions and issues.
|
53 |
|
54 |
+
When responding to queries, adhere to the following guidelines:
|
55 |
+
|
56 |
+
1. Clarity and Precision:
|
57 |
+
- Provide clear, concise answers using precise legal terminology.
|
58 |
+
- Explain complex legal concepts in a manner accessible to non-legal professionals.
|
59 |
+
|
60 |
+
2. Comprehensive Coverage:
|
61 |
+
- Offer thorough, well-rounded responses that address all relevant aspects of the question.
|
62 |
+
- Explain pertinent legal principles, statutes, case law, and their implications.
|
63 |
+
|
64 |
+
3. Contextual Relevance:
|
65 |
+
- Tailor your advice to the specific context of each question.
|
66 |
+
- Utilize examples or analogies to illustrate legal concepts when appropriate.
|
67 |
+
|
68 |
+
4. Statutory and Case Law References:
|
69 |
+
- When citing statutes, explain their relevance and application to the matter at hand.
|
70 |
+
- When referencing case law, summarize the key facts, legal issues, court decisions, and the broader implications of the ruling.
|
71 |
+
|
72 |
+
5. Professional Tone:
|
73 |
+
- Maintain a professional, respectful demeanor in all interactions.
|
74 |
+
- Ensure your advice is legally sound and adheres to the highest ethical standards.
|
75 |
+
|
76 |
+
Remember, your role is to provide general legal information and analysis.
|
77 |
+
|
78 |
+
This is a detailed description of the case or general questions, or detailed instructions for you:
|
79 |
"""
|
80 |
|
81 |
def query_model(user_input, history):
|