Sarikaa-Sridhar commited on
Commit
e16215b
·
verified ·
1 Parent(s): e6d782d

Delete sample_test.py

Browse files
Files changed (1) hide show
  1. sample_test.py +0 -59
sample_test.py DELETED
@@ -1,59 +0,0 @@
1
- import json
2
-
3
- from transformers import pipeline
4
-
5
-
6
- MODEL_DIR = "."
7
-
8
-
9
- with open(
10
- "sample_input_weekly.json",
11
- "r",
12
- ) as f:
13
- sample = json.load(f)
14
-
15
-
16
- pipe = pipeline(
17
- "yield-estimation",
18
- model=MODEL_DIR,
19
- trust_remote_code=True,
20
- )
21
-
22
-
23
- print("Testing released cutoffs...\n")
24
-
25
- for cutoff in [
26
- 20,
27
- 24,
28
- 28,
29
- 32,
30
- 36,
31
- 40,
32
- 44,
33
- 48,
34
- 52,
35
- ]:
36
- x = dict(sample)
37
- x["cutoff"] = cutoff
38
-
39
- output = pipe(x)
40
-
41
- print(
42
- f"Cutoff {cutoff}: "
43
- f"{output['predicted_yield']:.2f} "
44
- f"{output['yield_units']}"
45
- )
46
-
47
-
48
- print("\nFull output at cutoff 52:")
49
-
50
- sample["cutoff"] = 52
51
-
52
- output = pipe(sample)
53
-
54
- print(
55
- json.dumps(
56
- output,
57
- indent=2,
58
- )
59
- )