Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -2,6 +2,7 @@ import streamlit as st
|
|
2 |
import requests
|
3 |
import os
|
4 |
import google.generativeai as genai
|
|
|
5 |
|
6 |
genai.configure(api_key=os.getenv('GOOGLE_API_KEY'))
|
7 |
|
@@ -44,7 +45,13 @@ def get_summary(text):
|
|
44 |
Other opinions (if there are any dissenting or concurring opinions, summarize majority opinion, dissenting opinion and concurring opinion).
|
45 |
Cases cited (which cases the court cited and how it treated them).
|
46 |
Here is the text of the case to be summarized: {text}''',
|
47 |
-
stream=False
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
)
|
49 |
return response
|
50 |
except Exception as e:
|
|
|
2 |
import requests
|
3 |
import os
|
4 |
import google.generativeai as genai
|
5 |
+
from google.generativeai.types import HarmCategory, HarmBlockThreshold
|
6 |
|
7 |
genai.configure(api_key=os.getenv('GOOGLE_API_KEY'))
|
8 |
|
|
|
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 |
+
HarmCategory.HARM_CATEGORY_HATE_SPEECH: HarmBlockThreshold.BLOCK_NONE,
|
51 |
+
HarmCategory.HARM_CATEGORY_HARASSMENT: HarmBlockThreshold.BLOCK_NONE,
|
52 |
+
HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT: HarmBlockThreshold.BLOCK_NONE,
|
53 |
+
HarmCategory.HARM_CATEGORY_DANGEROUS_CONTENT: HarmBlockThreshold.BLOCK_NONE
|
54 |
+
}
|
55 |
)
|
56 |
return response
|
57 |
except Exception as e:
|