Spaces:
Running
Running
luanpoppe
commited on
Commit
·
fe21938
1
Parent(s):
08ffa6d
fix
Browse files
_utils/gerar_relatorio_modelo_usuario/EnhancedDocumentSummarizer.py
CHANGED
@@ -14,6 +14,7 @@ from _utils.models.gerar_relatorio import (
|
|
14 |
ContextualizedChunk,
|
15 |
RetrievalConfig,
|
16 |
)
|
|
|
17 |
from setup.environment import api_url
|
18 |
from rest_framework.response import Response
|
19 |
from _utils.gerar_relatorio_modelo_usuario.contextual_retriever import (
|
@@ -209,6 +210,23 @@ class EnhancedDocumentSummarizer(DocumentSummarizer):
|
|
209 |
)
|
210 |
|
211 |
modelo_buscado = resposta.json()["modelo"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
212 |
|
213 |
llm = ChatOpenAI(
|
214 |
temperature=self.gpt_temperature,
|
|
|
14 |
ContextualizedChunk,
|
15 |
RetrievalConfig,
|
16 |
)
|
17 |
+
from modelos_usuarios.serializer import ModeloUsuarioSerializer
|
18 |
from setup.environment import api_url
|
19 |
from rest_framework.response import Response
|
20 |
from _utils.gerar_relatorio_modelo_usuario.contextual_retriever import (
|
|
|
210 |
)
|
211 |
|
212 |
modelo_buscado = resposta.json()["modelo"]
|
213 |
+
# from modelos_usuarios.models import ModeloUsuarioModel
|
214 |
+
|
215 |
+
# # try:
|
216 |
+
# modelo_buscado = ModeloUsuarioModel.objects.get(
|
217 |
+
# pk=self.id_modelo_do_usuario
|
218 |
+
# )
|
219 |
+
# serializer = ModeloUsuarioSerializer(modelo_buscado)
|
220 |
+
# print("serializer.data: ", serializer.data)
|
221 |
+
|
222 |
+
# except:
|
223 |
+
# return Response(
|
224 |
+
# {
|
225 |
+
# "error": "Ocorreu um problema. Pode ser que o modelo não tenha sido encontrado. Tente novamente e/ou entre em contato com a equipe técnica"
|
226 |
+
# }
|
227 |
+
# )
|
228 |
+
|
229 |
+
# print("modelo_buscado: ", modelo_buscado)
|
230 |
|
231 |
llm = ChatOpenAI(
|
232 |
temperature=self.gpt_temperature,
|
setup/settings.py
CHANGED
@@ -31,7 +31,13 @@ SECRET_KEY = os.environ.get("SECRET_KEY")
|
|
31 |
# SECURITY WARNING: don't run with debug turned on in production!
|
32 |
DEBUG = True
|
33 |
|
34 |
-
ALLOWED_HOSTS = [
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
|
36 |
|
37 |
# Application definition
|
@@ -161,6 +167,7 @@ DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
|
|
161 |
CORS_ORIGIN_WHITELIST = [
|
162 |
"http://localhost",
|
163 |
"https://luanpoppe-projeto-y-teste-01.hf.space",
|
|
|
164 |
"https://*",
|
165 |
]
|
166 |
|
|
|
31 |
# SECURITY WARNING: don't run with debug turned on in production!
|
32 |
DEBUG = True
|
33 |
|
34 |
+
ALLOWED_HOSTS = [
|
35 |
+
"localhost",
|
36 |
+
"127.0.0.1",
|
37 |
+
"luanpoppe-projeto-y-teste-01.hf.space",
|
38 |
+
"luanpoppe-vella-backend.hf.space",
|
39 |
+
"*",
|
40 |
+
]
|
41 |
|
42 |
|
43 |
# Application definition
|
|
|
167 |
CORS_ORIGIN_WHITELIST = [
|
168 |
"http://localhost",
|
169 |
"https://luanpoppe-projeto-y-teste-01.hf.space",
|
170 |
+
"https://luanpoppe-vella-backend.hf.space",
|
171 |
"https://*",
|
172 |
]
|
173 |
|