Skip to content

Commit

Permalink
Fix cannot pickle error (#7598)
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 811d7277db2729321f7135140142303668de912e
  • Loading branch information
szymondudycz authored and Manul from Pathway committed Nov 5, 2024
1 parent c31390e commit cdd6fc6
Show file tree
Hide file tree
Showing 13 changed files with 5 additions and 37 deletions.
4 changes: 0 additions & 4 deletions examples/pipelines/adaptive-rag/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,12 @@ class App(BaseModel):
port: int = 8000

with_cache: bool = True
cache_backend: InstanceOf[pw.persistence.Backend] = (
pw.persistence.Backend.filesystem("./Cache")
)
terminate_on_error: bool = False

def run(self) -> None:
server = QASummaryRestServer(self.host, self.port, self.question_answerer)
server.run(
with_cache=self.with_cache,
cache_backend=self.cache_backend,
terminate_on_error=self.terminate_on_error,
)

Expand Down
2 changes: 0 additions & 2 deletions examples/pipelines/adaptive-rag/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,6 @@ question_answerer: !pw.xpacks.llm.question_answering.AdaptiveRAGQuestionAnswerer

# Cache configuration
# with_cache: true
# cache_backend: !pw.persistence.Backend.filesystem
# path: ".Cache"

# Set `terminate_on_error` to true if you want the program to terminate whenever any error is encountered
# terminate_on_error: false
4 changes: 0 additions & 4 deletions examples/pipelines/demo-document-indexing/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,12 @@ class App(BaseModel):
port: int = 8000

with_cache: bool = True
cache_backend: InstanceOf[pw.persistence.Backend] = (
pw.persistence.Backend.filesystem("./Cache")
)
terminate_on_error: bool = False

def run(self) -> None:
server = DocumentStoreServer(self.host, self.port, self.document_store)
server.run(
with_cache=self.with_cache,
cache_backend=self.cache_backend,
terminate_on_error=self.terminate_on_error,
)

Expand Down
2 changes: 0 additions & 2 deletions examples/pipelines/demo-document-indexing/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ document_store: !pw.xpacks.llm.document_store.DocumentStore

# Cache configuration
# with_cache: true
# cache_backend: !pw.persistence.Backend.filesystem
# path: ".Cache"

# Set `terminate_on_error` to true if you want the program to terminate whenever any error is encountered
# terminate_on_error: false
1 change: 0 additions & 1 deletion examples/pipelines/demo-question-answering/.env

This file was deleted.

4 changes: 0 additions & 4 deletions examples/pipelines/demo-question-answering/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,12 @@ class App(BaseModel):
port: int = 8000

with_cache: bool = True
cache_backend: InstanceOf[pw.persistence.Backend] = (
pw.persistence.Backend.filesystem("./Cache")
)
terminate_on_error: bool = False

def run(self) -> None:
server = QASummaryRestServer(self.host, self.port, self.question_answerer)
server.run(
with_cache=self.with_cache,
cache_backend=self.cache_backend,
terminate_on_error=self.terminate_on_error,
)

Expand Down
2 changes: 0 additions & 2 deletions examples/pipelines/demo-question-answering/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ question_answerer: !pw.xpacks.llm.question_answering.BaseRAGQuestionAnswerer

# Cache configuration
# with_cache: true
# cache_backend: !pw.persistence.Backend.filesystem
# path: ".Cache"

# Set `terminate_on_error` to true if you want the program to terminate whenever any error is encountered
# terminate_on_error: false
4 changes: 0 additions & 4 deletions examples/pipelines/gpt_4o_multimodal_rag/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,12 @@ class App(BaseModel):
port: int = 8000

with_cache: bool = True
cache_backend: InstanceOf[pw.persistence.Backend] = (
pw.persistence.Backend.filesystem("./Cache")
)
terminate_on_error: bool = False

def run(self) -> None:
server = QASummaryRestServer(self.host, self.port, self.question_answerer)
server.run(
with_cache=self.with_cache,
cache_backend=self.cache_backend,
terminate_on_error=self.terminate_on_error,
)

Expand Down
2 changes: 0 additions & 2 deletions examples/pipelines/gpt_4o_multimodal_rag/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ question_answerer: !pw.xpacks.llm.question_answering.BaseRAGQuestionAnswerer

# Cache configuration
# with_cache: true
# cache_backend: !pw.persistence.Backend.filesystem
# path: ".Cache"

# Set `terminate_on_error` to true if you want the program to terminate whenever any error is encountered
# terminate_on_error: false
4 changes: 0 additions & 4 deletions examples/pipelines/private-rag/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,12 @@ class App(BaseModel):
port: int = 8000

with_cache: bool = True
cache_backend: InstanceOf[pw.persistence.Backend] = (
pw.persistence.Backend.filesystem("./Cache")
)
terminate_on_error: bool = False

def run(self) -> None:
server = QASummaryRestServer(self.host, self.port, self.question_answerer)
server.run(
with_cache=self.with_cache,
cache_backend=self.cache_backend,
terminate_on_error=self.terminate_on_error,
)

Expand Down
2 changes: 0 additions & 2 deletions examples/pipelines/private-rag/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@ question_answerer: !pw.xpacks.llm.question_answering.AdaptiveRAGQuestionAnswerer

# Cache configuration
# with_cache: true
# cache_backend: !pw.persistence.Backend.filesystem
# path: ".Cache"

# Set `terminate_on_error` to true if you want the program to terminate whenever any error is encountered
# terminate_on_error: false
9 changes: 5 additions & 4 deletions examples/pipelines/slides_ai_search/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
from pathway_slides_ai_search import CustomDeckRetriever, add_slide_id, get_model
from pydantic import BaseModel, ConfigDict, FilePath, InstanceOf

# To use advanced features with Pathway Scale, get your free license key from
# https://pathway.com/features and paste it below.
# To use Pathway Community, comment out the line below.
pw.set_license_key("demo-license-key-with-telemetry")


class App(BaseModel):
host: str = "0.0.0.0"
Expand All @@ -28,9 +33,6 @@ class App(BaseModel):
details_schema: FilePath | dict[str, Any] | None = None

with_cache: bool = True
cache_backend: InstanceOf[pw.persistence.Backend] = (
pw.persistence.Backend.filesystem("./Cache")
)
terminate_on_error: bool = False

def run(self) -> None:
Expand Down Expand Up @@ -64,7 +66,6 @@ def run(self) -> None:

app.run_server(
with_cache=self.with_cache,
cache_backend=self.cache_backend,
terminate_on_error=self.terminate_on_error,
)

Expand Down
2 changes: 0 additions & 2 deletions examples/pipelines/slides_ai_search/app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ details_schema:

# Cache configuration
# with_cache: true
# cache_backend: !pw.persistence.Backend.filesystem
# path: ".Cache"

# Set `terminate_on_error` to true if you want the program to terminate whenever any error is encountered
# terminate_on_error: false

0 comments on commit cdd6fc6

Please sign in to comment.