Unable to use streaming with the /v1/embeddings API for the CodeQwen1.5-7B model.
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 39.5k
- Forks
- 4.8k
- PR merge metrics
- No merged PRs in 30d
Description
The model address is::https://huggingface.co/Qwen/CodeQwen1.5-7B
The deployment method is:vllm
Request example is:
```
curl -X POST "http://127.0.0.1:9188/v1/completions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer none" \
-H "Accept: text/event-stream" \
-d '{
"model": "CodeQwen1.5-7B",
"stream": true,
"prompt": "// Path: crates/tabby/src/main.rs\n// /// Download the language model for serving.\n// Download(download::DownloadArgs),\n//\n// Path: crates/tabby/src/main.rs\n// #[derive(Subcommand)]\n// pub enum Commands {\n// /// Starts the api endpoint for IDE / Editor extensions.\n// Serve(serve::ServeArgs),\n//\n// /// Download the language model for serving.\n// Download(download::DownloadArgs),\n//\n// /// Run scheduler progress for cron jobs integrating external code repositories.\n// Scheduler(SchedulerArgs),\n//\n// /// Run completion model as worker\n// #[cfg(feature = \"ee\")]\n// #[clap(name = \"worker::completion\", hide = true)]\n// WorkerCompletion(worker::WorkerArgs),\n//\n Commands::Scheduler(SchedulerArgs {\n now,\n url: Some(url),\n token: Some(token),\n }) => {\n let client = tabby_webserver::public::create_scheduler_client(&url, &token).await;\n tabby_scheduler::scheduler(now, client).await\n }\n Commands::Scheduler(SchedulerArgs { now, .. }) => {\n tabby_scheduler::scheduler(now, ConfigRepositoryAccess).await\n }\n #[cfg(feature = \"ee\")]\n Commands::WorkerCompletion(ref args) => {\n worker::main(tabby_webserver::public::WorkerKind::Completion, args).await\n }\n #[cfg(feature = \"ee\")]\n Commands::WorkerChat(ref args) => {\n worker::main(tabby_webserver::public::WorkerKind::Chat, args).await\n }\n Commands::Download()\n }\n}\n\n#[macro_export]\nmacro_rules! fatal {\n ($msg:expr) => {\n ({\n tracing::error!($msg);\n std::process::exit(1);\n })\n };\n\n ($fmt:expr, $($arg:tt)*) => {\n ({\n tracing::error!($fmt, $($arg)*);\n std::process::exit(1);\n })\n };\n}\n",
"n_predict": 12
}'
```
The error log is:
```
2024-05-21 12:23:24 | ERROR | stderr | +-+---------------- 1 ----------------
2024-05-21 12:23:24 | ERROR | stderr | | Traceback (most recent call last):
2024-05-21 12:23:24 | ERROR | stderr | | File "/usr/local/lib/python3.8/dist-packages/starlette/responses.py", line 261, in wrap
2024-05-21 12:23:24 | ERROR | stderr | | task_group.cancel_scope.cancel()
2024-05-21 12:23:24 | ERROR | stderr | | File "/usr/local/lib/python3.8/dist-packages/starlette/responses.py", line 250, in stream_response
2024-05-21 12:23:24 | ERROR | stderr | | if not isinstance(chunk, bytes):
2024-05-21 12:23:24 | ERROR | stderr | | File "/usr/local/lib/python3.8/dist-packages/fastchat/serve/openai_api_server.py", line 674, in generate_completion_stream_generator
2024-05-21 12:23:24 | ERROR | stderr | | yield f"data: {chunk.json(exclude_unset=True, ensure_ascii=False)}\n\n"
2024-05-21 12:23:24 | ERROR | stderr | | File "/usr/local/lib/python3.8/dist-packages/pydantic/main.py", line 1056, in json
2024-05-21 12:23:24 | ERROR | stderr | | def from_orm(cls: type[Model], obj: Any) -> Model: # noqa: D102
2024-05-21 12:23:24 | ERROR | stderr | | TypeError: `dumps_kwargs` keyword arguments are no longer supported.
```
pip list is:
> Package Version
> ----------------------------- ------------
> accelerate 0.28.0
> aiofiles 23.2.1
> aiohttp 3.9.3
> aioprometheus 23.12.0
> aiosignal 1.3.1
> altair 5.2.0
> annotated-types 0.6.0
> anyio 4.3.0
> async-timeout 4.0.3
> attrs 23.2.0
> auto-gptq 0.7.1
> certifi 2022.12.7
> charset-normalizer 2.1.1
> click 8.1.7
> colorama 0.4.6
> coloredlogs 15.0.1
> contourpy 1.1.1
> cupy-cuda12x 12.1.0
> cycler 0.12.1
> datasets 2.18.0
> deepspeed 0.14.0
> dill 0.3.8
> einops 0.7.0
> exceptiongroup 1.2.0
> fastapi 0.110.0
> fastrlock 0.8.2
> ffmpy 0.3.2
> filelock 3.9.0
> flash-attn 2.5.6
> fonttools 4.50.0
> frozenlist 1.4.1
> fschat 0.2.36
> fsspec 2024.3.0
> gekko 1.0.7
> gradio 4.21.0
> gradio-client 0.12.0
> h11 0.14.0
> hjson 3.1.0
> httpcore 1.0.4
> httptools 0.6.1
> httpx 0.27.0
> huggingface-hub 0.21.4
> humanfriendly 10.0
> idna 3.4
> importlib-resources 6.3.1
> Jinja2 3.1.2
> jsonschema 4.21.1
> jsonschema-specifications 2023.12.1
> kiwisolver 1.4.5
> markdown-it-py 3.0.0
> markdown2 2.4.13
> MarkupSafe 2.1.3
> matplotlib 3.7.5
> mdurl 0.1.2
> mpi4py 3.1.5
> mpmath 1.3.0
> msgpack 1.0.8
> multidict 6.0.5
> multiprocess 0.70.16
> networkx 3.1
> nh3 0.2.15
> ninja 1.11.1.1
> numpy 1.24.1
> optimum 1.17.1
> orjson 3.9.15
> packaging 24.0
> pandas 2.0.3
> peft 0.9.0
> pillow 10.2.0
> pip 20.0.2
> pkgutil-resolve-name 1.3.10
> prompt-toolkit 3.0.43
> protobuf 5.26.0
> psutil 5.9.8
> py-cpuinfo 9.0.0
> pyarrow 15.0.1
> pyarrow-hotfix 0.6
> pydantic 2.6.4
> pydantic-core 2.16.3
> pydub 0.25.1
> pygments 2.17.2
> pynvml 11.5.0
> pyparsing 3.1.2
> python-dateutil 2.9.0.post0
> python-dotenv 1.0.1
> python-multipart 0.0.9
> pytz 2024.1
> PyYAML 6.0.1
> quantile-python 1.1
> ray 2.9.3
> referencing 0.34.0
> regex 2023.12.25
> requests 2.28.1
> rich 13.7.1
> rouge 1.0.1
> rpds-py 0.18.0
> ruff 0.3.3
> safetensors 0.4.2
> scipy 1.10.1
> semantic-version 2.10.0
> sentencepiece 0.2.0
> setuptools 45.2.0
> shellingham 1.5.4
> shortuuid 1.0.13
> six 1.16.0
> sniffio 1.3.1
> starlette 0.37.2
> svgwrite 1.4.3
> sympy 1.12
> tiktoken 0.6.0
> tokenizers 0.15.2
> tomlkit 0.12.0
> toolz 0.12.1
> torch 2.1.2+cu121
> torchaudio 2.1.2+cu121
> torchvision 0.16.2+cu121
> tqdm 4.66.2
> transformers 4.37.0
> transformers-stream-generator 0.0.4
> triton 2.1.0
> typer 0.9.0
> typing-extensions 4.8.0
> tzdata 2024.1
> urllib3 1.26.13
> uvicorn 0.28.0
> uvloop 0.19.0
> vllm 0.3.1
> watchfiles 0.21.0
> wavedrom 2.0.3.post3
> wcwidth 0.2.13
> websockets 12.0
> wheel 0.34.2
> xformers 0.0.23.post1
> xxhash 3.4.1
> yarl 1.9.4
> zipp 3.18.1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with fastchat/serve/openai_api_server.py at generate_completion_stream_generator, then reproduce the reported curl request against the /v1/completions endpoint. Compare the streaming response path with the listed FastAPI and Pydantic versions; done means the request produces SSE chunks without the reported dumps_kwargs TypeError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- fastapi, python
- Domain
- ai, api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100