Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
j-dominguez9 committed Jul 8, 2024
1 parent ad40069 commit 67e939a
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 23 deletions.
16 changes: 9 additions & 7 deletions app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
from glob import glob

import gradio as gr
from process import diff_texts
from process import extract_docx
from process import extract_pdf
from process import extract_text
from process import model_load
from process import translator
from process import translator_sec
from process import (
diff_texts,
extract_docx,
extract_pdf,
extract_text,
model_load,
translator,
translator_sec,
)


def huanik(
Expand Down
3 changes: 1 addition & 2 deletions app/patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
import time
from functools import wraps
from threading import Lock
from typing import Optional
from typing import Union
from typing import Optional, Union

import gradio as gr
import openai
Expand Down
20 changes: 11 additions & 9 deletions app/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@
import pymupdf
from icecream import ic
from langchain_text_splitters import RecursiveCharacterTextSplitter
from patch import calculate_chunk_size
from patch import model_load
from patch import multichunk_improve_translation
from patch import multichunk_initial_translation
from patch import multichunk_reflect_on_translation
from patch import num_tokens_in_string
from patch import one_chunk_improve_translation
from patch import one_chunk_initial_translation
from patch import one_chunk_reflect_on_translation
from patch import (
calculate_chunk_size,
model_load,
multichunk_improve_translation,
multichunk_initial_translation,
multichunk_reflect_on_translation,
num_tokens_in_string,
one_chunk_improve_translation,
one_chunk_initial_translation,
one_chunk_reflect_on_translation,
)
from simplemma import simple_tokenizer


Expand Down
5 changes: 2 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ readme = "README.md"
package-mode = true
packages = [
{ include = "translation_agent", from = "src" },
{ include = "webui", from = "app" },
]
repository = "https://github.com/andrewyng/translation-agent"
keywords = ["translation", "agents", "LLM", "machine translation"]
Expand Down Expand Up @@ -76,7 +75,7 @@ priority = "supplemental"
# Set the maximum line length to 79.
line-length = 79
indent-width = 4
exclude = [".venv", ".env", ".git", "tests", "eval"]
exclude = [".venv", ".env", ".git", "tests", "eval", ".jj"]

[tool.ruff.lint]
# Add the `line-too-long` rule to the enforced rule set. By default, Ruff omits rules that
Expand All @@ -101,7 +100,7 @@ fixable = ["ALL"]
ignore = ["SIM117"]

[tool.ruff.lint.isort]
force-single-line = true
force-single-line = false
lines-after-imports = 2
known-first-party = ["translation-agent"]

Expand Down
3 changes: 1 addition & 2 deletions src/translation_agent/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import os
from typing import List
from typing import Union
from typing import List, Union

import openai
import tiktoken
Expand Down

0 comments on commit 67e939a

Please sign in to comment.