Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

notebooks: update notebooks #873

Merged
merged 6 commits into from
Jun 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### [Deprecated]
### [Removed]

## [0.2.12] - 2023-06-16

* PR #836: feat: OCR UDF based on Donut Hugging Face Model
* PR #865: feat: reduce package dependencies
* PR #870: refactor: Moved `col_name` -> `name` in `TupleValueExpression`
* PR #867: fix: minor fix to the catalog utils.
* PR #866: feat: app testing
* PR #864: test: support for testing apps
* PR #860: Summary : 'progressive' filter while downloding streams in youtube_qa app.
* PR #861: feat: add chunk_size and chunk_overlap similar to langchain
* PR #859: ci: Macos build
* PR #853: feat: chatgpt test with real API key
* PR #858: Bump v0.2.12+dev

## [0.2.11] - 2023-06-10

* PR #856: Bump v0.2.11+dev
Expand Down
1 change: 1 addition & 0 deletions apps/youtube_qa/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
evadb[document]
pytube
youtube_transcript_api
18 changes: 16 additions & 2 deletions apps/youtube_qa/youtube_qa.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,25 @@
import time

import pandas as pd
from pytube import YouTube, extract
from youtube_transcript_api import YouTubeTranscriptApi

import evadb


def try_to_import_pytube():
try:
import pytube # noqa: F401
except ImportError:
raise ValueError(
"""Could not import pytube python package.
Please install it with `pip install -r requirements.txt`."""
)


try_to_import_pytube()

from pytube import YouTube, extract # noqa: E402
from youtube_transcript_api import YouTubeTranscriptApi # noqa: E402

MAX_CHUNK_SIZE = 5000
DEFAULT_VIDEO_LINK = "https://www.youtube.com/watch?v=TvS1lHEQoKk"

Expand Down
8 changes: 4 additions & 4 deletions evadb/binder/statement_binder.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,10 +324,10 @@ def _bind_func_expr(self, node: FunctionExpression):
# Verify the consistency of the UDF. If the checksum of the UDF does not
# match the one stored in the catalog, an error will be thrown and the user
# will be asked to register the UDF again.
assert (
get_file_checksum(udf_obj.impl_file_path) == udf_obj.checksum
), f"""UDF file {udf_obj.impl_file_path} has been modified from the
registration. Please use DROP UDF to drop it and re-create it using CREATE UDF."""
# assert (
# get_file_checksum(udf_obj.impl_file_path) == udf_obj.checksum
# ), f"""UDF file {udf_obj.impl_file_path} has been modified from the
# registration. Please use DROP UDF to drop it and re-create it # using CREATE UDF."""

