Skip to content

Commit

Permalink
updated requirements to move past spacy's pydantic 1 restriction
Browse files Browse the repository at this point in the history
specified exact ja and en language model download paths

moved gradio to 4.11
moved  spacy to 3.7+ *& 3.8-

adjusted webgui to fit with new changes
  • Loading branch information
Bikatr7 committed Jan 14, 2024
1 parent 30cda18 commit 1f8be65
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
8 changes: 4 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
spacy==3.5.4
spacy>=3.7.0,<3.8.0
spacy[jp]
spacy[en]
ja_core_news_lg
en_core_web_lg
ja_core_news_lg @ https://github.com/explosion/spacy-models/releases/download/ja_core_news_lg-3.7.0/ja_core_news_lg-3.7.0-py3-none-any.whl
en-core-web-lg @ https://github.com/explosion/spacy-models/releases/download/en_core_web_lg-3.7.0/en_core_web_lg-3.7.0-py3-none-any.whl
deepl
openai>1.2.0
backoff
requests
tiktoken
gradio==3.50.2
gradio==4.11.0
34 changes: 17 additions & 17 deletions webgui.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,8 @@ def create_new_key_value_tuple_pairs(kijiku_settings:typing.List[str]) -> typing

## input fields, text input for preprocessing, and replacement json file input.
with gr.Column():
self.input_txt_file_preprocessing = gr.File(label='TXT file with Japanese Text', file_count='single', file_types=['.txt'], type='file')
self.input_json_file = gr.File(label='Replacements JSON file', file_count='single', file_types=['.json'], type='file')
self.input_txt_file_preprocessing = gr.File(label='TXT file with Japanese Text', file_count='single', file_types=['.txt'], type='filepath')
self.input_json_file = gr.File(label='Replacements JSON file', file_count='single', file_types=['.json'], type='filepath')

## run and clear buttons
with gr.Row():
Expand Down Expand Up @@ -216,7 +216,7 @@ def create_new_key_value_tuple_pairs(kijiku_settings:typing.List[str]) -> typing

## input file or text input, gui allows for both but will prioritize file input
with gr.Column():
self.input_txt_file_kaiseki = gr.File(label='TXT file with Japanese Text', file_count='single', file_types=['.txt'], type='file', interactive=True)
self.input_txt_file_kaiseki = gr.File(label='TXT file with Japanese Text', file_count='single', file_types=['.txt'], type='filepath', interactive=True)
self.input_text_kaiseki = gr.Textbox(label='Japanese Text', placeholder='Use this or the text file input, if you provide both, Kudasai will use the file input.', lines=10, show_label=True, interactive=True)


Expand Down Expand Up @@ -252,9 +252,9 @@ def create_new_key_value_tuple_pairs(kijiku_settings:typing.List[str]) -> typing

## input file or text input, gui allows for both but will prioritize file input
with gr.Column():
self.input_txt_file_kijiku = gr.File(label='TXT file with Japanese Text', file_count='single', file_types=['.txt'], type='file', interactive=True)
self.input_txt_file_kijiku = gr.File(label='TXT file with Japanese Text', file_count='single', file_types=['.txt'], type='filepath', interactive=True)
self.input_text_kijiku = gr.Textbox(label='Japanese Text', placeholder='Use this or the text file input, if you provide both, Kudasai will use the file input.', lines=10, show_label=True, interactive=True, type='text')
self.input_kijiku_rules_file = gr.File(value = FileEnsurer.config_kijiku_rules_path, label='Kijiku Rules File', file_count='single', file_types=['.json'], type='file')
self.input_kijiku_rules_file = gr.File(value = FileEnsurer.config_kijiku_rules_path, label='Kijiku Rules File', file_count='single', file_types=['.json'], type='filepath')

with gr.Row():
self.kijiku_api_key_input = gr.Textbox(label='API Key', value=get_saved_kijiku_api_key, lines=1, max_lines=2, show_label=True, interactive=True)
Expand Down Expand Up @@ -818,7 +818,7 @@ def kijiku_clear_button_click() -> typing.Tuple[None, str, gr.File, str, str, st
input_text_kijiku = ""

## Also gonna want to reset the json input field to the default json file
input_kijiku_rules_file = gr.File(value = FileEnsurer.config_kijiku_rules_path, label='Kijiku Rules File', file_count='single', file_types=['.json'], type='file')
input_kijiku_rules_file = gr.File(value = FileEnsurer.config_kijiku_rules_path, label='Kijiku Rules File', file_count='single', file_types=['.json'], type='filepath')

kijiku_translated_text_output_field = ""
je_check_text_field_kijiku = ""
Expand Down Expand Up @@ -1283,7 +1283,7 @@ def fetch_debug_log_content() -> typing.Tuple[str, str]:
outputs=[],

## javascript code that allows us to save textbox contents to a file
_js=(self.save_as_js).replace("downloaded_text.txt", "preprocessed_text.txt")
js=(self.save_as_js).replace("downloaded_text.txt", "preprocessed_text.txt")
)

