langfun 0.1.2.dev202410040804__py3-none-any.whl → 0.1.2.dev202410060803__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.
@@ -171,18 +171,6 @@ class Matching(base.Evaluation):
171
171
  ) -> None:
172
172
  super().save(definition, result, report)
173
173
 
174
- if result:
175
- # Save matches.
176
- pg.save(
177
- [
178
- pg.symbolic.deref(
179
- pg.Dict(input=input, output=output), recursive=True
180
- )
181
- for input, output, _ in self.matches
182
- ],
183
- os.path.join(self.dir, Matching.MATCHES_JSON),
184
- )
185
-
186
174
  if report:
187
175
  pg.save(
188
176
  self._html([self._render_result, self._render_matches]),
@@ -152,11 +152,6 @@ class MatchingTest(unittest.TestCase):
152
152
  os.path.join(s.dir, matching.Matching.CACHE_JSON)
153
153
  )
154
154
  )
155
- self.assertTrue(
156
- os.path.exists(
157
- os.path.join(s.dir, matching.Matching.MATCHES_JSON)
158
- )
159
- )
160
155
  self.assertTrue(
161
156
  os.path.exists(
162
157
  os.path.join(
@@ -102,6 +102,7 @@ from langfun.core.llms.groq import GroqMistral_8x7B
102
102
  from langfun.core.llms.groq import GroqGemma7B_IT
103
103
 
104
104
  from langfun.core.llms.vertexai import VertexAI
105
+ from langfun.core.llms.vertexai import VertexAIGemini1_5
105
106
  from langfun.core.llms.vertexai import VertexAIGeminiPro1_5
106
107
  from langfun.core.llms.vertexai import VertexAIGeminiPro1_5_Latest
107
108
  from langfun.core.llms.vertexai import VertexAIGeminiPro1_5_001
@@ -422,101 +422,78 @@ _DOCUMENT_TYPES = [
422
422
  ]
423
423
 
424
424
 
425
- class VertexAIGeminiPro1_5_Latest(VertexAI): # pylint: disable=invalid-name
426
- """Vertex AI Gemini 1.5 Pro model."""
425
+ class VertexAIGemini1_5(VertexAI): # pylint: disable=invalid-name
426
+ """Vertex AI Gemini 1.5 model."""
427
427
 
428
- model = 'gemini-1.5-pro-latest'
429
428
  supported_modalities = (
430
429
  _DOCUMENT_TYPES + _IMAGE_TYPES + _AUDIO_TYPES + _VIDEO_TYPES
431
430
  )
432
431
 
433
432
 
434
- class VertexAIGeminiPro1_5(VertexAI): # pylint: disable=invalid-name
433
+ class VertexAIGeminiPro1_5_Latest(VertexAIGemini1_5): # pylint: disable=invalid-name
434
+ """Vertex AI Gemini 1.5 Pro model."""
435
+
436
+ model = 'gemini-1.5-pro-latest'
437
+
438
+
439
+ class VertexAIGeminiPro1_5(VertexAIGemini1_5): # pylint: disable=invalid-name
435
440
  """Vertex AI Gemini 1.5 Pro model."""
436
441
 
437
442
  model = 'gemini-1.5-pro'
438
- supported_modalities = (
439
- _DOCUMENT_TYPES + _IMAGE_TYPES + _AUDIO_TYPES + _VIDEO_TYPES
440
- )
441
443
 
442
444
 
443
- class VertexAIGeminiPro1_5_002(VertexAI): # pylint: disable=invalid-name
445
+ class VertexAIGeminiPro1_5_002(VertexAIGemini1_5): # pylint: disable=invalid-name
444
446
  """Vertex AI Gemini 1.5 Pro model."""
445
447
 
446
448
  model = 'gemini-1.5-pro-002'
447
- supported_modalities = (
448
- _DOCUMENT_TYPES + _IMAGE_TYPES + _AUDIO_TYPES + _VIDEO_TYPES
449
- )
450
449
 
451
450
 
452
- class VertexAIGeminiPro1_5_001(VertexAI): # pylint: disable=invalid-name
451
+ class VertexAIGeminiPro1_5_001(VertexAIGemini1_5): # pylint: disable=invalid-name
453
452
  """Vertex AI Gemini 1.5 Pro model."""
454
453
 
455
454
  model = 'gemini-1.5-pro-001'
456
- supported_modalities = (
457
- _DOCUMENT_TYPES + _IMAGE_TYPES + _AUDIO_TYPES + _VIDEO_TYPES
458
- )
459
455
 
460
456
 
461
- class VertexAIGeminiPro1_5_0514(VertexAI): # pylint: disable=invalid-name
457
+ class VertexAIGeminiPro1_5_0514(VertexAIGemini1_5): # pylint: disable=invalid-name
462
458
  """Vertex AI Gemini 1.5 Pro preview model."""
463
459
 
464
460
  model = 'gemini-1.5-pro-preview-0514'
465
- supported_modalities = (
466
- _DOCUMENT_TYPES + _IMAGE_TYPES + _AUDIO_TYPES + _VIDEO_TYPES
467
- )
468
461
 
469
462
 
470
- class VertexAIGeminiPro1_5_0409(VertexAI): # pylint: disable=invalid-name
463
+ class VertexAIGeminiPro1_5_0409(VertexAIGemini1_5): # pylint: disable=invalid-name
471
464
  """Vertex AI Gemini 1.5 Pro preview model."""
472
465
 
473
466
  model = 'gemini-1.5-pro-preview-0409'
474
- supported_modalities = (
475
- _DOCUMENT_TYPES + _IMAGE_TYPES + _AUDIO_TYPES + _VIDEO_TYPES
476
- )
477
467
 
478
468
 
479
- class VertexAIGeminiFlash1_5_Latest(VertexAI): # pylint: disable=invalid-name
469
+ class VertexAIGeminiFlash1_5_Latest(VertexAIGemini1_5): # pylint: disable=invalid-name
480
470
  """Vertex AI Gemini 1.5 Flash model."""
481
471
 
482
472
  model = 'gemini-1.5-flash-latest'
483
- supported_modalities = (
484
- _DOCUMENT_TYPES + _IMAGE_TYPES + _AUDIO_TYPES + _VIDEO_TYPES
485
- )
486
473
 
487
474
 
488
- class VertexAIGeminiFlash1_5(VertexAI): # pylint: disable=invalid-name
475
+ class VertexAIGeminiFlash1_5(VertexAIGemini1_5): # pylint: disable=invalid-name
489
476
  """Vertex AI Gemini 1.5 Flash model."""
477
+
490
478
  model = 'gemini-1.5-flash'
491
- supported_modalities = (
492
- _DOCUMENT_TYPES + _IMAGE_TYPES + _AUDIO_TYPES + _VIDEO_TYPES
493
- )
494
479
 
495
480
 
496
- class VertexAIGeminiFlash1_5_002(VertexAI): # pylint: disable=invalid-name
481
+ class VertexAIGeminiFlash1_5_002(VertexAIGemini1_5): # pylint: disable=invalid-name
497
482
  """Vertex AI Gemini 1.5 Flash model."""
498
483
 
499
484
  model = 'gemini-1.5-flash-002'
500
- supported_modalities = (
501
- _DOCUMENT_TYPES + _IMAGE_TYPES + _AUDIO_TYPES + _VIDEO_TYPES
502
- )
503
485
 
504
486
 
505
- class VertexAIGeminiFlash1_5_001(VertexAI): # pylint: disable=invalid-name
487
+ class VertexAIGeminiFlash1_5_001(VertexAIGemini1_5): # pylint: disable=invalid-name
506
488
  """Vertex AI Gemini 1.5 Flash model."""
489
+
507
490
  model = 'gemini-1.5-flash-001'
508
- supported_modalities = (
509
- _DOCUMENT_TYPES + _IMAGE_TYPES + _AUDIO_TYPES + _VIDEO_TYPES
510
- )
511
491
 
512
492
 
513
- class VertexAIGeminiFlash1_5_0514(VertexAI): # pylint: disable=invalid-name
493
+ class VertexAIGeminiFlash1_5_0514(VertexAIGemini1_5): # pylint: disable=invalid-name
514
494
  """Vertex AI Gemini 1.5 Flash preview model."""
515
495
 
516
496
  model = 'gemini-1.5-flash-preview-0514'
517
- supported_modalities = (
518
- _DOCUMENT_TYPES + _IMAGE_TYPES + _AUDIO_TYPES + _VIDEO_TYPES
519
- )
520
497
 
521
498
 
522
499
  class VertexAIGeminiPro1(VertexAI): # pylint: disable=invalid-name
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: langfun
3
- Version: 0.1.2.dev202410040804
3
+ Version: 0.1.2.dev202410060803
4
4
  Summary: Langfun: Language as Functions.
5
5
  Home-page: https://github.com/google/langfun
6
6
  Author: Langfun Authors
@@ -46,13 +46,13 @@ langfun/core/coding/python/permissions_test.py,sha256=w5EDb8QxpxgJyZkojyzVWQvDfg
46
46
  langfun/core/eval/__init__.py,sha256=Ogdr9OtTywhhLPHi3AZzOD2mXX2oyaHWflrSTMm96uA,1899
47
47
  langfun/core/eval/base.py,sha256=3ALt5L51C7jnulLuJMw2uhEvB01d-GNuG-9iMtxM4ic,75230
48
48
  langfun/core/eval/base_test.py,sha256=iL-EEGnBD_HigClBwo34HVyOycupgw9r4S61eIZMShI,26929
49
- langfun/core/eval/matching.py,sha256=1ij-SjX4ePoWpz52HQlYs1h2cpRW2DhquV72U4SGOwA,9591
50
- langfun/core/eval/matching_test.py,sha256=UOfPb6ox9-OkgHNMbz-g0mWp3H3ejpPE1DERfGpWlQs,5374
49
+ langfun/core/eval/matching.py,sha256=lkI3dtvJe5ql1ppA8Dy6oNVvu5YNtemRos73WQMsgSY,9278
50
+ langfun/core/eval/matching_test.py,sha256=QCoYEuf4b_1bkHqUCuRzKMbXHrV3AB2FCOBivo1stC4,5249
51
51
  langfun/core/eval/patching.py,sha256=R0s2eAd1m97exQt06dmUL0V_MBG0W2Hxg7fhNB7cXW0,3866
52
52
  langfun/core/eval/patching_test.py,sha256=8kCd54Egjju22FMgtJuxEsrXkW8ifs-UUBHtrCG1L6w,4775
53
53
  langfun/core/eval/scoring.py,sha256=wZz90Iw5Sco3cAiA1T71cJEWhD6qmvMeE1Ai-pez_aY,6210
54
54
  langfun/core/eval/scoring_test.py,sha256=O8olHbrUEg60gMxwOkWzKBJZpZoUlmVnBANX5Se2SXM,4546
55
- langfun/core/llms/__init__.py,sha256=lmOl2HoUYDeAnSJjObd9DfhEuchfvmrJ-GeKTbVFqds,5427
55
+ langfun/core/llms/__init__.py,sha256=yeN5Bj_QDZpnSG8EeSaDiqpcVGQR3iitxG1EwE6dGAU,5484
56
56
  langfun/core/llms/anthropic.py,sha256=Gon3fOi31RhZFgNd0ijyTnKnUdp9hrWrCoSXyO4UaLw,7316
57
57
  langfun/core/llms/anthropic_test.py,sha256=T-swuMkfnlgs8Fpif4rtXs579exGk0TsbLMirXDZCkg,5533
58
58
  langfun/core/llms/fake.py,sha256=gCHBYBLvBCsC78HI1hpoqXCS-p1FMTgY1P1qh_sGBPk,3070
@@ -67,7 +67,7 @@ langfun/core/llms/openai.py,sha256=vnDrKuD-pli0AtDIDq_TmlltOk7z7_PQ-xpU4K1ARdU,1
67
67
  langfun/core/llms/openai_test.py,sha256=UcBFW_7RkkMEo47Tn5RuVRK_DryTN7bb9ITphlzthE8,17762
68
68
  langfun/core/llms/rest.py,sha256=laopuq-zD8V-3Y6eFDngftHEbE66VlUkCD2-rvvRaLU,3388
69
69
  langfun/core/llms/rest_test.py,sha256=NZ3Nf0XQVpT9kLP5cBVo_yBHLI7vWTYhWQxYEJVMGs4,3472
70
- langfun/core/llms/vertexai.py,sha256=QjYfHxqMAllHhkxphR-qj8ZLKVxoydue7tI3JCpWwlc,17045
70
+ langfun/core/llms/vertexai.py,sha256=M6iR_I8hx7SgGFQ7LCZOjOwUml4YRcjtXFOptAyTNVE,16272
71
71
  langfun/core/llms/vertexai_test.py,sha256=EPR-mB2hNUpvpf7E8m_k5bh04epdQTVUuYU6hPgZyu8,10321
72
72
  langfun/core/llms/cache/__init__.py,sha256=QAo3InUMDM_YpteNnVCSejI4zOsnjSMWKJKzkb3VY64,993
73
73
  langfun/core/llms/cache/base.py,sha256=rt3zwmyw0y9jsSGW-ZbV1vAfLxQ7_3AVk0l2EySlse4,3918
@@ -119,8 +119,8 @@ langfun/core/templates/demonstration.py,sha256=vCrgYubdZM5Umqcgp8NUVGXgr4P_c-fik
119
119
  langfun/core/templates/demonstration_test.py,sha256=SafcDQ0WgI7pw05EmPI2S4v1t3ABKzup8jReCljHeK4,2162
120
120
  langfun/core/templates/selfplay.py,sha256=yhgrJbiYwq47TgzThmHrDQTF4nDrTI09CWGhuQPNv-s,2273
121
121
  langfun/core/templates/selfplay_test.py,sha256=rBW2Qr8yi-aWYwoTwRR-n1peKyMX9QXPZXURjLgoiRs,2264
122
- langfun-0.1.2.dev202410040804.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
123
- langfun-0.1.2.dev202410040804.dist-info/METADATA,sha256=0SW-Pu_bhe-EBd7r8erhax5pBXLD0xue7P9-jMe0AgA,8890
124
- langfun-0.1.2.dev202410040804.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
125
- langfun-0.1.2.dev202410040804.dist-info/top_level.txt,sha256=RhlEkHxs1qtzmmtWSwYoLVJAc1YrbPtxQ52uh8Z9VvY,8
126
- langfun-0.1.2.dev202410040804.dist-info/RECORD,,
122
+ langfun-0.1.2.dev202410060803.dist-info/LICENSE,sha256=WNHhf_5RCaeuKWyq_K39vmp9F28LxKsB4SpomwSZ2L0,11357
123
+ langfun-0.1.2.dev202410060803.dist-info/METADATA,sha256=MmnBQwbeW2mYl0LkS0jfNWZ8phWetZVrBFMqjPTmTGY,8890
124
+ langfun-0.1.2.dev202410060803.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
125
+ langfun-0.1.2.dev202410060803.dist-info/top_level.txt,sha256=RhlEkHxs1qtzmmtWSwYoLVJAc1YrbPtxQ52uh8Z9VvY,8
126
+ langfun-0.1.2.dev202410060803.dist-info/RECORD,,