gmshroff commited on
Commit
a703588
1 Parent(s): d08c977

embedding via /encode endpoint

Browse files
__pycache__/app.cpython-38.pyc DELETED
Binary file (569 Bytes)
 
__pycache__/library.cpython-38.pyc DELETED
Binary file (895 Bytes)
 
__pycache__/registration.cpython-38.pyc DELETED
Binary file (755 Bytes)
 
app.py CHANGED
@@ -1,13 +1,34 @@
1
- from flask import Flask,request,render_template,send_file
2
  import os
 
3
 
4
  app=Flask(__name__)
5
  MESSAGED={'title':'Script Server',
6
  'messageL':['script in "script" parameter or field of json input to /run will be run']}
7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  @app.route("/file/<string:filename>")
9
- def return_pdf(filename):
10
- return send_file(filename)
11
 
12
  @app.route('/run',methods=['GET','POST'])
13
  def run_script():
 
1
+ from flask import Flask,request,render_template,send_file,jsonify
2
  import os
3
+ from transformers import AutoTokenizer, AutoModel
4
 
5
  app=Flask(__name__)
6
  MESSAGED={'title':'Script Server',
7
  'messageL':['script in "script" parameter or field of json input to /run will be run']}
8
 
9
+ tokenizer = AutoTokenizer.from_pretrained('allenai/specter')
10
+ encoder = AutoModel.from_pretrained('allenai/specter')
11
+
12
+ @app.route('/encode',methods=['GET','POST'])
13
+ def encode():
14
+ print(request)
15
+ if request.method=='GET':
16
+ text=request.args.get('text')
17
+ elif request.method=='POST':
18
+ data=request.get_json()
19
+ if 'text' in data: text=data["text"]
20
+ if text=='' or text is None: return -1
21
+ inputs = tokenizer(text, padding=True, truncation=True,
22
+ return_tensors="pt", max_length=512)
23
+ result = encoder(**inputs)
24
+ embeddings = result.last_hidden_state[:, 0, :]
25
+ emb_array = embeddings.detach().numpy()
26
+ embedding=emb_array.tolist()
27
+ return jsonify({'embedding': embedding})
28
+
29
  @app.route("/file/<string:filename>")
30
+ def return_file(filename):
31
+ return send_file('./data/'+filename)
32
 
33
  @app.route('/run',methods=['GET','POST'])
34
  def run_script():
out.txt CHANGED
@@ -1,10 +0,0 @@
1
- total 56
2
- 8 -rw-r--r-- 1 a112956 staff 621 Nov 13 15:08 README.md
3
- 0 drwxr-xr-x 5 a112956 staff 160 Nov 13 15:07 __pycache__
4
- 8 -rw-r--r--@ 1 a112956 staff 1208 Nov 13 16:00 app.py
5
- 0 drwxr-xr-x 2 a112956 staff 64 Nov 13 15:15 flagged
6
- 0 -rw-r--r-- 1 a112956 staff 0 Nov 13 16:02 out.txt
7
- 8 -rw-r--r-- 1 a112956 staff 22 Nov 13 15:21 requirements.txt
8
- 0 drwxr-xr-x 3 a112956 staff 96 Nov 13 15:19 scripts
9
- 24 -rw-r--r-- 1 a112956 staff 9239 Nov 13 15:56 test.ipynb
10
- 8 -rw-r--r-- 1 a112956 staff 12 Nov 13 15:08 update.txt
 
 
 
 
 
 
 
 
 
 
 
requirements.txt CHANGED
@@ -1,3 +1,4 @@
1
  anvil_uplink
2
  numerapi
3
  flask
 
 
1
  anvil_uplink
2
  numerapi
3
  flask
4
+ transformers
scripts/update_valdata.py CHANGED
@@ -25,10 +25,11 @@ validation_data=pd.read_parquet(data_path+"validation_int8.parquet")
25
  recent_eras=list(validation_data.loc[validation_data['data_type']=='validation']['era'].unique()[-2:])
