paulbricman commited on
Commit
4cacd20
1 Parent(s): cbb915b

feat: tweak docker-compose

Browse files
backend/Dockerfile CHANGED
@@ -9,4 +9,4 @@ RUN pip3 install pyOpenSSL uvicorn[standard]
9
  RUN pip3 install -r requirements.txt
10
  RUN pip3 install transformers -U
11
  COPY . .
12
- CMD python3 -m uvicorn --host 0.0.0.0 main:app
9
  RUN pip3 install -r requirements.txt
10
  RUN pip3 install transformers -U
11
  COPY . .
12
+ CMD python3 -m uvicorn --host 0.0.0.0 main:app --reload
backend/main.py CHANGED
@@ -13,7 +13,7 @@ from slowapi.middleware import SlowAPIMiddleware
13
  from slowapi.errors import RateLimitExceeded
14
 
15
 
16
- limiter = Limiter(key_func=get_remote_address, default_limits=['5/minute'])
17
  app = FastAPI()
18
  app.state.limiter = limiter
19
  app.add_exception_handler(RateLimitExceeded, _rate_limit_exceeded_handler)
13
  from slowapi.errors import RateLimitExceeded
14
 
15
 
16
+ limiter = Limiter(key_func=get_remote_address, default_limits=['30/minute'])
17
  app = FastAPI()
18
  app.state.limiter = limiter
19
  app.add_exception_handler(RateLimitExceeded, _rate_limit_exceeded_handler)
