mirror of
https://github.com/huggingface/text-generation-inference.git
synced 2025-04-20 06:12:07 +00:00
Simplify logs2. (#3045)
* Simplify logs2. * Changing the scope from module to session to fix the event_loop issue.
This commit is contained in:
parent
06dfe9abfe
commit
142a49a80d
@ -81,6 +81,8 @@ def container_log(request: SubRequest):
|
|||||||
if request.session.testsfailed:
|
if request.session.testsfailed:
|
||||||
error_log.seek(0)
|
error_log.seek(0)
|
||||||
print(error_log.read(), file=sys.stderr)
|
print(error_log.read(), file=sys.stderr)
|
||||||
|
else:
|
||||||
|
error_log.truncate(0)
|
||||||
|
|
||||||
|
|
||||||
class ResponseComparator(JSONSnapshotExtension):
|
class ResponseComparator(JSONSnapshotExtension):
|
||||||
@ -350,13 +352,13 @@ def ignore_logprob_response_snapshot(snapshot):
|
|||||||
return snapshot.use_extension(IgnoreLogProbResponseComparator)
|
return snapshot.use_extension(IgnoreLogProbResponseComparator)
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="module")
|
@pytest.fixture(scope="session")
|
||||||
def error_log():
|
def error_log():
|
||||||
with tempfile.TemporaryFile("w+") as tmp:
|
with tempfile.TemporaryFile("w+") as tmp:
|
||||||
yield tmp
|
yield tmp
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="module")
|
@pytest.fixture(scope="session")
|
||||||
async def launcher(error_log):
|
async def launcher(error_log):
|
||||||
@contextlib.contextmanager
|
@contextlib.contextmanager
|
||||||
def local_launcher(
|
def local_launcher(
|
||||||
|
Loading…
Reference in New Issue
Block a user