Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files- Dockerfile +0 -0
- src/llm.py +14 -3
Dockerfile
CHANGED
|
Binary files a/Dockerfile and b/Dockerfile differ
|
|
|
src/llm.py
CHANGED
|
@@ -25,6 +25,16 @@ Rules you must follow:
|
|
| 25 |
4. Always cite the Judgment ID when referencing a case
|
| 26 |
5. If excerpts don't contain enough information, say so explicitly
|
| 27 |
6. End every response with: "NOTE: This is not legal advice. Consult a qualified advocate."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
"""
|
| 29 |
|
| 30 |
@retry(
|
|
@@ -41,7 +51,8 @@ def call_llm(query: str, context: str) -> str:
|
|
| 41 |
SUPREME COURT JUDGMENT EXCERPTS:
|
| 42 |
{context}
|
| 43 |
|
| 44 |
-
Answer based only on the excerpts above. Cite judgment IDs.
|
|
|
|
| 45 |
|
| 46 |
response = _client.chat.completions.create(
|
| 47 |
model="llama-3.3-70b-versatile",
|
|
@@ -50,7 +61,7 @@ Answer based only on the excerpts above. Cite judgment IDs."""
|
|
| 50 |
{"role": "user", "content": user_message}
|
| 51 |
],
|
| 52 |
temperature=0.1,
|
| 53 |
-
max_tokens=
|
| 54 |
)
|
| 55 |
-
|
| 56 |
return response.choices[0].message.content
|
|
|
|
| 25 |
4. Always cite the Judgment ID when referencing a case
|
| 26 |
5. If excerpts don't contain enough information, say so explicitly
|
| 27 |
6. End every response with: "NOTE: This is not legal advice. Consult a qualified advocate."
|
| 28 |
+
|
| 29 |
+
Formatting rules — follow these exactly:
|
| 30 |
+
- Use numbered lists (1. 2. 3.) when listing multiple points or steps
|
| 31 |
+
- Use bullet points (- item) for sub-points or supporting details
|
| 32 |
+
- Use markdown tables (| Col | Col |) when comparing options side by side
|
| 33 |
+
- Use **bold** for important terms, case names, and section numbers
|
| 34 |
+
- Use headers (## Heading) to separate major sections in long answers
|
| 35 |
+
- Never write everything as one long paragraph
|
| 36 |
+
- Each distinct point must be on its own line
|
| 37 |
+
- Always put a blank line between sections
|
| 38 |
"""
|
| 39 |
|
| 40 |
@retry(
|
|
|
|
| 51 |
SUPREME COURT JUDGMENT EXCERPTS:
|
| 52 |
{context}
|
| 53 |
|
| 54 |
+
Answer based only on the excerpts above. Cite judgment IDs.
|
| 55 |
+
Use proper markdown formatting — numbered lists, bullet points, tables, bold text as appropriate."""
|
| 56 |
|
| 57 |
response = _client.chat.completions.create(
|
| 58 |
model="llama-3.3-70b-versatile",
|
|
|
|
| 61 |
{"role": "user", "content": user_message}
|
| 62 |
],
|
| 63 |
temperature=0.1,
|
| 64 |
+
max_tokens=1500
|
| 65 |
)
|
| 66 |
+
|
| 67 |
return response.choices[0].message.content
|