26
  validation_subset=validation_data[validation_data['era'].isin(recent_eras)]
27
  validation_subset.to_parquet(data_path+"validation_subset_int8.parquet",index=False)
 
28
 
29
 
30
  # In[ ]:
31
 
32
 
33
- print("Now please copy the file to server via: scp ../../data/validation_subset_int8.parquet gms@gms1:/home/gms/numerai/data/.")
34
 
 
25
  recent_eras=list(validation_data.loc[validation_data['data_type']=='validation']['era'].unique()[-2:])
26
  validation_subset=validation_data[validation_data['era'].isin(recent_eras)]
27
  validation_subset.to_parquet(data_path+"validation_subset_int8.parquet",index=False)
28
+ # napi.download_dataset('v4.2/live_int8.parquet',data_path+'live_int8.parquet')
29
 
30
 
31
  # In[ ]:
32
 
33
 
34
+ # print("Now please copy the file to server via: scp ../../data/validation_subset_int8.parquet gms@gms1:/home/gms/numerai/data/.")
35
 
test.ipynb CHANGED
@@ -2,7 +2,7 @@
2
  "cells": [
3
  {
4
  "cell_type": "code",
5
- "execution_count": 1,
6
  "metadata": {
7
  "tags": []
8
  },
@@ -16,54 +16,95 @@
16
  },
17
  {
18
  "cell_type": "code",
19
- "execution_count": 3,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
20
  "metadata": {},
21
  "outputs": [],
22
  "source": [
23
  "headers = {'Content-Type': 'application/json'}\n",
24
  "# url='http://127.0.0.1:5000/run'\n",
25
- "url='https://huggingface.co/spaces/gmshroff/gmserver'\n",
26
- "body={\"script\":\"python update_valdata.py\"}"
 
 
27
  ]
28
  },
29
  {
30
  "cell_type": "code",
31
- "execution_count": null,
32
  "metadata": {},
33
  "outputs": [],
34
  "source": [
35
- "response=requests.post(url=url,data=json.dumps(body),headers = {'Content-Type': 'application/json'})"
 
36
  ]
37
  },
38
  {
39
  "cell_type": "code",
40
- "execution_count": null,
41
  "metadata": {},
42
  "outputs": [],
43
  "source": [
44
- "response.content"
45
  ]
46
  },
47
  {
48
  "cell_type": "code",
49
- "execution_count": 2,
50
- "metadata": {
51
- "tags": []
52
- },
53
  "outputs": [
54
  {
55
- "data": {
56
- "text/plain": [
57
- "('./returned_file.txt', <http.client.HTTPMessage at 0x122375df0>)"
58
- ]
59
- },
60
- "execution_count": 2,
61
- "metadata": {},
62
- "output_type": "execute_result"
63
  }
64
  ],
65
  "source": [
66
- "urlretrieve(url='http://127.0.0.1:7860/file/update.txt',filename='./returned_file.txt')"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  ]
68
  },
69
  {
@@ -92,7 +133,7 @@
92
  "name": "python",
93
  "nbconvert_exporter": "python",
94
  "pygments_lexer": "ipython3",
95
- "version": "3.8.12"
96
  }
97
  },
98
  "nbformat": 4,
 
