Spaces:
Sleeping
Sleeping
Commit
Β·
37de7f1
1
Parent(s):
c1c7334
moved python code to dam_helper folder
Browse files- README.md +1 -5
- app.py β dam_helper/app.py +0 -0
- {email_manager β dam_helper/email_manager}/__init__.py +0 -0
- {email_manager β dam_helper/email_manager}/email_manager.py +3 -3
- {enums β dam_helper/enums}/__init__.py +0 -0
- {enums β dam_helper/enums}/enums.py +0 -0
- {form β dam_helper/form}/__init__.py +0 -0
- {form β dam_helper/form}/form.pdf +0 -0
- {form β dam_helper/form}/form.py +3 -3
- {llm_manager β dam_helper/llm_manager}/__init__.py +0 -0
- {llm_manager β dam_helper/llm_manager}/llm_parser.py +3 -3
- {local_storage β dam_helper/local_storage}/__init__.py +0 -0
- {local_storage β dam_helper/local_storage}/entities.py +1 -1
- {local_storage β dam_helper/local_storage}/enums.py +0 -0
- {local_storage β dam_helper/local_storage}/ls_manager.py +2 -2
- {prompts β dam_helper/prompts}/__init__.py +0 -0
- {prompts β dam_helper/prompts}/prompts_manager.py +3 -3
- {prompts β dam_helper/prompts}/questions.txt +0 -0
- {prompts β dam_helper/prompts}/system_prompt.txt +0 -0
- {prompts β dam_helper/prompts}/verification_prompt2.txt +0 -0
- {repository β dam_helper/repository}/__init__.py +0 -0
- {repository β dam_helper/repository}/intel_npu.py +2 -3
- {repository β dam_helper/repository}/ollama.py +1 -1
- {repository β dam_helper/repository}/ondemand.py +1 -1
- {repository β dam_helper/repository}/repository.py +6 -6
- {repository β dam_helper/repository}/testing_repo.py +1 -3
- {ui_manager β dam_helper/ui_manager}/__init__.py +0 -0
- {ui_manager β dam_helper/ui_manager}/ui_manager.py +10 -10
- {utils β dam_helper/utils}/__init__.py +0 -0
- {utils β dam_helper/utils}/date_utils.py +0 -0
- {utils β dam_helper/utils}/env_utils.py +0 -0
- {utils β dam_helper/utils}/parsing_utils.py +0 -0
- test.py +1 -1
README.md
CHANGED
@@ -32,8 +32,4 @@ natural language, for example: if you write that the
|
|
32 |
work you need to do will take place in two days, it
|
33 |
should correctly calculate the date and pass it down
|
34 |
in a way that the rest of my application can parse, which I think
|
35 |
-
is quite neat
|
36 |
-
|
37 |
-
## Why is the code related to the Intel NPU all commented out?
|
38 |
-
As of today HF cannot build the wheel: I tried to upload my
|
39 |
-
wheel but I built it on Windows and I guess HF uses Linux
|
|
|
32 |
work you need to do will take place in two days, it
|
33 |
should correctly calculate the date and pass it down
|
34 |
in a way that the rest of my application can parse, which I think
|
35 |
+
is quite neat
|
|
|
|
|
|
|
|
app.py β dam_helper/app.py
RENAMED
File without changes
|
{email_manager β dam_helper/email_manager}/__init__.py
RENAMED
File without changes
|
{email_manager β dam_helper/email_manager}/email_manager.py
RENAMED
@@ -1,8 +1,8 @@
|
|
1 |
from email.message import EmailMessage
|
2 |
|
3 |
-
from enums.enums import Questions
|
4 |
-
from prompts.prompts_manager import PromptsManager
|
5 |
-
from repository import Repository
|
6 |
|
7 |
|
8 |
class EmailManager:
|
|
|
1 |
from email.message import EmailMessage
|
2 |
|
3 |
+
from dam_helper.enums.enums import Questions
|
4 |
+
from dam_helper.prompts.prompts_manager import PromptsManager
|
5 |
+
from dam_helper.repository import Repository
|
6 |
|
7 |
|
8 |
class EmailManager:
|
{enums β dam_helper/enums}/__init__.py
RENAMED
File without changes
|
{enums β dam_helper/enums}/enums.py
RENAMED
File without changes
|
{form β dam_helper/form}/__init__.py
RENAMED
File without changes
|
{form β dam_helper/form}/form.pdf
RENAMED
File without changes
|
{form β dam_helper/form}/form.py
RENAMED
@@ -2,9 +2,9 @@ from pathlib import Path
|
|
2 |
from typing import TypedDict, Tuple
|
3 |
from PyPDFForm import PdfWrapper
|
4 |
|
5 |
-
from enums.enums import Questions
|
6 |
-
from utils.date_utils import get_today_date_as_dd_mm_yyyy
|
7 |
-
from utils.parsing_utils import find_and_parse_date, find_and_parse_phone_number
|
8 |
|
9 |
|
10 |
def build_form_data_from_answers(answers: dict[Questions, str], categories: list[str], signature: str | None = None) -> (
|
|
|
2 |
from typing import TypedDict, Tuple
|
3 |
from PyPDFForm import PdfWrapper
|
4 |
|
5 |
+
from dam_helper.enums.enums import Questions
|
6 |
+
from dam_helper.utils.date_utils import get_today_date_as_dd_mm_yyyy
|
7 |
+
from dam_helper.utils.parsing_utils import find_and_parse_date, find_and_parse_phone_number
|
8 |
|
9 |
|
10 |
def build_form_data_from_answers(answers: dict[Questions, str], categories: list[str], signature: str | None = None) -> (
|
{llm_manager β dam_helper/llm_manager}/__init__.py
RENAMED
File without changes
|
{llm_manager β dam_helper/llm_manager}/llm_parser.py
RENAMED
@@ -1,6 +1,6 @@
|
|
1 |
-
from form.form import work_categories
|
2 |
-
from local_storage.entities import SavedDetails
|
3 |
-
from enums.enums import Questions
|
4 |
|
5 |
|
6 |
class LlmParser:
|
|
|
1 |
+
from dam_helper.form.form import work_categories
|
2 |
+
from dam_helper.local_storage.entities import SavedDetails
|
3 |
+
from dam_helper.enums.enums import Questions
|
4 |
|
5 |
|
6 |
class LlmParser:
|
{local_storage β dam_helper/local_storage}/__init__.py
RENAMED
File without changes
|
{local_storage β dam_helper/local_storage}/entities.py
RENAMED
@@ -1,6 +1,6 @@
|
|
1 |
import abc
|
2 |
|
3 |
-
from enums.enums import Questions, DetailsType
|
4 |
|
5 |
|
6 |
class SavedDetails(abc.ABC):
|
|
|
1 |
import abc
|
2 |
|
3 |
+
from dam_helper.enums.enums import Questions, DetailsType
|
4 |
|
5 |
|
6 |
class SavedDetails(abc.ABC):
|
{local_storage β dam_helper/local_storage}/enums.py
RENAMED
File without changes
|
{local_storage β dam_helper/local_storage}/ls_manager.py
RENAMED
@@ -1,7 +1,7 @@
|
|
1 |
from streamlit_local_storage import LocalStorage
|
2 |
|
3 |
-
from local_storage.entities import SavedDetails, PersonalDetails, LocationDetails, ContractorDetails
|
4 |
-
from enums.enums import DetailsType
|
5 |
|
6 |
|
7 |
class LocalStorageManager:
|
|
|
1 |
from streamlit_local_storage import LocalStorage
|
2 |
|
3 |
+
from dam_helper.local_storage.entities import SavedDetails, PersonalDetails, LocationDetails, ContractorDetails
|
4 |
+
from dam_helper.enums.enums import DetailsType
|
5 |
|
6 |
|
7 |
class LocalStorageManager:
|
{prompts β dam_helper/prompts}/__init__.py
RENAMED
File without changes
|
{prompts β dam_helper/prompts}/prompts_manager.py
RENAMED
@@ -1,8 +1,8 @@
|
|
1 |
from pathlib import Path
|
2 |
|
3 |
-
from enums.enums import Questions
|
4 |
-
from local_storage.entities import PersonalDetails, ContractorDetails, LocationDetails
|
5 |
-
from utils.date_utils import get_today_date_as_dd_mm_yyyy
|
6 |
|
7 |
|
8 |
class PromptsManager:
|
|
|
1 |
from pathlib import Path
|
2 |
|
3 |
+
from dam_helper.enums.enums import Questions
|
4 |
+
from dam_helper.local_storage.entities import PersonalDetails, ContractorDetails, LocationDetails
|
5 |
+
from dam_helper.utils.date_utils import get_today_date_as_dd_mm_yyyy
|
6 |
|
7 |
|
8 |
class PromptsManager:
|
{prompts β dam_helper/prompts}/questions.txt
RENAMED
File without changes
|
{prompts β dam_helper/prompts}/system_prompt.txt
RENAMED
File without changes
|
{prompts β dam_helper/prompts}/verification_prompt2.txt
RENAMED
File without changes
|
{repository β dam_helper/repository}/__init__.py
RENAMED
File without changes
|
{repository β dam_helper/repository}/intel_npu.py
RENAMED
@@ -1,12 +1,11 @@
|
|
1 |
import json
|
2 |
from pathlib import Path
|
3 |
|
4 |
-
from intel_npu_acceleration_library import NPUModelForCausalLM,
|
5 |
from intel_npu_acceleration_library.compiler import CompilerConfig
|
6 |
-
from intel_npu_acceleration_library.dtypes import float32, float64, bfloat16
|
7 |
from transformers import AutoTokenizer
|
8 |
|
9 |
-
from repository import Model, Repository
|
10 |
|
11 |
|
12 |
class IntelNpuRepository(Repository):
|
|
|
1 |
import json
|
2 |
from pathlib import Path
|
3 |
|
4 |
+
from intel_npu_acceleration_library import NPUModelForCausalLM, float16
|
5 |
from intel_npu_acceleration_library.compiler import CompilerConfig
|
|
|
6 |
from transformers import AutoTokenizer
|
7 |
|
8 |
+
from dam_helper.repository import Model, Repository
|
9 |
|
10 |
|
11 |
class IntelNpuRepository(Repository):
|
{repository β dam_helper/repository}/ollama.py
RENAMED
@@ -1,7 +1,7 @@
|
|
1 |
import ollama
|
2 |
from ollama import Options
|
3 |
|
4 |
-
from repository import Model, Repository
|
5 |
|
6 |
|
7 |
class OllamaRepository(Repository):
|
|
|
1 |
import ollama
|
2 |
from ollama import Options
|
3 |
|
4 |
+
from dam_helper.repository import Model, Repository
|
5 |
|
6 |
|
7 |
class OllamaRepository(Repository):
|
{repository β dam_helper/repository}/ondemand.py
RENAMED
@@ -3,7 +3,7 @@ from pathlib import Path
|
|
3 |
|
4 |
import requests
|
5 |
|
6 |
-
from repository import ModelRoles, Model, Repository
|
7 |
|
8 |
|
9 |
class OndemandRepository(Repository):
|
|
|
3 |
|
4 |
import requests
|
5 |
|
6 |
+
from dam_helper.repository import ModelRoles, Model, Repository
|
7 |
|
8 |
|
9 |
class OndemandRepository(Repository):
|
{repository β dam_helper/repository}/repository.py
RENAMED
@@ -1,14 +1,14 @@
|
|
1 |
import os
|
2 |
from pathlib import Path
|
3 |
|
4 |
-
from repository import ModelRoles, Model
|
5 |
-
from utils.env_utils import in_hf
|
6 |
|
7 |
if not in_hf():
|
8 |
-
from repository.intel_npu import IntelNpuRepository
|
9 |
-
from repository.ollama import OllamaRepository
|
10 |
-
from repository.ondemand import OndemandRepository
|
11 |
-
from repository.testing_repo import TestingRepository
|
12 |
|
13 |
|
14 |
def build_repo_from_environment(system_prompt: str):
|
|
|
1 |
import os
|
2 |
from pathlib import Path
|
3 |
|
4 |
+
from dam_helper.repository import ModelRoles, Model
|
5 |
+
from dam_helper.utils.env_utils import in_hf
|
6 |
|
7 |
if not in_hf():
|
8 |
+
from dam_helper.repository.intel_npu import IntelNpuRepository
|
9 |
+
from dam_helper.repository.ollama import OllamaRepository
|
10 |
+
from dam_helper.repository.ondemand import OndemandRepository
|
11 |
+
from dam_helper.repository.testing_repo import TestingRepository
|
12 |
|
13 |
|
14 |
def build_repo_from_environment(system_prompt: str):
|
{repository β dam_helper/repository}/testing_repo.py
RENAMED
@@ -1,6 +1,4 @@
|
|
1 |
-
from
|
2 |
-
|
3 |
-
from repository import ModelRoles, Model, Repository
|
4 |
|
5 |
|
6 |
class TestingRepository(Repository):
|
|
|
1 |
+
from dam_helper.repository import ModelRoles, Model, Repository
|
|
|
|
|
2 |
|
3 |
|
4 |
class TestingRepository(Repository):
|
{ui_manager β dam_helper/ui_manager}/__init__.py
RENAMED
File without changes
|
{ui_manager β dam_helper/ui_manager}/ui_manager.py
RENAMED
@@ -4,16 +4,16 @@ import streamlit as st
|
|
4 |
from streamlit import session_state as ss
|
5 |
from streamlit.runtime.scriptrunner_utils.exceptions import StopException
|
6 |
|
7 |
-
from email_manager.email_manager import EmailManager
|
8 |
-
from enums.enums import Steps, DetailsType, Questions as Q
|
9 |
-
from form.form import work_categories, build_form_data_from_answers, write_pdf_form
|
10 |
-
from llm_manager.llm_parser import LlmParser
|
11 |
-
from local_storage.entities import PersonalDetails, LocationDetails, ContractorDetails
|
12 |
-
from local_storage.ls_manager import LocalStorageManager
|
13 |
-
from prompts.prompts_manager import PromptsManager
|
14 |
-
from repository import Model, ModelRoles
|
15 |
-
from repository.repository import build_repo_from_environment, get_repository
|
16 |
-
from utils.parsing_utils import check_for_missing_answers
|
17 |
|
18 |
|
19 |
class UIManager:
|
|
|
4 |
from streamlit import session_state as ss
|
5 |
from streamlit.runtime.scriptrunner_utils.exceptions import StopException
|
6 |
|
7 |
+
from dam_helper.email_manager.email_manager import EmailManager
|
8 |
+
from dam_helper.enums.enums import Steps, DetailsType, Questions as Q
|
9 |
+
from dam_helper.form.form import work_categories, build_form_data_from_answers, write_pdf_form
|
10 |
+
from dam_helper.llm_manager.llm_parser import LlmParser
|
11 |
+
from dam_helper.local_storage.entities import PersonalDetails, LocationDetails, ContractorDetails, SavedDetails
|
12 |
+
from dam_helper.local_storage.ls_manager import LocalStorageManager
|
13 |
+
from dam_helper.prompts.prompts_manager import PromptsManager
|
14 |
+
from dam_helper.repository import Model, ModelRoles
|
15 |
+
from dam_helper.repository.repository import build_repo_from_environment, get_repository
|
16 |
+
from dam_helper.utils.parsing_utils import check_for_missing_answers
|
17 |
|
18 |
|
19 |
class UIManager:
|
{utils β dam_helper/utils}/__init__.py
RENAMED
File without changes
|
{utils β dam_helper/utils}/date_utils.py
RENAMED
File without changes
|
{utils β dam_helper/utils}/env_utils.py
RENAMED
File without changes
|
{utils β dam_helper/utils}/parsing_utils.py
RENAMED
File without changes
|
test.py
CHANGED
@@ -50,7 +50,7 @@ What is my email?
|
|
50 |
|
51 |
e.r@l.com
|
52 |
"""
|
53 |
-
from llm_manager.llm_parser import LlmParser
|
54 |
|
55 |
llm_parser = LlmParser
|
56 |
llm_parser.parse_verification_prompt_answers(llm_answer)
|
|
|
50 |
|
51 |
e.r@l.com
|
52 |
"""
|
53 |
+
from dam_helper.llm_manager.llm_parser import LlmParser
|
54 |
|
55 |
llm_parser = LlmParser
|
56 |
llm_parser.parse_verification_prompt_answers(llm_answer)
|