backend/microverses.json CHANGED
@@ -1 +1 @@
1
- []
1
+ [{"filename": "zd1oaGvMTy8KTE2rrGKhgg.md", "modality": "text", "timestamp": 1643457050.6642315, "token": "xBMHgrsULyEeyJLgOuc1_w", "embeddings": {"text_model": "sentence-transformers/multi-qa-mpnet-base-cos-v1", "text_image_model": "clip-ViT-B-32", "text": [0.002426, -0.033236, -0.015784, 0.008488, -0.00727, -0.005809, 0.019862, 0.024071, -0.010357, 0.012449, 0.044691, 0.023055, -0.008816, 0.014801, 0.048491, -0.047784, 0.031107, -0.013901, -0.028176, -0.029727, -0.019634, -0.046136, -0.002352, -0.030781, 0.039063, -0.04015, 0.007634, 0.011453, 0.019302, -0.011444, -0.02214, -0.028496, 0.002637, 0.083404, 0.015303, -0.004681, -0.001447, 0.005785, -0.059521, -0.027741, -0.083415, -0.018694, 0.001993, -0.029784, -0.03249, -0.032508, 0.011713, -0.051509, -0.085455, -0.032614, 0.011535, 0.038654, 0.018737, -0.001103, 0.013922, 0.025584, 0.00136, 0.050854, 0.026841, 0.084678, 0.007258, 0.086429, -0.010016, -0.001431, 0.038705, -0.007454, 0.051088, 0.017165, -0.037507, 0.016872, 0.037408, -0.026315, -0.010656, -0.037582, 0.009655, 0.063311, -0.025803, 0.000635, -0.025509, 0.000265, -0.042093, -0.022722, 0.056558, -0.001857, 0.025804, 0.146752, 0.00602, 0.018906, -0.092933, -0.033808, -0.003899, -0.008155, -0.014094, -0.027364, 0.012922, -0.009629, 0.022225, -0.020429, 0.026748, 0.000968, 0.117618, 0.023645, 0.07064, 0.016248, 0.055608, -0.012666, -0.049821, -0.030531, 0.026529, -0.026928, 0.002616, -0.005103, 0.039966, 0.055985, -0.070933, -0.005887, 0.003028, 0.029643, 0.02495, 0.000648, -0.116857, 0.019766, 0.00318, -0.018539, -0.0139, 0.065405, -0.040731, 0.013061, 0.017231, 0.023484, -0.005118, -0.022507, -0.029119, 0.020631, 0.02502, 0.01229, 0.038405, 0.001758, -0.008263, -0.017229, -0.00365, -0.033431, 0.03049, 0.005507, -0.001561, 0.005638, -0.014739, 0.032006, -0.030109, -0.029275, -0.023169, 0.025474, -0.03752, 0.006832, 0.075507, 0.012942, -0.007158, 0.025518, -0.068675, -0.024328, 0.026852, 0.046111, -0.005048, -0.034685, 0.038243, -0.005025, -0.014589, -0.011179, 0.025962, 0.066091, -0.086386, 0.003717, -0.010749, 0.034498, 0.013513, 0.035891, 0.033875, -0.009752, 0.025155, -0.003411, 0.020705, 0.001343, 0.025587, 0.040338, -0.071013, 0.002705, 0.045098, -0.006164, -0.023763, 0.010655, -0.011273, -0.014074, -0.046068, 0.040232, 0.04317, -0.05666, 0.079845, 0.008779, 0.045591, -0.023235, -0.024822, 0.026316, 0.027317, 0.034815, -0.002256, -0.073318, -0.044472, -0.001311, -0.032107, 0.06308, 0.004184, -0.007025, 0.011711, 0.038568, 0.04013, -0.010879, -0.00125, 0.017999, -0.013444, -0.003849, -0.055889, -0.016274, 0.036196, -0.007386, -0.100399, 0.025366, 0.001786, 0.009484, -0.0011, 0.038238, 0.032112, -0.000187, 0.028347, -0.017712, -0.040945, -0.013025, 0.003261, 0.010175, 0.037503, -0.058312, 0.059912, 0.002061, 0.065682, -0.006671, -0.059963, 0.048421, 0.095129, 0.009152, 0.015022, -0.000966, 0.015283, -0.0049, 0.013288, -0.026129, 0.026583, -0.002016, -0.049847, 0.028487, 0.010183, 0.01602, -0.04497, -0.000752, 0.037866, -0.018501, -0.047847, 0.008821, -0.008043, -0.018686, -0.051216, -0.000603, -0.012077, 0.030134, 0.013977, -0.033346, 0.036486, 0.03968, 0.086767, 0.051802, -0.012912, -0.004572, 0.062603, 0.059741, -0.003544, -0.002444, -0.019, 0.024509, 0.023738, 0.040602, -0.016915, -0.017353, -0.001386, -0.011478, -0.004338, 0.023637, 0.016847, -0.019057, 0.031815, 0.009161, -0.022731, 0.028804, 0.028116, -0.01995, -0.000385, 0.005303, -0.007715, 0.024187, -0.013602, 0.035329, -0.000154, -0.028161, -0.006058, 0.018725, -0.034331, 0.119798, 0.000281, -0.063635, 0.002693, -0.002221, -0.001756, 0.007435, 0.021794, 0.007311, 0.005474, -0.007628, -0.000223, 0.010153, -0.050385, 0.004323, 0.048757, -0.005811, 0.020038, 0.014513, 0.002058, 0.016549, 0.044829, -0.02139, 0.018158, -0.042605, 6.1e-05, 0.001259, 0.028902, -0.03529, -0.007655, 0.011485, 0.072981, 0.007929, 0.046501, 0.043333, -0.008208, 0.020391, 0.001042, 0.041697, 0.004343, -0.003264, 0.000278, -0.02097, -0.052964, -0.046142, -0.016752, 0.001127, -0.006398, 0.071666, -0.027031, -0.03778, 0.07205, -0.018122, 0.052851, -0.002846, -0.013309, 0.013011, 0.042521, -0.003914, -0.046172, -0.005679, 0.005555, -0.030243, -0.031105, -0.005003, -0.058148, 1.8e-05, -0.010631, -0.035048, 0.039975, -0.044722, -0.008673, -0.05109, -0.024156, -0.010761, 0.028562, -0.057587, 0.010234, -0.062523, -0.042803, 0.015136, 0.010422, 0.049832, 0.000734, -0.002071, 0.006618, 0.002749, -0.024622, 0.010428, -0.073039, 0.026276, -0.008507, 0.029106, -0.039053, 0.013363, -0.039678, -0.013198, -0.114905, 0.041545, 0.049569, -0.017438, 0.067616, -0.015717, 0.006805, -0.012014, 0.038543, 0.028126, 0.013994, -0.022116, 0.039302, -0.00803, -0.01046, -0.002172, -0.073363, 0.016891, 0.016907, -0.034028, -0.026362, 0.038543, -0.023479, -0.009102, 0.029484, 0.077386, 0.009744, 0.038096, -0.0116, -0.006757, -0.034492, 0.025, -0.010342, 0.013184, -0.013501, 0.085058, -0.043076, -0.053779, -0.055426, -0.00935, -0.056998, 0.000665, -0.021355, 0.053328, -0.002652, -0.040627, -0.055538, -0.088513, -0.055889, -0.020503, 0.04505, 0.002008, 0.014761, 0.036052, -0.004182, 0.084025, 0.062701, -0.108317, 0.038774, 0.030044, 0.006983, -0.001371, 0.005495, 0.006915, -0.035246, 0.025847, -0.021625, -0.007231, -0.045266, 0.008738, -0.010178, -0.020436, -0.024154, -0.023965, -0.013763, 0.000193, -0.058285, 0.022057, -0.012239, -0.032301, 0.007628, -0.034971, 0.017903, -0.002208, 0.03144, -0.033906, -0.121743, 0.007089, -0.053323, 0.023845, 0.025766, -0.004419, 0.004298, -0.007633, -0.030255, -0.014666, -0.009218, 0.002694, 0.042386, 0.007473, 0.019119, -0.018696, -0.044535, -0.086451, 0.032387, 0.048318, 0.074795, 0.038426, 0.010633, -0.036444, -0.00584, -0.025188, -0.010344, 0.012679, 0.007164, -0.046117, 0.028634, -0.008183, 0.043292, 0.03074, -0.023022, 0.008668, 0.085303, -0.000162, -0.052242, 0.022401, -0.035385, 0.103401, 0.012715, 0.062141, -0.067706, 0.048516, 0.029947, 0.03963, -0.066073, -0.026881, -0.051433, 0.020114, 0.017834, -0.079125, -0.02627, 0.055974, -0.003062, 0.015913, 0.002535, -0.014524, 0.001391, 0.019923, 0.014673, -0.009781, 0.022877, -0.024329, -0.013808, -0.020044, -0.044761, -0.032473, -0.007086, 0.001141, -0.015732, 0.008837, 0.013002, 0.040501, -0.00925, 0.009532, -0.003663, 0.060643, 0.062365, 0.011322, 0.037341, -0.014905, -0.031757, -0.050498, 0.032219, 0.0593, -0.035473, -0.008093, -0.044711, 0.027549, -0.007674, -0.01197, 0.016166, -0.068932, 0.046819, 0.005592, 0.000744, -0.055237, 0.04257, -0.041402, 0.007735, 0.00478, 0.035522, -0.01602, 0.018909, 0.018406, -0.080148, -0.014268, 0.014343, -0.008706, -0.005439, 0.075899, 0.005041, -0.061629, 4.8e-05, 0.000931, -0.005273, 0.076084, 0.062744, 0.053545, 0.014876, -0.034089, 0.048599, 0.00399, -0.036379, -0.000123, -0.000627, -0.014128, 0.021583, -0.016377, 0.017267, 0.027294, -0.058458, -0.010159, -0.030389, -0.039636, -0.01983, -0.048222, 0.00621, -0.019509, -0.008486, -0.022567, 0.012217, -0.067113, 0.003781, 0.026584, -0.013158, -0.043833, -0.020374, 0.017496, 0.028516, -0.029691, 0.006155, 0.054214, 0.043738, 0.017816, -0.011337, 0.029814, -0.064275, -0.034219, -0.075338, 0.051952, -0.025963, 0.019998, -0.086157, -0.003151, -0.021072, 0.022349, 0.006518, -0.05037, 0.019638, -0.0248, 0.009408, -0.030606, 0.020536, 0.015135, 0.017667, -0.008906, -0.007554, -0.044226, -0.014196, 0.012101, 0.015137, 0.052776, -0.064688, 0.038732, 0.103273, -0.011107, -0.011067, 0.035194, -0.000217, -0.021489, 0.024566, 0.02991, -0.046187, -0.003897, 0.021576, 0.001119, -0.012367, -0.031161, 0.040045, 0.030225, -0.00043, -0.016321, 0.022968, -0.04425, 0.027778, -0.000383, 0.001052, -0.010234, -0.012312, -0.047801, -0.024545, 0.06519, 0.028602, 0.027163, -0.03109, 0.001627, 0.004846, 0.051587, 0.028253, -0.007687, 0.044852, -0.039949, 0.002379, 0.039489, -0.040019, -0.071195, -0.011708, 0.018004, -0.009483, -0.009194, 0.011788, -0.048783, -0.045846, 0.030275, -0.04611, -0.001876, 0.058384, 0.038762, -0.009332, -0.042015, -0.011611, 0.020347, -0.014907, -0.041906, 0.019181, 0.046061, -0.025864, -0.006988, 0.068974, -0.03048, -0.064898, 0.006888, -0.076993, 0.02768, -0.071457, 0.018092, -0.000845, -0.010223, 0.030632, -0.017612, -0.022167, -0.088007, -0.015294, -0.118168, -0.06012, 0.003148, -0.039398, 0.002921], "text_image": [-0.226292, 0.107697, 0.262129, -0.026938, 0.10939, -0.08307, -0.231523, -1.080778, -0.201995, 0.202388, -0.123342, 0.193853, 0.108751, -0.330906, -0.319023, 0.057707, -0.139173, -0.042089, -0.044127, 0.287001, 0.220496, 0.013055, 0.131235, 0.209645, 0.07242, -0.003968, -0.056311, 0.253616, 0.00969, 0.046336, 0.373695, -0.518351, 0.008296, 0.133197, -0.260776, 0.063049, 0.063303, -0.038384, 0.377244, -0.529958, 0.365614, 0.015649, 0.179336, 0.056578, -0.145881, 0.085081, 0.315797, -0.148763, 0.362241, -0.194566, 0.136605, 0.038175, 0.170419, -0.1165, -0.226773, 0.028683, -0.280578, 0.051376, 0.284843, 0.172843, 0.144818, 0.085191, -0.123086, -0.115969, -0.201011, -0.289072, -0.215595, 0.116803, 0.079327, -0.122333, -0.052815, -0.226281, 0.179681, -0.181764, 0.274992, 0.231401, 0.080681, -0.001221, 0.024135, -0.115367, -0.067443, 0.121339, 0.029426, 0.241889, -0.055643, 0.426599, -0.128223, -0.392162, 0.359806, 0.30013, 0.304129, 0.039872, -1.672083, 0.231594, 0.287834, 0.092673, 0.130545, 0.407392, -0.07236, -0.198062, 0.208463, 0.38948, 0.263391, -0.111803, -0.071078, 0.007708, -0.263298, -0.065431, -0.452826, -0.000801, 0.072829, 0.00686, -0.02516, -0.02809, -0.296769, 0.051336, -0.102029, 0.366215, -0.011593, 0.038788, -0.433838, -0.231374, -0.022098, 0.028321, 0.178749, -0.347908, 0.377661, -0.065847, -0.118885, 0.181434, -0.023069, 0.072277, -0.091588, 6.918654, 0.023136, 0.311477, -0.397965, -0.290108, -0.040937, -0.297528, 0.057401, 0.302444, 0.122375, 0.220638, -0.073465, 0.121818, -0.205323, -0.203997, -0.171356, 0.155265, -0.132277, -0.164367, 0.062253, 0.087299, 0.094308, -0.362169, -0.211647, 0.020182, -0.130902, -0.188791, 0.129274, -0.131317, 0.303815, -0.013855, 0.281787, -0.046233, -0.118466, -0.022928, 0.560085, -0.165409, 0.088584, 0.007045, 0.132796, -0.423123, 0.416764, -0.13819, -0.130981, 0.078519, -0.028953, 0.08928, -0.455841, 0.071356, -0.294983, -0.31202, 0.082214, -0.098664, 0.374168, 0.121978, 0.084652, -0.195288, -0.10211, -0.504476, 0.120507, -0.187723, 0.347539, 0.024565, -0.361843, 0.040236, 0.164615, -0.175354, -0.040128, -0.007505, 0.057858, 0.184022, -0.17431, -0.063531, 0.196668, 0.152009, -0.015727, 0.117567, 0.171928, -0.199706, -0.195571, -0.026144, 0.169636, 0.125369, 0.373102, 0.385059, -0.344249, -0.033097, 0.073365, -0.146195, -0.018833, -0.173676, 0.066133, 0.143159, 0.220299, -0.218142, 0.115751, -0.008791, 0.000721, 0.206745, 0.189853, 0.177993, -0.067847, 0.333977, 0.089741, 0.442618, 0.404892, 0.006483, 0.168362, -0.037229, 0.107017, 0.012569, 0.063707, 0.108256, -0.176205, 0.410347, 0.158157, -0.546342, 0.237655, 0.238358, -0.149079, -0.006571, -0.109592, -0.072166, 0.124838, 0.180546, -0.00891, -0.144443, -0.083947, -0.032873, 0.096121, -0.105572, 0.284903, 0.187418, 0.10601, 0.187069, -0.040636, 0.103368, 0.069751, -0.134967, -0.121137, 0.179083, 0.262901, 0.08845, -0.319514, -0.075705, -0.104768, -0.162081, -0.027073, 0.241563, 0.141115, 0.05878, -0.180242, 0.153684, -0.407655, -0.164275, -0.241504, -0.295416, 0.20467, -0.008776, 0.046785, -0.219102, -0.274454, -0.217541, 0.321217, 0.010251, 0.331961, 0.278828, 0.040844, 0.082574, -0.131682, 0.003743, 0.287923, 0.416729, -0.332862, -0.284951, 0.160194, -0.236334, -0.075742, -0.209282, 6.909087, -0.13351, -0.130396, -0.031618, -0.002094, -0.501755, 0.08122, -0.349423, 0.18817, 0.503308, -0.183565, -0.063091, 0.189474, -0.042017, -0.111563, -0.12557, -0.037837, -2.652737, 0.29925, 0.067504, 0.084618, 0.030051, 0.068819, -0.2029, 0.254628, -0.160837, 0.12654, -0.039367, -0.190474, -0.158623, 0.034172, 0.42767, -0.349128, 0.108162, -0.026412, 0.254836, -0.097616, -0.046865, -0.233146, 0.089503, 0.118964, 0.43214, -0.023656, -0.175617, -0.274743, -0.587425, 0.094281, 0.445052, 0.01443, 0.168989, 0.091596, -0.267695, -0.33263, -0.123009, 0.059173, 0.168104, 0.027075, 0.038199, -0.050681, 0.282431, 0.188059, -0.082649, 0.108835, 0.293624, -0.303765, -0.110289, 0.291429, 0.317949, -0.243878, -0.259924, -0.196624, -0.521011, 0.172839, 0.298772, -0.197753, 0.135908, 0.168152, 0.293889, 0.43374, 0.147989, 0.33263, 0.069498, 0.110544, 0.241201, 0.069117, 0.062661, -0.220206, 0.424807, 0.049772, 0.147524, -0.123631, 0.137316, 0.118654, -0.132913, -0.123126, 0.089204, 0.167377, -0.094199, 0.311098, 0.02973, 0.193233, -0.107489, 0.167904, 0.290424, 0.04519, -0.261185, -0.050599, -0.000675, 0.0404, 0.404042, -0.297433, -0.069604, 0.138922, 0.016003, -0.197347, 0.113172, 0.035342, -0.239508, 0.105861, -0.142559, 0.18792, 0.076912, -0.242742, 0.129091, 0.048085, 0.279861, 0.064156, -0.542975, -0.300507, -0.39627, -0.439194, -0.29102, 0.011632, -0.201009, 0.060866, -0.244526, 0.113161, -0.016975, -0.098734, 0.179165, 0.100861, 0.193558, 0.242467, -0.095939, -0.300987, 0.284485, 0.4878, -0.375772, 0.131989, 0.31761, 0.071057, -0.084154, 0.167856, 0.389297, -0.166839, -0.13868, -0.002977, 0.008115, 0.208826, -0.147287, -0.063016, -0.108854, -0.137494, 0.15943, 0.284109, -0.078246, 0.307421, 0.213273, 0.571517, -0.492565, 0.053704, 0.155875, -0.117005, 0.090023, 0.28452, -0.169912, -0.185201, 0.165503, 0.177729, 0.178559, 0.111282, 0.05744, 0.007651, 0.071369, 0.30601, 0.151642, -0.017758, 0.356142, -0.116126, 0.066929, 0.065404, 0.218143, 0.683802, 0.260816, -0.089677, -0.092683, -0.263333, 0.146909, -0.230577, -0.046798]}}]
docker-compose.yml CHANGED
@@ -1,7 +1,7 @@
1
  version: "3.7"