2
  "cells": [
3
  {
4
  "cell_type": "code",
5
+ "execution_count": null,
6
  "metadata": {
7
  "tags": []
8
  },
 
16
  },
17
  {
18
  "cell_type": "code",
19
+ "execution_count": 34,
20
+ "metadata": {},
21
+ "outputs": [],
22
+ "source": [
23
+ "def encode(text,server='local'):\n",
24
+ " headers = {'Content-Type': 'application/json'}\n",
25
+ " if server=='local': url='http://127.0.0.1:7860/encode'\n",
26
+ " elif server=='hf': url='https://huggingface.co/spaces/gmshroff/gmserver'\n",
27
+ " body={'text':text}\n",
28
+ " response=requests.post(url=url,data=json.dumps(body),headers = {'Content-Type': 'application/json'})\n",
29
+ " return json.loads(response.content)['embedding'][0]"
30
+ ]
31
+ },
32
+ {
33
+ "cell_type": "code",
34
+ "execution_count": null,
35
  "metadata": {},
36
  "outputs": [],
37
  "source": [
38
  "headers = {'Content-Type': 'application/json'}\n",
39
  "# url='http://127.0.0.1:5000/run'\n",
40
+ "# url='https://huggingface.co/spaces/gmshroff/gmserver'\n",
41
+ "# url='http://127.0.0.1:7860/run'\n",
42
+ "# body={\"script\":\"python update_valdata.py\"}\n",
43
+ "# body={\"script\":\"pwd\"}"
44
  ]
45
  },
46
  {
47
  "cell_type": "code",
48
+ "execution_count": 32,
49
  "metadata": {},
50
  "outputs": [],
51
  "source": [
52
+ "url='http://127.0.0.1:7860/encode'\n",
53
+ "body={'text':'I am very good'}\n"
54
  ]
55
  },
56
  {
57
  "cell_type": "code",
58
+ "execution_count": 20,
59
  "metadata": {},
60
  "outputs": [],
61
  "source": [
62
+ "response=requests.post(url=url,data=json.dumps(body),headers = {'Content-Type': 'application/json'})\n"
63
  ]
64
  },
65
  {
66
  "cell_type": "code",
67
+ "execution_count": 21,
68
+ "metadata": {},
 
 
69
  "outputs": [
70
  {
71
+ "name": "stdout",
72
+ "output_type": "stream",
73
+ "text": [
74
+ "<Response [200]>\n"
75
+ ]
 
 
 
76
  }
77
  ],
78
  "source": [
79
+ "print(response)"
80
+ ]
81
+ },
82
+ {
83
+ "cell_type": "code",
84
+ "execution_count": 29,
85
+ "metadata": {},
86
+ "outputs": [
87
+ {
88
+ "name": "stdout",
89
+ "output_type": "stream",
90
+ "text": [
91
+ "[[-0.16924583911895752, 0.5394846796989441, -0.6702709197998047, 0.040430836379528046, 0.5842257142066956, -0.10400038957595825, 1.3554238080978394, 0.20064431428909302, 0.7904593348503113, 0.07944442331790924, 0.3694689869880676, 0.0309899915009737, -0.0358109325170517, 0.8407368659973145, -0.18886400759220123, -0.18812552094459534, -0.7027854323387146, -0.6716575026512146, -0.16101406514644623, -0.2625257074832916, -1.0143442153930664, 0.6831651926040649, 0.3464907109737396, -0.028254728764295578, -0.1933746635913849, -0.027322892099618912, 1.0650479793548584, 0.05063764750957489, 0.5366902351379395, -0.09679951518774033, 0.4168861210346222, 0.6072957515716553, -1.1125460863113403, 0.3431336283683777, -0.5332702398300171, -0.7639042139053345, 0.44863301515579224, 0.4635305106639862, 0.4552519619464874, -0.09265922009944916, -0.10506373643875122, 0.32978275418281555, 0.3292321562767029, 0.09438435733318329, 0.8119341731071472, 0.42240285873413086, 0.14826630055904388, 0.664510190486908, -0.5775049924850464, 0.6216592788696289, -0.7063359618186951, 0.13787969946861267, 0.3324313163757324, -0.006968788802623749, -0.4890124499797821, 0.21385833621025085, 0.24096697568893433, -0.017509356141090393, -0.25432541966438293, -2.6441872119903564, 0.4082116484642029, 0.15110363066196442, -0.9272244572639465, -0.5076451301574707, 1.0227686166763306, -0.11975839734077454, 0.10114625841379166, 0.6772834658622742, 0.5309982299804688, 0.11752720922231674, -0.38174527883529663, -0.576882541179657, -0.42386457324028015, -0.4787759482860565, 0.42657271027565, 0.884860634803772, 0.17213068902492523, -0.2670276463031769, 0.8142200112342834, 0.19214186072349548, -0.7510114908218384, 0.1320962756872177, 0.8815200924873352, -0.30150485038757324, 0.3791406750679016, 0.050822071731090546, -0.01794038712978363, 0.12732011079788208, 0.28523844480514526, -0.6418834924697876, 0.7740083932876587, -0.49450939893722534, 0.11268052458763123, 0.1466187834739685, 0.1389007717370987, 0.07084275037050247, 0.053408991545438766, -0.07632303982973099, -0.12494771182537079, 0.16736072301864624, 0.08949943631887436, 0.4514691233634949, -0.3331630527973175, 0.10155684500932693, 0.5990362167358398, 0.3095496892929077, -0.4820187985897064, -0.33198079466819763, -0.21715545654296875, 0.5797330737113953, -0.4621957838535309, 0.903830349445343, 0.053295888006687164, 0.9480370879173279, 0.7831602692604065, 0.1594361960887909, 0.10460453480482101, 0.20459437370300293, -0.699772298336029, 0.1526128351688385, -0.37211593985557556, -0.959661066532135, -0.5080167055130005, -0.8336214423179626, 1.2379212379455566, -0.32031020522117615, 0.5611181259155273, 0.11619732528924942, -0.5205150842666626, 0.09715752303600311, 0.8878694772720337, 0.3342114984989166, -0.2223776876926422, 0.4065873622894287, 2.021987199783325, -0.3827890455722809, 0.7269340753555298, 0.11907811462879181, -0.4290564954280853, 0.15021352469921112, -0.7826882600784302, 0.8370822072029114, 0.17761412262916565, -0.8443654775619507, -1.5727237462997437, 0.06425298750400543, -0.8431735634803772, 0.4754883050918579, -0.25363558530807495, 0.8676797747612, 0.09027481079101562, 1.1143298149108887, -1.5407048463821411, -0.8863610029220581, 0.1472298800945282, 0.4998803436756134, 0.3192666471004486, 0.4923626184463501, -0.1539602428674698, 0.24821338057518005, 0.0691855251789093, 0.8032267093658447, -0.3095192015171051, 0.609862208366394, 0.3579982817173004, -0.05586349219083786, 0.7193583846092224, 0.4735642969608307, -0.15627115964889526, -0.5377950072288513, 0.10448334366083145, -0.01642458885908127, -0.20718464255332947, 0.6798056364059448, 0.14272689819335938, -0.41624829173088074, 0.3341134786605835, 0.08400989323854446, -0.14450117945671082, -1.0045260190963745, -0.15451228618621826, 0.3000997304916382, -0.25991716980934143, -0.353278249502182, 0.4011881947517395, -0.18793286383152008, -1.2464679479599, -0.024312399327754974, -0.3749045133590698, 0.07720524817705154, 0.05860114097595215, -0.18226514756679535, 0.7140490412712097, -0.02820228785276413, -0.19301630556583405, 0.8957469463348389, 0.21320077776908875, -1.0903466939926147, 0.1420649290084839, 1.326686978340149, -0.38575664162635803, -0.2204856276512146, -0.0347977839410305, 0.753210186958313, 0.5203763246536255, 0.6129097938537598, -0.7943956255912781, -0.6039091348648071, -0.4127115309238434, 0.7347033619880676, 0.860129177570343, -0.5003941059112549, -1.0145941972732544, -0.6755697131156921, -0.262959361076355, -1.1402562856674194, -0.201939657330513, -0.9239814281463623, 0.09926196932792664, -2.013683319091797, 0.06373506784439087, -0.3281327486038208, -0.8168194890022278, -0.03495316952466965, 1.0680989027023315, -0.7195814847946167, 0.20768064260482788, 0.8350968360900879, -0.9944704174995422, 0.08676226437091827, 0.331338495016098, 0.19218401610851288, 0.2630089521408081, 0.16700047254562378, -0.02193310856819153, 0.651127815246582, -0.4328961670398712, 0.5640565156936646, -0.6636453866958618, -0.14718733727931976, -0.05208853632211685, -0.011787563562393188, 0.17753367125988007, -0.010712523944675922, -0.17625129222869873, 0.22556498646736145, 0.48288291692733765, -1.1963601112365723, -0.2893027663230896, 0.4340693950653076, 1.370958924293518, 1.0308396816253662, 0.24235799908638, 0.21732449531555176, 0.3354713022708893, 0.6574875712394714, 0.17731909453868866, -0.7245486378669739, 0.5350983142852783, -0.37254101037979126, -0.2457614690065384, -0.7171913385391235, -0.167108952999115, -1.1373594999313354, 0.4085613489151001, -0.19684399664402008, 0.04326349496841431, -0.3240494132041931, -0.41053032875061035, 0.082035593688488, -0.44606804847717285, 1.198728084564209, 0.26752549409866333, -0.24030989408493042, -0.23849357664585114, -0.06748360395431519, -0.4635601341724396, 0.47419098019599915, 0.6533268690109253, -0.13971015810966492, -0.5912835001945496, -0.9035176634788513, 0.19250018894672394, 0.14367131888866425, 0.5637065172195435, -0.4456416070461273, -0.557498574256897, -0.07491868734359741, -1.0341790914535522, -0.3580291271209717, 0.277804970741272, -0.3691774904727936, -0.407357782125473, 0.41820913553237915, -0.9226908683776855, -1.0176174640655518, 1.376961588859558, -0.6741180419921875, 0.19502103328704834, -0.3266814947128296, 0.9463528990745544, -0.013745862990617752, -0.5596482157707214, -0.44498878717422485, -0.6854610443115234, -0.17861594259738922, 1.511431336402893, -0.69145667552948, 0.12439671903848648, 0.2382083386182785, -0.5839322805404663, -0.1236775815486908, -0.0018432922661304474, -1.688947081565857, 0.27494654059410095, 0.4522285461425781, -0.3294437527656555, -0.008672770112752914, -0.5654478669166565, -0.2990168333053589, -0.39941301941871643, 0.23630699515342712, -0.11204662173986435, -1.1613157987594604, 0.5098979473114014, -0.3412099778652191, 0.13642963767051697, -0.05091532692313194, -0.7643411755561829, -0.24145206809043884, 0.9380214810371399, 0.18733225762844086, -0.42424437403678894, 0.40427258610725403, -0.06736567616462708, -0.6648076176643372, 0.12930415570735931, 0.6745593547821045, 0.20239661633968353, 0.7891004085540771, 0.13495416939258575, -0.7075971364974976, -0.36016881465911865, 0.950757622718811, -0.15283843874931335, 0.6176789999008179, -0.5972418189048767, -0.048628419637680054, 0.8831787705421448, 0.5939822196960449, 0.01809534803032875, 0.19066472351551056, -0.3217373490333557, 0.5153446197509766, -0.6175653338432312, -0.21344342827796936, 0.8410862684249878, 0.4705890715122223, 0.4584202170372009, -0.4710823595523834, 1.025693655014038, -0.21247614920139313, -0.08015070855617523, -0.5754492282867432, -0.10993917286396027, 0.2204602062702179, 0.17184215784072876, -0.2578982412815094, 1.3579251766204834, 0.12579907476902008, -0.4477650225162506, 0.030116189271211624, 0.46029600501060486, -0.4967314898967743, -0.19492802023887634, 0.09343566745519638, 0.8032668828964233, 0.7898650765419006, 1.8330851793289185, 0.2342839390039444, -0.3399422764778137, 0.13673046231269836, 0.04827244579792023, 0.14252197742462158, -0.4531918466091156, -0.21688248217105865, 0.18370088934898376, -0.7470777034759521, 1.0511430501937866, -0.2548913359642029, 0.635642409324646, 0.024094533175230026, -0.23977422714233398, -1.068039894104004, -0.057685188949108124, -0.6072450280189514, -0.2096438705921173, 0.07243601232767105, 0.04754990339279175, -0.3414692282676697, 0.15589532256126404, 0.14136779308319092, -1.5070711374282837, 0.09805656969547272, -0.379332572221756, -0.21628908812999725, 0.11626826971769333, 1.2798638343811035, -0.3502950072288513, -0.23003976047039032, -0.2578822672367096, -0.8259634375572205, -1.112288475036621, 0.7136346101760864, -0.15191075205802917, -0.3236349821090698, -0.03730025142431259, 0.6661273837089539, -0.7432259917259216, 0.19443415105342865, -0.1908493936061859, 1.3039051294326782, 0.7560814619064331, -0.2930764853954315, 1.1477562189102173, -1.3636178970336914, 0.12331531941890717, 0.257172554731369, -0.7940487861633301, 0.25845861434936523, 0.47763633728027344, 0.2644701302051544, -0.14411182701587677, -0.35976648330688477, 0.12290118634700775, 0.18798500299453735, 0.2085580676794052, 1.003503680229187, -1.0023949146270752, 0.8208544850349426, 0.3067435622215271, 0.18519343435764313, 0.7017072439193726, -0.24522583186626434, -0.34996429085731506, 0.4159013330936432, 0.3171733021736145, -0.5867046117782593, -0.07039700448513031, -0.7418076992034912, -0.24804000556468964, -0.15010319650173187, 0.1296602487564087, 0.6451455354690552, -13.787566184997559, 0.8880425691604614, -0.895764946937561, 0.08129854500293732, 0.4632740020751953, 0.5868733525276184, -0.24736151099205017, 0.6744478940963745, 0.9838585257530212, 0.012748868204653263, -0.23469704389572144, 0.6217249035835266, 0.2513325810432434, -1.5254309177398682, -0.09476052969694138, -1.0180944204330444, -0.15540283918380737, -0.42320340871810913, -0.2875382602214813, 0.44913896918296814, 1.008971095085144, -0.8160606622695923, -0.6772723197937012, -0.8129516839981079, 0.040100716054439545, -0.586677610874176, -0.30045393109321594, 0.5835112929344177, 0.02974940836429596, 0.7061741352081299, 0.056568972766399384, -0.13353241980075836, -0.9266901016235352, -0.860576331615448, -0.2726995050907135, 0.7236534953117371, -1.2428178787231445, 0.13600072264671326, 0.5632796287536621, 0.18376758694648743, -0.016026511788368225, 0.23123662173748016, -0.9456964135169983, -0.8795024752616882, -0.3018348515033722, 0.27058643102645874, -0.09974731504917145, 0.41252100467681885, 0.16801446676254272, -0.8100613951683044, -0.7028710842132568, -0.017561189830303192, 0.598651111125946, -0.5469126105308533, 0.6749346852302551, -0.3159991502761841, -0.7996729612350464, 0.003793817013502121, -0.6943272352218628, -1.5292960405349731, 0.7644553184509277, -0.6496932506561279, -0.7427867650985718, 0.6475593447685242, 1.2543405294418335, -0.2146579623222351, 0.5405709147453308, 0.7337388396263123, -0.18150201439857483, 0.038588833063840866, -0.2729635536670685, 0.47113269567489624, -0.14558619260787964, 0.09058616310358047, -0.9241030812263489, 0.09655830264091492, 0.1458110362291336, -0.03181932121515274, 0.2758321166038513, 0.1279129683971405, -0.4248572587966919, 0.23090505599975586, -0.08071152120828629, 0.3384890556335449, -1.342301845550537, 0.157988503575325, 0.5910316705703735, -0.3828827440738678, 0.6395983695983887, 0.2991514801979065, -0.3233916461467743, 0.04900345206260681, -0.21963252127170563, -0.2356945276260376, 0.053025826811790466, 1.1006685495376587, 0.15301896631717682, 0.48360782861709595, -0.05607948452234268, -0.17477503418922424, 0.49361738562583923, 0.25321659445762634, -0.4580228626728058, 0.6851617693901062, 0.6394788026809692, -0.17669937014579773, 0.19816577434539795, -0.2538534998893738, 0.9773764610290527, 0.33277052640914917, 0.47057658433914185, -0.5305527448654175, 0.7249137759208679, 1.6297411918640137, -0.5886160135269165, 0.4724116623401642, 0.8716318011283875, 0.2803118824958801, 0.6556738615036011, 0.7546547055244446, 0.1431247591972351, 0.28406429290771484, 0.6285402774810791, 0.24250875413417816, 1.0065100193023682, 0.778100848197937, -0.03900105133652687, -0.0313727930188179, 0.32627516984939575, -0.4544874131679535, 0.6796066164970398, -0.742477536201477, -0.31229132413864136, -0.040660057216882706, 0.29926151037216187, -0.5470125675201416, -0.7503874897956848, 0.4697921574115753, -0.1438237428665161, 0.6729957461357117, 0.13266082108020782, -0.2428613305091858, -0.5589438676834106, -1.0081239938735962, -1.0884500741958618, 0.2048044502735138, -0.7984983325004578, 0.17385023832321167, -0.18036293983459473, -0.8158894181251526, 0.24032026529312134, -0.023681342601776123, 0.5657718181610107, -0.43608689308166504, -0.13101458549499512, 0.16759735345840454, -0.029978539794683456, -0.7853865027427673, 0.2727677822113037, -0.9170421361923218, 1.1432223320007324, 0.47438883781433105, -0.7513594031333923, 0.8692113161087036, 1.2484490871429443, 0.6536054015159607, -0.3024997115135193, -0.7414799928665161, 0.45811396837234497, -0.3245250880718231, 0.5268294811248779, -0.6595109105110168, -0.5521984100341797, -1.7927579879760742, -0.3417419195175171, -0.3232359290122986, 0.6192224621772766, -0.09021876752376556, -1.0948415994644165, 0.9573385715484619, 0.34892308712005615, 0.8717039227485657, 0.3579294979572296, -0.9072561860084534, -0.5528613328933716, -0.07905860245227814, 0.18961060047149658, 0.7052381634712219, 0.10156221687793732, 0.48824959993362427, -0.9366658926010132, -0.6636679172515869, -0.2827974855899811, 0.26888391375541687, 0.7172759175300598, -0.06079374626278877, 0.8158385157585144, 0.8955216407775879, -1.4264707565307617, 0.05143456906080246, -0.10268896818161011, -0.17717787623405457, -0.4902028739452362, 0.07101783156394958, 0.9737788438796997, -0.5023425221443176, -0.6863285899162292, -0.007293306291103363, 0.07468220591545105, 0.6278924345970154, -0.9754757881164551, 0.35087263584136963, -0.5564162731170654, -0.5891826152801514, -0.3974539637565613, 0.22306758165359497, -0.7828688621520996, -0.5713584423065186, 0.06380189210176468, -0.5555503368377686, -0.5746403336524963, 0.24865929782390594, -0.16257217526435852, 0.33285844326019287, 0.38596853613853455, 0.5310908555984497, 0.3194877505302429, 0.8503587245941162, 0.30252236127853394, 0.5928774476051331, 0.0653291642665863, 0.7462069392204285, -1.2103060483932495, -0.6796360015869141, 0.8147000670433044, -0.14826469123363495, -1.1243796348571777, 0.06505375355482101, -1.2684842348098755, 0.8218712210655212, -0.11810481548309326, 1.1600335836410522, 0.024577133357524872, 0.7672890424728394, -0.3818477392196655, -1.176230788230896, 0.14307650923728943, -0.36478954553604126, -0.2675243318080902, -0.3287678360939026, 0.33613428473472595, 1.0775933265686035, 0.39885538816452026, -0.14356006681919098, 1.0055022239685059, 0.3298846483230591, -0.5296570658683777, 0.0070754289627075195, 0.43257665634155273, 0.6497190594673157, 0.57063889503479, 0.06410922110080719, 0.7918137311935425, 0.16293446719646454, -0.1023562029004097, -0.2594066560268402, -0.37953126430511475, 0.36549240350723267, 0.3395199179649353, -0.4856763184070587, -0.3732529282569885, -0.9458137154579163, -0.03560802713036537, 0.09210842102766037, -0.3790932893753052, 0.472409188747406, -0.3025752305984497, 0.10647442936897278, 0.1691814363002777, 0.6113191843032837, 0.9262945652008057, 0.2380715161561966, -0.22122859954833984, -0.06210768222808838, 0.30379608273506165, 0.16581280529499054, -0.05275825783610344, -0.2700578570365906, 0.19631600379943848, -0.8459869027137756, -0.09436513483524323, 0.04790949821472168, -0.1868971288204193, -0.7478898167610168, -0.3465505838394165, -0.9422973394393921, 0.48073846101760864, -0.3396507501602173, -0.4986068308353424, 0.08935505151748657, 0.49811556935310364, 1.304567813873291, -0.26231247186660767, -0.014945432543754578, 0.15545004606246948, -0.30702072381973267, 0.3312910199165344, 1.3234797716140747, 0.25626271963119507, 0.3258507251739502, 0.4615495800971985, 0.2508990466594696, 0.08660449832677841, 1.370755672454834]]\n"
92
+ ]
93
+ }
94
+ ],
95
+ "source": [
96
+ "print(json.loads(response.content)['embedding'])"
97
+ ]
98
+ },
99
+ {
100
+ "cell_type": "code",
101
+ "execution_count": null,
102
+ "metadata": {
103
+ "tags": []
104
+ },
105
+ "outputs": [],
106
+ "source": [
107
+ "urlretrieve(url='http://127.0.0.1:7860/file/data.csv',filename='./returned_file.csv')"
108
  ]
109
  },
110
  {
 
133
  "name": "python",
134
  "nbconvert_exporter": "python",
135
  "pygments_lexer": "ipython3",
136
+ "version": "3.10.13"
137
  }
138
  },
