Skip to content

Commit

Permalink
-Make server working again;
Browse files Browse the repository at this point in the history
-Commented out arguments.py file and hardcoded constants for now;
-Resolve issue with bad naming and location of the db_get_incomplete_completion_tasks function
  • Loading branch information
Yamcz00r committed May 20, 2024
1 parent d18d05b commit 24cd2e5
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 33 deletions.
Empty file added __init__.py
Empty file.
57 changes: 29 additions & 28 deletions arguments.py
Original file line number Diff line number Diff line change
@@ -1,31 +1,32 @@
import argparse
# import argparse

parser = argparse.ArgumentParser()
parser.add_argument(
"-H",
"--use-hugging-face",
dest="use_hugging_face",
action="store_true",
help="Use Hugging Face as the model provider",
)
parser.add_argument(
"-M",
"--pick-model",
type=str,
dest="model_choice",
choices=[
"ollama_medium",
"ollama_small",
"ollama_large",
"hugging_face_medium",
"hugging_face_small",
"hugging_face_large",
],
default="ollama_medium",
help="Select model configuration",
)
# parser = argparse.ArgumentParser()
# parser.add_argument(
# "-H",
# "--use-hugging-face",
# dest="use_hugging_face",
# action="store_true",
# help="Use Hugging Face as the model provider",
# )
# parser.add_argument(
# "-M",
# "--pick-model",
# type=str,
# dest="model_choice",
# choices=[
# "ollama_medium",
# "ollama_small",
# "ollama_large",
# "hugging_face_medium",
# "hugging_face_small",
# "hugging_face_large",
# ],
# default="ollama_medium",
# help="Select model configuration",
# )

args = parser.parse_args()
# args = parser.parse_args()

USE_HUGGING_FACE = args.use_hugging_face
MODEL_CHOICE = args.model_choice
USE_HUGGING_FACE = True
MODEL_CHOICE = "ollama_medium"
#TODO: Handle the arguments parsing
1 change: 0 additions & 1 deletion webui/models/url_pool.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from __future__ import annotations

from pydantic import BaseModel


Expand Down
4 changes: 2 additions & 2 deletions webui/router/completion_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from core.databases.db_completion_tasks import (
db_add_completion_task,
db_get_completion_tasks_by_page,
db_get_incomplete_completion_task,
db_get_incomplete_completion_tasks
)
from webui.models.completion_task import TaskCreator

Expand All @@ -17,7 +17,7 @@ def get_tasks_by_page():

@router.get("/task/incomplete")
def get_incomplete_task():
result = db_get_incomplete_completion_task()
result = db_get_incomplete_completion_tasks()
return {"tasks": result}


Expand Down
4 changes: 2 additions & 2 deletions webui/router/crawl_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
db_add_crawl_task,
db_get_crawl_task,
db_set_crawl_completed,
db_get_incomplete_completion_task,
)
from core.databases.db_completion_tasks import db_get_incomplete_completion_tasks
from webui.models.crawl_task import CrawlCreator

router = APIRouter()
Expand All @@ -29,5 +29,5 @@ def set_crawl_completed(uuid):

@router.get("/crawl/incomplete")
def get_inocmplete_completion_task():
result = db_get_incomplete_completion_task()
result = db_get_incomplete_completion_tasks()
return {"task": result}
Empty file added workers/__init__.py
Empty file.

0 comments on commit 24cd2e5

Please sign in to comment.