Spaces:
Build error
Build error
legaltextai
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -29,7 +29,13 @@ def extract_text_from_api(query):
|
|
29 |
|
30 |
@st.cache_data(ttl=3600)
|
31 |
def get_summary(text):
|
32 |
-
model = genai.GenerativeModel('gemini-1.5-pro', generation_config=generation_config
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
|
34 |
try:
|
35 |
response = model.generate_content(f'''You are a law professor specialized in legal writing and legal research.
|
@@ -45,13 +51,7 @@ def get_summary(text):
|
|
45 |
Other opinions (if there are any dissenting or concurring opinions, summarize majority opinion, dissenting opinion and concurring opinion).
|
46 |
Cases cited (which cases the court cited and how it treated them).
|
47 |
Here is the text of the case to be summarized: {text}''',
|
48 |
-
stream=False
|
49 |
-
safety_settings={
|
50 |
-
'HATE': 'BLOCK_NONE',
|
51 |
-
'HARASSMENT': 'BLOCK_NONE',
|
52 |
-
'SEXUAL' : 'BLOCK_NONE',
|
53 |
-
'DANGEROUS' : 'BLOCK_NONE'
|
54 |
-
}
|
55 |
)
|
56 |
return response
|
57 |
except Exception as e:
|
|
|
29 |
|
30 |
@st.cache_data(ttl=3600)
|
31 |
def get_summary(text):
|
32 |
+
model = genai.GenerativeModel('gemini-1.5-pro', generation_config=generation_config,
|
33 |
+
safety_settings = {
|
34 |
+
'HATE': 'BLOCK_NONE',
|
35 |
+
'HARASSMENT': 'BLOCK_NONE',
|
36 |
+
'SEXUAL' : 'BLOCK_NONE',
|
37 |
+
'DANGEROUS' : 'BLOCK_NONE'
|
38 |
+
})
|
39 |
|
40 |
try:
|
41 |
response = model.generate_content(f'''You are a law professor specialized in legal writing and legal research.
|
|
|
51 |
Other opinions (if there are any dissenting or concurring opinions, summarize majority opinion, dissenting opinion and concurring opinion).
|
52 |
Cases cited (which cases the court cited and how it treated them).
|
53 |
Here is the text of the case to be summarized: {text}''',
|
54 |
+
stream=False
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
)
|
56 |
return response
|
57 |
except Exception as e:
|