Spaces:
Running
Running
luanpoppe
commited on
Commit
路
08ffa6d
1
Parent(s):
561e395
fix
Browse files
_utils/gerar_relatorio_modelo_usuario/EnhancedDocumentSummarizer.py
CHANGED
@@ -197,7 +197,9 @@ class EnhancedDocumentSummarizer(DocumentSummarizer):
|
|
197 |
)
|
198 |
|
199 |
url_request = f"{api_url}/modelo/{self.id_modelo_do_usuario}"
|
|
|
200 |
resposta = requests.get(url_request)
|
|
|
201 |
|
202 |
if resposta.status_code != 200:
|
203 |
return Response(
|
|
|
197 |
)
|
198 |
|
199 |
url_request = f"{api_url}/modelo/{self.id_modelo_do_usuario}"
|
200 |
+
print("url_request: ", url_request)
|
201 |
resposta = requests.get(url_request)
|
202 |
+
print("resposta: ", resposta)
|
203 |
|
204 |
if resposta.status_code != 200:
|
205 |
return Response(
|
_utils/resumo_completo_cursor.py
CHANGED
@@ -39,7 +39,6 @@ async def get_llm_summary_answer_by_cursor_complete(
|
|
39 |
):
|
40 |
"""Par芒metro "contexto" s贸 deve ser passado quando quiser utilizar o teste com ragas, e assim, n茫o quiser passar PDFs"""
|
41 |
allPdfsChunks = []
|
42 |
-
|
43 |
# Configuration
|
44 |
config = RetrievalConfig(
|
45 |
num_chunks=serializer["num_chunks_retrieval"],
|
@@ -88,7 +87,6 @@ async def get_llm_summary_answer_by_cursor_complete(
|
|
88 |
loader = PyPDFLoader(pdf_path)
|
89 |
pages = loader.load()
|
90 |
full_text = " ".join([page.page_content for page in pages])
|
91 |
-
|
92 |
# Contextualize chunks
|
93 |
if serializer["should_have_contextual_chunks"]:
|
94 |
contextualized_chunks = (
|
@@ -107,7 +105,7 @@ async def get_llm_summary_answer_by_cursor_complete(
|
|
107 |
chunks_passados, is_contextualized_chunk
|
108 |
)
|
109 |
|
110 |
-
prompt_relatorio_sem_context = """
|
111 |
**Instructions**:
|
112 |
1. **Chain of Thought**: Before producing your final answer, you must think through and plan your summary silently, without showing this reasoning in the final output. The final answer must only contain the required formatted report and nothing else.
|
113 |
2. **Reading the Context**: Extract the following information from `context`:
|
|
|
39 |
):
|
40 |
"""Par芒metro "contexto" s贸 deve ser passado quando quiser utilizar o teste com ragas, e assim, n茫o quiser passar PDFs"""
|
41 |
allPdfsChunks = []
|
|
|
42 |
# Configuration
|
43 |
config = RetrievalConfig(
|
44 |
num_chunks=serializer["num_chunks_retrieval"],
|
|
|
87 |
loader = PyPDFLoader(pdf_path)
|
88 |
pages = loader.load()
|
89 |
full_text = " ".join([page.page_content for page in pages])
|
|
|
90 |
# Contextualize chunks
|
91 |
if serializer["should_have_contextual_chunks"]:
|
92 |
contextualized_chunks = (
|
|
|
105 |
chunks_passados, is_contextualized_chunk
|
106 |
)
|
107 |
|
108 |
+
prompt_relatorio_sem_context = """You are a language model specialized in producing concise and well-structured legal case summaries in Portuguese. You will receive a variable `context`, which contains information about a legal case. Your task is to read the `context` carefully and produce a summary report in Portuguese, following the specific format provided below. Do not include any additional comments or reasoning steps in your final answer.
|
109 |
**Instructions**:
|
110 |
1. **Chain of Thought**: Before producing your final answer, you must think through and plan your summary silently, without showing this reasoning in the final output. The final answer must only contain the required formatted report and nothing else.
|
111 |
2. **Reading the Context**: Extract the following information from `context`:
|
gerar_relatorio_modelo_usuario/views.py
CHANGED
@@ -22,8 +22,6 @@ class ResumoSimplesCursorCompletoView(AsyncAPIView):
|
|
22 |
async def post(self, request):
|
23 |
serializer = ResumoCursorCompeltoSerializer(data=request.data)
|
24 |
if serializer.is_valid(raise_exception=True):
|
25 |
-
print("\n\n\n")
|
26 |
-
print("serializer.validated_data: ", serializer.validated_data)
|
27 |
print("\n\n\n")
|
28 |
listaPDFs = []
|
29 |
data = serializer.validated_data
|
|
|
22 |
async def post(self, request):
|
23 |
serializer = ResumoCursorCompeltoSerializer(data=request.data)
|
24 |
if serializer.is_valid(raise_exception=True):
|
|
|
|
|
25 |
print("\n\n\n")
|
26 |
listaPDFs = []
|
27 |
data = serializer.validated_data
|
setup/environment.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
default_model = "gpt-4o-mini"
|
2 |
# default_model = "gpt-4o"
|
3 |
|
4 |
-
api_url = "https://luanpoppe-vella-backend.hf.space"
|
|
|
|
1 |
default_model = "gpt-4o-mini"
|
2 |
# default_model = "gpt-4o"
|
3 |
|
4 |
+
api_url = "https://luanpoppe-vella-backend.hf.space"
|
5 |
+
# api_url = "http://localhost:8000"
|