-
Notifications
You must be signed in to change notification settings - Fork 115
Expand file tree
/
Copy pathdocument_mobject.py
More file actions
28 lines (22 loc) · 941 Bytes
/
document_mobject.py
File metadata and controls
28 lines (22 loc) · 941 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# pytest: ollama, qualitative, e2e
from mellea.backends import model_ids
from mellea.backends.model_ids import IBM_GRANITE_4_HYBRID_MICRO
from mellea.stdlib.components.docs.richdocument import RichDocument
rd = RichDocument.from_document_file("https://arxiv.org/pdf/1906.04043")
from mellea.stdlib.components.docs.richdocument import Table
table1: Table = rd.get_tables()[0]
print(table1.to_markdown())
from mellea import start_session
from mellea.backends import ModelOption
m = start_session(model_id=model_ids.META_LLAMA_3_2_3B)
for seed in [x * 12 for x in range(5)]:
table2 = m.transform(
table1,
"Add a column 'Model' that extracts which model was used in Feature description or 'None' if none.",
model_options={ModelOption.SEED: seed},
)
if isinstance(table2, Table):
print(table2.to_markdown())
break
else:
print("==== TRYING AGAIN after non-useful output.====")