enricorampazzo commited on
Commit
37de7f1
β€’
1 Parent(s): c1c7334

moved python code to dam_helper folder

Browse files
Files changed (33) hide show
  1. README.md +1 -5
  2. app.py β†’ dam_helper/app.py +0 -0
  3. {email_manager β†’ dam_helper/email_manager}/__init__.py +0 -0
  4. {email_manager β†’ dam_helper/email_manager}/email_manager.py +3 -3
  5. {enums β†’ dam_helper/enums}/__init__.py +0 -0
  6. {enums β†’ dam_helper/enums}/enums.py +0 -0
  7. {form β†’ dam_helper/form}/__init__.py +0 -0
  8. {form β†’ dam_helper/form}/form.pdf +0 -0
  9. {form β†’ dam_helper/form}/form.py +3 -3
  10. {llm_manager β†’ dam_helper/llm_manager}/__init__.py +0 -0
  11. {llm_manager β†’ dam_helper/llm_manager}/llm_parser.py +3 -3
  12. {local_storage β†’ dam_helper/local_storage}/__init__.py +0 -0
  13. {local_storage β†’ dam_helper/local_storage}/entities.py +1 -1
  14. {local_storage β†’ dam_helper/local_storage}/enums.py +0 -0
  15. {local_storage β†’ dam_helper/local_storage}/ls_manager.py +2 -2
  16. {prompts β†’ dam_helper/prompts}/__init__.py +0 -0
  17. {prompts β†’ dam_helper/prompts}/prompts_manager.py +3 -3
  18. {prompts β†’ dam_helper/prompts}/questions.txt +0 -0
  19. {prompts β†’ dam_helper/prompts}/system_prompt.txt +0 -0
  20. {prompts β†’ dam_helper/prompts}/verification_prompt2.txt +0 -0
  21. {repository β†’ dam_helper/repository}/__init__.py +0 -0
  22. {repository β†’ dam_helper/repository}/intel_npu.py +2 -3
  23. {repository β†’ dam_helper/repository}/ollama.py +1 -1
  24. {repository β†’ dam_helper/repository}/ondemand.py +1 -1
  25. {repository β†’ dam_helper/repository}/repository.py +6 -6
  26. {repository β†’ dam_helper/repository}/testing_repo.py +1 -3
  27. {ui_manager β†’ dam_helper/ui_manager}/__init__.py +0 -0
  28. {ui_manager β†’ dam_helper/ui_manager}/ui_manager.py +10 -10
  29. {utils β†’ dam_helper/utils}/__init__.py +0 -0
  30. {utils β†’ dam_helper/utils}/date_utils.py +0 -0
  31. {utils β†’ dam_helper/utils}/env_utils.py +0 -0
  32. {utils β†’ dam_helper/utils}/parsing_utils.py +0 -0
  33. 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, int4, float16
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 typing import Tuple
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
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
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)