修复 args_hash在使用常规缓存时候才计算导致embedding缓存时没有计算的bug
This commit is contained in:
@@ -162,7 +162,6 @@ async def azure_openai_complete_if_cache(
|
|||||||
if prompt is not None:
|
if prompt is not None:
|
||||||
messages.append({"role": "user", "content": prompt})
|
messages.append({"role": "user", "content": prompt})
|
||||||
|
|
||||||
hashing_kv: BaseKVStorage = kwargs.pop("hashing_kv", None)
|
|
||||||
if hashing_kv is not None:
|
if hashing_kv is not None:
|
||||||
# Calculate args_hash only when using cache
|
# Calculate args_hash only when using cache
|
||||||
args_hash = compute_args_hash(model, messages)
|
args_hash = compute_args_hash(model, messages)
|
||||||
@@ -373,7 +372,6 @@ async def hf_model_if_cache(
|
|||||||
messages.extend(history_messages)
|
messages.extend(history_messages)
|
||||||
messages.append({"role": "user", "content": prompt})
|
messages.append({"role": "user", "content": prompt})
|
||||||
|
|
||||||
hashing_kv: BaseKVStorage = kwargs.pop("hashing_kv", None)
|
|
||||||
if hashing_kv is not None:
|
if hashing_kv is not None:
|
||||||
# Calculate args_hash only when using cache
|
# Calculate args_hash only when using cache
|
||||||
args_hash = compute_args_hash(model, messages)
|
args_hash = compute_args_hash(model, messages)
|
||||||
@@ -491,7 +489,6 @@ async def ollama_model_if_cache(
|
|||||||
messages.extend(history_messages)
|
messages.extend(history_messages)
|
||||||
messages.append({"role": "user", "content": prompt})
|
messages.append({"role": "user", "content": prompt})
|
||||||
|
|
||||||
hashing_kv: BaseKVStorage = kwargs.pop("hashing_kv", None)
|
|
||||||
if hashing_kv is not None:
|
if hashing_kv is not None:
|
||||||
# Calculate args_hash only when using cache
|
# Calculate args_hash only when using cache
|
||||||
args_hash = compute_args_hash(model, messages)
|
args_hash = compute_args_hash(model, messages)
|
||||||
@@ -652,7 +649,6 @@ async def lmdeploy_model_if_cache(
|
|||||||
messages.extend(history_messages)
|
messages.extend(history_messages)
|
||||||
messages.append({"role": "user", "content": prompt})
|
messages.append({"role": "user", "content": prompt})
|
||||||
|
|
||||||
hashing_kv: BaseKVStorage = kwargs.pop("hashing_kv", None)
|
|
||||||
if hashing_kv is not None:
|
if hashing_kv is not None:
|
||||||
# Calculate args_hash only when using cache
|
# Calculate args_hash only when using cache
|
||||||
args_hash = compute_args_hash(model, messages)
|
args_hash = compute_args_hash(model, messages)
|
||||||
|
Reference in New Issue
Block a user