Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Aug 11, 2024
1 parent 5ad0f06 commit 5e016ba
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion comps/cores/proto/docarray.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ class LLMParamsDoc(BaseDoc):
),
)

@field_validator('chat_template')
@field_validator("chat_template")
def chat_template_must_contain_variables(cls, v):
return v

Check warning on line 113 in comps/cores/proto/docarray.py

View check run for this annotation

Codecov / codecov/patch

comps/cores/proto/docarray.py#L113

Added line #L113 was not covered by tests

Expand Down
4 changes: 3 additions & 1 deletion comps/llms/text-generation/tgi/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

from fastapi.responses import StreamingResponse
from huggingface_hub import AsyncInferenceClient
from langchain_core.prompts import PromptTemplate
from langsmith import traceable
from openai import OpenAI
from langchain_core.prompts import PromptTemplate
from template import ChatTemplate

from comps import (
Expand Down Expand Up @@ -73,6 +73,7 @@ async def llm_generate(input: Union[LLMParamsDoc, ChatCompletionRequest]):
top_p=input.top_p,
)
if input.streaming:

async def stream_generator():
chat_response = ""
async for text in text_generation:
Expand Down Expand Up @@ -171,6 +172,7 @@ async def stream_generator():
)

if input.stream:

def stream_generator():
for c in chat_completion:
print(c)
Expand Down

0 comments on commit 5e016ba

Please sign in to comment.