2
 
3
  networks:
4
- conceptarium:
5
 
6
  services:
7
  frontend:
@@ -9,7 +9,7 @@ services:
9
  ports:
10
  - 8501:8501
11
  networks:
12
- conceptarium:
13
  aliases:
14
  - frontend.docker
15
  depends_on:
@@ -23,7 +23,7 @@ services:
23
  ports:
24
  - 8000:8000
25
  networks:
26
- conceptarium:
27
  aliases:
28
  - backend.docker
29
  volumes:
1
  version: "3.7"
2
 
3
  networks:
4
+ local:
5
 
6
  services:
7
  frontend:
9
  ports:
10
  - 8501:8501
11
  networks:
12
+ local:
13
  aliases:
14
  - frontend.docker
15
  depends_on:
23
  ports:
24
  - 8000:8000
25
  networks:
26
+ local:
27
  aliases:
28
  - backend.docker
29
  volumes:
frontend/components/__pycache__/microverses.cpython-39.pyc CHANGED
Binary files a/frontend/components/__pycache__/microverses.cpython-39.pyc and b/frontend/components/__pycache__/microverses.cpython-39.pyc differ
frontend/components/__pycache__/viewport.cpython-39.pyc CHANGED
Binary files a/frontend/components/__pycache__/viewport.cpython-39.pyc and b/frontend/components/__pycache__/viewport.cpython-39.pyc differ
frontend/components/microverses.py CHANGED
@@ -56,14 +56,18 @@ def paint():
56
  shared_microverses = json.loads(requests.get(custodian_microverse[0]['url'] + '/microverse/list', params={
57
  'token': custodian_microverse[0]['token']
58
  }).content)
 
59
  for e_idx, e in enumerate(shared_microverses):
60
- st.code(e['token'])
 
 
 
61
 
62
- if st.button('disable', help='Disable the access to this microverse.'):
63
- requests.get(custodian_microverse[0]['url'] + '/microverse/remove', params={
64
- 'token': custodian_microverse[0]['token'],
65
- 'microverse': e['token']
66
- })
67
- st.info(
68
- 'The microverse has been removed.')
69
- st.experimental_rerun()
56
  shared_microverses = json.loads(requests.get(custodian_microverse[0]['url'] + '/microverse/list', params={
57
  'token': custodian_microverse[0]['token']
58
  }).content)
59
+
60
  for e_idx, e in enumerate(shared_microverses):
61
+ if isinstance(e, dict):
62
+ st.code(e['token'])
63
+ if e['modality'] == 'text':
64
+ st.success(e['content'])
65
 
66
+ if st.button('disable', help='Disable the access to this microverse.'):
67
+ requests.get(custodian_microverse[0]['url'] + '/microverse/remove', params={
68
+ 'token': custodian_microverse[0]['token'],
69
+ 'microverse': e['token']
70
+ })
71
+ st.info(
72
+ 'The microverse has been removed.')
73
+ st.experimental_rerun()