polish code with new pre-commit rule (#2923)

This commit is contained in:
Zero Rains
2025-07-19 23:19:27 +08:00
committed by GitHub
parent b8676d71a8
commit 25698d56d1
424 changed files with 14307 additions and 13518 deletions

View File

@@ -14,11 +14,10 @@
# limitations under the License.
"""
import openai
ip = "0.0.0.0"
service_http_port = "9809" # 服务配置的
service_http_port = "9809" # 服务配置的
client = openai.Client(base_url=f"http://{ip}:{service_http_port}/v1", api_key="EMPTY_API_KEY")
@@ -42,7 +41,7 @@ response = client.completions.create(
)
for chunk in response:
print(chunk.choices[0].text, end='')
print(chunk.choices[0].text, end="")
print("\n")
# Chat completion
@@ -78,5 +77,5 @@ response = client.chat.completions.create(
for chunk in response:
if chunk.choices[0].delta is not None:
print(chunk.choices[0].delta.content, end='')
print(chunk.choices[0].delta.content, end="")
print("\n")