返回提交历史
Modified
g4f/Provider/Llama2.py
+4
-1
XFEstudio/gpt4free
Update Llama2.py
802cf1ce
代码差异
1 个文件
+4
-1
@@ -3,6 +3,7 @@ from __future__ import annotations
3
3
from aiohttp import ClientSession
4
4
5
5
from ..typing import AsyncResult, Messages
6
from ..requests.raise_for_status import raise_for_status
6
7
from .base_provider import AsyncGeneratorProvider, ProviderModelMixin
7
8
8
9
@@ -67,8 +68,10 @@ class Llama2(AsyncGeneratorProvider, ProviderModelMixin):
67
68
}
68
69
started = False
69
70
async with session.post(f"{cls.url}/api", json=data, proxy=proxy) as response:
70
response.raise_for_status()
71
await raise_for_status(response)
71
72
async for chunk in response.content.iter_any():
73
if not chunk:
74
continue
72
75
if not started:
73
76
chunk = chunk.lstrip()
74
77
started = True