mirror of
https://git.mirrors.martin98.com/https://github.com/open-webui/open-webui
synced 2025-08-17 08:55:53 +08:00
Fix model reference with Ollama proxy when prefixes are used
This commit is contained in:
parent
852d9dcbe9
commit
cafba3eaff
@ -880,6 +880,10 @@ async def embed(
|
|||||||
url = request.app.state.config.OLLAMA_BASE_URLS[url_idx]
|
url = request.app.state.config.OLLAMA_BASE_URLS[url_idx]
|
||||||
key = get_api_key(url_idx, url, request.app.state.config.OLLAMA_API_CONFIGS)
|
key = get_api_key(url_idx, url, request.app.state.config.OLLAMA_API_CONFIGS)
|
||||||
|
|
||||||
|
prefix_id = api_config.get("prefix_id", None)
|
||||||
|
if prefix_id:
|
||||||
|
form_data.model = form_data.model.replace(f"{prefix_id}.", "")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
r = requests.request(
|
r = requests.request(
|
||||||
method="POST",
|
method="POST",
|
||||||
@ -959,6 +963,10 @@ async def embeddings(
|
|||||||
url = request.app.state.config.OLLAMA_BASE_URLS[url_idx]
|
url = request.app.state.config.OLLAMA_BASE_URLS[url_idx]
|
||||||
key = get_api_key(url_idx, url, request.app.state.config.OLLAMA_API_CONFIGS)
|
key = get_api_key(url_idx, url, request.app.state.config.OLLAMA_API_CONFIGS)
|
||||||
|
|
||||||
|
prefix_id = api_config.get("prefix_id", None)
|
||||||
|
if prefix_id:
|
||||||
|
form_data.model = form_data.model.replace(f"{prefix_id}.", "")
|
||||||
|
|
||||||
try:
|
try:
|
||||||
r = requests.request(
|
r = requests.request(
|
||||||
method="POST",
|
method="POST",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user