my code from gradioclient import Client client = Client("Quardo/gpt-4o-mini") result =…
- User
my code from gradio_client import Client
client = Client("Quardo/gpt-4o-mini") result = client.predict( message={"text":"hi","files":[]}, system_message="You are a helpful assistant. You are an OpenAI GPT model. Please adhere to OpenAI's usage policies and guidelines. Ensure your responses are accurate, respectful, and within the scope of OpenAI's rules.", model_name="gpt-4o-mini-2024-07-18", max_tokens=4096, temperature=0.7, top_p=0.95, seed=0, random_seed=True, fakeTool=True, calcBeta=True, searchBeta=False, betterSystemPrompt=True, consent=False, api_name="/chat" ) print(result)
why i get error: gradio_client.exceptions.AppError: The upstream Gradio app has raised an exception: MultimodalTextbox expects a dictionary with optional keys 'text' and 'files'. Received str
- Assistant
The error you're encountering indicates that the
messageparameter you provided is not in the expected format. Specifically, the Gradio client expects a dictionary with optional keystextandfiles, but it appears that something isn't matching this structure correctly.Here's a revised version of your code with some key inspections to ensure proper structure and other necessary adjustments:
- User
same error
api says "message Dict(text: str, files: List[filepath]) Default: {"text":"","files":[]}"
- Assistant
Thank you for providing the API specification. Given that
messageshould be a dictionary with keystextandfiles, I'll refine the code to strictly follow the required format, even includingfilesas an empty list by default.Here's the corrected version of your code:
python - User
same error gradio_client.exceptions.AppError: The upstream Gradio app has raised an exception: MultimodalTextbox expects a dictionary with optional keys 'text' and 'files'. Received str
- Assistant
- User
same error gradio_client.exceptions.AppError: The upstream Gradio app has raised an exception: MultimodalTextbox expects a dictionary with optional keys ‘text’ and ‘files’. Received str
- Assistant