Skip to content

Commit

Permalink
fix stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
philschmid committed Aug 10, 2023
1 parent 3179861 commit ee4280a
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions easyllm/clients/huggingface.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import importlib.metadata
import json
import logging
import os
from typing import Any, Dict, List, Optional, Union

from huggingface_hub import HfFolder, InferenceClient
from nanoid import generate
from packaging.version import parse

from easyllm.prompt_utils.base import build_prompt, buildBasePrompt
from easyllm.schema.base import ChatMessage, Usage, dump_object # noqa: F811
from easyllm.schema.base import ChatMessage, Usage, dump_object
from easyllm.schema.openai import (
ChatCompletionRequest,
ChatCompletionResponse,
Expand Down Expand Up @@ -505,10 +503,3 @@ async def acreate(cls, *args, **kwargs):
Creates a new chat completion for the provided messages and parameters.
"""
raise NotImplementedError("ChatCompletion.acreate is not implemented")


def dump_object(object):
if parse(importlib.metadata.version("pydantic")) < parse("2.0.0"):
return object.dict()
else:
return object.model_dump(exclude_none=True)

0 comments on commit ee4280a

Please sign in to comment.