mirror of
https://github.com/open-webui/pipelines
synced 2025-05-12 00:20:48 +00:00
Remove caching
This commit is contained in:
parent
05d480b1b2
commit
77ae1e9a27
@ -54,7 +54,7 @@ class Pipeline:
|
|||||||
async def on_valves_updated(self):
|
async def on_valves_updated(self):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@lru_cache(maxsize=128) # LRU cache to store translation results
|
# @lru_cache(maxsize=128) # LRU cache to store translation results
|
||||||
def translate(self, text: str, source: str, target: str) -> str:
|
def translate(self, text: str, source: str, target: str) -> str:
|
||||||
url = "https://translate.googleapis.com/translate_a/single"
|
url = "https://translate.googleapis.com/translate_a/single"
|
||||||
params = {
|
params = {
|
||||||
@ -90,7 +90,7 @@ class Pipeline:
|
|||||||
|
|
||||||
def clean_table_delimiters(self, text: str) -> str:
|
def clean_table_delimiters(self, text: str) -> str:
|
||||||
# Remove extra spaces from table delimiters
|
# Remove extra spaces from table delimiters
|
||||||
return re.sub(r'(\|\s*-+\s*)+', lambda m: m.group(0).replace(' ', ''), text)
|
return re.sub(r'(\|\s*-+\s*)+', lambda m: m.group(0).replace(' ', '-'), text)
|
||||||
|
|
||||||
async def inlet(self, body: dict, user: Optional[dict] = None) -> dict:
|
async def inlet(self, body: dict, user: Optional[dict] = None) -> dict:
|
||||||
print(f"inlet:{__name__}")
|
print(f"inlet:{__name__}")
|
||||||
|
Loading…
Reference in New Issue
Block a user