Comments (3)
I worked around by tweaking the callable_serialization.py :
import inspect
import sys
from typing import Callable, Optional
from haystack import DeserializationError
def serialize_callable(callable_handle: Callable) -> str:
"""
Serializes a callable to its full path.
:param callable_handle: The callable to serialize
:return: The full path of the callable
"""
if callable_handle is None:
return "None"
module = inspect.getmodule(callable_handle)
# Get the full package path of the function
if module is not None:
full_path = f"{module.__name__}.{callable_handle.__name__}"
else:
full_path = callable_handle.__name__
return full_path
def deserialize_callable(callable_handle: str) -> Optional[Callable]:
"""
Deserializes a callable given its full import path as a string.
:param callable_handle: The full path of the callable_handle
:return: The callable
:raises DeserializationError: If the callable cannot be found
"""
if callable_handle == "None":
return None
parts = callable_handle.split(".")
module_name = ".".join(parts[:-1])
function_name = parts[-1]
module = sys.modules.get(module_name, None)
if not module:
raise DeserializationError(f"Could not locate the module of the callable: {module_name}")
streaming_callback = getattr(module, function_name, None)
if not streaming_callback:
raise DeserializationError(f"Could not locate the callable: {function_name}")
return streaming_callback
from haystack.
Investigating further I think the problem is rather with the bedrock integration itself and not the serialization utils
from haystack.
Found the right repo to post the issue, sorry
from haystack.
Related Issues (20)
- Hybrid doc search e2e fails with DuplicateDocumentError
- `AzureOpenAIGenerator` not passing `meta` (used tokens, model...) to Langfuse
- Error Transcribing Audio: [WinError 2] The system cannot find the file specified
- [V2.2.0] ChatPromptBuilder is not export HOT 1
- feat: Port (and upgrade) DocxToDocument converter from Haystack v1
- feat: Port PptxToDocument converter from Haystack v1
- Update the Get Started page on the Haystack website
- `ContextRelevanceEvaluator`: statements extraction can be made more robust
- Error while loading pipelines from yaml files HOT 2
- docs: Create docs page for `TransformerTextRouter`
- Cannot specify model version for `SentenceTransformer` embedding retriever HOT 1
- Milvus Exception error
- SQuAD to DPR conversion script missing in the repo HOT 2
- `@component` decorator on a class that inherits from another marked with the same breaks its init
- Test the evaluation harness on RAG parameter tuning
- Benchmark hyde using evaluation harness
- docs: Add docs for `PPTXToDocument` converter
- `DocumentSplitter` - `split_by="page"` is not documented
- `EvaluationRunResult.score_result()` is not documented in API reference
- 'PydanticWriter' and 'PydanticReader' components for type-safe object storage
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from haystack.