mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-06 02:30:41 -08:00
Use gradio api in flux dev
This commit is contained in:
parent
78cb36dc71
commit
69d0b09816
3 changed files with 69 additions and 43 deletions
|
|
@ -19,7 +19,6 @@ from ... import version, models
|
|||
from ... import ChatCompletion, get_model_and_provider
|
||||
from ... import debug
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
conversations: dict[dict[str, BaseConversation]] = {}
|
||||
|
||||
class Api:
|
||||
|
|
@ -156,7 +155,6 @@ class Api:
|
|||
has_images="images" in kwargs,
|
||||
)
|
||||
except Exception as e:
|
||||
logger.exception(e)
|
||||
debug.error(e)
|
||||
yield self._format_json('error', type(e).__name__, message=get_error_message(e))
|
||||
return
|
||||
|
|
@ -186,7 +184,6 @@ class Api:
|
|||
else:
|
||||
yield self._format_json("conversation_id", conversation_id)
|
||||
elif isinstance(chunk, Exception):
|
||||
logger.exception(chunk)
|
||||
debug.error(chunk)
|
||||
yield self._format_json('message', get_error_message(chunk), error=type(chunk).__name__)
|
||||
elif isinstance(chunk, PreviewResponse):
|
||||
|
|
@ -222,7 +219,6 @@ class Api:
|
|||
yield self._format_json("content", str(chunk))
|
||||
yield from self._yield_logs()
|
||||
except Exception as e:
|
||||
logger.exception(e)
|
||||
debug.error(e)
|
||||
yield from self._yield_logs()
|
||||
yield self._format_json('error', type(e).__name__, message=get_error_message(e))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue