langfun 0.1.2.dev202504300804__py3-none-any.whl → 0.1.2.dev202505020804__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -167,7 +167,6 @@ class Evaluation(experiment_lib.Experiment):
167
167
  example.input = self.example_input_by_id(example.id)
168
168
 
169
169
  checkpointed = self._state.ckpt_example(example.id)
170
- self._state.update(example, in_progress=True)
171
170
 
172
171
  with pg.timeit('evaluate') as timeit, lf.track_usages() as usage_summary:
173
172
  if checkpointed is None or checkpointed.has_error:
@@ -182,6 +181,7 @@ class Evaluation(experiment_lib.Experiment):
182
181
  f'contains error: {checkpointed.error}'
183
182
  )
184
183
  example.start_time = time.time()
184
+ self._state.update(example, in_progress=True)
185
185
  self._process(example, raise_if_has_error=raise_if_has_error)
186
186
  else:
187
187
  self.info(
@@ -189,6 +189,7 @@ class Evaluation(experiment_lib.Experiment):
189
189
  'is available and error free.'
190
190
  )
191
191
  example.start_time = checkpointed.start_time
192
+ self._state.update(example, in_progress=True)
192
193
 
193
194
  # Use the output and metadata obtained from the previous processing.
194
195
  example.output = checkpointed.output
@@ -458,7 +458,9 @@ def query(
458
458
  if protocol is None:
459
459
  protocol = lf.context_value('__query_protocol__', 'python')
460
460
 
461
- invocation_id = invocation_id or f'query@{uuid.uuid4().hex[-7:]}'
461
+ def _invocation_id():
462
+ return invocation_id or f'query@{uuid.uuid4().hex[-7:]}'
463
+
462
464
  # Multiple quries will be issued when `lm` is a list or `num_samples` is
463
465
  # greater than 1.
464
466
  if isinstance(lm, list) or num_samples != 1:
@@ -482,7 +484,7 @@ def query(
482
484
  protocol=protocol,
483
485
  returns_message=returns_message,
484
486
  skip_lm=skip_lm,
485
- invocation_id=f'{invocation_id}:{i}',
487
+ invocation_id=f'{_invocation_id()}:{i}',
486
488
  **kwargs,
487
489
  )
488
490
  lm_list = lm if isinstance(lm, list) else [lm]
@@ -595,7 +597,7 @@ def query(
595
597
  metadata.pop('usage', None)
596
598
 
597
599
  invocation = QueryInvocation(
598
- id=invocation_id,
600
+ id=_invocation_id(),
599
601
  input=pg.Ref(query_input),
600
602
  schema=(
601
603
  schema_lib.Schema.from_value(schema)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: langfun
3
- Version: 0.1.2.dev202504300804
3
+ Version: 0.1.2.dev202505020804
4
4
  Summary: Langfun: Language as Functions.
5
5
  Home-page: https://github.com/google/langfun
6
6
  Author: Langfun Authors
@@ -63,7 +63,7 @@ langfun/core/eval/v2/__init__.py,sha256=9lNKJwbvl0lcFblAXYT_OHI8fOubJsTOdSkxEqsP
63
63
  langfun/core/eval/v2/checkpointing.py,sha256=t47rBfzGZYgIqWW1N1Ak9yQnNtHd-IRbEO0cZjG2VRo,11755
64
64
  langfun/core/eval/v2/checkpointing_test.py,sha256=NggOSJ_6XSa4cNP6nGIu9wLsK59dUwe8SPWDiXtGGDE,9197
65
65
  langfun/core/eval/v2/eval_test_helper.py,sha256=sKFi_wPYCNmr96WyTduuXY0KnxjFxcJyEhXey-_nGX8,3962
66
- langfun/core/eval/v2/evaluation.py,sha256=4Kcpve_dlti3FWxd7KtZaapsva_C7sOGjyJ69xsXLY4,26992
66
+ langfun/core/eval/v2/evaluation.py,sha256=BijbrYufnlRZLryxezDU32gHjFCCZvLAZMLF6kQ90eA,27050
67
67
  langfun/core/eval/v2/evaluation_test.py,sha256=QNp_HEvRTupvNuLEeYTvylykh1Ut2jpMqHQ-gCUZQ10,6919
68
68
  langfun/core/eval/v2/example.py,sha256=Jegt-viQSNYzPVkOZE_M19GON2TYGTct4Cp9HnJ7DGo,10861
69
69
  langfun/core/eval/v2/example_test.py,sha256=1DNm6EuyZOq827DKvf3oTRVFkMNM_qTnLUpvOjpgz5I,3419
@@ -137,7 +137,7 @@ langfun/core/structured/mapping.py,sha256=gxdcYQP9yqbDRtiJQ1RRAOrKHiCr0h6xBYLCRK
137
137
  langfun/core/structured/mapping_test.py,sha256=OntYvfDitAf0tAnzQty3YS90vyEn6FY1Mi93r_ViEk8,9594
138
138
  langfun/core/structured/parsing.py,sha256=MGvI7ypXlwfzr5XB8_TFU9Ei0_5reYqkWkv64eAy0EA,12015
139
139
  langfun/core/structured/parsing_test.py,sha256=V8Cj1tJK4Lxv_b0YQj6-2hzXZgnYNBa2JR7rOLRBKoQ,22346
140
- langfun/core/structured/querying.py,sha256=NA5LL97ny9aIml3wz4GPzFsvAH2XafZIGoZbIhuV8nA,30456
140
+ langfun/core/structured/querying.py,sha256=lHSPQ4UKRfhLXRjofG1geIGpQ_ImZf0dIvjXIwr_jNk,30480
141
141
  langfun/core/structured/querying_test.py,sha256=_npZ3ztaZc6VerP7nU_QTJscWGgBqiwTE02z_S3Ahd4,40197
142
142
  langfun/core/structured/schema.py,sha256=pGiAjez-ON2nKLUSeAls27gJsMto5aJnCXLVwH3pUKM,28296
143
143
  langfun/core/structured/schema_generation.py,sha256=3AcuKvv3VOtKY5zMVqODrxfOuDxzoZtGeBxHlOWDOWw,5308
@@ -156,8 +156,8 @@ langfun/core/templates/demonstration.py,sha256=vCrgYubdZM5Umqcgp8NUVGXgr4P_c-fik
156
156
  langfun/core/templates/demonstration_test.py,sha256=SafcDQ0WgI7pw05EmPI2S4v1t3ABKzup8jReCljHeK4,2162
157
157
  langfun/core/templates/selfplay.py,sha256=yhgrJbiYwq47TgzThmHrDQTF4nDrTI09CWGhuQPNv-s,2273
158
158
  langfun/core/templates/selfplay_test.py,sha256=Ot__1P1M8oJfoTp-M9-PQ6HUXqZKyMwvZ5f7yQ3yfyM,2326
159
- langfun-0.1.2.dev202504300804.dist-info/licenses/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
160
- langfun-0.1.2.dev202504300804.dist-info/METADATA,sha256=rlaBu8x--oQz7DAbnG3snNBBk7ltVc1RFvtOcE9cW3Q,8178
161
- langfun-0.1.2.dev202504300804.dist-info/WHEEL,sha256=ooBFpIzZCPdw3uqIQsOo4qqbA4ZRPxHnOH7peeONza0,91
162
- langfun-0.1.2.dev202504300804.dist-info/top_level.txt,sha256=RhlEkHxs1qtzmmtWSwYoLVJAc1YrbPtxQ52uh8Z9VvY,8
163
- langfun-0.1.2.dev202504300804.dist-info/RECORD,,
159
+ langfun-0.1.2.dev202505020804.dist-info/licenses/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
160
+ langfun-0.1.2.dev202505020804.dist-info/METADATA,sha256=AWOuM3J68NYl8LFoEFVYgZyCDxyIDvcxwz79ce1GTSE,8178
161
+ langfun-0.1.2.dev202505020804.dist-info/WHEEL,sha256=wXxTzcEDnjrTwFYjLPcsW_7_XihufBwmpiBeiXNBGEA,91
162
+ langfun-0.1.2.dev202505020804.dist-info/top_level.txt,sha256=RhlEkHxs1qtzmmtWSwYoLVJAc1YrbPtxQ52uh8Z9VvY,8
163
+ langfun-0.1.2.dev202505020804.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.0.1)
2
+ Generator: setuptools (80.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5