Sebastián Cepeda
03/11/2024, 6:33 PMChaoyu
03/11/2024, 6:56 PMSebastián Cepeda
03/11/2024, 6:57 PMEric Riddoch
03/11/2024, 7:03 PMlaunch.json for FastAPI. I bet you could modify this to use the bentoml serve command.
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: <https://go.microsoft.com/fwlink/?linkid=830387>
"version": "0.2.0",
"configurations": [
{
"name": "Python: FastAPI",
"type": "python",
"request": "launch",
"module": "uvicorn",
"env": {
"db_username": "postgres",
"db_password": "secret",
"host_server": "localhost",
"database_name": "fastapi",
"ssl_mode": "prefer",
"db_server_port": "5432"
},
"args": [
"main:app",
"--reload",
"--port",
"8000"
]
}
]
}
I got the file from here. If you get a launch.json working. Would you mind sharing it here? Me and my team will probably need this too in a week or two!Eric Riddoch
03/11/2024, 7:07 PM{
"version": "0.2.0",
"configurations": [
{
"name": "Python: BentoML",
"type": "python",
"request": "launch",
"module": "bentoml",
"env": {
"some": "env var"
},
"args": [
"serve",
"--port",
"3000"
]
}
]
}Sebastián Cepeda
03/11/2024, 8:00 PMSebastián Cepeda
03/14/2024, 3:41 PMSebastián Cepeda
03/14/2024, 6:21 PMif __name__=="__main__":
bento_id = "."
# o si tienes un objeto Bento
# Crear una instancia del servidor HTTP en modo desarrollo con recarga automática.
http_server = HTTPServer(
bento=bento_id,
reload=True, # Habilitar recarga automática en desarrollo.
production=False, # Indicar que estamos en modo de desarrollo.
#host="127.0.0.1", # El host del servidor.
#port=5000, # El puerto en el que el servidor debe escuchar.
backlog=100,
#working_dir="/data/projects/TranscripcionBM"
)
# Iniciar el servidor.
with http_server.start(blocking=True) as client:
print(f"Servidor HTTP corriendo en modo desarrollo en http://{http_server.host}:{http_server.port}")Eric Riddoch
03/15/2024, 11:20 PMSebastián Cepeda
03/18/2024, 1:34 PMSebastián Cepeda
03/18/2024, 1:34 PM{
// Use IntelliSense para saber los atributos posibles.
// Mantenga el puntero para ver las descripciones de los existentes atributos.
// Para más información, visite: <https://go.microsoft.com/fwlink/?linkid=830387>
"version": "0.2.0",
"configurations": [
{
"name": "Depurador de Python: Archivo actual",
"type": "debugpy",
"request": "launch",
"module": "bentoml",
"args":[
"serve",
".",
"--development"
],
"console": "integratedTerminal",
"justMyCode": false,
"cwd":"${workspaceFolder}/TranscripcionBM",
"env": {
"PYDEVD_DISABLE_FILE_VALIDATION": "1"
}
}
]
}Eric Riddoch
03/18/2024, 5:03 PMSebastián Cepeda
03/18/2024, 6:35 PM