139
  "nbformat": 4,
update.txt DELETED
@@ -1 +0,0 @@
1
- Nov 12 2023
 
 
update_valdata.py DELETED
@@ -1,34 +0,0 @@
1
- #!/usr/bin/env python
2
- # coding: utf-8
3
-
4
- # In[ ]:
5
-
6
-
7
- from numerapi import NumerAPI
8
- import os
9
- import pandas as pd
10
- import numpy as np
11
-
12
-
13
- # In[ ]:
14
-
15
-
16
- napi = NumerAPI()
17
- data_path='./data/'
18
-
19
-
20
- # In[ ]:
21
-
22
-
23
- napi.download_dataset("v4.2/validation_int8.parquet", data_path+"validation_int8.parquet")
24
- validation_data=pd.read_parquet(data_path+"validation_int8.parquet")
25
- recent_eras=list(validation_data.loc[validation_data['data_type']=='validation']['era'].unique()[-2:])
26
- validation_subset=validation_data[validation_data['era'].isin(recent_eras)]
27
- validation_subset.to_parquet(data_path+"validation_subset_int8.parquet",index=False)
28
-
29
-
30
- # In[ ]:
31
-
32
-
33
- print("Now please copy the file to server via: scp ../../data/validation_subset_int8.parquet gms@gms1:/home/gms/numerai/data/.")
34
-