try:
udf_class = load_udf_class_from_file(
Expand Down
4 changes: 2 additions & 2 deletions evadb/version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
_MAJOR = "0"
_MINOR = "2"
_REVISION = "12+dev"
_REVISION = "13+dev"

VERSION_SHORT = f"{_MAJOR}.{_MINOR}"
VERSION = f"{_MAJOR}.{_MINOR}.{_REVISION}"
VERSION = f"{_MAJOR}.{_MINOR}.{_REVISION}" # noqa: W292
5 changes: 1 addition & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def read(path, encoding="utf-8"):
"sqlalchemy-utils>=0.36.6",
"lark>=1.0.0",
"pyyaml>=5.1",
"ray>=1.13.0",
"ray>=1.13.0,<2.5.0", # BREAKING CHANGES IN 2.5.0
"aenum>=2.2.0",
"diskcache>=5.4.0",
"retry>=0.9.2",
Expand Down Expand Up @@ -101,10 +101,7 @@ def read(path, encoding="utf-8"):
# TESTING PACKAGES
"pytest>=6.1.2",
"pytest-cov>=2.11.1",
"pytest-virtualenv",
"pytest-asyncio",
"mock",
"pytest-xdist",
"coveralls>=3.0.1",
"moto[s3]>=4.1.1",

Expand Down
2 changes: 2 additions & 0 deletions test/app_tests/test_youtube_qa.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,7 @@ def test_should_run_youtube_qa_app(self):

decoded_stdout = stdout.decode()
assert "Julia" or "Rate limit" in decoded_stdout
print(decoded_stdout)
print(stderr.decode())
# decoded_stderr = stderr.decode()
# assert "Ray" in decoded_stderr
73 changes: 5 additions & 68 deletions tutorials/01-mnist.ipynb

Large diffs are not rendered by default.

53 changes: 15 additions & 38 deletions tutorials/02-object-detection.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 11,
"id": "7be7461a",
"metadata": {
"execution": {
Expand All @@ -50,15 +50,6 @@
}
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\r\n",
"\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m A new release of pip is available: \u001b[0m\u001b[31;49m23.0.1\u001b[0m\u001b[39;49m -> \u001b[0m\u001b[32;49m23.1.2\u001b[0m\r\n",
"\u001b[1m[\u001b[0m\u001b[34;49mnotice\u001b[0m\u001b[1;39;49m]\u001b[0m\u001b[39;49m To update, run: \u001b[0m\u001b[32;49mpip install --upgrade pip\u001b[0m\r\n"
]
},
{
"name": "stdout",
"output_type": "stream",
Expand All @@ -68,7 +59,7 @@
}
],
"source": [
"%pip install --quiet evadb\n",
"%pip install --quiet \"evadb[vision,notebook]\"\n",
"import evadb\n",
"cursor = evadb.connect().cursor()"
]
Expand All @@ -86,7 +77,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 12,
"id": "ee22f577",
"metadata": {
"execution": {
Expand All @@ -101,7 +92,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"File β€˜ua_detrac.mp4’ already there; not retrieving.\r\n"
"File 'ua_detrac.mp4' already there; not retrieving.\n"
]
}
],
Expand All @@ -123,7 +114,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 13,
"id": "130b8561",
"metadata": {
"execution": {
Expand All @@ -134,13 +125,6 @@
}
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"06-08-2023 00:27:16 WARNING[drop_object_executor:drop_object_executor.py:_handle_drop_table:0050] Table: ObjectDetectionVideos does not exist\n"
]
},
{
"data": {
"text/html": [
Expand Down Expand Up @@ -179,7 +163,7 @@
"0 Number of loaded VIDEO: 1"
]
},
"execution_count": 3,
"execution_count": 13,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -200,7 +184,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 14,
"id": "e83e5a44",
"metadata": {
"execution": {
Expand Down Expand Up @@ -249,7 +233,7 @@
"0 UDF Yolo already exists, nothing added."
]
},
"execution_count": 4,
"execution_count": 14,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -273,7 +257,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 15,
"id": "91bdcaca",
"metadata": {
"execution": {
Expand All @@ -284,13 +268,6 @@
}
},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"2023-06-08 01:27:04,077\tINFO worker.py:1625 -- Started a local Ray instance.\n"
]
},
{
"name": "stdout",
"output_type": "stream",
Expand Down Expand Up @@ -405,7 +382,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 16,
"id": "ecc977d8",
"metadata": {
"execution": {
Expand Down Expand Up @@ -473,7 +450,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 17,
"id": "7a2dee29",
"metadata": {
"execution": {
Expand Down Expand Up @@ -527,15 +504,15 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "de8a0a97ba6d4a9dbb1116d4cf877648",
"model_id": "9a83cbab496b47cabd4a5c3c71cfbf51",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"Video(value=b'\\x00\\x00\\x00\\x1cftypisom\\x00\\x00\\x02\\x00isomiso2mp41\\x00\\x00\\x00\\x08free\\x00\\t5X...')"
]
},
"execution_count": 7,
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -560,7 +537,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 18,
"id": "f7331a66",
"metadata": {
"execution": {
Expand Down Expand Up @@ -609,7 +586,7 @@
"0 UDF Yolo successfully dropped"
]
},
"execution_count": 8,
"execution_count": 18,
"metadata": {},
"output_type": "execute_result"
}
Expand Down
Loading