mirror of
https://github.com/gradio-app/gradio.git
synced 2024-12-15 02:11:15 +08:00
Fix multipart
ModuleNotFoundError by renaming import to python_multipart
(#10188)
* Fix ModuleNotFoundError * add changeset * more changes * formt * add changeset * add changeset --------- Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com> Co-authored-by: Abubakar Abid <abubakar@huggingface.co>
This commit is contained in:
parent
9cd291b7f1
commit
22fe4ce5a1
5
.changeset/wild-sheep-agree.md
Normal file
5
.changeset/wild-sheep-agree.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"gradio": patch
|
||||
---
|
||||
|
||||
feat:Fix `multipart` ModuleNotFoundError by renaming import to `python_multipart`
|
@ -31,9 +31,8 @@ import anyio
|
||||
import fastapi
|
||||
import gradio_client.utils as client_utils
|
||||
import httpx
|
||||
import multipart
|
||||
from gradio_client.documentation import document
|
||||
from multipart.multipart import parse_options_header
|
||||
from python_multipart.multipart import MultipartParser, parse_options_header
|
||||
from starlette.datastructures import FormData, Headers, MutableHeaders, UploadFile
|
||||
from starlette.formparsers import MultiPartException, MultipartPart
|
||||
from starlette.responses import PlainTextResponse, Response
|
||||
@ -644,7 +643,7 @@ class GradioMultiPartParser:
|
||||
}
|
||||
|
||||
# Create the parser.
|
||||
parser = multipart.MultipartParser(boundary, callbacks) # type: ignore
|
||||
parser = MultipartParser(boundary, callbacks) # type: ignore
|
||||
try:
|
||||
# Feed the parser with data from the request.
|
||||
async for chunk in self.stream:
|
||||
|
@ -56,7 +56,7 @@ from gradio_client import utils as client_utils
|
||||
from gradio_client.documentation import document
|
||||
from gradio_client.utils import ServerMessage
|
||||
from jinja2.exceptions import TemplateNotFound
|
||||
from multipart.multipart import parse_options_header
|
||||
from python_multipart.multipart import parse_options_header
|
||||
from starlette.background import BackgroundTask
|
||||
from starlette.datastructures import UploadFile as StarletteUploadFile
|
||||
from starlette.responses import RedirectResponse
|
||||
|
Loading…
Reference in New Issue
Block a user