Skip to content

Commit

Permalink
clean up folder structure
Browse files Browse the repository at this point in the history
  • Loading branch information
lfunderburk committed Dec 2, 2024
1 parent c2dcf10 commit e41163b
Show file tree
Hide file tree
Showing 18 changed files with 141 additions and 130 deletions.
File renamed without changes.
52 changes: 0 additions & 52 deletions ch2/tests/test_ch2_haystack_openai.py

This file was deleted.

22 changes: 0 additions & 22 deletions ch7/api-dockerization/Dockerfile

This file was deleted.

50 changes: 0 additions & 50 deletions ch7/api-dockerization/config.yaml

This file was deleted.

Binary file removed ch7/api-dockerization/dataflow-dag.png
Binary file not shown.
17 changes: 17 additions & 0 deletions ch7/api_dockerization/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Base image
FROM python:3.10-slim

# Set working directory
WORKDIR /app

# Copy application code
COPY . /app

# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Expose API port
EXPOSE 8000

# Run the application
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
Redis instance

```bash
gunicorn -b 127.0.0.1:8000 myapp:app -k uvicorn.workers.UvicornWorker
gunicorn -b 127.0.0.1:8000 app:app -k uvicorn.workers.UvicornWorker
pip-compile requirements.in --output-file requirements.txt
docker run --restart always -p 8000:8000 fastapi-bytewax-app
docker build -t nlp-api .
docker run -p 8000:8000 nlp-api

```

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from bytewax.dataflow import Dataflow
from bytewax.run import cli_main
from haystack.document_stores.in_memory import InMemoryDocumentStore
from haystack_integrations.document_stores.elasticsearch import ElasticsearchDocumentStore
import asyncio
import logging
import os
Expand Down
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added ch7/api_dockerization/images/dataflow-dag.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from haystack.components.writers import DocumentWriter
from haystack.document_stores.types import DuplicatePolicy
from haystack.utils import Secret
from haystack.document_stores.in_memory import InMemoryDocumentStore


from haystack import component, Document
Expand All @@ -25,8 +26,6 @@

import logging



logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)

Expand Down Expand Up @@ -185,3 +184,11 @@ def process_event(event):
embed_data = op.map("embed_data", filtered_data, process_event)
op.output("output", embed_data, StdOutSink())
return flow

## sample usage
# symbol = "AAPL"
# load_dotenv(".env")
# OPENAI_API_KEY = os.getenv("OPENAI_API_KEY")

# document_store = InMemoryDocumentStore()
# flow = run_pipeline_with_symbol(symbol, document_store, OPENAI_API_KEY)
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ test-py tests=pytests: _assert-venv
pytest {{tests}}

# Run all the checks that will be run in CI locally
ci-pre: lint test-py
ci-pre: test-py

# Build the package
build: _assert-venv
Expand Down
1 change: 1 addition & 0 deletions pytests/ch7/test_dataflow.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from ch7.api_dockerization.indexing_dataflow import run_pipeline_with_symbol
110 changes: 110 additions & 0 deletions repo_structure.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
.
├── LICENSE
├── README.md
├── __init__.py
├── ch2
│   ├── README.md
│   ├── __init__.py
│   ├── jupyter-notebooks
│   │   ├── images
│   │   ├── interacting-with-llms-haystack2.0.ipynb
│   │   ├── interacting-with-llms-hugging-face.ipynb
│   │   ├── interacting-with-llms-openai.ipynb
│   │   ├── llm-augmentation.ipynb
│   │   ├── llm-overview.ipynb
│   │   └── pipeline-diagrams
│   └── scripts
│   ├── __init__.py
│   ├── huggingfaceendpoints.py
│   └── pipelines.py
├── ch3
│   ├── README.md
│   └── jupyter-notebooks
│   ├── audio-files
│   ├── components.ipynb
│   ├── data-processing-components.ipynb
│   ├── data_classes.ipynb
│   ├── embedding-components.ipynb
│   ├── images
│   └── writing-components.ipynb
├── ch4
│   ├── README.md
│   └── jupyter-notebooks
│   ├── extraction-and-processing-pipelines.ipynb
│   ├── images
│   ├── indexing-pipelines.ipynb
│   ├── markdown_pages
│   ├── retriever-pipelines-with-llm.ipynb
│   ├── retriever-pipelines.ipynb
│   └── textfile-pages
├── ch5
│   ├── README.md
│   └── jupyter-notebooks
│   ├── custom-component-error-handling.ipynb
│   ├── custom-component-logging-threading.ipynb
│   ├── custom-component-logging.ipynb
│   ├── custom-component-scalability.ipynb
│   ├── custom-components.ipynb
│   ├── images
│   └── tests
├── ch6
│   ├── README.md
│   ├── adding-evaluation
│   │   ├── query_pipeline.py
│   │   ├── query_pipeline_ragas.png
│   │   └── wandb
│   ├── adding-observability
│   │   ├── indexing_pipeline.py
│   │   ├── query_pipeline.png
│   │   ├── query_pipeline.py
│   │   └── wandb
│   ├── benzinga_pipeline.png
│   ├── case-I-q-and-a-dataset
│   │   ├── benzinga_pipeline.png
│   │   ├── indexingpipeline.py
│   │   ├── query_pipeline.png
│   │   └── querypipeline.py
│   ├── case-II-q-and-a-complex
│   │   ├── answer_generation_pipeline.png
│   │   ├── indexing_complex_knowledge.png
│   │   └── rag-tutorials.ipynb
│   ├── docker-compose.yml
│   ├── feedback-loop-guardrails
│   │   └── query_pipeline.py
│   ├── news_out.jsonl
│   ├── query_pipeline.png
│   └── query_pipeline_ragas.png
├── ch7
│   ├── api_dockerization
│   │   ├── Dockerfile
│   │   ├── README.md
│   │   ├── app.py
│   │   ├── benzinga_pipeline.png
│   │   ├── config.yaml
│   │   ├── dataflow-dag.png
│   │   ├── indexing_dataflow.py
│   │   ├── news_out.jsonl
│   │   ├── querying.py
│   │   └── requirements.txt
│   ├── benzinga_pipeline.png
│   └── pipeline-serialization
├── just
├── justfile
├── mistral-7b-v1.0.yaml
├── pyproject.toml
├── repo_structure.txt
├── requirements
│   ├── dev.in
│   ├── dev.txt
│   ├── doc.txt
│   ├── lib-py3.10.txt
│   ├── lib-py3.11.txt
│   ├── lib-py3.12.txt
│   ├── lib-py3.9.txt
│   ├── requirements.in
│   └── requirements.txt
├── tests
└── venvs
└── dev

34 directories, 74 files

0 comments on commit e41163b

Please sign in to comment.