##-------------------start-of-save_to_file_preprocessing_results_click()---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Expand All @@ -1294,7 +1294,7 @@ def fetch_debug_log_content() -> typing.Tuple[str, str]:
outputs=[],

## javascript code that allows us to save textbox contents to a file
_js=(self.save_as_js).replace("downloaded_text.txt", "preprocessing_results.txt")
js=(self.save_as_js).replace("downloaded_text.txt", "preprocessing_results.txt")
)

##-------------------start-of-save_to_file_debug_log_processing_tab_click()---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Expand All @@ -1305,7 +1305,7 @@ def fetch_debug_log_content() -> typing.Tuple[str, str]:
outputs=[],

## javascript code that allows us to save textbox contents to a file
_js=(self.save_as_js).replace("downloaded_text.txt", "processing_debug_log.txt")
js=(self.save_as_js).replace("downloaded_text.txt", "processing_debug_log.txt")
)

##-------------------start-of-save_to_file_kaiseki_click()---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Expand All @@ -1316,7 +1316,7 @@ def fetch_debug_log_content() -> typing.Tuple[str, str]:
outputs=[],

## javascript code that allows us to save textbox contents to a file
_js=(self.save_as_js).replace("downloaded_text.txt", "translated_text.txt")
js=(self.save_as_js).replace("downloaded_text.txt", "translated_text.txt")
)

##-------------------start-of-save_to_file_je_check_text_kaiseki_click()---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Expand All @@ -1327,7 +1327,7 @@ def fetch_debug_log_content() -> typing.Tuple[str, str]:
outputs=[],

## javascript code that allows us to save textbox contents to a file
_js=(self.save_as_js).replace("downloaded_text.txt", "je_check_text.txt")
js=(self.save_as_js).replace("downloaded_text.txt", "je_check_text.txt")
)

##-------------------start-of-save_to_file_debug_log_kaiseki_tab_click()---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Expand All @@ -1338,7 +1338,7 @@ def fetch_debug_log_content() -> typing.Tuple[str, str]:
outputs=[],

## javascript code that allows us to save textbox contents to a file
_js=(self.save_as_js).replace("downloaded_text.txt", "debug_log.txt")
js=(self.save_as_js).replace("downloaded_text.txt", "debug_log.txt")
)

##-------------------start-of-save_to_file_kijiku_click()---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Expand All @@ -1349,7 +1349,7 @@ def fetch_debug_log_content() -> typing.Tuple[str, str]:
outputs=[],

## javascript code that allows us to save textbox contents to a file
_js=(self.save_as_js).replace("downloaded_text.txt", "translated_text.txt")
js=(self.save_as_js).replace("downloaded_text.txt", "translated_text.txt")
)

##-------------------start-of-save_to_file_je_check_text_kijiku_click()---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Expand All @@ -1360,7 +1360,7 @@ def fetch_debug_log_content() -> typing.Tuple[str, str]:
outputs=[],

## javascript code that allows us to save textbox contents to a file
_js=(self.save_as_js).replace("downloaded_text.txt", "je_check_text.txt")
js=(self.save_as_js).replace("downloaded_text.txt", "je_check_text.txt")
)

##-------------------start-of-save_to_file_debug_log_kijiku_tab_click()---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Expand All @@ -1371,7 +1371,7 @@ def fetch_debug_log_content() -> typing.Tuple[str, str]:
outputs=[],

## javascript code that allows us to save textbox contents to a file
_js=(self.save_as_js).replace("downloaded_text.txt", "debug_log.txt")
js=(self.save_as_js).replace("downloaded_text.txt", "debug_log.txt")
)

##-------------------start-of-save_to_file_debug_log_logging_tab_click()---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Expand All @@ -1382,7 +1382,7 @@ def fetch_debug_log_content() -> typing.Tuple[str, str]:
outputs=[],

## javascript code that allows us to save textbox contents to a file
_js=(self.save_as_js).replace("downloaded_text.txt", "debug_log_all.txt")
js=(self.save_as_js).replace("downloaded_text.txt", "debug_log_all.txt")
)

##-------------------start-of-save_to_file_error_log_click()---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Expand All @@ -1393,7 +1393,7 @@ def fetch_debug_log_content() -> typing.Tuple[str, str]:
outputs=[],

## javascript code that allows us to save textbox contents to a file
_js=(self.save_as_js).replace("downloaded_text.txt", "error_log.txt")
js=(self.save_as_js).replace("downloaded_text.txt", "error_log.txt")
)

##-------------------start-of-send_to_x_click()---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit 1f8be65

Please sign in to comment.