Skip to content

Commit

Permalink
isort
Browse files Browse the repository at this point in the history
  • Loading branch information
ixaxaar committed Mar 1, 2024
1 parent a488582 commit 66fd49a
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 36 deletions.
2 changes: 1 addition & 1 deletion geniusrise_text/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from .language_model import LanguageModelAPI, LanguageModelBulk, LanguageModelFineTuner
from .ner import NamedEntityRecognitionAPI, NamedEntityRecognitionBulk, NamedEntityRecognitionFineTuner
from .nli import NLIAPI, NLIBulk, NLIFineTuner
from .notebook import TextJupyterNotebook
from .qa import QAAPI, QABulk, QAFineTuner
from .summarization import SummarizationAPI, SummarizationBulk, SummarizationFineTuner
from .translation import TranslationAPI, TranslationBulk, TranslationFineTuner
from .notebook import TextJupyterNotebook
4 changes: 2 additions & 2 deletions geniusrise_text/base/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@

import json
import threading
from typing import Any, Dict, Optional, Union, List
from typing import Any, Dict, List, Optional, Union

import llama_cpp
import cherrypy
import llama_cpp
from geniusrise import BatchInput, BatchOutput, State
from geniusrise.logging import setup_logger

Expand Down
25 changes: 10 additions & 15 deletions geniusrise_text/base/bulk.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,34 +13,29 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Any, Dict, List, Optional, Tuple, Union
import os
from typing import Any, Dict, List, Optional, Tuple, Union

import llama_cpp
import torch
import transformers
from geniusrise import BatchInput, BatchOutput, Bolt, State
from geniusrise.logging import setup_logger
from llama_cpp import Llama as LlamaCPP
from optimum.bettertransformer import BetterTransformer
from ray.util.placement_group import PlacementGroup
from transformers import (
AutoModelForCausalLM,
AutoTokenizer,
BeamSearchScorer,
LogitsProcessorList,
MinLengthLogitsProcessor,
)
from optimum.bettertransformer import BetterTransformer
from vllm.config import (
ModelConfig as VLLMModelConfig,
CacheConfig,
ParallelConfig,
SchedulerConfig,
DeviceConfig,
LoRAConfig,
)

from vllm import LLM, AsyncLLMEngine
from ray.util.placement_group import PlacementGroup
import llama_cpp
from llama_cpp import Llama as LlamaCPP
from transformers.tokenization_utils_base import PreTrainedTokenizerBase
from vllm import LLM, AsyncLLMEngine
from vllm.config import CacheConfig, DeviceConfig, LoRAConfig
from vllm.config import ModelConfig as VLLMModelConfig
from vllm.config import ParallelConfig, SchedulerConfig

from geniusrise_text.base.communication import send_email

Expand Down
2 changes: 1 addition & 1 deletion geniusrise_text/classification/eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import pandas as pd
import torch
import yaml # type: ignore
from datasets import Dataset, load_from_disk, load_dataset, load_metric
from datasets import Dataset, load_dataset, load_from_disk, load_metric
from geniusrise import BatchInput, BatchOutput, State
from pyarrow import feather
from pyarrow import parquet as pq
Expand Down
11 changes: 6 additions & 5 deletions geniusrise_text/instruction/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,19 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Any, Dict, Optional, Iterator

import asyncio
from concurrent.futures import ThreadPoolExecutor
from typing import Any, Dict, Iterator, Optional

import cherrypy
import llama_cpp
from concurrent.futures import ThreadPoolExecutor
from geniusrise_text.base import TextAPI
from geniusrise import BatchInput, BatchOutput, State
from geniusrise.logging import setup_logger
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
from vllm.entrypoints.openai.serving_chat import OpenAIServingChat
from vllm.entrypoints.openai.protocol import ChatCompletionRequest
from vllm.entrypoints.openai.serving_chat import OpenAIServingChat

from geniusrise_text.base import TextAPI


class InstructionAPI(TextAPI):
Expand Down
4 changes: 2 additions & 2 deletions geniusrise_text/instruction/bulk.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
import xml.etree.ElementTree as ET
from typing import Any, Dict, List, Optional, Union

import pandas as pd
import llama_cpp
from transformers.tokenization_utils_base import PreTrainedTokenizerBase
import pandas as pd
import yaml # type: ignore
from datasets import Dataset, load_from_disk
from geniusrise import BatchInput, BatchOutput, State
from pyarrow import feather
from pyarrow import parquet as pq
from transformers.tokenization_utils_base import PreTrainedTokenizerBase
from vllm import LLM, SamplingParams

from geniusrise_text.base import TextBulk
Expand Down
9 changes: 5 additions & 4 deletions geniusrise_text/language_model/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from typing import Any, Dict, Optional, Iterator
from concurrent.futures import ThreadPoolExecutor
import asyncio
from concurrent.futures import ThreadPoolExecutor
from typing import Any, Dict, Iterator, Optional

import cherrypy
import llama_cpp
from geniusrise import BatchInput, BatchOutput, State
from geniusrise.logging import setup_logger
from vllm.entrypoints.openai.serving_completion import OpenAIServingCompletion
from vllm.entrypoints.openai.protocol import CompletionRequest
import llama_cpp
from vllm.entrypoints.openai.serving_completion import OpenAIServingCompletion

from geniusrise_text.base import TextAPI

Expand Down
3 changes: 2 additions & 1 deletion geniusrise_text/language_model/bulk.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,16 @@
import uuid
import xml.etree.ElementTree as ET
from typing import Any, Dict, List, Optional, Union

import llama_cpp
import pandas as pd
import yaml # type: ignore
from datasets import Dataset, load_from_disk
from geniusrise import BatchInput, BatchOutput, State
from pyarrow import feather
from pyarrow import parquet as pq
from vllm import LLM, SamplingParams
from transformers.tokenization_utils_base import PreTrainedTokenizerBase
from vllm import LLM, SamplingParams

from geniusrise_text.base import TextBulk

Expand Down
2 changes: 1 addition & 1 deletion geniusrise_text/language_model/fine_tune.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import pyarrow.feather as feather
import pyarrow.parquet as pq
import yaml # type: ignore
from datasets import Dataset, load_from_disk, load_metric, load_dataset
from datasets import Dataset, load_dataset, load_from_disk, load_metric
from nltk.translate.bleu_score import corpus_bleu
from transformers import DataCollatorForLanguageModeling, EvalPrediction

Expand Down
3 changes: 2 additions & 1 deletion geniusrise_text/nli/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@
# limitations under the License.

from typing import Any, Dict, List
import numpy as np

import cherrypy
import numpy as np
import torch
from geniusrise import BatchInput, BatchOutput, State
from geniusrise.logging import setup_logger
Expand Down
8 changes: 5 additions & 3 deletions geniusrise_text/notebook/notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
import os
import subprocess
import sys
from jinja2 import Environment, FileSystemLoader, Template
from nbformat import v4 as nbf
from typing import Any, Dict, List, Optional

import nbformat
from geniusrise import BatchInput, BatchOutput, Bolt, State
from geniusrise.logging import setup_logger
from typing import Any, Dict, List, Optional
from jinja2 import Environment, FileSystemLoader, Template
from nbformat import v4 as nbf

from geniusrise_text.base.communication import send_email


Expand Down

0 comments on commit 66fd49a

Please sign in to comment.