Skip to content

Commit

Permalink
cleanup: unused import
Browse files Browse the repository at this point in the history
Signed-off-by: Yu Fan <fany@buaa.edu.cn>
  • Loading branch information
FuryMartin committed Oct 6, 2024
1 parent 5857c58 commit 8fee150
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,12 @@
from __future__ import absolute_import, division, print_function

import os
import json
import tempfile
import time
import zipfile

import numpy as np
from sedna.common.config import Context
from core.common.log import LOGGER
from sedna.common.class_factory import ClassType, ClassFactory

from models import HuggingfaceLLM, APIBasedLLM, VllmLLM

from transformers import AutoModelForCausalLM, AutoTokenizer
from models import APIBasedLLM
device = "cuda" # the device to load the model onto

from core.common.log import LOGGER

os.environ['BACKEND_TYPE'] = 'TORCH'

Expand All @@ -39,10 +30,7 @@
class CloudModel:
def __init__(self, **kwargs):
LOGGER.info(kwargs)
# The API KEY and API URL are confidential data and should not be written in yaml.

self.model = APIBasedLLM(**kwargs)

self.model.load(model = kwargs.get("model", "gpt-4o-mini"))

def inference(self, data, input_shape=None, **kwargs):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,13 @@
from __future__ import absolute_import, division, print_function

import os
import tempfile
import time
import zipfile

import numpy as np
from sedna.common.config import Context
from core.common.log import LOGGER
from sedna.common.class_factory import ClassType, ClassFactory

from models import HuggingfaceLLM, APIBasedLLM, VllmLLM

from transformers import AutoModelForCausalLM, AutoTokenizer
device = "cuda" # the device to load the model onto

from core.common.log import LOGGER

os.environ['BACKEND_TYPE'] = 'TORCH'

__all__ = ["BaseModel"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,11 @@ def __call__(self, data=None) -> bool:
return False

def cleanup(self):
print(
f"Both Wrong: {self.both_wrong}\n",
f"Both Correct: {self.both_right}\n",
f"Edge Better: {self.edge_better}\n",
message = [
f"OracleRouter Statistics: \n",
f"Both Wrong: {self.both_wrong}, ",
f"Both Correct: {self.both_right}, ",
f"Edge Better: {self.edge_better}, ",
f"Cloud Better: {self.cloud_better}"
)
]
LOGGER.info("".join(message))

0 comments on commit 8fee150

Please sign in to comment.