mirror of
https://github.com/open-webui/pipelines
synced 2025-05-14 01:20:48 +00:00
fix
This commit is contained in:
parent
e34e8c4fc0
commit
ee2e85ca24
4
main.py
4
main.py
@ -600,8 +600,8 @@ async def delete_pipeline(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@app.post("/v1/reload")
|
@app.post("/v1/pipelines/reload")
|
||||||
@app.post("/reload")
|
@app.post("/pipelines/reload")
|
||||||
async def reload_pipelines(user: str = Depends(get_current_user)):
|
async def reload_pipelines(user: str = Depends(get_current_user)):
|
||||||
if user == API_KEY:
|
if user == API_KEY:
|
||||||
await reload()
|
await reload()
|
||||||
|
@ -30,7 +30,6 @@ class Pipeline:
|
|||||||
async def on_startup(self):
|
async def on_startup(self):
|
||||||
# This function is called when the server is started.
|
# This function is called when the server is started.
|
||||||
print(f"on_startup:{__name__}")
|
print(f"on_startup:{__name__}")
|
||||||
self.pipelines = self.get_ollama_models()
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
async def on_shutdown(self):
|
async def on_shutdown(self):
|
||||||
@ -38,6 +37,12 @@ class Pipeline:
|
|||||||
print(f"on_shutdown:{__name__}")
|
print(f"on_shutdown:{__name__}")
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
async def on_valves_update(self):
|
||||||
|
# This function is called when the valves are updated.
|
||||||
|
print(f"on_valves_update:{__name__}")
|
||||||
|
self.pipelines = self.get_ollama_models()
|
||||||
|
pass
|
||||||
|
|
||||||
def get_ollama_models(self):
|
def get_ollama_models(self):
|
||||||
if self.valves.OLLAMA_BASE_URL:
|
if self.valves.OLLAMA_BASE_URL:
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user