title
stringclasses
312 values
author
stringclasses
138 values
date
stringclasses
263 values
local
stringclasses
312 values
tags
stringclasses
196 values
URL
stringclasses
312 values
chunk
stringlengths
7
30.6k
embedding
sequencelengths
768
768
Llama 2 on Amazon SageMaker a Benchmark
philschmid
September 26, 2023
llama-sagemaker-benchmark
guide, inference, llm, aws
https://huggingface.co/blog/llama-sagemaker-benchmark
Recommendations & Insights Based on the benchmark, we provide specific recommendations for optimal LLM deployment depending on your priorities between cost, throughput, and latency for all Llama 2 model sizes. Note: The recommendations are based on the configuration we tested. In the future, other environments or hardware offerings, such as Inferentia2, may be even more cost-efficient.
[ 0.03054041601717472, 0.009476792998611927, 0.05415799468755722, 0.06034242361783981, 0.09652727097272873, 0.008421464823186398, -0.014534864574670792, 0.047274790704250336, 0.005609674844890833, -0.07088042050600052, -0.01711638830602169, 0.07107257097959518, 0.032197240740060806, 0.05054478347301483, 0.021491292864084244, -0.009648567996919155, 0.0305707398802042, 0.009886196814477444, 0.03898536413908005, 0.00912163034081459, 0.01707746833562851, -0.029290728271007538, 0.04989011958241463, -0.05387721210718155, -0.01176267210394144, -0.017885589972138405, -0.050320085138082504, 0.021551024168729782, -0.06354568898677826, -0.01837112382054329, -0.015206649899482727, -0.0021260296925902367, -0.03154601529240608, -0.015145260840654373, 0.03312130644917488, -0.01587238349020481, -0.05646776407957077, 0.08166635781526566, -0.012041079811751842, -0.04034925624728203, -0.007683762349188328, -0.04896917939186096, -0.09536734968423843, -0.00047553773038089275, -0.026424497365951538, 0.029941292479634285, -0.07394086569547653, 0.020898522809147835, 0.017734188586473465, 0.033747993409633636, -0.08854752779006958, 0.08595146983861923, 0.006050229538232088, 0.024963198229670525, 0.04480767250061035, -0.025520270690321922, 0.053404662758111954, -0.011870310641825199, -0.027579983696341515, 0.05623103305697441, 0.01814529113471508, -0.037040114402770996, 0.06099368631839752, 0.020878858864307404, -0.008780601434409618, -0.005600430071353912, -0.030351849272847176, -0.058372002094984055, -0.05111987888813019, -0.043636515736579895, 0.0005994472303427756, -0.013277174904942513, 0.007084960583597422, -0.03572463244199753, 0.005642549600452185, -0.05308663100004196, -0.012115798890590668, 0.06628735363483429, 0.024462003260850906, 0.08619176596403122, -0.0178922638297081, 0.04013918712735176, 0.04329950362443924, 0.004217130597680807, -0.015026479959487915, 0.04670809954404831, 0.061705317348241806, 0.0022658566012978554, -0.06753702461719513, 0.015539529733359814, -0.016078127548098564, -0.06481443345546722, 0.021988388150930405, 0.05239814519882202, 0.0827697217464447, -0.0386991910636425, 0.01766154356300831, -0.0034885990899056196, -0.060865338891744614, 0.033518821001052856, 0.0000114336780825397, -0.02274363487958908, 0.017996003851294518, 0.002170825144276023, -0.04122675582766533, 0.0775073692202568, -0.028048625215888023, -0.07197582721710205, -0.0918787345290184, 0.06846532970666885, -0.06285236030817032, -0.008583858609199524, 0.07220280170440674, -0.0016737281112000346, -0.05635804310441017, 0.016097040846943855, -0.023486213758587837, -0.005921228788793087, 0.010399176739156246, 0.05733935534954071, 0.026829227805137634, 0.10544310510158539, 0.06490108370780945, -0.047958195209503174, 0.02094731293618679, 0.020454872399568558, 0.005095033440738916, 0.04585716128349304, -0.0547480545938015, 0.012055316008627415, 0.028217030689120293, -0.0694870799779892, 0.0026341050397604704, -0.015612630173563957, 0.025450661778450012, -0.09233301132917404, -0.005042976699769497, -0.004966529551893473, 0.051706720143556595, -0.037479571998119354, -0.06936367601156235, -0.0020879993680864573, 0.05736379325389862, 0.004286458715796471, 0.06574978679418564, -0.02351217530667782, -0.0656454786658287, -0.006131371017545462, -0.023198915645480156, 0.0011047461302950978, -0.08401601761579514, 0.0736166462302208, -0.11944203078746796, -0.028924493119120598, 0.028842750936746597, 0.005069018341600895, -0.007961448282003403, -0.020621180534362793, -0.0766095295548439, -0.037115272134542465, -0.02624642103910446, -0.01828639768064022, -0.03572868928313255, -0.010030286386609077, 0.03666149452328682, -0.006184708792716265, 0.058558158576488495, 0.02303585596382618, -0.01616961695253849, -0.012944822199642658, 0.04492151737213135, 0.035759955644607544, 0.07053197175264359, -0.025597164407372475, -0.020433126017451286, 0.03387784585356712, 0.04501362517476082, 0.0938158705830574, 0.01426686067134142, -0.01983065903186798, -0.04245568439364433, 0.012730320915579796, -0.053377483040094376, 0.04010479897260666, 0.019413653761148453, -0.09159612655639648, 0.003214331343770027, -0.0849967747926712, -0.05880970507860184, -0.11802714318037033, -0.05485210567712784, -0.020503289997577667, 0.049910712987184525, -0.009817743673920631, -0.016611751168966293, -0.011027074418962002, 0.010487713851034641, 0.12501604855060577, 0.06946289539337158, 0.02039443701505661, 0.07743602246046066, 0.07381948083639145, 0.039689332246780396, 0.03721153363585472, -0.0633387491106987, -0.003992781974375248, -0.012517891824245453, -0.036318693310022354, 0.021172886714339256, 0.024278854951262474, 0.010747374035418034, -0.13518084585666656, -0.042042434215545654, -0.038230050355196, 0.008223382756114006, -0.054902564734220505, -0.0005029810126870871, 0.033413030207157135, 0.015067989006638527, -0.014420773833990097, 0.13803711533546448, -0.037310536950826645, 0.016417108476161957, 0.002516639418900013, -0.010031403973698616, 0.03795892372727394, 0.03763644024729729, -0.0025828424841165543, 0.07374410331249237, -0.026407329365611076, 0.032633762806653976, -0.06572581082582474, 0.0030658869072794914, 0.08277128636837006, 0.041936539113521576, 0.044303085654973984, -0.09245264530181885, -0.03974099084734917, 0.04868210479617119, 0.05390723794698715, 0.03398190438747406, 0.008245399221777916, 0.019540797919034958, 0.09858988970518112, 0.01852683536708355, -0.04849402979016304, 0.009165805764496326, -0.025139017030596733, -0.031726520508527756, -0.014565151184797287, -0.05949283391237259, -0.031721331179142, 0.08531391620635986, 0.03477970510721207, 0.017196834087371826, -0.020354047417640686, -0.04849380627274513, -0.0005925525911152363, -0.03962438181042671, 0.007536540273576975, -0.00621953746303916, -0.013909257017076015, 0.029164090752601624, -0.01858346536755562, 0.03932304307818413, -0.04125566780567169, 0.015088343061506748, -0.0568493977189064, -0.06446842849254608, 0.015522835776209831, 0.021509012207388878, 0.01768876053392887, 0.01030515506863594, -0.010664992034435272, -0.022672008723020554, -0.03329804912209511, 0.04359598457813263, -0.02469591610133648, -0.012578176334500313, -0.025121353566646576, -0.005685746204108, -0.030067365616559982, 0.05765256658196449, 0.03658905252814293, -0.01907438039779663, -0.04943041130900383, 0.000230612771701999, -0.031780920922756195, -0.02158442884683609, -0.008723771199584007, -0.017176082357764244, -0.0341457836329937, -0.004748309496790171, -0.014979011379182339, -0.0397910512983799, -0.04601758345961571, 0.034883763641119, 0.014061102643609047, -0.012496751733124256, 0.005693632178008556, -0.06769552826881409, -0.017169533297419548, 0.0017408967250958085, -0.00540953828021884, -0.0206002090126276, 0.022618351504206657, 0.028490135446190834, 0.018037376925349236, -0.1036982610821724, -0.007072920445352793, -0.03747671842575073, 0.028065165504813194, -0.022351745516061783, -0.010685214772820473, 0.060098208487033844, -0.010226813144981861, -0.02740217186510563, 0.010484129190444946, -0.0000707297949702479, 0.011302645318210125, 0.020609602332115173, -0.03441585972905159, -0.010066339746117592, 0.039203133434057236, 0.020273791626095772, -0.004405756015330553, 0.0024883891455829144, -0.008237608708441257, -0.0046548121608793736, 0.03823227062821388, -0.004358982667326927, -0.019527258351445198, -0.05438932031393051, 0.01287597231566906, -0.005784932523965836, -0.0030375756323337555, -0.006961433682590723, -0.03497651591897011, -0.037180572748184204, -0.0009394073276780546, -0.04404013976454735, -0.06093515828251839, -0.05466623231768608, 0.012706644833087921, -0.01812083087861538, 0.03850182518362999, 0.057412583380937576, 0.06815466284751892, 0.025983775034546852, -0.015309219248592854, 0.049785587936639786, -0.024332858622074127, 0.021306481212377548, 0.013073463924229145, 0.020159969106316566, -0.0045565469190478325, 0.0663338154554367, 0.0010894008446484804, -0.03409196436405182, 0.01772572100162506, 0.0005942020798102021, 0.014018193818628788, 0.027377473190426826, -0.003781375475227833, 0.003944431897252798, 0.003270573215559125, 0.03889136016368866, 0.025346679612994194, -0.044224970042705536, -0.004018133506178856, -0.021151842549443245, 0.018748624250292778, -0.037952981889247894, 0.036662738770246506, 0.038058407604694366, 0.014290155842900276, 0.00746577512472868, 0.018810611218214035, -0.017833584919571877, 0.0763423964381218, 0.006912836804986, 0.0061700548976659775, -0.018648279830813408, 0.016482559964060783, -0.02263169176876545, -0.0032480608206242323, 0.04583185911178589, 0.040497396141290665, -0.0235823355615139, 0.000814959523268044, 0.010386967100203037, -0.02030646987259388, -0.01674087531864643, 0.025011496618390083, 0.022763680666685104, 0.006988300010561943, 0.00827251747250557, 0.02643829770386219, -0.028902772814035416, -0.006953398697078228, 0.039181362837553024, -0.008675300516188145, 0.03340397775173187, -0.01538724172860384, 0.024710936471819878, 0.0038612636271864176, -0.02087767980992794, 0.028922518715262413, 0.039166077971458435, 0.001073705148883164, -0.0027148567605763674, 0.0072750491090118885, -0.019611939787864685, 0.015241784043610096, 0.02245650440454483, -0.013366182334721088, 0.010797475464642048, 0.04067020118236542, 0.016023799777030945, 0.005972803570330143, 0.0030187577940523624, -0.009617981500923634, 0.04341263324022293, -0.008064093068242073, -0.010072452016174793, 0.036037322133779526, -0.026690466329455376, 0.01578785479068756, -0.04767982289195061, -0.02166854962706566, -0.00018807948799803853, 0.02351057156920433, 0.06360642611980438, -0.036560025066137314, -0.017387710511684418, -0.008925429545342922, 0.015916382893919945, 0.005439899396151304, -0.038844335824251175, -0.024024635553359985, 0.021408915519714355, 0.005337654612958431, -0.01884416677057743, 0.010773582383990288, -0.053781673312187195, 0.046338580548763275, -0.019869234412908554, 0.004226929973810911, 0.01964009739458561, 0.02710368111729622, 0.02001536451280117, -0.034674495458602905, 0.05046270787715912, 0.008210494183003902, -0.013575148768723011, -0.014235883951187134, -0.014441830106079578, 0.022801581770181656, 0.01840004324913025, -0.028284214437007904, -0.017334163188934326, 0.026833930984139442, 0.011603574268519878, 0.021683767437934875, -0.018647782504558563, 0.02664756588637829, 0.022206779569387436, 0.014656022191047668, 0.019507713615894318, 0.013871314935386181, -0.0533209927380085, -0.00569555489346385, 0.025890206918120384, -0.006562462076544762, 0.008167552761733532, 0.015395041555166245, -0.01368862483650446, -0.011086386628448963, 0.05199359357357025, -0.04996556043624878, 0.014658540487289429, -0.01041367743164301, 0.031237022951245308, 0.013561597093939781, 0.006439385004341602, -0.001977390144020319, 0.038523703813552856, -0.011595819145441055, -0.0004263521113898605, -0.029467500746250153, 0.04859789460897446, 0.0007135909982025623, -0.0001652613136684522, -0.0013175328494980931, 0.07105471938848495, 0.04100969061255455, -0.034515004605054855, 0.024234743788838387, 0.04212991148233414, 0.01963174343109131, 0.009411708451807499, -0.015711313113570213, 0.00043000298319384456, 0.008191379718482494, 0.009859168902039528, 0.019858362153172493, 0.0036817502696067095, 0.0029712349642068148, 0.01399382296949625, 0.007437478750944138, -0.04810383915901184, -0.032899159938097, -0.017376044765114784, 0.014081700704991817, 0.008420553989708424, -0.05581248924136162, 0.03282911702990532, 0.026435142382979393, -0.035259656608104706, -0.033758677542209625, -0.04415906220674515, 0.01656845584511757, 0.045514557510614395, -0.03067588619887829, -0.0731661468744278, 0.06319545954465866, 0.047896888107061386, 0.05132654681801796, 0.03214503824710846, -0.025613006204366684, -0.013375627808272839, 0.0018758714431896806, -0.035751864314079285, -0.005750829353928566, -0.03511134162545204, -0.006828058045357466, -0.030297469347715378, 0.015745412558317184, 0.0002493066422175616, -0.06213471293449402, 0.025942323729395866, 0.03285764157772064, 0.040898047387599945, 0.019618002697825432, -0.058518845587968826, 0.0047651431523263454, -0.017230601981282234, -0.016662457957863808, -0.03426382318139076, -0.062332864850759506, -0.08213358372449875, 0.014221439138054848, -0.05777224898338318, 0.021377721801400185, 0.05786629021167755, -0.008864146657288074, -0.039985351264476776, 0.0038544386625289917, 0.01105399802327156, -0.014989531598985195, 0.013136068359017372, -0.010300727561116219, 0.002832012949511409, 0.01421028096228838, 0.022835025563836098, 0.041113391518592834, -0.006544642150402069, -0.03441251814365387, 0.029982011765241623, -0.017895376309752464, 0.010626501403748989, 0.07510293275117874, -0.032903820276260376, 0.011802250519394875, 0.04271933436393738, -0.07137992233037949, 0.05682104080915451, -0.01926061511039734, -0.017714358866214752, -0.007265637628734112, 0.03519978001713753, -0.020004792138934135, -0.010575996711850166, -0.01233995147049427, -0.007851057685911655, 0.039393868297338486, 0.011210769414901733, 0.03847574442625046, -0.012681420892477036, 0.010574937798082829, 0.06863243877887726, 0.03078053519129753, -0.036612581461668015, 0.02039085514843464, 0.028632408007979393, 0.04437824711203575, 0.04486817121505737, 0.0358111597597599, -0.02460055612027645, -0.01100609079003334, 0.00093244225718081, 0.0067000058479607105, -0.07383733987808228, 0.0023438630159944296, 0.0048111071810126305, 0.022309081628918648, -0.02328943833708763, -0.047983910888433456, 0.032868582755327225, 0.006356747820973396, 0.018977416679263115, -0.027403101325035095, 0.03303099423646927, -0.031998567283153534, 0.025432871654629707, -0.010615682229399681, -0.007724531926214695, -0.022917399182915688, -0.03140925616025925, 0.03301762789487839, -0.010685866698622704, 0.0561227984726429, -0.00635007256641984, -0.0045991563238203526, -0.0027340713422745466, -0.019478322938084602, 0.011257732287049294, 0.025546377524733543, 0.005961868911981583, -0.00009910088556353003, -0.01193738542497158, 0.053082458674907684, -0.020898249000310898, -0.0230566393584013, -0.015934038907289505, 0.018392052501440048, 0.014112817123532295, -0.017240410670638084, 0.022851068526506424, 0.06174185872077942, 0.03676748648285866, 0.0036945492029190063, -0.009194771759212017, 0.012096988968551159, -0.04948306456208229, 0.013889051042497158, -0.05653781816363335, -0.014096030965447426, 0.013919363729655743, 0.02735378034412861, 0.0018802236299961805, 0.050311144441366196, -0.01071172021329403, 0.023462463170289993, 0.03525195270776749, -0.006617279723286629, -0.048825882375240326, 0.010831937193870544, -0.015850162133574486, 0.02180449292063713, -0.014202368445694447, 0.019467679783701897, 0.031064750626683235, -0.05519842728972435, 0.02718937024474144, -0.017867494374513626, -0.0071457549929618835, -0.030952826142311096, 0.020349562168121338, 0.013861036859452724, 0.0018640370108187199, 0.017123956233263016, -0.015427094884216785, -0.019915547221899033, -0.027315277606248856, 0.030668897554278374, 0.027990229427814484, 0.034644853323698044, -0.020420700311660767, 0.011406918987631798, -0.008246557787060738, 0.05859791487455368, -0.017789913341403008, 0.012932064943015575, 0.00745487492531538, 0.021511366590857506, -0.027865296229720116, -0.01421410869807005, 0.07942774146795273, -0.0033815971110016108, 0.05162763595581055, 0.024537790566682816, 0.025105701759457588, 0.0010821775067597628, -0.01896875724196434, 0.03883152827620506, -0.007344589568674564, 0.0342877171933651, -0.0030176197178661823, -0.0036082149017602205, 0.0036518722772598267, -0.010325239971280098, -0.02136511355638504, -0.0043405829928815365, -0.024888308718800545, -0.010446973145008087, -0.042138271033763885, -0.011362072080373764, -0.007024304009974003, -0.03394875302910805, 0.05531200394034386, 0.045892201364040375, 0.007236960809677839, -0.0022634731139987707, -0.042527567595243454, -0.017084062099456787, -0.007119514048099518, 0.018139611929655075, 0.026927020400762558, -0.008142373524606228, -0.021678553894162178, -0.033917639404535294, 0.02354876883327961, -0.003862525802105665, -0.048977624624967575, -0.004344727843999863, 0.025879791006445885, -0.010783064179122448, 0.04827624186873436, -0.03721972927451134, 0.012859489768743515, 0.005140230525285006, 0.05823304131627083, 0.024769224226474762, -0.02616598643362522, 0.003828411689028144, -0.024179944768548012, -0.028685368597507477, -0.012114969082176685, 0.013478840701282024, -0.020336929708719254, 0.001702154753729701, 0.0059233433566987514, -0.004052107222378254, -0.05029301717877388, -0.0200662799179554, 0.01952536404132843, -0.025871792808175087, -0.033730845898389816, -0.03486229106783867, 0.016391200944781303, 0.0031415473204106092, -0.045512739568948746, -0.08293052762746811, 0.022911259904503822, -0.004330926109105349, 0.01660136878490448, -0.007946555502712727, -0.05397437512874603, -0.008860863745212555, 0.019883926957845688, 0.00033980561420321465, 0.012441708706319332, 0.03195546939969063, 0.013189407996833324, 0.011351280845701694, -0.0050300052389502525, 0.009159494191408157 ]
Llama 2 on Amazon SageMaker a Benchmark
philschmid
September 26, 2023
llama-sagemaker-benchmark
guide, inference, llm, aws
https://huggingface.co/blog/llama-sagemaker-benchmark
What is GPTQ? GPTQ is a post-training quantziation method to compress LLMs, like GPT. GPTQ compresses GPT (decoder) models by reducing the number of bits needed to store each weight in the model, from 32 bits down to just 3-4 bits. This means the model takes up much less memory and can run on less Hardware, e.g. Single GPU for 13B Llama2 models. GPTQ analyzes each layer of the model separately and approximates the weights to preserve the overall accuracy. If you want to learn more and how to use it, check out Optimize open LLMs using GPTQ and Hugging Face Optimum.
[ 0.00758901285007596, -0.011925783008337021, 0.025449592620134354, -0.038422711193561554, 0.050769150257110596, 0.0413956418633461, -0.02677908167243004, 0.030579164624214172, 0.0444846972823143, 0.02899739146232605, -0.10508852452039719, 0.0059764571487903595, -0.03913082554936409, 0.04454348608851433, -0.010944393463432789, -0.001397663145326078, 0.023409318178892136, -0.02279788628220558, 0.0013007083907723427, 0.019223352894186974, 0.03863120079040527, -0.025203512981534004, 0.012509373016655445, -0.06869921088218689, 0.05263636261224747, -0.031748440116643906, 0.01394403912127018, 0.046502579003572464, -0.003974443767219782, 0.028511427342891693, -0.05865713953971863, -0.011557028628885746, -0.057502686977386475, -0.06826338917016983, 0.02981540560722351, -0.03861099109053612, -0.13203300535678864, 0.023213567212224007, 0.020479915663599968, 0.0034826926421374083, -0.012391507625579834, 0.01153788436204195, -0.014038666151463985, 0.005907100159674883, -0.01127590611577034, 0.004582797177135944, -0.12743450701236725, 0.06397830694913864, -0.08147940039634705, -0.15144117176532745, -0.011875469237565994, 0.08854065835475922, -0.04427524283528328, 0.016891952604055405, -0.014915675856173038, -0.038978226482868195, 0.043323613703250885, -0.081158347427845, -0.03969705104827881, 0.0042724753729999065, -0.007960015907883644, -0.04133456572890282, 0.03992561250925064, 0.04164326936006546, 0.00020269046945031732, -0.00043949062819592655, -0.050574615597724915, -0.02380426414310932, -0.03193550556898117, 0.00032337024458684027, -0.03075094148516655, 0.055265363305807114, -0.00526420259848237, -0.035850826650857925, -0.030662115663290024, -0.011052094399929047, -0.03324950113892555, 0.039726875722408295, 0.02820899710059166, 0.055111613124608994, 0.006574414670467377, 0.026524648070335388, -0.004150563385337591, 0.017907937988638878, 0.022480718791484833, 0.02865099534392357, 0.015542544424533844, -0.09003959596157074, -0.08975618332624435, 0.029095835983753204, -0.05165204405784607, -0.12153763324022293, -0.06456815451383591, -0.004481395240873098, -0.0012872818624600768, -0.012659949250519276, -0.008581767790019512, -0.006956090219318867, -0.011068500578403473, 0.018700940534472466, 0.05549406260251999, -0.056769657880067825, 0.02739483304321766, -0.042188771069049835, -0.03622431680560112, 0.06750736385583878, -0.039516035467386246, -0.08062432706356049, -0.026478178799152374, 0.03388414531946182, 0.0029623776208609343, 0.002139132469892502, -0.013174138963222504, -0.022497743368148804, -0.07987869530916214, 0.045821405947208405, 0.007869631052017212, -0.015264159068465233, 0.04771408066153526, 0.053314097225666046, -0.08454148471355438, 0.05043813958764076, 0.06324584037065506, -0.04525226727128029, 0.0011437401408329606, -0.05247548967599869, 0.043662652373313904, -0.08236663043498993, 0.08316534757614136, 0.03470240905880928, 0.03590033948421478, -0.0017123795114457607, 0.010816995054483414, -0.023524900898337364, -0.008215639740228653, -0.05454522371292114, -0.03414690122008324, -0.05246352776885033, -0.03609469160437584, -0.01811126433312893, 0.02687225490808487, 0.02810671553015709, -0.014363044872879982, -0.06925095617771149, -0.05220203474164009, 0.022886916995048523, -0.09983509033918381, 0.038604479283094406, -0.016216592863202095, 0.008561979979276657, -0.14133240282535553, 0.04013726860284805, -0.05587577819824219, -0.101591557264328, 0.03867032006382942, -0.011535136960446835, -0.05326979607343674, 0.007770406547933817, -0.0506482757627964, -0.03392978757619858, -0.0664886087179184, -0.05555865168571472, -0.06516922265291214, 0.045475054532289505, -0.003932759165763855, -0.010706921108067036, -0.05388745665550232, 0.007617814000695944, -0.014234693720936775, 0.03865740820765495, -0.0020428593270480633, 0.0034463428892195225, 0.07894408702850342, -0.021243130788207054, -0.008131338283419609, 0.007716954220086336, 0.021422699093818665, 0.07093581557273865, -0.027736032381653786, -0.004955342970788479, 0.02499081939458847, 0.010304754599928856, 0.011818213388323784, 0.03127535060048103, -0.00512327253818512, -0.0789678767323494, 0.03133852407336235, -0.04091976583003998, -0.01301784161478281, -0.042576469480991364, -0.048930343240499496, 0.012700755149126053, 0.06274177879095078, 0.0018879101844504476, 0.03877757117152214, -0.061647579073905945, -0.005997639615088701, 0.1399315893650055, 0.050688255578279495, 0.032616205513477325, 0.05850960314273834, 0.02815081737935543, 0.04816240444779396, -0.025273354724049568, -0.00686510419473052, 0.041961029171943665, -0.01181086990982294, 0.04311903193593025, 0.00643578078597784, -0.006619200576096773, -0.0064898463897407055, -0.05467383936047554, -0.06601987779140472, -0.03835468739271164, 0.036088135093450546, -0.017886850982904434, -0.003237370168790221, 0.018185099586844444, 0.051874320954084396, -0.03291815519332886, 0.13698804378509521, -0.02221096120774746, -0.00041303609032183886, -0.07111611217260361, -0.05370945855975151, 0.0678500086069107, 0.08134859055280685, -0.03366462141275406, 0.054078925400972366, -0.07606881111860275, 0.018552141264081, -0.1198083758354187, 0.02459535375237465, 0.05292770266532898, 0.0512855164706707, -0.03414095565676689, 0.008709191344678402, 0.006608107127249241, 0.095181405544281, -0.0003614526940509677, -0.006964023225009441, 0.07291296124458313, -0.03358358144760132, -0.0034020370803773403, 0.07916413992643356, 0.019556360319256783, 0.05712568014860153, -0.04207272082567215, -0.016554871574044228, -0.038223735988140106, -0.013397496193647385, 0.06478767842054367, -0.0005053241620771587, 0.007150104735046625, -0.013934267684817314, -0.05510773882269859, 0.016579223796725273, -0.007624000310897827, -0.01346363965421915, 0.017867809161543846, -0.019528260454535484, -0.022529473528265953, 0.009338305331766605, 0.00951532181352377, 0.02666926197707653, 0.01492615882307291, 0.014948651194572449, 0.025275444611907005, -0.0004796064458787441, -0.034979380667209625, 0.05288008227944374, 0.016916077584028244, 0.04854326322674751, 0.017748404294252396, 0.014354775659739971, 0.03402214124798775, 0.01966184377670288, -0.017471015453338623, -0.023809900507330894, -0.009388882666826248, 0.032300516963005066, 0.003943565767258406, 0.028589213266968727, 0.021219797432422638, -0.0021927226334810257, 0.015477659180760384, -0.00042885844595730305, -0.027687449008226395, -0.02424279786646366, 0.03929904103279114, -0.022163482382893562, 0.031165674328804016, -0.05182179436087608, -0.021327989175915718, -0.011381511576473713, -0.02124634012579918, 0.014615458436310291, 0.011321291327476501, 0.023560579866170883, 0.03633898124098778, -0.01051374338567257, 0.025582466274499893, -0.01083714421838522, 0.030079208314418793, -0.034028202295303345, 0.01716267690062523, 0.03689642623066902, 0.041762351989746094, -0.07855842262506485, -0.02079729735851288, 0.02707803249359131, 0.007203700486570597, 0.025745991617441177, -0.02979407086968422, 0.07035929709672928, 0.0011757856700569391, -0.03179435059428215, 0.0008397315395995975, 0.0782523900270462, 0.026231644675135612, 0.02802051231265068, 0.0028832091484218836, 0.018496476113796234, 0.021954329684376717, -0.037412673234939575, -0.009786192327737808, 0.03842458128929138, 0.031645771116018295, 0.031073439866304398, 0.011391040869057178, 0.02897593192756176, -0.016613176092505455, 0.01589236781001091, -0.045608729124069214, -0.010734867304563522, 0.0022811428643763065, -0.021189061924815178, 0.024087127298116684, -0.01833515241742134, -0.011222845874726772, -0.021770134568214417, 0.034212589263916016, -0.03477025032043457, -0.01345505379140377, 0.05913783237338066, 0.038531359285116196, 0.024214448407292366, 0.03860276937484741, -0.02205057255923748, -0.03464723378419876, 0.04793081060051918, -0.016553165391087532, 0.03906655311584473, 0.01423483807593584, -0.016939926892518997, -0.0043729860335588455, 0.0451379232108593, -0.02695438824594021, -0.029258636757731438, -0.03520633652806282, -0.04425767809152603, 0.03122037649154663, -0.01789706200361252, -0.022690702229738235, 0.0022576237097382545, -0.013542027212679386, 0.0326940193772316, 0.03251589462161064, -0.035565316677093506, -0.024205930531024933, -0.017403220757842064, -0.03296567127108574, -0.009691575542092323, 0.03778686746954918, 0.007192790973931551, -0.031209388747811317, 0.020932793617248535, 0.03738134354352951, 0.021631525829434395, 0.0017325547523796558, -0.000477815541671589, 0.005805792286992073, -0.030963314697146416, 0.018742337822914124, -0.03878365457057953, -0.011834841221570969, 0.05251225829124451, 0.0008635235135443509, -0.021588491275906563, -0.004513665568083525, -0.04488883167505264, 0.0028072313871234655, 0.021907726302742958, -0.02090839296579361, 0.0019210976315662265, -0.015426306053996086, 0.049737349152565, -0.016087958589196205, 0.014125454239547253, -0.028882378712296486, 0.029478583484888077, 0.010655480436980724, -0.004364795982837677, 0.052780769765377045, 0.022395208477973938, 0.025822589173913002, 0.01690620370209217, -0.004761494696140289, 0.05083364620804787, -0.022784022614359856, 0.0026199202984571457, -0.03242202475667, -0.031654469668865204, 0.030218716710805893, -0.008013865910470486, -0.0038898191414773464, 0.05745226517319679, 0.03584443777799606, -0.008793646469712257, -0.03021073341369629, 0.0035551926121115685, 0.024359311908483505, 0.039505790919065475, -0.022615021094679832, -0.013503764756023884, -0.025417836382985115, 0.03533928096294403, 0.026170654222369194, -0.02355635166168213, 0.016884062439203262, 0.005205363966524601, -0.007653906475752592, 0.008592563681304455, 0.013286357745528221, -0.022606240585446358, -0.037338726222515106, -0.011569675989449024, -0.005889905616641045, -0.048192184418439865, -0.02672918513417244, 0.004451865795999765, -0.023998107761144638, 0.02200813964009285, -0.01610240712761879, -0.02826031669974327, -0.00854151789098978, 0.023544294759631157, -0.03891047090291977, -0.028268082067370415, -0.030618436634540558, 0.040131956338882446, -0.05148123577237129, 0.024204343557357788, 0.02975035272538662, 0.02438601665198803, 0.019950125366449356, -0.009699062444269657, 0.05291040614247322, 0.007895590737462044, -0.030008068308234215, -0.03118194080889225, -0.03622760623693466, 0.038045186549425125, -0.005684256087988615, -0.03564158454537392, 0.006005414295941591, 0.013135981746017933, 0.02876877225935459, 0.028093639761209488, 0.03631986677646637, -0.03902016952633858, -0.020820805802941322, 0.022943198680877686, -0.013761449605226517, 0.02226388268172741, 0.005834057927131653, -0.012199406512081623, 0.03544575721025467, 0.011894159018993378, 0.0014332712162286043, 0.03940631449222565, -0.021219098940491676, 0.0030175780411809683, 0.05784261226654053, 0.016355622559785843, -0.00024199101608246565, -0.008791988715529442, 0.02006636932492256, -0.03703565150499344, -0.02599787339568138, 0.031930096447467804, -0.01063867099583149, -0.01584906317293644, 0.02617032080888748, 0.030368849635124207, 0.06610985845327377, -0.041591279208660126, 0.016013305634260178, 0.0531088262796402, 0.004053283482789993, 0.06546255946159363, -0.012183177284896374, -0.0029624169692397118, 0.020135702565312386, 0.017186693847179413, 0.024719996377825737, -0.0228734128177166, -0.003513345494866371, 0.01827583834528923, 0.01910664513707161, -0.01934761367738247, -0.021811073645949364, -0.0007097187335602939, 0.007010236382484436, -0.03633199259638786, -0.03971705585718155, 0.021261272951960564, 0.020954130217432976, -0.022565489634871483, -0.02206331118941307, -0.02464669570326805, -0.04981693997979164, 0.005724700167775154, -0.008268935605883598, 0.017248045653104782, 0.02681664377450943, 0.02604159340262413, 0.003851033514365554, 0.005855114199221134, -0.04837487265467644, -0.015899820253252983, -0.018288956955075264, 0.03914092108607292, -0.021754318848252296, -0.0073851183988153934, 0.004489196464419365, 0.04143264517188072, 0.019969265908002853, 0.018433354794979095, -0.0135897696018219, -0.02501816302537918, 0.0146593376994133, 0.004370768554508686, 0.035418227314949036, -0.02880149520933628, -0.011792254634201527, -0.017321031540632248, -0.024021901190280914, 0.0041456217877566814, -0.07215465605258942, -0.04030604660511017, -0.022708483040332794, -0.08120587468147278, 0.018547063693404198, 0.055875588208436966, -0.006871746852993965, 0.0033474185038357973, -0.0010819390881806612, 0.04230211302638054, 0.0017617784906178713, 0.049095626920461655, 0.02196459099650383, -0.020817743614315987, 0.019996531307697296, 0.04498809948563576, 0.00460875453427434, 0.010374178178608418, 0.04809844121336937, 0.02957630716264248, -0.0593995675444603, 0.01917482353746891, 0.05448799952864647, -0.03713887557387352, 0.05154403671622276, 0.01778552494943142, -0.04601633548736572, 0.027738720178604126, -0.0040163882076740265, 0.02201458066701889, 0.03593016788363457, 0.005724857095628977, 0.042098548263311386, -0.014264962635934353, 0.0167975015938282, 0.02140692062675953, 0.07066132128238678, -0.0063021122477948666, 0.03662480041384697, -0.017273487523198128, 0.027967551723122597, 0.03672686219215393, -0.002473206026479602, 0.021333210170269012, 0.02261674962937832, 0.042712386697530746, -0.0038860347121953964, -0.000346175889717415, -0.012652527540922165, 0.000005650203547702404, 0.011485395021736622, 0.015296388417482376, -0.030895346775650978, -0.02934899739921093, -0.01604725979268551, 0.025668464601039886, -0.005917657166719437, 0.0335952527821064, -0.011657544411718845, 0.06701283901929855, 0.046995826065540314, 0.046380944550037384, -0.03708430379629135, 0.03347435221076012, -0.020613668486475945, 0.011410253122448921, 0.02360514923930168, 0.010492128320038319, -0.003859984688460827, -0.008741367608308792, 0.04329865425825119, 0.009151208214461803, 0.055147893726825714, 0.06371720135211945, -0.014515128917992115, 0.011834111995995045, -0.0015308554284274578, 0.026259051635861397, 0.027133768424391747, -0.014514653012156487, 0.01659204624593258, 0.01473335549235344, 0.009093615226447582, -0.02228991501033306, 0.054742418229579926, 0.03374836593866348, 0.0022657844237983227, -0.01164593081921339, -0.031552985310554504, -0.01339036226272583, -0.007287721615284681, 0.009623496793210506, -0.014852885156869888, -0.013394638895988464, 0.02806050516664982, -0.03684522211551666, 0.025079596787691116, -0.036146532744169235, -0.028954392299056053, -0.015709497034549713, -0.00022280194389168173, -0.055512934923172, 0.05780857428908348, 0.013863025233149529, 0.024009235203266144, 0.05153818055987358, 0.03802475705742836, 0.00019426779181230813, 0.05142899975180626, -0.002128640888258815, 0.04279589280486107, -0.006060001440346241, -0.02488180622458458, 0.0008718188037164509, -0.05408266559243202, 0.025874381884932518, -0.06236249953508377, 0.0073778023943305016, 0.013599308207631111, 0.010266941040754318, 0.008457517251372337, 0.06214345619082451, -0.012341322377324104, -0.034476589411497116, -0.008493264205753803, -0.031791627407073975, -0.0013858325546607375, 0.010142138227820396, -0.001297435606829822, -0.03525201976299286, -0.01663920097053051, -0.008805833756923676, 0.0006001238944008946, -0.011954800225794315, 0.003975857049226761, 0.07522619515657425, 0.04382559657096863, 0.003558502299711108, 0.03247227147221565, 0.06059003248810768, -0.016978701576590538, -0.019954653456807137, 0.0230729877948761, 0.0407201386988163, 0.02502571791410446, -0.016392938792705536, 0.04054928198456764, -0.01003484707325697, 0.015185350552201271, -0.014785362407565117, -0.040022920817136765, 0.02275114879012108, 0.019122852012515068, 0.049139026552438736, 0.05161834880709648, 0.004453555215150118, -0.03859094902873039, -0.006563298404216766, 0.008188088424503803, -0.004431529901921749, 0.014179615303874016, 0.02353072166442871, -0.0008504660218022764, -0.00253277737647295, 0.035870976746082306, -0.046602826565504074, -0.018204491585493088, 0.003094445914030075, 0.012100820429623127, 0.04979697987437248, 0.03180830180644989, 0.010362721048295498, -0.06526205688714981, -0.02729777805507183, 0.0003215807373635471, -0.04499434679746628, 0.029180599376559258, 0.0027415866497904062, -0.028264334425330162, -0.02748536877334118, -0.010138957761228085, 0.00537503557279706, 0.021907519549131393, 0.02562970668077469, -0.00714322691783309, 0.019698485732078552, -0.003209211863577366, -0.030483145266771317, -0.08959661424160004, -0.00013364884944166988, -0.022001640871167183, -0.018733719363808632, -0.02435433119535446, 0.004430023487657309, 0.03949114307761192, -0.027334872633218765, 0.018787769600749016, -0.01894993521273136, 0.0009338154923170805, 0.024906566366553307, -0.011521768756210804, 0.01921074092388153, 0.052297309041023254, -0.025213800370693207, -0.015431399457156658, -0.02201130799949169, -0.011343157850205898, 0.0073084160685539246, -0.011570483446121216, -0.036286450922489166, 0.02008497528731823, 0.0016108902636915445, -0.026228604838252068, -0.008060079999268055, 0.03854920715093613, 0.012052878737449646, -0.00004425301813171245, -0.04317750409245491, -0.04180258885025978 ]
Llama 2 on Amazon SageMaker a Benchmark
philschmid
September 26, 2023
llama-sagemaker-benchmark
guide, inference, llm, aws
https://huggingface.co/blog/llama-sagemaker-benchmark
Conclusions In this benchmark, we tested 60 configurations of Llama 2 on Amazon SageMaker. For cost-effective deployments, we found 13B Llama 2 with GPTQ on g5.2xlarge delivers 71 tokens/sec at an hourly cost of $1.55. For max throughput, 13B Llama 2 reached 296 tokens/sec on ml.g5.12xlarge at $2.21 per 1M tokens. And for minimum latency, 7B Llama 2 achieved 16ms per token on ml.g5.12xlarge. We hope the benchmark will help companies deploy Llama 2 optimally based on their needs. If you want to get started deploying Llama 2 on Amazon SageMaker, check out Introducing the Hugging Face LLM Inference Container for Amazon SageMaker and Deploy Llama 2 7B/13B/70B on Amazon SageMaker blog posts. --- Thanks for reading! If you have any questions, feel free to contact me on Twitter or LinkedIn.
[ -0.025368349626660347, 0.04902283474802971, 0.02016555145382881, 0.02632533200085163, 0.008580772206187248, 0.011663313023746014, 0.05565078929066658, 0.030170494690537453, 0.04007530212402344, 0.001098264125175774, 0.04982689768075943, 0.054300036281347275, 0.019957685843110085, 0.09357154369354248, 0.04509856924414635, -0.03392341732978821, -0.015161887742578983, 0.015617169439792633, 0.02568715438246727, -0.045293040573596954, 0.012693510390818119, 0.01137679722160101, -0.0015675676986575127, -0.027859801426529884, -0.036472052335739136, 0.03310808166861534, -0.06305886805057526, -0.004837861750274897, -0.03602861613035202, 0.02188878506422043, -0.04653359577059746, 0.019910868257284164, 0.01717325672507286, 0.03225071728229523, 0.09176833927631378, -0.06452284008264542, -0.13864262402057648, 0.06578666716814041, 0.027021249756217003, -0.007252476643770933, 0.0007550104637630284, 0.0013779810396954417, -0.08587127178907394, 0.04787542298436165, -0.042959365993738174, 0.017050087451934814, -0.006270983722060919, 0.026135405525565147, 0.01010184083133936, 0.0025392465759068727, -0.11975441873073578, 0.04094827547669411, 0.004540901631116867, -0.03687717393040657, 0.0659000352025032, 0.025614608079195023, -0.011608664877712727, -0.012471797876060009, 0.005827663466334343, -0.007114240434020758, 0.005837191361933947, -0.10680064558982849, 0.05004451051354408, -0.039928171783685684, 0.01783693954348564, 0.007279287092387676, 0.024881109595298767, 0.007624754216521978, -0.04208722338080406, -0.016111040487885475, -0.008935173973441124, 0.013281910680234432, -0.026570631191134453, -0.010173346847295761, -0.001905702636577189, -0.03344956412911415, -0.000644780055154115, -0.010806305333971977, 0.028935132548213005, 0.0690336599946022, -0.06799253821372986, 0.030731389299035072, -0.02089129574596882, -0.014416988007724285, -0.0022348889615386724, 0.084684818983078, 0.033313147723674774, -0.06649411469697952, -0.05794907733798027, 0.030482826754450798, -0.05267178267240524, -0.047778286039829254, -0.017565881833434105, 0.03163011744618416, 0.07026933133602142, 0.01660577580332756, -0.009543308988213539, -0.03474205732345581, -0.04196541756391525, -0.0211460180580616, 0.0297709833830595, -0.05900624021887779, 0.04169219359755516, -0.017966654151678085, -0.031595710664987564, 0.08091732859611511, -0.07464036345481873, -0.13016439974308014, 0.015073376707732677, 0.01883830688893795, -0.00907212495803833, -0.028164902701973915, 0.04960057511925697, 0.03807508572936058, -0.11718253046274185, 0.05088024213910103, 0.0001767806534189731, -0.017637966200709343, -0.006648411508649588, 0.05860420688986778, 0.036307044327259064, 0.08305814862251282, 0.05678326636552811, -0.07859862595796585, 0.02186840958893299, 0.027265457436442375, 0.03568617254495621, 0.004477615933865309, 0.011813664808869362, 0.0413985550403595, 0.019939426332712173, -0.08767590671777725, 0.026746150106191635, -0.03972351551055908, 0.02377862110733986, -0.046630483120679855, 0.0024147003423422575, -0.0667245015501976, 0.009247939102351665, -0.0007964152027852833, -0.027526168152689934, 0.07301221042871475, 0.0554327517747879, -0.03973323106765747, 0.06074148043990135, 0.05204010382294655, -0.042679477483034134, -0.04535107687115669, -0.058612994849681854, 0.0004373551346361637, -0.13995395600795746, 0.021113449707627296, -0.092725470662117, -0.016941752284765244, 0.03636350855231285, 0.01643487997353077, 0.006762819364666939, -0.033869437873363495, -0.10131237655878067, -0.02882610447704792, -0.0032065147534012794, -0.04133337736129761, -0.01493510976433754, -0.034820616245269775, 0.019892647862434387, 0.027921169996261597, 0.0461379699409008, -0.016820693388581276, -0.041268136352300644, 0.01765715517103672, 0.04002469405531883, 0.021249966695904732, 0.04123087227344513, -0.005704748444259167, 0.014904175885021687, 0.03222208097577095, 0.017390241846442223, 0.07816525548696518, 0.0480894111096859, -0.021819397807121277, -0.02066861465573311, 0.019972063601017, -0.0029162399005144835, 0.04290986433625221, 0.017847277224063873, -0.11526845395565033, -0.030143139883875847, 0.01162716280668974, -0.013506020419299603, -0.09083118289709091, -0.04034092649817467, 0.02456568367779255, 0.046055909246206284, -0.0016277157701551914, -0.023227287456393242, -0.02634935826063156, 0.03488337993621826, 0.09326544404029846, 0.1045890599489212, 0.02949390932917595, 0.0260605551302433, 0.11213027685880661, -0.00040899464511312544, 0.018291570246219635, -0.06951317191123962, -0.009963305667042732, -0.038544684648513794, -0.020610490813851357, -0.006969570182263851, 0.03205006197094917, -0.0011208835057914257, -0.07986462861299515, -0.029048392549157143, -0.0024900147691369057, 0.02570958249270916, -0.008907860144972801, 0.011194294318556786, 0.0072268228977918625, 0.08782550692558289, 0.031413741409778595, 0.12093254923820496, -0.07852698117494583, 0.01578318513929844, -0.07884547114372253, -0.0058495779521763325, 0.010694432072341442, 0.029033394530415535, 0.018427779898047447, 0.055412955582141876, -0.028072362765669823, -0.03874005004763603, -0.12896773219108582, -0.039246201515197754, 0.017930082976818085, 0.023703841492533684, -0.040169306099414825, -0.01475546695291996, -0.06151404231786728, 0.06790190935134888, 0.056484710425138474, 0.061128199100494385, 0.03233524411916733, 0.027025064453482628, 0.05608993396162987, 0.004770742729306221, -0.022535070776939392, -0.006190902087837458, -0.04240274801850319, -0.007610487286001444, -0.004715805407613516, -0.06817885488271713, 0.0010518560884520411, 0.05986538901925087, 0.03569381311535835, -0.0004254269297234714, -0.017043722793459892, -0.06362028419971466, -0.019200220704078674, -0.04335159435868263, 0.020478231832385063, 0.021445810794830322, 0.004441757686436176, -0.012386168353259563, 0.020062679424881935, -0.010821586474776268, -0.02855680324137211, -0.02125495858490467, -0.028629295527935028, -0.07478267699480057, -0.05044803023338318, 0.05137987434864044, 0.0019536083564162254, 0.007378882262855768, -0.004647564608603716, 0.00949329324066639, -0.036051150411367416, 0.029775772243738174, -0.015567581169307232, -0.030552560463547707, -0.021468879655003548, 0.048561252653598785, -0.03900386765599251, 0.02654808945953846, 0.037221379578113556, -0.008361132815480232, -0.025894084945321083, 0.006893178913742304, -0.027703892439603806, -0.028101356700062752, 0.01127434428781271, 0.004253741819411516, 0.016334732994437218, 0.03459836542606354, 0.014542573131620884, -0.041234083473682404, -0.05618639662861824, -0.026078779250383377, -0.012475970201194286, -0.0001927735429489985, 0.0749247670173645, -0.022525934502482414, -0.001364577328786254, -0.01462317444384098, 0.023810721933841705, -0.010328761301934719, -0.027985500171780586, 0.007590839639306068, 0.03919064998626709, -0.06742911785840988, -0.02165358141064644, -0.042607199400663376, 0.008969536051154137, -0.037702739238739014, -0.020649192854762077, 0.05440199375152588, -0.034845639020204544, -0.02111889235675335, 0.014985732734203339, 0.036288920789957047, 0.02335238642990589, -0.003059866838157177, -0.03708300366997719, 0.01577332802116871, 0.026290200650691986, -0.013163549825549126, -0.0015804339200258255, 0.018572378903627396, -0.00015049766807351261, -0.029402699321508408, 0.006483204662799835, 0.00023437506752088666, -0.030569080263376236, -0.036913126707077026, -0.012968316674232483, 0.013949010521173477, -0.04617433622479439, 0.028316400945186615, -0.0036122447345405817, 0.0008235639543272555, -0.018192196264863014, -0.007394208572804928, -0.0004560387460514903, -0.056338101625442505, -0.013527830131351948, -0.022437477484345436, 0.02933046966791153, 0.0651656910777092, 0.019017694517970085, 0.026652246713638306, -0.011102862656116486, 0.0488053560256958, -0.036532022058963776, 0.03673176467418671, 0.009419904090464115, 0.02664296142756939, -0.020025700330734253, 0.04628060385584831, 0.004883978050202131, -0.021779367700219154, 0.04027113318443298, 0.01740332692861557, 0.011944783851504326, 0.030125822871923447, 0.0004944972461089492, -0.013699306175112724, 0.004299310501664877, 0.03576936200261116, 0.026397567242383957, -0.033436451107263565, 0.019047806039452553, -0.0027100914157927036, 0.006499124690890312, -0.019553393125534058, 0.0069577330723404884, 0.039320409297943115, -0.012790579348802567, 0.020062509924173355, 0.019680673256516457, -0.027031047269701958, 0.031075026839971542, -0.03212883695960045, 0.00023744335339870304, -0.00018648519471753389, -0.0206599161028862, -0.031462572515010834, 0.0003127331438008696, 0.03505943715572357, 0.02649366855621338, 0.02271098829805851, -0.033443428575992584, 0.0009087996440939605, -0.0137352105230093, -0.0017181223956868052, 0.0025102945510298014, -0.024978406727313995, -0.02784692868590355, 0.01247042790055275, 0.012926141731441021, -0.0014739661710336804, 0.018592366948723793, -0.009925143793225288, 0.005148920230567455, 0.025276610627770424, -0.05157168582081795, 0.006993842776864767, 0.008646691218018532, -0.05109832435846329, 0.05089951306581497, 0.022078407928347588, 0.012768419459462166, 0.0317765511572361, -0.02877669781446457, -0.0459849089384079, 0.028016071766614914, 0.016415227204561234, -0.02677651308476925, 0.025283200666308403, 0.051517780870199203, 0.057691220194101334, 0.0010351829696446657, 0.02958005666732788, 0.017511775717139244, 0.02532544545829296, 0.013019401580095291, 0.027775660157203674, 0.010974286124110222, 0.01181946974247694, 0.035471100360155106, -0.022062549367547035, -0.009948261082172394, -0.01915731467306614, -0.012464546598494053, 0.03885086625814438, -0.020382272079586983, -0.001124153146520257, -0.007330314256250858, -0.009929081425070763, -0.00649215979501605, -0.024239318445324898, -0.02046954818069935, -0.017644431442022324, -0.01307480689138174, 0.0011648476356640458, 0.015457021072506905, -0.04003280773758888, 0.00266459584236145, 0.002915669698268175, 0.000926157517824322, 0.02302454225718975, 0.02767939306795597, 0.01859099231660366, -0.007080781273543835, -0.003169454401358962, 0.016839876770973206, 0.006141020450741053, -0.018178790807724, -0.024585742503404617, 0.03857121616601944, 0.014529656618833542, -0.05434861779212952, 0.015057611279189587, 0.012355349957942963, 0.017812620848417282, 0.007151661440730095, -0.023595230653882027, -0.0024995419662445784, 0.02527175471186638, -0.002984648570418358, -0.030931241810321808, 0.018504830077290535, -0.01791345328092575, -0.033981893211603165, 0.04292546957731247, 0.00047219483531080186, -0.020666996017098427, 0.017963450402021408, 0.027773480862379074, 0.010355268605053425, 0.016046704724431038, -0.0029480597004294395, 0.011636186391115189, 0.027721509337425232, 0.037968073040246964, 0.06795011460781097, 0.03246307000517845, -0.030963534489274025, 0.011685864999890327, 0.0049675568006932735, -0.029500268399715424, -0.04751669615507126, 0.01928901858627796, -0.03224603086709976, -0.01045267190784216, -0.003727931994944811, 0.037273552268743515, 0.08208877593278885, -0.03181803971529007, 0.031860679388046265, 0.0169286597520113, -0.026853304356336594, 0.024297773838043213, -0.06820487231016159, 0.0014345879899337888, -0.000267456955043599, 0.010862170718610287, 0.0510738343000412, 0.014375259168446064, -0.032244954258203506, 0.0018995442660525441, -0.002141488716006279, -0.05420617759227753, -0.025032244622707367, -0.0033555678091943264, 0.01802944578230381, 0.007370435167104006, -0.04701657220721245, 0.008551115170121193, 0.005653518717736006, -0.007865764200687408, -0.000019616687495727092, -0.04718555882573128, -0.031056178733706474, 0.04158682003617287, -0.023111099377274513, -0.043816909193992615, 0.07437469810247421, 0.055230993777513504, 0.015973126515746117, -0.008108536712825298, -0.009207981638610363, 0.01061774417757988, -0.06366497278213501, -0.011935685761272907, -0.003066370030865073, -0.00009066205529961735, 0.012587972916662693, -0.025963790714740753, 0.04625336453318596, -0.010192218236625195, -0.05316561460494995, -0.007491104770451784, 0.022283198311924934, -0.010231226682662964, -0.004555146675556898, -0.009282794781029224, -0.0024237644392997026, 0.01731140725314617, -0.002354013966396451, -0.020032107830047607, -0.028532370924949646, -0.0386175774037838, -0.020471947267651558, -0.07275860011577606, 0.07392127811908722, 0.015803655609488487, -0.010751685127615929, -0.026252690702676773, -0.011695696972310543, 0.0015245784306898713, 0.0015069288201630116, 0.018055574968457222, 0.01976877823472023, 0.03684224560856819, 0.0029799125622957945, 0.025083178654313087, 0.02629462070763111, 0.0114716412499547, -0.02447550930082798, 0.017621619626879692, -0.03301018103957176, 0.01531813945621252, 0.04848797246813774, -0.03733598068356514, 0.025113578885793686, 0.009196138940751553, -0.07172447443008423, 0.024608202278614044, 0.033346135169267654, -0.01737290807068348, -0.022616073489189148, -0.006766853854060173, -0.00011386079131625593, 0.003521019360050559, 0.0029164371080696583, -0.04621710628271103, 0.03372778370976448, -0.006177830044180155, 0.039891891181468964, -0.0026293285191059113, 0.03653799369931221, 0.06210005283355713, 0.025797013193368912, -0.015725601464509964, -0.0005247428198345006, 0.029782269150018692, 0.002183380303904414, 0.06730655580759048, 0.041045453399419785, -0.04807770252227783, -0.007915239781141281, -0.035676680505275726, 0.00359534053131938, -0.052243009209632874, -0.009996193461120129, 0.028731726109981537, -0.005247852299362421, -0.0072999573312699795, -0.037435464560985565, 0.05576720088720322, 0.02216806262731552, 0.03302627056837082, 0.005103052128106356, 0.05132891237735748, -0.04933886229991913, 0.007010536268353462, -0.041931312531232834, 0.007848197594285011, -0.02158541977405548, -0.013744883239269257, 0.016134293749928474, 0.014275193214416504, 0.050018392503261566, -0.009106865152716637, -0.012957262806594372, -0.052942708134651184, 0.01069906447082758, 0.01600569672882557, 0.014044106006622314, 0.019397664815187454, 0.014510361477732658, -0.01305045373737812, -0.01843995228409767, 0.025152036920189857, 0.010040761902928352, -0.001783863641321659, -0.021875523030757904, 0.02857539802789688, -0.014357172884047031, 0.03719699755311012, 0.029395190998911858, 0.006816118489950895, -0.08913011848926544, -0.025266248732805252, 0.02021178789436817, -0.03446028009057045, -0.002933963667601347, -0.0828089490532875, -0.023992035537958145, 0.054568007588386536, 0.03209397569298744, -0.04576475918292999, 0.02413184940814972, -0.032749053090810776, 0.024869952350854874, 0.05179071053862572, -0.006364364642649889, 0.030835850164294243, 0.010402649641036987, -0.010387742891907692, 0.02989042177796364, -0.026365552097558975, -0.0367475263774395, 0.05402694642543793, -0.017831774428486824, 0.04467812180519104, -0.0018098304281011224, -0.026008330285549164, 0.0067743174731731415, 0.04759324714541435, 0.03299534693360329, 0.04756765440106392, 0.04900647699832916, -0.010849357582628727, -0.007793860975652933, 0.021997720003128052, -0.04708809033036232, 0.056242674589157104, 0.005095925647765398, -0.01081041619181633, -0.0032866857945919037, 0.0008867568103596568, 0.06110253930091858, 0.0036434391513466835, 0.0015492738457396626, 0.04438694566488266, -0.00486634811386466, 0.026481395587325096, 0.01448421087116003, 0.01920267753303051, -0.016376584768295288, 0.018504979088902473, 0.02916470728814602, -0.0394534170627594, 0.0011986125027760863, -0.01929977536201477, 0.011482219211757183, -0.0375751331448555, 0.0015301762614399195, 0.0004254660161677748, -0.007775425910949707, -0.034297000616788864, 0.00047256198013201356, 0.018337255343794823, 0.03816783055663109, -0.04702332988381386, -0.004851995501667261, -0.03812577202916145, -0.02360549010336399, 0.006026002578437328, -0.03677351772785187, 0.05941285192966461, 0.02869589254260063, 0.05143826827406883, 0.0033027196768671274, -0.06464444100856781, 0.0257955901324749, 0.01882537081837654, -0.00270017609000206, 0.03171395882964134, -0.020240232348442078, -0.04745952785015106, -0.04331604391336441, -0.0010802347678691149, 0.02828739583492279, -0.014324672520160675, 0.06398026645183563, -0.009962731972336769, -0.0038729447405785322, 0.006779155228286982, 0.009206396527588367, 0.05800090730190277, 0.007003565784543753, 0.05900556221604347, 0.017846710979938507, 0.032001495361328125, 0.010686828754842281, -0.04752830043435097, -0.05357225611805916, 0.009920509532094002, 0.02986711822450161, -0.01770862191915512, 0.025890838354825974, 0.02503693662583828, 0.0030119679868221283, -0.05112852528691292, 0.007397816516458988, 0.000676568248309195, -0.0067624603398144245, -0.057736676186323166, -0.020405523478984833, 0.028262440115213394, -0.009010208770632744, -0.04263131693005562, -0.031417116522789, -0.006069740746170282, -0.04199090972542763, 0.01429824996739626, -0.0214525293558836, -0.027233095839619637, -0.019445935264229774, -0.0170813649892807, -0.013738100416958332, 0.04038292169570923, -0.010737860575318336, 0.053278762847185135, 0.009905358776450157, -0.023442929610610008, 0.02642817236483097 ]
Non-engineers guide: Train a LLaMA 2 chatbot
2legit2overfit
September 28, 2023
Llama2-for-non-engineers
guide, community, nlp
https://huggingface.co/blog/Llama2-for-non-engineers
Step 1: Create a new AutoTrain Space 1.1 Go to huggingface.co/spaces and select โ€œCreate new Spaceโ€. 1.2 Give your Space a name and select a preferred usage license if you plan to make your model or Space public. 1.3 In order to deploy the AutoTrain app from the Docker Template in your deployed space select Docker > AutoTrain. 1.4 Select your โ€œSpace hardwareโ€ for running the app. (Note: For the AutoTrain app the free CPU basic option will suffice, the model training later on will be done using separate compute which we can choose later) 1.5 Add your โ€œHF_TOKENโ€ under โ€œSpace secretsโ€ in order to give this Space access to your Hub account. Without this the Space wonโ€™t be able to train or save a new model to your account. (Note: Your HF_TOKEN can be found in your Hugging Face Profile under Settings > Access Tokens, make sure the token is selected as โ€œWriteโ€) 1.6 Select whether you want to make the โ€œPrivateโ€ or โ€œPublicโ€, for the AutoTrain Space itself itโ€™s recommended to keep this Private, but you can always publicly share your model or Chat App later on. 1.7 Hit โ€œCreate Spaceโ€ et voilร ! The new Space will take a couple of minutes to build after which you can open the Space and start using AutoTrain.
[ -0.0033171565737575293, 0.027800342068076134, 0.04808768257498741, -0.026001252233982086, 0.06109384819865227, 0.058882519602775574, 0.08344139158725739, 0.025487136095762253, -0.03715191408991814, -0.03741559386253357, -0.10185779631137848, 0.06302265077829361, -0.03034042939543724, 0.020157596096396446, -0.013986105099320412, -0.09791592508554459, 0.03506067395210266, -0.010337917134165764, -0.037885550409555435, 0.07803072035312653, -0.005060737486928701, -0.050294212996959686, 0.03656426817178726, 0.004259004257619381, -0.0242162998765707, -0.004878954961895943, 0.04415126517415047, 0.07480820268392563, 0.0351802259683609, 0.05573689565062523, -0.0576147623360157, -0.018960626795887947, 0.021174481138586998, -0.04450102522969246, 0.0708424299955368, 0.030854221433401108, -0.06148289144039154, 0.03562329709529877, 0.07627453655004501, -0.018786227330565453, -0.009745249524712563, -0.02558436058461666, -0.03517111390829086, 0.05389000102877617, -0.016182133927941322, -0.018211903050541878, -0.14615671336650848, 0.034373387694358826, 0.013397663831710815, -0.005050252191722393, -0.06613823026418686, -0.005283221136778593, -0.020657779648900032, -0.005107147619128227, 0.05377907305955887, 0.02261163853108883, -0.0666232779622078, -0.06780692934989929, -0.01534217782318592, -0.03356502205133438, 0.07122798264026642, 0.00981843564659357, 0.0286643635481596, 0.061661433428525925, 0.00711654732003808, -0.014566201716661453, -0.038621388375759125, -0.04886490851640701, -0.06237061694264412, -0.06159529834985733, 0.004006851930171251, -0.033036548644304276, -0.02621537260711193, -0.07843326777219772, -0.016964146867394447, -0.008490560576319695, -0.001963965827599168, 0.03748280927538872, 0.03954395651817322, 0.023535985499620438, 0.07008135318756104, 0.0408857986330986, -0.034576188772916794, -0.00041063452954404056, -0.000663354410789907, 0.03276277333498001, -0.078122079372406, -0.018599310889840126, -0.06020360067486763, 0.05504729226231575, -0.014868287369608879, -0.07942314445972443, -0.03605172038078308, 0.04653213545680046, 0.056196730583906174, 0.015088503248989582, -0.02700546570122242, 0.04084846004843712, 0.008061801083385944, 0.021316684782505035, -0.051697131246328354, -0.035046570003032684, -0.026920700445771217, -0.06629952043294907, 0.004782200790941715, 0.016414927318692207, 0.0043593719601631165, -0.0735749751329422, -0.0064038862474262714, -0.06116452440619469, 0.04625478386878967, -0.05802004784345627, 0.0009135151049122214, 0.0679304301738739, -0.11976462602615356, 0.011277826502919197, -0.01723404787480831, -0.033019959926605225, 0.01613800600171089, -0.008926563896238804, 0.06352260708808899, 0.08935047686100006, 0.026301423087716103, 0.0014217057032510638, -0.02783234603703022, 0.054180700331926346, -0.023252712562680244, -0.00027857490931637585, 0.005154550541192293, -0.025466203689575195, 0.021510832011699677, -0.03704946115612984, 0.044497206807136536, 0.01227752584964037, 0.04323173314332962, 0.004100206773728132, 0.04544820636510849, -0.06354879587888718, 0.03157207742333412, 0.0076733483001589775, 0.018501995131373405, 0.06978555768728256, 0.06338974088430405, -0.02180386893451214, 0.03376854583621025, 0.03286471217870712, -0.05530179291963577, 0.010673617012798786, -0.024102438241243362, -0.009173539467155933, -0.06118759140372276, 0.04279845580458641, -0.0007294893730431795, -0.06390892714262009, 0.011420735158026218, 0.048853546380996704, -0.06886442750692368, 0.009264526888728142, -0.02413032203912735, 0.05519777908921242, -0.015418204478919506, -0.021470455452799797, -0.12229038774967194, 0.0055365050211548805, 0.011111673898994923, 0.024422263726592064, 0.01860264502465725, -0.030093690380454063, 0.03335202485322952, -0.05684898421168327, 0.044343527406454086, -0.06152822822332382, 0.04984331876039505, -0.011768082156777382, 0.0540940947830677, 0.05803682282567024, 0.01607016660273075, 0.08705112338066101, -0.0068834624253213406, 0.043392863124608994, -0.03166525065898895, 0.09816936403512955, 0.01112399436533451, 0.06489891558885574, 0.08067042380571365, -0.112280935049057, -0.0008246102370321751, -0.008833588100969791, -0.029975270852446556, 0.002140419092029333, -0.008753080852329731, -0.038763683289289474, 0.027698185294866562, -0.033620256930589676, 0.01477102842181921, -0.0632953867316246, -0.030890166759490967, 0.05978089198470116, 0.027243826538324356, 0.0731692984700203, 0.0011842328822240233, 0.02943800762295723, -0.01891142502427101, -0.03481920063495636, -0.03109685517847538, 0.03443159908056259, -0.033320117741823196, -0.07663594186306, -0.032915595918893814, 0.018711557611823082, -0.015563896857202053, -0.11767194420099258, 0.09327120333909988, -0.04563761129975319, 0.03707132861018181, -0.0637754574418068, -0.012235934846103191, -0.006652438081800938, -0.05329309031367302, 0.02343287132680416, 0.17433881759643555, -0.0010506657417863607, 0.029678825289011, 0.03104611113667488, -0.018923895433545113, 0.05989709869027138, 0.03461958467960358, 0.08249744027853012, 0.13816478848457336, -0.06502696126699448, -0.05124158412218094, -0.06736587733030319, -0.05353900417685509, 0.029318224638700485, -0.008958162739872932, 0.011745255440473557, 0.10240191966295242, -0.02331559546291828, 0.005433597601950169, -0.02633671648800373, -0.01026144064962864, -0.04243582859635353, 0.01334451511502266, -0.024254873394966125, 0.010660089552402496, 0.05654392018914223, 0.07074892520904541, 0.03682629391551018, -0.04680805280804634, -0.03584587201476097, -0.04133830592036247, 0.029345085844397545, -0.019927652552723885, -0.005133556202054024, 0.050869185477495193, -0.03181905299425125, 0.008183145895600319, 0.012238006107509136, -0.06280506402254105, 0.0331755056977272, 0.02082020416855812, 0.016750797629356384, -0.046497147530317307, -0.024155408143997192, -0.03787832334637642, -0.014256485737860203, 0.013478917069733143, 0.024741636589169502, 0.01342739537358284, -0.0030338973738253117, 0.0013717514229938388, -0.008547897450625896, -0.004472848493605852, -0.020257186144590378, -0.01558627188205719, 0.028384394943714142, 0.014862126670777798, -0.039246074855327606, 0.030763234943151474, -0.0037009557709097862, 0.00936741940677166, -0.024175278842449188, -0.009494498372077942, 0.05051715672016144, 0.02654152363538742, 0.01093487162142992, -0.025959866121411324, -0.03719322755932808, -0.06007935851812363, -0.001971937483176589, 0.03067457489669323, 0.03910936042666435, 0.03072967566549778, 0.01126287505030632, -0.025019776076078415, 0.010539760813117027, 0.013795651495456696, -0.02367876097559929, 0.023834431543946266, 0.0438275970518589, 0.026122979819774628, 0.021383583545684814, 0.014312409795820713, -0.017792267724871635, -0.011053032241761684, 0.00938847754150629, -0.005945085547864437, -0.031813375651836395, -0.08815865963697433, -0.012387632392346859, -0.026322033256292343, 0.012836466543376446, -0.01563756726682186, -0.004057598765939474, 0.024512285366654396, -0.01826327294111252, -0.014048096723854542, 0.02279908023774624, -0.012424412183463573, -0.00826799962669611, 0.022340768948197365, -0.018831104040145874, -0.004767286125570536, 0.007638140115886927, 0.0016782120801508427, -0.012320314534008503, 0.018803458660840988, 0.0004856140003539622, -0.05248323082923889, -0.0014810252469033003, 0.021985815837979317, 0.02015976421535015, 0.016788577660918236, -0.04182054474949837, 0.02306218259036541, 0.029598675668239594, 0.028254175558686256, -0.015195962972939014, 0.00821979995816946, -0.009496361948549747, -0.028785981237888336, -0.013750715181231499, -0.04026183485984802, -0.008737219497561455, -0.02549086883664131, -0.012051676400005817, 0.037946026772260666, -0.005635980051010847, -0.0013650184264406562, 0.008237709291279316, 0.025778742507100105, -0.007770633324980736, 0.024463346228003502, 0.0012879426358267665, 0.007468103896826506, 0.02170228585600853, 0.03524477779865265, -0.015262008644640446, 0.0013865274377167225, -0.006099208723753691, 0.021783476695418358, 0.029902201145887375, 0.009457635693252087, 0.03813808783888817, 0.008840546943247318, 0.05017992481589317, -0.018250135704874992, -0.019391562789678574, -0.08177008479833603, -0.014271540567278862, -0.04570838809013367, -0.027960773557424545, -0.014502276666462421, 0.015917250886559486, 0.01976941153407097, 0.018953483551740646, -0.003200629958882928, 0.048431895673274994, -0.016946222633123398, 0.024021608754992485, 0.014738725498318672, 0.012793991714715958, -0.0221305713057518, -0.00868378859013319, -0.030140288174152374, -0.06044497340917587, 0.07417719066143036, 0.0372391976416111, 0.011988549493253231, -0.005936751142144203, 0.008442804217338562, 0.007536465302109718, -0.006495904177427292, -0.028566140681505203, 0.03769008442759514, 0.0026418392080813646, 0.03296852484345436, 0.05588085949420929, -0.004336378071457148, -0.05660945922136307, 0.036447763442993164, -0.0048535834066569805, -0.0029084288980811834, -0.0363844633102417, -0.02373887225985527, 0.023305026814341545, -0.010106898844242096, 0.012286966666579247, 0.05128315091133118, -0.003998727072030306, 0.002260180190205574, 0.021751288324594498, 0.0314384400844574, 0.005232608411461115, -0.0557897575199604, -0.029612155631184578, 0.007442951668053865, 0.015340641140937805, 0.0017615224933251739, 0.0022529445122927427, 0.008379915729165077, -0.0029189458582550287, -0.009750557132065296, 0.028591955080628395, -0.03429912403225899, -0.00845293514430523, -0.01463090255856514, 0.03108152188360691, -0.011035013943910599, 0.017012223601341248, -0.021053113043308258, -0.03676028177142143, 0.009080148302018642, 0.022929100319743156, 0.03516148403286934, 0.001982450019568205, 0.005007721018046141, -0.01784501038491726, -0.03878265619277954, 0.008236720226705074, 0.02379966899752617, -0.012263749726116657, -0.036994341760873795, 0.0065581826493144035, -0.02165224775671959, 0.021540293470025063, 0.024409735575318336, 0.006336579564958811, 0.0061744400300085545, 0.0018645073287189007, 0.030736248940229416, -0.048849139362573624, 0.023514274507761, 0.053711339831352234, -0.07140297442674637, -0.00870230607688427, -0.024906985461711884, 0.030942736193537712, 0.006593938916921616, -0.011235826648771763, -0.04084867238998413, 0.029221730306744576, 0.0551847368478775, -0.012806704267859459, -0.014478080905973911, -0.014863753691315651, -0.036151252686977386, 0.00848260335624218, 0.003331867977976799, -0.012920311652123928, -0.001363746589049697, -0.010976225137710571, -0.017195744439959526, 0.0023646990302950144, 0.014723524451255798, -0.07354611158370972, -0.008989358320832253, -0.025567244738340378, -0.036865174770355225, 0.023622089996933937, -0.0073922122828662395, -0.026990437880158424, -0.021495895460247993, 0.07184428721666336, 0.06455932557582855, 0.05411563441157341, -0.01555525790899992, 0.007733780425041914, -0.03057604655623436, 0.0577021948993206, 0.006983567029237747, -0.016307156533002853, -0.00042630115058273077, 0.009643894620239735, 0.09227816015481949, 0.044236138463020325, 0.020801618695259094, 0.016514362767338753, -0.02135385014116764, -0.021088216453790665, 0.024397796019911766, -0.009016720578074455, 0.010626845993101597, -0.04624730721116066, 0.008133025839924812, -0.0015889195492491126, 0.007109154015779495, -0.018844280391931534, 0.026361240074038506, 0.07533373683691025, -0.04126063734292984, -0.04542011767625809, 0.03170621395111084, 0.024665288627147675, 0.024884654209017754, -0.0019456500886008143, 0.03253304213285446, 0.016525711864233017, -0.031518712639808655, -0.00941405352205038, -0.011206379160284996, -0.014448198489844799, 0.014484682120382786, 0.004726969171315432, -0.03734659403562546, 0.02344217337667942, 0.005664758384227753, 0.042841315269470215, -0.030663765966892242, -0.023914983496069908, -0.002122658072039485, -0.036504000425338745, 0.024101903662085533, -0.008736460469663143, 0.01083931140601635, 0.021208416670560837, -0.019988376647233963, 0.03298097476363182, 0.008850404061377048, 0.00515454076230526, 0.008450225926935673, 0.048056334257125854, 0.034339047968387604, 0.011682418175041676, 0.0010194317437708378, 0.0020952795166522264, 0.00504740746691823, -0.0015576010337099433, 0.02530464343726635, 0.005577758885920048, -0.04032854735851288, -0.030165689066052437, -0.05428818240761757, 0.04498527571558952, 0.07237140834331512, -0.03329747915267944, 0.002274954691529274, -0.0384490080177784, -0.01419105939567089, -0.009186860173940659, -0.004749996587634087, -0.013131125830113888, -0.0017018398502841592, -0.02355075627565384, -0.0004256973334122449, 0.02970036305487156, 0.015883756801486015, -0.0025463264901190996, 0.018159884959459305, -0.054217226803302765, -0.020791472867131233, 0.01656189002096653, -0.012787329033017159, 0.002276401733979583, -0.025785349309444427, -0.05154351890087128, -0.0020086595322936773, 0.030984316021203995, -0.0017469499725848436, 0.0063951644115149975, -0.004798246081918478, -0.0025789369828999043, -0.0341981016099453, 0.0022867589723318815, 0.030096372589468956, 0.027589518576860428, -0.003024118719622493, 0.05263092741370201, 0.012549158185720444, 0.05614197626709938, 0.03385297209024429, 0.008219960145652294, 0.00891044083982706, -0.000808887358289212, 0.05193813145160675, 0.01428739819675684, 0.025288915261626244, 0.004178979899734259, 0.009268525056540966, -0.023604093119502068, 0.0017648139037191868, 0.014016155153512955, -0.004973235074430704, 0.0457196943461895, 0.01328939851373434, -0.02585088089108467, 0.021038830280303955, 0.00013545005640480667, 0.03194957599043846, 0.045540206134319305, -0.004378126468509436, -0.042420241981744766, 0.02654491923749447, 0.01002532709389925, 0.029093477874994278, 0.019409026950597763, 0.036603089421987534, 0.018785974010825157, -0.04923693835735321, 0.03700222447514534, 0.012694933451712132, 0.003505633445456624, 0.009224162437021732, 0.038629915565252304, 0.03289931267499924, -0.0180863905698061, -0.028283990919589996, -0.018977120518684387, -0.03253290802240372, -0.015603688545525074, -0.05125107988715172, 0.020571695640683174, -0.01858709007501602, 0.018602194264531136, -0.024967500939965248, -0.0001602422125870362, -0.02578149549663067, 0.015145321376621723, -0.0060077328234910965, 0.030124196782708168, 0.018599817529320717, -0.011383717879652977, 0.010633973404765129, 0.02915217913687229, 0.01262491475790739, -0.026949316263198853, -0.005389541387557983, -0.0834299623966217, -0.027834219858050346, -0.009111639112234116, -0.0243898443877697, 0.04013435170054436, -0.0053291041404008865, -0.02583795227110386, -0.011871195398271084, 0.0662631094455719, 0.012797901406884193, 0.04685422405600548, -0.008262586779892445, 0.01131177507340908, -0.04833722859621048, -0.026091422885656357, -0.02356838621199131, -0.007282050792127848, 0.01802431419491768, -0.05863416939973831, 0.06455613672733307, 0.008888928219676018, 0.017910471186041832, 0.027137255296111107, 0.046308133751153946, -0.018111899495124817, -0.05359907075762749, -0.01667974330484867, 0.0027606403455138206, -0.035237789154052734, 0.06534811854362488, -0.0273330919444561, 0.006697418168187141, 0.024248233065009117, 0.0452166385948658, -0.025456726551055908, 0.002220607828348875, 0.0307343527674675, 0.06557866930961609, -0.002476749010384083, -0.04961889237165451, 0.04444114491343498, 0.05614301562309265, -0.006155479699373245, 0.024945275858044624, 0.021575601771473885, -0.012863731943070889, 0.0032793052960187197, -0.02535509318113327, 0.03336502984166145, -0.03169021010398865, 0.013743300922214985, -0.02951020933687687, -0.04349873214960098, 0.0043398719280958176, -0.044587392359972, -0.017592445015907288, -0.0040857731364667416, -0.0582309253513813, -0.047232821583747864, 0.004528295714408159, -0.002984310034662485, 0.010493561625480652, -0.0037971886340528727, 0.037257928401231766, 0.039070501923561096, 0.01916906237602234, 0.0025897263549268246, -0.04219689965248108, 0.019179243594408035, -0.018709108233451843, 0.01873832754790783, 0.026200907304883003, 0.01926066167652607, -0.013896254822611809, -0.015405157580971718, -0.0301703829318285, 0.009926777333021164, -0.04843458533287048, -0.011452208273112774, -0.0025379916187375784, -0.007513908203691244, -0.021659057587385178, -0.0006395673262886703, 0.010240654461085796, 0.00616418058052659, 0.028706926852464676, -0.02169598639011383, -0.031916357576847076, 0.0212252140045166, 0.029460540041327477, -0.04056268185377121, -0.0017648396315053105, -0.02187136933207512, 0.024969330057501793, 0.05315179377794266, -0.003178462153300643, 0.007437239866703749, 0.023427920415997505, -0.017904961481690407, 0.015609318390488625, 0.0013413057895377278, -0.03176566958427429, -0.03336166590452194, -0.012888153083622456, 0.0456378273665905, 0.003360731527209282, -0.011450421065092087, -0.01226747129112482, -0.02387624979019165, -0.043525535613298416, -0.021140320226550102, 0.00851415190845728, 0.02139260433614254, 0.012869409285485744, -0.006179862655699253, -0.007875521667301655, 0.033220503479242325, 0.045776233077049255, -0.03229845315217972, -0.09389735758304596, 0.0022555675823241472 ]
Non-engineers guide: Train a LLaMA 2 chatbot
2legit2overfit
September 28, 2023
Llama2-for-non-engineers
guide, community, nlp
https://huggingface.co/blog/Llama2-for-non-engineers
Introduction to Spaces Spaces from Hugging Face is a service that provides easy to use GUI for building and deploying web hosted ML demos and apps. The service allows you to quickly build ML demos using Gradio or Streamlit front ends, upload your own apps in a docker container, or even select a number of pre-configured ML applications to deploy instantly. Weโ€™ll be deploying two of the pre-configured docker application templates from Spaces, AutoTrain and ChatUI. You can read more about Spaces here.
[ -0.008472735062241554, -0.014407878741621971, 0.058993056416511536, 0.02534470334649086, 0.09564799815416336, 0.1205565333366394, 0.07067238539457321, 0.007126900367438793, -0.022554779425263405, -0.028739824891090393, -0.15000075101852417, 0.01985442079603672, -0.0015017566038295627, 0.022580081596970558, 0.01409079972654581, -0.05983257293701172, 0.026025546714663506, -0.03840826451778412, -0.0422191247344017, 0.04666852951049805, 0.004756387323141098, -0.021454600617289543, 0.04156887158751488, 0.0311879925429821, -0.053351204842329025, -0.03900711610913277, -0.012676572427153587, -0.010778003372251987, -0.0014979155967012048, 0.06516321748495102, -0.058507755398750305, -0.04625890776515007, -0.02168377675116062, -0.05875091999769211, 0.046637579798698425, -0.0006070781382732093, -0.040603309869766235, 0.0781598836183548, 0.018177887424826622, -0.002670038491487503, -0.004631470888853073, -0.004641747567802668, -0.06341253966093063, 0.03889411687850952, -0.03442420810461044, 0.003050731960684061, -0.14460216462612152, 0.013694875873625278, -0.012783442623913288, -0.00009485397458774969, -0.0665755495429039, -0.010686013847589493, -0.007662287913262844, -0.013385210186243057, 0.024512434378266335, 0.051338788121938705, 0.005690122023224831, -0.1034807488322258, -0.008237133733928204, 0.011995737440884113, 0.03396165370941162, 0.01939747855067253, 0.021996164694428444, 0.028009729459881783, -0.005981113761663437, -0.0033033413346856833, -0.008457277901470661, 0.009471333585679531, -0.02796158753335476, -0.029285939410328865, 0.02394690364599228, 0.06226247176527977, 0.00009955492714652792, -0.028084252029657364, 0.02760755643248558, 0.010405974462628365, -0.046209435909986496, 0.03796397149562836, -0.004835729021579027, 0.02683142013847828, 0.032177578657865524, 0.02088889107108116, 0.02318810671567917, 0.013380651362240314, -0.0029385078232735395, 0.04349871724843979, -0.04827948659658432, -0.031041055917739868, -0.051983948796987534, 0.035304613411426544, 0.01880578324198723, -0.1352657675743103, -0.006685336120426655, 0.0571906715631485, 0.11062104254961014, 0.05545556917786598, -0.05106804147362709, 0.03238515183329582, 0.013435150496661663, 0.012126742862164974, -0.03797120600938797, -0.04079073294997215, -0.028646888211369514, -0.08294520527124405, -0.01015198789536953, 0.019524896517395973, -0.04342937096953392, -0.06285049021244049, -0.02601756528019905, -0.008439915254712105, 0.018480930477380753, -0.054522667080163956, 0.035539835691452026, 0.10247873514890671, -0.09796485304832458, 0.0201302170753479, -0.03587006777524948, 0.0476488433778286, 0.029838236048817635, 0.001325132674537599, 0.01744285225868225, 0.0552082359790802, 0.01229439489543438, 0.005998742766678333, -0.0688292607665062, 0.0755208283662796, -0.022712575271725655, 0.0015253843739628792, 0.03581114113330841, -0.05079762637615204, 0.00717128487303853, -0.05469716340303421, 0.03557145968079567, 0.004787440877407789, 0.02930651232600212, 0.0010945997200906277, 0.04123511537909508, -0.09172550588846207, 0.03324836492538452, 0.001478287624195218, 0.03995474427938461, 0.09294487535953522, -0.0008366277907043695, -0.01082653272897005, 0.02730831317603588, -0.0011764609953388572, -0.021161234006285667, 0.0086406534537673, -0.056957587599754333, -0.016374897211790085, -0.10797119140625, 0.006374839693307877, 0.0019802527967840433, 0.005222033709287643, 0.00007827806985005736, 0.09708733856678009, -0.04492346942424774, 0.012969070114195347, 0.019745832309126854, 0.04464580863714218, -0.04602533578872681, 0.004299253690987825, -0.08270423114299774, -0.011176284402608871, 0.019817087799310684, 0.007031005807220936, -0.047792475670576096, -0.026278572157025337, 0.028327716514468193, -0.008502451702952385, -0.011885164305567741, -0.037275075912475586, 0.009447971358895302, 0.012851009145379066, 0.022235490381717682, -0.00593040743842721, 0.07336422801017761, 0.04789968207478523, 0.017264969646930695, -0.014260990545153618, -0.012467384338378906, 0.10722260177135468, 0.03976398706436157, 0.045336559414863586, 0.04493398219347, -0.08015788346529007, -0.0024231099523603916, -0.0037389243952929974, 0.047454945743083954, -0.0355360209941864, -0.04589457809925079, -0.009324735030531883, 0.014648279175162315, -0.035312678664922714, 0.028687691316008568, -0.026764055714011192, -0.06138412281870842, 0.10010471940040588, 0.04995545744895935, 0.05736576020717621, 0.014583636075258255, 0.057962533086538315, 0.005044914316385984, -0.03616730496287346, -0.012584864161908627, 0.03811851888895035, -0.04001385718584061, -0.060653962194919586, -0.045143596827983856, 0.006525644101202488, 0.03804951533675194, -0.09351453930139542, 0.09049364179372787, 0.0204782597720623, 0.04177791625261307, -0.03827383741736412, -0.043880559504032135, -0.035651158541440964, -0.04209166392683983, 0.03531269356608391, 0.1603391319513321, -0.06260719150304794, 0.014375589787960052, -0.004626455716788769, 0.008730904199182987, 0.054602283984422684, 0.1022796556353569, 0.07952975481748581, 0.1503908634185791, -0.07626190781593323, 0.003490464063361287, -0.032781194895505905, -0.03166681155562401, 0.07543660700321198, -0.051035746932029724, -0.03907382860779762, 0.08567541837692261, -0.05548115447163582, 0.05154389888048172, -0.03485766425728798, 0.045335233211517334, -0.06709082424640656, 0.0028793818783015013, -0.02785278484225273, 0.009032796137034893, -0.03723666071891785, 0.034666508436203, -0.03896496072411537, -0.02491696923971176, -0.014856618829071522, 0.006720982026308775, 0.023674461990594864, 0.0018083452014252543, -0.00673375790938735, -0.008205478079617023, -0.009178549982607365, -0.00548177445307374, -0.004058270249515772, -0.047837402671575546, 0.0419989638030529, 0.005107100121676922, 0.004919886589050293, -0.020422471687197685, -0.05762609839439392, -0.007331307046115398, -0.03464473783969879, 0.0209807101637125, 0.017995595932006836, -0.0034273772034794092, 0.0012553343549370766, 0.012813620269298553, -0.00005762407090514898, 0.0014261333271861076, -0.02079552784562111, 0.03795546293258667, 0.018441112712025642, -0.005557620897889137, -0.030485723167657852, -0.02337103709578514, -0.02983119525015354, -0.004409364890307188, -0.05280739441514015, 0.03400901332497597, 0.08306794613599777, 0.010404537431895733, 0.009717495180666447, -0.02566288597881794, -0.02528950572013855, -0.0590457022190094, 0.00411017844453454, 0.008859268389642239, 0.03295563533902168, 0.032136619091033936, 0.0041246311739087105, 0.026461530476808548, -0.022715816274285316, 0.015707626938819885, -0.029691040515899658, -0.02074592001736164, 0.05979985371232033, 0.0017326932866126299, 0.018064873293042183, -0.01602908968925476, -0.004921477288007736, 0.029858732596039772, 0.03565290942788124, 0.031390152871608734, 0.014657456427812576, -0.07129623740911484, -0.01681649126112461, -0.01410952303558588, 0.025886980816721916, -0.021974388509988785, -0.046994440257549286, 0.04718456789851189, -0.0387972928583622, -0.019121665507555008, 0.0733397975564003, -0.0302719809114933, -0.020895468071103096, 0.005999926943331957, 0.005775001831352711, 0.006323373876512051, 0.000553612713702023, -0.025844858959317207, 0.00832425057888031, 0.01154149416834116, -0.01605798676609993, -0.0745355486869812, 0.017831306904554367, 0.028179755434393883, 0.01838202215731144, -0.024488402530550957, -0.021504608914256096, 0.027756160125136375, 0.0060806781984865665, 0.027174605056643486, -0.02980923466384411, 0.043177902698516846, -0.022610215470194817, -0.0697273463010788, 0.006645025685429573, -0.029144546017050743, -0.03231600672006607, -0.042947281152009964, -0.02306140400469303, 0.032538797706365585, -0.009737322106957436, 0.03926825150847435, 0.013902763836085796, 0.05054051801562309, 0.00420061219483614, 0.011858966201543808, -0.03341594710946083, -0.006996450014412403, 0.04408346489071846, 0.042450401932001114, -0.02466869167983532, -0.012242281809449196, -0.0008586065960116684, 0.024320216849446297, 0.07185780256986618, 0.009976517409086227, 0.009567249566316605, 0.012284559197723866, 0.04875835031270981, -0.017924735322594643, 0.03697900101542473, -0.06814631819725037, 0.020773811265826225, -0.03374742344021797, -0.04403679817914963, -0.00001991260432987474, -0.0012143801432102919, 0.017400015145540237, -0.0019074842566624284, -0.00966467335820198, 0.03165927529335022, 0.013300025835633278, 0.015980929136276245, 0.032722827047109604, 0.0052102659828960896, 0.0004476949980016798, -0.03143993765115738, -0.007195768877863884, -0.06634450703859329, 0.05714983493089676, 0.014678457751870155, 0.001111422898247838, -0.014564772136509418, -0.0077309259213507175, -0.022710656747221947, 0.025058260187506676, -0.034558482468128204, 0.0014771787682548165, -0.05784910172224045, 0.025349631905555725, 0.0377071239054203, -0.02743576094508171, -0.06631355732679367, 0.011694539338350296, -0.02993730641901493, 0.018631579354405403, -0.013271067291498184, -0.0009156020823866129, 0.05244910344481468, 0.0102391941472888, -0.015502904541790485, 0.02077137678861618, -0.07408584654331207, 0.0003099521854892373, 0.021221350878477097, -0.010968135669827461, 0.009644510224461555, -0.032507870346307755, -0.03464201092720032, 0.017115836963057518, 0.04208451136946678, 0.011864759027957916, 0.004945967812091112, -0.007544244173914194, 0.02904825657606125, 0.012142879888415337, 0.04257996752858162, -0.0017214352265000343, 0.0008643353939987719, -0.02294442616403103, 0.0470750667154789, -0.007644814904779196, 0.0036137616261839867, 0.001603706507012248, -0.021974612027406693, 0.0166067723184824, 0.019508924335241318, 0.04273520037531853, -0.02810068242251873, 0.012816029600799084, -0.04438693821430206, -0.019426118582487106, -0.005761267151683569, 0.0690935030579567, 0.001879412098787725, -0.010591037571430206, -0.012851881794631481, -0.026396602392196655, 0.007869879715144634, -0.011974579654633999, 0.000060978807596256956, -0.011282027699053288, -0.00015339934907387942, 0.012623640708625317, -0.028251131996512413, 0.022737350314855576, 0.05513615161180496, -0.057536303997039795, 0.0023573085200041533, -0.024387527257204056, 0.032302696257829666, -0.0162619911134243, -0.030932379886507988, -0.017039194703102112, 0.03195275366306305, 0.06288240849971771, -0.0034268859308212996, -0.03156071528792381, 0.01390080526471138, 0.012795951217412949, 0.03829137608408928, 0.010146111249923706, 0.022144393995404243, -0.04107615724205971, 0.02033388428390026, -0.02104305848479271, -0.004874967969954014, 0.004602054134011269, -0.023529155179858208, 0.008293475024402142, 0.008466332219541073, -0.04777774587273598, 0.02289896458387375, 0.014299115166068077, -0.023746248334646225, -0.022899962961673737, 0.05022386461496353, 0.02743113413453102, 0.02581784315407276, -0.03646266087889671, 0.011784099042415619, -0.041294027119874954, 0.014220329001545906, -0.0019999095238745213, -0.041642073541879654, 0.019918743520975113, 0.0022841638419777155, 0.056950364261865616, 0.025898071005940437, 0.006554977502673864, 0.022768348455429077, -0.015337400138378143, -0.028606422245502472, 0.000010560613191046286, -0.014880002476274967, 0.030666423961520195, -0.027217404916882515, -0.010200241580605507, 0.002681538462638855, 0.029263611882925034, -0.04209408536553383, 0.0010290744248777628, 0.027750998735427856, -0.05826324224472046, -0.021351709961891174, 0.01928090862929821, 0.0058964514173567295, 0.004621815402060747, -0.04962926730513573, 0.00884187687188387, -0.034480173140764236, -0.022173136472702026, -0.03701034560799599, 0.01762283593416214, -0.025461843237280846, -0.02423936128616333, -0.030067233368754387, -0.017134036868810654, -0.0244342889636755, 0.021377021446824074, 0.01885005086660385, -0.05298545956611633, -0.02226923033595085, -0.010775315575301647, -0.02035239338874817, 0.002272046636790037, 0.000960243574809283, 0.0011610017390921712, 0.027608230710029602, -0.04725397750735283, -0.008319569751620293, 0.03934682533144951, 0.0084220664575696, 0.00882376916706562, 0.020341597497463226, 0.006955846678465605, 0.03782209753990173, 0.001108783413656056, 0.01946008950471878, 0.012805485166609287, -0.007502661552280188, 0.026754148304462433, -0.022081619128584862, -0.041766006499528885, -0.004683160223066807, 0.0036398745141923428, 0.03380706161260605, 0.06942962855100632, -0.0337759368121624, 0.01723717339336872, 0.004976897966116667, -0.020844390615820885, -0.019879259169101715, 0.006733230780810118, -0.017066746950149536, 0.020763471722602844, 0.026890501379966736, 0.014378827065229416, 0.03897120803594589, -0.024110926315188408, -0.015438109636306763, 0.033571477979421616, -0.039237864315509796, 0.011599806137382984, 0.004905159119516611, 0.02870474010705948, -0.013047163374722004, 0.00793082732707262, -0.014253087341785431, -0.0022924260701984167, -0.018991436809301376, -0.029282761737704277, 0.03126665577292442, -0.00441556004807353, -0.009311330504715443, 0.036434389650821686, -0.015681792050600052, 0.023323075845837593, 0.018521424382925034, 0.016424546018242836, 0.016727734357118607, 0.002035469515249133, 0.060512661933898926, 0.01380629651248455, 0.013792438432574272, 0.022192830219864845, 0.003524541622027755, 0.0751168355345726, 0.030239863321185112, 0.023339929059147835, 0.0242118239402771, -0.015056544914841652, -0.006089524831622839, -0.03794645518064499, -0.010561393573880196, -0.027279917150735855, 0.011128132231533527, 0.030363796278834343, 0.022642353549599648, 0.013790875673294067, 0.0018441429128870368, 0.08186428993940353, 0.018755806609988213, 0.02991521544754505, -0.001229000510647893, -0.002888740273192525, 0.005102802067995071, 0.022682219743728638, 0.02463245764374733, 0.04602448642253876, 0.016418468207120895, -0.043329641222953796, 0.04864976182579994, 0.021901672706007957, 0.034788522869348526, 0.0062662092968821526, 0.02637575753033161, 0.010842469520866871, -0.04949604719877243, 0.019452368840575218, -0.014408988878130913, -0.04133782163262367, -0.018246665596961975, -0.009655826725065708, 0.0012942659668624401, 0.007514527067542076, 0.016818862408399582, -0.014491729438304901, 0.01877620443701744, 0.010536777786910534, 0.014118298888206482, 0.01033534575253725, 0.003157152561470866, 0.01472722552716732, -0.03664515167474747, -0.027642009779810905, -0.007321819197386503, 0.012141360901296139, -0.025376230478286743, -0.03544076904654503, -0.04404186084866524, 0.01130572147667408, -0.02398368902504444, -0.016712423413991928, 0.038167305290699005, -0.002113236114382744, -0.012215937487781048, -0.029724709689617157, 0.09264342486858368, -0.01821613870561123, -0.01453949511051178, 0.011189867742359638, 0.012284930795431137, -0.054954227060079575, 0.02298278734087944, -0.0530138835310936, -0.04371898993849754, -0.009766124188899994, -0.030896686017513275, 0.030946549028158188, -0.013345666229724884, -0.0009094660636037588, -0.0016335146501660347, 0.05427674576640129, -0.02807552181184292, -0.03467321768403053, 0.007974552921950817, 0.007537978235632181, -0.03685552999377251, 0.04934632405638695, -0.037575215101242065, 0.008691743947565556, 0.025613538920879364, 0.002425377955660224, -0.027356211096048355, -0.012154058553278446, 0.02522469125688076, 0.04634610190987587, 0.010195624083280563, -0.07456482946872711, 0.004181656986474991, 0.039986640214920044, 0.02910452149808407, 0.040284935384988785, 0.01310909166932106, 0.01518946047872305, -0.0285037849098444, -0.010566042736172676, 0.02726779691874981, -0.017699208110570908, 0.006394647527486086, -0.05853590369224548, -0.035961832851171494, 0.015297815203666687, 0.004322335124015808, 0.011703098192811012, -0.017419230192899704, -0.048796992748975754, -0.018231021240353584, 0.006617543287575245, -0.008370565250515938, -0.055318716913461685, 0.012464821338653564, 0.027800407260656357, 0.047007277607917786, 0.01906069926917553, -0.005941641982644796, -0.01893695257604122, 0.0008362342487089336, 0.020786097273230553, 0.007850568741559982, 0.027209101244807243, -0.008269142359495163, 0.01409219391644001, -0.05693139508366585, 0.005235455464571714, 0.0034643830731511116, -0.03037455677986145, 0.018640026450157166, 0.030064988881349564, 0.010422433726489544, 0.009809834882616997, 0.0366041474044323, 0.0393759086728096, -0.03148771449923515, 0.0037608954589813948, -0.016340559348464012, -0.02181163989007473, 0.028869114816188812, -0.0068158539943397045, -0.035552240908145905, 0.020266223698854446, -0.015280580148100853, 0.0059868888929486275, 0.03426942601799965, -0.038773685693740845, 0.017788341268897057, -0.016087697818875313, -0.008522345684468746, 0.05074207857251167, -0.03855494037270546, -0.054534126073122025, -0.0041488599963486195, -0.029411157593131065, 0.040750131011009216, 0.02323230728507042, 0.0034637530334293842, -0.028626559302210808, 0.0022280202247202396, 0.001111160614527762, -0.015934059396386147, 0.006389386020600796, -0.04057745262980461, 0.0028483534697443247, 0.00488579785451293, -0.021396467462182045, 0.04645203799009323, 0.036965809762477875, -0.02620641328394413, -0.08364083617925644, -0.0026702771428972483 ]
Non-engineers guide: Train a LLaMA 2 chatbot
2legit2overfit
September 28, 2023
Llama2-for-non-engineers
guide, community, nlp
https://huggingface.co/blog/Llama2-for-non-engineers
Step 2: Launch a Model Training in AutoTrain 2.1 Once youโ€™re AutoTrain space has launched youโ€™ll see the GUI below. AutoTrain can be used for several different kinds of training including LLM fine-tuning, text classification, tabular data and diffusion models. As weโ€™re focusing on LLM training today select the โ€œLLMโ€ tab. 2.2 Choose the LLM you want to train from the โ€œModel Choiceโ€ field, you can select a model from the list or type the name of the model from the Hugging Face model card, in this example weโ€™ve used Metaโ€™s Llama 2 7b foundation model, learn more from the model card here. (Note: LLama 2 is gated model which requires you to request access from Meta before using, but there are plenty of others non-gated models you could choose like Falcon) 2.3 In โ€œBackendโ€ select the CPU or GPU you want to use for your training. For a 7b model an โ€œA10G Largeโ€ will be big enough. If you choose to train a larger model youโ€™ll need to make sure the model can fully fit in the memory of your selected GPU. (Note: If you want to train a larger model and need access to an A100 GPU please email api-enterprise@huggingface.co) 2.4 Of course to fine-tune a model youโ€™ll need to upload โ€œTraining Dataโ€. When you do, make sure the dataset is correctly formatted and in CSV file format. An example of the required format can be found here. If your dataset contains multiple columns, be sure to select the โ€œText Columnโ€ from your file that contains the training data. In this example weโ€™ll be using the Alpaca instruction tuning dataset, more information about this dataset is available here. You can also download it directly as CSV from here. 2.5 Optional: You can upload โ€œValidation Dataโ€ to test your newly trained model against, but this isnโ€™t required. 2.6 A number of advanced settings can be configured in AutoTrain to reduce the memory footprint of your model like changing precision (โ€œFP16โ€), quantization (โ€œInt4/8โ€) or whether to employ PEFT (Parameter Efficient Fine Tuning). Itโ€™s recommended to use these as is set by default as it will reduce the time and cost to train your model, and only has a small impact on model performance. 2.7 Similarly you can configure the training parameters in โ€œParameter Choiceโ€ but for now letโ€™s use the default settings. 2.8 Now everything is set up, select โ€œAdd Jobโ€ to add the model to your training queue then select โ€œStart Trainingโ€ (Note: If you want to train multiple models versions with different hyper-parameters you can add multiple jobs to run simultaneously) 2.9 After training has started youโ€™ll see that a new โ€œSpaceโ€ has been created in your Hub account. This Space is running the model training, once itโ€™s complete the new model will also be shown in your Hub account under โ€œModelsโ€. (Note: To view training progress you can view live logs in the Space) 2.10 Go grab a coffee, depending on the size of your model and training data this could take a few hours or even days. Once completed a new model will appear in your Hugging Face Hub account under โ€œModelsโ€.
[ 0.004747704602777958, -0.02687980979681015, 0.027618704363703728, 0.025048723444342613, 0.09272141754627228, 0.0462094284594059, 0.0240803062915802, 0.042559877038002014, -0.004991310648620129, -0.01288077887147665, -0.08323528617620468, 0.06491601467132568, -0.06339197605848312, 0.03502199053764343, 0.041812438517808914, -0.13090448081493378, 0.033898767083883286, 0.03192121163010597, -0.029445746913552284, 0.07996723055839539, 0.031223081052303314, -0.047760263085365295, 0.06602314114570618, 0.030193520709872246, -0.04484061896800995, -0.010373230092227459, 0.034754808992147446, 0.061116788536310196, 0.03254719078540802, 0.012372939847409725, -0.10629867017269135, -0.01620883122086525, -0.03480900451540947, -0.012714565731585026, 0.031642477959394455, 0.026768067851662636, -0.06704980880022049, 0.05397331714630127, 0.03457820788025856, -0.048027124255895615, -0.0296893622726202, -0.004407433792948723, -0.030180759727954865, 0.04301783815026283, -0.008996711112558842, -0.02039399743080139, -0.10843897610902786, -0.028119977563619614, 0.0006424980238080025, -0.021322261542081833, -0.04486847296357155, 0.06204664707183838, -0.0012982041807845235, -0.036862753331661224, 0.057916153222322464, -0.025514310225844383, -0.006403888575732708, -0.03966929391026497, -0.033272113651037216, 0.024178890511393547, 0.023435981944203377, 0.025086160749197006, 0.013983266428112984, -0.0010047565447166562, 0.04015291482210159, 0.008349084295332432, -0.0771598294377327, 0.0005943571450188756, -0.09208088368177414, -0.05067278444766998, -0.002414460526779294, -0.032398346811532974, 0.011798039078712463, -0.08633608371019363, -0.026479283347725868, -0.016704818233847618, -0.01493759360164404, 0.0053381905891001225, 0.003419480985030532, 0.035574473440647125, 0.043099820613861084, 0.070271797478199, -0.0156891867518425, 0.04629020020365715, 0.007017757277935743, 0.04317256063222885, -0.014269779436290264, -0.041874177753925323, 0.00029493006877601147, 0.03818640112876892, -0.07190556079149246, -0.0904245600104332, -0.022815437987446785, 0.022734196856617928, 0.05459705367684364, 0.003034254303202033, -0.025465749204158783, 0.038763485848903656, -0.027784837409853935, 0.020153770223259926, -0.010902385227382183, -0.04752185940742493, 0.0016565611585974693, -0.04573090746998787, -0.04071046784520149, 0.05713142082095146, -0.040220994502305984, -0.08157816529273987, -0.02944226935505867, -0.07185962051153183, 0.006931360345333815, -0.0689164325594902, 0.007775799836963415, 0.034040238708257675, -0.12651650607585907, -0.006941691972315311, 0.012585420161485672, -0.007867932319641113, 0.008261908777058125, 0.019291821867227554, -0.0026964733842760324, 0.09155376255512238, 0.09136632084846497, -0.06197637319564819, -0.03235196694731712, 0.09094475209712982, 0.014387520961463451, 0.008908485062420368, 0.060609541833400726, 0.01685241423547268, 0.05651266127824783, -0.0745554268360138, 0.04737945273518562, 0.002964962273836136, 0.046142902225255966, -0.010875072330236435, -0.010699464939534664, -0.09230747073888779, 0.06104767695069313, 0.009573626331984997, 0.0000162772284966195, 0.044148921966552734, 0.021023137494921684, -0.0684516429901123, 0.08884323388338089, 0.04005786031484604, -0.06392373889684677, 0.03670592978596687, -0.018576838076114655, 0.014838368631899357, -0.10714017599821091, 0.0906936526298523, -0.0006472117966040969, -0.05505862087011337, 0.07579611986875534, 0.05172424390912056, -0.060504116117954254, 0.0373307541012764, -0.09580755978822708, -0.003509797854349017, -0.02763291448354721, -0.005317706149071455, -0.08200443536043167, 0.01776951365172863, 0.027604447677731514, 0.026699725538492203, -0.0056764427572488785, 0.004748822655528784, 0.06627336144447327, -0.02642688900232315, 0.04259371757507324, -0.030541302636265755, 0.05007888749241829, -0.02562551386654377, 0.03224262595176697, 0.06441416591405869, 0.023281028494238853, 0.05895207077264786, -0.05738108605146408, 0.02161431312561035, -0.024375716224312782, 0.0558399073779583, -0.0008161466103047132, 0.03308151662349701, 0.045347992330789566, -0.07741184532642365, 0.022116612643003464, -0.015909673646092415, -0.027763500809669495, -0.026207096874713898, 0.028313646093010902, 0.04371139779686928, 0.07634566724300385, -0.018928704783320427, 0.014002521522343159, -0.07123173773288727, -0.04793628677725792, 0.10013897716999054, 0.056314170360565186, 0.028992287814617157, 0.032066795974969864, 0.02983924001455307, 0.04023732244968414, 0.003392935963347554, -0.014901108108460903, 0.02003735862672329, -0.01571214757859707, -0.06764759123325348, 0.016691138967871666, 0.017967548221349716, 0.011234530247747898, -0.10356160998344421, 0.031590916216373444, -0.024157455191016197, 0.03711521625518799, 0.0013816849095746875, 0.014454334042966366, 0.006732862908393145, -0.0025634863413870335, 0.0013482627691701055, 0.14987479150295258, -0.0194732453674078, 0.0046581062488257885, -0.017522957175970078, -0.04802243039011955, 0.02097783237695694, 0.07556973397731781, 0.08023842424154282, 0.070075623691082, -0.11615785956382751, 0.009211692959070206, -0.09967520833015442, -0.007193555124104023, 0.04422040656208992, -0.01151663064956665, -0.06380128115415573, 0.041678380221128464, -0.03140156343579292, 0.0501849502325058, 0.034242894500494, 0.05062725022435188, 0.014215142466127872, 0.010167703032493591, 0.01525845192372799, -0.03364204242825508, 0.0030467770993709564, 0.0405803844332695, 0.0176878459751606, -0.04079153388738632, -0.008426216430962086, -0.017129311338067055, 0.02308446727693081, 0.028162537142634392, 0.03703917935490608, -0.04731418564915657, -0.05356955528259277, -0.010987544432282448, -0.00672023743391037, -0.0507945641875267, 0.06239777430891991, 0.016504773870110512, 0.023387936875224113, -0.028063112869858742, 0.0011655018897727132, 0.0023337623570114374, -0.046667154878377914, 0.018810536712408066, 0.02700169011950493, -0.0016150358133018017, -0.03575724735856056, 0.012807312421500683, 0.008866180665791035, 0.010609274730086327, 0.0027459084521979094, 0.0012897704727947712, 0.04734622687101364, 0.051450420171022415, -0.03549370542168617, -0.01885058544576168, -0.02823382429778576, -0.0002665223437361419, -0.016017258167266846, 0.031723134219646454, 0.03765878453850746, 0.006618466693907976, -0.007095590699464083, 0.0017467221478000283, -0.043675124645233154, -0.03375890105962753, 0.03557054325938225, 0.04520341008901596, 0.0057626934722065926, 0.001066987868398428, -0.0007676766254007816, 0.003508584341034293, 0.017844226211309433, 0.0356060191988945, 0.016724372282624245, 0.02564339153468609, 0.011192168109118938, 0.016613489016890526, 0.007056472357362509, 0.019084740430116653, -0.008579215966165066, 0.0007355966954492033, 0.00021219352493062615, 0.01982809603214264, 0.010823789983987808, -0.0817309245467186, -0.029361436143517494, 0.011027004569768906, -0.04938085377216339, 0.017464065924286842, -0.02090330235660076, 0.04001728445291519, -0.0182704608887434, -0.005781096871942282, 0.0148114999756217, -0.0296902097761631, 0.007597394287586212, 0.02355700545012951, -0.007900812663137913, 0.024711737409234047, 0.030027305707335472, -0.014120491221547127, -0.03695356100797653, 0.012031763792037964, 0.008727549575269222, -0.028749307617545128, 0.016806168481707573, -0.01089471485465765, 0.05203792452812195, 0.015979615971446037, -0.010573100298643112, 0.002407653024420142, -0.0018435029778629541, 0.024324120953679085, -0.024645060300827026, 0.0038274757098406553, -0.03493278846144676, -0.020271603018045425, -0.0031295879743993282, -0.04220744967460632, -0.030264217406511307, 0.0152341453358531, 0.01229691319167614, 0.005817345809191465, 0.0009338358649984002, 0.029291680082678795, 0.005009397864341736, 0.02973894402384758, -0.0014658620348200202, 0.01617673598229885, 0.011464463546872139, -0.027732715010643005, -0.0017916812794283032, 0.012675296515226364, -0.022369522601366043, -0.02261281944811344, 0.004069579765200615, -0.0038264747709035873, 0.05030003935098648, -0.006124391220510006, 0.055124785751104355, 0.03240856155753136, 0.020695308223366737, -0.002818539272993803, -0.004861260764300823, -0.06692004948854446, 0.006179974414408207, -0.007983347401022911, -0.004638993181288242, -0.021215932443737984, 0.019136669114232063, 0.01686786115169525, -0.015339547768235207, -0.008314958773553371, 0.021916838362812996, -0.0007544991676695645, 0.04833969473838806, 0.01287298183888197, -0.0004478498303797096, -0.010809281840920448, -0.049271631985902786, -0.010704068467020988, -0.04213551804423332, 0.04723795875906944, 0.06429225206375122, 0.001055027823895216, -0.007434813305735588, 0.007712372113019228, -0.0279519222676754, 0.0019380943849682808, -0.020040934905409813, 0.03376708924770355, -0.06982086598873138, 0.025582943111658096, 0.04278577119112015, 0.006099533289670944, -0.044182781130075455, 0.016791006550192833, -0.010192074812948704, -0.0013813312398269773, -0.02764241211116314, -0.014310036785900593, 0.02359095588326454, 0.006800635252147913, 0.022358624264597893, 0.035712920129299164, -0.009362402372062206, 0.0208668801933527, 0.0061880736611783504, 0.0016284598968923092, 0.010726024396717548, -0.014333370141685009, -0.0281800739467144, 0.016013775020837784, 0.017485126852989197, -0.016970202326774597, -0.026500675827264786, 0.021322140470147133, -0.012845447286963463, 0.0014013845939189196, 0.01825789175927639, -0.045394688844680786, -0.008740121498703957, 0.010406270623207092, 0.018109403550624847, -0.04604724049568176, 0.00960510317236185, -0.029552755877375603, -0.07218634337186813, 0.04646395891904831, 0.01701393909752369, 0.03011506237089634, 0.03132735565304756, 0.026827029883861542, -0.05085306987166405, -0.08218038827180862, -0.031103402376174927, -0.000499216141179204, 0.0011041640536859632, -0.019312702119350433, -0.004886968061327934, -0.06117191165685654, 0.0034060704056173563, 0.028768301010131836, 0.022532839328050613, -0.033815592527389526, -0.01139280665665865, -0.008287686854600906, -0.01997407153248787, 0.043591152876615524, 0.008899428881704807, -0.014607108198106289, -0.004844434093683958, -0.017928507179021835, 0.023741494864225388, 0.003977905958890915, -0.018803004175424576, -0.04885239154100418, 0.014368458651006222, 0.023056069388985634, -0.01275231596082449, -0.011837909929454327, 0.023432567715644836, -0.019239185377955437, 0.030031241476535797, -0.008068103343248367, 0.0019584535621106625, -0.02991561032831669, 0.007407768629491329, 0.011326680891215801, -0.010451027192175388, -0.0211232490837574, -0.023070011287927628, -0.02259545959532261, 0.009237661957740784, -0.0016363529721274972, -0.001926165190525353, -0.012562146410346031, -0.03326835483312607, -0.011869069188833237, 0.05646098032593727, 0.0787234827876091, -0.00417293980717659, -0.02090667188167572, 0.008269250392913818, -0.036334384232759476, -0.045687463134527206, 0.025940673425793648, -0.00007326036575250328, -0.015972718596458435, 0.0017381811048835516, 0.05902370437979698, 0.05617905035614967, 0.014427637681365013, 0.0006603747024200857, -0.008639336563646793, -0.0183007400482893, 0.027546871453523636, -0.030027123168110847, -0.01807955652475357, -0.0009222549269907176, 0.03424803540110588, 0.03186943382024765, -0.002121860161423683, -0.02132631279528141, 0.02266579121351242, 0.05554226040840149, -0.05210183560848236, -0.03324700519442558, 0.025946438312530518, 0.004781304392963648, -0.037168312817811966, -0.040535490959882736, 0.011981475166976452, -0.008392922580242157, -0.013451416976749897, -0.0341358408331871, 0.02413303777575493, -0.009865379892289639, 0.036339130252599716, -0.00042180236778222024, -0.024734575301408768, 0.045806463807821274, 0.023158786818385124, 0.037950463593006134, -0.0013661585981026292, -0.0056859529577195644, -0.002269851742312312, -0.02845313772559166, 0.02067635767161846, -0.029581066220998764, 0.02944841794669628, 0.002769640414044261, -0.0025914607103914022, 0.04098165035247803, 0.0005259191966615617, -0.002805382013320923, -0.00041667779441922903, 0.042956653982400894, 0.019133614376187325, -0.004513122141361237, -0.019704565405845642, -0.01150940079241991, 0.02072128839790821, 0.0016678425017744303, -0.02351693995296955, -0.014586939476430416, -0.09840461611747742, -0.004871998447924852, -0.07228738069534302, 0.03497234359383583, 0.06911946088075638, -0.036847326904535294, 0.0011571698123589158, -0.008381246589124203, -0.002795163309201598, -0.0007375007262453437, 0.007055792957544327, 0.016087153926491737, -0.012145520187914371, 0.006385760381817818, -0.002391513902693987, 0.02764715813100338, 0.027453601360321045, -0.028677942231297493, 0.014296291396021843, -0.0525653176009655, 0.0033584577031433582, 0.06949242949485779, 0.001283740159124136, -0.01556584145873785, 0.012900818139314651, -0.03238740190863609, -0.004243611823767424, 0.017362644895911217, 0.029231468215584755, -0.01370955165475607, -0.020388968288898468, 0.012910773977637291, -0.0002664103521965444, -0.006184177007526159, 0.002449473598971963, 0.03509002923965454, -0.0001336047862423584, 0.02489047683775425, 0.0020710572134703398, 0.032400038093328476, 0.02594921365380287, 0.003254046430811286, -0.008204474113881588, -0.0068903216160833836, 0.05885402113199234, 0.08092215657234192, 0.010968992486596107, 0.0128200463950634, -0.019347725436091423, -0.013747763819992542, -0.023223256692290306, 0.017201313748955727, -0.014314783737063408, 0.00947519950568676, 0.05017498508095741, -0.00941148865967989, -0.010657235980033875, -0.008328872732818127, 0.08078988641500473, 0.07634354382753372, 0.005063191521912813, -0.021877672523260117, 0.02461066283285618, -0.030431397259235382, 0.0017732977867126465, 0.0006238606874831021, 0.030306270346045494, 0.0058204419910907745, -0.04171106964349747, 0.06454823166131973, 0.03989112749695778, 0.03830603510141373, 0.02954631671309471, 0.00616665231063962, 0.02742663398385048, -0.024722540751099586, -0.003254207083955407, 0.057417627424001694, -0.010887437500059605, 0.003968502394855022, -0.025372371077537537, 0.005258944351226091, -0.0111722182482481, -0.005051538348197937, -0.0007573866751044989, -0.014893556945025921, -0.03700718283653259, -0.010850978083908558, 0.007003652397543192, 0.0464743971824646, 0.03111490048468113, -0.05280214920639992, -0.013058369047939777, 0.009200770407915115, -0.036506108939647675, -0.015936870127916336, -0.006073217839002609, -0.04813748970627785, -0.019521893933415413, -0.01898978464305401, -0.029744789004325867, 0.08160646259784698, -0.00017713177658151835, 0.0007267321925610304, 0.002898839768022299, -0.0002101177378790453, 0.009760445915162563, 0.008270305581390858, -0.02043444663286209, -0.012337674386799335, -0.04102416709065437, -0.014019239693880081, -0.004576375707983971, -0.022394556552171707, 0.03779655694961548, -0.04673738405108452, 0.0749516412615776, -0.006061526946723461, -0.02621218003332615, 0.06390567123889923, 0.08242262154817581, 0.01912374421954155, -0.050861161202192307, -0.03210698068141937, -0.021408863365650177, -0.014168724417686462, 0.044073741883039474, -0.03138060122728348, -0.025143330916762352, 0.013959471136331558, -0.004738327115774155, 0.0009839523117989302, -0.011179612018167973, 0.019672246649861336, 0.03588922694325447, 0.003267426509410143, -0.03724965080618858, 0.023380164057016373, 0.03467920795083046, -0.0091944495216012, 0.043237634003162384, 0.012283592484891415, -0.011087042279541492, -0.025757553055882454, 0.009460401721298695, 0.025524472817778587, -0.06320565193891525, 0.01148937363177538, -0.030892128124833107, -0.03749898821115494, -0.0016065415693446994, 0.002503184601664543, -0.019983701407909393, 0.006390738766640425, -0.018159443512558937, -0.030239129438996315, -0.04145506024360657, -0.048792764544487, 0.003615771187469363, -0.022028213366866112, 0.07609042525291443, 0.0630178451538086, 0.00944297295063734, 0.033920757472515106, -0.03083188831806183, 0.01971827633678913, -0.02608867548406124, 0.011938003823161125, 0.037268031388521194, -0.0023218628484755754, -0.014887804165482521, -0.03007899411022663, -0.006258615292608738, 0.009562727995216846, -0.0444335900247097, -0.02041097916662693, -0.04643625393509865, 0.012879869900643826, -0.018012061715126038, -0.011484530754387379, 0.045194052159786224, 0.02287355251610279, 0.025467246770858765, -0.025650838389992714, -0.025152890011668205, 0.03471623733639717, 0.03312117978930473, -0.07944042235612869, 0.009972204454243183, -0.03806881234049797, -0.026497384533286095, 0.047049570828676224, -0.011070719920098782, 0.05011116340756416, -0.017011620104312897, -0.0012669457355514169, 0.012978047132492065, -0.0007543443352915347, -0.005927276331931353, -0.030526425689458847, 0.01952545903623104, 0.03546449542045593, 0.0031155471224337816, 0.005909495055675507, -0.0040709953755140305, 0.02660582773387432, -0.025223350152373314, -0.041072115302085876, -0.019977444782853127, 0.0053336769342422485, 0.003351460909470916, -0.021186450496315956, -0.03522327542304993, 0.015874750912189484, 0.0020717016886919737, 0.00009425251482753083, -0.06936388462781906, -0.0019341175211593509 ]
Non-engineers guide: Train a LLaMA 2 chatbot
2legit2overfit
September 28, 2023
Llama2-for-non-engineers
guide, community, nlp
https://huggingface.co/blog/Llama2-for-non-engineers
Introduction to AutoTrain AutoTrain is a no-code tool that lets non-ML Engineers, (or even non-developers ๐Ÿ˜ฎ) train state-of-the-art ML models without the need to code. It can be used for NLP, computer vision, speech, tabular data and even now for fine-tuning LLMs like weโ€™ll be doing today. You can read more about AutoTrain here.
[ 0.04783107340335846, -0.0029914425686001778, 0.0781119167804718, 0.005707032512873411, 0.05948048457503319, 0.034451015293598175, 0.01134769432246685, 0.038674116134643555, 0.006898400839418173, 0.004679808393120766, -0.12228590995073318, 0.1050679087638855, -0.05321260169148445, 0.019765501841902733, 0.03384144976735115, -0.032065100967884064, 0.006576267536729574, -0.021280985325574875, -0.004499855451285839, 0.014403477311134338, -0.03840615600347519, -0.06274877488613129, 0.08536180853843689, -0.04456435516476631, -0.018130244687199593, 0.00015739879745524377, 0.002713916590437293, 0.03846330568194389, -0.09968097507953644, 0.019527964293956757, -0.0684029832482338, 0.024003583937883377, -0.03955636918544769, -0.05828710272908211, -0.023083878681063652, 0.004946217406541109, -0.06383714079856873, 0.063275046646595, 0.02975544147193432, -0.06943189352750778, -0.042083486914634705, 0.007682856172323227, -0.02823369763791561, 0.06475242227315903, -0.04337586089968681, -0.014412732794880867, -0.1983201652765274, 0.05167205631732941, -0.033162910491228104, -0.0017968117026612163, -0.08891617506742477, 0.06919315457344055, -0.010167301632463932, 0.022504165768623352, -0.008780614472925663, 0.02523769810795784, 0.004061699379235506, -0.10578589886426926, -0.023880356922745705, -0.0062982672825455666, 0.008201604709029198, 0.015914803370833397, -0.005569614935666323, -0.004413879010826349, 0.043396785855293274, -0.05244717746973038, -0.021703649312257767, -0.009890791960060596, -0.12320858240127563, -0.03917360305786133, -0.009719539433717728, -0.06298671662807465, -0.03741222992539406, -0.016613487154245377, 0.026799766346812248, -0.04477490484714508, -0.04232572391629219, 0.0010405172361060977, 0.031548891216516495, 0.02840132638812065, 0.08325207233428955, 0.039372995495796204, 0.03305131569504738, 0.07067955285310745, 0.004283247049897909, 0.04353686794638634, -0.006506243254989386, -0.052505820989608765, -0.0004209859762340784, 0.012139244936406612, -0.04670010879635811, -0.09091504663228989, -0.023271307349205017, 0.013371824286878109, 0.010511765256524086, -0.019927604123950005, -0.02859460934996605, 0.05978316068649292, -0.04972674697637558, -0.014665479771792889, -0.0362473763525486, -0.00492759607732296, 0.0014653322286903858, -0.018780343234539032, -0.05585428327322006, 0.018130479380488396, -0.03165114298462868, -0.03311402350664139, -0.06856292486190796, -0.020964358001947403, 0.01535137090831995, -0.034958381205797195, 0.009283371269702911, 0.06690427660942078, -0.09048806875944138, 0.0326976478099823, 0.038115061819553375, 0.02406727336347103, 0.0004419793258421123, 0.013115910813212395, -0.005102214403450489, 0.006860196124762297, 0.08627741038799286, -0.005948953330516815, -0.020916903391480446, 0.0643312856554985, -0.018384242430329323, 0.03158130496740341, 0.01986478455364704, 0.026264283806085587, 0.021475939080119133, -0.02212098427116871, 0.0007572699687443674, 0.04731538146734238, 0.025279855355620384, 0.01740116998553276, -0.0159746240824461, -0.03946715220808983, 0.020263981074094772, 0.09977765381336212, -0.060141973197460175, 0.06728807836771011, 0.0389014407992363, -0.0457531213760376, 0.06392115354537964, 0.02476990967988968, -0.057033050805330276, 0.0488794781267643, -0.029611673206090927, 0.003986444789916277, -0.057945773005485535, 0.05215746536850929, -0.05241457000374794, -0.10294793546199799, 0.05501575022935867, 0.09216984361410141, -0.011906282976269722, -0.040038228034973145, 0.011940058320760727, 0.0015260966029018164, -0.045918285846710205, 0.01217696163803339, -0.0790088102221489, -0.027975620701909065, -0.004743493162095547, -0.0599578358232975, -0.012097860686480999, -0.0021320644300431013, 0.015567588619887829, 0.0313531756401062, -0.010854978114366531, -0.0929299145936966, 0.057656820863485336, -0.018338274210691452, 0.04227868840098381, -0.023285649716854095, 0.007445954717695713, 0.061899278312921524, -0.05651812255382538, 0.017630882561206818, -0.03261522948741913, 0.07026433944702148, 0.03260250389575958, -0.0009882308077067137, 0.04470815509557724, -0.04640159010887146, 0.04494151100516319, -0.01588466577231884, -0.04173857346177101, -0.029569359496235847, -0.026784026995301247, -0.014541739597916603, 0.07035718858242035, -0.01355337630957365, 0.05460362508893013, -0.05223922058939934, -0.056456539779901505, 0.155980184674263, 0.05630289763212204, 0.03366377577185631, 0.06434710323810577, -0.011460239998996258, -0.01049124076962471, -0.0645545944571495, 0.016061725094914436, 0.06755264103412628, 0.04203695058822632, 0.016355101019144058, 0.010677115991711617, 0.0000369093322660774, -0.006844814401119947, -0.09342112392187119, 0.04203488677740097, -0.03750469535589218, -0.005287705454975367, 0.012877264060080051, 0.001645473763346672, 0.013235235586762428, -0.0083268191665411, 0.014469888061285019, 0.19122491776943207, -0.07551971077919006, -0.022069627419114113, -0.025163061916828156, -0.09347396343946457, 0.04439317062497139, 0.08936871588230133, 0.0412345789372921, 0.0752296969294548, -0.08427488803863525, -0.01727687194943428, -0.06851065158843994, -0.004682597704231739, 0.028930464759469032, 0.015023781917989254, -0.011247901245951653, 0.07511425018310547, -0.0230312068015337, 0.030191773548722267, 0.010693581774830818, 0.04064677655696869, -0.029545273631811142, 0.0035180554259568453, 0.03543534874916077, -0.009157119318842888, 0.04114404320716858, 0.08308330923318863, -0.015838665887713432, -0.0008279799367301166, 0.00896195787936449, -0.013785773888230324, -0.009036309085786343, 0.007367042824625969, -0.043615106493234634, -0.006131133530288935, -0.022805674001574516, -0.009051177650690079, -0.030564652755856514, -0.029114581644535065, 0.03548553213477135, -0.00348470127210021, -0.021314062178134918, 0.0023604410234838724, -0.03774042800068855, -0.013925580307841301, -0.039620935916900635, 0.030395640060305595, 0.039722323417663574, 0.03553706780076027, 0.022671125829219818, 0.00012139528553234413, 0.005265033338218927, 0.04717814922332764, 0.013848926872015, 0.007402702234685421, 0.03366690129041672, 0.037577711045742035, -0.029988909140229225, -0.03898710012435913, -0.0500052385032177, 0.019283419474959373, -0.046908482909202576, 0.05071265622973442, 0.04373493045568466, 0.027767496183514595, -0.007997657172381878, 0.0014925266150385141, 0.0014540539123117924, -0.0024875630624592304, 0.0031463156919926405, 0.005570210516452789, 0.02511589042842388, -0.009930986911058426, 0.0029086233116686344, -0.014497018419206142, -0.03688257187604904, 0.031340375542640686, -0.010038325563073158, 0.004142681136727333, 0.010407253168523312, 0.041394758969545364, 0.037334512919187546, 0.014824396930634975, -0.02706904523074627, 0.0036565104965120554, 0.03273676708340645, 0.010563497431576252, -0.021621327847242355, -0.10498283803462982, -0.015065339393913746, 0.011378523893654346, -0.0027067058254033327, 0.03270532563328743, -0.047179099172353745, 0.049357496201992035, -0.025477353483438492, -0.007533811032772064, 0.012160471640527248, -0.00905897468328476, 0.02035973221063614, 0.06572828441858292, 0.01612745225429535, 0.0029825991950929165, 0.007192252203822136, -0.03899616003036499, -0.0028488095849752426, 0.018754243850708008, 0.03405286744236946, -0.035094182938337326, 0.010611928068101406, 0.021041560918092728, 0.026432018727064133, -0.0008758039912208915, -0.003066916484385729, 0.00917036272585392, 0.03292645886540413, 0.021401209756731987, 0.015364929102361202, 0.008163463324308395, -0.00552526256069541, -0.07222753018140793, 0.04117918014526367, -0.019690468907356262, -0.006194750312715769, 0.02470851130783558, 0.04995480552315712, 0.02945888228714466, 0.008001932874321938, 0.006902993656694889, -0.03483695909380913, 0.04639703780412674, -0.02823396399617195, -0.01187543012201786, -0.02108156308531761, -0.004584601614624262, -0.0002743979566730559, 0.024822480976581573, -0.04794520512223244, -0.04287520796060562, -0.01694236509501934, 0.019338469952344894, 0.05860276147723198, 0.010720795951783657, 0.006647401489317417, -0.010249882005155087, -0.0020356127060949802, 0.030417032539844513, 0.032773107290267944, -0.05649719759821892, 0.026656383648514748, 0.005818045232445002, -0.03475464880466461, -0.04260743409395218, 0.0170900896191597, 0.040201954543590546, 0.013035092502832413, -0.008813210763037205, 0.01962556503713131, 0.0073815141804516315, 0.03240543231368065, 0.013675044290721416, 0.008867022581398487, -0.029536571353673935, 0.030078686773777008, -0.009177891537547112, -0.03128615394234657, 0.07530897855758667, 0.0865262970328331, 0.006097972393035889, -0.047909874469041824, 0.0006092592957429588, -0.009479953907430172, 0.014639894478023052, 0.01096334122121334, 0.02487148903310299, -0.010191026143729687, 0.00950012169778347, 0.025933431461453438, -0.008532306179404259, -0.037567805498838425, 0.03484334796667099, -0.006379494443535805, 0.00367313576862216, -0.027254046872258186, -0.0032021820079535246, 0.017784010618925095, 0.0018850710475817323, -0.012373869307339191, 0.03311945125460625, -0.004604034591466188, -0.013198713771998882, 0.008065509609878063, -0.018521208316087723, 0.023826997727155685, -0.0424327589571476, -0.02456091344356537, 0.013854590244591236, -0.008889091201126575, -0.008126708678901196, -0.01224414724856615, 0.03046914003789425, 0.01481163315474987, 0.018597185611724854, 0.005661358591169119, -0.03474530577659607, -0.003297019749879837, -0.006815189495682716, 0.000588089635130018, -0.0389326736330986, 0.01279826182872057, -0.025744302198290825, -0.022716380655765533, 0.03273415565490723, -0.02823677659034729, 0.053111907094717026, 0.03942451626062393, -0.01937413401901722, -0.015185032971203327, -0.026567157357931137, -0.0070662968792021275, 0.014694924466311932, 0.008947908878326416, -0.0027804686687886715, -0.03400152921676636, -0.00469729071483016, 0.021250398829579353, -0.007246672175824642, -0.0213193129748106, 0.0009890637593343854, -0.00638070423156023, 0.010773224756121635, -0.027204276993870735, 0.04916403070092201, -0.0019957388285547495, -0.04068922623991966, 0.001759052975103259, -0.004542647395282984, 0.02884499914944172, 0.009966795332729816, -0.02785901352763176, -0.0454440675675869, -0.01292571984231472, 0.06099835783243179, -0.039114274084568024, -0.001769362948834896, 0.02730146422982216, -0.015426221303641796, 0.025842050090432167, 0.019795149564743042, 0.008159814402461052, -0.033302269876003265, -0.010225163772702217, 0.04444882646203041, -0.028721269220113754, 0.015717294067144394, -0.03627418354153633, 0.00814852025359869, -0.0244147852063179, 0.001773293362930417, 0.014063474722206593, 0.0031168980058282614, -0.030550241470336914, -0.0020492435432970524, 0.017319075763225555, 0.07405474781990051, 0.024900861084461212, -0.05655936151742935, -0.010242072865366936, -0.01838279701769352, 0.014539709314703941, 0.023375829681754112, -0.0043015549890697, -0.014224478043615818, 0.004476290196180344, 0.04012936353683472, 0.018652085214853287, -0.023089660331606865, 0.03431719169020653, 0.03134091943502426, -0.02302766777575016, 0.008121379651129246, -0.014993023127317429, 0.014304036274552345, -0.026452530175447464, 0.018099550157785416, -0.021669944748282433, -0.014890088699758053, -0.024630235508084297, -0.006077616009861231, 0.03997476026415825, -0.053874894976615906, -0.04787577688694, 0.03905791416764259, -0.013561006635427475, -0.02175932750105858, -0.03804941475391388, -0.0008962607244029641, 0.0011985086603090167, -0.005544575396925211, -0.029622990638017654, 0.02492508664727211, 0.004020947031676769, -0.014345231465995312, -0.0020237290300428867, 0.01541147194802761, 0.025876345112919807, -0.01963650994002819, 0.0017246343195438385, -0.012479736469686031, -0.002538540866225958, -0.010757858864963055, 0.014437333680689335, 0.07855859398841858, -0.016925130039453506, 0.00018466524488758296, 0.02681056596338749, 0.029151830822229385, 0.028873957693576813, 0.02008255198597908, 0.025385094806551933, 0.00047733320388942957, 0.02023436687886715, 0.02214980125427246, -0.015376921743154526, -0.02219761349260807, 0.06826049089431763, 0.046290475875139236, -0.02498117834329605, -0.022500313818454742, -0.0069965883158147335, -0.06030649691820145, -0.00866666529327631, -0.07133965939283371, 0.0380873829126358, 0.03615443408489227, -0.012663724832236767, 0.014187571592628956, 0.023956913501024246, -0.006007954012602568, 0.01917874999344349, -0.015706151723861694, 0.025687549263238907, 0.023546842858195305, 0.023443352431058884, 0.036335282027721405, 0.034493472427129745, -0.0007329020299948752, -0.0032847467809915543, 0.033241573721170425, -0.05619385093450546, 0.0006432632217183709, 0.01418321393430233, -0.029877571389079094, 0.0039133355021476746, -0.0015096446732059121, -0.014580207876861095, 0.013881320133805275, 0.0011885873973369598, 0.04184970632195473, 0.02352241799235344, -0.014491519890725613, 0.005234467796981335, 0.019928982481360435, -0.035106707364320755, 0.005127251148223877, 0.050974637269973755, -0.017656657844781876, 0.06018499657511711, 0.02369382604956627, 0.03954768553376198, 0.02203322947025299, 0.003298798343166709, -0.00680515356361866, 0.019136130809783936, 0.04708176478743553, 0.03958667814731598, 0.02069004438817501, 0.0299152173101902, 0.031912196427583694, -0.03874047473073006, -0.009148009121418, 0.01289944164454937, -0.04653611406683922, -0.0018608467653393745, 0.04276132211089134, 0.002752835163846612, -0.0032162617426365614, 0.022796252742409706, 0.04507474601268768, 0.0313427597284317, 0.03642478212714195, -0.015549967996776104, 0.015095071867108345, 0.038397666066884995, 0.030476633459329605, 0.013762555085122585, 0.06251389533281326, -0.017274798825383186, -0.037709787487983704, 0.07482307404279709, 0.03653198853135109, 0.027443164959549904, 0.01136635709553957, -0.00007845564687158912, 0.025861831381917, -0.03658311069011688, -0.0003701910318341106, 0.03061803989112377, -0.023764360696077347, -0.0023858805652707815, -0.04228443279862404, -0.01379470620304346, 0.0063311257399618626, -0.003515844698995352, 0.0015269146533682942, -0.0027505396865308285, -0.00695433234795928, -0.0020502374973148108, -0.003969278186559677, 0.015796290710568428, -0.004514605738222599, 0.012592184357345104, -0.04312437027692795, -0.0353860966861248, -0.008213863708078861, -0.010650965385138988, 0.0013060501078143716, -0.033978383988142014, -0.03685402497649193, -0.016483711078763008, -0.022718358784914017, 0.052420515567064285, 0.001386771211400628, -0.027301110327243805, 0.013024394400417805, 0.0035493639297783375, -0.027616269886493683, 0.014125634916126728, 0.025498032569885254, 0.008198277093470097, -0.047675423324108124, -0.016859693452715874, -0.041021622717380524, -0.02190939150750637, 0.01899563893675804, -0.06063509359955788, 0.03312792629003525, -0.02696368843317032, -0.051168978214263916, 0.017139650881290436, 0.0647207498550415, 0.008571240119636059, -0.04454949498176575, -0.04464935511350632, -0.01918846182525158, -0.030962122604250908, 0.006523297633975744, -0.0034932526759803295, -0.029886731877923012, -0.021356310695409775, -0.011329447850584984, -0.0013002720661461353, -0.007100094575434923, 0.02766861952841282, 0.048867519944906235, 0.007636025547981262, -0.055100057274103165, 0.03017200343310833, 0.021522071212530136, -0.023279264569282532, 0.04818223416805267, 0.020511046051979065, 0.02462473139166832, -0.012573113664984703, -0.03509708121418953, 0.025968428701162338, -0.03281812742352486, 0.006734432652592659, -0.0190112367272377, -0.06982210278511047, -0.01630685105919838, 0.02352859452366829, -0.0027822465635836124, -0.004989557433873415, -0.015162905678153038, 0.007713754661381245, -0.02537197433412075, -0.05169491097331047, -0.0327172689139843, 0.03226371109485626, 0.03621921315789223, 0.011704345233738422, 0.015829795971512794, 0.006507620681077242, -0.0009021913865581155, 0.0017450761515647173, -0.02478937990963459, 0.04023221135139465, 0.022861966863274574, 0.004247073549777269, -0.023806698620319366, 0.001248336979188025, 0.03344079479575157, -0.034770261496305466, -0.05965976044535637, -0.01081586629152298, 0.012269428931176662, 0.020845049992203712, -0.04752909392118454, 0.014515270479023457, 0.04962310194969177, 0.005234283395111561, 0.019214116036891937, 0.023054709658026695, -0.0034413812682032585, -0.00697242422029376, -0.009490869008004665, -0.061942219734191895, 0.00027415092336013913, -0.029650310054421425, -0.02435525879263878, 0.04135455936193466, 0.03623141348361969, 0.020043639466166496, 0.00878126360476017, 0.03285546973347664, 0.012887910939753056, -0.004881984554231167, 0.002164715202525258, -0.041367921978235245, -0.0036142210010439157, 0.007714962586760521, -0.013267136178910732, -0.0035274787805974483, -0.004767123144119978, 0.023841291666030884, 0.007082456722855568, -0.032716672867536545, 0.010225296951830387, -0.0056589818559587, 0.02547367289662361, 0.0028490088880062103, -0.006879278924316168, 0.03913702443242073, 0.04732993617653847, -0.020625924691557884, -0.02485773153603077, 0.012219386175274849 ]
Non-engineers guide: Train a LLaMA 2 chatbot
2legit2overfit
September 28, 2023
Llama2-for-non-engineers
guide, community, nlp
https://huggingface.co/blog/Llama2-for-non-engineers
Introduction In this tutorial we will show you how anyone can build their own open-source ChatGPT without ever writing a single line of code! Weโ€™ll use the LLaMA 2 base model, fine tune it for chat with an open-source instruction dataset and then deploy the model to a chat app you can share with your friends. All by just clicking our way to greatness. ๐Ÿ˜€ Why is this important? Well, machine learning, especially LLMs (Large Language Models), has witnessed an unprecedented surge in popularity, becoming a critical tool in our personal and business lives. Yet, for most outside the specialized niche of ML engineering, the intricacies of training and deploying these models appears beyond reach. If the anticipated future of machine learning is to be one filled with ubiquitous personalized models, then there's an impending challenge ahead: How do we empower those with non-technical backgrounds to harness this technology independently? At Hugging Face, weโ€™ve been quietly working to pave the way for this inclusive future. Our suite of tools, including services like Spaces, AutoTrain, and Inference Endpoints, are designed to make the world of machine learning accessible to everyone. To showcase just how accessible this democratized future is, this tutorial will show you how to use Spaces, AutoTrain and ChatUI to build the chat app. All in just three simple steps, sans a single line of code. For context Iโ€™m also not an ML engineer, but a member of the Hugging Face GTM team. If I can do this then you can too! Let's dive in!
[ 0.003005162114277482, -0.02366953156888485, 0.071621373295784, 0.049440961331129074, 0.06979953497648239, 0.041968826204538345, 0.04342365264892578, 0.03915354236960411, 0.0038799038156867027, -0.015002344734966755, -0.14412206411361694, 0.0590352900326252, -0.0644335150718689, 0.06381580978631973, 0.0033095020335167646, -0.04683399945497513, -0.0015683110104873776, -0.04297182336449623, -0.03232590854167938, 0.029687941074371338, 0.036150913685560226, -0.003093602368608117, 0.005600446835160255, -0.05663735792040825, -0.016761884093284607, -0.008644402027130127, 0.0592389740049839, 0.04746872931718826, -0.017743047326803207, 0.04529201611876488, -0.058259621262550354, 0.004743980709463358, -0.055026277899742126, -0.05359485000371933, 0.03536614775657654, 0.0006120892358012497, -0.06995875388383865, 0.04876544699072838, 0.034395795315504074, -0.019913416355848312, 0.016795342788100243, 0.002273630117997527, -0.07315025478601456, 0.03400953486561775, -0.043995682150125504, -0.019104881212115288, -0.16133800148963928, 0.027311306446790695, -0.030654681846499443, -0.019295157864689827, -0.05534546077251434, 0.05707939714193344, -0.029341870918869972, -0.009533755481243134, 0.003077590139582753, 0.02339191548526287, 0.02240057662129402, -0.11860097199678421, -0.06906004250049591, 0.027033675462007523, -0.012925844639539719, 0.03685522824525833, 0.032573457807302475, -0.014438181184232235, 0.02733897604048252, -0.0021448133047670126, -0.04016701132059097, -0.016041193157434464, -0.07413862645626068, -0.006816355511546135, 0.025634242221713066, -0.02237069606781006, -0.03939497098326683, -0.05686298385262489, -0.007416919339448214, -0.007110925391316414, 0.014082922600209713, 0.061208613216876984, 0.0784316286444664, 0.03540990874171257, 0.011028295382857323, 0.04084428399801254, -0.00565993832424283, 0.0017557255923748016, 0.011039926670491695, 0.05826987698674202, 0.0010047171963378787, -0.0287422277033329, -0.012602271512150764, 0.01797717809677124, -0.05667360872030258, -0.11139842867851257, -0.0333009734749794, 0.03467608243227005, 0.07856298983097076, 0.03873010352253914, -0.043359190225601196, 0.025960097089409828, 0.008692881092429161, -0.008230170235037804, -0.0028283321298658848, -0.041303884238004684, 0.014500072225928307, -0.04708314687013626, -0.051372576504945755, 0.03585771843791008, 0.009632118046283722, -0.06902080774307251, -0.039929505437612534, -0.01315603218972683, 0.0026758681051433086, -0.057639993727207184, 0.009672246873378754, 0.09871681779623032, -0.13151104748249054, 0.03860178217291832, 0.0074576144106686115, -0.04007410258054733, 0.02218819409608841, -0.040729787200689316, 0.06548319011926651, 0.012928330339491367, 0.028677958995103836, -0.023994192481040955, 0.03556189313530922, 0.09020016342401505, -0.040746770799160004, 0.014554213732481003, 0.04101772978901863, -0.005629186984151602, 0.024858562275767326, -0.016390101984143257, 0.036850105971097946, -0.046505920588970184, 0.05420022830367088, -0.020513426512479782, 0.053098369389772415, -0.04836469143629074, 0.043977972120046616, 0.032873377203941345, 0.017021557316184044, 0.061490122228860855, 0.038715165108442307, -0.010507091879844666, 0.04742405563592911, 0.08577719330787659, -0.07801118493080139, -0.008137021213769913, -0.034094903618097305, -0.027689708396792412, -0.10000944137573242, 0.007770848460495472, 0.02979394607245922, -0.0818372294306755, 0.029438810423016548, 0.047483596950769424, -0.06614929437637329, 0.01513776183128357, -0.025915997102856636, -0.013641069643199444, 0.03008655086159706, -0.015074360184371471, -0.03762553259730339, 0.018569327890872955, 0.026641273871064186, 0.0038899274077266455, -0.00207720510661602, 0.019016975536942482, -0.00900376494973898, 0.007033664267510176, 0.027135781943798065, -0.027090955525636673, 0.05531272292137146, -0.06848981976509094, 0.06893867254257202, 0.021720198914408684, 0.04631631076335907, 0.023450857028365135, 0.021352332085371017, 0.029741529375314713, -0.018587220460176468, 0.023491155356168747, 0.03670237585902214, 0.015970151871442795, 0.03496421128511429, -0.13610060513019562, -0.00002509049045329448, -0.08577846735715866, -0.017040424048900604, -0.04771941900253296, -0.0006740565877407789, 0.03493515029549599, 0.02183367870748043, 0.012794889509677887, 0.02367379702627659, -0.05350609868764877, -0.04389887675642967, 0.11288882046937943, 0.10626810044050217, 0.11183658987283707, 0.034124210476875305, 0.004881756380200386, -0.01127254031598568, -0.03661993891000748, -0.008338267914950848, 0.015836600214242935, 0.011414461769163609, -0.0011686409125104547, 0.013909018598496914, -0.022883981466293335, -0.030031803995370865, -0.05973958969116211, 0.05328628048300743, 0.005521341692656279, 0.04076315835118294, -0.07446057349443436, -0.01121359784156084, 0.0023213259410113096, 0.01519505213946104, 0.06994642317295074, 0.15838244557380676, -0.10139419883489609, 0.003391753416508436, -0.04523112252354622, -0.004912466276437044, 0.05987812206149101, 0.09829055517911911, 0.07673359662294388, 0.12245804816484451, -0.055042244493961334, -0.03528763726353645, -0.09560373425483704, 0.029464473947882652, 0.02720348909497261, -0.007714665029197931, -0.02024940401315689, 0.06880471855401993, -0.03195187449455261, 0.034957244992256165, -0.03230692073702812, 0.03646213933825493, -0.020104650408029556, 0.010553917847573757, -0.014015845954418182, -0.025782393291592598, -0.018745074048638344, 0.04634697735309601, -0.006975823547691107, -0.0008715545409359038, 0.03948456048965454, -0.037028826773166656, 0.012644770555198193, -0.008601033128798008, 0.046651534736156464, -0.03318796679377556, -0.024472225457429886, -0.02003665268421173, 0.004857925232499838, -0.04851453751325607, 0.050069089978933334, 0.015743177384138107, 0.004613903816789389, -0.012804551981389523, -0.014513709582388401, -0.036274254322052, -0.03778766095638275, 0.005216087680310011, 0.04015130177140236, -0.002984443213790655, -0.027057817205786705, -0.004272263962775469, -0.029477441683411598, -0.011955155059695244, 0.009486940689384937, 0.015786679461598396, 0.021083204075694084, 0.009493202902376652, 0.006248851772397757, -0.006392675451934338, -0.011801151558756828, 0.0060776639729738235, -0.04869088530540466, 0.022911157459020615, 0.0714535340666771, 0.007483538240194321, 0.02496362291276455, 0.006969607435166836, -0.01952764391899109, -0.04334581643342972, 0.017388762906193733, 0.018313653767108917, 0.036169566214084625, 0.01097219530493021, -0.01165627222508192, -0.019556790590286255, -0.007343860808759928, 0.0054897465743124485, -0.013558262027800083, 0.007137199863791466, 0.034814756363630295, 0.039915818721055984, -0.008050957694649696, 0.013115273788571358, -0.0018344904528930783, 0.0035161993000656366, 0.00970832072198391, 0.03163804113864899, 0.0067871748469769955, -0.08874242752790451, 0.011173594743013382, -0.028236983343958855, -0.014307462610304356, 0.008852769620716572, -0.04529985412955284, 0.0653911605477333, -0.04246055707335472, -0.02105485461652279, 0.0418577715754509, -0.05119384080171585, 0.024587254971265793, 0.009322533383965492, -0.0013082557125017047, -0.013079365715384483, -0.0007105919648893178, -0.026700487360358238, -0.001971391262486577, 0.005583636462688446, 0.0053070830181241035, -0.033122360706329346, 0.022654669359326363, -0.00630878796800971, 0.023092297837138176, 0.007675153203308582, -0.026053866371512413, 0.03025144524872303, -0.020214267075061798, 0.04482952132821083, 0.01625133864581585, 0.0034146567340940237, -0.007988019846379757, -0.0375223271548748, 0.0028786954935640097, -0.04559357464313507, 0.007211057934910059, 0.04165365919470787, 0.020842133089900017, 0.025860000401735306, 0.03356979787349701, 0.002107043983414769, 0.0020260417368263006, 0.005804382264614105, -0.03554234281182289, 0.004764995537698269, -0.032545216381549835, -0.012629183009266853, 0.01767691597342491, -0.0038596992380917072, -0.05485768988728523, 0.012906592339277267, 0.021584009751677513, 0.037695690989494324, 0.032777607440948486, 0.0005860950332134962, 0.02370326593518257, 0.03175898268818855, 0.028438877314329147, -0.007036786526441574, 0.0341726578772068, -0.08163049817085266, 0.033270373940467834, -0.04216841608285904, -0.02049715630710125, -0.002684553386643529, 0.03238409757614136, 0.02344932034611702, -0.012326141819357872, 0.002919491846114397, 0.06017225608229637, -0.030358130112290382, 0.019652945920825005, 0.001430839067324996, 0.007820074446499348, -0.02273373119533062, 0.018740255385637283, -0.011477858759462833, -0.03749087452888489, 0.06758049130439758, 0.03464892506599426, 0.0016002055490389466, -0.04763704910874367, 0.006987797562032938, -0.01455417275428772, 0.010534940287470818, -0.00729328952729702, 0.01756766438484192, -0.031154481694102287, 0.0035043172538280487, 0.04516743868589401, -0.01292324811220169, -0.042754389345645905, 0.049050215631723404, 0.004726686980575323, 0.013828560709953308, -0.01871202513575554, -0.005156530998647213, 0.02768586203455925, -0.00027880427660420537, -0.002957710763439536, 0.05897882953286171, 0.006934506352990866, 0.014259343035519123, 0.01542387343943119, -0.025137752294540405, 0.026683926582336426, -0.023467540740966797, -0.03352915495634079, 0.04032387211918831, 0.018413374200463295, -0.035121362656354904, -0.017550267279148102, 0.01183255948126316, 0.00752211082726717, 0.024683523923158646, 0.017083724960684776, -0.019944094121456146, -0.0014140940038487315, -0.005997117143124342, -0.004974051378667355, -0.006618602201342583, -0.026916751638054848, 0.002137875184416771, -0.006785342935472727, 0.041432078927755356, 0.007928237318992615, 0.037528492510318756, -0.008908499963581562, 0.012970336712896824, -0.014079229906201363, -0.03751887008547783, -0.03475433588027954, 0.016991863027215004, -0.005864791572093964, -0.009834634140133858, 0.024717219173908234, -0.006647885777056217, 0.019784200936555862, -0.01829748973250389, -0.010218818672001362, -0.04793694615364075, -0.006533472798764706, 0.023589065298438072, -0.04156062379479408, 0.018728643655776978, 0.01996743679046631, -0.03312679007649422, -0.0014451639726758003, 0.007623766083270311, 0.012935986742377281, 0.005789437796920538, -0.026648420840501785, -0.026703456416726112, -0.00468107033520937, 0.021311376243829727, 0.005347009748220444, -0.011434641666710377, 0.022395528852939606, 0.0011697551235556602, 0.028092702850699425, -0.016118934378027916, 0.0053476085886359215, -0.03095722757279873, -0.011044424027204514, 0.014165190979838371, -0.008297441527247429, 0.02877109684050083, -0.012252447195351124, -0.01083415001630783, 0.009996719658374786, -0.012894314713776112, 0.03314455971121788, 0.029764587059617043, 0.011120423674583435, 0.010081944987177849, 0.032546378672122955, 0.07946081459522247, 0.036933548748493195, -0.0015185705851763487, 0.022256601601839066, -0.04568558186292648, -0.007504159584641457, 0.013223380781710148, -0.01211485080420971, 0.0076005104929208755, 0.027333155274391174, 0.06031280755996704, 0.07696109265089035, 0.014444385655224323, -0.003326903795823455, -0.027093902230262756, 0.0007784146582707763, 0.026521258056163788, -0.007163335103541613, 0.022168142721056938, -0.02568611316382885, 0.003073083935305476, 0.025196122005581856, -0.007749104872345924, -0.016852248460054398, 0.010775718837976456, 0.019177021458745003, -0.07226308435201645, -0.01086841244250536, 0.05954592302441597, -0.008264200761914253, 0.013641923666000366, -0.028044715523719788, 0.015446577221155167, -0.008007190190255642, -0.009755519218742847, -0.06190246343612671, 0.03441021591424942, -0.017710037529468536, -0.010982692241668701, 0.011618449352681637, -0.020162353292107582, 0.0014762707287445664, -0.002251383615657687, 0.033018480986356735, -0.026670902967453003, -0.043364204466342926, -0.03638109192252159, -0.021044693887233734, 0.022943973541259766, 0.002912792842835188, -0.008572055958211422, 0.046980809420347214, 0.01685200072824955, -0.016804324463009834, 0.021520305424928665, -0.020759301260113716, 0.0024920543655753136, 0.030582278966903687, -0.0038625048473477364, 0.004193461500108242, -0.05704336240887642, -0.025125831365585327, 0.019714808091521263, -0.0019546218682080507, 0.003488786518573761, -0.05112070590257645, -0.030490059405565262, -0.023210415616631508, -0.04681721702218056, 0.03220854699611664, 0.0676133930683136, -0.012949743308126926, -0.021719060838222504, -0.0135270981118083, -0.01232617162168026, -0.030253762379288673, -0.007396568078547716, 0.01094783004373312, 0.016623202711343765, 0.015542964451014996, 0.038709335029125214, 0.009421329014003277, -0.013224737718701363, -0.036085519939661026, 0.02664695866405964, -0.07187966257333755, -0.022047532722353935, -0.011591038666665554, 0.0051980894058942795, 0.0012464940082281828, 0.010849898681044579, -0.008910559117794037, -0.011765165254473686, -0.029056964442133904, 0.027225520461797714, 0.005869891028851271, -0.0221230611205101, 0.003754938952624798, -0.01694345287978649, -0.03847232833504677, 0.018427764996886253, 0.06328873336315155, -0.0006459922879002988, 0.054574742913246155, -0.007217917591333389, 0.04242084175348282, 0.050670672208070755, 0.015951326116919518, -0.011934108100831509, 0.020982330664992332, 0.0558047741651535, 0.0472157821059227, 0.02029930241405964, 0.03669959679245949, -0.042220406234264374, -0.027393074706196785, -0.02044716477394104, 0.010344590060412884, -0.03776765242218971, 0.00922342948615551, 0.041335586458444595, -0.01588340848684311, 0.028357893228530884, -0.005017110146582127, 0.054572418332099915, 0.05159249156713486, 0.01566939987242222, 0.029262512922286987, 0.0354604497551918, 0.005293406546115875, -0.006657980848103762, 0.0202934630215168, 0.05888265371322632, 0.017454195767641068, -0.059702325612306595, 0.023605037480592728, 0.024101531133055687, 0.016194170340895653, -0.03486304730176926, 0.01671481877565384, 0.02664118818938732, 0.013170034624636173, 0.0315534807741642, 0.034115634858608246, -0.028803305700421333, 0.01294535119086504, -0.04475059360265732, -0.01073353923857212, 0.027684452012181282, -0.0052236467599868774, -0.02757890149950981, -0.019320884719491005, 0.011582743376493454, -0.03800012916326523, 0.009986662305891514, 0.036326855421066284, 0.055371999740600586, -0.026369696483016014, -0.011063927784562111, -0.024704182520508766, -0.005238750483840704, -0.03551147133111954, -0.024616096168756485, -0.058711159974336624, -0.03346701338887215, -0.015815401449799538, -0.02064330130815506, 0.0003092754923272878, -0.01856366917490959, -0.05945784971117973, 0.039313748478889465, 0.05686255171895027, -0.009092489257454872, 0.018594160676002502, 0.008221411146223545, 0.054310575127601624, -0.07915471494197845, -0.0613495409488678, -0.030876602977514267, -0.03076307848095894, -0.03439636155962944, -0.0189556535333395, -0.003024343168362975, -0.015543432906270027, -0.005143860355019569, 0.03222121298313141, 0.04404492676258087, -0.006518872454762459, -0.059807468205690384, 0.027877459302544594, 0.03560261055827141, -0.0480104461312294, 0.029423365369439125, 0.0031875018030405045, 0.017985714599490166, 0.019112123176455498, 0.009768784046173096, 0.012524780817329884, -0.01900584064424038, 0.011882657185196877, 0.02940325252711773, 0.015322281047701836, -0.06074013561010361, 0.01625671237707138, 0.031605109572410583, -0.01652011089026928, 0.03169376030564308, 0.017977377399802208, -0.01756349578499794, 0.00982784666121006, -0.03293750807642937, 0.038231559097766876, -0.052955981343984604, 0.022570738568902016, -0.0460420623421669, -0.06782518327236176, -0.023348955437541008, 0.0007388409576378763, 0.012457465752959251, 0.002424731617793441, -0.04244061931967735, -0.043209273368120193, -0.024961447343230247, 0.007177017163485289, -0.005205893889069557, 0.013929207809269428, 0.03851953521370888, -0.0009247565758414567, 0.010247218422591686, 0.013917649164795876, -0.021514877676963806, 0.02753470465540886, -0.009338904172182083, 0.02383306995034218, 0.03752769157290459, -0.013216889463365078, -0.016737088561058044, -0.0037157689221203327, 0.001898458693176508, -0.010468561202287674, -0.04633953422307968, 0.00980820320546627, 0.012735024094581604, -0.025309978052973747, -0.017358800396323204, -0.00921072717756033, -0.002245876705273986, -0.017159946262836456, 0.03311450034379959, -0.056900858879089355, -0.020161446183919907, 0.033902689814567566, 0.011167988181114197, -0.049486882984638214, 0.03151955083012581, -0.024811096489429474, -0.0017253292025998235, 0.002983170561492443, 0.02945229969918728, 0.035578832030296326, -0.01250111497938633, 0.04163946211338043, 0.015017881989479065, 0.03078574128448963, -0.04736204445362091, -0.028635887429118156, -0.013774820603430271, 0.013541252352297306, -0.026684992015361786, 0.010595769621431828, -0.004916095174849033, -0.014065106399357319, -0.008171554654836655, -0.01575949788093567, 0.023604843765497208, -0.017975494265556335, 0.004733031149953604, -0.02291782572865486, -0.009853542782366276, 0.06257202476263046, 0.058549512177705765, -0.035605888813734055, -0.0569300502538681, 0.029151391237974167 ]
Non-engineers guide: Train a LLaMA 2 chatbot
2legit2overfit
September 28, 2023
Llama2-for-non-engineers
guide, community, nlp
https://huggingface.co/blog/Llama2-for-non-engineers
Step 3: Create a new ChatUI Space using your model 3.1 Follow the same process of setting up a new Space as in steps 1.1 > 1.3, but select the ChatUI docker template instead of AutoTrain. 3.2 Select your โ€œSpace Hardwareโ€ for our 7b model an A10G Small will be sufficient to run the model, but this will vary depending on the size of your model. 3.3 If you have your own Mongo DB you can provide those details in order to store chat logs under โ€œMONGODB_URLโ€. Otherwise leave the field blank and a local DB will be created automatically. 3.4 In order to run the chat app using the model youโ€™ve trained youโ€™ll need to provide the โ€œMODEL_NAMEโ€ under the โ€œSpace variablesโ€ section. You can find the name of your model by looking in the โ€œModelsโ€ section of your Hugging Face profile, it will be the same as the โ€œProject nameโ€ you used in AutoTrain. In our example itโ€™s โ€œ2legit2overfit/wrdt-pco6-31a7-0โ€. 3.4 Under โ€œSpace variablesโ€ you can also change model inference parameters including temperature, top-p, max tokens generated and others to change the nature of your generations. For now letโ€™s stick with the default settings. 3.5 Now you are ready to hit โ€œCreateโ€ and launch your very own open-source ChatGPT. Congratulations! If youโ€™ve done it right it should look like this. If youโ€™re feeling inspired, but still need technical support to get started, feel free to reach out and apply for support here. Hugging Face offers a paid Expert Advice service that might be able to help.
[ -0.04079851508140564, -0.013187388889491558, 0.034876879304647446, 0.016221443191170692, 0.0770968645811081, 0.06974779814481735, 0.0685478001832962, 0.05574573948979378, -0.014170997776091099, -0.027122274041175842, -0.07531537860631943, 0.050161730498075485, -0.024296395480632782, 0.021757740527391434, 0.00819785799831152, -0.10625077039003372, 0.03618721663951874, -0.01364368386566639, -0.05056034028530121, 0.05246235802769661, 0.01672411523759365, -0.011756526306271553, 0.0023256209678947926, 0.0037749886978417635, -0.03480922058224678, -0.04456565901637077, -0.007349948398768902, 0.06715509295463562, 0.017347795888781548, 0.024255357682704926, -0.07384396344423294, -0.02120540291070938, -0.017525294795632362, -0.05519123747944832, 0.03203526511788368, 0.016222113743424416, -0.05215954780578613, 0.029682930558919907, 0.007769490592181683, -0.006934268865734339, -0.015249124728143215, 0.0055763134732842445, -0.035323869436979294, 0.0381995253264904, 0.02088107168674469, 0.0009434582898393273, -0.13397100567817688, 0.017847664654254913, 0.014852285385131836, -0.012476157397031784, -0.012960837222635746, 0.0642368420958519, -0.039314933121204376, -0.027911201119422913, 0.02087852917611599, -0.0070563629269599915, -0.027644608169794083, -0.11612135916948318, -0.015365769155323505, 0.036099083721637726, 0.0243399515748024, 0.020242799073457718, 0.030497746542096138, 0.04166799783706665, 0.019762352108955383, 0.004485917743295431, -0.05830990523099899, -0.05929482355713844, -0.049223195761442184, -0.02124633453786373, 0.02685130015015602, 0.0356636643409729, 0.010776225477457047, -0.05129294842481613, -0.04768962413072586, -0.0173326563090086, -0.009855682030320168, 0.06578484922647476, 0.06588862091302872, 0.033097073435783386, -0.06860731542110443, 0.01896645873785019, -0.024594785645604134, -0.002644457621499896, -0.008711464703083038, 0.03688213974237442, -0.0001842531346483156, -0.017980804666876793, -0.0014143770094960928, 0.04570069909095764, -0.04454270005226135, -0.10970684885978699, 0.03527751937508583, 0.026162074878811836, 0.023980354890227318, 0.03647667542099953, -0.027269696816802025, 0.005120579618960619, 0.04512805864214897, 0.024244658648967743, 0.011803999543190002, -0.05511949211359024, 0.030154163017868996, -0.05009615421295166, -0.014048260636627674, 0.03365498408675194, -0.02231794036924839, -0.07295532524585724, -0.003559235716238618, -0.05336615443229675, 0.003631582949310541, -0.056288234889507294, 0.013094693422317505, 0.11757007986307144, -0.10731978714466095, 0.013648529537022114, -0.010115751065313816, -0.021984940394759178, 0.03388688340783119, -0.021321695297956467, 0.06883778423070908, 0.06268147379159927, 0.061021290719509125, -0.008684658445417881, -0.014566784724593163, 0.059602007269859314, 0.0018402847927063704, 0.02426040731370449, 0.0004876808088738471, -0.03857341781258583, 0.040170710533857346, -0.03524849936366081, 0.08773651719093323, 0.0011433296604081988, 0.030272379517555237, 0.01523891743272543, 0.04869489744305611, -0.07144869863986969, 0.04819640517234802, 0.01549392007291317, 0.0011185129405930638, 0.05090875178575516, 0.0366349034011364, 0.06083173304796219, 0.06479085236787796, 0.06290315836668015, -0.08032231032848358, 0.020492082461714745, -0.051151201128959656, 0.009205751121044159, -0.09681028872728348, 0.018541118130087852, 0.03302483260631561, -0.04708022624254227, 0.018178341910243034, 0.045983098447322845, -0.11308223009109497, 0.021832281723618507, -0.011127381585538387, -0.0024623426143079996, 0.00392075115814805, 0.02555326372385025, -0.09992120414972305, 0.04938138276338577, 0.01589883491396904, -0.0023151987697929144, 0.023600514978170395, 0.012455089017748833, 0.025177931413054466, 0.006311445962637663, 0.0289424117654562, -0.044966887682676315, 0.04592938721179962, 0.02222750335931778, 0.0425487719476223, 0.0463944673538208, 0.0069063822738826275, 0.007056482136249542, -0.037819840013980865, 0.010847190394997597, -0.038398951292037964, 0.08086644113063812, -0.008496544323861599, 0.04448153078556061, 0.07884999364614487, -0.15047398209571838, -0.021011730656027794, -0.0336499959230423, -0.01752285473048687, -0.024231629446148872, 0.027312826365232468, -0.014641259796917439, 0.025196498259902, 0.007891937159001827, 0.02980659529566765, -0.04281481355428696, -0.015260498970746994, 0.08574431389570236, 0.11477173864841461, 0.12320020794868469, 0.009501108899712563, 0.05119676887989044, 0.013950022868812084, -0.005169382784515619, -0.009210355579853058, 0.05860399082303047, 0.057401251047849655, -0.049875494092702866, -0.016310611739754677, -0.00615517096593976, -0.02576640248298645, -0.10208357125520706, 0.09432099759578705, -0.034106239676475525, 0.01948365941643715, -0.07811044156551361, -0.007142356131225824, -0.05875580385327339, -0.03872115537524223, 0.03642643243074417, 0.15848007798194885, -0.017481334507465363, 0.041276875883340836, -0.009152681566774845, -0.003429364413022995, 0.07704298943281174, 0.082322858273983, 0.06237488612532616, 0.11587300151586533, -0.06950996816158295, 0.005302585661411285, -0.031752366572618484, 0.015021707862615585, 0.07148012518882751, -0.05536578968167305, 0.023272711783647537, 0.07709445059299469, -0.039511874318122864, 0.05973983183503151, -0.022503511980175972, 0.046892765909433365, -0.013490447774529457, -0.008239059709012508, 0.01019375678151846, 0.008132695220410824, 0.015613898634910583, 0.03668151795864105, 0.003835636656731367, -0.026161886751651764, -0.03763280808925629, -0.014685805886983871, 0.03105752542614937, -0.004728072788566351, 0.013013208284974098, 0.019381584599614143, -0.028872709721326828, -0.025705799460411072, 0.005470273084938526, -0.05824168398976326, 0.04175983741879463, 0.01312856562435627, 0.04249981418251991, -0.017216486856341362, -0.019142063334584236, 0.006402881350368261, -0.022304117679595947, -0.022705355659127235, 0.028940586373209953, -0.01667347177863121, -0.004194292239844799, -0.017998263239860535, -0.00939739029854536, -0.028938617557287216, 0.005155250895768404, 0.025557396933436394, 0.019511647522449493, 0.008574963547289371, -0.0383533276617527, -0.0033492466900497675, 0.018100621178746223, -0.008479561656713486, -0.04893607646226883, 0.01057238969951868, 0.06810010969638824, 0.011200981214642525, 0.0006435029790736735, -0.022730598226189613, -0.04421685263514519, -0.06656140089035034, -0.004600074607878923, 0.007160105276852846, 0.029245790094137192, -0.0044380235485732555, 0.002315990626811981, 0.008452268317341805, -0.004322019871324301, 0.04988563060760498, -0.01529524102807045, 0.012351361103355885, 0.04275590181350708, 0.008618292398750782, 0.016186751425266266, -0.008474531583487988, 0.00822912435978651, -0.005363968666642904, 0.004640091210603714, 0.030975045636296272, 0.022678082808852196, -0.08488200604915619, -0.01093254890292883, -0.03255279362201691, -0.013139703311026096, -0.03750278428196907, -0.014883637428283691, 0.03529268503189087, -0.010604964569211006, -0.039822231978178024, 0.06121993437409401, -0.04995507746934891, 0.015559080056846142, 0.027810364961624146, 0.0072411964647471905, -0.008398260921239853, 0.018509766086935997, -0.03232923150062561, -0.032726310193538666, -0.01930757611989975, -0.05386607348918915, -0.06852355599403381, 0.023022575303912163, -0.017333513125777245, 0.02457438036799431, 0.005393971223384142, -0.018645402044057846, 0.02454269491136074, 0.009968624450266361, 0.03107021003961563, -0.01964610256254673, -0.01776839606463909, -0.016536841168999672, -0.03212787210941315, 0.008912825025618076, -0.05216050148010254, -0.014589371159672737, -0.006124152336269617, -0.0003425109898671508, 0.014795499853789806, 0.027574429288506508, -0.005664891097694635, -0.00013046443928033113, 0.031524185091257095, -0.006694962736219168, 0.04520862549543381, -0.01588078960776329, -0.00463001849129796, 0.02236950397491455, -0.01424828078597784, -0.018813740462064743, 0.004850231576710939, -0.013165263459086418, 0.005133054684847593, 0.025460703298449516, -0.02903921902179718, 0.03984355553984642, 0.03256962075829506, 0.060441818088293076, -0.025730282068252563, -0.011763297021389008, -0.0784069076180458, 0.013884859159588814, -0.04689774289727211, -0.01110701821744442, 0.00602172315120697, 0.018875911831855774, 0.023613400757312775, 0.0367538183927536, 0.01034416351467371, 0.04890073835849762, -0.039711691439151764, 0.03226891905069351, 0.035855576395988464, 0.01391124352812767, 0.01185789704322815, -0.0016651879996061325, -0.03070634976029396, -0.05195534974336624, 0.04028409719467163, 0.025569915771484375, 0.004067480564117432, -0.01290659885853529, -0.018503883853554726, -0.014030717313289642, 0.008382800035178661, -0.044436655938625336, 0.03219746798276901, -0.05468418821692467, 0.005736093036830425, 0.0548892468214035, -0.0003674153995234519, -0.04908839613199234, 0.055885568261146545, 0.028169158846139908, -0.0032180710695683956, -0.025825414806604385, -0.0037525722291320562, 0.014282814227044582, 0.01412674318999052, 0.02407965622842312, 0.036181990057229996, -0.012797917239367962, 0.0020759061444550753, 0.033038437366485596, 0.016629289835691452, -0.004105812404304743, -0.011535443365573883, -0.014315243810415268, 0.03424149751663208, 0.031235551461577415, 0.0013378906296566129, -0.019042959436774254, 0.01321814488619566, 0.005502534098923206, 0.01779438927769661, 0.03663024678826332, 0.009525175206363201, -0.014071744866669178, 0.010901935398578644, 0.03716222569346428, -0.012530543841421604, 0.012484697625041008, -0.030478117987513542, -0.02425123006105423, 0.011592277325689793, -0.004590393975377083, 0.035952407866716385, 0.0017848447896540165, 0.022939031943678856, -0.007728903088718653, -0.0399542860686779, 0.0031237569637596607, 0.03583905100822449, 0.011974360793828964, 0.000011135020940855611, -0.001810727990232408, -0.0266271885484457, -0.010023780167102814, -0.019603312015533447, -0.002081003738567233, -0.030202293768525124, -0.02842544950544834, 0.013942082412540913, -0.03770121559500694, 0.01962040178477764, 0.042636439204216, -0.06135605275630951, 0.005514599848538637, 0.01366767380386591, 0.03571535274386406, 0.005676116794347763, -0.03357333689928055, -0.057206280529499054, 0.015222594141960144, 0.027114255353808403, -0.0051613603718578815, -0.035709358751773834, 0.005542704835534096, -0.01788361556828022, 0.04662511125206947, -0.008711084723472595, -0.018027951940894127, 0.011172004044055939, 0.004795523826032877, 0.007863173261284828, 0.02078165113925934, 0.016684524714946747, -0.04713877663016319, 0.017822790890932083, -0.008556443266570568, -0.06373545527458191, 0.024841688573360443, 0.003067565616220236, -0.06350746750831604, 0.019708357751369476, 0.044767726212739944, 0.08497023582458496, 0.0301364753395319, 0.0124231968075037, 0.009225147776305676, -0.03428829833865166, 0.02708962932229042, -0.006406513974070549, -0.008256526663899422, 0.04681757837533951, -0.0017172108637169003, 0.07477855682373047, 0.0524708591401577, 0.02787243016064167, 0.007335224654525518, -0.006187322549521923, -0.0012983944034203887, 0.017757559195160866, -0.020663416013121605, 0.01646529510617256, -0.0017684029880911112, -0.009065467864274979, 0.008283535949885845, -0.01371175516396761, 0.002222721930593252, 0.027869723737239838, 0.03464379534125328, -0.04418973624706268, -0.036457084119319916, 0.026895882561802864, 0.029997678473591805, 0.012502769008278847, -0.01394565962255001, 0.025095637887716293, -0.012454681098461151, -0.02690056338906288, -0.018788166344165802, 0.06109194830060005, -0.005019338335841894, 0.02131512202322483, -0.012486586347222328, -0.021207287907600403, -0.0017462398391216993, 0.012425237335264683, 0.03556866571307182, -0.04003853723406792, -0.03565673157572746, -0.03796175867319107, -0.041688110679388046, -0.011484401300549507, 0.016064515337347984, -0.01273046899586916, 0.014430224895477295, -0.03042070008814335, 0.01158806774765253, 0.025034472346305847, -0.01601354591548443, 0.002623634645715356, 0.050383310765028, -0.012908043339848518, 0.011225301772356033, -0.006210594903677702, 0.008026150055229664, -0.00732440035790205, -0.00780200632289052, 0.04307115450501442, -0.04402470588684082, -0.011505589820444584, -0.02736506052315235, -0.06716284900903702, 0.020074306055903435, 0.057868875563144684, -0.015970107167959213, 0.020030459389090538, 0.006881082430481911, -0.0002300329360878095, -0.02026217058300972, -0.009307095780968666, -0.024629302322864532, -0.028198206797242165, -0.01783117651939392, 0.018654750660061836, -0.01600722409784794, -0.013923444785177708, 0.0005085893790237606, 0.012845260091125965, -0.08406249433755875, 0.018877290189266205, 0.018959207460284233, -0.018721753731369972, 0.0016507639084011316, -0.013692130334675312, -0.04541731998324394, -0.01876586116850376, -0.03075920045375824, 0.008618185296654701, 0.029305147007107735, -0.047905754297971725, -0.015970278531312943, -0.025708140805363655, -0.02101685106754303, 0.03807860612869263, 0.06766912341117859, -0.028649423271417618, 0.026357097551226616, 0.007873553782701492, 0.03668244928121567, 0.010069752112030983, 0.04929465800523758, -0.021858766674995422, 0.028044795617461205, 0.0545240081846714, 0.011693587526679039, 0.011948050931096077, -0.001525040017440915, -0.002059594029560685, -0.009327474050223827, -0.04020661115646362, 0.0230758935213089, -0.0035414081066846848, 0.02304360643029213, 0.00812245812267065, 0.019819580018520355, 0.004926107823848724, -0.006547382567077875, 0.027136340737342834, 0.06596171110868454, 0.012930219992995262, 0.004443604964762926, -0.0015915583353489637, 0.0060853310860693455, -0.0035808116663247347, -0.007673449814319611, 0.04010266810655594, 0.022928260266780853, -0.04696013405919075, 0.05904367193579674, 0.008162081241607666, 0.011873633600771427, -0.005490403156727552, -0.000005570439952862216, 0.018588131293654442, 0.0015040917787700891, -0.010775569826364517, -0.006112430710345507, -0.015156498178839684, -0.023611726239323616, -0.02596375346183777, 0.03641636669635773, 0.016459573060274124, -0.01378582138568163, -0.0432606115937233, -0.00946817360818386, 0.020821407437324524, 0.0008026105933822691, -0.03103586845099926, 0.019252683967351913, 0.006196069996803999, -0.03747914358973503, -0.0065901936031877995, 0.03781919181346893, -0.050305504351854324, -0.03483361005783081, -0.038770824670791626, -0.061297670006752014, -0.038339145481586456, 0.008945049718022346, -0.03562789037823677, 0.029577672481536865, -0.02716720663011074, -0.023170536383986473, -0.003105719806626439, 0.051773473620414734, -0.020116379484534264, 0.024779638275504112, -0.021829331293702126, 0.006297957617789507, -0.06486093252897263, -0.047038666903972626, -0.03212331235408783, 0.003475648583844304, -0.026341482996940613, -0.02171197533607483, 0.025899406522512436, -0.006797470152378082, 0.01324769388884306, 0.06284450739622116, 0.027209408581256866, 0.009433809667825699, -0.03718610107898712, -0.022522198036313057, -0.0027714029420167208, -0.05345440283417702, 0.0654836967587471, -0.03939453512430191, 0.02378014661371708, 0.02025962993502617, -0.0008532594074495137, -0.02384713664650917, -0.02923579514026642, 0.013861267827451229, 0.04139735549688339, 0.0035674015525728464, -0.07573076337575912, -0.009963847696781158, 0.033285580575466156, 0.005765391048043966, 0.012965505011379719, 0.025754285976290703, 0.006073086988180876, -0.00358459516428411, 0.0005086896708235145, 0.014144225046038628, -0.048128288239240646, 0.029848171398043633, -0.03180635720491409, -0.07328584045171738, 0.009026574902236462, -0.015148700214922428, -0.01635684259235859, -0.014127192087471485, -0.03074047528207302, -0.05287010967731476, -0.02875099703669548, 0.01767623983323574, -0.038485169410705566, 0.023137573152780533, 0.05314107611775398, 0.04620065167546272, 0.022973600775003433, -0.011974097229540348, -0.03602505102753639, 0.03087424300611019, -0.0006831727805547416, 0.007651754189282656, 0.05285093933343887, -0.0008570699137635529, -0.019391749054193497, -0.016485214233398438, -0.0033743418753147125, 0.009537258185446262, -0.036428216844797134, 0.02311270497739315, 0.008785833604633808, -0.010029483586549759, -0.026348933577537537, 0.008565021678805351, 0.015355509705841541, 0.021771639585494995, 0.020639076828956604, -0.03882472217082977, -0.03496263548731804, 0.007517551071941853, 0.018271425738930702, -0.04765847697854042, 0.0009613644215278327, -0.034725435078144073, -0.017659267410635948, 0.019868379458785057, -0.02080579847097397, 0.03696661442518234, -0.03400910645723343, -0.023772792890667915, 0.0207586158066988, 0.018633155152201653, -0.038549575954675674, 0.0014736837474629283, -0.008778787218034267, 0.034645646810531616, -0.012127861380577087, 0.002253599464893341, -0.0029446680564433336, -0.02369832992553711, -0.055173907428979874, -0.052389707416296005, 0.04425593838095665, -0.007282369304448366, 0.005649729631841183, -0.005838046316057444, -0.0420568473637104, 0.013347681611776352, 0.05796503648161888, -0.03356552869081497, -0.048431120812892914, -0.009808464907109737 ]
Non-engineers guide: Train a LLaMA 2 chatbot
2legit2overfit
September 28, 2023
Llama2-for-non-engineers
guide, community, nlp
https://huggingface.co/blog/Llama2-for-non-engineers
Introduction to ChatUI ChatUI is exactly what it sounds like, itโ€™s the open-source UI built by Hugging Face that provides an interface to interact with open-source LLMs. Notably, it's the same UI behind HuggingChat, our 100% open-source alternative to ChatGPT. You can read more about ChatUI here.
[ 0.012726647779345512, -0.045517511665821075, 0.07286668568849564, -0.043289389461278915, 0.040332209318876266, 0.07529401034116745, -0.02214033342897892, 0.08435934036970139, 0.0028169164434075356, -0.011775342747569084, -0.08207239955663681, 0.09576316922903061, -0.049790989607572556, 0.07740382105112076, -0.0010370835661888123, -0.025078754872083664, 0.039896413683891296, -0.02809278853237629, -0.006082585081458092, 0.00216465350240469, -0.03584844991564751, -0.00500643253326416, -0.004602893255650997, -0.0983375683426857, -0.03271724656224251, -0.03488736227154732, 0.023180192336440086, 0.03884990140795708, -0.028390849009156227, 0.012836495414376259, -0.07325182110071182, -0.045617882162332535, -0.021990718320012093, -0.03925714269280434, -0.014246640726923943, -0.0020090611651539803, -0.08095819503068924, 0.05661875382065773, -0.037405967712402344, -0.01946968026459217, -0.0069825248792767525, -0.01732250675559044, -0.05874837934970856, 0.017359986901283264, -0.019964301958680153, -0.02687334083020687, -0.23717626929283142, 0.08319544792175293, -0.03347798064351082, 0.01321326196193695, -0.08742004632949829, 0.06294349581003189, -0.026603076606988907, 0.0022036556620150805, -0.00784097146242857, -0.01315813884139061, 0.016526713967323303, -0.07727853208780289, -0.015093907713890076, 0.013583093881607056, 0.06236296892166138, 0.0028547162655740976, -0.017554467543959618, 0.02600102871656418, 0.028420783579349518, 0.013978797011077404, 0.0005810727016068995, -0.045118145644664764, -0.04613039642572403, -0.0252165999263525, 0.02828635647892952, 0.027398156002163887, -0.039951812475919724, -0.027304986491799355, 0.008299940265715122, -0.04895394667983055, -0.026601901277899742, 0.07330264896154404, 0.006248101592063904, 0.014290005899965763, -0.02491498924791813, 0.03171319514513016, 0.05672858655452728, 0.04638908430933952, 0.002782900584861636, 0.0993504524230957, -0.007567986845970154, -0.05662227421998978, -0.010723656043410301, 0.019824257120490074, -0.05642435699701309, -0.0953952819108963, -0.005486274603754282, 0.01811676099896431, 0.06473903357982635, 0.01551247201859951, -0.003957491833716631, 0.005311940796673298, -0.0020864985417574644, 0.07664434611797333, 0.016242317855358124, -0.1008768305182457, 0.041092466562986374, -0.03687203302979469, -0.05632242187857628, 0.020129015669226646, -0.043936051428318024, -0.09094282984733582, -0.0069418782368302345, 0.029280608519911766, -0.013802528381347656, -0.04887194558978081, 0.08353052288293839, 0.09765221178531647, -0.07936505228281021, 0.0635710135102272, -0.02973764017224312, -0.006546508055180311, 0.04654986783862114, 0.0028181029483675957, 0.009271026588976383, -0.011921319179236889, 0.017238132655620575, 0.021450277417898178, 0.08488915115594864, 0.07783769071102142, -0.005925169214606285, -0.008001608774065971, 0.020932260900735855, -0.031350020319223404, 0.040486834943294525, 0.007433239836245775, 0.03136730566620827, -0.020073210820555687, 0.017382023856043816, -0.013614286668598652, 0.041049230843782425, -0.029514793306589127, 0.04788648337125778, 0.01859774999320507, 0.020767925307154655, 0.03691288083791733, 0.040449149906635284, 0.02213682234287262, -0.027514688670635223, 0.04359515756368637, -0.11158795654773712, 0.014773447066545486, -0.04771849140524864, -0.06884114444255829, -0.10991482436656952, 0.01644638180732727, 0.021228456869721413, -0.0015971855027601123, -0.013572141528129578, 0.03663733974099159, 0.00538606708869338, -0.035860802978277206, 0.03099214658141136, -0.04019124433398247, -0.024576988071203232, 0.044918134808540344, -0.033546097576618195, -0.013826138339936733, -0.010994723066687584, 0.021352605894207954, -0.03249658644199371, 0.010211576707661152, -0.062363047152757645, 0.023676060140132904, -0.011837207712233067, -0.05080508440732956, 0.03128606081008911, -0.017825700342655182, 0.036980628967285156, 0.01797759346663952, 0.059823617339134216, 0.023519089445471764, -0.031997211277484894, 0.04664813354611397, -0.03538433834910393, -0.0024592599365860224, 0.03228789567947388, 0.02161245048046112, -0.000027138166842632927, -0.08023858070373535, -0.018852662295103073, -0.06411123275756836, 0.03353080525994301, -0.04372202232480049, -0.030403275042772293, -0.008689619600772858, 0.018535366281867027, 0.025519931688904762, 0.0391499400138855, -0.04169771820306778, -0.04485705867409706, 0.09398776292800903, 0.07660245150327682, 0.12286795675754547, 0.021291963756084442, 0.028509415686130524, 0.0032967685256153345, -0.025913791730999947, -0.025799738243222237, 0.0014651502715423703, 0.07020026445388794, 0.014821343123912811, -0.006821694318205118, -0.03939560800790787, 0.020125404000282288, -0.09105024486780167, 0.0738317146897316, -0.00856146588921547, 0.03173002600669861, -0.048992983996868134, -0.049675095826387405, -0.03964909166097641, 0.008113296702504158, 0.02591772750020027, 0.16334137320518494, -0.07908022403717041, 0.027867170050740242, -0.010605446994304657, -0.0517868734896183, 0.05753877013921738, 0.1144009679555893, 0.05266992375254631, 0.0873960480093956, -0.09337122738361359, 0.005835746880620718, -0.06828153133392334, 0.010581787675619125, 0.018148409202694893, -0.011416606605052948, 0.013734627515077591, 0.051447317004203796, -0.03688868135213852, 0.09500467032194138, -0.025192752480506897, 0.047227974981069565, -0.050721511244773865, 0.03549216315150261, 0.03587806224822998, 0.012101755477488041, -0.06875935941934586, 0.019991274923086166, -0.008928284049034119, -0.016889940947294235, 0.037762369960546494, -0.029840843752026558, 0.05268338322639465, 0.017115414142608643, 0.017072556540369987, 0.02775886096060276, -0.009488416835665703, -0.025152701884508133, -0.00759944599121809, -0.029891755431890488, 0.061914894729852676, 0.03584453463554382, -0.015508363023400307, -0.0038005150854587555, -0.030371667817234993, -0.026386167854070663, -0.01207027118653059, 0.001662684604525566, 0.02195258066058159, -0.019120188429951668, 0.03955483436584473, 0.054136864840984344, -0.022939780727028847, 0.01851288601756096, -0.022751357406377792, 0.009833963587880135, 0.014349367469549179, 0.023131564259529114, -0.011585359461605549, -0.04107257351279259, -0.015480805188417435, -0.025181865319609642, -0.01973882131278515, 0.05975620821118355, 0.050457194447517395, 0.023721523582935333, 0.024515599012374878, 0.0050634220242500305, 0.018265198916196823, -0.042178258299827576, 0.04130789265036583, 0.02417200244963169, 0.02333073504269123, -0.03940823674201965, 0.010959196835756302, -0.02144930139183998, -0.02949429862201214, 0.038453035056591034, 0.012245139107108116, -0.024121148511767387, 0.005772309843450785, 0.03980422392487526, 0.026875028386712074, -0.01123964972794056, 0.005662916693836451, -0.010702092200517654, 0.014015516266226768, 0.03275540843605995, 0.038885436952114105, -0.10332843661308289, -0.01635602116584778, -0.005236932076513767, 0.012209909968078136, -0.02192290872335434, -0.03854619711637497, 0.050498876720666885, -0.007091861218214035, 0.012187019921839237, 0.04523911699652672, -0.006161907687783241, 0.02648288756608963, 0.0271926149725914, -0.001575909205712378, 0.005225791595876217, -0.008794112130999565, -0.04929129406809807, 0.028793608769774437, -0.010073719546198845, 0.002303679008036852, -0.04639891907572746, 0.06175466254353523, 0.005403091199696064, 0.0489656887948513, -0.024537745863199234, -0.059182461351156235, 0.03798899054527283, -0.045030176639556885, -0.0017950539477169514, -0.015145322307944298, 0.02070164680480957, 0.009107141755521297, -0.036735083907842636, 0.0704328641295433, -0.021442826837301254, 0.016509220004081726, 0.026879189535975456, 0.006123501341789961, 0.03866381570696831, 0.03735513985157013, 0.017836902290582657, -0.0029602234717458487, 0.013460580259561539, -0.04117699712514877, 0.0036371785681694746, -0.024776851758360863, -0.06270408630371094, 0.005255973432213068, 0.031243888661265373, -0.04351438954472542, -0.030044950544834137, 0.004369684029370546, 0.0038612685166299343, 0.04903937876224518, -0.01880960538983345, 0.020000841468572617, 0.006408344488590956, -0.007924910634756088, -0.012934759259223938, 0.020701775327324867, -0.05498271435499191, 0.009240574203431606, -0.060977112501859665, -0.027303945273160934, -0.03948631510138512, 0.051449984312057495, 0.019875317811965942, 0.0014688812661916018, 0.012262786738574505, 0.024069231003522873, 0.018522445112466812, 0.02875235304236412, -0.013172519393265247, 0.013574827462434769, -0.017135880887508392, 0.016888553276658058, 0.00856828037649393, -0.04573541879653931, 0.05802105739712715, 0.014980464242398739, -0.020517665892839432, -0.01575624570250511, 0.004840698093175888, -0.0258493609726429, 0.028102507814764977, -0.022436436265707016, 0.0245223306119442, -0.02312004566192627, 0.026709241792559624, 0.05016496032476425, -0.006378393154591322, -0.04845433309674263, 0.034417133778333664, 0.009582978673279285, 0.033136121928691864, 0.035513199865818024, 0.014960448257625103, 0.013480981811881065, -0.016345681622624397, -0.01581614464521408, 0.03535531461238861, -0.04017813503742218, -0.023000730201601982, 0.0042326003313064575, -0.0023169841151684523, 0.015635840594768524, -0.01674516126513481, -0.03684771806001663, 0.0365915410220623, 0.03893006220459938, 0.006229850463569164, -0.032920729368925095, 0.025669464841485023, 0.015142264775931835, 0.037433821707963943, 0.03700165078043938, -0.016924837604165077, -0.01363089308142662, -0.028020212426781654, 0.02627718448638916, -0.009068273939192295, 0.011116339825093746, -0.0007715916144661605, -0.011213108897209167, 0.023392407223582268, 0.008240743540227413, 0.03171274811029434, -0.03199224919080734, 0.0088000213727355, 0.024746129289269447, -0.015458254143595695, -0.027997076511383057, 0.04458557814359665, 0.0050023747608065605, 0.0155939981341362, 0.011098010465502739, -0.014198273420333862, 0.010361343622207642, -0.022585123777389526, -0.03908311948180199, -0.04285534471273422, -0.0016311531653627753, 0.009209642186760902, -0.01165623776614666, 0.034129250794649124, -0.010649731382727623, -0.07963380217552185, 0.013208637945353985, 0.013147134333848953, 0.046160414814949036, 0.029496653005480766, -0.04613012447953224, -0.04366777464747429, 0.024543479084968567, 0.02910727448761463, -0.006176946684718132, -0.018671009689569473, 0.0353730209171772, 0.01724875159561634, 0.07036545127630234, 0.029235145077109337, 0.024803632870316505, -0.024107981473207474, -0.0042162067256867886, -0.001095241867005825, -0.0049452148377895355, 0.024788381531834602, -0.013859391212463379, 0.03000243380665779, 0.008193135261535645, -0.015864156186580658, 0.025051072239875793, 0.022711504250764847, -0.02610364928841591, -0.02758350782096386, 0.025500444695353508, 0.04285728931427002, 0.008733479306101799, 0.0065513234585523605, 0.01786034181714058, -0.02301478572189808, -0.014141423627734184, 0.02149626798927784, -0.013095296919345856, 0.01455278042703867, -0.003844707040116191, 0.06793183833360672, 0.03810754045844078, -0.0031326294410973787, 0.005640890449285507, -0.005238047335296869, -0.009660056792199612, 0.007451681420207024, -0.028473615646362305, 0.028961308300495148, -0.006287012714892626, -0.03878207504749298, -0.015617930330336094, 0.00559213338419795, -0.008925700560212135, 0.030343072488904, 0.019796522334218025, -0.03427247703075409, -0.004130497574806213, 0.0016111605800688267, -0.03576542064547539, 0.027127062901854515, -0.04613006114959717, 0.017259204760193825, -0.007742362562566996, -0.05494478717446327, -0.025198495015501976, 0.006892914418131113, -0.04637985676527023, 0.025465210899710655, -0.01335560716688633, 0.006052035838365555, -0.036504682153463364, -0.011549293994903564, 0.015425262972712517, 0.0008735411684028804, -0.011253886856138706, -0.052379872649908066, -0.02530227042734623, 0.03389599546790123, 0.011655340902507305, -0.01366220973432064, 0.003268030472099781, 0.011507811956107616, 0.012532955966889858, 0.06941959261894226, 0.0018296393100172281, -0.0018881787545979023, 0.011366317979991436, 0.0007425161893479526, 0.03290176019072533, -0.03562520816922188, -0.005042462144047022, 0.01728391833603382, -0.0066065797582268715, -0.00449386378750205, 0.0014952814672142267, -0.04392209276556969, -0.03320792689919472, -0.04483714699745178, -0.019652873277664185, 0.061099741607904434, 0.002975328592583537, 0.014207549393177032, 0.0016069477424025536, 0.008864156901836395, -0.02126866765320301, -0.0009254665346816182, -0.025598740205168724, 0.014509407803416252, 0.008476040326058865, 0.044503580778837204, -0.008743268437683582, -0.02797245979309082, -0.008433802984654903, -0.006744562182575464, -0.07839251309633255, -0.0027337572537362576, 0.018485302105545998, -0.018239865079522133, 0.024419590830802917, 0.012936034239828587, -0.0040144952945411205, 0.01650986261665821, 0.005574265960603952, 0.023907063528895378, 0.05042969807982445, -0.018188411369919777, -0.024107739329338074, 0.008439228869974613, -0.04661828652024269, 0.0335288941860199, 0.07270856201648712, -0.016303639858961105, 0.04488919675350189, 0.03281983733177185, 0.0451393723487854, 0.0055528865195810795, 0.014582349918782711, -0.026676826179027557, 0.027584584429860115, 0.08295309543609619, -0.012930710799992085, 0.035189781337976456, 0.011040352284908295, -0.07052107900381088, -0.016513686627149582, -0.0021198333706706762, 0.01875896193087101, -0.01320436131209135, -0.007852892391383648, -0.014114532619714737, 0.00024386739823967218, 0.011947688646614552, 0.00952922273427248, 0.027305418625473976, 0.02546699531376362, 0.058002158999443054, 0.007678707595914602, 0.00849510170519352, -0.0117188710719347, -0.018993690609931946, 0.010785751044750214, 0.04118252545595169, 0.01120763923972845, 0.014770456589758396, 0.05307616665959358, 0.01520175114274025, 0.011865884065628052, -0.016367854550480843, 0.01728750951588154, 0.04506377503275871, 0.008745417930185795, -0.019225090742111206, -0.023282473906874657, 0.021823879331350327, -0.009548923000693321, -0.020693765953183174, -0.012348768301308155, 0.016818849369883537, -0.016222186386585236, 0.012511060573160648, 0.014164200983941555, 0.03404447063803673, -0.036219678819179535, 0.02960079349577427, 0.02516779862344265, -0.00772640947252512, -0.01284381840378046, -0.01665499433875084, -0.01198885403573513, -0.008688613772392273, -0.015403026714920998, -0.03263231739401817, 0.0033278900664299726, -0.008811822161078453, -0.003890792140737176, -0.02671409398317337, -0.0007058191695250571, 0.016335904598236084, 0.011778969317674637, 0.019580677151679993, 0.018392138183116913, -0.03895742446184158, 0.03142951801419258, 0.003622682997956872, 0.019155504181981087, -0.040312450379133224, -0.017175663262605667, -0.01257148664444685, -0.004035793244838715, -0.03142291679978371, -0.010633404366672039, 0.029702428728342056, -0.030817333608865738, 0.018475525081157684, 0.0295500960201025, 0.03842410445213318, -0.03723056986927986, -0.040367305278778076, 0.06476283818483353, -0.0034884982742369175, -0.034905288368463516, 0.029753923416137695, 0.020340846851468086, 0.007186741568148136, 0.008693618699908257, 0.0002559115528129041, -0.00031181221129372716, -0.01721813529729843, -0.008488966152071953, 0.042940087616443634, 0.014793320558965206, -0.06003035604953766, 0.023778731003403664, 0.03824663907289505, 0.028819873929023743, 0.009307323954999447, 0.004034478683024645, 0.02371465228497982, 0.015341034159064293, -0.025195863097906113, 0.039881881326436996, -0.04063029587268829, 0.00757926981896162, -0.030376972630620003, -0.06683297455310822, 0.013608916662633419, -0.014204195700585842, 0.01715671829879284, -0.0160604827105999, -0.03849739953875542, 0.0019045320805162191, 0.012580513954162598, 0.013366851955652237, -0.016241393983364105, 0.02538224682211876, 0.040286507457494736, -0.02378895692527294, -0.005740836262702942, -0.0005575308459810913, 0.0007230531191453338, 0.02431849017739296, 0.008246605284512043, -0.004443068988621235, 0.024834120646119118, -0.0005189572111703455, -0.020810222253203392, -0.023196805268526077, -0.010415730997920036, 0.005314819514751434, -0.04618081822991371, 0.03144463151693344, 0.023167572915554047, -0.027819087728857994, -0.034198470413684845, -0.00512343505397439, 0.02320237271487713, -0.0191090926527977, 0.0636599138379097, -0.03318354859948158, -0.030631396919488907, -0.006451466120779514, 0.012252354994416237, -0.057237520813941956, 0.008868817239999771, -0.004055518191307783, -0.009452080354094505, 0.01306995190680027, -0.01255603227764368, 0.013969001360237598, -0.033093128353357315, 0.018544532358646393, 0.001704235328361392, 0.020971454679965973, -0.05005865916609764, -0.025264639407396317, -0.007087214849889278, -0.003794587217271328, -0.04906177520751953, -0.0062449779361486435, -0.0018458050908520818, -0.01929911971092224, 0.003455378348007798, -0.018408343195915222, -0.01544834766536951, -0.049744024872779846, -0.01340153906494379, 0.054633595049381256, 0.0153209138661623, 0.05261079594492912, 0.010008133016526699, -0.03412170335650444, -0.03340530768036842, -0.0025960863567888737 ]
Non-engineers guide: Train a LLaMA 2 chatbot
2legit2overfit
September 28, 2023
Llama2-for-non-engineers
guide, community, nlp
https://huggingface.co/blog/Llama2-for-non-engineers
# Non-engineers guide: Train a LLaMA 2 chatbot
[ 0.059697289019823074, -0.005086615215986967, 0.08800271153450012, 0.030755026265978813, 0.11959929019212723, -0.005103194620460272, 0.038165248930454254, 0.05259295180439949, 0.0016484929947182536, -0.03482966125011444, -0.07831870019435883, 0.10124298930168152, -0.09172054380178452, 0.04201493039727211, -0.011869913898408413, -0.02583514340221882, -0.013856157660484314, -0.008044314570724964, 0.024632323533296585, 0.015060050413012505, -0.04367769509553909, -0.009017301723361015, 0.06443186849355698, -0.07452824711799622, 0.005686054937541485, -0.024426152929663658, -0.00379055249504745, 0.03605927899479866, -0.065647654235363, 0.0162630807608366, -0.054135847836732864, -0.011878886260092258, 0.03567294031381607, -0.05185853689908981, -0.027405790984630585, 0.021336203441023827, -0.11414460837841034, 0.0379600003361702, 0.016273315995931625, -0.03696716949343681, -0.06614094972610474, -0.06401039659976959, -0.045665495097637177, 0.04388909786939621, -0.05821533128619194, 0.018432261422276497, -0.20172201097011566, 0.0005159713327884674, -0.016939973458647728, -0.027753353118896484, -0.07582033425569534, 0.0911661684513092, 0.013223443180322647, -0.018632911145687103, -0.0015590222319588065, 0.06053442507982254, 0.040368352085351944, -0.06091954931616783, -0.06935461610555649, -0.013018823228776455, 0.038574542850255966, 0.0539361946284771, 0.015141156502068043, 0.01813902147114277, 0.02309444360435009, 0.025572778657078743, 0.03401833400130272, -0.002581513486802578, -0.08243504166603088, -0.007377217058092356, 0.044530920684337616, -0.06084704399108887, -0.06415965408086777, -0.05800880119204521, 0.024795960634946823, -0.12239556014537811, 0.013836507685482502, 0.03945380449295044, 0.01997498795390129, 0.07292455434799194, -0.027843553572893143, 0.014475420117378235, 0.05792979896068573, 0.1103375032544136, 0.017413625493645668, 0.07118219882249832, 0.06678686290979385, -0.005416452884674072, -0.027009963989257812, 0.05716061219573021, -0.03915107995271683, -0.07159654796123505, -0.05597524344921112, -0.004410997033119202, 0.10602879524230957, -0.007992461323738098, -0.03287998214364052, -0.026958657428622246, -0.024226868525147438, 0.014131744392216206, -0.051691822707653046, -0.029665080830454826, 0.05106521397829056, 0.01316559873521328, -0.04029485210776329, 0.004906181711703539, -0.03574897721409798, -0.09629520773887634, -0.07605759799480438, -0.01854288950562477, -0.017931530252099037, -0.0407516211271286, 0.07496879994869232, 0.07237102091312408, -0.05186428874731064, 0.07566574215888977, 0.01606903411448002, 0.015187306329607964, -0.001871577580459416, 0.030753709375858307, 0.06237613409757614, 0.05775102600455284, 0.04862518981099129, -0.012620225548744202, 0.023689445108175278, 0.05719069018959999, 0.007299506105482578, 0.06871620565652847, -0.04239441826939583, 0.008331242017447948, 0.013415523804724216, -0.01901637762784958, 0.012044721283018589, -0.007592083886265755, -0.021203957498073578, -0.03364026919007301, -0.03747735172510147, -0.0039956895634531975, 0.030349628999829292, 0.041818588972091675, -0.023047106340527534, 0.07508930563926697, 0.06084734946489334, 0.03971073776483536, 0.05124858766794205, 0.06969644874334335, -0.04201814904808998, 0.012024317868053913, -0.02397162653505802, -0.03387322276830673, -0.052230145782232285, -0.005150419194251299, -0.07368233054876328, -0.061060648411512375, 0.03966490551829338, 0.01267591305077076, -0.010320381261408329, -0.015690725296735764, -0.030861614271998405, -0.002609839430078864, -0.015520218759775162, -0.00045753034646622837, -0.03223014250397682, -0.006944519933313131, 0.04556146264076233, -0.03589923307299614, 0.007593863178044558, 0.002905681263655424, -0.020765643566846848, -0.019441014155745506, 0.016405973583459854, -0.06667420268058777, 0.04618135467171669, -0.008839956484735012, -0.008363952860236168, 0.013112529180943966, 0.0059184967540204525, 0.017253052443265915, 0.006487613078206778, 0.028493845835328102, -0.027521908283233643, 0.005688106641173363, -0.007407124619930983, 0.03665907680988312, 0.01578029990196228, -0.07701997458934784, -0.00254817889072001, -0.049207039177417755, -0.03791620954871178, -0.04240434244275093, -0.011606360785663128, -0.023707842454314232, 0.027612367644906044, 0.02249019220471382, 0.033195894211530685, -0.024754058569669724, -0.014109853655099869, 0.13531368970870972, 0.07754390686750412, 0.09662668406963348, 0.03427433222532272, 0.041968606412410736, 0.02080661430954933, -0.005276655778288841, -0.05608811229467392, 0.03805667906999588, 0.042474981397390366, -0.02648599073290825, 0.012359506450593472, 0.014735178090631962, -0.03935318812727928, -0.062208954244852066, 0.055856455117464066, -0.05339447781443596, 0.03935704380273819, -0.03324247896671295, 0.011763221584260464, -0.0219747181981802, 0.003366774646565318, -0.02725360170006752, 0.11432959139347076, -0.0236708614975214, 0.0055703516118228436, -0.0005386139382608235, 0.012094988487660885, 0.07449660450220108, 0.07441528141498566, 0.027185695245862007, 0.0888732522726059, -0.08314108103513718, -0.03228238224983215, -0.007103893905878067, 0.0003502671606838703, 0.04016098752617836, -0.004622038919478655, 0.0067480518482625484, 0.014244145713746548, -0.052571576088666916, 0.07956984639167786, -0.027591854333877563, -0.015539093874394894, 0.0023431002628058195, 0.028606880456209183, 0.09729967266321182, -0.094293013215065, 0.00018131172691937536, 0.038935985416173935, -0.00747624970972538, -0.036803461611270905, 0.05197897553443909, -0.03494156152009964, 0.021883731707930565, 0.06024966761469841, 0.036005470901727676, 0.022577675059437752, -0.030664101243019104, -0.05965478718280792, -0.05044884979724884, -0.042233094573020935, 0.02199375629425049, 0.004577624145895243, -0.0054009477607905865, -0.00975166168063879, -0.006353568285703659, -0.029097452759742737, -0.038944873958826065, 0.024756215512752533, 0.0009795259684324265, -0.0309812780469656, 0.038074884563684464, 0.017215555533766747, -0.015696587041020393, 0.06375707685947418, -0.003047375474125147, 0.014319329522550106, -0.0117779690772295, 0.05110383778810501, 0.0019143696408718824, -0.020413881167769432, -0.017412710934877396, 0.018918780609965324, -0.014141557738184929, 0.042218104004859924, 0.0361034981906414, 0.013377325609326363, -0.025832828134298325, 0.015858164057135582, -0.024300625547766685, -0.004517892841249704, 0.037258636206388474, -0.009510005824267864, -0.004166250117123127, -0.022155120968818665, 0.012062184512615204, -0.0073469155468046665, -0.05516572669148445, 0.021437104791402817, -0.004431971348822117, 0.004103703889995813, 0.028028342872858047, 0.046137526631355286, 0.011237554252147675, -0.03138207271695137, 0.0032602346036583185, -0.012050904333591461, -0.005644395016133785, 0.032516006380319595, -0.009982747957110405, -0.12140032649040222, -0.03521071374416351, 0.008069800212979317, 0.026731960475444794, -0.004393346142023802, -0.022611506283283234, 0.050170619040727615, -0.04862155765295029, -0.02387971244752407, 0.006527177058160305, -0.026878919452428818, 0.037040334194898605, 0.0033690377604216337, -0.01323795598000288, -0.015926580876111984, -0.04021245613694191, -0.021622465923428535, -0.004318921361118555, 0.007493981160223484, -0.017475906759500504, -0.06114375218749046, 0.05795369669795036, -0.012261555530130863, 0.030801361426711082, 0.0026592882350087166, 0.0009268894209526479, 0.03128347173333168, 0.000817568798083812, 0.044409677386283875, -0.006954807788133621, 0.015491988509893417, 0.04286418482661247, -0.06552880257368088, 0.013749141246080399, -0.035244908183813095, 0.03988524526357651, 0.03026212379336357, 0.029203595593571663, 0.04432840272784233, 0.061483658850193024, 0.01948666013777256, 0.002800415735691786, 0.03428143262863159, -0.0496613085269928, -0.042105600237846375, -0.009344453923404217, -0.025575898587703705, -0.0014555068919435143, 0.056300628930330276, -0.03372982144355774, -0.01578204333782196, -0.000715461268555373, 0.010535423643887043, 0.040743257850408554, 0.029480433091521263, 0.008626354858279228, 0.005485809873789549, 0.03392695263028145, 0.01530796941369772, 0.005729384254664183, -0.06301355361938477, 0.024149911478161812, -0.005069155246019363, 0.013040203601121902, -0.06505507230758667, 0.02331681363284588, 0.014050627127289772, 0.03031119331717491, 0.00910469051450491, 0.012982281856238842, 0.027862509712576866, 0.00643811235204339, -0.02805604599416256, 0.012580400332808495, -0.016238700598478317, 0.0719384029507637, -0.020480377599596977, 0.019958870485424995, 0.09625812619924545, 0.021057233214378357, -0.009729289449751377, -0.042104464024305344, -0.0034328254405409098, -0.015181337483227253, 0.009765712544322014, -0.0019110493594780564, 0.03676106035709381, -0.04430901259183884, 0.0025567442644387484, 0.05164250358939171, -0.031524717807769775, -0.028913797810673714, 0.04393943399190903, -0.009648039005696774, 0.023915600031614304, 0.011442255228757858, 0.013874669559299946, -0.003900590818375349, -0.04252051189541817, 0.041800860315561295, 0.04531005397439003, 0.0040268548764288425, 0.001077070483006537, 0.038426779210567474, -0.003934182226657867, 0.03780149668455124, 0.0040981057099998, -0.06556641310453415, -0.00526895746588707, 0.008746291510760784, 0.008467351086437702, -0.03383203223347664, 0.00820849183946848, -0.008670174516737461, -0.01196188572794199, 0.022304881364107132, -0.006598544307053089, -0.005170843098312616, -0.023660846054553986, 0.01671188697218895, -0.04057304933667183, -0.0061643472872674465, 0.01565219834446907, 0.010092806071043015, 0.026957178488373756, -0.030242828652262688, 0.04283168911933899, 0.004443822894245386, 0.010417191311717033, -0.02432856336236, -0.03288321942090988, -0.016747454181313515, -0.013675403781235218, -0.018922386690974236, 0.026201996952295303, 0.011787036433815956, -0.0026524991262704134, 0.022120794281363487, -0.007895379327237606, -0.04659900441765785, -0.031224315986037254, 0.02044813707470894, 0.018207905814051628, -0.030826028436422348, 0.014869480393826962, -0.013646201230585575, -0.033761799335479736, -0.0055501097813248634, 0.005405713338404894, 0.024780090898275375, 0.0015702919336035848, -0.05285109952092171, -0.01942032389342785, -0.003836430376395583, 0.026315508410334587, 0.014661633409559727, 0.0015568194212391973, 0.026072945445775986, -0.042313992977142334, 0.035255316644907, -0.023345256224274635, -0.026511823758482933, -0.05148928612470627, -0.017705140635371208, 0.02035527676343918, -0.040741778910160065, 0.021317483857274055, -0.05028411000967026, 0.05412530526518822, -0.038843438029289246, 0.00358263379894197, 0.01092920359224081, 0.01965261436998844, -0.02304886281490326, 0.03857190161943436, 0.04237130656838417, 0.043498773127794266, 0.020133690908551216, 0.01060336921364069, -0.004520069342106581, -0.029022375121712685, -0.025382814928889275, 0.04041615501046181, 0.003714152844622731, -0.038440216332674026, -0.0012052841484546661, 0.08625248074531555, 0.03705175593495369, 0.02952289581298828, 0.036493293941020966, 0.005626484286040068, -0.012610997073352337, 0.01807316020131111, -0.02530289627611637, -0.008554210886359215, 0.004187214653939009, -0.008640265092253685, 0.02873043715953827, -0.020632877945899963, -0.00980465766042471, -0.008695496246218681, -0.009219140745699406, -0.035047534853219986, -0.043273795396089554, 0.03808028623461723, -0.022031839936971664, -0.01389269158244133, -0.0236345287412405, 0.0381183847784996, 0.004548612516373396, -0.019929613918066025, -0.0266236774623394, -0.0012256025802344084, -0.035508278757333755, -0.008944723755121231, -0.01567736640572548, -0.040442369878292084, 0.04450538009405136, 0.02341320365667343, 0.0016380124725401402, -0.011157034896314144, 0.0023328096140176058, -0.017369691282510757, 0.007586669642478228, 0.0637982040643692, -0.010258926078677177, -0.0009054043330252171, 0.03512957692146301, 0.015160626731812954, 0.010996641591191292, 0.011235253885388374, -0.02262170799076557, 0.03560031205415726, 0.05991825461387634, -0.009179132990539074, 0.0034922785125672817, -0.07917405664920807, 0.0269425380975008, 0.03246274217963219, -0.0064667039550840855, 0.004074320197105408, -0.03807276114821434, -0.03312142193317413, -0.039358753710985184, -0.012007612735033035, 0.016650831326842308, 0.031169205904006958, 0.017430230975151062, 0.012294471263885498, -0.00871699582785368, 0.017438212409615517, -0.00996839627623558, 0.012172704562544823, 0.03639070689678192, -0.0073185269720852375, 0.02654625102877617, 0.040462713688611984, 0.0025385983753949404, -0.012148414738476276, -0.03143884241580963, 0.01325918734073639, -0.03372808173298836, -0.028925707563757896, -0.0014039560919627547, 0.006031868513673544, 0.028239315375685692, -0.01586187444627285, -0.02392314374446869, 0.0018158871680498123, 0.008032575249671936, -0.0036155185662209988, 0.01446473877876997, 0.02301446534693241, 0.026614366099238396, -0.007759409490972757, -0.05555218085646629, 0.031230302527546883, 0.07451312243938446, -0.006922821048647165, 0.05343227833509445, 0.00780101865530014, 0.03684312105178833, 0.012286456301808357, 0.010473400354385376, -0.0221419557929039, 0.03404253348708153, 0.03801041841506958, -0.011589420028030872, 0.03187244385480881, 0.03650856390595436, 0.01749338209629059, -0.011514987796545029, -0.02873823791742325, -0.009673929773271084, -0.049295537173748016, 0.04044138640165329, 0.05195202678442001, -0.02273034118115902, 0.01281758863478899, -0.04300159960985184, 0.0277638528496027, 0.02037520706653595, 0.02472420036792755, 0.006363024935126305, 0.019771801307797432, 0.004140065982937813, -0.014473795890808105, 0.008428026922047138, 0.015144748613238335, -0.02703525498509407, -0.020779388025403023, 0.027328046038746834, -0.005371488630771637, 0.046325959265232086, 0.003180906642228365, -0.014131095260381699, 0.038064636290073395, 0.006060770247131586, 0.011788956820964813, 0.023783931508660316, 0.023731516674160957, -0.011702110059559345, -0.007753859739750624, -0.030328385531902313, 0.046676844358444214, -0.051780011504888535, 0.00016619119560346007, -0.012463410384953022, 0.022256415337324142, -0.023896759375929832, -0.008933793753385544, 0.042108938097953796, 0.028684178367257118, -0.012009971775114536, -0.005481180269271135, -0.015712320804595947, -0.010085716843605042, -0.004821733105927706, -0.016245244070887566, -0.023527145385742188, -0.018361758440732956, -0.025037312880158424, -0.0047048223204910755, -0.00030306450207717717, -0.031232161447405815, -0.024800188839435577, 0.021906748414039612, -0.00580797903239727, -0.02122829109430313, 0.02654336765408516, -0.00034227006835862994, 0.025178581476211548, -0.03555261716246605, -0.022887462750077248, -0.002500074915587902, 0.005044468212872744, -0.013971236534416676, -0.02193172089755535, 0.006746349856257439, 0.0069984737783670425, -0.022284867241978645, 0.07474146783351898, 0.027296166867017746, 0.0043977792374789715, 0.00150815409142524, 0.023318076506257057, -0.006830169353634119, -0.04491884261369705, 0.041100144386291504, 0.008860067464411259, -0.013970959931612015, -0.015314670279622078, -0.0068707894533872604, 0.0012755944626405835, 0.0043166582472622395, 0.03667626902461052, 0.03236816078424454, -0.019285116344690323, -0.014778115786612034, -0.0055166431702673435, 0.06248725950717926, -0.01960398629307747, 0.011218865402042866, -0.0020763124339282513, 0.010437575168907642, -0.026339488103985786, -0.03814325109124184, 0.03610566630959511, -0.028572753071784973, -0.024864014238119125, -0.028368085622787476, -0.03901451826095581, -0.047633733600378036, -0.004656750708818436, -0.016391219571232796, 0.017499133944511414, -0.03771549463272095, -0.03191688284277916, 0.0065614935010671616, -0.011565277352929115, -0.03104723058640957, 0.04065825045108795, 0.06478501111268997, 0.033661242574453354, 0.0294698104262352, -0.008770409040153027, -0.0009207067778334022, -0.012759711593389511, 0.012190361507236958, 0.028762364760041237, 0.02508574351668358, 0.02034219168126583, -0.03311014920473099, -0.00619880435988307, 0.036666907370090485, -0.02589206025004387, -0.03381489962339401, -0.024016734212636948, -0.0031128795817494392, -0.00770451920107007, -0.0028398754075169563, -0.036619216203689575, -0.0005838991492055357, -0.015576978214085102, 0.04429762810468674, -0.020044103264808655, -0.016453474760055542, -0.0019944384694099426, 0.018166139721870422, -0.06648299843072891, 0.015527159906923771, 0.0014721449697390199, 0.002131799701601267, -0.0010979376966133714, 0.024099363014101982, -0.02555648796260357, -0.004880174994468689, -0.0103350430727005, 0.036006052047014236, 0.0202937088906765, -0.011583052575588226, -0.010278127156198025, -0.01048057246953249, -0.030945315957069397, -0.05336907133460045, -0.042905449867248535, 0.028799137100577354, -0.01706536114215851, -0.029994424432516098, -0.03153169900178909, 0.012955548241734505, -0.03376181423664093, 0.02564862184226513, 0.0012854752130806446, 0.017283836379647255, 0.04513269290328026, 0.016123192384839058, -0.015891561284661293, 0.02547510154545307, 0.03180297091603279 ]
Finetune Stable Diffusion Models with DDPO via TRL
metric-space
September 29, 2023
trl-ddpo
guide, diffusers, rl, rlhf
https://huggingface.co/blog/trl-ddpo
Lessons learned 1. The results seem to generalize over a wide variety of prompts despite the minimally sized training prompts size. This has been thoroughly verified for the objective function that rewards aesthetics 2. Attempts to try to explicitly generalize at least for the aesthetic objective function by increasing the training prompt size and varying the prompts seem to slow down the convergence rate for barely noticeable learned general behavior if at all this exists 3. While LoRA is recommended and is tried and tested multiple times, the non-LoRA is something to consider, among other reasons from empirical evidence, non-Lora does seem to produce relatively more intricate images than LoRA. However, getting the right hyperparameters for a stable non-LoRA run is significantly more challenging. 4. Recommendations for the config parameters for non-Lora are: set the learning rate relatively low, something around 1e-5 should do the trick and set mixed_precision to None
[ 0.1140013039112091, -0.05710815638303757, -0.00456884503364563, -0.002916807308793068, 0.03139301761984825, 0.06491093337535858, -0.00925893522799015, 0.0748186931014061, -0.05381450802087784, -0.049211159348487854, -0.026871781796216965, -0.008839413523674011, 0.012410057708621025, -0.002682392718270421, -0.025226354598999023, 0.011027718894183636, 0.05758154019713402, -0.02916146069765091, -0.005339376162737608, 0.07673358917236328, -0.01834402047097683, 0.005996630992740393, 0.06996616721153259, -0.021960796788334846, 0.011249992065131664, -0.049840040504932404, -0.0008185739279724658, 0.030474821105599403, -0.04549889266490936, 0.008540571667253971, -0.1106417253613472, -0.04998645558953285, -0.020148875191807747, -0.03009611926972866, 0.029708992689847946, -0.031346481293439865, -0.04411862790584564, 0.03225615993142128, 0.0424957275390625, 0.03992975130677223, 0.0103955939412117, -0.028029832988977432, -0.030537324026226997, 0.024711988866329193, 0.025810638442635536, -0.00034374272217974067, -0.17412182688713074, 0.04263782501220703, -0.05128870904445648, 0.026530450209975243, -0.11039751768112183, 0.06588391214609146, 0.044435031712055206, 0.01522549893707037, 0.034339193254709244, -0.0003902768949046731, 0.019896220415830612, -0.011638423427939415, 0.022504355758428574, -0.023588508367538452, 0.004654571879655123, -0.004096502438187599, -0.0308972280472517, 0.010605283081531525, 0.029257534071803093, 0.017363160848617554, -0.02343573607504368, 0.028725266456604004, -0.02211879938840866, -0.03183548524975777, 0.0676937997341156, -0.03818780183792114, 0.027810625731945038, -0.020877299830317497, -0.02517084591090679, -0.05591302365064621, 0.06404081732034683, 0.058385610580444336, 0.013521180488169193, -0.020968914031982422, -0.006540198810398579, -0.019417230039834976, 0.0693722665309906, 0.01995261013507843, -0.008794639259576797, -0.00769214890897274, 0.0326441153883934, -0.016398318111896515, -0.04333428293466568, -0.04714361950755119, -0.054945219308137894, -0.10595208406448364, 0.004319994244724512, 0.04962098225951195, 0.006016156170517206, -0.03065953589975834, -0.016677161678671837, -0.030947120860219002, 0.005585540551692247, -0.01477755606174469, -0.041048645973205566, -0.004345523193478584, 0.004467699211090803, -0.09056122601032257, -0.0897001177072525, 0.015039235353469849, -0.08994534611701965, -0.05097586289048195, -0.06711325794458389, 0.05842462554574013, -0.04776771366596222, 0.0906951054930687, 0.027176478877663612, 0.04473559558391571, -0.09720678627490997, 0.037792615592479706, -0.02563370205461979, 0.04882703348994255, 0.016329452395439148, -0.043886590749025345, 0.007358877453953028, 0.10169646143913269, 0.015323096886277199, -0.04264714568853378, -0.03550354763865471, 0.04133984073996544, 0.09513237327337265, 0.0036152584943920374, -0.07486439496278763, -0.011152363382279873, -0.044021863490343094, -0.01743004471063614, -0.003518137615174055, -0.010187730193138123, 0.014231001026928425, -0.10499674081802368, -0.029265135526657104, -0.03644556924700737, 0.015354650095105171, 0.007976815104484558, -0.07528539001941681, -0.006511308252811432, -0.018902406096458435, 0.018280629068613052, -0.0003551534318830818, -0.030913950875401497, 0.02926521748304367, -0.021705107763409615, -0.008789245039224625, -0.014862380921840668, -0.036025188863277435, 0.09896448254585266, -0.07957916706800461, -0.07645528763532639, 0.03257190063595772, 0.01288054883480072, 0.0321035161614418, -0.06541892141103745, -0.0452270582318306, -0.007940738461911678, -0.0043928674422204494, 0.03586573526263237, -0.023978330194950104, -0.01562100276350975, 0.08239303529262543, -0.05783579498529434, 0.00517577538266778, 0.030281780287623405, -0.0056561497040092945, 0.04399304836988449, 0.061287980526685715, -0.024259978905320168, 0.10143354535102844, -0.026460086926817894, -0.05016441270709038, 0.009396669454872608, 0.04506506398320198, 0.02622930519282818, 0.006899145897477865, 0.016176557168364525, -0.020857781171798706, 0.06758435070514679, -0.027501177042722702, -0.0025110719725489616, 0.03495260700583458, -0.11264738440513611, 0.03550863265991211, 0.011289625428617, -0.0637344941496849, -0.008836278691887856, -0.06447069346904755, 0.04873013123869896, 0.06688787043094635, 0.01151345670223236, 0.01863921247422695, -0.059148725122213364, -0.048027556389570236, 0.10561227053403854, 0.054718017578125, 0.016261255368590355, 0.0799022987484932, 0.018381647765636444, 0.10297419130802155, -0.0360620878636837, -0.06897155195474625, -0.0031566903926432133, -0.04053962603211403, -0.010215911082923412, 0.007230436895042658, 0.005295972339808941, -0.0393013097345829, -0.12215569615364075, 0.005230071023106575, -0.03426539897918701, 0.05289255455136299, 0.035898588597774506, 0.07972157001495361, -0.04777145013213158, -0.01563260331749916, -0.003983862232416868, 0.08643236011266708, 0.04397080838680267, 0.013581817969679832, 0.008087711408734322, -0.021734200417995453, 0.06336407363414764, 0.04813982546329498, -0.022833216935396194, 0.03687676414847374, -0.08064494282007217, -0.03326123207807541, -0.06842105090618134, 0.0030009103938937187, 0.10180936008691788, -0.001509243855252862, 0.025945382192730904, 0.06120845302939415, -0.07100941985845566, 0.0433623343706131, -0.038939669728279114, -0.04069403186440468, 0.040232978761196136, 0.0156402587890625, 0.08092156797647476, -0.026775559410452843, -0.023197369650006294, 0.012740843929350376, 0.05649736523628235, -0.0669504925608635, -0.008115418255329132, -0.10120436549186707, 0.06409768760204315, -0.02363298460841179, -0.03323892131447792, 0.027158470824360847, -0.008755731396377087, -0.006999145727604628, -0.04694214090704918, -0.008755474351346493, -0.01898864284157753, -0.015190583653748035, 0.002989822532981634, -0.010832552798092365, 0.009625278413295746, 0.041330382227897644, -0.01177760399878025, -0.015965908765792847, -0.009458997286856174, 0.034437280148267746, 0.014553489163517952, -0.007228818256407976, -0.02985045313835144, 0.012328178621828556, 0.03797200694680214, -0.029006965458393097, -0.004563953727483749, 0.019646869972348213, -0.025206629186868668, -0.019529199227690697, -0.015798917040228844, -0.008299734443426132, 0.007769383490085602, 0.003370617749169469, -0.007274204399436712, 0.02364489808678627, -0.012159864418208599, 0.002876421669498086, 0.0002579160500317812, -0.028130004182457924, 0.023262575268745422, 0.012051272206008434, 0.005281767342239618, -0.006632523145526648, 0.008342543616890907, -0.0012666552793234587, 0.0005265590734779835, 0.021282050758600235, 0.033587805926799774, -0.028218494728207588, -0.030051473528146744, 0.011254329234361649, -0.007833604700863361, 0.028430398553609848, -0.018293999135494232, -0.026225198060274124, 0.03758648410439491, 0.026848703622817993, 0.07591422647237778, -0.10565078258514404, 0.007577480748295784, -0.009974335320293903, 0.10320813953876495, -0.049480706453323364, -0.02248910255730152, 0.06814825534820557, -0.007730117999017239, 0.003030827036127448, -0.026019033044576645, -0.005112593062222004, 0.04247886687517166, 0.0020830659195780754, 0.020982932299375534, -0.01926802657544613, 0.0021220589987933636, 0.0002844505070243031, -0.021480748429894447, 0.03296684846282005, 0.05994577333331108, -0.01432033535093069, 0.008641970343887806, 0.010606375522911549, 0.01571383886039257, -0.023174189031124115, 0.010457984171807766, -0.0007088274578563869, 0.012629049830138683, 0.01878424920141697, -0.08313512057065964, 0.044085822999477386, -0.007396547589451075, -0.02369002252817154, 0.06399570405483246, -0.031024178490042686, 0.01928441785275936, -0.03185397759079933, 0.00806165486574173, 0.0025295268278568983, 0.05688322335481644, -0.006267796736210585, 0.024574970826506615, 0.0263398215174675, 0.03811444342136383, -0.006584102287888527, 0.015584539622068405, 0.014577646739780903, -0.00511140888556838, 0.057906195521354675, -0.06898394227027893, -0.0318235419690609, 0.011956151574850082, -0.00760248675942421, 0.0855119377374649, -0.008839059621095657, 0.010722914710640907, -0.028434928506612778, 0.016292180866003036, 0.006579529959708452, -0.03522912412881851, -0.028497569262981415, 0.01774585247039795, 0.007411543745547533, 0.008485350757837296, -0.019941652193665504, 0.061025165021419525, 0.010410481132566929, -0.0045692287385463715, -0.022532623261213303, 0.01489891204982996, 0.025441111996769905, 0.023479267954826355, -0.008532345294952393, -0.0038740960881114006, 0.00785585306584835, -0.02411484718322754, -0.01594969630241394, 0.029852934181690216, 0.024950342252850533, 0.004481573589146137, -0.02837332710623741, 0.001600227551534772, -0.028301244601607323, -0.03631573170423508, -0.006840990390628576, 0.035499174147844315, 0.026410702615976334, -0.044801391661167145, 0.015474900603294373, 0.040474966168403625, 0.027357904240489006, -0.01869375817477703, 0.010100413113832474, -0.0010960837826132774, 0.012190590612590313, 0.005001997109502554, 0.051332104951143265, -0.0029516874346882105, 0.026586612686514854, 0.044012945145368576, 0.020275890827178955, 0.0029848595149815083, -0.009488762356340885, 0.011566749773919582, 0.02035522274672985, -0.0028226759750396013, -0.05999317392706871, -0.00640335027128458, -0.02054494433104992, -0.015564503148198128, 0.02215607278048992, -0.0501151978969574, 0.005710412748157978, -0.01276133768260479, 0.021047290414571762, 0.05616980046033859, -0.03256016597151756, 0.0036673222202807665, -0.03588801249861717, 0.016717445105314255, -0.017601188272237778, 0.004508031997829676, 0.01445295661687851, -0.016191750764846802, 0.055314913392066956, 0.019103290513157845, -0.013787358067929745, 0.044570863246917725, -0.0022936752066016197, 0.021773595362901688, -0.01471243891865015, -0.05228203907608986, -0.012756353244185448, 0.032330188900232315, 0.023060623556375504, -0.014275372959673405, -0.03712328523397446, 0.015362989157438278, -0.04328320175409317, -0.02099917083978653, -0.01159269642084837, -0.0036743497475981712, 0.04384300485253334, 0.015832601115107536, 0.04026131331920624, 0.0021105059422552586, 0.006954091135412455, -0.0044063082896173, 0.0044553242623806, 0.016997506842017174, 0.028768153861165047, -0.017207827419042587, -0.01966891810297966, 0.006150177214294672, 0.00845776405185461, -0.029875729233026505, -0.05614699795842171, -0.006404321175068617, -0.014416060410439968, 0.02094714343547821, 0.008695242926478386, 0.0014853437896817923, -0.04853907972574234, 0.04532114416360855, -0.014459568075835705, -0.03210025653243065, 0.026436517015099525, 0.005083797499537468, 0.001253864960744977, -0.030297420918941498, 0.02253059297800064, -0.034433942288160324, 0.0021761187817901373, -0.03556070476770401, 0.04290574789047241, 0.001530181267298758, 0.03575383871793747, -0.004554056096822023, 0.004139170050621033, 0.004808171186596155, -0.011445020325481892, -0.00917726382613182, 0.07175704836845398, -0.0034453317057341337, -0.00009637838957132772, 0.010570251382887363, 0.026765627786517143, 0.022393597289919853, 0.0312659852206707, 0.02950332686305046, 0.004081357270479202, 0.008888479322195053, 0.0016695373924449086, -0.02193617634475231, -0.011735470965504646, -0.004934965167194605, -0.01150485035032034, 0.04372158646583557, -0.011432086117565632, -0.003579668002203107, 0.0072022718377411366, -0.00012715764751192182, -0.0127215925604105, -0.024756891652941704, 0.026018451899290085, 0.010816092602908611, 0.028106991201639175, 0.0180218368768692, 0.014671987853944302, -0.03958209231495857, -0.004108778201043606, -0.0076858773827552795, -0.054633453488349915, -0.0054742731153965, -0.013928153552114964, -0.04740002378821373, -0.04233459010720253, 0.05834595486521721, 0.008742808364331722, 0.03125160560011864, 0.02392810583114624, 0.006722406484186649, -0.0377177856862545, 0.003664739429950714, 0.007014538161456585, -0.04045001044869423, 0.034919969737529755, -0.008646116591989994, -0.026160486042499542, 0.012488518841564655, 0.010102097876369953, -0.010372089222073555, -0.017731593921780586, 0.005200207699090242, 0.040577784180641174, -0.0370827317237854, -0.04810745269060135, 0.05436137318611145, 0.036345161497592926, 0.04036317765712738, -0.0035542082041502, 0.020422538742423058, -0.006293425802141428, 0.002897698665037751, -0.04570755735039711, 0.07930896431207657, -0.0017273328267037868, -0.011479045264422894, -0.03528254106640816, -0.012681087478995323, 0.03946929797530174, -0.013054987415671349, -0.016108080744743347, 0.002022337866947055, 0.024305107071995735, 0.047039687633514404, 0.030034564435482025, -0.018532559275627136, 0.030787209048867226, -0.00031734947697259486, 0.02620827965438366, -0.02127331867814064, 0.028342684730887413, 0.0069559235125780106, -0.00016193609917536378, 0.042668767273426056, 0.021567922085523605, 0.006462732795625925, 0.030495908111333847, 0.028607208281755447, 0.03524882346391678, 0.004661348648369312, 0.01889224722981453, 0.006751652806997299, -0.03501966968178749, -0.006056805141270161, -0.019849922508001328, 0.01951192133128643, 0.03282181918621063, -0.01012293342500925, 0.027725227177143097, 0.044051796197891235, 0.06870750337839127, -0.00979062169790268, 0.020203907042741776, 0.0002888469025492668, 0.038937706500291824, 0.008156374096870422, 0.018569625914096832, -0.012332304380834103, -0.016681233420968056, -0.03651881590485573, 0.006482137832790613, -0.029373308643698692, -0.0016884043579921126, 0.010892262682318687, 0.01978755183517933, 0.012657832354307175, 0.005805111490190029, -0.02387060970067978, -0.0003818456898443401, 0.003613722277805209, 0.03597329929471016, 0.007721927482634783, -0.008336620405316353, -0.00027079530991613865, 0.049196988344192505, -0.0282130129635334, 0.0342574268579483, 0.009560019709169865, -0.025953007861971855, 0.012416563928127289, 0.009843653067946434, -0.01990986056625843, -0.01548557635396719, -0.002789474790915847, -0.017345288768410683, -0.0363086499273777, 0.04966140538454056, 0.043218474835157394, 0.032607898116111755, 0.009109936654567719, -0.004587031435221434, -0.023445257917046547, -0.05639325827360153, -0.013725416734814644, 0.009295021183788776, -0.026453914120793343, 0.014864659868180752, 0.031210482120513916, 0.010213031433522701, 0.02421211451292038, 0.005251665599644184, -0.03169490769505501, -0.0018257828196510673, -0.016441266983747482, 0.0014142090221866965, 0.02408985234797001, -0.008884984999895096, -0.04192894697189331, 0.0021954230032861233, 0.013576258905231953, 0.02045031636953354, 0.02855592407286167, 0.021884426474571228, 0.03422778844833374, 0.01962985284626484, 0.008863940834999084, -0.0006561859627254307, -0.004967309068888426, -0.013555577956140041, -0.018214933574199677, -0.028588024899363518, 0.037871699780225754, -0.021759361028671265, -0.0516221858561039, 0.017828132957220078, -0.03382794186472893, -0.008673177100718021, -0.017554908990859985, 0.009282177314162254, 0.02002859115600586, 0.006141607649624348, -0.047691710293293, -0.04049086943268776, -0.011747270822525024, -0.049299608916044235, 0.01651146076619625, 0.03069104067981243, 0.0068091945722699165, -0.015682712197303772, -0.04469667375087738, -0.007853642106056213, -0.04514487087726593, -0.02973606251180172, 0.015490357764065266, 0.04207608476281166, 0.006200704257935286, -0.01191102247685194, 0.005496801342815161, 0.06300345808267593, 0.04526861757040024, 0.06144769862294197, 0.03740876913070679, -0.02022600919008255, 0.010451722890138626, -0.010252007283270359, 0.017244908958673477, 0.01879088394343853, 0.04507799446582794, -0.049631159752607346, -0.009769677184522152, -0.05067036300897598, 0.012031172402203083, -0.02758014388382435, 0.03194894269108772, -0.019763313233852386, -0.03490794822573662, -0.038724176585674286, 0.021007105708122253, -0.027754776179790497, 0.02767406590282917, 0.06856629252433777, 0.017149070277810097, 0.02761163003742695, 0.0008716532029211521, -0.001943212584592402, 0.000467228761408478, -0.008319810964167118, -0.0037211566232144833, 0.029960522428154945, 0.01670912466943264, -0.02988743595778942, -0.06649824231863022, -0.020522858947515488, -0.0036992745008319616, -0.07297752052545547, -0.0034480546601116657, 0.026433845981955528, 0.009330330416560173, -0.005837650969624519, -0.03038819693028927, 0.02019214816391468, 0.04176652431488037, 0.0756097212433815, -0.03548363223671913, -0.008273878134787083, 0.03786149248480797, 0.04352179542183876, -0.052237026393413544, -0.024733705446124077, -0.019381938502192497, 0.030395327135920525, 0.023092467337846756, -0.005130482371896505, -0.03490038588643074, 0.00854017585515976, -0.027986304834485054, 0.03422839939594269, 0.00514404010027647, -0.029186701402068138, -0.007077358663082123, 0.03584086894989014, 0.009190067648887634, -0.0020675596315413713, -0.011283257976174355, 0.019419092684984207, 0.016165852546691895, -0.017716703936457634, -0.018595142289996147, -0.0544082373380661, 0.002659086138010025, -0.010088869370520115, 0.04443113133311272, -0.016395429149270058, 0.0677943006157875, 0.04483100026845932, -0.018997184932231903, 0.01857677474617958, 0.020235100761055946 ]
Finetune Stable Diffusion Models with DDPO via TRL
metric-space
September 29, 2023
trl-ddpo
guide, diffusers, rl, rlhf
https://huggingface.co/blog/trl-ddpo
Limitations 1. Right now trl's DDPOTrainer is limited to finetuning vanilla SD models; 2. In our experiments we primarily focused on LoRA which works very well. We did a few experiments with full training which can lead to better quality but finding the right hyperparameters is more challenging.
[ 0.12578226625919342, -0.034541476517915726, -0.012073764577507973, 0.10837230086326599, 0.05973226577043533, 0.03672860190272331, -0.002138009760528803, -0.03347520902752876, -0.0261912252753973, -0.003911488689482212, 0.01156552229076624, 0.04943389073014259, -0.0017397069605067372, 0.0002562396111898124, 0.009137176908552647, 0.037434086203575134, -0.01804904267191887, -0.035484813153743744, -0.0031380564905703068, 0.06845222413539886, 0.0074502588249742985, -0.0664629116654396, 0.010401091538369656, -0.031045682728290558, -0.008567562326788902, -0.00951396208256483, 0.0015431258361786604, 0.07557445764541626, -0.03896430879831314, 0.025182200595736504, -0.051139384508132935, -0.01504694763571024, -0.005438340362161398, -0.025971734896302223, 0.08243401348590851, 0.015569476410746574, -0.08207720518112183, -0.007124738302081823, -0.028592107817530632, -0.07252170890569687, -0.024362022057175636, 0.003780604340136051, -0.04279809072613716, 0.07588522881269455, 0.02194533310830593, 0.03585101664066315, -0.10120172798633575, 0.03975267335772514, -0.006087984424084425, -0.01296751108020544, -0.10121797770261765, 0.13069988787174225, 0.06027597561478615, -0.011535578407347202, 0.02520555816590786, -0.04827225208282471, 0.047226808965206146, 0.04259270429611206, 0.009843441657721996, -0.05683276057243347, -0.006469644606113434, -0.002166452119126916, -0.007811243180185556, -0.02526956796646118, -0.042260244488716125, 0.004843445494771004, -0.03448747470974922, -0.015775028616189957, -0.03649090230464935, -0.009170438162982464, -0.010847550816833973, -0.02618013322353363, -0.004614139907062054, -0.008323821239173412, 0.007822321727871895, -0.03670589625835419, -0.0019435323774814606, 0.06506554782390594, 0.03652169182896614, 0.031580422073602676, 0.0076246620155870914, 0.006305888760834932, 0.12610279023647308, 0.021482834592461586, 0.01172227319329977, -0.026355279609560966, 0.04193318635225296, -0.0195197481662035, -0.0587700754404068, -0.018343446776270866, -0.023009108379483223, -0.0872131735086441, 0.011007022112607956, -0.049777206033468246, 0.013910246081650257, -0.012754363939166069, -0.0440925657749176, 0.0565810352563858, 0.028604144230484962, 0.01830917038023472, -0.038231510668992996, 0.026214728131890297, 0.059882327914237976, -0.058588024228811264, -0.055405210703611374, 0.029478769749403, -0.02746254950761795, -0.018898598849773407, -0.047550104558467865, 0.1144304871559143, -0.049256037920713425, 0.0845484659075737, 0.06441345810890198, 0.07773923128843307, -0.07216081768274307, 0.042783915996551514, -0.0056349956430494785, 0.01690460741519928, -0.015526989474892616, -0.004311422351747751, 0.015118829905986786, 0.04158041626214981, -0.014565205201506615, -0.0653056800365448, -0.030101275071501732, 0.05251513421535492, 0.04737761616706848, -0.028454575687646866, -0.030042672529816628, 0.01696392148733139, -0.012863214127719402, -0.015793031081557274, -0.013333293609321117, 0.039535705000162125, -0.0009651617729105055, -0.11317771673202515, -0.03726643696427345, 0.0036091122310608625, 0.005594648886471987, 0.008904066868126392, -0.10425440967082977, 0.05067279562354088, -0.01501454133540392, -0.0038731659296900034, 0.00402082921937108, -0.05888837203383446, -0.027093108743429184, 0.04158564656972885, -0.06909380108118057, -0.02230745367705822, -0.04105677455663681, 0.1326507031917572, 0.008210932835936546, -0.0287209190428257, -0.01090501993894577, 0.06290411949157715, -0.10419368743896484, -0.04459202662110329, -0.0518597811460495, 0.03905950486660004, -0.038102615624666214, 0.004301154520362616, -0.08309192955493927, 0.06157525256276131, 0.06928437203168869, -0.042190395295619965, -0.013244537636637688, 0.06214892864227295, 0.012333382852375507, -0.027461890131235123, 0.042173270136117935, 0.07102219760417938, 0.05189058184623718, 0.004764075856655836, -0.003145661437883973, 0.008131743408739567, 0.014250165782868862, 0.053796764463186264, 0.00408596359193325, 0.006995619740337133, -0.007667951285839081, 0.012889071367681026, -0.01275220699608326, -0.0011675201822072268, 0.00963379442691803, -0.0642351359128952, 0.05976468324661255, -0.024606097489595413, 0.03667498379945755, -0.010293502360582352, -0.019671190530061722, 0.0924515575170517, 0.03438601270318031, 0.015897858887910843, 0.06501320749521255, -0.05078883841633797, -0.002775207394734025, 0.07498916238546371, 0.06277886778116226, 0.06833340227603912, 0.086298368871212, 0.028673259541392326, -0.01091062743216753, 0.003774577984586358, -0.07007485628128052, 0.002784517826512456, 0.07392231374979019, 0.024650976061820984, 0.022951768711209297, 0.022928323596715927, 0.036844536662101746, -0.16515091061592102, -0.0020283281337469816, -0.020205534994602203, -0.02437691017985344, 0.014281138777732849, 0.007073728367686272, -0.030670443549752235, -0.018369322642683983, 0.0023606161121279, 0.08342450112104416, 0.0018432741053402424, -0.019640551880002022, 0.0640520229935646, -0.07043986022472382, 0.0691402330994606, 0.09441163390874863, -0.04481983929872513, -0.00374201824888587, -0.035728905349969864, -0.0714859887957573, 0.005042480770498514, 0.04501146078109741, 0.11994550377130508, -0.001773546333424747, 0.012321200221776962, -0.018243061378598213, -0.039746835827827454, 0.011002732440829277, 0.040121376514434814, 0.016257328912615776, 0.06365273147821426, -0.05801272764801979, 0.1080719530582428, -0.011234322562813759, 0.0009130500839091837, 0.04435711354017258, -0.0004724844475276768, 0.03327997028827667, -0.040434982627630234, -0.1229100227355957, 0.031447626650333405, 0.029257645830512047, -0.08179137110710144, 0.036443643271923065, 0.023188790306448936, 0.0023150623310357332, -0.019653214141726494, 0.02965851128101349, 0.018376892432570457, 0.027051489800214767, 0.007145414128899574, -0.0165425892919302, -0.01792091876268387, 0.014996161684393883, -0.035140927881002426, -0.000952676753513515, -0.01809876784682274, 0.015336901880800724, 0.013314798474311829, -0.026777660474181175, -0.002252244623377919, -0.0077032893896102905, -0.0186248067766428, -0.024009015411138535, -0.012548300437629223, -0.002371591981500387, -0.037377409636974335, 0.0022658254019916058, 0.02071983739733696, 0.023938294500112534, -0.02316039800643921, 0.07047142833471298, 0.01770579256117344, -0.004195868037641048, 0.015545946545898914, -0.036004312336444855, -0.008517489768564701, -0.036440160125494, 0.014161617495119572, -0.0020291556138545275, 0.0009532085387036204, -0.02147701010107994, 0.001992379315197468, -0.0071736606769263744, -0.0065516275353729725, 0.0308246947824955, -0.014468954876065254, -0.0026624160818755627, -0.029968896880745888, -0.01589944027364254, 0.032395005226135254, 0.03398497402667999, 0.04009270668029785, -0.02028370276093483, -0.01144296582788229, 0.03621736541390419, 0.030111076310276985, -0.09958938509225845, -0.031699907034635544, -0.006565516348928213, 0.04650699347257614, -0.020280536264181137, -0.0004984664847142994, -0.0009934640256687999, -0.060928378254175186, 0.045751363039016724, -0.0023756492882966995, -0.04730001091957092, 0.033401861786842346, -0.014464461244642735, -0.015145043842494488, 0.03061891347169876, -0.008268595673143864, 0.04796304553747177, -0.01061159186065197, 0.017215492203831673, 0.01565011590719223, -0.0014733055140823126, 0.06922309845685959, 0.0009664885583333671, 0.015184625051915646, -0.03892146795988083, 0.05456480756402016, 0.02452554926276207, -0.015482121147215366, -0.014955136924982071, -0.004153236281126738, 0.011747652664780617, -0.0057871281169354916, -0.005556061398237944, 0.03293028473854065, 0.00030484009766951203, 0.021533213555812836, -0.020848974585533142, 0.013148900121450424, 0.02307748794555664, 0.05332154408097267, 0.003895096480846405, -0.029468845576047897, 0.07273325324058533, 0.010912817902863026, -0.01071339100599289, 0.03131242096424103, -0.003369559533894062, 0.01238239835947752, 0.02207956835627556, -0.03145094960927963, -0.018095452338457108, 0.0013907303800806403, 0.016657553613185883, 0.014609761536121368, -0.03102870285511017, -0.016662457957863808, 0.016796845942735672, 0.03728983551263809, -0.0022532567381858826, 0.0019263605354353786, -0.02411089465022087, 0.026089521124958992, 0.010171813890337944, 0.029686378315091133, -0.03753591701388359, 0.004012672696262598, 0.021091826260089874, -0.0061753857880830765, -0.026545196771621704, -0.010090160183608532, -0.002589739393442869, 0.03788289800286293, 0.01005528774112463, -0.002877638442441821, 0.040426526218652725, 0.029404152184724808, -0.013595148921012878, -0.004225506912916899, 0.023151244968175888, 0.020163632929325104, -0.005478627048432827, -0.05072561278939247, -0.01855417527258396, -0.025999339297413826, -0.01593635417521, -0.007269128225743771, -0.02809782139956951, -0.03187020868062973, 0.031098946928977966, 0.013225906528532505, 0.017173556610941887, 0.01355607807636261, 0.011488012038171291, -0.012647475115954876, 0.011591240763664246, 0.015499169938266277, 0.07925846427679062, -0.016628095880150795, 0.008885065093636513, 0.049827393144369125, -0.02514350786805153, -0.01236861664801836, 0.007986178621649742, 0.010272016748785973, -0.023134728893637657, -0.012948968447744846, -0.02540440484881401, -0.021177440881729126, 0.014186518266797066, -0.010167406871914864, 0.012625257484614849, -0.026882151141762733, 0.032073553651571274, -0.016158411279320717, 0.018240027129650116, 0.010252509266138077, -0.007351186592131853, 0.028072554618120193, -0.04846888780593872, 0.028658071532845497, -0.05013422667980194, -0.012168258428573608, 0.003211635397747159, -0.00932134035974741, 0.03152171149849892, -0.011639079079031944, 0.011778502725064754, 0.059573374688625336, -0.03246837481856346, 0.011118465103209019, -0.026323139667510986, -0.03787757083773613, -0.03012094274163246, 0.011573031544685364, 0.02836502715945244, -0.04001785069704056, 0.007577291689813137, 0.06674174964427948, 0.015955287963151932, -0.05538715049624443, -0.02574923262000084, -0.03483358770608902, 0.028254004195332527, -0.036209963262081146, 0.0740160197019577, -0.009265267290174961, -0.0034896451979875565, 0.0195971317589283, 0.012833476066589355, 0.0024255455937236547, 0.03302466496825218, -0.0633786991238594, -0.043548524379730225, -0.014285244978964329, 0.04458314925432205, -0.032049812376499176, 0.04077151417732239, 0.0035817825701087713, 0.02045178785920143, 0.03456542640924454, 0.05676233395934105, -0.04866948351264, -0.027277536690235138, 0.0424920879304409, 0.029592173174023628, 0.0163417998701334, 0.028793329373002052, 0.002352682640776038, -0.002706802450120449, -0.016702495515346527, -0.029645806178450584, -0.017955543473362923, 0.012189803645014763, 0.011390451341867447, 0.0217024814337492, 0.01344787236303091, 0.058149684220552444, -0.006190869957208633, -0.016859019175171852, -0.019200609996914864, -0.014793513342738152, 0.010138637386262417, 0.022854292765259743, 0.0006232816376723349, 0.010214794427156448, -0.015759235247969627, 0.02495015412569046, 0.035307180136442184, 0.02600967511534691, 0.01873171515762806, 0.02563454583287239, 0.01669236086308956, 0.012174606323242188, -0.056367285549640656, 0.015638254582881927, 0.046639665961265564, 0.028615767136216164, 0.05450601503252983, -0.028794020414352417, 0.009310782887041569, 0.003694999497383833, -0.045712344348430634, -0.021103903651237488, -0.026901615783572197, 0.007257678546011448, -0.005690172780305147, 0.020310916006565094, 0.00755384610965848, 0.020785711705684662, -0.0465099960565567, -0.013927898369729519, -0.021440306678414345, -0.0435621552169323, -0.021768562495708466, -0.002873899880796671, -0.05122128501534462, -0.04590173065662384, 0.0016630807658657432, 0.000172042942722328, 0.011512971483170986, -0.013532991521060467, -0.0041296943090856075, 0.0016430263640359044, -0.006558005698025227, -0.0046922750771045685, -0.023211129009723663, -0.011156433261930943, -0.0003990901750512421, -0.02531423792243004, 0.0334494411945343, -0.010399874299764633, -0.006327565293759108, -0.03356676548719406, -0.0420868881046772, -0.025472629815340042, 0.01442057453095913, -0.04637794941663742, 0.089018315076828, -0.006864143535494804, -0.026567088440060616, -0.012824869714677334, 0.00624586408957839, 0.0010451748967170715, -0.007197539322078228, -0.030063951388001442, 0.016613846644759178, -0.015149770304560661, -0.05139956623315811, -0.008485217578709126, -0.012471374124288559, 0.04935988038778305, -0.04327180236577988, 0.01193662267178297, 0.010594169609248638, 0.017002977430820465, 0.031278517097234726, 0.007701111026108265, -0.018952175974845886, 0.022453516721725464, -0.017463449388742447, -0.0005760485655628145, -0.021435951814055443, 0.043698474764823914, 0.0074762203730642796, -0.006088752765208483, -0.014387300238013268, 0.015766538679599762, -0.017918843775987625, -0.00207181042060256, 0.022025547921657562, 0.00021357550576794893, 0.0064402190037071705, 0.028138821944594383, 0.0003807749890256673, -0.004780150018632412, 0.006660366430878639, 0.023498650640249252, 0.01408261340111494, 0.016451014205813408, 0.0020163943991065025, 0.038087453693151474, 0.010127312503755093, 0.04752984642982483, -0.018374046310782433, -0.0006454625981859863, 0.037942610681056976, 0.022047271952033043, -0.007535445503890514, -0.004227304831147194, 0.017422102391719818, 0.0011287415400147438, -0.024427684023976326, -0.012008976191282272, -0.02970051020383835, -0.05239872634410858, -0.011527970433235168, 0.04966356232762337, -0.011816123500466347, -0.016050856560468674, -0.01671416126191616, 0.016858574002981186, 0.04299984872341156, 0.0600709542632103, 0.004614640958607197, 0.013207824900746346, 0.009608200751245022, 0.04802015423774719, 0.02398843690752983, 0.058652546256780624, 0.00030026090098544955, -0.008150139823555946, 0.01220270711928606, -0.02103734388947487, 0.01155314315110445, -0.020573092624545097, 0.020204421132802963, 0.012032047845423222, 0.0013568808790296316, 0.007021654862910509, 0.05271447077393532, 0.08766896277666092, -0.028191739693284035, -0.002365312771871686, 0.03205897659063339, -0.05520971864461899, -0.03431902080774307, -0.01370443869382143, -0.0022992270532995462, -0.005155881866812706, 0.042659908533096313, 0.04672715812921524, -0.006279915105551481, -0.010993972420692444, -0.02800642140209675, -0.013425689190626144, 0.0018965266644954681, -0.027501119300723076, 0.024905990809202194, -0.012981618754565716, -0.005110501777380705, -0.020287401974201202, -0.027466963976621628, -0.014089263044297695, 0.044652730226516724, 0.04510147124528885, -0.016114933416247368, -0.011358707211911678, -0.037823181599378586, 0.013502053916454315, -0.011419730260968208, -0.013378147035837173, -0.021900653839111328, -0.06310517340898514, 0.023238172754645348, -0.03451990336179733, -0.021919861435890198, 0.014436474069952965, -0.06957465410232544, 0.017401333898305893, -0.003927965182811022, 0.04542944207787514, -0.005746497772634029, -0.02166200801730156, -0.011086483485996723, -0.02068951539695263, -0.03474020957946777, -0.02568528614938259, 0.0025940248742699623, 0.021748963743448257, 0.033694855868816376, -0.009516166523098946, -0.006085962988436222, -0.03239577263593674, 0.01455568615347147, -0.019844578579068184, -0.006194491870701313, -0.004405089188367128, 0.07926759868860245, -0.03771410137414932, -0.05161894112825394, 0.0412515252828598, 0.027583742514252663, 0.0016266535967588425, 0.018742946907877922, -0.010838455520570278, 0.010752537287771702, -0.037174325436353683, 0.017878171056509018, 0.00858695525676012, 0.0335795097053051, -0.06078328192234039, -0.0455598309636116, -0.036613330245018005, 0.03274449706077576, -0.0023012466263026, 0.04094869643449783, -0.009407779201865196, -0.023493755608797073, -0.022910719737410545, -0.028602682054042816, -0.02747415378689766, 0.03968691825866699, 0.0641016960144043, 0.02350492961704731, 0.015964359045028687, -0.005917286965996027, -0.00667274696752429, -0.026768287643790245, -0.032438114285469055, -0.015967031940817833, 0.03173466771841049, 0.03312302380800247, -0.0019213847117498517, -0.06327880918979645, -0.024144500494003296, 0.007854933850467205, -0.05979491397738457, -0.023759622126817703, 0.03416585922241211, -0.03310738131403923, 0.0006282560061663389, -0.03223874419927597, -0.014782914891839027, -0.012738787569105625, 0.01744469627737999, 0.01006957795470953, -0.016094593331217766, -0.016439663246273994, -0.020426416769623756, -0.06564386934041977, 0.003914339933544397, -0.03494348004460335, -0.005515348166227341, -0.04207562282681465, -0.011986242607235909, -0.05477873980998993, 0.00524209113791585, -0.019843632355332375, 0.016691168770194054, -0.0298168808221817, -0.0022452487610280514, -0.02073422633111477, 0.015035424381494522, 0.011860228143632412, -0.009116766043007374, -0.026701193302869797, 0.004386155866086483, 0.036675188690423965, -0.0051177553832530975, -0.023280592635273933, -0.024806445464491844, -0.02537679858505726, 0.011655203998088837, 0.03220249339938164, -0.03818889707326889, 0.04952414706349373, 0.024401016533374786, -0.04037350043654442, -0.020690789446234703, 0.024123210459947586 ]
Finetune Stable Diffusion Models with DDPO via TRL
metric-space
September 29, 2023
trl-ddpo
guide, diffusers, rl, rlhf
https://huggingface.co/blog/trl-ddpo
# Finetune Stable Diffusion Models with DDPO via TRL
[ 0.04562148451805115, -0.04798053205013275, 0.04017704352736473, 0.04040813446044922, 0.09326580166816711, 0.0338456854224205, -0.07517262548208237, 0.015261282213032246, -0.05057520791888237, -0.04488152265548706, -0.015371335670351982, 0.03327718377113342, -0.04366818070411682, 0.0010115473996847868, -0.00304489117115736, 0.01962372101843357, -0.009197590872645378, -0.025788545608520508, 0.04041649401187897, 0.018741313368082047, 0.005021543242037296, -0.08192736655473709, -0.009342910721898079, -0.018778664991259575, -0.013265666551887989, -0.06465191394090652, 0.03631773591041565, 0.04533441737294197, -0.07238241285085678, 0.007976600900292397, -0.06604208052158356, 0.011855628341436386, 0.011524472385644913, -0.001230226131156087, 0.013562226668000221, 0.0022366319317370653, -0.06643586605787277, 0.00862523540854454, -0.015941912308335304, -0.08892777562141418, -0.0055375597439706326, -0.04399062320590019, -0.012315348722040653, 0.05727225914597511, 0.03169453889131546, -0.05319046974182129, -0.17949287593364716, 0.09060494601726532, -0.02089921198785305, -0.07070717215538025, -0.08251399546861649, 0.06528379768133163, -0.03643128648400307, -0.023955868557095528, -0.02674638107419014, -0.013262868858873844, -0.00980012584477663, -0.04630867764353752, -0.018030846491456032, -0.06495760381221771, 0.05586372688412666, -0.015142207033932209, -0.011506478302180767, 0.02013830840587616, 0.008070272393524647, 0.03646627813577652, 0.0015341434627771378, -0.013817924074828625, -0.1037282794713974, -0.01319021824747324, 0.0020003856625407934, -0.007467158604413271, -0.005191156640648842, -0.024329928681254387, 0.030761580914258957, -0.07118945568799973, -0.0413372665643692, 0.0625806450843811, 0.0614621676504612, 0.09973844140768051, 0.027823450043797493, -0.003153035882860422, 0.107998788356781, 0.08813384920358658, -0.005710379686206579, 0.026425955817103386, 0.0748014897108078, -0.03071424923837185, -0.00776693457737565, -0.006083764601498842, -0.037659771740436554, -0.11188627034425735, -0.05610840767621994, 0.007911278866231441, 0.05718693509697914, -0.0624270960688591, -0.047575075179338455, 0.048530470579862595, 0.030708668753504753, 0.026845036074519157, 0.008344345726072788, -0.02338886447250843, 0.06809352338314056, -0.10022863000631332, -0.05550751835107803, 0.03246336430311203, -0.016550615429878235, -0.034981414675712585, -0.005085385404527187, 0.06350652128458023, 0.0014277303125709295, 0.06341583281755447, -0.016271179541945457, 0.03522351011633873, -0.03337353840470314, 0.060710225254297256, -0.024404646828770638, 0.010252011008560658, 0.009708062745630741, 0.08828160911798477, -0.016572993248701096, 0.09111338108778, 0.048552993685007095, -0.004179154988378286, 0.005351741332560778, 0.1101376935839653, 0.05118517950177193, -0.007683117873966694, -0.06460462510585785, 0.017400473356246948, -0.0003082925686612725, -0.012579862959682941, 0.020014392212033272, -0.027853330597281456, 0.06050192564725876, -0.11233959347009659, 0.00033407157752662897, -0.0006448971689678729, 0.0309611726552248, -0.013111834414303303, -0.02578037977218628, 0.042492739856243134, 0.009083107113838196, 0.07247653603553772, 0.019569536671042442, -0.037783410400152206, -0.02892540767788887, 0.04647055268287659, -0.046561989933252335, 0.016328327357769012, -0.015970949083566666, 0.08827298879623413, -0.004480062052607536, -0.07216392457485199, 0.00535802636295557, 0.055387090891599655, -0.034309837967157364, -0.017691098153591156, -0.034129463136196136, -0.0011108313919976354, 0.029334936290979385, -0.01971215382218361, -0.01590464636683464, 0.04624432325363159, 0.08261146396398544, -0.02300543151795864, 0.028730841353535652, 0.04948373883962631, 0.036760564893484116, -0.06243380531668663, 0.000010813121662067715, 0.0042847502045333385, 0.04542333632707596, 0.044635407626628876, -0.0267720278352499, 0.011595926247537136, 0.019395163282752037, 0.07105180621147156, -0.04188239574432373, -0.028604531660676003, 0.006296129431575537, 0.010516603477299213, 0.008233481086790562, 0.018244033679366112, 0.03320617973804474, -0.09477857500314713, 0.03118928149342537, -0.006782848853617907, 0.035513054579496384, 0.04426007345318794, -0.039231859147548676, 0.0033927711192518473, 0.06566577404737473, -0.0035266857594251633, 0.03525574505329132, -0.08715245872735977, -0.06502988934516907, 0.0868128091096878, 0.038407471030950546, 0.09445055574178696, 0.011411176063120365, -0.01877632550895214, 0.047102831304073334, -0.049187224358320236, -0.05842418596148491, 0.014966161921620369, 0.05900092050433159, 0.02527645044028759, 0.051603883504867554, -0.004190461244434118, -0.05007197707891464, -0.13735823333263397, 0.04413028061389923, -0.050650760531425476, -0.03361803665757179, -0.013655458576977253, -0.008698542602360249, -0.00848080962896347, -0.0476045124232769, -0.05936345458030701, 0.12316831946372986, 0.06269624829292297, -0.02992956154048443, 0.032232336699962616, -0.08319850265979767, 0.06506559997797012, 0.07200057804584503, -0.05114155635237694, 0.05032499507069588, -0.05396716669201851, -0.06314583867788315, -0.027164176106452942, 0.015914998948574066, 0.05822509899735451, 0.06771618872880936, -0.01786116138100624, -0.0000037133188470761525, 0.0029465712141245604, 0.04921018332242966, -0.01579415053129196, 0.0664767250418663, -0.008380753919482231, -0.07324638217687607, 0.08383627235889435, -0.03300781175494194, -0.01976066827774048, 0.06061678007245064, 0.016078384593129158, -0.029890961945056915, 0.011359427124261856, -0.06779846549034119, 0.022452134639024734, -0.010843347758054733, -0.03758540377020836, 0.04083600640296936, 0.010081865824759007, -0.011743875220417976, -0.03664785996079445, -0.017515413463115692, 0.011381356045603752, 0.03385135531425476, 0.001292187487706542, -0.004470957443118095, -0.005627847742289305, -0.01097453199326992, -0.0303895715624094, 0.015466883778572083, 0.010237281210720539, 0.01661514863371849, 0.0326681062579155, -0.008252358995378017, -0.006759526673704386, -0.00003581915734685026, 0.010072729550302029, -0.02237224206328392, 0.00846355501562357, 0.04185708984732628, -0.043886907398700714, -0.02878318540751934, 0.0292483139783144, 0.00861105602234602, -0.0038285457994788885, 0.05196802690625191, 0.027944639325141907, 0.015657123178243637, 0.016103675588965416, 0.006751258857548237, -0.0034571727737784386, -0.022087905555963516, 0.037776801735162735, 0.01017739623785019, -0.0023339157924056053, -0.01840209774672985, 0.020962530747056007, 0.008263284340500832, -0.002427654806524515, 0.011939847841858864, -0.01906518265604973, -0.004536390770226717, -0.030011776834726334, 0.023332985118031502, 0.0061272005550563335, 0.012458013370633125, 0.015651760622859, -0.035590171813964844, 0.028868351131677628, 0.02508586086332798, 0.011528578586876392, -0.12670646607875824, -0.03734629228711128, 0.0358840674161911, 0.02072698064148426, 0.0012476807460188866, -0.033709608018398285, 0.01169626135379076, -0.0262504443526268, -0.027688905596733093, 0.006727632600814104, 0.03184736520051956, 0.03955068439245224, 0.026164868846535683, 0.017004050314426422, 0.018946656957268715, 0.00784182921051979, 0.030413465574383736, 0.031837012618780136, -0.0031692557968199253, 0.031546153128147125, -0.06380520015954971, 0.061183419078588486, 0.009740729816257954, 0.0027472861111164093, -0.02889467217028141, 0.05125873163342476, 0.03251878172159195, 0.011875570751726627, -0.001333726104348898, 0.003823589300736785, -0.035149965435266495, 0.006539515219628811, -0.04463416710495949, 0.02081737294793129, -0.023596536368131638, 0.009219084866344929, 0.0322607085108757, 0.023819902911782265, 0.03335891291499138, 0.0236374381929636, 0.013425523415207863, 0.009152792394161224, 0.03993068262934685, -0.008357114158570766, -0.027068141847848892, 0.01583719067275524, 0.004153154324740171, 0.03000027686357498, 0.023979930207133293, -0.008599147200584412, -0.016150858253240585, 0.008336304686963558, 0.008560598827898502, 0.029669884592294693, 0.00867648795247078, 0.027015605941414833, -0.0017012098105624318, 0.042187854647636414, 0.0398181714117527, -0.011287818662822247, -0.044593214988708496, -0.00040343578439205885, 0.02966027334332466, -0.009969610720872879, -0.029985908418893814, 0.0331275574862957, 0.03627210855484009, 0.02866273932158947, -0.0191117562353611, 0.015972141176462173, 0.013447754085063934, -0.008163376711308956, -0.008328154683113098, 0.02446792833507061, -0.010504953563213348, 0.02527441456913948, -0.007979110814630985, -0.010690535418689251, 0.043615393340587616, -0.028583522886037827, -0.009495940990746021, -0.02401593141257763, 0.016044510528445244, -0.04222095385193825, 0.016225038096308708, -0.012249015271663666, -0.010312310419976711, -0.0057212249375879765, 0.04890105500817299, 0.03765648230910301, 0.022362643852829933, 0.024448823183774948, 0.012300947681069374, 0.0016062087379395962, 0.019657399505376816, 0.005978796165436506, 0.056926973164081573, 0.010841365903615952, 0.01289458479732275, 0.018725773319602013, 0.02017965540289879, -0.048868995159864426, -0.002024364424869418, 0.002442210214212537, -0.02039729245007038, 0.010253938846290112, -0.020652463659644127, -0.032554976642131805, -0.019907381385564804, -0.006891707889735699, 0.011900270357728004, -0.03876139596104622, 0.014089382253587246, -0.02745971642434597, -0.004966115579009056, 0.01599459908902645, -0.026956411078572273, -0.03372647240757942, -0.042046792805194855, 0.03520341217517853, -0.052926477044820786, 0.0032898683566600084, -0.002865790156647563, -0.022280795499682426, 0.024779288098216057, 0.0030053022783249617, 0.005337663926184177, 0.020322304219007492, -0.04573154076933861, -0.015108947642147541, -0.014747576788067818, -0.036900218576192856, 0.03114514984190464, -0.01563410274684429, 0.030082866549491882, -0.005055667366832495, 0.011474703438580036, 0.04129381105303764, 0.003275081980973482, -0.0712367445230484, -0.051538798958063126, 0.0016778899589553475, 0.03357193246483803, -0.031461555510759354, 0.06234335899353027, -0.014538558200001717, -0.04448040574789047, 0.016934622079133987, 0.006822305731475353, 0.03941446542739868, 0.05687569081783295, -0.039171528071165085, -0.040023744106292725, -0.03436451405286789, 0.03353903815150261, -0.005347732920199633, 0.034614451229572296, 0.001265892991796136, 0.0014105974696576595, 0.06753600388765335, 0.017401166260242462, -0.02229352295398712, -0.028406156226992607, 0.042598117142915726, 0.016161641106009483, 0.013313923962414265, 0.016997799277305603, -0.028826603665947914, -0.025517085567116737, 0.013932280242443085, -0.024549324065446854, 0.009784807451069355, 0.018880825489759445, -0.013404936529695988, 0.006125503219664097, 0.04306148365139961, 0.020160529762506485, 0.008474250324070454, 0.009927933104336262, 0.005207417998462915, -0.029894091188907623, 0.023579483851790428, 0.022117488086223602, 0.014444351196289062, 0.008278097957372665, 0.0015221413923427463, 0.003340289229527116, 0.024017835035920143, 0.017621491104364395, 0.033940937370061874, 0.02216559834778309, -0.007662998978048563, -0.002831744961440563, -0.052045539021492004, -0.0008123205625452101, 0.03388263285160065, 0.00492457952350378, -0.0010439479956403375, -0.02880917303264141, -0.007969780825078487, 0.027742404490709305, 0.0097523657605052, -0.005724158138036728, -0.02421417087316513, 0.01676354557275772, -0.006275401450693607, -0.0012838662369176745, -0.02360379323363304, 0.022887952625751495, -0.008278988301753998, 0.0037468457594513893, 0.0067930375225842, -0.01663871854543686, -0.056411609053611755, 0.010554161854088306, -0.04745664820075035, -0.040108393877744675, -0.024128438904881477, -0.017559481784701347, 0.04602668061852455, 0.003770329523831606, -0.012246385216712952, -0.025918684899806976, 0.014987735077738762, 0.03187815472483635, -0.031836312264204025, -0.02594539150595665, 0.03241617605090141, -0.010789038613438606, 0.04687679186463356, 0.0004983514663763344, -0.023265231400728226, 0.0035284492187201977, 0.01680331863462925, 0.023111218586564064, -0.0012609396362677217, -0.05816182866692543, 0.07777238637208939, 0.011022773571312428, 0.01833498664200306, 0.025582969188690186, 0.004719706252217293, -0.06910938769578934, -0.010193606838583946, -0.036129504442214966, -0.010915226303040981, 0.014400145970284939, 0.000805409625172615, -0.0034804462920874357, 0.01060953177511692, 0.04583283141255379, -0.02558494172990322, 0.014473408460617065, -0.01884612999856472, -0.008565494790673256, 0.023225856944918633, 0.01165029313415289, -0.03776340186595917, 0.015641113743185997, -0.03837078437209129, 0.022839903831481934, -0.025638114660978317, 0.048867419362068176, 0.023780053481459618, 0.03574598208069801, 0.04770224541425705, 0.014335762709379196, -0.034886911511421204, 0.015055349096655846, 0.0507437027990818, -0.005289899185299873, 0.03572269529104233, 0.020846327766776085, 0.004958922043442726, 0.016101568937301636, -0.035708580166101456, 0.019009526818990707, 0.03568163886666298, -0.019934918731451035, 0.034643322229385376, -0.010764115490019321, 0.02251318469643593, 0.01939862221479416, -0.001547585823573172, -0.011862456798553467, 0.04513634741306305, 0.031586214900016785, 0.009393731132149696, 0.008837859146296978, 0.028140457347035408, 0.01405149046331644, -0.021437114104628563, -0.053094521164894104, -0.032091543078422546, -0.046115126460790634, 0.04468506574630737, 0.051589250564575195, -0.023436207324266434, -0.00023728323867544532, -0.043702609837055206, 0.046633653342723846, 0.04303978383541107, 0.04143710806965828, -0.005254210904240608, 0.011840442195534706, 0.00581100070849061, 0.0556841641664505, -0.004223106894642115, 0.00325199612416327, 0.020230676978826523, 0.003641503630205989, 0.03013741225004196, -0.03155982121825218, 0.005454758647829294, -0.009383765049278736, -0.02184954285621643, 0.04014784097671509, -0.00879928283393383, -0.03200856223702431, -0.001185466069728136, 0.061806149780750275, -0.01753418892621994, -0.015826169401407242, 0.02829071320593357, -0.027432886883616447, -0.03563278540968895, -0.002782875206321478, 0.024906611070036888, -0.022019043564796448, -0.021605584770441055, 0.036174532026052475, 0.004936513025313616, -0.004857412073761225, -0.01432079542428255, -0.015263695269823074, 0.014701087027788162, 0.029333848506212234, 0.0242830328643322, -0.030842285603284836, -0.026728874072432518, -0.04554411768913269, 0.02512923814356327, -0.01707386039197445, -0.009103050455451012, 0.011716567911207676, -0.026051364839076996, -0.015600341372191906, -0.024652082473039627, -0.021672459319233894, -0.025465311482548714, 0.04297424480319023, 0.0229013804346323, -0.050949327647686005, 0.041650980710983276, 0.010782775469124317, 0.0014044607523828745, -0.021676132455468178, -0.05678221210837364, 0.01058914978057146, -0.03011016920208931, 0.040591903030872345, 0.06339678913354874, -0.00029934701160527766, -0.027226511389017105, -0.07038953900337219, -0.0025360167492181063, -0.03938877955079079, 0.020817073062062263, 0.015962500125169754, 0.036258265376091, -0.02857954427599907, -0.0065899379551410675, 0.01721321791410446, 0.028252573683857918, -0.03814956918358803, 0.00347816850990057, -0.010713230818510056, -0.017429526895284653, -0.015834569931030273, -0.049318958073854446, 0.023623352870345116, -0.005869652610272169, 0.01887904293835163, 0.032912515103816986, 0.05069628357887268, -0.01866871304810047, -0.006631480064243078, 0.034678880125284195, -0.008019025437533855, 0.04249110072851181, -0.03785041719675064, -0.04254334047436714, -0.024405157193541527, -0.00024913373636081815, -0.02166617102921009, 0.0013738526031374931, -0.010669166222214699, -0.020134899765253067, -0.026176083832979202, -0.01983666978776455, -0.00445865374058485, 0.028805052861571312, 0.055155906826257706, 0.030385809019207954, 0.03477777540683746, 0.0036861374974250793, -0.041587866842746735, -0.03006923943758011, -0.01618576981127262, 0.017535941675305367, 0.02487022802233696, -0.009078149683773518, -0.013649010099470615, -0.012104027904570103, 0.02269868180155754, -0.021900121122598648, -0.06977066397666931, -0.009084703400731087, 0.03492359071969986, -0.04948025569319725, -0.05927538499236107, -0.009082619100809097, 0.02475937083363533, -0.01049834955483675, 0.027847787365317345, 0.03480226546525955, -0.022655896842479706, 0.0031203345861285925, -0.01422044076025486, -0.04101492092013359, 0.008007691241800785, -0.027912437915802002, -0.0002965579042211175, 0.00288128643296659, -0.003978036344051361, 0.00436445465311408, -0.029743222519755363, -0.023805152624845505, 0.00145096390042454, -0.004974368494004011, -0.020971029996871948, -0.04232938587665558, 0.03713652119040489, -0.0028996604960411787, -0.029982032254338264, -0.052375417202711105, 0.01143339928239584, 0.03160213679075241, -0.02231976017355919, -0.03288840129971504, -0.0018035282846540213, 0.02952047809958458, 0.01295335404574871, 0.0019028602400794625, -0.026264982298016548, 0.04565094783902168, 0.02853260189294815, -0.04888797178864479, -0.01585191860795021, 0.01576516218483448 ]
Finetune Stable Diffusion Models with DDPO via TRL
metric-space
September 29, 2023
trl-ddpo
guide, diffusers, rl, rlhf
https://huggingface.co/blog/trl-ddpo
DDPO algorithm briefly Given the MDP framework used to model the sequential nature of the denoising process and the rest of the considerations that follow, the tool of choice to tackle the optimization problem is a policy gradient method. Specifically Proximal Policy Optimization (PPO). The whole DDPO algorithm is pretty much the same as Proximal Policy Optimization (PPO) but as a side, the portion that stands out as highly customized is the trajectory collection portion of PPO Hereโ€™s a diagram to summarize the flow:
[ 0.01930813118815422, -0.005854117218405008, -0.02316872589290142, -0.003834286704659462, 0.06911104917526245, 0.026129746809601784, -0.09348133951425552, 0.026339523494243622, -0.03688827157020569, -0.09036258608102798, -0.014608423225581646, 0.03605632856488228, -0.035788778215646744, -0.038363173604011536, -0.006099039223045111, 0.02484414353966713, 0.027481557801365852, -0.021058732643723488, 0.05157151445746422, 0.038865093141794205, -0.007122220937162638, 0.02502853237092495, 0.012093338184058666, -0.0026508131995797157, 0.000996291870251298, 0.009340761229395866, -0.01633591391146183, 0.03724902495741844, -0.03793668746948242, 0.016619060188531876, -0.02152010053396225, -0.020970650017261505, 0.012807786464691162, -0.03798134997487068, 0.05275508761405945, -0.020997237414121628, -0.038034696131944656, -0.015073300339281559, 0.010182122699916363, -0.05535212904214859, -0.00554707320407033, -0.06985043734312057, -0.05144937336444855, 0.01517903245985508, 0.010844605974853039, -0.019695425406098366, -0.12165412306785583, 0.057925283908843994, -0.013745422475039959, -0.08753891289234161, -0.1114216297864914, 0.0668448805809021, -0.060837481170892715, 0.0150478919968009, -0.060278549790382385, -0.08074908703565598, 0.01709810458123684, -0.04294076934456825, -0.007382192648947239, -0.044420693069696426, 0.02245362289249897, 0.007074284367263317, 0.05388518422842026, 0.07213374227285385, 0.08401988446712494, 0.0008366478141397238, 0.01846708357334137, 0.01180744357407093, -0.07293044775724411, -0.0037410466466099024, 0.0006073529366403818, -0.007949099875986576, -0.02697298303246498, 0.10631238669157028, -0.03826625272631645, -0.05610596761107445, -0.021562131121754646, 0.020301703363656998, -0.01789063587784767, 0.06957647204399109, 0.06439077854156494, -0.02776612527668476, 0.11281336098909378, 0.02153383195400238, 0.07034584879875183, 0.0006605734815821052, 0.06998377293348312, 0.010883591137826443, -0.007829001173377037, 0.015256139449775219, -0.02066439390182495, -0.014977234415709972, -0.028133118525147438, -0.023478813469409943, 0.06539890170097351, -0.04457191377878189, 0.01563948765397072, -0.022331561893224716, 0.025508498772978783, 0.057684510946273804, -0.004405900835990906, -0.06107417866587639, -0.014213056303560734, -0.00636592460796237, -0.03614706173539162, 0.026835555210709572, 0.003920301329344511, -0.024268738925457, -0.07978793233633041, 0.13784252107143402, -0.0321267805993557, 0.07565531879663467, -0.0007510416326113045, 0.04682533070445061, -0.019439753144979477, 0.04678712785243988, -0.05315466970205307, 0.03434654325246811, 0.04623395577073097, 0.07498608529567719, -0.023588718846440315, 0.1100502610206604, 0.06553549319505692, 0.013298122212290764, -0.00965497363358736, 0.010726286098361015, 0.032680146396160126, -0.005384731572121382, -0.059155382215976715, -0.007270971778780222, -0.009923155419528484, -0.011704172939062119, 0.050369054079055786, -0.017836982384324074, 0.03858568146824837, -0.07386914640665054, 0.03428177163004875, 0.03325005620718002, 0.05020404979586601, -0.051967695355415344, -0.010273772291839123, 0.03999650105834007, -0.015100549906492233, 0.0028372984379529953, 0.02478913404047489, -0.09482788294553757, 0.01768697425723076, 0.051723044365644455, -0.021809160709381104, 0.005246161948889494, 0.0053886775858700275, 0.07783763110637665, -0.04863210394978523, -0.054759394377470016, 0.025919541716575623, 0.041332587599754333, -0.01823192462325096, -0.06895046681165695, -0.09591756016016006, -0.03079887107014656, 0.06046565994620323, -0.023231320083141327, -0.014798217453062534, 0.06314810365438461, 0.059295784682035446, 0.02916617877781391, 0.05581383779644966, 0.08314003795385361, -0.03364640846848488, -0.024683179333806038, -0.04004940763115883, 0.03856903314590454, 0.07171797752380371, -0.002878102008253336, 0.037340257316827774, 0.0254448801279068, 0.03054848499596119, 0.05127787962555885, 0.031249817460775375, 0.0572291761636734, -0.007893248461186886, 0.04833380877971649, 0.022629166021943092, -0.03278028219938278, 0.060615021735429764, -0.06038116663694382, 0.06056416407227516, 0.037234678864479065, -0.03489696606993675, 0.034947607666254044, -0.05063020810484886, -0.05497368425130844, 0.08850845694541931, -0.1209976077079773, -0.034858617931604385, -0.02089308388531208, -0.03795464709401131, 0.04818097874522209, 0.046765513718128204, 0.11627119779586792, 0.03853578492999077, 0.0014115039957687259, 0.042005714029073715, -0.09861086308956146, -0.008131113834679127, 0.02360202930867672, 0.01624174416065216, 0.00029341084882616997, 0.055892761796712875, -0.029454492032527924, -0.059072673320770264, -0.11433563381433487, -0.07091258466243744, -0.07712993770837784, -0.01220654509961605, 0.036300163716077805, -0.051571376621723175, 0.01852596364915371, -0.010398569516837597, -0.09811902046203613, 0.0797446221113205, -0.0065352958627045155, -0.009131807833909988, 0.07297243922948837, -0.019170477986335754, 0.04525117948651314, 0.008674049749970436, 0.013135310262441635, 0.08487556129693985, 0.011591929942369461, 0.033377304673194885, -0.06083660572767258, 0.026223313063383102, 0.07019109278917313, 0.07786703109741211, -0.017287712544202805, -0.013345091603696346, 0.01905197650194168, 0.062421124428510666, 0.0050177318044006824, 0.013014511205255985, -0.0008383542881347239, -0.029548170045018196, 0.06919974088668823, 0.03179968148469925, -0.004130530171096325, 0.07015980780124664, -0.02217893674969673, -0.051659777760505676, 0.0215130727738142, -0.07145436108112335, 0.08118065446615219, 0.027162818238139153, -0.0067008608020842075, 0.018150491639971733, 0.03595193848013878, -0.010217905044555664, -0.02791197970509529, -0.026594894006848335, -0.010796631686389446, -0.025804312899708748, -0.011400064453482628, 0.013473917730152607, -0.008578682318329811, 0.01054257620126009, -0.019770359620451927, 0.05260055139660835, 0.02179507538676262, 0.04551177844405174, -0.0015093303518369794, -0.01308564841747284, -0.017704453319311142, 0.02343377098441124, -0.002853949321433902, -0.009545511566102505, -0.030294176191091537, 0.004545192699879408, -0.01678542047739029, -0.03387722373008728, -0.0157907884567976, 0.011094460263848305, 0.01433560810983181, 0.02591593563556671, 0.02273375727236271, 0.03884856775403023, -0.012666306458413601, -0.0007198605453595519, 0.014931051060557365, -0.059028226882219315, 0.04919038712978363, -0.023127611726522446, -0.010635965503752232, -0.023343760520219803, 0.007085038814693689, -0.016406547278165817, -0.012202385812997818, 0.0033028225880116224, 0.0047688670456409454, 0.015632906928658485, -0.023409118875861168, 0.006984221749007702, -0.002579056890681386, 0.01659499667584896, -0.017122989520430565, -0.02433660812675953, 0.05057581886649132, 0.023787761107087135, 0.04908909276127815, -0.10321439057588577, 0.011643039993941784, 0.012699767015874386, 0.028122678399086, 0.0017995485104620457, -0.035185087472200394, 0.006787779275327921, -0.026366878300905228, -0.04645560309290886, -0.0064680613577365875, 0.058137986809015274, 0.034184958785772324, 0.052713196724653244, -0.007650412619113922, 0.009717396460473537, -0.023055972531437874, 0.03556077927350998, 0.0015363761922344565, -0.007838115096092224, 0.05510881915688515, -0.016075171530246735, 0.038291577249765396, 0.042358335107564926, -0.03132340684533119, -0.006796413101255894, -0.013456565327942371, 0.03834818676114082, 0.009493349120020866, -0.03324630483984947, -0.03311944752931595, -0.013367678970098495, 0.013239656575024128, -0.05670551210641861, 0.017141971737146378, -0.00255274074152112, -0.0313277430832386, 0.008854634128510952, 0.03718729689717293, -0.013914366252720356, 0.01788194850087166, 0.01620158553123474, -0.04580408334732056, 0.02282746322453022, 0.007730390410870314, -0.013858139514923096, 0.031055135652422905, 0.05096995830535889, -0.01664823107421398, 0.026893198490142822, -0.03053799644112587, -0.05315571278333664, 0.017713040113449097, -0.02337767370045185, 0.014947356656193733, 0.004066444467753172, -0.018014363944530487, 0.03569810464978218, 0.009093460626900196, 0.03825219348073006, 0.03793983906507492, 0.02416171319782734, 0.00887210201472044, 0.01976180262863636, -0.004400934092700481, -0.011425652541220188, 0.030667705461382866, 0.038434579968452454, 0.001412364304997027, -0.04306085407733917, 0.018077747896313667, 0.022597044706344604, 0.022776877507567406, -0.044021572917699814, 0.005649571307003498, -0.024815119802951813, 0.0167531818151474, 0.01606239192187786, -0.044266946613788605, 0.026436734944581985, -0.0037528264801949263, 0.01904480904340744, 0.02164466306567192, -0.01609078235924244, -0.0301311444491148, -0.011943324469029903, 0.014332233928143978, 0.013488700613379478, 0.026740355417132378, 0.01690112054347992, 0.06196599826216698, 0.027670126408338547, 0.018731750547885895, -0.007307988591492176, -0.002567355055361986, -0.02356668747961521, 0.017557727172970772, 0.048950597643852234, -0.005060179159045219, 0.000573364261072129, -0.04848656430840492, 0.010606443509459496, -0.04161631688475609, -0.004224391654133797, 0.008899486623704433, -0.028439711779356003, 0.0003369110927451402, -0.014702708460390568, -0.009345835074782372, 0.020890092477202415, -0.026218479499220848, 0.0017517111264169216, 0.002997494535520673, 0.020753752440214157, -0.04263542965054512, 0.034902315586805344, 0.027493799105286598, -0.062270693480968475, 0.024423036724328995, -0.016967037692666054, -0.007049150764942169, -0.04460812360048294, -0.012188119813799858, -0.025925207883119583, 0.017302270978689194, 0.05793360248208046, 0.009246809408068657, -0.0214020237326622, 0.02155456319451332, 0.021566251292824745, -0.005681486334651709, 0.020067159086465836, -0.0007116406923159957, -0.006444412749260664, 0.018978649750351906, 0.001994080375880003, 0.025604436174035072, -0.03341277316212654, 0.04571792110800743, -0.0024686127435415983, -0.052702438086271286, 0.00195701839402318, -0.008814852684736252, 0.006734125781804323, -0.06984949111938477, 0.03380627557635307, -0.0028590254951268435, -0.004792284686118364, -0.003428579308092594, 0.016229402273893356, 0.03845731168985367, 0.06322014331817627, -0.02389899082481861, -0.05315268412232399, -0.03866041824221611, 0.03916550427675247, -0.013093555346131325, 0.007313396316021681, -0.027068957686424255, -0.008220262825489044, 0.04868807643651962, 0.01152010541409254, -0.04835391044616699, -0.04260675236582756, 0.037458084523677826, -0.010728908702731133, 0.005929272621870041, -0.014224354177713394, 0.005505519453436136, 0.0015831702621653676, 0.00039349112194031477, 0.004303404130041599, 0.005756799131631851, -0.012778125703334808, -0.03807263448834419, 0.04127192869782448, 0.00029253229149617255, 0.024397796019911766, 0.026306336745619774, -0.026348739862442017, 0.019236810505390167, -0.029824720695614815, -0.015829460695385933, 0.006491597276180983, 0.014480581507086754, 0.03502393513917923, -0.0026793871074914932, -0.012029118835926056, 0.004213674459606409, 0.014737891033291817, 0.0163008701056242, 0.0123435752466321, -0.016340911388397217, -0.005331516265869141, -0.06447432190179825, 0.019894367083907127, 0.05945443734526634, -0.03716430440545082, 0.03930257633328438, -0.07828281819820404, -0.028544535860419273, 0.036755066365003586, 0.05753780156373978, -0.02013608068227768, -0.023444760590791702, -0.05467461794614792, -0.004768198821693659, -0.008279876783490181, -0.023307492956519127, 0.00546290585771203, 0.019078519195318222, -0.011996730230748653, -0.021007612347602844, -0.04083256050944328, -0.062051720917224884, -0.04976769909262657, -0.06630875170230865, -0.03456363454461098, 0.015025701373815536, -0.011786039918661118, 0.03185615688562393, 0.00372100411914289, -0.014921647496521473, -0.03806036710739136, 0.051963649690151215, -0.0024479262065142393, -0.03701195493340492, 0.012049075216054916, -0.015384262427687645, -0.017279384657740593, 0.00883199367672205, -0.02367222122848034, -0.0004245202289894223, 0.0006707862485200167, 0.014061855152249336, 0.019855402410030365, -0.017413368448615074, -0.03938506543636322, 0.07909150421619415, 0.011051488108932972, -0.004661357495933771, 0.005039724055677652, -0.020751740783452988, -0.003677100408822298, -0.025285348296165466, -0.03773698955774307, -0.031242812052369118, 0.027385618537664413, -0.019375069066882133, -0.0016226364532485604, 0.02213873527944088, 0.02897653914988041, 0.0015523461624979973, -0.015949955210089684, -0.030036451295018196, 0.0023638284765183926, 0.009415785782039165, 0.009907025843858719, -0.02830587886273861, 0.013074766844511032, 0.016771694645285606, -0.010859393514692783, -0.008530989289283752, 0.029863571748137474, -0.023522213101387024, -0.010880245827138424, 0.022566137835383415, -0.014919055625796318, -0.05067586526274681, 0.002655389253050089, 0.014214693568646908, -0.004052311182022095, 0.045454565435647964, 0.03292348235845566, 0.012661583721637726, -0.002631885465234518, -0.03450705483555794, -0.005742035806179047, 0.06034581735730171, -0.027602462098002434, 0.006249958649277687, -0.013792182318866253, 0.00012792674533557147, 0.026136036962270737, -0.0023648568894714117, -0.018125317990779877, 0.04295141622424126, 0.01248828787356615, 0.011560387909412384, 0.025150736793875694, -0.03225758671760559, -0.0373687781393528, 0.024248022586107254, -0.03518031910061836, 0.005315954796969891, -0.009309251792728901, 0.05492181330919266, 0.015149758197367191, -0.03663947433233261, 0.008381552994251251, -0.043170034885406494, 0.013405481353402138, 0.058841388672590256, -0.025482282042503357, -0.03907954692840576, -0.050514597445726395, 0.02021501399576664, 0.07128951698541641, 0.03388224169611931, -0.0025640567764639854, -0.012629840523004532, -0.005541685968637466, 0.01915457844734192, -0.028456520289182663, 0.06054998189210892, -0.01479566190391779, 0.005743180867284536, 0.04812939837574959, 0.008435866795480251, -0.013776864856481552, -0.0020304792560636997, 0.01687610149383545, -0.004614735953509808, 0.03792903572320938, 0.003113343147560954, -0.02730805240571499, -0.020768960937857628, 0.007469807751476765, 0.04354001581668854, 0.008735168725252151, -0.02573038451373577, 0.015793347731232643, 0.023570165038108826, -0.01089759636670351, -0.04062860086560249, -0.018323387950658798, 0.027129849418997765, 0.03144017606973648, -0.008627449162304401, -0.04139465093612671, -0.03710486739873886, -0.026229199022054672, 0.02307802066206932, 0.02452145330607891, -0.0010455321753397584, 0.004179017618298531, -0.004413296468555927, -0.004085225984454155, -0.022268174216151237, -0.026502111926674843, -0.007648092228919268, 0.028906796127557755, 0.048752475529909134, -0.03503838926553726, 0.011064666323363781, 0.0040038577280938625, 0.02833615429699421, 0.024579385295510292, 0.01490254420787096, 0.004221287090331316, -0.026407942175865173, 0.05769982188940048, 0.02933403290808201, -0.002788158832117915, -0.007199624087661505, -0.03579723462462425, -0.06236158683896065, -0.058352962136268616, 0.001987967174500227, 0.008068033494055271, 0.07978751510381699, -0.030989566817879677, -0.01306322030723095, 0.004822138696908951, -0.011864622123539448, -0.026954172179102898, -0.030458256602287292, 0.007397742476314306, -0.036226578056812286, 0.018295729532837868, 0.012770717963576317, 0.007188981864601374, -0.012619822286069393, 0.016047339886426926, 0.037790603935718536, 0.02034970000386238, -0.030557025223970413, -0.04115498438477516, -0.002547908341512084, 0.004838861525058746, 0.03831368684768677, -0.046959374099969864, -0.06355087459087372, -0.043438732624053955, 0.06008382886648178, 0.009100611321628094, 0.001231497386470437, -0.02623629756271839, -0.01987229473888874, 0.02325257658958435, -0.04464266821742058, -0.020762432366609573, 0.019216366112232208, 0.041245874017477036, 0.029657455161213875, 0.006568646524101496, 0.046707313507795334, -0.043686673045158386, -0.0038474309258162975, -0.009707666002213955, -0.0033395057544112206, 0.021749570965766907, -0.012390315532684326, 0.04486484080553055, -0.0446351133286953, 0.005523683503270149, -0.01764870434999466, -0.07894622534513474, 0.005638740491122007, 0.03178093209862709, -0.03261915594339371, -0.001047121942974627, -0.014144804328680038, 0.005903716664761305, 0.012996431440114975, 0.0011227932991459966, -0.03342977166175842, 0.02387167327105999, 0.00743152154609561, -0.008954794146120548, 0.014494392089545727, 0.006475383415818214, 0.014474881812930107, -0.035613927990198135, 0.004780460614711046, -0.017324021086096764, -0.006381106097251177, -0.008899801410734653, -0.021635251119732857, -0.010607905685901642, -0.011999839916825294, 0.008474917151033878, -0.03175820782780647, 0.013628002256155014, 0.006259686779230833, -0.0367773100733757, -0.06134491041302681, -0.0068170190788805485, 0.008143634535372257, -0.01975760981440544, 0.00917236041277647, -0.027491291984915733, 0.009188385680317879, 0.013192784041166306, 0.05373011529445648, 0.0019405012717470527, 0.0062583317048847675, 0.03220310062170029, 0.029228610917925835, -0.013325655832886696, -0.013292810879647732 ]
Finetune Stable Diffusion Models with DDPO via TRL
metric-space
September 29, 2023
trl-ddpo
guide, diffusers, rl, rlhf
https://huggingface.co/blog/trl-ddpo
Setup To get started, when it comes to the hardware side of things and this implementation of DDPO, at the very least access to an A100 NVIDIA GPU is required for successful training. Anything below this GPU type will soon run into Out-of-memory issues. Use pip to install the trl library bash pip install trl[diffusers] This should get the main library installed. The following dependencies are for tracking and image logging. After getting wandb installed, be sure to login to save the results to a personal account bash pip install wandb torchvision Note: you could choose to use tensorboard rather than wandb for which youโ€™d want to install the tensorboard package via pip.
[ 0.026909196749329567, 0.024907711893320084, 0.00613128999248147, 0.014348565600812435, 0.10792767256498337, -0.05589127168059349, -0.0386490672826767, 0.03470396623015404, -0.03302041068673134, -0.06425467878580093, -0.06469473242759705, 0.09992993623018265, 0.02810814417898655, 0.016723552718758583, 0.019198507070541382, -0.04339202493429184, 0.03150447458028793, -0.01700337789952755, -0.05636557564139366, 0.040479954332113266, 0.07004830986261368, -0.02881300076842308, -0.01951439678668976, 0.03759632259607315, -0.030959272757172585, -0.09462989121675491, 0.004176774062216282, 0.04698028042912483, -0.04694642499089241, 0.01655074767768383, -0.05561808869242668, -0.02785431407392025, 0.023652682080864906, -0.05520617589354515, 0.02914287894964218, 0.027244998142123222, -0.0612981952726841, 0.024706948548555374, 0.08189871907234192, -0.01723308302462101, -0.0005217490834183991, -0.021871430799365044, -0.04911642149090767, 0.05872013792395592, -0.01562123466283083, 0.010720171965658665, -0.03677129000425339, 0.056027669459581375, 0.002523265080526471, -0.0320744551718235, -0.15616965293884277, 0.07510914653539658, -0.052351489663124084, -0.0749010443687439, 0.04908425733447075, 0.03172582387924194, -0.006191427819430828, -0.012132551521062851, -0.028829388320446014, -0.037610940635204315, 0.029247844591736794, 0.026918433606624603, -0.032859962433576584, 0.019684329628944397, -0.027553150430321693, -0.0678199827671051, 0.021364865824580193, -0.030536038801074028, -0.03163917362689972, -0.04422527551651001, 0.03387442231178284, -0.00784162525087595, -0.056702226400375366, -0.016209645196795464, 0.0017439922085031867, -0.0739826187491417, 0.0714631974697113, 0.006565348710864782, 0.03248761221766472, 0.07648207992315292, 0.03680906444787979, 0.0015444314340129495, 0.004189123399555683, 0.08212512731552124, 0.03609699010848999, 0.05527627095580101, 0.056219346821308136, 0.0042756088078022, -0.044487107545137405, -0.019309040158987045, -0.0438874177634716, -0.020401623100042343, -0.0172706451267004, 0.0037011373788118362, 0.036568086594343185, -0.052015066146850586, -0.09930426627397537, 0.03104410506784916, 0.01605476252734661, -0.0423860065639019, 0.04666424170136452, -0.017746131867170334, 0.022390225902199745, -0.10807733982801437, -0.05720273405313492, 0.062127888202667236, 0.014247446320950985, 0.00997925829142332, 0.00026297286967746913, 0.07332748919725418, -0.04237821325659752, 0.03403662517666817, -0.03598567470908165, 0.04004751145839691, -0.04120069369673729, 0.05247689038515091, 0.0033955860417336226, 0.049245867878198624, 0.04978494346141815, 0.06161888316273689, 0.010363640263676643, 0.08316592127084732, -0.0022851359099149704, -0.06218935176730156, -0.008537566289305687, 0.10279067605733871, -0.06120426207780838, 0.0015525547787547112, -0.054133091121912, 0.0281623974442482, 0.04805516079068184, -0.01745743863284588, 0.0630769431591034, -0.07959837466478348, -0.02445736713707447, -0.03209589794278145, -0.006942082662135363, -0.0391465425491333, -0.010758811607956886, -0.012639889493584633, 0.0149672357365489, 0.08217999339103699, -0.040848955512046814, 0.05425021052360535, -0.03419438749551773, -0.04931959882378578, -0.051041584461927414, 0.030920900404453278, -0.04832930862903595, -0.02673450857400894, -0.07192571461200714, 0.09812700003385544, -0.024419406428933144, -0.05579589307308197, 0.004531059879809618, 0.09528268873691559, -0.016925057396292686, -0.0023675591219216585, -0.05907071754336357, 0.0026562586426734924, 0.0020624038297683, -0.037980008870363235, -0.055548492819070816, 0.084650918841362, 0.006741460878401995, -0.03530220687389374, 0.08561902493238449, -0.0000018213156636193162, 0.08818850666284561, -0.02151491865515709, -0.027318421751260757, 0.01256596576422453, 0.018169647082686424, 0.07007069885730743, 0.012912770733237267, 0.04198670759797096, 0.019660785794258118, 0.03265867754817009, 0.02286727912724018, -0.035344384610652924, -0.05766685679554939, 0.004141588695347309, -0.0022700740955770016, 0.015938976779580116, 0.03405548259615898, -0.11101261526346207, 0.040130771696567535, -0.05942820385098457, 0.044556062668561935, 0.03115328960120678, -0.0018484200118109584, -0.022548280656337738, 0.05924335867166519, 0.010680130682885647, 0.05094965919852257, -0.04555429145693779, -0.0144028440117836, 0.052300844341516495, 0.06593398749828339, 0.06856042891740799, 0.004218310583382845, 0.027716422453522682, 0.028830545023083687, 0.022886455059051514, -0.0025372172240167856, 0.02392919920384884, 0.000902102212421596, 0.02347590960562229, 0.03066944144666195, 0.04130353778600693, -0.04734516143798828, -0.16133452951908112, 0.02184673398733139, -0.05386713892221451, 0.03304951637983322, -0.02415638417005539, 0.03133990615606308, 0.03219860792160034, 0.015742728486657143, -0.005108024459332228, 0.06550289690494537, -0.025198565796017647, -0.029651828110218048, -0.012140564620494843, -0.08945659548044205, 0.08465434610843658, 0.05485455319285393, -0.02256816253066063, 0.022208169102668762, -0.09611920267343521, -0.07957907021045685, -0.037331003695726395, -0.027784157544374466, 0.09515143185853958, 0.021588116884231567, -0.03344317525625229, -0.02699189819395542, -0.0294154305011034, 0.047875743359327316, 0.0031148565467447042, 0.033451057970523834, 0.03846591338515282, -0.07843933254480362, 0.03516034036874771, 0.07181467860937119, -0.0009618056355975568, 0.03660817816853523, 0.023709852248430252, 0.009518513455986977, -0.02468610182404518, -0.06468851864337921, 0.056340575218200684, -0.01529107615351677, -0.026758672669529915, 0.026462890207767487, 0.05557108297944069, -0.015926063060760498, -0.03858168050646782, 0.009029611945152283, 0.023766396567225456, -0.01961493492126465, 0.022903136909008026, -0.029573120176792145, -0.03830134496092796, -0.008499786257743835, 0.0022933778818696737, -0.02856636792421341, -0.02390339784324169, -0.013839606195688248, -0.015166419558227062, 0.010751927271485329, 0.0020629982464015484, -0.008650749921798706, 0.03065124899148941, 0.0030016161035746336, 0.021991854533553123, 0.010142800398170948, -0.014925844967365265, -0.011712943203747272, -0.03601043298840523, 0.032781630754470825, -0.03262602910399437, 0.029783226549625397, 0.03815276920795441, -0.007477853447198868, 0.035203948616981506, -0.028266077861189842, -0.03332133963704109, -0.026514582335948944, 0.029018808156251907, -0.03987612575292587, 0.025811806321144104, 0.032573994249105453, -0.02299569547176361, -0.03022666461765766, 0.004431779962033033, -0.009004766121506691, -0.00787047203630209, -0.0029280513990670443, -0.00020135841623414308, -0.0006613852456212044, -0.006161575671285391, -0.0019766902551054955, -0.0154939666390419, -0.026120100170373917, -0.015769112855196, 0.00813795905560255, 0.00611488800495863, -0.08405792713165283, 0.010378819890320301, -0.01649538055062294, 0.026358578354120255, 0.03183027356863022, 0.014423245564103127, -0.017856908962130547, 0.01575963757932186, -0.00598520040512085, -0.0008693488198332489, -0.028232960030436516, 0.04642292857170105, 0.010640191845595837, 0.027037395164370537, 0.07770760357379913, 0.01100629661232233, 0.07472287118434906, 0.0029596483800560236, 0.02292540855705738, 0.025046341121196747, -0.03161529824137688, 0.021306799724698067, 0.0012933401158079505, -0.0007344972109422088, -0.058885928243398666, 0.014677248895168304, 0.008219743147492409, 0.0169184822589159, -0.01192755438387394, 0.035033196210861206, -0.002412382746115327, -0.007813092321157455, -0.04534052312374115, 0.019662661477923393, -0.02226909063756466, -0.016762422397732735, 0.03395991399884224, -0.04215768352150917, 0.015870187431573868, 0.018620043992996216, 0.023893985897302628, -0.03941136971116066, 0.015170815400779247, -0.016571728512644768, 0.030375780537724495, 0.006597643718123436, 0.018107766285538673, 0.011496642604470253, -0.02212933823466301, -0.026892373338341713, -0.02056957595050335, 0.019585948437452316, -0.025099242106080055, -0.0018516817362979054, 0.000533478450961411, -0.005693510174751282, 0.009399689733982086, 0.040872722864151, 0.013850073330104351, -0.01897633634507656, -0.013483977876603603, 0.02388947084546089, 0.038157619535923004, -0.03129565715789795, 0.002966089639812708, 0.03352442756295204, 0.057090144604444504, -0.045985594391822815, -0.0057779657654464245, -0.008055278100073338, -0.02382037788629532, 0.061428479850292206, 0.017138415947556496, 0.00416514091193676, 0.004754954017698765, 0.008605285547673702, -0.012264015153050423, -0.021034125238656998, 0.04350484535098076, -0.007577972952276468, 0.01941772736608982, -0.06359981745481491, -0.033907536417245865, -0.0652867928147316, -0.016951045021414757, 0.008143264800310135, -0.06765738129615784, -0.04818609356880188, 0.06903450936079025, 0.0153454365208745, 0.052584920078516006, -0.0014386388938874006, 0.005719730630517006, 0.023171640932559967, -0.011706262826919556, -0.05937442183494568, 0.010317842476069927, 0.033568885177373886, 0.028808262199163437, 0.024333976209163666, -0.011286219581961632, -0.04710360988974571, 0.011019746772944927, 0.013702142983675003, -0.053767818957567215, -0.0026666508056223392, -0.019154295325279236, -0.009317638352513313, 0.0025191595777869225, 0.0019922584760934114, 0.012751730158925056, -0.050957564264535904, 0.021589554846286774, 0.014758016914129257, -0.017892910167574883, 0.025487538427114487, 0.020687399432063103, -0.0008820823859423399, -0.06970973312854767, 0.03771040588617325, -0.015353193506598473, 0.003923170268535614, -0.015233194455504417, -0.03787554055452347, 0.0012883050367236137, -0.011174515821039677, 0.03710413724184036, 0.02218877151608467, -0.006929311901330948, -0.03117479383945465, -0.012367205694317818, -0.00947599858045578, 0.04331676661968231, 0.028410151600837708, 0.01439407654106617, -0.044817421585321426, -0.01032616849988699, 0.02951560541987419, 0.029544994235038757, 0.011536448262631893, -0.03368070349097252, -0.012514463625848293, 0.05407450348138809, -0.07584072649478912, 0.040488485246896744, -0.010099230334162712, -0.010123169980943203, 0.050176095217466354, -0.035981837660074234, 0.03850879892706871, 0.022078463807702065, -0.0182657390832901, -0.01888449490070343, 0.032860323786735535, 0.04383491352200508, 0.01435520313680172, -0.010702463798224926, 0.029344592243433, 0.038928356021642685, 0.06206206977367401, -0.022678108885884285, -0.008448359556496143, -0.025691909715533257, 0.055905841290950775, 0.005882744211703539, 0.03115849755704403, 0.023316463455557823, -0.02563563920557499, 0.008319318294525146, 0.003070615231990814, -0.034935444593429565, 0.004034390673041344, -0.01869938150048256, 0.0028525276575237513, -0.0003702230751514435, 0.022728921845555305, 0.01144241914153099, 0.027190010994672775, -0.018725084140896797, -0.0034658194053918123, -0.014774513430893421, -0.011463320814073086, 0.046361759305000305, -0.015088469721376896, -0.00041552813490852714, 0.01207937765866518, 0.005248784087598324, -0.009693343192338943, 0.028283171355724335, 0.004990388173609972, -0.010020171292126179, -0.013500478118658066, 0.03379400819540024, -0.021388480439782143, 0.02654087543487549, 0.009568934328854084, -0.020466623827815056, 0.05758770555257797, -0.029774419963359833, 0.009180828928947449, 0.028266116976737976, 0.02185029163956642, -0.011488797143101692, -0.02516409568488598, 0.04638336971402168, 0.026878250762820244, 0.001705979579128325, 0.018525607883930206, 0.0105900252237916, 0.02234218455851078, -0.008878025226294994, -0.03201664239168167, -0.005007465369999409, -0.016999850049614906, -0.031949546188116074, -0.06733143329620361, -0.004641551058739424, 0.020960116758942604, 0.006410388741642237, 0.06143992021679878, -0.035007137805223465, 0.005907464772462845, -0.02056529000401497, 0.047143951058387756, 0.01795291155576706, -0.02949075773358345, 0.0032603973522782326, 0.016547491773962975, -0.026807621121406555, 0.040324967354536057, 0.020204704254865646, 0.02920565754175186, -0.01478948350995779, 0.045458320528268814, 0.03238500654697418, 0.04809276759624481, -0.011673994362354279, 0.03603178635239601, 0.03723505884408951, 0.027628635987639427, -0.014808219857513905, 0.007720010820776224, -0.013031229376792908, -0.02891014702618122, -0.03330962359905243, -0.003937760833650827, 0.03450838476419449, -0.03309261053800583, -0.006032874342054129, -0.01914106123149395, 0.04978521913290024, -0.012163842096924782, -0.048538289964199066, -0.037899598479270935, 0.010268112644553185, 0.04002395272254944, 0.000298426894005388, -0.020860111340880394, 0.008476447314023972, 0.027165446430444717, -0.017145974561572075, -0.04178957641124725, 0.05542392283678055, -0.014019878581166267, -0.005024438723921776, -0.0362863689661026, 0.018309159204363823, -0.03260677307844162, -0.008516237139701843, 0.02564506232738495, -0.022531576454639435, 0.008619855158030987, 0.019462555646896362, -0.012717490084469318, -0.004983915947377682, -0.00885857455432415, 0.04669542610645294, -0.0006404474261216819, -0.04778079316020012, -0.001018490525893867, -0.015976369380950928, 0.03850619122385979, 0.0332157164812088, -0.01748688519001007, -0.05769886448979378, 0.022390132769942284, 0.07017387449741364, -0.014107204973697662, -0.00877287145704031, 0.029850013554096222, 0.0068984488025307655, -0.020688563585281372, -0.050426334142684937, -0.01313719805330038, -0.03300659358501434, 0.007719624787569046, 0.03041229397058487, -0.0027054334059357643, -0.02132117934525013, 0.012211808934807777, 0.03526929020881653, 0.039741866290569305, 0.03796132281422615, 0.008673017844557762, 0.024645334109663963, 0.023911412805318832, 0.044237032532691956, -0.011144722811877728, -0.00007913565787021071, 0.014012726955115795, 0.01445860881358385, -0.023636693134903908, 0.014558061957359314, 0.052072010934352875, -0.0029703991021960974, -0.009397891350090504, 0.03782598674297333, 0.005058354698121548, -0.0016443125205114484, -0.0157445278018713, 0.0362248457968235, -0.07275119423866272, -0.009850624017417431, -0.004531683400273323, -0.03513384610414505, -0.00897110067307949, -0.0010752982925623655, 0.011634702794253826, 0.029324188828468323, -0.036973509937524796, 0.04901297017931938, 0.012974845245480537, 0.01297230739146471, 0.009034804999828339, -0.010436884127557278, 0.03471491113305092, 0.005672754719853401, -0.003623472759500146, -0.04898713156580925, 0.003051379229873419, -0.02860470861196518, 0.04000524803996086, -0.007866978645324707, 0.02198309265077114, -0.015552523545920849, -0.022559499368071556, -0.02312607690691948, -0.042824968695640564, -0.020508412271738052, -0.004844666924327612, -0.012164252810180187, -0.016957607120275497, -0.04719764366745949, 0.005308038555085659, 0.012791444547474384, 0.014404425397515297, 0.01357585284858942, -0.00717579573392868, 0.025463951751589775, -0.02572930045425892, 0.020899100229144096, 0.028901297599077225, 0.002438407624140382, 0.012616940774023533, -0.06681828200817108, -0.018404124304652214, 0.002989677246659994, -0.03228354454040527, 0.0584774985909462, 0.04364533722400665, 0.0030675213783979416, 0.029950175434350967, -0.011325353756546974, 0.0015175783773884177, -0.03142158314585686, 0.008411737158894539, -0.006476870272308588, -0.0034800858702510595, 0.015277598984539509, -0.025412263348698616, 0.03404822200536728, -0.003263464430347085, 0.031610265374183655, 0.033022817224264145, 0.012786169536411762, -0.0031422642059624195, 0.006845049560070038, -0.006825961638242006, -0.0314517579972744, 0.037302643060684204, -0.06972991675138474, -0.03221810236573219, -0.01697336509823799, 0.037860188633203506, -0.010074800811707973, -0.006063244305551052, -0.04574296250939369, -0.04478027671575546, -0.06959179788827896, -0.011092700995504856, 0.024207141250371933, 0.03546122461557388, 0.04413462057709694, 0.064992256462574, 0.017239375039935112, -0.016337307170033455, -0.03925880417227745, 0.001186853158287704, 0.003284369595348835, -0.01850062422454357, 0.022953147068619728, 0.04807683080434799, -0.02781287394464016, -0.06076594442129135, -0.018490184098482132, 0.027540890499949455, -0.04825258255004883, -0.0163533054292202, 0.02279246412217617, -0.023074347525835037, -0.044736895710229874, -0.025234567001461983, 0.015235383063554764, 0.019931409507989883, 0.01809714362025261, 0.015259450301527977, -0.02358344756066799, 0.043327074497938156, 0.002395987045019865, -0.05185321718454361, 0.004443932790309191, -0.050372716039419174, 0.004359441343694925, 0.010012006387114525, -0.05601200833916664, -0.011563807725906372, -0.011932232417166233, 0.00013541767839342356, -0.028086669743061066, -0.033638738095760345, -0.04567337408661842, -0.008824661374092102, 0.04100431501865387, 0.041848354041576385, -0.020692668855190277, -0.0389045886695385, -0.01337585411965847, 0.02519156038761139, -0.0018804743885993958, -0.015389854088425636, 0.011548057198524475, -0.0056908996775746346, 0.040235359221696854, -0.010441956110298634, 0.0220850370824337, 0.044562242925167084, -0.000984514132142067, -0.04845144599676132, -0.005424643866717815, 0.009150867350399494 ]
Finetune Stable Diffusion Models with DDPO via TRL
metric-space
September 29, 2023
trl-ddpo
guide, diffusers, rl, rlhf
https://huggingface.co/blog/trl-ddpo
Results The following are pre-finetuned (left) and post-finetuned (right) outputs for the prompts bear, heaven and dune (each row is for the outputs of a single prompt): | pre-finetuned | post-finetuned | |:-------------------------:|:-------------------------:| | | | | | | | | |
[ 0.05482351779937744, -0.006297983229160309, 0.06123145669698715, -0.02997470460832119, 0.10196202248334885, 0.016272185370326042, 0.012572888284921646, 0.05964821204543114, -0.019748235121369362, -0.06692305207252502, -0.019735144451260567, 0.00549143785610795, 0.03052547201514244, 0.0005639883456751704, -0.01887286826968193, 0.006894959136843681, 0.011800464242696762, -0.053946636617183685, -0.04614083468914032, -0.024771632626652718, 0.07268624752759933, -0.000110191926069092, 0.009924661368131638, -0.015420230105519295, 0.06242141127586365, -0.022701378911733627, 0.044622357934713364, 0.004788133315742016, -0.06748489290475845, 0.03775272145867348, -0.08559691905975342, -0.05968649312853813, 0.03480737656354904, -0.05864398553967476, -0.0014216821873560548, -0.05598309636116028, -0.04318226873874664, 0.030996203422546387, -0.0022902218624949455, -0.06066761538386345, -0.007952872663736343, -0.07398147881031036, 0.03306497260928154, 0.04136543348431587, 0.027140934020280838, 0.0010106179397553205, -0.15196920931339264, 0.06743478029966354, -0.03584933653473854, 0.025405021384358406, -0.086770199239254, 0.047308508306741714, 0.060213636606931686, -0.03286207094788551, 0.034718990325927734, 0.007556415628641844, -0.01452729944139719, 0.005268373526632786, 0.04900564253330231, 0.021852592006325722, 0.0859658420085907, 0.0042142439633607864, 0.005076472647488117, 0.007954801432788372, -0.0003557398449629545, 0.041304294019937515, -0.020016107708215714, 0.08886996656656265, -0.07155200093984604, 0.007082880940288305, -0.003016131231561303, 0.010645050555467606, 0.004139130935072899, -0.027692511677742004, 0.0026550493203103542, -0.005191029515117407, 0.022377250716090202, 0.021266303956508636, -0.0545525997877121, 0.00796604622155428, -0.018458308652043343, -0.021329907700419426, 0.10630081593990326, 0.06428146362304688, -0.028372671455144882, -0.04000869393348694, 0.050102174282073975, 0.022594457492232323, -0.03130301833152771, -0.011725999414920807, -0.034533772617578506, -0.12651854753494263, -0.04831524193286896, 0.06485748291015625, -0.0007998908986337483, -0.034379757940769196, 0.06681062281131744, -0.04108358174562454, 0.015037779696285725, 0.025875333696603775, -0.04192279651761055, 0.008883259259164333, 0.1083768829703331, -0.07505542039871216, -0.05082593485713005, 0.009909235872328281, -0.09222199022769928, -0.08553213626146317, -0.029782520607113838, -0.035234324634075165, 0.029857270419597626, 0.001433802186511457, 0.04453928396105766, 0.05605122074484825, -0.036385733634233475, 0.043629035353660583, -0.023086564615368843, -0.020068924874067307, -0.04607343673706055, 0.03390190005302429, -0.027746757492423058, 0.025697896257042885, 0.07588467746973038, -0.03424400836229324, 0.024649618193507195, 0.043638717383146286, 0.007731630466878414, -0.02671581692993641, -0.08863820135593414, -0.028724005445837975, -0.0179588720202446, -0.011948510073125362, 0.0067968727089464664, 0.006896358914673328, -0.019948072731494904, -0.11024655401706696, -0.04763593524694443, -0.04565927013754845, 0.03814391791820526, 0.017725564539432526, -0.033893343061208725, -0.000693012319970876, -0.025115054100751877, 0.009676619432866573, 0.02829311415553093, -0.03626905754208565, -0.024951061233878136, 0.06061049923300743, -0.09458000957965851, 0.0683259516954422, 0.004090535454452038, 0.0473891906440258, -0.036518748849630356, -0.09816901385784149, -0.033656664192676544, 0.029575228691101074, 0.03474348038434982, -0.012761969119310379, -0.07547809928655624, -0.01808822900056839, 0.005483749322593212, 0.06039607524871826, 0.019414609298110008, -0.0002020172541961074, 0.03749174624681473, -0.04021591320633888, 0.029961613938212395, 0.0451812706887722, -0.00555254053324461, -0.03355620428919792, 0.020265044644474983, -0.00778770400211215, 0.10143043100833893, -0.0697755515575409, -0.04603913798928261, -0.024489955976605415, 0.09208877384662628, 0.0483233667910099, -0.007560761179775, 0.018135281279683113, 0.020378192886710167, -0.0001045081444317475, -0.010452794842422009, 0.059350527822971344, 0.025361405685544014, -0.06608529388904572, 0.00654262350872159, 0.0012731204042211175, 0.05864778533577919, 0.047817230224609375, -0.11267964541912079, 0.0013525249669328332, 0.09981238842010498, -0.014400126412510872, 0.0012927594361826777, -0.12544862926006317, -0.05885949730873108, 0.06752742826938629, 0.08054650574922562, -0.040702689439058304, 0.02591024339199066, 0.026797039434313774, 0.10665977746248245, -0.02211816981434822, -0.04284350201487541, 0.007900501601397991, 0.006878004875034094, -0.02533974125981331, 0.005193636287003756, -0.0785149559378624, -0.052528541535139084, -0.05243341252207756, 0.0631580799818039, -0.026453422382473946, -0.07057985663414001, -0.03738174960017204, 0.006580076180398464, -0.057206179946660995, -0.0031708867754787207, -0.04328010231256485, 0.09474067389965057, 0.10109955072402954, -0.005834838375449181, 0.0039711203426122665, -0.03239177539944649, 0.06629696488380432, 0.059593264013528824, 0.02765270508825779, -0.002246612450107932, -0.0870436578989029, -0.0595363974571228, -0.0038975398056209087, -0.059604763984680176, 0.07986004650592804, 0.03619535267353058, -0.026360662654042244, 0.03581009805202484, -0.06830133497714996, 0.041622184216976166, -0.027828171849250793, 0.023077458143234253, 0.003545740619301796, -0.03800526261329651, 0.029633954167366028, -0.005454550962895155, -0.05775909498333931, 0.005821512546390295, -0.009798883460462093, -0.05129504203796387, 0.030136022716760635, -0.08186829835176468, 0.04189298674464226, 0.006356442347168922, -0.026751022785902023, 0.01502230018377304, 0.04174017161130905, -0.014668290503323078, -0.01074603945016861, 0.00022735299717169255, -0.003961789421737194, -0.011302954517304897, -0.0036689843982458115, -0.0032200354617089033, -0.022222260013222694, -0.015569276176393032, -0.02509942837059498, -0.01501032616943121, 0.013468555174767971, -0.012317919172346592, -0.0021241118665784597, -0.005766123067587614, -0.01688774675130844, 0.01833830215036869, 0.024540189653635025, 0.007100042421370745, -0.02141449600458145, 0.052551403641700745, -0.04976030811667442, 0.016143817454576492, 0.033705055713653564, 0.023066317662596703, 0.008664462715387344, 0.04959900677204132, 0.021726658567786217, 0.04852568730711937, 0.02608552761375904, 0.03569823503494263, 0.0024955468252301216, 0.00937788374722004, -0.022306520491838455, -0.01095394603908062, 0.025775784626603127, 0.03940000385046005, -0.020566679537296295, 0.024982770904898643, -0.013989190571010113, -0.02170834131538868, 0.019654491916298866, -0.017578937113285065, 0.005399071145802736, 0.04274546355009079, -0.03760765492916107, -0.007146875374019146, 0.016952045261859894, 0.01325775682926178, 0.0456535741686821, -0.004303745925426483, 0.050214964896440506, -0.11187488585710526, -0.02679385431110859, 0.030862832441926003, 0.05233351141214371, -0.01454274170100689, -0.042142000049352646, 0.02494192309677601, -0.030256807804107666, -0.03367668017745018, -0.027794532477855682, 0.036563191562891006, -0.026075419038534164, -0.016825446859002113, 0.013714871369302273, 0.01158478669822216, 0.025361204519867897, 0.006103443447500467, -0.022885724902153015, 0.010649288073182106, 0.003664592746645212, -0.045227356255054474, 0.028788238763809204, -0.041578296571969986, -0.0011347297113388777, -0.01105624157935381, 0.04992511495947838, 0.04403047263622284, -0.020980728790163994, 0.0444856733083725, -0.010967181995511055, 0.027297934517264366, 0.01477982010692358, -0.02636328898370266, 0.029709411785006523, -0.04710482805967331, -0.014052308164536953, 0.01705329865217209, 0.008298827335238457, 0.0329832099378109, 0.06227413937449455, 0.005845241714268923, 0.019002540037035942, 0.02472997084259987, 0.03964213654398918, 0.002226469339802861, -0.011534024961292744, -0.01852473057806492, 0.024468062445521355, -0.010127809830009937, -0.025646086782217026, -0.0578770637512207, 0.038332805037498474, -0.03272667154669762, 0.07305797189474106, -0.0033403062261641026, 0.017145225778222084, -0.016864273697137833, 0.007538827136158943, 0.012113645672798157, -0.03512383624911308, -0.02964944764971733, 0.023829104378819466, 0.00241715251468122, 0.010589320212602615, -0.006170968059450388, 0.0073380786925554276, -0.008400722406804562, 0.02075939066708088, -0.011152789928019047, -0.029526151716709137, 0.006537891924381256, -0.007098844274878502, -0.007475399412214756, 0.008470301516354084, -0.004043737892061472, -0.03351592645049095, -0.03736609220504761, 0.04927714914083481, 0.023133402690291405, -0.002404386643320322, 0.0012575045693665743, 0.02451149746775627, -0.034675247967243195, -0.006928276736289263, -0.0032657161355018616, 0.026651877909898758, -0.029310381039977074, -0.04141749441623688, 0.013036660850048065, 0.0034867129288613796, 0.052666064351797104, -0.04749756306409836, 0.004196186549961567, -0.010835440829396248, 0.00898483581840992, -0.009340863674879074, 0.002448269398882985, 0.030930494889616966, 0.026550551876425743, 0.013464449904859066, 0.0492505207657814, -0.0140724191442132, -0.03615252301096916, 0.03895365819334984, 0.004277867265045643, 0.010436858981847763, -0.024066496640443802, 0.03238586336374283, -0.03438441827893257, 0.027629492804408073, -0.012459514662623405, -0.04449617490172386, 0.04036877304315567, -0.020772835239768028, -0.011734578758478165, -0.0104206008836627, 0.006418636068701744, -0.024377942085266113, -0.018251638859510422, 0.015816660597920418, -0.0296610239893198, 0.015882685780525208, 0.008596064522862434, -0.03235407918691635, 0.0592753030359745, 0.00814792700111866, 0.041007764637470245, 0.008528108708560467, 0.0073461709544062614, -0.019620129838585854, 0.013572415336966515, -0.056532733142375946, 0.0065588150173425674, 0.03927197307348251, 0.007885350845754147, -0.012036947533488274, -0.03202015534043312, 0.020030591636896133, -0.005733131431043148, -0.05720421299338341, 0.02611858770251274, -0.030768349766731262, 0.03150372579693794, -0.023368116468191147, 0.04869893938302994, 0.010513720102608204, -0.010470114648342133, -0.023586003109812737, -0.0027992920950055122, 0.006036106031388044, 0.049370694905519485, 0.015269170515239239, -0.022857211530208588, -0.021911494433879852, -0.013913060538470745, -0.019073832780122757, -0.03606773912906647, -0.02302236296236515, 0.013603782281279564, 0.06964000314474106, -0.008415027521550655, -0.020486880093812943, -0.04929311200976372, 0.05485527589917183, -0.019224315881729126, 0.038325730711221695, -0.01456046849489212, 0.02026985213160515, -0.00570191303268075, -0.015331285074353218, -0.008352115750312805, -0.01153547316789627, 0.03358699008822441, -0.036968521773815155, 0.0371011458337307, 0.036583635956048965, 0.04355178400874138, -0.0008940661791712046, 0.010598340071737766, -0.0037555075250566006, -0.04376523196697235, 0.007041282020509243, 0.06140286475419998, 0.01319204643368721, -0.040464483201503754, 0.03327735513448715, 0.026133302599191666, 0.02131783775985241, 0.04043969139456749, 0.040353525429964066, 0.04669556766748428, -0.02651197835803032, -0.007237811107188463, -0.037841834127902985, -0.001385070732794702, -0.021294336766004562, -0.018554726615548134, -0.02260752208530903, -0.026010438799858093, -0.02726777270436287, 0.031507380306720734, 0.01780196651816368, -0.021340632811188698, 0.0016770599177107215, 0.010427037253975868, 0.0016820690361782908, 0.008648183196783066, -0.0011384509271010756, 0.02706892229616642, -0.03015429712831974, 0.0018662747461348772, -0.0011006341082975268, -0.04440142214298248, -0.02029711939394474, 0.04210459813475609, -0.05814208462834358, -0.042561162263154984, -0.035629015415906906, 0.005205119028687477, -0.00232290499843657, 0.004275459796190262, 0.008617891930043697, 0.05012862756848335, 0.038669053465127945, -0.012763040140271187, 0.020656870678067207, 0.006307878531515598, 0.031409624963998795, -0.020242266356945038, 0.030377207323908806, 0.01032835990190506, 0.02884649485349655, -0.016177436336874962, -0.02177397906780243, -0.013322124257683754, 0.024524405598640442, -0.06959951668977737, 0.006956180091947317, 0.030626002699136734, 0.020210053771734238, 0.034313805401325226, 0.02840445190668106, 0.007045764476060867, 0.024038884788751602, -0.007369802799075842, 0.011567026376724243, 0.014628051780164242, -0.0053747775964438915, 0.010452019982039928, 0.046344488859176636, 0.012866878882050514, -0.028319496661424637, -0.02595382370054722, -0.0077859191223979, -0.004895319696515799, 0.0413295216858387, 0.0077011133544147015, 0.0033102817833423615, 0.02638043276965618, -0.02775823324918747, 0.06057121977210045, -0.008323002606630325, 0.030673589557409286, 0.0329371839761734, -0.002695033559575677, 0.018229197710752487, 0.01913372427225113, 0.015609423629939556, -0.0024671286810189486, 0.044765498489141464, 0.0006599208572879434, -0.016229255124926567, 0.03956303745508194, -0.022515470162034035, -0.03715159371495247, -0.001332940417341888, 0.029705822467803955, 0.032319486141204834, 0.05168426036834717, -0.010427539236843586, 0.014701540581882, 0.030143296346068382, 0.023214854300022125, -0.00042283025686629117, 0.007142325397580862, 0.027738532051444054, 0.0426810085773468, -0.0038754274137318134, 0.03282200172543526, 0.056565504521131516, -0.033089011907577515, -0.018491577357053757, 0.014212689362466335, -0.023151613771915436, -0.026038913056254387, 0.030005475506186485, 0.04627859219908714, -0.008245399221777916, 0.026448406279087067, -0.04882074519991875, 0.023684928193688393, 0.020469091832637787, 0.028026243671774864, 0.004455717280507088, 0.03606726974248886, 0.004819085355848074, 0.03516675531864166, -0.006067524664103985, -0.015346243977546692, -0.02694671042263508, 0.010209217667579651, 0.06442958861589432, -0.016162337735295296, 0.01087190117686987, 0.0061988020315766335, -0.013156183063983917, -0.007389466743916273, -0.01780010014772415, -0.0019592931494116783, 0.021428648382425308, 0.009474147111177444, 0.001808662316761911, 0.005853910464793444, -0.010444755665957928, -0.024692775681614876, -0.045179519802331924, 0.008428654633462429, -0.04238912835717201, 0.001099706394597888, 0.009826770052313805, -0.0033859258983284235, 0.03867753595113754, 0.024819066748023033, -0.03814153000712395, -0.043519508093595505, 0.005934176035225391, 0.015259256586432457, 0.06043820455670357, -0.022852227091789246, -0.02396705187857151, -0.05798057094216347, -0.010198264382779598, -0.01611238159239292, 0.02952553890645504, 0.03707313537597656, -0.03570080175995827, -0.019936783239245415, -0.010250356048345566, -0.028047503903508186, 0.014579052105545998, -0.01021871343255043, -0.005263849627226591, 0.0021480845753103495, 0.05021746829152107, -0.03292025253176689, 0.008977532386779785, 0.01482103206217289, -0.0023969770409166813, -0.00023976080410648137, -0.0011846462730318308, 0.002636826131492853, 0.046962425112724304, 0.02067093551158905, -0.0494452603161335, -0.01409673411399126, 0.009854613803327084, 0.0012427455512806773, 0.03204289823770523, -0.017597375437617302, 0.05304049700498581, 0.03036719746887684, 0.0012139157624915242, -0.027342865243554115, 0.002362377941608429, -0.04251689091324806, -0.005506823770701885, 0.001737760379910469, 0.023682309314608574, -0.022043492645025253, 0.009415814653038979, 0.026061374694108963, 0.007982674054801464, -0.002198117086663842, 0.032679107040166855, 0.029015151783823967, 0.0041932775638997555, 0.005765997804701328, 0.03513449430465698, -0.010360531508922577, 0.04112706705927849, -0.044777095317840576, -0.014021734707057476, -0.029888806864619255, -0.010846630670130253, -0.014754724688827991, -0.007780659012496471, -0.027852145954966545, 0.013323649764060974, -0.03573709726333618, -0.013977328315377235, 0.021128211170434952, 0.02396034635603428, 0.05549147352576256, -0.015704846009612083, 0.039554499089717865, -0.004154591355472803, 0.005323679652065039, -0.027835747227072716, -0.027162691578269005, -0.011871901340782642, -0.026416312903165817, 0.015415419824421406, -0.005046436563134193, -0.056337807327508926, 0.01718933694064617, -0.07062634825706482, -0.05415298789739609, -0.0000038010027765267296, 0.06172235310077667, -0.009678507223725319, -0.0011690228711813688, 0.02776891551911831, 0.02808789722621441, 0.05317075178027153, 0.033704355359077454, 0.028858622536063194, -0.006072320509701967, -0.0161892157047987, 0.002852085279300809, -0.02412598207592964, 0.030734529718756676, 0.0023464225232601166, 0.05455552414059639, 0.04298543557524681, 0.030063943937420845, -0.017472783103585243, -0.031964320689439774, -0.02465900406241417, -0.009107903577387333, -0.03734796494245529, -0.04410267993807793, -0.026956720277667046, 0.036502473056316376, 0.0031091596465557814, -0.04986045882105827, -0.03464627265930176, 0.04883423075079918, 0.01587619073688984, -0.0672616958618164, 0.004267341922968626, 0.03689872846007347, 0.039825282990932465, -0.002041087718680501, 0.05492367595434189, 0.007869012653827667, 0.02483110874891281, 0.008607731200754642, -0.009076087735593319, 0.004999530967324972, 0.009802299551665783 ]
Finetune Stable Diffusion Models with DDPO via TRL
metric-space
September 29, 2023
trl-ddpo
guide, diffusers, rl, rlhf
https://huggingface.co/blog/trl-ddpo
Training Stable Diffusion with DDPO
[ 0.04061957448720932, -0.010631752200424671, 0.05315306410193443, 0.01740949973464012, 0.08552218973636627, 0.022772926837205887, -0.07903622835874557, 0.03264447674155235, -0.03735058382153511, -0.07813291251659393, -0.026668861508369446, 0.044003117829561234, -0.040537912398576736, 0.011816848069429398, 0.01821795292198658, -0.005622738040983677, 0.015373952686786652, -0.04597434028983116, 0.021909058094024658, 0.009129186160862446, -0.029065826907753944, -0.04823758080601692, 0.002734300447627902, -0.03238828480243683, -0.011736806482076645, -0.06379447132349014, 0.034201931208372116, 0.025165073573589325, -0.06590171903371811, -0.017894525080919266, -0.09983793646097183, -0.01279807835817337, 0.05934072658419609, -0.017081089317798615, 0.02975582517683506, 0.019357213750481606, -0.045585136860609055, 0.025170138105750084, 0.02510126680135727, -0.04036800563335419, -0.028384631499648094, -0.05793076381087303, -0.05834072455763817, 0.04544438421726227, 0.0034277394879609346, -0.04600575566291809, -0.2387893795967102, 0.06811729073524475, -0.007906964048743248, -0.052724968641996384, -0.0961475521326065, 0.07181371003389359, -0.045133981853723526, 0.0005647010402753949, -0.01690852642059326, 0.0007929626735858619, -0.013611314818263054, -0.022329967468976974, -0.006808947771787643, -0.04683060571551323, 0.04810293763875961, -0.007133845705538988, -0.017308557406067848, 0.027949679642915726, 0.0030645953956991434, 0.012615279294550419, 0.0157944168895483, -0.006920022424310446, -0.10582515597343445, -0.048881758004426956, 0.014351580291986465, -0.030581865459680557, -0.01258895918726921, -0.003224355634301901, 0.02564535290002823, -0.08984284847974777, -0.013860329985618591, 0.05594554916024208, 0.05089131370186806, 0.08690447360277176, 0.0584268681704998, -0.019259678199887276, 0.1045200526714325, 0.06845860183238983, 0.010576894506812096, 0.02810708060860634, 0.05674424022436142, -0.028456412255764008, -0.011072133667767048, 0.011333845555782318, -0.002363060601055622, -0.0811825841665268, -0.05338152125477791, 0.017625711858272552, 0.0770927220582962, -0.04464608058333397, -0.02681380696594715, 0.005964373704046011, 0.04243788495659828, 0.023063568398356438, 0.0027946147602051497, -0.03187493234872818, 0.027221618220210075, -0.07833721488714218, -0.04378455504775047, 0.02061094529926777, -0.004628332797437906, -0.07866121828556061, -0.031049132347106934, 0.06637442111968994, -0.016954336315393448, 0.03757622092962265, 0.01968667283654213, 0.01768186315894127, -0.05858604609966278, 0.0762503519654274, -0.03064565919339657, 0.0366181805729866, 0.03128957003355026, 0.05093778669834137, -0.01663546822965145, 0.11854761093854904, 0.019562682136893272, 0.032553061842918396, -0.028650503605604172, 0.09270158410072327, 0.033697906881570816, -0.002534574829041958, -0.054015520960092545, 0.018415452912449837, 0.02679300121963024, -0.021217556670308113, 0.036846939474344254, -0.03754740208387375, 0.04650615528225899, -0.07370917499065399, -0.012240267358720303, 0.0009738400112837553, 0.017887094989418983, -0.010153450071811676, -0.03052457608282566, 0.05253113806247711, 0.018480489030480385, 0.07247146964073181, 0.007259753067046404, -0.03296191617846489, -0.03142634779214859, 0.018026914447546005, -0.0266544371843338, 0.0195753313601017, -0.002458393108099699, 0.0651448592543602, -0.0397556833922863, -0.048495467752218246, 0.01799246482551098, 0.06785008311271667, -0.02177850902080536, -0.014375579543411732, -0.07029417157173157, 0.01861981302499771, 0.024905791506171227, -0.04315394163131714, 0.005241494160145521, 0.061999522149562836, 0.08174154162406921, -0.05263002961874008, 0.033975448459386826, 0.03690672665834427, -0.0015505440533161163, -0.033234771341085434, -0.009530114009976387, -0.004911509342491627, 0.025844905525445938, 0.027624180540442467, -0.009969566017389297, 0.022535456344485283, 0.021398233249783516, 0.08087620139122009, 0.005726358853280544, 0.0019505289383232594, -0.014913156628608704, 0.005238841287791729, 0.001386332674883306, 0.03883134573698044, 0.05511058494448662, -0.10436554998159409, 0.03763813525438309, 0.013492568396031857, 0.041722699999809265, 0.06062990427017212, -0.04158005490899086, -0.0184348002076149, 0.06677605956792831, -0.02396966516971588, 0.04572197422385216, -0.05540880933403969, -0.05724111199378967, 0.07617517560720444, 0.041494641453027725, 0.0962018221616745, 0.002302807057276368, -0.01922576315701008, 0.04376193508505821, -0.03240986540913582, -0.04383904114365578, 0.006155193317681551, 0.05717968940734863, 0.014594938606023788, 0.06490764766931534, -0.02148834802210331, -0.04344244301319122, -0.10975085943937302, 0.03298246115446091, -0.028445057570934296, -0.030985532328486443, 0.05476364493370056, -0.017121069133281708, -0.03845594450831413, -0.018661586567759514, -0.06300606578588486, 0.12463903427124023, 0.030161390081048012, -0.008283901959657669, 0.058659106492996216, -0.055156413465738297, 0.06266167014837265, 0.06534896790981293, -0.00936687272042036, 0.08870375156402588, -0.11250077933073044, -0.046203747391700745, -0.028085652738809586, 0.023694390431046486, 0.07319620996713638, 0.061546679586172104, 0.0017581427237018943, 0.04545436054468155, -0.008982802741229534, 0.07378922402858734, -0.044072479009628296, 0.06520838290452957, -0.027091532945632935, -0.04526142776012421, 0.04295629262924194, -0.025843119248747826, -0.0054743485525250435, 0.06337174028158188, 0.04814847558736801, -0.06699518859386444, 0.0023727458901703358, -0.06437703222036362, 0.06297720968723297, -0.015000834129750729, -0.056423693895339966, 0.0717075988650322, -0.009190065786242485, -0.023617198690772057, -0.029570406302809715, -0.007422609720379114, 0.01631978526711464, 0.01726982183754444, -0.0012316773645579815, 0.005716748535633087, -0.0248598400503397, 0.0025742664001882076, -0.035225193947553635, 0.008512812666594982, 0.0063187433406710625, 0.004433280322700739, 0.025768272578716278, -0.0054726931266486645, -0.02516837604343891, 0.031698744744062424, -0.008706051856279373, -0.01951390877366066, -0.026276633143424988, 0.05080782249569893, -0.017799116671085358, -0.025964953005313873, 0.0038210819475352764, 0.006659351289272308, 0.0005571158835664392, 0.03515778109431267, 0.016873665153980255, 0.019650746136903763, 0.015708936378359795, 0.01345782820135355, -0.006905851885676384, -0.04013269394636154, 0.05476132035255432, 0.0039529623463749886, 0.027071991935372353, -0.02667284943163395, 0.008142262697219849, 0.011309650726616383, 0.007096508983522654, -0.004074030090123415, -0.006713260896503925, -0.0015650205314159393, -0.004444064572453499, 0.04093446210026741, 0.013475234620273113, -0.014627902768552303, 0.029327886179089546, -0.05204698070883751, 0.03846396133303642, 0.007281940430402756, 0.010214935056865215, -0.1362302452325821, -0.04284102842211723, 0.029333945363759995, 0.05082548409700394, -0.011802636086940765, -0.04819876700639725, 0.0038552165497094393, -0.03332376480102539, -0.02262553945183754, -0.006739457603543997, 0.029166867956519127, 0.031566157937049866, 0.020899638533592224, 0.02348533645272255, 0.007413568440824747, 0.01013204175978899, 0.04469979181885719, 0.024640601128339767, -0.008308503776788712, 0.03939438238739967, -0.06554524600505829, 0.06563953310251236, 0.01216871663928032, -0.0027255434542894363, -0.04341409355401993, 0.04177388548851013, 0.03368278220295906, 0.030329803004860878, 0.009104105643928051, -0.02639566920697689, -0.009416747838258743, 0.0069555738009512424, -0.04027020186185837, 0.035034261643886566, -0.043801773339509964, 0.02317008376121521, 0.024962792173027992, 0.009973657317459583, 0.022794924676418304, 0.009079430252313614, 0.027314553037285805, -0.017012672498822212, 0.013352270238101482, -0.011199088767170906, -0.010800555348396301, 0.006083493586629629, 0.011449558660387993, 0.026836317032575607, 0.04235211759805679, -0.02910677343606949, -0.016860397532582283, 0.0022655881475657225, -0.0008158095297403634, 0.02282615192234516, 0.011350728571414948, 0.024149268865585327, 0.011172709055244923, 0.0403643362224102, 0.03985226899385452, -0.016945339739322662, -0.027033429592847824, -0.002878573490306735, 0.02611437253654003, -0.024369260296225548, -0.04833182319998741, 0.054074883460998535, 0.023952791467308998, 0.029099227860569954, -0.009627271443605423, 0.015507932752370834, 0.02172461338341236, 0.002191867446526885, -0.017516369000077248, 0.024300681427121162, -0.027159450575709343, 0.02290823683142662, 0.00876353494822979, -0.024289915338158607, 0.07534343749284744, -0.019270308315753937, -0.008890022523701191, -0.011083644814789295, 0.0172248724848032, -0.06210930645465851, 0.013691367581486702, 0.0071398247964680195, 0.013911283574998379, 0.0035776826553046703, 0.039825644344091415, 0.04183993861079216, 0.015914281830191612, 0.0205489844083786, 0.024045897647738457, -0.014739949256181717, 0.02595583163201809, 0.026380399242043495, 0.05975725129246712, 0.003986991010606289, -0.009553015232086182, 0.025115611031651497, 0.047058846801519394, -0.04719714820384979, -0.01060301624238491, -0.00037966170930303633, -0.020147759467363358, 0.02148880623281002, -0.01873956061899662, -0.04398414492607117, -0.016127798706293106, -0.02495899610221386, 0.013420874252915382, -0.03616120666265488, 0.010049526579678059, -0.039606425911188126, -0.011752113699913025, 0.02804943546652794, -0.042727030813694, -0.025019239634275436, -0.03290509805083275, 0.04106173291802406, -0.05059471353888512, 0.01144978404045105, -0.017321662977337837, -0.027599036693572998, 0.0025017329026013613, -0.00679393345490098, -0.0018599419854581356, 0.025485960766673088, -0.022178499028086662, -0.007758805528283119, -0.022346673533320427, -0.038218412548303604, 0.006232414394617081, 0.005786917172372341, 0.028963154181838036, -0.021227076649665833, -0.020140094682574272, 0.04374102130532265, 0.018843993544578552, -0.07169683277606964, -0.03286688029766083, 0.00852714292705059, 0.0547669418156147, -0.02247888594865799, 0.04630328342318535, -0.0224210973829031, -0.06297899782657623, 0.006751237902790308, -0.014988693408668041, 0.03967206925153732, 0.04458659514784813, -0.03128189593553543, -0.052802447229623795, -0.0223026555031538, 0.04198286682367325, -0.003302572062239051, -0.009461535140872002, -0.009566670283675194, 0.007071580272167921, 0.05652051791548729, 0.00657482398673892, -0.02913675643503666, -0.03591799736022949, 0.009796852245926857, 0.006224730052053928, 0.0023076108191162348, 0.025704260915517807, -0.03053687885403633, 0.00484567740932107, -0.003474667901173234, -0.003842437407001853, 0.014034499414265156, 0.015539000742137432, -0.03852720186114311, 0.009301147423684597, 0.023132920265197754, 0.026432333514094353, 0.030650442466139793, 0.0074951378628611565, 0.0066747646778821945, -0.02130083739757538, 0.02791503258049488, 0.02639492228627205, -0.004999950062483549, -0.025380384176969528, 0.009782343171536922, 0.012036475352942944, -0.007481609936803579, 0.008436473086476326, 0.03765475004911423, 0.008198712021112442, -0.007377332076430321, 0.013528014533221722, -0.036464937031269073, 0.015848780050873756, 0.010915416292846203, 0.008817281574010849, 0.006334046833217144, -0.02754620462656021, -0.008911882527172565, 0.013888382352888584, 0.0286361426115036, -0.013523992151021957, -0.012631678953766823, 0.008736046962440014, 0.014220954850316048, -0.003148322692140937, 0.003039771458134055, 0.013661268167197704, -0.016706187278032303, 0.009439082816243172, 0.004851214587688446, -0.02760191075503826, -0.07029420137405396, -0.010183414444327354, -0.04651056230068207, -0.03911987319588661, -0.01096633542329073, -0.016335653141140938, 0.042955223470926285, -0.006754583213478327, 0.0007691478240303695, -0.04696952924132347, 0.015751691535115242, 0.05451212078332901, -0.029327917844057083, -0.003666728036478162, 0.015002278611063957, -0.02169112116098404, 0.050200894474983215, 0.014307473786175251, -0.008859993889927864, -0.004651287104934454, 0.02481352537870407, 0.03807199001312256, -0.003078421577811241, -0.02849927544593811, 0.09489927440881729, 0.009838958270847797, 0.03125093877315521, 0.01026946771889925, 0.015956582501530647, -0.05799926817417145, -0.01039358600974083, -0.027033086866140366, -0.00665074959397316, 0.03964444249868393, -0.00876510702073574, -0.014552992768585682, 0.0016900449991226196, 0.030612953007221222, -0.029706737026572227, 0.01998727396130562, -0.02198694832623005, 0.0016276780515909195, 0.027610916644334793, 0.007416883483529091, -0.03376598283648491, 0.009922543540596962, -0.02161446027457714, 0.0198941919952631, -0.011887100525200367, 0.03545217216014862, 0.0015008322661742568, 0.011849760077893734, 0.03762505203485489, -0.004477774724364281, -0.03570660948753357, 0.009877684526145458, 0.03737233951687813, 0.011919384822249413, 0.02783745341002941, 0.0025642174296081066, 0.006336628459393978, 0.0036900423001497984, -0.036147184669971466, 0.016024567186832428, 0.04965673387050629, -0.03457755967974663, 0.03980515897274017, -0.014128131791949272, 0.037445317953825, 0.017728988081216812, -0.011121977120637894, -0.023184003308415413, 0.02606426365673542, 0.03068898618221283, 0.006005431525409222, 0.01802169531583786, 0.010484341531991959, 0.011898738332092762, -0.035593852400779724, -0.03986318036913872, -0.011508043855428696, -0.02241411805152893, 0.0436655655503273, 0.029375307261943817, -0.052575740963220596, 0.0053066411055624485, -0.03831767663359642, 0.06226937100291252, 0.05867931619286537, 0.026367533951997757, -0.00554192578420043, 0.027522651478648186, 0.02439751662313938, 0.058316417038440704, -0.003192502772435546, -0.002666640328243375, 0.0019014194840565324, 0.0012145905056968331, 0.02431473508477211, -0.02484402060508728, -0.003407626412808895, 0.004977214615792036, -0.024911705404520035, 0.05506899580359459, -0.004517183639109135, -0.02901172637939453, -0.01120049599558115, 0.049477286636829376, -0.03190935403108597, 0.010004831477999687, 0.003023090772330761, -0.01883901096880436, -0.035431861877441406, -0.007934383116662502, 0.024777865037322044, -0.0092200618237257, -0.028637925162911415, 0.004493874963372946, 0.031025251373648643, 0.0037166124675422907, -0.004983753897249699, -0.007579200901091099, 0.01916443184018135, 0.018449153751134872, 0.018797462806105614, -0.03960321098566055, -0.04129653051495552, -0.026693707332015038, 0.026426998898386955, 0.0007293561939150095, 0.02325482666492462, -0.007623082026839256, -0.009007176384329796, -0.02414512448012829, -0.022636594250798225, -0.022637583315372467, -0.021715892478823662, 0.05481136962771416, 0.002413578564301133, -0.04757392778992653, 0.030032053589820862, -0.005560365971177816, -0.029471078887581825, -0.03393574431538582, -0.037488482892513275, 0.008573048748075962, -0.011027215979993343, 0.04232195019721985, 0.05047697573900223, 0.006721729878336191, -0.014452495612204075, -0.042463645339012146, -0.006659631617367268, -0.03856915980577469, 0.00740069430321455, 0.024886658415198326, 0.04998677968978882, -0.037246979773044586, -0.035118188709020615, 0.02885780669748783, 0.013989308848977089, -0.023457009345293045, -0.004339894279837608, 0.008596151135861874, -0.036760348826646805, -0.006278117652982473, -0.020295586436986923, 0.029301520437002182, -0.0044069476425647736, 0.012299749068915844, 0.02901999093592167, 0.05150407925248146, -0.008418080396950245, -0.02497716434299946, 0.028631417080760002, -0.016034400090575218, 0.023222466930747032, -0.0457538366317749, -0.04638119041919708, -0.018080634996294975, -0.028435664251446724, -0.010833009146153927, -0.009222639724612236, -0.02348223701119423, -0.00897280965000391, 0.0013593126786872745, 0.00029914904735051095, -0.014231263659894466, 0.030911123380064964, 0.06743107736110687, 0.026474734768271446, 0.024909965693950653, 0.012729942798614502, -0.036519479006528854, -0.010509216226637363, -0.015133237466216087, 0.01585816591978073, 0.046172816306352615, 0.016972454264760017, -0.01494357455521822, -0.02798975445330143, 0.018524525687098503, -0.03097580373287201, -0.05517297238111496, -0.019566981121897697, 0.008434763178229332, -0.04297566041350365, -0.0559503398835659, -0.006823540199548006, 0.014478583820164204, 0.014808706939220428, 0.035321466624736786, -0.00557660311460495, -0.023530522361397743, 0.015648851171135902, 0.009032756090164185, -0.025889718905091286, 0.0018040393479168415, -0.008923984132707119, 0.007764414884150028, 0.018897224217653275, 0.002105733146890998, -0.004774894565343857, -0.01782749965786934, -0.0280387531965971, 0.003701563458889723, 0.0035765119828283787, -0.0351700559258461, -0.03779744729399681, 0.02637651562690735, -0.005777557846158743, -0.02635214291512966, -0.048371486365795135, 0.008760547265410423, 0.0248941071331501, -0.011620676144957542, -0.03032921440899372, -0.022983821108937263, 0.016920950263738632, 0.0037983909714967012, 0.024731265380978584, -0.01980949379503727, 0.06918218731880188, 0.03187128156423569, -0.03572090342640877, -0.016745008528232574, 0.019762523472309113 ]
Finetune Stable Diffusion Models with DDPO via TRL
metric-space
September 29, 2023
trl-ddpo
guide, diffusers, rl, rlhf
https://huggingface.co/blog/trl-ddpo
A Walkthrough The main classes within the trl library responsible for DDPO training are the DDPOTrainer and DDPOConfig classes. See docs for more general info on the DDPOTrainer and DDPOConfig. There is an example training script in the trl repo. It uses both of these classes in tandem with default implementations of required inputs and default parameters to finetune a default pretrained Stable Diffusion Model from RunwayML . This example script uses wandb for logging and uses an aesthetic reward model whose weights are read from a public facing HuggingFace repo (so gathering data and training the aesthetic reward model is already done for you). The default prompt dataset used is a list of animal names. There is only one commandline flag argument that is required of the user to get things up and running. Additionally, the user is expected to have a huggingface user access token that will be used to upload the model post finetuning to HuggingFace hub. The following bash command gets things running: python python stable_diffusion_tuning.py --hf_user_access_token <token> The following table contains key hyperparameters that are directly correlated with positive results: | Parameter | Description | Recommended value for single GPU training (as of now) | | --- | --- | --- | | num_epochs | The number of epochs to train for | 200 | | train_batch_size | The batch size to use for training | 3 | | sample_batch_size | The batch size to use for sampling | 6 | | gradient_accumulation_steps | The number of accelerator based gradient accumulation steps to use | 1 | | sample_num_steps | The number of steps to sample for | 50 | | sample_num_batches_per_epoch | The number of batches to sample per epoch | 4 | | per_prompt_stat_tracking | Whether to track stats per prompt. If false, advantages will be calculated using the mean and std of the entire batch as opposed to tracking per prompt | True | | per_prompt_stat_tracking_buffer_size | The size of the buffer to use for tracking stats per prompt | 32 | | mixed_precision | Mixed precision training | True | | train_learning_rate | Learning rate | 3e-4 | The provided script is merely a starting point. Feel free to adjust the hyperparameters or even overhaul the script to accommodate different objective functions. For instance, one could integrate a function that gauges JPEG compressibility or one that evaluates visual-text alignment using a multi-modal model, among other possibilities.
[ 0.052299614995718, 0.006072815973311663, -0.043520741164684296, 0.01567809097468853, 0.09844302386045456, 0.02248859405517578, -0.003025578334927559, 0.02907877415418625, -0.03573823720216751, -0.021191241219639778, -0.07213009148836136, 0.07122479379177094, -0.012282412499189377, 0.000855666003189981, 0.0049272882752120495, -0.044889435172080994, 0.0005299084004946053, -0.04404940828680992, -0.021230872720479965, 0.053377650678157806, 0.014738678932189941, -0.046164173632860184, -0.02962108515202999, 0.011751481331884861, 0.014582782983779907, -0.08623876422643661, 0.05715622752904892, 0.05052679032087326, -0.060503970831632614, 0.03267236799001694, -0.08639205247163773, -0.03529759868979454, 0.023099401965737343, -0.06350208818912506, 0.07692951709032059, -0.006264743860810995, -0.06175606697797775, 0.013197437860071659, 0.021353794261813164, -0.05714896693825722, -0.01273021474480629, -0.04823761433362961, -0.05784067139029503, 0.052173882722854614, 0.011319627985358238, -0.056363753974437714, -0.12160640954971313, 0.025461167097091675, 0.005256708711385727, -0.07334887981414795, -0.11833979189395905, 0.08309005945920944, -0.043783288449048996, -0.005956972949206829, 0.002097754506394267, -0.021159572526812553, -0.014088605530560017, -0.03586520999670029, -0.005290831904858351, -0.04684300720691681, -0.01323143020272255, 0.023327453061938286, 0.03582761064171791, 0.016025755554437637, 0.04441292956471443, 0.004553013015538454, -0.018076693639159203, -0.004621192347258329, -0.05745784565806389, -0.05284614861011505, 0.022892696782946587, -0.01482172217220068, -0.0016022121999412775, -0.011206074617803097, -0.046922750771045685, -0.06615810096263885, -0.01288621686398983, 0.024630876258015633, 0.033656515181064606, 0.07721175253391266, -0.00022620345407631248, 0.012149867601692677, 0.043545953929424286, 0.07046987861394882, 0.0025909265968948603, 0.055410198867321014, 0.06031903624534607, -0.013328739441931248, -0.02023829147219658, -0.020015696063637733, -0.05098813399672508, -0.0816059485077858, -0.009157632477581501, -0.006315779406577349, 0.038074661046266556, -0.05551551654934883, -0.07939457893371582, 0.06189378723502159, 0.01896558329463005, -0.017931660637259483, 0.02955268695950508, -0.025222862139344215, 0.03225487843155861, -0.09575756639242172, -0.06885167211294174, 0.07183371484279633, -0.023732900619506836, -0.024645468220114708, -0.027257485315203667, 0.05752246081829071, 0.01433197408914566, 0.00371344992890954, -0.04109044000506401, 0.1087503731250763, -0.019337788224220276, 0.058562710881233215, -0.04826117679476738, -0.031202107667922974, -0.015103532932698727, 0.03223917633295059, -0.019457850605249405, 0.07823850214481354, 0.021842725574970245, -0.045736514031887054, -0.052431754767894745, 0.10715901106595993, 0.017467278987169266, -0.03119160607457161, -0.0018443703884258866, 0.005344516132026911, 0.03979630395770073, -0.01665377803146839, 0.06078767403960228, -0.04445726051926613, 0.02173524722456932, -0.04190825670957565, -0.009339351207017899, -0.03287411481142044, 0.04336448758840561, 0.02081305906176567, -0.022996628656983376, 0.07347147166728973, -0.06333755701780319, -0.003624101635068655, 0.02758922055363655, -0.04229894280433655, -0.04639708995819092, 0.039594992995262146, -0.06196551397442818, 0.024891246110200882, -0.08891680836677551, 0.12108541280031204, -0.003981876652687788, -0.03739019110798836, 0.028320372104644775, 0.06542370468378067, -0.03572913259267807, -0.028368281200528145, -0.061608124524354935, 0.011279841884970665, -0.009367575868964195, -0.003136542160063982, -0.06598521769046783, 0.08313707262277603, 0.05711303651332855, -0.017341703176498413, 0.05194474011659622, 0.059041578322649, 0.05719630420207977, -0.047344814985990524, -0.015609048306941986, -0.0032153939828276634, 0.04797014221549034, 0.037164002656936646, -0.014011505991220474, 0.029755650088191032, 0.006575766019523144, 0.01871085725724697, -0.022858042269945145, -0.0028549584094434977, -0.03217390552163124, 0.030363857746124268, 0.03342540189623833, 0.020440001040697098, 0.07155230641365051, -0.1276683509349823, 0.014820530079305172, 0.008527818135917187, 0.016503572463989258, 0.043180134147405624, 0.01212924811989069, 0.05464351177215576, 0.0666833221912384, 0.0016223711427301168, 0.04793596640229225, -0.08825455605983734, -0.055045995861291885, 0.09204715490341187, 0.02733185514807701, 0.057664159685373306, 0.05903547257184982, -0.027024345472455025, 0.05634818971157074, -0.024467315524816513, -0.06070055812597275, 0.0022956780157983303, 0.011993218213319778, -0.010716377757489681, 0.034545473754405975, 0.0023746276274323463, -0.03783175349235535, -0.13649627566337585, 0.018377285450696945, -0.04913590848445892, 0.011780321598052979, -0.016584930941462517, -0.021363699808716774, -0.036125071346759796, 0.03602316975593567, -0.0342644527554512, 0.13950017094612122, -0.0026480001397430897, 0.0076737478375434875, -0.008089238777756691, -0.09158064424991608, 0.0075677004642784595, 0.0537966713309288, 0.025203460827469826, 0.04489690437912941, -0.06106213480234146, -0.05762222036719322, -0.06460252404212952, -0.05403737351298332, 0.05406135693192482, 0.03185620903968811, -0.06914273649454117, 0.0622565858066082, 0.0029401984065771103, 0.0035463939420878887, 0.03679078444838524, 0.02818373031914234, 0.008350629359483719, -0.05056825280189514, 0.05498161539435387, -0.012616087682545185, 0.02155406028032303, 0.06007678061723709, 0.04690302908420563, -0.047856107354164124, -0.0427161268889904, -0.07436186820268631, 0.07960447669029236, 0.021464811637997627, -0.04936419799923897, -0.004451294429600239, 0.0733637735247612, -0.02684825286269188, 0.0002176291454816237, -0.018154950812458992, 0.03063991665840149, 0.018753115087747574, 0.009489161893725395, -0.04655665159225464, -0.012692960910499096, -0.010946911759674549, -0.034640561789274216, -0.014981307089328766, -0.00025442676269449294, 0.0163465216755867, 0.031201466917991638, 0.02063005231320858, -0.023899851366877556, -0.01126838754862547, 0.016584763303399086, 0.005319594871252775, 0.027771178632974625, 0.04685891047120094, -0.009176181629300117, -0.03457295522093773, 0.020234104245901108, 0.01655017025768757, -0.03203602507710457, 0.03139956295490265, 0.028890805318951607, 0.021907826885581017, 0.022108975797891617, 0.005380227696150541, -0.031865667551755905, -0.019155900925397873, 0.023612987250089645, 0.001721071545034647, 0.02515016496181488, -0.0027959346771240234, -0.027721215039491653, -0.03791726380586624, 0.019575610756874084, 0.02731742337346077, -0.04546390101313591, 0.0105034364387393, 0.019391819834709167, 0.013158968649804592, -0.03257830813527107, 0.006379394792020321, 0.015508603304624557, -0.021898528560996056, 0.008827400393784046, 0.04361622408032417, 0.038241125643253326, -0.09967494010925293, -0.0048957099206745625, 0.007335057482123375, 0.03552784025669098, 0.004527296870946884, -0.025088133290410042, -0.02069331705570221, -0.017895212396979332, -0.043495915830135345, 0.017513392493128777, -0.0011009816080331802, 0.023572426289319992, -0.004066054709255695, 0.03191056102514267, 0.03142727166414261, 0.03480156511068344, 0.03541192412376404, -0.00921650044620037, 0.012726765125989914, 0.04693806916475296, -0.06345174461603165, 0.016380373388528824, 0.017661582678556442, -0.00984356738626957, -0.05305451899766922, -0.004290812183171511, 0.02678782306611538, -0.0018424340523779392, 0.002520608250051737, -0.016165029257535934, -0.010687035508453846, -0.00726961949840188, -0.05055629089474678, 0.0206217709928751, -0.002199634676799178, -0.01450522243976593, 0.038695525377988815, 0.008240574039518833, 0.01644003577530384, 0.008643782697618008, 0.0023914652410894632, -0.004844792652875185, 0.018342265859246254, -0.005542856175452471, 0.03557446971535683, 0.019587326794862747, 0.023136233910918236, -0.004762247670441866, -0.00597589323297143, -0.0015200634952634573, -0.026075612753629684, 0.05362505838274956, -0.0010031653800979257, 0.040804170072078705, -0.019913306459784508, 0.016766563057899475, 0.011203437112271786, 0.007399986498057842, 0.016342557966709137, -0.006715182214975357, -0.049801863729953766, 0.015853753313422203, 0.008884109556674957, -0.02538836933672428, 0.0021764179691672325, 0.027598002925515175, 0.03693251684308052, -0.014937014319002628, -0.03689669817686081, 0.0023304384667426348, -0.018706582486629486, 0.03600643202662468, 0.012676205486059189, 0.009973747655749321, -0.016211247071623802, -0.042633578181266785, -0.042684249579906464, -0.016160231083631516, 0.03075678087770939, 0.0027427279856055975, -0.022747447714209557, -0.00638269167393446, -0.022422609850764275, -0.05005782097578049, 0.006617386359721422, -0.00290299067273736, -0.0031263947021216154, -0.02462632581591606, 0.07803288102149963, 0.02288600616157055, 0.026065360754728317, 0.00043196091428399086, 0.014775501564145088, 0.019743237644433975, -0.00572555186226964, -0.002770689083263278, 0.0238018985837698, 0.03504331409931183, 0.023171212524175644, 0.04897958040237427, 0.026532864198088646, -0.03582070767879486, 0.025557812303304672, 0.026675857603549957, -0.026238322257995605, -0.027470223605632782, -0.03927714377641678, -0.05673345923423767, 0.009886941872537136, -0.015201302245259285, -0.0025434077251702547, -0.0318698026239872, 0.03798815980553627, -0.046296101063489914, 0.014582515694200993, 0.04976551607251167, -0.032705388963222504, 0.0029840755742043257, -0.043404556810855865, 0.058027513325214386, -0.02598879672586918, -0.01085715927183628, -0.02198677510023117, -0.02622511424124241, 0.050006818026304245, -0.00558735616505146, 0.01619596779346466, 0.03588033840060234, -0.001341253868304193, -0.05222582072019577, -0.01115529052913189, -0.046271130442619324, -0.006226031109690666, 0.005748237017542124, -0.014566588215529919, -0.017813665792346, -0.01120547205209732, -0.000953036593273282, 0.025231672450900078, -0.013749263249337673, -0.02331828698515892, -0.014063146896660328, 0.049588561058044434, -0.03809891268610954, 0.04515589401125908, 0.004746226128190756, -0.028911810368299484, 0.019838234409689903, -0.004925168585032225, 0.012692858465015888, 0.045865047723054886, -0.010081754066050053, -0.040381863713264465, -0.021903550252318382, 0.07256803661584854, -0.0350477509200573, 0.022940630093216896, 0.023670557886362076, 0.00010375089186709374, 0.07338395714759827, -0.00006430161010939628, -0.021234644576907158, -0.01851947046816349, 0.04725230485200882, 0.004054386168718338, 0.033053331077098846, -0.019926365464925766, -0.011774128302931786, -0.014839302748441696, 0.007121543399989605, -0.020751433447003365, -0.009234408847987652, -0.017404474318027496, -0.014650524593889713, 0.01211665291339159, 0.05705087631940842, 0.03915899619460106, 0.03700818121433258, -0.027608968317508698, -0.011398762464523315, -0.0573786124587059, -0.008917664177715778, 0.034875091165304184, 0.003131750738248229, 0.00452886987477541, -0.004393463023006916, 0.021835587918758392, 0.027662042528390884, 0.038908954709768295, 0.04394831135869026, 0.0006128860986791551, -0.008048665709793568, 0.03528111055493355, -0.039655156433582306, -0.007186764385551214, 0.005461546126753092, 0.0006926539936102927, 0.0743604302406311, -0.052360646426677704, -0.01199396327137947, 0.022987665608525276, 0.02906946651637554, -0.031917545944452286, -0.032729145139455795, 0.04219770058989525, 0.01937355101108551, -0.019216623157262802, -0.031808845698833466, 0.02139766700565815, -0.020077040418982506, -0.023046398535370827, -0.02023985981941223, 0.017760783433914185, -0.034146782010793686, -0.00038338766898959875, -0.05786089226603508, -0.022411851212382317, -0.011156870052218437, 0.02562413178384304, 0.03175674378871918, -0.03848879411816597, 0.02297460287809372, -0.025875529274344444, -0.009005682542920113, 0.017550887539982796, -0.03430112451314926, 0.022790096700191498, 0.01161388959735632, 0.012708315625786781, 0.006888796575367451, -0.0021783174015581608, -0.013280674815177917, -0.002205549506470561, 0.019121909514069557, 0.0038178737740963697, 0.0026243673637509346, -0.06235148012638092, 0.0592522993683815, 0.03381615877151489, -0.013930181041359901, -0.01233590766787529, 0.03204377740621567, -0.027011599391698837, -0.015034154988825321, -0.027569325640797615, 0.011098219081759453, 0.018047846853733063, -0.019665822386741638, 0.004959280602633953, -0.008032293990254402, 0.03269168734550476, -0.01004842296242714, 0.005894021596759558, 0.002851136028766632, -0.00765587342903018, 0.025220129638910294, -0.004026842303574085, -0.018468061462044716, 0.02101333811879158, -0.013271222822368145, 0.02332734316587448, -0.04083079844713211, 0.047802481800317764, 0.011391563341021538, -0.005374458152800798, 0.019526392221450806, 0.004950623493641615, -0.04314863309264183, 0.004899761639535427, 0.04010787606239319, -0.00581608759239316, 0.026107393205165863, 0.024013755843043327, -0.007547279354184866, 0.008793721906840801, -0.03782783821225166, 0.01703912764787674, 0.03702068701386452, -0.03429396450519562, 0.048367612063884735, 0.00667985063046217, 0.017968865111470222, 0.04071025922894478, -0.0028669496532529593, 0.011517093516886234, 0.017527692019939423, 0.07345703989267349, 0.018612289801239967, 0.011661596596240997, 0.03697621822357178, -0.004140727687627077, 0.015595543198287487, -0.040440142154693604, -0.0020871616434305906, -0.014645266346633434, 0.0057039461098611355, 0.06994783878326416, -0.01570003665983677, 0.023891502991318703, -0.014444363303482533, 0.041820671409368515, 0.04892882704734802, 0.02257208339869976, -0.0026021203957498074, 0.054789770394563675, 0.015276598744094372, 0.058003831654787064, -0.001133799902163446, 0.00814315490424633, 0.005803128704428673, -0.02850109152495861, 0.010860626585781574, 0.026802776381373405, 0.02594575099647045, -0.013259601779282093, -0.025540197268128395, 0.040671151131391525, -0.02997465804219246, -0.015776032581925392, 0.0005081886192783713, 0.02769443951547146, -0.0006736943032592535, -0.009271949529647827, 0.004279849585145712, -0.025922706350684166, 0.010958340018987656, 0.012728528119623661, 0.011112846434116364, 0.023768529295921326, 0.005299655254930258, 0.03869715705513954, 0.04765678942203522, 0.03652162849903107, -0.03844777122139931, -0.01389181800186634, 0.02732393890619278, -0.0027474439702928066, 0.010948882438242435, -0.021283049136400223, -0.01597747579216957, -0.045249342918395996, 0.0007206848822534084, -0.010474475100636482, 0.02659883350133896, 0.04265347868204117, -0.04669688642024994, -0.005683210212737322, -0.020090028643608093, -0.003804681124165654, -0.01048390381038189, 0.023560186848044395, -0.01090469490736723, -0.03628814220428467, 0.010075118392705917, 0.012287057936191559, -0.01153700239956379, 0.00038348606904037297, -0.06846049427986145, 0.04164032265543938, -0.020476950332522392, 0.04856171831488609, 0.05371221527457237, 0.02747579663991928, -0.015905233100056648, -0.0844976007938385, -0.008069776929914951, -0.029568631201982498, -0.01772480644285679, 0.06586059927940369, 0.05381351709365845, -0.039027485996484756, -0.00720933498814702, 0.0041506183333694935, -0.019876496866345406, -0.007446645759046078, -0.01895187422633171, 0.003514302894473076, -0.002867792034521699, -0.004286144394427538, -0.022105667740106583, 0.015062135644257069, 0.020783716812729836, 0.005445894319564104, 0.07087671011686325, 0.013463475741446018, 0.005338449962437153, -0.00482476782053709, 0.02943340130150318, -0.023893335834145546, 0.02685469016432762, -0.043751150369644165, -0.04208926856517792, -0.03340308368206024, 0.010248065926134586, -0.011062940582633018, 0.030575329437851906, -0.009316181764006615, -0.03429528698325157, -0.039819974452257156, -0.04373614862561226, 0.008506855927407742, 0.04860282316803932, 0.06546246260404587, 0.03586169704794884, 0.026301532983779907, 0.01996755413711071, -0.065113365650177, 0.0008295062580145895, -0.018719354644417763, -0.007427426520735025, 0.047218695282936096, 0.031068069860339165, -0.011562470346689224, -0.03068346343934536, -0.0015453191008418798, 0.014926545321941376, -0.06279385089874268, -0.024666396901011467, 0.03991876542568207, -0.007862498983740807, -0.045504409819841385, -0.005012083798646927, 0.0022340496070683002, 0.025237731635570526, 0.05907308682799339, 0.002018788130953908, -0.0015681791119277477, 0.016035081818699837, 0.017963524907827377, -0.039209116250276566, 0.013741282746195793, -0.04593335837125778, 0.0027244046796113253, 0.005878819618374109, -0.03993207961320877, 0.022171728312969208, -0.023648962378501892, -0.00824061967432499, 0.00679012993350625, -0.0172018650919199, 0.018994154408574104, -0.034140340983867645, 0.0035743401385843754, 0.024295328184962273, -0.015303126536309719, -0.006942330859601498, -0.004767128732055426, 0.015097646974027157, -0.029276248067617416, -0.010980188846588135, -0.01005458366125822, 0.00887915026396513, 0.029781226068735123, -0.0005837418138980865, -0.042481597512960434, 0.05896036699414253, 0.012296627275645733, -0.04604155570268631, -0.03847318887710571, 0.023946739733219147 ]
Finetune Stable Diffusion Models with DDPO via TRL
metric-space
September 29, 2023
trl-ddpo
guide, diffusers, rl, rlhf
https://huggingface.co/blog/trl-ddpo
Acknowledgements Thanks to Chunte Lee for the thumbnail of this blog post.
[ 0.05733922868967056, -0.025155646726489067, 0.059617482125759125, -0.004968360066413879, 0.09833356738090515, 0.057167764753103256, 0.011227358132600784, 0.028451839461922646, -0.032482799142599106, -0.10002978891134262, -0.021375121548771858, 0.028112750500440598, -0.027335427701473236, -0.0139326062053442, 0.002616495592519641, 0.04548737406730652, 0.0483851432800293, -0.029712984338402748, 0.01017693430185318, 0.03511931002140045, 0.0014440760714933276, -0.04433676600456238, 0.07280626893043518, 0.035256944596767426, -0.009735544212162495, -0.05071309581398964, -0.0009614918963052332, -0.0051465630531311035, -0.08092294633388519, 0.053687937557697296, -0.00737148430198431, -0.009242168627679348, 0.062152400612831116, 0.007647764403373003, -0.04110799729824066, -0.0377311073243618, -0.09043198823928833, -0.005007381085306406, -0.021936671808362007, -0.04564328119158745, 0.03755465894937515, -0.02725350856781006, -0.0029697453137487173, 0.0795285776257515, -0.027990348637104034, 0.01018946710973978, -0.22971554100513458, 0.09258363395929337, -0.03792490065097809, 0.004976348951458931, -0.030264995992183685, -0.017284860834479332, 0.023004701361060143, -0.013209372758865356, 0.044530048966407776, 0.010059913620352745, 0.04745839908719063, -0.05633782595396042, 0.029605219140648842, -0.0863942801952362, 0.039415180683135986, -0.01261052768677473, 0.0018139076419174671, -0.0137779600918293, 0.04931764677166939, 0.0557800829410553, 0.006454804912209511, 0.05127895250916481, -0.03344244509935379, -0.015097442083060741, 0.033841170370578766, 0.003038631984964013, -0.030059484764933586, -0.016419997438788414, 0.025385484099388123, -0.03770448639988899, -0.03363650292158127, 0.007961180992424488, 0.06171831488609314, 0.048308927565813065, -0.011041493155062199, 0.006731149274855852, 0.09726200997829437, 0.08218541741371155, 0.004807544872164726, -0.050021279603242874, 0.07364988327026367, -0.03934533894062042, 0.01036091148853302, -0.05075709521770477, -0.05490292236208916, -0.07076054066419601, 0.03577553108334541, 0.061360109597444534, 0.03772067278623581, -0.05253692343831062, 0.05980856344103813, 0.021119767799973488, 0.05878438428044319, 0.007282717619091272, -0.007386485580354929, 0.0543409138917923, -0.02023971639573574, -0.04824279248714447, -0.03561912104487419, 0.0008725845254957676, -0.03704686462879181, -0.042959313839673996, -0.09276672452688217, 0.04995846003293991, -0.004094142001122236, 0.08331558853387833, 0.04062705859541893, -0.005434863269329071, -0.05980037525296211, 0.06615950912237167, -0.01693122088909149, -0.0022415141575038433, 0.0440370999276638, 0.014487501233816147, -0.01745065674185753, 0.10449191182851791, 0.038395725190639496, 0.008073468692600727, 0.026934517547488213, 0.0022094466257840395, 0.04820249229669571, 0.0302659273147583, -0.10994523763656616, -0.01835758052766323, -0.007926962338387966, -0.0027267367113381624, 0.04662466421723366, -0.014041773043572903, -0.07027562707662582, -0.033949658274650574, -0.018703386187553406, -0.011506715789437294, -0.005167047493159771, 0.013370455242693424, -0.008390395902097225, 0.031178398057818413, -0.022623224183917046, 0.03552749752998352, 0.02049870602786541, -0.017721496522426605, -0.053710486739873886, 0.0494581013917923, -0.012502698227763176, -0.04817764088511467, 0.01325200218707323, 0.07900376617908478, -0.04233111813664436, -0.042764484882354736, -0.01903238333761692, 0.04130716249346733, 0.040602389723062515, 0.024870911613106728, -0.08271223306655884, -0.025676723569631577, 0.024484146386384964, 0.007036462891846895, -0.019038263708353043, -0.018845001235604286, 0.04666275903582573, -0.02766321785748005, 0.044326622039079666, 0.0007141271489672363, -0.04134631156921387, -0.09094136208295822, -0.013533060438930988, 0.0047543724067509174, 0.057574786245822906, -0.00784887745976448, -0.0820578932762146, 0.036271192133426666, 0.057815637439489365, 0.04556157439947128, 0.02921832539141178, 0.020561780780553818, -0.04679340124130249, 0.032254211604595184, -0.0019324049353599548, 0.01986418478190899, 0.013527444563806057, -0.027330556884407997, 0.08563902229070663, -0.011577294208109379, -0.04355631023645401, 0.04795502498745918, -0.15974536538124084, -0.028773227706551552, 0.12184452265501022, -0.02655699849128723, -0.012340455316007137, -0.09091982245445251, -0.020277701318264008, 0.11207208782434464, 0.06668311357498169, 0.05457767844200134, 0.07124882191419601, 0.05760685354471207, 0.07252040505409241, -0.01788940839469433, -0.043145813047885895, 0.001658327877521515, 0.06201411038637161, -0.02961902879178524, 0.006397131364792585, -0.03176659345626831, -0.05039045214653015, -0.08620771765708923, 0.0021209868136793375, -0.032409004867076874, -0.010644538328051567, -0.013153469190001488, -0.009259026497602463, -0.018441082909703255, 0.004931869450956583, -0.08962542563676834, 0.05799901485443115, 0.013944205828011036, -0.007911305874586105, 0.046100761741399765, -0.003917711321264505, 0.09413901716470718, 0.057457637041807175, 0.009160898625850677, 0.09721805900335312, -0.0660337284207344, 0.0030201254412531853, -0.02291608415544033, 0.016686443239450455, 0.08685077726840973, 0.023943571373820305, 0.04266465827822685, -0.00472191721200943, -0.05621187761425972, 0.018526926636695862, -0.008189489133656025, -0.003160538151860237, 0.009832493960857391, -0.019934851676225662, 0.03888237476348877, -0.039554253220558167, -0.09040629118680954, 0.012176873162388802, 0.03567906841635704, -0.09375090897083282, -0.012244511395692825, -0.07070783525705338, 0.12380122393369675, 0.025768505409359932, -0.021547676995396614, 0.10566798597574234, -0.02637239173054695, -0.0034863040782511234, -0.011292167007923126, -0.010275074280798435, 0.01378213707357645, 0.01209491491317749, -0.0033175970893353224, -0.004647569265216589, -0.06360449641942978, -0.002028550487011671, -0.019019078463315964, 0.03486545383930206, 0.0060191163793206215, 0.017251841723918915, 0.04221053794026375, -0.021576516330242157, -0.029674431309103966, 0.01671072095632553, 0.01917257159948349, -0.003080048831179738, 0.004796472378075123, 0.02592121623456478, -0.018538929522037506, -0.0037871869280934334, -0.042645808309316635, -0.006758739706128836, -0.02236548624932766, -0.0025842550676316023, -0.003270298009738326, 0.05178164690732956, -0.02147943712770939, 0.011340931989252567, 0.0019055926240980625, -0.010820182040333748, 0.02357557788491249, -0.0000918074365472421, 0.017056206241250038, 0.01915799081325531, -0.05064893141388893, 0.02060939185321331, -0.021511968225240707, -0.016036998480558395, 0.026294102892279625, -0.032665252685546875, -0.012019587680697441, 0.006702438462525606, -0.002926162676885724, -0.005265308078378439, 0.03682971000671387, -0.02565457485616207, 0.02710948884487152, -0.0010229769395664334, 0.02813991904258728, -0.1399703025817871, -0.01802898198366165, 0.04927689582109451, 0.06183355674147606, -0.016365019604563713, 0.006227937992662191, 0.05227379873394966, -0.04767616465687752, -0.03860892355442047, -0.04291146993637085, 0.04975906386971474, 0.015352707356214523, 0.026816045865416527, -0.041121624410152435, -0.020191609859466553, -0.012018063105642796, -0.012850319966673851, 0.014801803976297379, -0.007794001139700413, -0.017332419753074646, -0.0033729919232428074, 0.034725699573755264, -0.022102463990449905, -0.011501740664243698, -0.03880254179239273, 0.05356506258249283, 0.02282191812992096, 0.019746610894799232, 0.012481058947741985, -0.04245123267173767, -0.04715703800320625, 0.021812476217746735, -0.018089907243847847, 0.0407165102660656, 0.010185658000409603, -0.0043495167046785355, -0.008796353824436665, -0.021269701421260834, 0.010542667470872402, 0.04706066474318504, 0.02673349715769291, 0.008276320993900299, 0.04275212809443474, 0.022052988409996033, -0.014825337566435337, 0.027670172974467278, 0.02413538470864296, 0.003035865491256118, 0.05147498473525047, -0.02702609822154045, -0.05089423060417175, -0.009922867640852928, -0.003918356262147427, 0.06783616542816162, -0.01783253625035286, 0.00673810625448823, -0.02704525552690029, 0.004032880533486605, 0.03592124208807945, -0.0026454469189047813, 0.0010823842603713274, 0.02611374482512474, -0.0019119898788630962, 0.026689574122428894, -0.011924635618925095, 0.06658043712377548, -0.03834925964474678, 0.015765715390443802, -0.07411743700504303, 0.04973389580845833, 0.0030627106316387653, 0.03651799261569977, -0.02448706328868866, 0.014077380299568176, -0.0049439724534749985, 0.013268386013805866, -0.001133904792368412, -0.026239797472953796, 0.051071956753730774, -0.02655259519815445, -0.011774228885769844, -0.01073349267244339, -0.016235770657658577, -0.013721872121095657, 0.001184339402243495, 0.038990192115306854, -0.026417041197419167, 0.025493882596492767, -0.01606098935008049, 0.021218091249465942, 0.034696321934461594, 0.027303071692585945, -0.015074839815497398, -0.01775241643190384, 0.006134288385510445, 0.0228104330599308, 0.06688292324542999, 0.0017745326040312648, 0.025090880692005157, 0.012595697306096554, 0.00778576172888279, 0.0002153107343474403, -0.013638521544635296, 0.007980097085237503, 0.01057340670377016, 0.021957090124487877, -0.027387892827391624, -0.02904340997338295, -0.016160134226083755, 0.007500651758164167, 0.014035176485776901, -0.0433635488152504, 0.0028576890472322702, -0.02474265731871128, -0.0105978948995471, 0.0063957711681723595, -0.021855436265468597, -0.05762912705540657, -0.017445417121052742, 0.0027212752029299736, -0.028602836653590202, 0.02044062875211239, 0.008922670036554337, -0.011399178765714169, 0.022488577291369438, 0.008771226741373539, -0.019005661830306053, 0.01846262253820896, -0.017648175358772278, -0.005399141926318407, -0.021538319066166878, -0.034599583595991135, 0.02804105170071125, 0.016407862305641174, 0.011089316569268703, -0.014222283847630024, 0.010114519856870174, 0.029034581035375595, -0.010705370455980301, -0.03921753168106079, 0.020224059000611305, 0.00664687342941761, 0.0077080028131604195, -0.024347318336367607, 0.035595040768384933, -0.01931779459118843, 0.024735305458307266, 0.016056358814239502, 0.012818969786167145, -0.010152128525078297, 0.05133421719074249, -0.05076773092150688, -0.03891067951917648, 0.001234914525412023, -0.002579155145213008, 0.03542468324303627, 0.028713060542941093, -0.009790473617613316, -0.026663901284337044, 0.06389808654785156, -0.007309271022677422, 0.004143879283219576, -0.0643097311258316, 0.02897656336426735, -0.046467605978250504, 0.011293673887848854, 0.0012806943850591779, 0.014691920019686222, -0.005580317694693804, -0.027641143649816513, -0.03128823637962341, -0.03136371821165085, 0.024866662919521332, -0.023564280942082405, 0.01862279698252678, -0.0035416148602962494, -0.0017655093688517809, -0.009816895239055157, 0.00839169044047594, 0.02700674720108509, -0.023145051673054695, -0.0007294126553460956, 0.044366300106048584, 0.00023778079776093364, 0.018567612394690514, -0.007202071603387594, 0.038385652005672455, -0.0014078200329095125, 0.004420059267431498, 0.042776383459568024, -0.053610239177942276, -0.009088668040931225, -0.011226607486605644, -0.02192973531782627, -0.006839442532509565, 0.011873866431415081, 0.0052923886105418205, -0.015155891887843609, -0.015753036364912987, 0.003476973157376051, 0.009346049278974533, 0.035465873777866364, -0.019844727590680122, 0.00008795555186225101, 0.009773774072527885, 0.03044121526181698, -0.004521883558481932, -0.0182133000344038, 0.00735511863604188, -0.03975092992186546, -0.023773541674017906, 0.014812939800322056, -0.0595494881272316, -0.013948277570307255, -0.003529764711856842, -0.051933299750089645, -0.03330070152878761, 0.03368702158331871, -0.0002725007652770728, 0.02103065699338913, 0.01798529177904129, 0.007774906232953072, -0.008840730413794518, 0.042669329792261124, 0.04511432349681854, -0.011332648806273937, -0.019168628379702568, 0.03577686473727226, -0.013308978639543056, 0.04042995721101761, 0.014545862562954426, 0.005343961995095015, -0.03260737285017967, 0.016296131536364555, 0.023611128330230713, 0.006761495489627123, -0.061327338218688965, 0.011768447235226631, -0.008916819468140602, 0.014008771628141403, 0.0354485958814621, -0.016805168241262436, -0.00011827780690509826, -0.016473611816763878, -0.0339839830994606, 0.026953252032399178, 0.03965672478079796, -0.037116311490535736, 0.00932035967707634, -0.004478949122130871, 0.028066596016287804, -0.009653358720242977, -0.008871464058756828, -0.027479374781250954, -0.004209544975310564, 0.031384944915771484, 0.011792370118200779, -0.030219050124287605, 0.014814765192568302, -0.005891091655939817, -0.0058806659653782845, -0.01592797413468361, 0.009593551978468895, 0.02754533290863037, -0.022740991786122322, 0.005342348013073206, 0.00947633944451809, -0.032504852861166, 0.02797618880867958, -0.004065550398081541, -0.021119706332683563, -0.0014391723088920116, 0.03332260251045227, -0.014219546690583229, 0.01203460805118084, -0.022300738841295242, 0.040207620710134506, 0.005275552626699209, 0.03817448765039444, -0.018750762566924095, 0.008557802066206932, -0.013743525370955467, 0.04204916954040527, -0.0030858302488923073, -0.0030212958808988333, 0.009787777438759804, 0.03796111419796944, -0.007541351020336151, 0.010441359132528305, -0.006601911038160324, -0.003099764697253704, 0.024513395503163338, -0.015000294893980026, 0.016868362203240395, 0.0003764690482057631, 0.0008429503650404513, 0.016598790884017944, -0.019566791132092476, 0.01544871088117361, -0.03908609226346016, 0.01744270697236061, 0.007923070341348648, -0.010535425506532192, 0.025565432384610176, -0.01928388886153698, 0.01866101287305355, 0.022774547338485718, -0.01933126710355282, -0.035644739866256714, -0.03957059606909752, 0.03156282380223274, 0.041284408420324326, -0.028477611020207405, -0.022410474717617035, -0.020286941900849342, -0.04224006459116936, 0.04727649316191673, -0.0035481376107782125, 0.00992441177368164, -0.009975134395062923, 0.04373008757829666, 0.013613217510282993, -0.006825931370258331, -0.02935328707098961, -0.026528745889663696, -0.060901544988155365, 0.026166563853621483, 0.01605946570634842, -0.03289793059229851, -0.00406476017087698, 0.031892482191324234, 0.030100619420409203, -0.0034585127141326666, 0.0005632190150208771, 0.0015890005743131042, 0.04372622072696686, 0.004100599326193333, 0.04345843568444252, 0.0033642807975411415, -0.007926936261355877, -0.008372713811695576, 0.00359588791616261, 0.027711985632777214, -0.013671382330358028, -0.015356316231191158, -0.0006886960472911596, -0.014222321100533009, 0.017258720472455025, -0.023888416588306427, 0.033724892884492874, 0.030657261610031128, -0.0018838042160496116, 0.0033735602628439665, 0.05234408751130104, -0.02166038006544113, -0.005921730771660805, -0.019929347559809685, -0.0011973812943324447, 0.002431010128930211, -0.027314435690641403, -0.01043462473899126, 0.03605329990386963, 0.01574854925274849, -0.03029639460146427, -0.05629891902208328, -0.0036999827716499567, -0.0021256424952298403, 0.0030826502479612827, 0.009401879273355007, 0.0126207135617733, -0.014696074649691582, -0.04022948071360588, 0.02095109224319458, 0.002985183382406831, -0.01731163077056408, -0.03814469277858734, -0.03136763721704483, -0.033135347068309784, -0.004232790321111679, -0.02152002975344658, 0.07495139539241791, 0.03357141837477684, 0.0314008928835392, 0.03607098013162613, 0.031145013868808746, 0.010722631588578224, -0.016767829656600952, 0.004835446365177631, 0.01902882568538189, 0.05251721665263176, -0.02335466630756855, -0.024966580793261528, -0.014308798126876354, -0.02904389426112175, 0.0013572366442531347, 0.009886498562991619, -0.04786099120974541, -0.03260825574398041, 0.011118591763079166, 0.02343621850013733, -0.05728914216160774, 0.019810747355222702, 0.04744991660118103, 0.020876683294773102, 0.00868834275752306, 0.014234756119549274, -0.016118133440613747, -0.012882083654403687, 0.03365158662199974, -0.01615040935575962, 0.05990644916892052, 0.039049454033374786, -0.014744331128895283, -0.07597294449806213, 0.029067791998386383, -0.04592245817184448, -0.04143541678786278, -0.008540707640349865, 0.04563778638839722, -0.001898922142572701, -0.009383087046444416, 0.0037146611139178276, 0.008614259772002697, 0.030157962813973427, 0.004971301183104515, 0.03172130137681961, -0.012678556144237518, 0.016865171492099762, -0.02022402361035347, -0.027697918936610222, 0.002094799419865012, 0.007282426580786705, 0.016564935445785522, 0.031475432217121124, -0.001939995912835002, -0.031102335080504417, 0.009693003259599209, -0.03765680640935898, 0.018889443948864937, -0.016545172780752182, -0.0070493449456989765, 0.013029992580413818, 0.017493082210421562, -0.05911868065595627, -0.011447016149759293, -0.03212727978825569, 0.03552503511309624, 0.036388322710990906, -0.027296431362628937, -0.017398543655872345, -0.03938303887844086, 0.0026437263004481792, -0.006698880810290575, 0.008044683374464512, 0.0159778892993927, 0.060961026698350906, 0.04844392091035843, -0.0267869271337986, 0.0011503971181809902, 0.02035147324204445 ]
Finetune Stable Diffusion Models with DDPO via TRL
metric-space
September 29, 2023
trl-ddpo
guide, diffusers, rl, rlhf
https://huggingface.co/blog/trl-ddpo
The Advantages of DDPO DDPO is not the only working answer to the question of how to attempt to fine-tune diffusion models with RL. Before diving in, there are two key points to remember when it comes to understanding the advantages of one RL solution over the other 1. Computational efficiency is key. The more complicated your data distribution gets, the higher your computational costs get. 2. Approximations are nice, but because approximations are not the real thing, associated errors stack up. Before DDPO, Reward-weighted regression (RWR) was an established way of using Reinforcement Learning to fine-tune diffusion models. RWR reuses the denoising loss function of the diffusion model along with training data sampled from the model itself and per-sample loss weighting that depends on the reward associated with the final samples. This algorithm ignores the intermediate denoising steps/samples. While this works, two things should be noted: 1. Optimizing by weighing the associated loss, which is a maximum likelihood objective, is an approximate optimization 2. The associated loss is not an exact maximum likelihood objective but an approximation that is derived from a reweighed variational bound The two orders of approximation have a significant impact on both performance and the ability to handle complex objectives. DDPO uses this method as a starting point. Rather than viewing the denoising step as a single step by only focusing on the final sample, DDPO frames the whole denoising process as a multistep Markov Decision Process (MDP) where the reward is received at the very end. This formulation in addition to using a fixed sampler paves the way for the agent policy to become an isotropic Gaussian as opposed to an arbitrarily complicated distribution. So instead of using the approximate likelihood of the final sample (which is the path RWR takes), here the exact likelihood of each denoising step which is extremely easy to compute ( \( \ell(\mu, \sigma^2; x) = -\frac{n}{2} \log(2\pi) - \frac{n}{2} \log(\sigma^2) - \frac{1}{2\sigma^2} \sum_{i=1}^n (x_i - \mu)^2 \) ). If youโ€™re interested in learning more details about DDPO, we encourage you to check out the original paper and the accompanying blog post.
[ 0.015421575866639614, -0.016906743869185448, -0.010352618992328644, 0.0647425428032875, 0.10645337402820587, 0.03071775659918785, -0.06516315042972565, 0.025137007236480713, -0.02862458862364292, -0.03591461852192879, -0.055639468133449554, 0.018502002581954002, -0.04722314700484276, -0.031143782660365105, -0.01108297985047102, 0.009371860884130001, 0.030598288401961327, -0.027058813720941544, 0.10049045085906982, -0.01834917813539505, 0.03334623575210571, 0.021776823326945305, 0.0023791014682501554, 0.016083544120192528, -0.025381067767739296, -0.03201978653669357, 0.014460335485637188, 0.018993189558386803, -0.03996278718113899, 0.005150585435330868, -0.06501403450965881, -0.007687390316277742, -0.024105265736579895, 0.0071488250978291035, 0.05054057016968727, -0.05681435391306877, -0.03810665011405945, -0.023700281977653503, 0.03905436769127846, -0.07023405283689499, 0.0001534484326839447, -0.06399544328451157, -0.061692290008068085, 0.010176105424761772, -0.0373564139008522, -0.0956454649567604, -0.08495121449232101, 0.030841976404190063, -0.0565163679420948, -0.12125412374734879, -0.06494560837745667, 0.07806020230054855, -0.07707370072603226, 0.012640049681067467, -0.04617397114634514, -0.08809752762317657, 0.016902070492506027, -0.060153137892484665, 0.01971251890063286, -0.05233445391058922, -0.01998203620314598, -0.011367393657565117, 0.0638691633939743, 0.05062825605273247, -0.03693594038486481, 0.05255218967795372, 0.012687074951827526, 0.0020028946455568075, -0.08555757254362106, -0.009229701943695545, -0.011760189197957516, -0.05309193581342697, -0.0446636825799942, 0.02545750141143799, -0.015538674779236317, -0.07029017806053162, -0.035851746797561646, 0.017240146175026894, 0.002697091083973646, 0.02990087680518627, 0.05535048618912697, -0.022330863401293755, 0.06718212366104126, 0.036627255380153656, 0.037844110280275345, 0.022368330508470535, 0.06997544318437576, 0.012143485248088837, -0.028237629681825638, 0.006173398811370134, -0.05853714421391487, -0.027014991268515587, -0.01583973318338394, 0.003111408092081547, 0.10867147147655487, -0.06382790952920914, -0.0240569319576025, 0.04741039499640465, -0.009449157863855362, -0.03637152910232544, -0.03680989891290665, -0.06383819133043289, 0.045766543596982956, -0.059790484607219696, -0.03197898343205452, 0.07176616787910461, -0.01056318636983633, -0.06706646829843521, -0.025152772665023804, 0.09393688291311264, 0.00630949717015028, 0.0730338841676712, -0.023261263966560364, 0.04752514138817787, -0.03670816868543625, -0.010738161392509937, -0.034783985465765, 0.05396941304206848, 0.00849177036434412, 0.06861256062984467, -0.044342197477817535, 0.13212727010250092, 0.028402840718626976, -0.0320187546312809, -0.04793436452746391, 0.07715737819671631, 0.05226719751954079, -0.029050614684820175, 0.01159924827516079, 0.006098550744354725, 0.05940583348274231, 0.010672259144484997, 0.010931058786809444, 0.003264504484832287, 0.04176630079746246, -0.035938866436481476, -0.0031637551728636026, 0.0345429889857769, 0.005985647905617952, -0.04284055158495903, -0.0636666789650917, 0.027230650186538696, -0.009951937012374401, 0.016109667718410492, 0.01995399221777916, -0.050906140357255936, 0.01856757327914238, -0.011752289719879627, -0.029544100165367126, -0.0038596808444708586, -0.006190711632370949, 0.07692445069551468, -0.013329431414604187, -0.07622921466827393, -0.0012866775505244732, 0.11156858503818512, -0.03854238614439964, -0.047865644097328186, -0.03998193144798279, 0.04243043065071106, -0.027963953092694283, -0.026415551081299782, 0.037581220269203186, 0.08657234907150269, 0.06781396269798279, 0.016108142212033272, 0.05389085039496422, 0.08724584430456161, -0.017325159162282944, 0.018126357346773148, 0.02186569757759571, 0.026226602494716644, 0.09327808767557144, 0.03188057988882065, 0.037138257175683975, 0.036606721580028534, -0.036971207708120346, 0.08180196583271027, -0.0053000240586698055, -0.019739991053938866, 0.01914544217288494, 0.01563280075788498, 0.027219733223319054, 0.0033461658749729395, 0.06479228287935257, -0.07641879469156265, 0.03663822263479233, -0.0027837560046464205, 0.03003864176571369, -0.0009099571034312248, -0.05334443598985672, 0.059166841208934784, 0.08056250214576721, -0.030900152400135994, 0.009658528491854668, -0.05702076479792595, -0.032952919602394104, 0.08551297336816788, 0.037093792110681534, 0.02348886989057064, 0.029193144291639328, -0.0037047930527478456, 0.06166728213429451, -0.09125504642724991, -0.047957826405763626, 0.01565602608025074, 0.07580690085887909, -0.0385347343981266, 0.024996642023324966, -0.01969205029308796, -0.009351757355034351, -0.11232984066009521, -0.04298258200287819, -0.04990455508232117, -0.018807584419846535, 0.0011178605491295457, 0.0402333103120327, 0.030791224911808968, -0.024248257279396057, -0.054497186094522476, 0.11509928107261658, -0.00957203097641468, -0.06650732457637787, 0.055113784968853, -0.01793038100004196, 0.008475776761770248, 0.033870961517095566, -0.019517898559570312, 0.03315750136971474, -0.0009956337744370103, -0.04171464592218399, -0.08208538591861725, 0.04802434891462326, 0.04721461609005928, 0.06949732452630997, -0.03422123193740845, -0.022550806403160095, -0.042029935866594315, -0.019487133249640465, 0.03165948763489723, 0.04821930080652237, 0.012847743928432465, -0.059790752828121185, 0.0761198028922081, 0.044855911284685135, -0.007549709174782038, 0.06434473395347595, 0.049151189625263214, -0.022684046998620033, -0.02770698443055153, -0.0932549387216568, 0.08530815690755844, 0.08900905400514603, -0.0017322991043329239, 0.004710044711828232, 0.05083693191409111, -0.01937205158174038, 0.0121392160654068, -0.044729843735694885, 0.017998235300183296, -0.026175808161497116, 0.010101748630404472, 0.004068366251885891, 0.03106633760035038, 0.011130201630294323, -0.02394561655819416, 0.006822919473052025, 0.023077737540006638, 0.026141684502363205, -0.014052405022084713, 0.02633018046617508, -0.01300361379981041, -0.008338668383657932, 0.03762942552566528, -0.02540278062224388, 0.004329207818955183, 0.04061531275510788, -0.04146113991737366, -0.06942559778690338, 0.008325893431901932, 0.02335888147354126, 0.004464203026145697, 0.05967516452074051, 0.03573465347290039, 0.012904173694550991, -0.0008775726309977472, -0.013986031524837017, 0.006982478778809309, -0.04110749065876007, 0.06372404098510742, -0.009510132484138012, -0.001971716992557049, -0.015885500237345695, 0.034227196127176285, -0.0492427684366703, -0.011710532940924168, 0.0027297022752463818, -0.04024440795183182, 0.024890845641493797, -0.023851046338677406, 0.02000841684639454, -0.021143846213817596, 0.027901144698262215, -0.00778772309422493, -0.004104351159185171, 0.004197051282972097, 0.026275737211108208, 0.04454824700951576, -0.1007310152053833, -0.022725891321897507, 0.026685643941164017, 0.023975795134902, 0.008432615548372269, -0.024713771417737007, 0.01093996036797762, -0.03555043041706085, -0.0672227069735527, -0.0020579309202730656, 0.04626215249300003, 0.021363144740462303, 0.033984389156103134, 0.025743192061781883, 0.03495350107550621, 0.03811124339699745, 0.06658945977687836, 0.020503057166934013, -0.0006442956509999931, 0.04999706894159317, -0.011214932426810265, 0.04839465767145157, 0.014085279777646065, -0.0053031714633107185, -0.08311008661985397, -0.013772375881671906, 0.028844941407442093, 0.008768822066485882, -0.030856704339385033, -0.018680084496736526, -0.027481824159622192, -0.04509483650326729, -0.034437261521816254, -0.00200344598852098, -0.029576987028121948, -0.0115439984947443, -0.014635208994150162, 0.01633589342236519, 0.003965492360293865, 0.05287894234061241, -0.0042569818906486034, -0.012739894911646843, 0.017880462110042572, -0.006268600933253765, -0.01136696431785822, 0.048119839280843735, 0.02779770828783512, 0.00003225350519642234, -0.0071685705333948135, -0.0004925222601741552, -0.011434225365519524, 0.04571683332324028, -0.026923542842268944, 0.021610818803310394, 0.020862752571702003, 0.012868218123912811, 0.009591958485543728, -0.0006360725965350866, 0.026391109451651573, 0.015369164757430553, -0.011391797102987766, 0.037197258323431015, 0.03939333185553551, -0.022821202874183655, -0.007960268296301365, 0.0018705842085182667, 0.030913064256310463, -0.032729871571063995, -0.03117498755455017, 0.0028309414628893137, 0.016651460900902748, -0.004679808393120766, 0.03138457238674164, 0.008193663321435452, -0.017588870599865913, 0.013031830079853535, 0.01174180582165718, -0.0303927194327116, 0.05694413185119629, -0.013863284140825272, -0.019809696823358536, -0.00483611598610878, -0.023304052650928497, -0.04599211737513542, -0.005159714724868536, 0.003438220825046301, 0.01758972741663456, 0.009252266027033329, -0.0050870380364358425, 0.022844450548291206, 0.014948518015444279, 0.011553495191037655, 0.016071053221821785, 0.0221922155469656, -0.0056008752435445786, -0.012379511259496212, 0.038919877260923386, 0.011102144606411457, 0.015525585040450096, -0.007952065207064152, 0.023420004174113274, -0.018132230266928673, 0.031948186457157135, 0.018743664026260376, -0.0011215029517188668, 0.0225670225918293, -0.01539861410856247, -0.007827330380678177, 0.000014494383322016802, -0.0032629857305437326, -0.007368816062808037, -0.00048175742267630994, 0.007425033487379551, -0.031558409333229065, 0.021471042186021805, 0.03296135738492012, -0.030943989753723145, 0.016884196549654007, -0.04163055866956711, 0.023499870672822, -0.06579238176345825, -0.0010277158580720425, -0.007892906665802002, -0.004151663742959499, 0.05711151286959648, 0.024501170963048935, -0.010123340412974358, 0.042864616960287094, -0.013731395825743675, -0.03323798254132271, -0.027370397001504898, -0.02477591671049595, -0.005177807062864304, -0.016851620748639107, 0.04694275185465813, -0.004920791368931532, -0.020048797130584717, 0.04737669602036476, -0.006242068950086832, -0.030176440253853798, -0.023735065013170242, -0.007403668947517872, 0.01310933567583561, -0.038982272148132324, 0.05547768250107765, -0.006408507935702801, -0.014555728062987328, 0.007046822924166918, -0.01415636669844389, 0.017016496509313583, 0.05573476850986481, -0.006538359448313713, -0.03192272409796715, -0.01713833399116993, 0.0602249950170517, -0.04221727326512337, -0.02188703790307045, 0.004217997658997774, -0.011036337353289127, 0.049658507108688354, 0.0017608782509341836, -0.010785119608044624, -0.04378342255949974, 0.04262237250804901, 0.028445342555642128, 0.012345952913165092, -0.02564745955169201, 0.004322017077356577, -0.02042522095143795, -0.005994832143187523, -0.013311699964106083, 0.009011211805045605, 0.019376832991838455, -0.017993012443184853, -0.002884278306737542, 0.0037315087392926216, 0.001212699105963111, -0.010161180980503559, -0.0025938469916582108, -0.0063937329687178135, -0.062353745102882385, -0.018241167068481445, 0.022477149963378906, 0.0016381184104830027, 0.0019749558996409178, -0.005845170002430677, 0.020910538733005524, 0.0209665410220623, 0.029048055410385132, -0.02010486088693142, 0.025155523791909218, 0.0018634231528267264, 0.022754903882741928, -0.04989248514175415, 0.008952951990067959, 0.030033975839614868, -0.006876913830637932, 0.019461283460259438, -0.04788393899798393, -0.007356932386755943, 0.029449554160237312, 0.02145940437912941, 0.013122334145009518, -0.001780258840881288, -0.022112421691417694, 0.0043080514296889305, -0.04186002537608147, -0.017479337751865387, -0.017994478344917297, 0.008171220310032368, -0.007085992489010096, -0.03673377260565758, -0.0168028324842453, -0.04396141320466995, -0.01169742364436388, -0.04728099703788757, -0.03596196696162224, 0.010623680427670479, 0.028677230700850487, 0.04923737794160843, -0.0006258586654439569, -0.03795718029141426, -0.07669918984174728, 0.032107941806316376, 0.010118571110069752, -0.054969388991594315, -0.019697587937116623, -0.006310758180916309, -0.007338694762438536, -0.0016803705366328359, 0.012349617667496204, -0.015833083540201187, 0.0066443998366594315, 0.008626445196568966, 0.022861531004309654, -0.039221882820129395, -0.019554676488041878, 0.07367357611656189, 0.05905554071068764, 0.018618978559970856, -0.011972938664257526, 0.0005670997779816389, -0.035858914256095886, -0.010854662396013737, -0.05960415303707123, 0.017742713913321495, -0.00844634510576725, -0.015293099917471409, 0.01734336093068123, -0.00826977752149105, 0.055978626012802124, -0.009969554841518402, 0.003462957451120019, 0.03369428589940071, 0.01148639153689146, 0.030720343813300133, 0.031179137527942657, -0.025493936613202095, 0.02025889977812767, 0.016500378027558327, 0.017415475100278854, -0.022024158388376236, 0.03684379905462265, 0.01270851120352745, 0.024186858907341957, 0.01760711334645748, 0.02387593314051628, -0.08315346390008926, 0.028103109449148178, 0.0039007000159472227, -0.0026904153637588024, 0.008837899193167686, 0.03844864293932915, 0.05613391101360321, 0.009532483294606209, 0.02598687633872032, -0.01189303956925869, -0.007885796017944813, -0.010928390547633171, 0.011157568544149399, -0.006712816655635834, 0.02144456095993519, 0.027563057839870453, -0.018613334745168686, -0.01813938282430172, 0.03833962231874466, 0.028733009472489357, 0.01076462771743536, 0.05316244438290596, 0.01447942666709423, -0.006743043661117554, -0.006072763353586197, -0.0465795174241066, -0.006461340002715588, -0.03516247123479843, 0.03303922340273857, 0.06938187032938004, -0.05324987322092056, 0.014542114920914173, -0.020603002980351448, 0.016778312623500824, 0.060183726251125336, 0.032453276216983795, -0.005594875663518906, 0.005044823512434959, 0.0007182275294326246, 0.07139047235250473, 0.0020408243872225285, -0.0009764666319824755, -0.02070314809679985, 0.01837375946342945, 0.005311323795467615, -0.006378233432769775, 0.03463699296116829, -0.0467785969376564, 0.00012590314145199955, 0.034943126142024994, -0.00883617252111435, 0.02150692231953144, 0.01760854385793209, 0.038131363689899445, 0.042940229177474976, 0.025580551475286484, 0.02063773386180401, -0.029515612870454788, 0.0062162685208022594, 0.014257746748626232, 0.018879450857639313, 0.028647512197494507, -0.025459975004196167, 0.036622460931539536, 0.033616386353969574, -0.037621986120939255, -0.08420895785093307, -0.047391366213560104, 0.0061094858683645725, 0.010260467417538166, -0.025163209065794945, -0.052813414484262466, -0.03635227307677269, -0.059183888137340546, -0.013764135539531708, 0.018285557627677917, 0.009627038612961769, -0.008061995729804039, -0.05495169386267662, -0.02079009637236595, -0.019668888300657272, 0.0055330307222902775, -0.006248475052416325, 0.026387132704257965, 0.0071539743803441525, 0.010404849424958229, 0.01873135194182396, -0.008487815037369728, -0.027358639985322952, 0.011672142893075943, -0.030999282374978065, -0.005819485988467932, -0.0091486731544137, 0.07179845124483109, 0.0014302220661193132, 0.012873216532170773, -0.01169873122125864, -0.014607809484004974, -0.022826822474598885, -0.025843238458037376, 0.015018897131085396, -0.030989065766334534, 0.06234961375594139, -0.03229464218020439, -0.030577074736356735, 0.005473438184708357, -0.018469858914613724, -0.014908716082572937, -0.00978940725326538, 0.027132483199238777, -0.014474455267190933, 0.008553968742489815, -0.007494512014091015, 0.0036272720899432898, 0.014693979173898697, 0.02407713793218136, 0.039156559854745865, -0.00955943949520588, -0.046117153018713, -0.019896958023309708, 0.01364006008952856, -0.007424992974847555, 0.02173456735908985, -0.006326091941446066, -0.07087390869855881, -0.023246455937623978, 0.05745473504066467, 0.005340334493666887, 0.01083015464246273, 0.000980159966275096, -0.027049405500292778, 0.0014280721079558134, -0.06505245715379715, -0.02714049071073532, 0.0009661631193011999, 0.043097056448459625, -0.005205483641475439, 0.019659727811813354, 0.010434016585350037, -0.020096588879823685, -0.020618826150894165, -0.05386945977807045, -0.01772274076938629, 0.028368843719363213, -0.011998815461993217, -0.014345335774123669, -0.02773750014603138, -0.006631029769778252, 0.0030191733967512846, -0.032765213400125504, -0.013446537777781487, 0.03354639932513237, -0.031440287828445435, -0.0315689779818058, 0.0329553447663784, 0.033596400171518326, 0.008560264483094215, -0.0042027817107737064, 0.036454424262046814, -0.05043617635965347, -0.00257988553494215, -0.01147659681737423, -0.010618872009217739, 0.03446768596768379, -0.026206230744719505, -0.012369347736239433, 0.005918102338910103, -0.020261099562048912, 0.00962724257260561, -0.012004529125988483, -0.033577434718608856, -0.007111939135938883, 0.004461999516934156, 0.005235339980572462, -0.05303836613893509, 0.05081050097942352, 0.02653799206018448, -0.018109695985913277, -0.03625747933983803, 0.001981461187824607, 0.02222449518740177, -0.0016180521342903376, 0.01215916033834219, 0.009299281984567642, 0.05500200390815735, 0.007987519726157188, -0.011202693916857243, -0.022522734478116035, 0.05424422398209572, 0.002144602360203862, 0.0034205547999590635, -0.06321559101343155, 0.0035968890879303217 ]
Finetune Stable Diffusion Models with DDPO via TRL
metric-space
September 29, 2023
trl-ddpo
guide, diffusers, rl, rlhf
https://huggingface.co/blog/trl-ddpo
Conclusion Diffusion models like Stable Diffusion, when fine-tuned using DDPO, can offer significant improvements in the quality of generated images as perceived by humans or any other metric once properly conceptualized as an objective function The computational efficiency of DDPO and its ability to optimize without relying on approximations, especially over earlier methods to achieve the same goal of fine-tuning diffusion models, make it a suitable candidate for fine-tuning diffusion models like Stable Diffusion trl library's DDPOTrainer implements DDPO for finetuning SD models. Our experimental findings underline the strength of DDPO in generalizing across a broad range of prompts, although attempts at explicit generalization through varying prompts had mixed results. The difficulty of finding the right hyperparameters for non-LoRA setups also emerged as an important learning. DDPO is a promising technique to align diffusion models with any reward function and we hope that with the release in TRL we can make it more accessible to the community!
[ 0.10242781043052673, -0.030283115804195404, -0.0441887266933918, 0.07412616163492203, 0.030893003568053246, 0.028188137337565422, -0.10246142745018005, 0.05368764325976372, -0.036807604134082794, -0.02106405608355999, -0.001130030257627368, -0.029380762949585915, -0.03794001787900925, -0.004245780874043703, -0.03227695822715759, -0.013039972633123398, 0.012207796797156334, -0.0150602450594306, 0.015172041021287441, 0.058361202478408813, -0.018131522461771965, -0.01120669487863779, -0.03887748345732689, -0.07094716280698776, -0.03460939601063728, -0.0593552403151989, 0.04224832355976105, 0.012881457805633545, -0.04790175333619118, -0.010111860930919647, -0.06116952374577522, -0.0366264209151268, -0.011937162838876247, -0.0014169903006404638, 0.028759028762578964, -0.07171475142240524, -0.016101662069559097, -0.011994661763310432, 0.00966446939855814, -0.03883564844727516, 0.005243800580501556, -0.06735260039567947, -0.05084533989429474, 0.036629077047109604, 0.01989189349114895, -0.06435870379209518, -0.10679236799478531, 0.03702180087566376, -0.01592717133462429, -0.019345637410879135, -0.08745112270116806, 0.07185045629739761, -0.018208516761660576, 0.02039056085050106, -0.053407713770866394, -0.02141598053276539, 0.002680570585653186, 0.01302852388471365, 0.010307513177394867, -0.03691157326102257, -0.03358779847621918, -0.02493738755583763, 0.018162885680794716, -0.004903239663690329, -0.024477628991007805, 0.04933132976293564, -0.004124890547245741, 0.037815265357494354, -0.07084713876247406, -0.041963089257478714, -0.02428741194307804, -0.04537516087293625, -0.01505096536129713, 0.016552090644836426, -0.02254578471183777, -0.032988425344228745, 0.0006871179793961346, 0.04662991315126419, 0.00055964186321944, -0.00026592545327730477, 0.023924585431814194, 0.00923090148717165, 0.11969359964132309, 0.01316217053681612, 0.02281061001121998, 0.015521657653152943, 0.048077598214149475, -0.04601888358592987, -0.010774410329759121, -0.045547228306531906, -0.025266170501708984, -0.08223138004541397, -0.05997685343027115, 0.00757575361058116, 0.07690390199422836, -0.0170297808945179, -0.04228793829679489, 0.04061775654554367, 0.0002586490008980036, 0.026911191642284393, -0.013743932358920574, -0.03125019371509552, 0.06020427495241165, -0.11493465304374695, -0.09661853313446045, 0.026950452476739883, -0.04037001356482506, -0.04043333977460861, -0.01698404550552368, 0.11161381751298904, -0.015228992328047752, 0.08355143666267395, -0.008394896984100342, 0.08235251903533936, -0.03436706215143204, 0.033559732139110565, -0.04638645797967911, 0.06126886233687401, 0.0015738527290523052, 0.032182760536670685, -0.04096653312444687, 0.041331697255373, 0.03290227800607681, -0.04254885017871857, -0.060409754514694214, 0.07204696536064148, 0.07453597337007523, -0.05987362936139107, -0.037873219698667526, 0.0449550598859787, -0.006245042197406292, -0.0068160006776452065, 0.007871235720813274, -0.019539380446076393, 0.05835655331611633, -0.07347335666418076, -0.021548109129071236, -0.04062151536345482, -0.001648162491619587, -0.029543530195951462, 0.002380265621468425, 0.03621261939406395, -0.006477699149399996, -0.0008853842155076563, 0.050504349172115326, -0.028448231518268585, 0.011889846995472908, -0.0033777300268411636, -0.04037398844957352, 0.02135559543967247, -0.021224340423941612, 0.07304351776838303, -0.006155005656182766, -0.09139597415924072, 0.0014342808863148093, 0.09837835282087326, -0.032465387135744095, -0.052225612103939056, -0.007198560517281294, 0.022918937727808952, -0.030382351949810982, -0.05867423117160797, -0.023750009015202522, 0.035911232233047485, 0.03825993090867996, -0.025845205411314964, 0.07803680002689362, 0.0873296707868576, 0.008393742144107819, 0.017431534826755524, 0.06782503426074982, 0.0251925066113472, 0.051943376660346985, 0.02255413308739662, -0.014914785511791706, 0.020858772099018097, -0.0030452103819698095, 0.03782191872596741, 0.03747738525271416, -0.04255368560552597, -0.0011785202659666538, 0.036371130496263504, 0.02872852049767971, 0.030305176973342896, 0.102348692715168, -0.13606062531471252, 0.028808997943997383, 0.00348105002194643, 0.029465267434716225, 0.020533263683319092, -0.07921350002288818, 0.061932455748319626, 0.03238990157842636, -0.03699842467904091, 0.04951109364628792, -0.06030914932489395, -0.06515426933765411, 0.06993629783391953, 0.06534145772457123, 0.043030887842178345, 0.03239113464951515, -0.0674111396074295, 0.05824193358421326, -0.09612712264060974, -0.08935512602329254, -0.038718923926353455, 0.03619379922747612, 0.056339751929044724, 0.01746531017124653, 0.002266484312713146, -0.01881011575460434, -0.13483279943466187, 0.004989125300198793, 0.0025269528850913048, -0.007218062877655029, 0.038956332951784134, 0.015328087843954563, -0.025251630693674088, -0.05289030447602272, -0.03413325920701027, 0.11256405711174011, 0.062460873275995255, -0.003383611561730504, 0.031223265454173088, -0.006988537963479757, 0.06305286288261414, 0.05930172652006149, -0.026532098650932312, 0.03619283065199852, -0.027005363255739212, -0.07441284507513046, -0.05169529840350151, 0.01966875046491623, 0.04847593232989311, 0.04172377288341522, -0.012736986391246319, 0.055376097559928894, -0.014819330535829067, 0.03700326755642891, -0.0018409746699035168, 0.08175120502710342, 0.024481402710080147, -0.05349224805831909, 0.08500301837921143, 0.041380878537893295, 0.002063832012936473, 0.05385205149650574, 0.025263572111725807, -0.01357537042349577, 0.015612388961017132, -0.1312934309244156, 0.04400875046849251, 0.018021808937191963, -0.048075031489133835, -0.006676223129034042, -0.004252617713063955, 0.02643609791994095, -0.01562029030174017, -0.005686168558895588, 0.02009095996618271, -0.021868379786610603, 0.010941829532384872, -0.0009696974884718657, 0.033881135284900665, 0.016196219250559807, -0.03708922117948532, -0.008639734238386154, 0.02284310571849346, 0.032103538513183594, 0.00042453379137441516, -0.0019460966577753425, -0.02254745177924633, -0.004250203724950552, 0.024233398959040642, -0.056997887790203094, -0.024934004992246628, 0.02441444806754589, -0.034005992114543915, -0.00028223777189850807, 0.01784542389214039, -0.010143385268747807, 0.001651765312999487, 0.06447307765483856, 0.010952950455248356, 0.03119684010744095, 0.035926222801208496, -0.0256638340651989, -0.01103972177952528, -0.062067411839962006, 0.03811713308095932, 0.004229456186294556, -0.0173552967607975, -0.024128906428813934, 0.024050485342741013, -0.016335615888237953, -0.013240961357951164, 0.0011873120674863458, -0.026182979345321655, -0.021540923044085503, -0.014088653028011322, 0.044260017573833466, -0.02853110246360302, 0.0654689148068428, -0.0073043592274188995, -0.010296715423464775, 0.024785740301012993, -0.00739889033138752, 0.04053682088851929, -0.09101226925849915, -0.025006940588355064, 0.016955532133579254, 0.055738549679517746, -0.009344772435724735, -0.027020329609513283, 0.03651999309659004, -0.0306136142462492, -0.023314248770475388, -0.0021679026540368795, 0.011043615639209747, 0.05145356059074402, 0.004927915055304766, 0.027959657832980156, 0.033822596073150635, 0.014772981405258179, 0.05247725918889046, 0.04346913844347, -0.01995217427611351, 0.06482746452093124, -0.05514812469482422, 0.03496062010526657, -0.004701594822108746, 0.009995677508413792, -0.05216849222779274, 0.014160237275063992, 0.0359906442463398, -0.030773036181926727, 0.003207935020327568, -0.039078161120414734, 0.007199805695563555, -0.04197082296013832, -0.0077081588096916676, 0.002006308874115348, -0.0405113510787487, 0.00989560130983591, 0.01166774332523346, 0.03367118909955025, 0.01694752834737301, 0.019531235098838806, 0.004409420769661665, -0.004994004964828491, 0.028947915881872177, 0.015423358418047428, 0.008056123740971088, 0.01812218502163887, 0.014019189402461052, -0.00674282805994153, 0.019174644723534584, -0.01634438894689083, -0.021569160744547844, 0.03257657587528229, 0.0019974380265921354, 0.040980733931064606, 0.019189627841114998, 0.024715323001146317, 0.018382711336016655, -0.0031156581826508045, -0.01078766118735075, -0.0226607583463192, -0.02209506742656231, 0.03575824201107025, 0.06227637082338333, -0.013727108016610146, -0.04587206616997719, 0.03442338481545448, 0.015660621225833893, -0.022646592929959297, -0.013031424954533577, 0.0312640443444252, 0.02398289181292057, 0.014798134565353394, -0.013603032566606998, 0.011365861631929874, -0.014871235936880112, -0.015336225740611553, -0.0009902829769998789, 0.017473306506872177, 0.011207145638763905, -0.01695537008345127, -0.02695065177977085, -0.01748068258166313, 0.008618212305009365, -0.046594515442848206, 0.0221845842897892, 0.012515213340520859, 0.000843202811665833, -0.04305272549390793, 0.035748112946748734, 0.021612783893942833, 0.046960245817899704, 0.015393808484077454, -0.0022826348431408405, 0.008085179142653942, 0.015985865145921707, -0.007640693336725235, 0.06490161269903183, 0.03809765726327896, 0.007275852840393782, 0.006878437474370003, 0.014238651841878891, 0.003488988848403096, -0.028199363499879837, 0.029884520918130875, -0.033093493431806564, -0.004275938495993614, -0.026717128232121468, -0.012489447370171547, -0.04358372092247009, -0.026752358302474022, -0.026528948917984962, 0.00046836177352815866, 0.019043169915676117, -0.019728420302271843, 0.03875589743256569, 0.030268074944615364, 0.004461399745196104, 0.0026120280381292105, -0.049909159541130066, 0.03611524775624275, -0.03956632688641548, -0.0010244430741295218, -0.01778644509613514, -0.018699005246162415, 0.05111135169863701, 0.032091014087200165, -0.02947350963950157, 0.018856210634112358, -0.016389891505241394, -0.008762208744883537, -0.003974312450736761, -0.03995290398597717, -0.020040225237607956, 0.004651591647416353, 0.015002674423158169, -0.03609509766101837, -0.016815612092614174, 0.0340893492102623, -0.026194598525762558, -0.02582119032740593, -0.039759911596775055, -0.00045827191206626594, 0.06560378521680832, 0.006132065784186125, 0.06599349528551102, 0.010250444523990154, -0.027418330311775208, 0.019336534664034843, 0.019596833735704422, 0.023196186870336533, 0.04028208926320076, -0.013396005146205425, -0.029935715720057487, -0.07021407783031464, 0.06525216996669769, -0.04475250840187073, -0.03434837982058525, 0.005257731769233942, -0.006283011753112078, 0.0691542848944664, 0.04232693091034889, -0.019213436171412468, -0.023701505735516548, 0.034727271646261215, 0.026495974510908127, 0.026867814362049103, 0.029252789914608, 0.017457129433751106, 0.007533903233706951, 0.009958388283848763, 0.014876489527523518, -0.01125834695994854, 0.0004522126691881567, -0.017127932980656624, 0.034920115023851395, -0.003037400310859084, 0.05550288408994675, 0.027632929384708405, -0.033063143491744995, 0.015182184055447578, -0.02552090957760811, 0.00035791477421298623, 0.045935261994600296, 0.003495141863822937, 0.028871627524495125, -0.024274712428450584, 0.016174903139472008, 0.03204977139830589, 0.041080232709646225, -0.016357900574803352, 0.016467956826090813, 0.01071841549128294, 0.00807935930788517, -0.06506247073411942, 0.015477247536182404, 0.027153754606842995, 0.0034972091671079397, 0.03058510273694992, -0.06718355417251587, -0.0042006284929811954, 0.015322364866733551, -0.0039908066391944885, -0.03021562099456787, -0.0076384288258850574, -0.004429197870194912, 0.02287110686302185, -0.007141087204217911, -0.0054861437529325485, 0.009848549030721188, -0.02997109293937683, 0.017895372584462166, -0.021288642659783363, -0.03861907869577408, -0.05506167188286781, 0.026555394753813744, -0.05168067663908005, -0.006780391093343496, -0.008590120822191238, -0.015389649197459221, 0.003991100005805492, -0.0005902988486923277, -0.03567611426115036, -0.023565957322716713, 0.0009656280162744224, 0.01997516304254532, -0.05711383372545242, -0.020246554166078568, 0.005278292577713728, -0.020113864913582802, -0.011661241762340069, 0.027276763692498207, -0.039679884910583496, 0.012975875288248062, 0.006685784086585045, 0.02003800868988037, -0.022107280790805817, -0.006668829824775457, 0.08137998729944229, 0.022329695522785187, 0.029353618621826172, 0.002597463084384799, 0.003874352900311351, -0.04925356060266495, 0.0024709515273571014, -0.044383104890584946, 0.025360504165291786, -0.028394585475325584, -0.030039777979254723, -0.00998231302946806, -0.0051894960924983025, 0.04527168720960617, -0.04205450788140297, 0.018709832802414894, 0.021289298310875893, -0.002670412650331855, 0.010871498845517635, 0.05140243470668793, -0.02340671420097351, 0.03673635423183441, -0.036295145750045776, 0.008708903566002846, -0.007431242149323225, 0.03477732837200165, -0.006300127133727074, 0.010125315748155117, 0.02705915831029415, 0.013182003051042557, -0.05001131817698479, 0.02308526448905468, -0.0070402128621935844, -0.0035967344883829355, 0.00001326401161350077, 0.028961921110749245, 0.031902976334095, 0.01661437191069126, 0.01710759662091732, -0.015526102855801582, 0.01742774061858654, -0.0015706063713878393, 0.01321680098772049, 0.00230192462913692, 0.009973726235330105, 0.05575861036777496, -0.0232562106102705, -0.007594562601298094, -0.010479167103767395, 0.006779583171010017, -0.0025951764546334743, 0.023975161835551262, -0.0005167077179066837, 0.015593545511364937, -0.045957207679748535, -0.04024823009967804, -0.04567239060997963, -0.04861559346318245, 0.04955482482910156, 0.06674012541770935, -0.02098700776696205, -0.01265585608780384, -0.025188032537698746, 0.03666120395064354, 0.05739621818065643, 0.06000753864645958, 0.009744896553456783, 0.00943798664957285, -0.006552905309945345, 0.05892254039645195, -0.013124603778123856, 0.01351987849920988, 0.023830095306038857, -0.011337929405272007, -0.015404990874230862, -0.004460921045392752, -0.016647018492221832, -0.04072971269488335, 0.016881315037608147, 0.014331690035760403, -0.0028452591504901648, -0.0008038394153118134, 0.04058264568448067, 0.013017147779464722, 0.0062563857063651085, 0.015298900194466114, 0.014300651848316193, -0.01735757850110531, -0.015896357595920563, -0.0011247568763792515, 0.005211632698774338, 0.02351536974310875, 0.009099970571696758, 0.06307940930128098, 0.017642689868807793, -0.003739764913916588, -0.060897160321474075, -0.02911083586513996, -0.006747561041265726, 0.022409450262784958, 0.012080630287528038, -0.025116922333836555, -0.027840470895171165, -0.03426668420433998, 0.019900847226381302, 0.016694311052560806, 0.017559565603733063, 0.01145962905138731, 0.01109370868653059, -0.03115241415798664, -0.008894913829863071, -0.02281656488776207, -0.04482796788215637, 0.020692897960543633, 0.007936999201774597, -0.04460811987519264, 0.03169909492135048, 0.002376234857365489, -0.04189608246088028, -0.006504567340016365, -0.029563624411821365, 0.004961394239217043, -0.020300572738051414, 0.05784721300005913, 0.002344495616853237, -0.005950413178652525, -0.0263961274176836, -0.012889102101325989, -0.0018637282773852348, -0.03847073018550873, 0.031345952302217484, 0.011990361846983433, 0.04523688927292824, -0.015706896781921387, -0.014987052418291569, -0.006073768250644207, -0.008717735297977924, -0.014876415021717548, 0.010293466039001942, 0.0559861995279789, 0.014784591272473335, 0.008070486597716808, -0.03413242846727371, 0.017683817073702812, 0.030484789982438087, 0.02723049186170101, 0.043847400695085526, 0.00869144219905138, -0.007388299331068993, -0.0002100048732245341, 0.07988443970680237, -0.005897772032767534, 0.032713841646909714, -0.0388377420604229, -0.01966448873281479, -0.01574864611029625, 0.04838211089372635, -0.013307717628777027, 0.023774592205882072, -0.005673971027135849, -0.0021393068600445986, -0.03709142655134201, -0.05385805666446686, -0.008731584995985031, 0.01265713945031166, 0.06586631387472153, -0.006692097522318363, 0.016619525849819183, -0.01913449540734291, -0.040348734706640244, -0.039840392768383026, -0.049795351922512054, -0.0051928614266216755, 0.0435049906373024, -0.047231826931238174, -0.004750674590468407, -0.05570917949080467, -0.012918269261717796, 0.019259138032794, -0.04443416744470596, 0.018713008612394333, 0.05062049254775047, -0.04266536608338356, -0.037349116057157516, -0.010352767072618008, 0.009381555020809174, 0.012210935354232788, 0.02120792306959629, -0.002364534419029951, -0.016437994316220284, 0.011970598250627518, -0.000403457204811275, -0.018255693838000298, 0.019613349810242653, 0.0035609372425824404, 0.012602044269442558, -0.00002237882472400088, 0.003961461130529642, 0.0072782919742167, -0.004932474344968796, 0.008037146180868149, 0.03831390663981438, -0.03146950155496597, -0.031749431043863297, -0.047402601689100266, 0.04172973334789276, 0.017140498384833336, -0.009454699233174324, -0.006873921491205692, -0.008712802082300186, 0.01606455259025097, -0.008520809933543205, -0.01569318398833275, 0.005489975214004517, 0.027204927057027817, 0.013963981531560421, -0.0020560743287205696, -0.019529923796653748, 0.08980944007635117, 0.03919227048754692, -0.05239458754658699, -0.03969717398285866, 0.003319431794807315 ]
Finetune Stable Diffusion Models with DDPO via TRL
metric-space
September 29, 2023
trl-ddpo
guide, diffusers, rl, rlhf
https://huggingface.co/blog/trl-ddpo
Introduction Diffusion models (e.g., DALL-E 2, Stable Diffusion) are a class of generative models that are widely successful at generating images most notably of the photorealistic kind. However, the images generated by these models may not always be on par with human preference or human intention. Thus arises the alignment problem i.e. how does one go about making sure that the outputs of a model are aligned with human preferences like โ€œqualityโ€ or that outputs are aligned with intent that is hard to express via prompts? This is where Reinforcement Learning comes into the picture. In the world of Large Language Models (LLMs), Reinforcement learning (RL) has proven to become a very effective tool for aligning said models to human preferences. Itโ€™s one of the main recipes behind the superior performance of systems like ChatGPT. More precisely, RL is the critical ingredient of Reinforcement Learning from Human Feedback (RLHF), which makes ChatGPT chat like human beings. In Training Diffusion Models with Reinforcement Learning, Black et al. show how to augment diffusion models to leverage RL to fine-tune them with respect to an objective function via a method named Denoising Diffusion Policy Optimization (DDPO). In this blog post, we discuss how DDPO came to be, a brief description of how it works, and how DDPO can be incorporated into an RLHF workflow to achieve model outputs more aligned with the human aesthetics. We then quickly switch gears to talk about how you can apply DDPO to your models with the newly integrated DDPOTrainer from the trl library and discuss our findings from running DDPO on Stable Diffusion.
[ 0.041556425392627716, -0.05031382665038109, -0.06050194799900055, 0.06136655807495117, 0.04214861989021301, 0.04421618953347206, -0.07235576212406158, 0.015167571604251862, -0.031597718596458435, -0.0766880139708519, -0.07144298404455185, -0.016204047948122025, -0.08274881541728973, -0.010100158862769604, -0.0020730087999254465, 0.006242937874048948, 0.012104503810405731, 0.02286592684686184, 0.031617239117622375, 0.006701263133436441, -0.006955338642001152, 0.04297890141606331, -0.04134315252304077, -0.02129887044429779, 0.020188264548778534, -0.06920228898525238, 0.0338408462703228, 0.007443726994097233, -0.030116921290755272, 0.0057379622012376785, -0.04606585204601288, -0.03936836123466492, -0.02625296637415886, -0.008946634829044342, 0.03479423746466637, -0.05304082855582237, -0.05946015194058418, -0.017922842875123024, 0.05802849307656288, -0.0025444594211876392, 0.01937679387629032, -0.03427298367023468, -0.05467849224805832, -0.008425773121416569, 0.010077718645334244, -0.0722338855266571, -0.11769773811101913, 0.04921913892030716, -0.015069590881466866, -0.06477611511945724, -0.0857493132352829, 0.05159502476453781, -0.1097848191857338, -0.003659478621557355, -0.05197830870747566, -0.057059772312641144, -0.022274168208241463, -0.058036353439092636, -0.03545600175857544, -0.0073742493987083435, -0.02778477594256401, 0.031246250495314598, 0.019989773631095886, 0.04008184000849724, 0.012699089013040066, 0.019601957872509956, -0.026477042585611343, 0.00016311707440763712, -0.05992503836750984, -0.06522557139396667, -0.04176008328795433, -0.013143138960003853, -0.016984492540359497, -0.023952573537826538, -0.013112276792526245, -0.023431962355971336, -0.034425605088472366, 0.09253772348165512, -0.043182048946619034, -0.05001668632030487, -0.014376528561115265, 0.015669599175453186, 0.08271996676921844, 0.06147567927837372, -0.0136863486841321, 0.04134468361735344, 0.04802985489368439, -0.019188998267054558, 0.01780550740659237, -0.01667845994234085, -0.07534660398960114, -0.04113977402448654, -0.0452728271484375, -0.004190304782241583, 0.07866518944501877, -0.03414019197225571, -0.07541482150554657, 0.03174004331231117, 0.000657758500892669, 0.007455401122570038, -0.04119487479329109, -0.035364050418138504, 0.06814362108707428, -0.09676005691289902, -0.03800400346517563, 0.06321214139461517, -0.026561083272099495, -0.0344851091504097, -0.04473413899540901, 0.08095549046993256, 0.006014912389218807, 0.023341095075011253, -0.036039501428604126, 0.04291457682847977, -0.09193675965070724, 0.023569168522953987, -0.0418020561337471, 0.06267502158880234, -0.011925110593438148, 0.11195685714483261, -0.003332380671054125, 0.07998000085353851, 0.04296392947435379, -0.046857502311468124, -0.04590460658073425, 0.0964185819029808, -0.005659149028360844, -0.028025610372424126, -0.05603673681616783, 0.002789303893223405, 0.027366075664758682, 0.019067073240876198, -0.018431901931762695, -0.026098111644387245, 0.059081096202135086, -0.07333752512931824, 0.05297601968050003, -0.07710693776607513, 0.0516502670943737, -0.015141033567488194, 0.004584221169352531, 0.010863992385566235, 0.049171775579452515, -0.01672530733048916, 0.05660521611571312, -0.0033743055537343025, -0.06307454407215118, -0.015180406160652637, -0.020180488005280495, 0.016672788187861443, -0.04011210799217224, 0.06276120245456696, -0.03285909444093704, -0.12336868792772293, 0.017327455803751945, 0.04955662786960602, -0.060181304812431335, 0.0008110848721116781, 0.014938962645828724, -0.0040224464610219, -0.01714254915714264, -0.07496768236160278, -0.03559502214193344, 0.07077141851186752, 0.05372904613614082, 0.026056457310914993, 0.01001209206879139, 0.06407888978719711, 0.004302811808884144, 0.02717067487537861, 0.01597370207309723, 0.046708397567272186, 0.061576321721076965, 0.022846825420856476, 0.020817464217543602, 0.0188693068921566, 0.006476283073425293, 0.015577079728245735, -0.004064120352268219, -0.03577161580324173, -0.030517172068357468, 0.04855303838849068, 0.011632416397333145, 0.009876825846731663, 0.10885632038116455, -0.14262612164020538, 0.03468765318393707, -0.014628532342612743, 0.01546688936650753, 0.03426135703921318, -0.07313170284032822, 0.054439861327409744, 0.06910672038793564, -0.017872098833322525, 0.02439701557159424, -0.04858074337244034, -0.08215789496898651, 0.11986257135868073, 0.0341966412961483, 0.0952167734503746, 0.03806934133172035, -0.05972110480070114, 0.027327479794621468, -0.07909315079450607, -0.009737174026668072, -0.051052164286375046, 0.012027754448354244, 0.01691056787967682, -0.0002748267725110054, 0.009480373933911324, -0.02413850836455822, -0.08404269814491272, 0.05891118943691254, 0.0028553083539009094, -0.010401563718914986, -0.043460216373205185, 0.055055391043424606, -0.024541813880205154, -0.038062773644924164, -0.0091123441234231, 0.12586234509944916, 0.025797462090849876, 0.00845706183463335, 0.02867131493985653, 0.02082950249314308, 0.0414884053170681, 0.10132196545600891, 0.036483217030763626, 0.03768114373087883, -0.03503890708088875, -0.03029824048280716, -0.053979579359292984, 0.04711855947971344, 0.001992300618439913, -0.019723886623978615, -0.028024055063724518, 0.05302974581718445, 0.010682633146643639, 0.035589057952165604, 0.01058668177574873, 0.07276076078414917, 0.007162530440837145, -0.02697966806590557, 0.06429264694452286, 0.024101290851831436, 0.01654834672808647, 0.05177784338593483, 0.06187950447201729, -0.031597577035427094, -0.0015102194156497717, -0.10265208780765533, 0.01888764277100563, -0.0008776835747994483, 0.024494638666510582, 0.0023726103827357292, 0.03283149003982544, 0.026349341496825218, 0.019060377031564713, -0.02106393314898014, -0.01500552985817194, -0.029954999685287476, 0.00005039109964855015, -0.020481571555137634, 0.033679116517305374, 0.01844841055572033, -0.0274185910820961, 0.010877721942961216, 0.01896991953253746, 0.007417834363877773, 0.03360356390476227, 0.01466573029756546, 0.010858210735023022, 0.009845741093158722, 0.011553079821169376, -0.0536140538752079, -0.005838928744196892, 0.03934590518474579, -0.025072650983929634, -0.024225011467933655, 0.026450132951140404, -0.010876019485294819, 0.020905906334519386, 0.04408278316259384, 0.025338875129818916, 0.013504023663699627, 0.024504654109477997, 0.0010392150143161416, -0.0168121550232172, -0.06550706923007965, 0.06168172508478165, 0.05616757273674011, 0.018359344452619553, 0.00246366742067039, -0.013401685282588005, -0.004169116728007793, -0.0013365468475967646, -0.004055397119373083, -0.023269426077604294, -0.011098303832113743, -0.019248414784669876, 0.018330691382288933, -0.006834237836301327, 0.020697422325611115, 0.039076559245586395, 0.021143648773431778, 0.040845148265361786, 0.03377176448702812, 0.02544616162776947, -0.08233419060707092, -0.035509638488292694, 0.027266379445791245, 0.024208055809140205, 0.016099249944090843, -0.044550757855176926, 0.053199928253889084, -0.0482780896127224, -0.06473608314990997, 0.0280535276979208, 0.009633089415729046, 0.04484504461288452, 0.024499567225575447, 0.03831111639738083, 0.01493342686444521, 0.03086884506046772, 0.045846693217754364, -0.03009997121989727, -0.021149558946490288, 0.03543362393975258, -0.07406070083379745, 0.02883252687752247, 0.01649647206068039, 0.007291554939001799, -0.025035075843334198, -0.016730250790715218, 0.05141621083021164, 0.015584715642035007, 0.019232366234064102, -0.015032768249511719, 0.0046783373691141605, -0.03609934821724892, -0.031739816069602966, 0.01267653051763773, -0.038644708693027496, 0.0002504544099792838, 0.021301008760929108, 0.05135999619960785, 0.011864844709634781, 0.02985181286931038, -0.024080103263258934, 0.01269038487225771, -0.006694747135043144, 0.01800226978957653, -0.0067167202942073345, 0.003507689805701375, 0.013339831493794918, 0.005036627408117056, 0.006717429030686617, -0.028719346970319748, -0.015076715499162674, 0.018938779830932617, 0.02425583265721798, 0.03882909566164017, 0.038794562220573425, 0.03529471531510353, 0.053328987210989, 0.0009423059527762234, 0.002318458165973425, -0.019684474915266037, -0.012559225782752037, 0.03336245194077492, -0.0005116112297400832, -0.019482094794511795, 0.0001810593530535698, 0.03000389225780964, 0.03521861881017685, -0.022623231634497643, -0.027445364743471146, 0.06796777248382568, 0.001662227208726108, 0.03364704176783562, 0.017809603363275528, 0.0072934431955218315, -0.012510117143392563, -0.0282989963889122, 0.006223921664059162, -0.01179068349301815, 0.030912859365344048, -0.003628237871453166, -0.04036509990692139, -0.02464214526116848, -0.03191238269209862, -0.02188269980251789, 0.0015628974651917815, -0.02531455084681511, 0.04209001362323761, -0.03594188764691353, 0.02758403681218624, 0.01826324872672558, 0.019194554537534714, -0.02927699312567711, -0.006789671257138252, -0.004896558355540037, 0.003368477337062359, -0.013967709615826607, 0.02635273151099682, 0.014698874205350876, -0.00013737991685047746, 0.009475693106651306, 0.023297004401683807, -0.0019363396568223834, 0.014170178212225437, 0.01311538740992546, 0.015423002652823925, -0.004203493241220713, -0.02291981875896454, 0.004450585693120956, -0.011922288686037064, 0.0009397415560670197, -0.007218231447041035, 0.00020969967590644956, -0.01424994133412838, 0.01790124922990799, 0.04133246839046478, 0.0015271443407982588, -0.010823187418282032, 0.01855349913239479, -0.015351721085608006, 0.011701934970915318, -0.038427047431468964, -0.011837574653327465, -0.023414218798279762, -0.02915332093834877, 0.04720848426222801, 0.0328662134706974, -0.008365309797227383, -0.03743391111493111, 0.008123177103698254, -0.0417269766330719, -0.004187935031950474, -0.036660291254520416, 0.019093817099928856, -0.0023731589317321777, -0.005418186075985432, -0.01282004825770855, -0.021146725863218307, 0.04207161068916321, -0.0015753544867038727, -0.014183412306010723, -0.004193441942334175, 0.010357467457652092, 0.06838413327932358, -0.023394200950860977, 0.0432731956243515, -0.015458288602530956, 0.005109661258757114, 0.01728663593530655, 0.016952579841017723, 0.007327856961637735, 0.043042201548814774, -0.014213685877621174, -0.06453213095664978, -0.03817135468125343, 0.07034958899021149, -0.01833150163292885, -0.029729271307587624, 0.03371233865618706, -0.011376735754311085, 0.043309424072504044, 0.058933861553668976, 0.004526980221271515, -0.04423444718122482, 0.03485625609755516, 0.051541898399591446, 0.024865690618753433, 0.018560675904154778, -0.0039472091011703014, 0.0010096243349835277, 0.023144373670220375, -0.024686196818947792, 0.009965954348444939, -0.00803897250443697, -0.02907620556652546, 0.034935612231492996, -0.029976915568113327, 0.05907513573765755, 0.011013773269951344, -0.02403809316456318, -0.006236452143639326, -0.04976438730955124, -0.005903266835957766, 0.025886552408337593, 0.004502623807638884, -0.01497309748083353, -0.022828979417681694, 0.06196969375014305, 0.058216825127601624, 0.023824768140912056, -0.031205127015709877, -0.0007305301260203123, 0.030226407572627068, 0.01448019314557314, -0.043584853410720825, 0.006352216470986605, 0.04969341680407524, -0.018814414739608765, 0.035420067608356476, -0.02998034842312336, -0.010117816738784313, 0.003996469546109438, 0.04933678358793259, -0.018322931602597237, 0.01173434965312481, 0.012010091915726662, -0.014371686615049839, -0.03543704003095627, -0.02552253007888794, 0.012119409628212452, 0.0198542270809412, -0.017139418050646782, -0.02895153872668743, -0.01599380560219288, -0.06159399077296257, 0.006710963323712349, -0.04628663882613182, -0.015345847234129906, -0.005071371328085661, -0.0177004411816597, 0.05590936914086342, -0.04454232379794121, -0.016397841274738312, -0.043609488755464554, 0.004177119117230177, 0.0070126173086464405, -0.05666900426149368, -0.033455051481723785, 0.003943274263292551, -0.016950029879808426, -0.009520767256617546, 0.02865656651556492, -0.027339400723576546, 0.04125416651368141, 0.03476836532354355, -0.014337296597659588, -0.023905105888843536, -0.021505339071154594, 0.06700626015663147, 0.0362863726913929, -0.007145323790609837, 0.014539631083607674, -0.013733063824474812, -0.04223034158349037, -0.023178813979029655, -0.042942699044942856, 0.044822365045547485, -0.02539418637752533, -0.02129274606704712, -0.01331107784062624, -0.025458326563239098, 0.05199873074889183, -0.023398220539093018, 0.032156288623809814, -0.0032336595468223095, -0.015896404162049294, 0.05826578661799431, 0.050027333199977875, -0.021356169134378433, 0.007137043867260218, 0.006413098890334368, 0.008304350078105927, -0.035555724054574966, -0.0017969957552850246, -0.007949563674628735, -0.018702944740653038, 0.0448903925716877, 0.02479018270969391, -0.04847273230552673, 0.006802491378039122, 0.022312168031930923, 0.004213578999042511, 0.021275866776704788, 0.012234780937433243, 0.027977673336863518, 0.040800634771585464, 0.009552438743412495, -0.007847056724131107, 0.03895195573568344, -0.04899992421269417, 0.03301810845732689, 0.013198311440646648, -0.013428868725895882, 0.04517580196261406, -0.0021759713999927044, -0.03574436530470848, 0.025498008355498314, 0.03918908163905144, -0.014658690430223942, 0.02489050105214119, -0.015171423554420471, 0.0020392511505633593, -0.028997985646128654, -0.030582860112190247, -0.032945416867733, -0.017795860767364502, 0.06510274857282639, 0.025233116000890732, -0.02241067960858345, 0.005011351779103279, -0.038417089730501175, 0.038281843066215515, 0.04346184805035591, 0.06161870062351227, -0.007772399578243494, -0.012550966814160347, 0.033224932849407196, 0.03547587990760803, 0.016530605033040047, 0.02061568759381771, 0.018810158595442772, -0.005100185517221689, -0.004002362955361605, 0.01905340887606144, 0.02706269547343254, -0.03131427615880966, 0.041608020663261414, 0.05299557372927666, -0.015428200364112854, -0.007737025618553162, -0.00582357682287693, -0.02004374749958515, 0.016786450520157814, 0.0017428526189178228, -0.004841088782995939, 0.004034079145640135, -0.025215763598680496, -0.012315026484429836, 0.02032756246626377, 0.060249779373407364, -0.023235512897372246, 0.023334715515375137, 0.004214100539684296, 0.029503753408789635, -0.053192008286714554, 0.006521621719002724, -0.002873087301850319, 0.03645860403776169, -0.03468018025159836, -0.006959369871765375, -0.04805106297135353, -0.03276100754737854, 0.021659301593899727, -0.012607133947312832, -0.004688592627644539, -0.01788783259689808, -0.014416615478694439, -0.015424145385622978, 0.03419224172830582, -0.02598639950156212, -0.029350101947784424, 0.015475699678063393, 0.02118859440088272, -0.06550710648298264, 0.008502037264406681, 0.01905754953622818, -0.012415468692779541, -0.02412376180291176, -0.03222687542438507, -0.0023908293806016445, -0.015447204932570457, 0.07404167950153351, 0.007627334911376238, 0.018813196569681168, -0.01689138077199459, -0.05393970385193825, -0.03292378410696983, -0.0007219413528218865, 0.012897767126560211, -0.024209821596741676, 0.041853491216897964, -0.01369844563305378, 0.00110239174682647, -0.012724334374070168, -0.028041262179613113, -0.02464742213487625, 0.0054632751271128654, 0.022601298987865448, -0.008120972663164139, -0.0042286100797355175, 0.005879797041416168, 0.0246075801551342, 0.011697162874042988, 0.04260016232728958, 0.004504463169723749, -0.018247727304697037, -0.03077603504061699, -0.012600898742675781, 0.026031799614429474, -0.042313866317272186, 0.0448775514960289, -0.04187504202127457, 0.0031099808402359486, -0.0208466574549675, 0.05631783604621887, 0.003543949220329523, 0.007510530762374401, 0.04208076000213623, 0.0008048055460676551, -0.03459080308675766, 0.009714817628264427, 0.02886168099939823, 0.01836170069873333, 0.05606172978878021, -0.01906006596982479, -0.024568086490035057, 0.0035583863500505686, -0.027442216873168945, -0.01763470657169819, -0.0337856225669384, -0.024188362061977386, 0.014195294119417667, -0.02338852547109127, -0.03285731002688408, 0.0011152345687150955, 0.0006742950645275414, 0.009087616577744484, -0.052310291677713394, 0.038065191358327866, 0.039994362741708755, -0.03557329997420311, -0.01385695394128561, -0.013041076250374317, 0.02315486967563629, 0.013230386190116405, 0.021949434652924538, -0.031504567712545395, -0.043425776064395905, 0.020804988220334053, -0.019623078405857086, -0.03212755173444748, 0.03851808235049248, -0.03983259201049805, -0.010326957330107689, 0.01930481195449829, 0.007908823899924755, 0.039437223225831985, -0.021704303100705147, 0.008755296468734741, -0.009261860512197018, -0.010971435345709324, -0.0002669506357051432, -0.056984834372997284, 0.0418420173227787, 0.04152533784508705, -0.023179184645414352, -0.00878110621124506, 0.006478765979409218, 0.008164126425981522, 0.00008881488611223176, -0.0231106486171484, 0.015485083684325218, 0.02213476598262787, 0.026292111724615097, -0.01873137429356575, -0.009077847003936768, 0.04971107840538025, 0.036632273346185684, -0.03785223513841629, -0.021897155791521072, -0.011366301216185093 ]
Finetune Stable Diffusion Models with DDPO via TRL
metric-space
September 29, 2023
trl-ddpo
guide, diffusers, rl, rlhf
https://huggingface.co/blog/trl-ddpo
DDPO and RLHF: a mix to enforce aestheticness The general training aspect of RLHF can roughly be broken down into the following steps: 1. Supervised fine-tuning a โ€œbaseโ€ model learns to the distribution of some new data 2. Gathering preference data and training a reward model using it. 3. Fine-tuning the model with reinforcement learning using the reward model as a signal. It should be noted that preference data is the primary source for capturing human feedback in the context of RLHF. When we add DDPO to the mix, the workflow gets morphed to the following: 1. Starting with a pretrained Diffusion Model 2. Gathering preference data and training a reward model using it. 3. Fine-tuning the model with DDPO using the reward model as a signal Notice that step 3 from the general RLHF workflow is missing in the latter list of steps and this is because empirically it has been shown (as you will get to see yourself) that this is not needed. To get on with our venture to get a diffusion model to output images more in line with the human perceived notion of what it means to be aesthetic, we follow these steps: 1. Starting with a pretrained Stable Diffusion (SD) Model 2. Training a frozen CLIP model with a trainable regression head on the Aesthetic Visual Analysis (AVA) dataset to predict how much people like an input image on average 3. Fine-tuning the SD model with DDPO using the aesthetic predictor model as the reward signaller We keep these steps in mind while moving on to actually getting these running which is described in the following sections.
[ 0.0944908857345581, -0.01248510554432869, -0.07781925797462463, -0.010060606524348259, 0.07557875663042068, 0.02178865671157837, -0.07829073071479797, -0.0011515322839841247, -0.03573349490761757, -0.044556982815265656, -0.08519448339939117, 0.044796861708164215, -0.023513227701187134, -0.059177789837121964, -0.02769630402326584, 0.02803216315805912, 0.028635656461119652, -0.01707741990685463, 0.028396539390087128, 0.025733165442943573, 0.00018073615501634777, -0.03842474892735481, -0.021379007026553154, 0.010681419633328915, -0.015594718977808952, -0.08343829959630966, 0.09072454273700714, 0.03914540633559227, -0.04415084794163704, 0.008136864751577377, -0.025718536227941513, -0.06086102873086929, -0.002831468591466546, -0.004293534904718399, 0.05631294474005699, -0.007438036147505045, -0.023960791528224945, -0.034447118639945984, 0.08571963757276535, 0.0020951011683791876, -0.014627598226070404, -0.01937432400882244, -0.06772205233573914, 0.0002628857910167426, 0.018094390630722046, -0.04924609884619713, -0.09853892028331757, 0.024997474625706673, -0.05550228804349899, 0.04066164046525955, -0.0807836726307869, 0.09406459331512451, -0.048139896243810654, 0.07347822189331055, 0.020296044647693634, -0.10445121675729752, -0.044658612459897995, 0.031708721071481705, -0.031220629811286926, 0.003106227610260248, -0.029837029054760933, -0.03321349620819092, 0.0003035915724467486, 0.04314282163977623, 0.01803646981716156, 0.0075827003456652164, 0.0010355247650295496, 0.02017952874302864, -0.015209290198981762, -0.10260099917650223, 0.0025953175500035286, -0.033830996602773666, 0.03192274644970894, -0.007463444489985704, -0.033903252333402634, -0.054455239325761795, -0.015008979476988316, 0.06402398645877838, 0.01028755959123373, 0.011563749052584171, 0.0021271465811878443, -0.018069198355078697, 0.008612805977463722, 0.07138244807720184, -0.014202477410435677, 0.040849752724170685, 0.021158162504434586, -0.035246625542640686, -0.03335323557257652, -0.0045518395490944386, -0.04872770980000496, -0.044449616223573685, -0.022199729457497597, -0.018972735852003098, 0.10299162566661835, -0.06032008305191994, -0.01822732575237751, 0.02386651188135147, -0.007005025167018175, -0.043780937790870667, -0.03819938004016876, -0.015275322832167149, 0.016970757395029068, -0.10023722052574158, -0.04324110597372055, 0.03342462703585625, -0.06573302298784256, -0.009280509315431118, -0.029026364907622337, 0.07694123685359955, 0.021045325323939323, 0.0368330292403698, -0.057961564511060715, 0.07410769909620285, -0.03152718022465706, 0.02796287275850773, -0.05962666869163513, 0.04222056269645691, -0.03510706499218941, 0.05118945986032486, -0.0027967155911028385, 0.05180395022034645, -0.026869110763072968, -0.03798969089984894, -0.06200726702809334, 0.1220376119017601, -0.0038828328251838684, 0.0072128791362047195, -0.018823713064193726, 0.022051705047488213, 0.03171864524483681, 0.015748418867588043, -0.004544829484075308, -0.006306200288236141, 0.05400430038571358, -0.04657157137989998, -0.031369250267744064, -0.0417591892182827, 0.04022904857993126, -0.028533056378364563, -0.007123444229364395, 0.02648337185382843, 0.019358862191438675, -0.029520181939005852, 0.005587955936789513, -0.05430745705962181, 0.043642617762088776, -0.03139611333608627, 0.01783408224582672, -0.0033988694194704294, -0.009834357537329197, 0.10698743164539337, -0.028319496661424637, -0.10953215509653091, 0.057082172483205795, 0.02719942107796669, -0.015499543398618698, -0.06813383847475052, -0.010121890343725681, 0.054526783525943756, 0.021576927974820137, 0.01690548285841942, -0.04257373884320259, 0.1290595978498459, 0.09520012140274048, 0.010129043832421303, 0.02008167654275894, 0.0522071048617363, -0.02414850704371929, 0.01570184901356697, 0.008511977270245552, 0.02850925177335739, 0.056325193494558334, 0.0682961568236351, -0.02242214046418667, 0.024782853201031685, -0.01193874143064022, 0.02172662504017353, -0.013629944995045662, -0.020135795697569847, 0.03706177696585655, 0.026753142476081848, 0.007902686484158039, 0.010202232748270035, 0.07690424472093582, -0.12395200878381729, 0.06911635398864746, 0.03278970718383789, -0.003869527019560337, 0.022924169898033142, -0.053894203156232834, 0.06530696153640747, 0.05010121688246727, -0.05909847840666771, 0.022276267409324646, -0.06664508581161499, -0.10141122341156006, 0.07191988080739975, 0.030033431947231293, 0.054116133600473404, 0.07554178684949875, -0.08937046676874161, 0.09424988925457001, -0.036126457154750824, -0.009775310754776001, -0.04851562902331352, 0.004313257522881031, 0.00029408285627141595, 0.01352079026401043, -0.026937268674373627, -0.018696753308176994, -0.07915511727333069, 0.0008001087117008865, -0.0021547016222029924, 0.025621896609663963, 0.03410058841109276, 0.013484838418662548, 0.017013391479849815, -0.0165922362357378, -0.0694226548075676, 0.10036775469779968, 0.016393650323152542, 0.015842890366911888, 0.0549619123339653, 0.007877863943576813, 0.03439692035317421, 0.0893598273396492, 0.002329339040443301, 0.0094291465356946, -0.010614411905407906, -0.040972888469696045, -0.019839787855744362, -0.008644781075417995, 0.009484611451625824, -0.024838237091898918, -0.0036407895386219025, 0.08156142383813858, 0.0055078850127756596, -0.008254151791334152, -0.008378584869205952, 0.055151499807834625, -0.029125554487109184, -0.05579107627272606, 0.015299106016755104, 0.00027404873981140554, 0.021376878023147583, 0.04639812931418419, 0.04916250333189964, -0.0672515481710434, 0.006232195999473333, -0.09640619158744812, 0.11476241797208786, -0.0068024685606360435, -0.01553860493004322, -0.006892204284667969, -0.0010023812064900994, 0.016642989590764046, -0.012568513862788677, -0.011653797701001167, -0.008290641009807587, -0.023953815922141075, 0.015198311768472195, -0.02675473503768444, 0.021120550110936165, 0.01608704961836338, -0.033433444797992706, 0.023489058017730713, 0.03091110847890377, 0.0005480482941493392, 0.04796290025115013, -0.03451162204146385, 0.027392908930778503, -0.013972165063023567, 0.0034664650447666645, -0.04157225787639618, -0.022677157074213028, 0.02180328406393528, -0.020610865205526352, -0.05644388869404793, -0.016475483775138855, -0.004885267466306686, 0.01092329528182745, 0.04064871370792389, 0.034944672137498856, 0.05940663814544678, -0.006746700499206781, -0.016689525917172432, -0.0039553591050207615, -0.07630053162574768, 0.06360100954771042, 0.007089176215231419, 0.029072927311062813, -0.010222190991044044, 0.023651663213968277, -0.0090309614315629, 0.014931933023035526, 0.012473168782889843, -0.037702515721321106, -0.007934520952403545, -0.009740387089550495, 0.007398803718388081, -0.011821197345852852, 0.030855033546686172, 0.0019964773673564196, 0.007536833640187979, 0.004758193623274565, 0.05564899742603302, 0.027836432680487633, -0.07883506268262863, -0.03542400151491165, 0.011575349606573582, 0.017544951289892197, -0.006889332085847855, -0.05768493190407753, -0.0005912977503612638, -0.017880477011203766, -0.06751835346221924, 0.010129229165613651, 0.016259988769888878, -0.019238149747252464, 0.05131694674491882, 0.04153289645910263, 0.04111604392528534, 0.03236314281821251, 0.04849999025464058, 0.0008778032497502863, 0.009794311597943306, 0.06005996838212013, -0.085124172270298, 0.01149584911763668, 0.02781880646944046, -0.020671607926487923, -0.058380577713251114, 0.007509006652981043, 0.05378971993923187, 0.021040063351392746, 0.01415475644171238, -0.008442888967692852, 0.006237051449716091, -0.05575213208794594, -0.053778115659952164, 0.027451641857624054, 0.002434875350445509, 0.006898246239870787, 0.02837284840643406, 0.04222545400261879, 0.011420702561736107, 0.027253536507487297, -0.03584003821015358, -0.014128098264336586, -0.03376320004463196, 0.0031553716398775578, 0.010088163428008556, -0.002146740211173892, 0.005007661879062653, 0.024413786828517914, -0.015431995503604412, -0.01936981827020645, -0.028654491528868675, 0.027194378897547722, -0.01875488832592964, 0.06668362021446228, -0.013106026686728, -0.0014163906453177333, 0.0153804374858737, 0.015180262736976147, 0.015073108486831188, -0.05451073497533798, -0.03521347790956497, -0.0014608121709898114, 0.005578410346060991, -0.012276478111743927, 0.0025327473413199186, 0.019021088257431984, 0.016753466799855232, -0.03275100141763687, -0.05013403296470642, -0.00042579389992170036, 0.01840008981525898, 0.026805032044649124, 0.034128185361623764, -0.0005830694572068751, -0.02449754811823368, -0.03363671526312828, 0.013484150171279907, 0.01089536864310503, 0.008154341951012611, -0.005052524618804455, -0.014306191354990005, -0.03402642533183098, -0.022210368886590004, -0.05145305395126343, 0.03920935466885567, -0.03012017346918583, 0.018681488931179047, -0.020669814199209213, 0.0072753592394292355, 0.0009480580920353532, 0.028923828154802322, 0.00947695504873991, -0.05431366339325905, 0.02237851917743683, -0.00677120964974165, -0.035700082778930664, 0.03096177615225315, 0.024395952001214027, -0.006676713936030865, 0.018529614433646202, 0.04714639484882355, -0.005550713744014502, 0.007122618146240711, 0.013896611519157887, 0.02040129341185093, -0.03941298648715019, -0.03246317803859711, -0.025302622467279434, 0.0012690657749772072, -0.03538229689002037, -0.005526440218091011, -0.0009080971940420568, 0.024936366826295853, -0.007527295034378767, 0.01908332109451294, 0.018786214292049408, -0.04883695766329765, 0.016221357509493828, 0.016173221170902252, 0.01728498376905918, -0.01800067164003849, -0.013058170676231384, 0.0006510050734505057, -0.03972351551055908, 0.043028078973293304, 0.01702580414712429, -0.009439460933208466, 0.030977413058280945, 0.03606560453772545, -0.028486251831054688, -0.004801725968718529, -0.04434497654438019, -0.002498086541891098, -0.0030836781952530146, 0.015829501673579216, -0.004712198860943317, -0.017784563824534416, 0.028676452115178108, 0.023246465250849724, -0.0032532024197280407, 0.004295655991882086, 0.01165168546140194, 0.06261423230171204, 0.02754564955830574, 0.03373564034700394, -0.002996917348355055, 0.00527565460652113, 0.009559985250234604, 0.01911996863782406, -0.0007223851280286908, 0.020659681409597397, 0.008478155359625816, -0.051608432084321976, -0.0479448139667511, 0.06445836275815964, -0.01781153865158558, -0.023898662999272346, 0.019163575023412704, -0.02295830473303795, 0.0336129292845726, -0.00428782170638442, -0.008803644217550755, -0.04215163737535477, 0.012484436854720116, 0.032769277691841125, 0.009710999205708504, -0.01538140419870615, 0.018527911975979805, -0.013849664479494095, -0.005593480542302132, -0.03458043932914734, 0.0019033716525882483, -0.01386974286288023, -0.04613570123910904, 0.026388131082057953, -0.010179055854678154, 0.04639764502644539, 0.033413130789995193, -0.05054032430052757, 0.0007501600193791091, -0.060634367167949677, 0.027205346152186394, 0.027711309492588043, 0.01116716954857111, -0.006812563631683588, 0.013946431688964367, 0.017679039388895035, 0.0266343392431736, 0.06807740777730942, -0.0012379480758681893, 0.02078431472182274, 0.009734215214848518, -0.004209629725664854, -0.02602100931107998, -0.02204391546547413, 0.0031682171393185854, 0.0009749365854077041, 0.030270975083112717, -0.03691815957427025, -0.00035990451578982174, 0.0357726626098156, 0.03295827656984329, 0.019399814307689667, 0.027018072083592415, 0.0200315173715353, -0.016162335872650146, -0.029719278216362, 0.006638435646891594, -0.01092239748686552, -0.024585407227277756, -0.014962537214159966, -0.03707459941506386, -0.03146243467926979, -0.04268095642328262, -0.006012381985783577, -0.0696171298623085, -0.032765429466962814, 0.014247192069888115, -0.0147890355437994, 0.0473848320543766, -0.019424285739660263, 0.01766452193260193, -0.04908711463212967, 0.027531493455171585, 0.014405373483896255, -0.07550777494907379, 0.03024929203093052, -0.016012875363230705, 0.001591794192790985, -0.02047167345881462, 0.020776525139808655, 0.006249250844120979, 0.013013065792620182, 0.007850638590753078, -0.017069488763809204, -0.025944460183382034, -0.04240705817937851, 0.0831930860877037, 0.056088950484991074, -0.011906035244464874, 0.008330916054546833, 0.033272504806518555, -0.005199689418077469, -0.030650189146399498, -0.007729480508714914, 0.06524466723203659, -0.029821224510669708, -0.005149044096469879, 0.0008962039719335735, -0.02878970094025135, 0.04433038458228111, -0.0329207144677639, 0.027511045336723328, -0.0011586336186155677, -0.026511775329709053, 0.06971355527639389, 0.018923833966255188, -0.026344584301114082, 0.02878253348171711, -0.016354508697986603, 0.004662917461246252, -0.007138808723539114, 0.047764912247657776, -0.009818734601140022, 0.022884810343384743, 0.028205106034874916, 0.030433423817157745, -0.0187775120139122, 0.02438679151237011, 0.006446513347327709, 0.05039176344871521, 0.028097031638026237, 0.024334609508514404, 0.01583613082766533, 0.03492939844727516, -0.04972198233008385, -0.006759110372513533, 0.01269722729921341, -0.02208827994763851, -0.021460741758346558, -0.01966511271893978, -0.02817990817129612, 0.056744206696748734, -0.0038908885326236486, 0.00021180826297495514, 0.04566317796707153, 0.005878342315554619, 0.006398024968802929, 0.0250602625310421, 0.028794707730412483, 0.012605029158294201, -0.013599525205790997, -0.029499167576432228, -0.02772030420601368, -0.000782152870669961, 0.045547258108854294, 0.024108760058879852, -0.01995515450835228, 0.001122286426834762, -0.03922167792916298, 0.04632510989904404, 0.02741505205631256, 0.0388084314763546, 0.0023448336869478226, 0.0008429087465628982, 0.04378530755639076, 0.032849155366420746, 0.013119524344801903, 0.004695103038102388, 0.03289546072483063, 0.01149035431444645, -0.021876005455851555, 0.007067658938467503, -0.006778101436793804, -0.021170377731323242, 0.04749560356140137, 0.03179753199219704, 0.015859942883253098, 0.006164045073091984, 0.007347872946411371, -0.0026314537972211838, -0.002316436730325222, 0.005595682188868523, 0.01734916865825653, -0.018684888258576393, -0.011492328718304634, 0.0005122587899677455, 0.003843270940706134, 0.031098414212465286, 0.014290111139416695, 0.07314298301935196, 0.03454555198550224, 0.01617511175572872, -0.04683700203895569, -0.031695716083049774, 0.041608329862356186, 0.02140011638402939, -0.011854651384055614, -0.05698136240243912, -0.0658799335360527, -0.05631949007511139, 0.0195266455411911, 0.001006933394819498, 0.04186342656612396, 0.04138729348778725, -0.017302697524428368, -0.019386587664484978, -0.022574692964553833, -0.0015366144943982363, -0.04942840337753296, 0.0006911198142915964, -0.0014067518059164286, -0.0584632009267807, 0.019741326570510864, 0.013656019233167171, -0.03511228412389755, 0.01296215783804655, -0.016002211719751358, 0.01887962594628334, -0.01857226900756359, 0.04538019746541977, 0.024077268317341805, 0.02110486477613449, -0.013066781684756279, -0.042901504784822464, -0.07480581849813461, 0.014920941554009914, 0.0026690911035984755, 0.006024038419127464, 0.023806385695934296, -0.0032739120069891214, 0.0050648050382733345, 0.03020627051591873, -0.05036333575844765, -0.02353004366159439, 0.005910975858569145, 0.03929635137319565, -0.026249663904309273, -0.01104577723890543, 0.02509048581123352, 0.012088567949831486, 0.037967465817928314, 0.03402511030435562, 0.03535792604088783, -0.011355194263160229, -0.03917976841330528, -0.020052414387464523, -0.005663840100169182, 0.011690226383507252, 0.013076282106339931, -0.02987981028854847, -0.002723861252889037, -0.01983960159122944, 0.0529424324631691, -0.013224934227764606, 0.028406476601958275, -0.009625125676393509, -0.010621117427945137, -0.05011483281850815, -0.02685277722775936, 0.005833868868649006, 0.026097213849425316, 0.06855160742998123, -0.027284618467092514, 0.019393768161535263, 0.028618793934583664, -0.048608969897031784, -0.001974839484319091, -0.051379743963479996, -0.047187093645334244, 0.024106904864311218, -0.010752652771770954, -0.0023575809318572283, -0.025425922125577927, -0.03583889827132225, 0.03554411977529526, -0.04118319973349571, -0.0040838997811079025, 0.010697589255869389, -0.04451446980237961, -0.03567115589976311, -0.014939693734049797, 0.0502152182161808, 0.03234916552901268, -0.003394601633772254, -0.010319264605641365, -0.016207369044423103, 0.040234409272670746, 0.011956964619457722, -0.023862149566411972, 0.028012851253151894, -0.0125191118568182, 0.037295497953891754, -0.021758167073130608, -0.040429309010505676, -0.0032094463240355253, -0.016003122553229332, -0.001698632724583149, -0.019938761368393898, -0.0068008434027433395, -0.02290378510951996, -0.039751939475536346, 0.02291938103735447, 0.027000682428479195, -0.010802625678479671, -0.029576463624835014, 0.015207977965474129, 0.01445007137954235, -0.000010125422704732046, -0.01961435005068779, -0.02337643876671791, 0.03273206204175949, 0.05125553160905838, 0.011327258311212063, -0.02913663163781166, 0.06620568782091141, 0.008160649798810482, -0.039897263050079346, -0.03559134528040886, 0.001458304701372981 ]
Ethics and Society Newsletter #5: Hugging Face Goes To Washington and Other Summer 2023 Musings
meg
September 29, 2023
ethics-soc-5
ethics
https://huggingface.co/blog/ethics-soc-5
# Ethics and Society Newsletter #5: Hugging Face Goes To Washington and Other Summer 2023 Musings One of the most important things to know about โ€œethicsโ€ in AI is that it has to do with **values**. Ethics doesnโ€™t tell you whatโ€™s right or wrong, it provides a vocabulary of values โ€“ transparency, safety, justice โ€“ and frameworks to prioritize among them. This summer, we were able to take our understanding of values in AI to legislators in the E.U., U.K., and U.S., to help shape the future of AI regulation. This is where ethics shines: helping carve out a path forward when laws are not yet in place. In keeping with Hugging Faceโ€™s core values of *openness* and *accountability*, we are sharing a collection of what weโ€™ve said and done here. This includes our CEO [Clem](https://huggingface.co/clem)โ€™s [testimony to U.S. Congress](https://twitter.com/ClementDelangue/status/1673348676478025730) and [statements at the U.S. Senate AI Insight Forum](https://twitter.com/ClementDelangue/status/1702095553503412732); our advice on the [E.U. AI Act](https://huggingface.co/blog/eu-ai-act-oss); our [comments to the NTIA on AI Accountability](https://huggingface.co/blog/policy-ntia-rfc); and our Chief Ethics Scientist [Meg](https://huggingface.co/meg)โ€™s [comments to the Democratic Caucus](assets/164_ethics-soc-5/meg_dem_caucus.pdf). Common to many of these discussions were questions about why openness in AI can be beneficial, and we share a collection of our answers to this question [here](assets/164_ethics-soc-5/why_open.md). In keeping with our core value of *democratization*, we have also spent a lot of time speaking publicly, and have been privileged to speak with journalists in order to help explain whatโ€™s happening in the world of AI right now. This includes: - Comments from [Sasha](https://huggingface.co/sasha) on **AIโ€™s energy use and carbon emissions** ([The Atlantic](https://www.theatlantic.com/technology/archive/2023/08/ai-carbon-emissions-data-centers/675094/), [The Guardian](https://www.theguardian.com/technology/2023/aug/01/techscape-environment-cost-ai-artificial-intelligence), ([twice](https://www.theguardian.com/technology/2023/jun/08/artificial-intelligence-industry-boom-environment-toll)), [New Scientist](https://www.newscientist.com/article/2381859-shifting-where-data-is-processed-for-ai-can-reduce-environmental-harm/), [The Weather Network](https://www.theweathernetwork.com/en/news/climate/causes/how-energy-intensive-are-ai-apps-like-chatgpt), the [Wall Street Journal](https://www.wsj.com/articles/artificial-intelligence-technology-energy-a3a1a8a7), ([twice](https://www.wsj.com/articles/artificial-intelligence-can-make-companies-greener-but-it-also-guzzles-energy-7c7b678))), as well as penning part of a [Wall Street Journal op-ed on the topic](https://www.wsj.com/articles/artificial-intelligence-technology-energy-a3a1a8a7); thoughts on **AI doomsday risk** ([Bloomberg](https://www.bnnbloomberg.ca/ai-doomsday-scenarios-are-gaining-traction-in-silicon-valley-1.1945116), [The Times](https://www.thetimes.co.uk/article/everything-you-need-to-know-about-ai-but-were-afraid-to-ask-g0q8sq7zv), [Futurism](https://futurism.com/the-byte/ai-expert-were-all-going-to-die), [Sky News](https://www.youtube.com/watch?v=9Auq9mYxFEE)); details on **bias in generative AI** ([Bloomberg](https://www.bloomberg.com/graphics/2023-generative-ai-bias/), [NBC](https://www.nbcnews.com/news/asian-america/tool-reducing-asian-influence-ai-generated-art-rcna89086), [Vox](https://www.vox.com/technology/23738987/racism-ai-automated-bias-discrimination-algorithm)); addressing how **marginalized workers create the data for AI** ([The Globe and Mail](https://www.theglobeandmail.com/business/article-ai-data-gig-workers/), [The Atlantic](https://www.theatlantic.com/technology/archive/2023/07/ai-chatbot-human-evaluator-feedback/674805/)); highlighting effects of **sexism in AI** ([VICE](https://www.vice.com/en/article/g5ywp7/you-know-what-to-do-boys-sexist-app-lets-men-rate-ai-generated-women)); and providing insights in MIT Technology Review on [AI text detection](https://www.technologyreview.com/2023/07/07/1075982/ai-text-detection-tools-are-really-easy-to-fool/), [open model releases](https://www.technologyreview.com/2023/07/18/1076479/metas-latest-ai-model-is-free-for-all/), and [AI transparency](https://www.technologyreview.com/2023/07/25/1076698/its-high-time-for-more-ai-transparency/). - Comments from [Nathan](https://huggingface.co/natolambert) on the state of the art on **language models and open releases** ([WIRED](https://www.wired.com/story/metas-open-source-llama-upsets-the-ai-horse-race/), [VentureBeat](https://venturebeat.com/business/todays-ai-is-not-science-its-alchemy-what-that-means-and-why-that-matters-the-ai-beat/), [Business Insider](https://www.businessinsider.com/chatgpt-openai-moat-in-ai-wars-llama2-shrinking-2023-7), [Fortune](https://fortune.com/2023/07/18/meta-llama-2-ai-open-source-700-million-mau/)). - Comments from [Meg](https://huggingface.co/meg) on **AI and misinformation** ([CNN](https://www.cnn.com/2023/07/17/tech/ai-generated-election-misinformation-social-media/index.html), [al Jazeera](https://www.youtube.com/watch?v=NuLOUzU8P0c), [the New York Times](https://www.nytimes.com/2023/07/18/magazine/wikipedia-ai-chatgpt.html)); the need for **just handling of artistsโ€™ work** in AI ([Washington Post](https://www.washingtonpost.com/technology/2023/07/16/ai-programs-training-lawsuits-fair-use/)); advancements in **generative AI** and their relationship to the greater good ([Washington Post](https://www.washingtonpost.com/technology/2023/09/20/openai-dall-e-image-generator/), [VentureBeat](https://venturebeat.com/ai/generative-ai-secret-sauce-data-scraping-under-attack/)); how **journalists can better shape the evolution of AI** with their reporting ([CJR](https://www.cjr.org/analysis/how-to-report-better-on-artificial-intelligence.php)); as well as explaining the fundamental statistical concept of **perplexity** in AI ([Ars Technica](https://arstechnica.com/information-technology/2023/07/why-ai-detectors-think-the-us-constitution-was-written-by-ai/)); and highlighting patterns of **sexism** ([Fast Company](https://www.fastcompany.com/90952272/chuck-schumer-ai-insight-forum)). - Comments from [Irene](https://huggingface.co/irenesolaiman) on understanding the **regulatory landscape of AI** ([MIT Technology Review](https://www.technologyreview.com/2023/09/11/1079244/what-to-know-congress-ai-insight-forum-meeting/), [Barronโ€™s](https://www.barrons.com/articles/artificial-intelligence-chips-technology-stocks-roundtable-74b256fd)). - Comments from [Yacine](https://huggingface.co/yjernite) on **open source and AI legislation** ([VentureBeat](https://venturebeat.com/ai/hugging-face-github-and-more-unite-to-defend-open-source-in-eu-ai-legislation/), [TIME](https://time.com/6308604/meta-ai-access-open-source/)) as well as **copyright issues** ([VentureBeat](https://venturebeat.com/ai/potential-supreme-court-clash-looms-over-copyright-issues-in-generative-ai-training-data/)). - Comments from [Giada](https://huggingface.co/giadap) on the concepts of **AI โ€œsingularityโ€** ([Popular Mechanics](https://www.popularmechanics.com/technology/security/a43929371/ai-singularity-dangers/)) and **AI โ€œsentienceโ€** ([RFI](https://www.rfi.fr/fr/technologies/20230612-pol%C3%A9mique-l-intelligence-artificielle-ange-ou-d%C3%A9mon), [Radio France](https://www.radiofrance.fr/franceculture/podcasts/le-temps-du-debat/l-intelligence-artificielle-est-elle-un-nouvel-humanisme-9822329)); thoughts on **the perils of artificial romance** ([Analytics India Magazine](https://analyticsindiamag.com/the-perils-of-artificial-romance/)); and explaining **value alignment** ([The Hindu](https://www.thehindu.com/sci-tech/technology/ai-alignment-cant-be-solved-as-openai-says/article67063877.ece)). Some of our talks released this summer include [Giada](https://huggingface.co/giadap)โ€™s [TED presentation on whether โ€œethicalโ€ generative AI is possible](https://youtu.be/NreFQFKahxw?si=49UoQeEw5IyRSRo7) (the automatic English translation subtitles are great!); [Yacine](https://huggingface.co/yjernite)โ€™s presentations on [Ethics in Tech](https://docs.google.com/presentation/d/1viaOjX4M1m0bydZB0DcpW5pSAgK1m1CPPtTZz7zsZnE/) at the [Markkula Center for Applied Ethics](https://www.scu.edu/ethics/focus-areas/technology-ethics/) and [Responsible Openness](https://www.youtube.com/live/75OBTMu5UEc?feature=shared&t=10140) at the [Workshop on Responsible and Open Foundation Models](https://sites.google.com/view/open-foundation-models); [Katie](https://huggingface.co/katielink)โ€™s chat about [generative AI in health](https://www.youtube.com/watch?v=_u-PQyM_mvE); and [Meg](https://huggingface.co/meg)โ€™s presentation for [London Data Week](https://www.turing.ac.uk/events/london-data-week) on [Building Better AI in the Open](https://london.sciencegallery.com/blog/watch-again-building-better-ai-in-the-open). Of course, we have also made progress on our regular work (our โ€œwork workโ€). The fundamental value of *approachability* has emerged across our work, as we've focused on how to shape AI in a way thatโ€™s informed by society and human values, where everyone feels welcome. This includes [a new course on AI audio](https://huggingface.co/learn/audio-course/) from [Maria](https://huggingface.co/MariaK) and others; a resource from [Katie](https://huggingface.co/katielink) on [Open Access clinical language models](https://www.linkedin.com/feed/update/urn:li:activity:7107077224758923266/); a tutorial from [Nazneen](https://huggingface.co/nazneen) and others on [Responsible Generative AI](https://www.youtube.com/watch?v=gn0Z_glYJ90&list=PLXA0IWa3BpHnrfGY39YxPYFvssnwD8awg&index=13&t=1s); our FAccT papers on [The Gradient of Generative AI Release](https://dl.acm.org/doi/10.1145/3593013.3593981) ([video](https://youtu.be/8_-QTw8ugas?si=RG-NO1v3SaAMgMRQ)) and [Articulation of Ethical Charters, Legal Tools, and Technical Documentation in ML](https://dl.acm.org/doi/10.1145/3593013.3594002) ([video](https://youtu.be/ild63NtxTpI?si=jPlIBAL6WLtTHUwt)); as well as workshops on [Mapping the Risk Surface of Text-to-Image AI with a participatory, cross-disciplinary approach](https://avidml.org/events/tti2023/) and [Assessing the Impacts of Generative AI Systems Across Modalities and Society](https://facctconference.org/2023/acceptedcraft#modal) ([video](https://youtu.be/yJMlK7PSHyI?si=UKDkTFEIQ_rIbqhd)). We have also moved forward with our goals of *fairness* and *justice* with [bias and harm testing](https://huggingface.co/HuggingFaceM4/idefics-80b-instruct#bias-risks-and-limitations), recently applied to the new Hugging Face multimodal model [IDEFICS](https://huggingface.co/HuggingFaceM4/idefics-80b-instruct). We've worked on how to operationalize *transparency* responsibly, including [updating our Content Policy](https://huggingface.co/blog/content-guidelines-update) (spearheaded by [Giada](https://huggingface.co/giadap)). We've advanced our support of language *diversity* on the Hub by [using machine learning to improve metadata](https://huggingface.co/blog/huggy-lingo) (spearheaded by [Daniel](https://huggingface.co/davanstrien)), and our support of *rigour* in AI by [adding more descriptive statistics to datasets](https://twitter.com/polinaeterna/status/1707447966355563000) (spearheaded by [Polina](https://huggingface.co/polinaeterna)) to foster a better understanding of what AI learns and how it can be evaluated. Drawing from our experiences this past season, we now provide a collection of many of the resources at Hugging Face that are particularly useful in current AI ethics discourse right now, available here: [https://huggingface.co/society-ethics](https://huggingface.co/society-ethics). Finally, we have been surprised and delighted by public recognition for many of the society & ethics regulars, including both [Irene](https://www.technologyreview.com/innovator/irene-solaiman/) and [Sasha](https://www.technologyreview.com/innovator/sasha-luccioni/) being selected in [MITโ€™s 35 Innovators under 35](https://www.technologyreview.com/innovators-under-35/artificial-intelligence-2023/) (Hugging Face makes up ยผ of the AI 35 under 35!); [Meg](https://huggingface.co/meg) being included in lists of influential AI innovators ([WIRED](https://www.wired.com/story/meet-the-humans-trying-to-keep-us-safe-from-ai/), [Fortune](https://fortune.com/2023/06/13/meet-top-ai-innovators-impact-on-business-society-chatgpt-deepmind-stability/)); and [Meg](https://huggingface.co/meg) and [Clem](https://huggingface.co/clem)โ€™s selection in [TIMEโ€™s 100 under 100 in AI](https://time.com/collection/time100-ai/). We are also very sad to say goodbye to our colleague [Nathan](https://huggingface.co/natolambert), who has been instrumental in our work connecting ethics to reinforcement learning for AI systems. As his parting gift, he has provided further details on the [challenges of operationalizing ethical AI in RLHF](https://www.interconnects.ai/p/operationalizing-responsible-rlhf). Thank you for reading! \-\- Meg, on behalf of the [Ethics & Society regulars](https://huggingface.co/spaces/society-ethics/about) at Hugging Face
[ 0.03130336478352547, -0.05552268400788307, 0.005767383147031069, 0.02747683972120285, -0.025312671437859535, 0.03157953545451164, 0.045584917068481445, 0.043193552643060684, -0.06692203134298325, -0.06329389661550522, -0.12162578850984573, 0.017806414514780045, -0.055851049721241, 0.08851460367441177, -0.026314150542020798, -0.05341421812772751, 0.08944733440876007, 0.0236396212130785, 0.042890582233667374, -0.006224814802408218, -0.03171878680586815, -0.02004692517220974, 0.029944323003292084, -0.046703487634658813, -0.01502818614244461, -0.08690958470106125, 0.002608593087643385, 0.0032392721623182297, -0.023185143247246742, 0.0605572909116745, -0.11066633462905884, -0.02140110731124878, -0.07478637993335724, 0.027493853121995926, 0.02483910508453846, -0.011500370688736439, -0.13797003030776978, 0.06505393236875534, 0.023574385792016983, 0.10081473737955093, 0.021623117849230766, -0.07544256001710892, -0.06792111694812775, -0.011509967036545277, -0.015738993883132935, -0.03137890622019768, -0.10948608815670013, 0.050667621195316315, -0.009727341122925282, -0.01882399432361126, -0.06454640626907349, 0.016337579116225243, -0.029281504452228546, 0.007295574527233839, 0.04568558186292648, -0.0075905947014689445, 0.025569675490260124, -0.06844589859247208, -0.017869742587208748, -0.061103690415620804, 0.025564108043909073, -0.037091854959726334, 0.05250123143196106, 0.0011920962715521455, 0.06021059304475784, 0.021196337416768074, 0.005149862729012966, -0.04210095852613449, -0.07052679359912872, 0.011915496550500393, 0.01403757929801941, -0.02014421671628952, -0.05820778012275696, 0.01569671928882599, 0.0016161496751010418, -0.0037746408488601446, -0.08677515387535095, 0.03741269186139107, 0.08745444566011429, 0.011004360392689705, -0.015562199987471104, -0.053012389689683914, 0.05137059837579727, 0.05158942937850952, 0.0032130719628185034, 0.005372370593249798, -0.018405301496386528, -0.014949755743145943, -0.01108744740486145, 0.04449284449219704, -0.012250607833266258, -0.08769091218709946, 0.03454442694783211, 0.017557470127940178, 0.06220792979001999, -0.05433809012174606, -0.030415061861276627, -0.05580436438322067, -0.01954561099410057, -0.01686996966600418, 0.007529368158429861, 0.021596506237983704, 0.03706315904855728, -0.06327225267887115, -0.10062461346387863, 0.08323100209236145, 0.024669334292411804, -0.059065647423267365, 0.027408573776483536, 0.007277689874172211, 0.009974968619644642, 0.032068222761154175, 0.0069487434811890125, -0.017102329060435295, -0.08595743030309677, 0.08154457062482834, -0.06023251265287399, -0.08102265000343323, 0.02014186978340149, 0.051307618618011475, 0.03850327432155609, -0.003372001461684704, 0.032615579664707184, -0.02311289869248867, 0.028579343110322952, 0.025295032188296318, -0.005297557450830936, -0.011384413577616215, 0.03759153187274933, -0.0455557219684124, 0.001929844031110406, 0.004403023049235344, -0.02926906757056713, 0.009433193132281303, -0.017668964341282845, -0.03880619257688522, 0.0345156267285347, -0.046568818390369415, 0.04464225098490715, -0.03840560466051102, 0.0033861142583191395, -0.019968098029494286, 0.0342438668012619, -0.031438786536455154, 0.05673949047923088, 0.034773584455251694, -0.11156260222196579, 0.03703685849905014, -0.0346912257373333, 0.008795182220637798, -0.024251148104667664, 0.05533432960510254, 0.002881067106500268, -0.04318498820066452, 0.039971258491277695, 0.005397830158472061, -0.005192184820771217, 0.010147254914045334, -0.04952101781964302, 0.013850551098585129, -0.015000514686107635, -0.04689857363700867, -0.007360732648521662, -0.02427687682211399, 0.0666130930185318, -0.016264762729406357, -0.017708122730255127, 0.0012451069196686149, -0.026115432381629944, 0.023754050955176353, 0.014802463352680206, 0.013926227577030659, 0.09094484895467758, -0.11325618624687195, 0.03461116924881935, 0.06956645101308823, -0.011136578395962715, -0.014239254407584667, 0.004263032227754593, 0.016924826428294182, -0.07942647486925125, 0.045759204775094986, -0.0028878585435450077, 0.028235722333192825, 0.052547261118888855, -0.04077830910682678, 0.027195146307349205, -0.03108864836394787, -0.0014846693957224488, 0.06338942795991898, -0.06436025351285934, -0.008375583216547966, 0.07683230936527252, -0.030282964929938316, 0.03462965786457062, 0.011677246540784836, -0.0012222647201269865, 0.10982730984687805, -0.005404171533882618, 0.08566460013389587, 0.005666465498507023, 0.006110984832048416, -0.010624242946505547, -0.0007360881427302957, 0.036735523492097855, 0.05926612392067909, 0.09745538234710693, -0.06361639499664307, -0.015142370946705341, 0.04494187980890274, -0.010498963296413422, -0.053840525448322296, 0.0442492812871933, 0.05469469353556633, 0.012668510898947716, -0.02245616726577282, 0.014076532796025276, 0.019349027425050735, -0.03591427952051163, -0.0068802903406322, 0.09335362911224365, -0.01925499178469181, 0.06843680143356323, 0.0850185826420784, 0.005638942588120699, 0.05051179230213165, 0.04681621119379997, 0.09543296694755554, 0.05438823997974396, -0.07779164612293243, 0.0214683935046196, 0.01748601533472538, -0.062287770211696625, -0.05679410323500633, 0.018689876422286034, -0.03018956445157528, 0.061286840587854385, -0.02864515408873558, 0.019220128655433655, -0.006732932757586241, -0.0021525390911847353, -0.0184494461864233, 0.0839199349284172, 0.07064391672611237, -0.03370829299092293, -0.05071083828806877, 0.07487202435731888, 0.047019973397254944, -0.0943949967622757, 0.03152182698249817, -0.07609307765960693, 0.08574464172124863, 0.028643595054745674, 0.0022271110210567713, -0.01171872764825821, 0.05250225216150284, 0.002473889384418726, 0.02874949388206005, -0.05649680644273758, 0.05384077504277229, -0.008954047225415707, -0.01837804727256298, -0.021470073610544205, -0.045202139765024185, -0.018915599212050438, 0.012511580251157284, -0.0342596098780632, 0.040906041860580444, -0.004116314463317394, 0.04610643535852432, 0.04643436148762703, -0.03172079101204872, 0.005391515325754881, 0.0048729171976447105, -0.020264945924282074, 0.012819275259971619, 0.04022292420268059, 0.027240581810474396, -0.017359880730509758, -0.04952847212553024, -0.03518419712781906, 0.0025694705545902252, 0.018216919153928757, 0.05937150865793228, -0.02389669045805931, 0.009965683333575726, 0.03840029984712601, -0.010520149022340775, -0.014001590199768543, 0.04332900419831276, 0.005164040718227625, -0.017171695828437805, -0.0033140676096081734, -0.02643641270697117, 0.025283467024564743, 0.015334534458816051, 0.02901524305343628, -0.03849729895591736, 0.002802296308800578, 0.00462878355756402, -0.01084826234728098, -0.010016298852860928, -0.039756689220666885, 0.03159303218126297, 0.03655066341161728, -0.00040492936386726797, -0.0332883857190609, 0.0280128326267004, -0.09611581265926361, -0.021082865074276924, 0.027216631919145584, 0.07722531259059906, -0.05521771311759949, 0.009711192920804024, 0.034554947167634964, -0.023055262863636017, 0.004446801263839006, -0.007947818376123905, 0.019050560891628265, 0.04122442752122879, -0.02981521189212799, 0.03004702925682068, -0.026992641389369965, -0.05500972643494606, 0.0057482910342514515, -0.0288462582975626, 0.029057398438453674, 0.04607854038476944, -0.005289868917316198, 0.02367870882153511, 0.0011045363498851657, 0.004420298617333174, -0.004769900813698769, -0.02589094638824463, 0.043488793075084686, 0.025405986234545708, 0.027039028704166412, -0.035775307565927505, -0.010118096135556698, 0.03551630303263664, -0.037631090730428696, -0.0073740435764193535, -0.00767643004655838, -0.008846696466207504, 0.028323423117399216, -0.007865008898079395, 0.008899989537894726, 0.02001279778778553, -0.008750059641897678, -0.023902516812086105, 0.03032008558511734, 0.030766824260354042, 0.02458769641816616, 0.023494381457567215, -0.02187044359743595, -0.014948312193155289, 0.021331652998924255, -0.0202585868537426, 0.006859111599624157, -0.01369605865329504, -0.005267287138849497, 0.04610559716820717, 0.026514366269111633, 0.035992544144392014, -0.012036256492137909, 0.026847928762435913, -0.013847274705767632, -0.04477027431130409, -0.03413279727101326, 0.01949414797127247, -0.022694304585456848, 0.0028023074846714735, -0.007868815213441849, 0.0035605691373348236, 0.01128532737493515, 0.0011356309987604618, -0.012793825939297676, 0.020629966631531715, -0.02213538996875286, 0.004470843356102705, -0.03585246950387955, 0.0025418454315513372, -0.037255074828863144, -0.005006341263651848, -0.018410049378871918, -0.020937994122505188, 0.024140087887644768, 0.0042798868380486965, -0.03311789780855179, -0.02804878167808056, -0.015646809712052345, 0.007285077590495348, 0.015403459779918194, -0.04241183027625084, 0.04794227331876755, 0.030437525361776352, 0.010466325096786022, 0.032901935279369354, -0.013190856203436852, -0.04046618565917015, 0.02706911601126194, -0.03450331464409828, 0.009622958488762379, 0.03481728583574295, 0.020787503570318222, 0.02423401176929474, 0.02038135752081871, 0.02718501351773739, 0.005536737851798534, -0.04976843670010567, -0.014956720173358917, -0.05730852484703064, 0.008452401496469975, 0.011688679456710815, 0.004554092418402433, -0.027971765026450157, 0.01930275186896324, 0.01893785409629345, -0.04917639493942261, -0.0029418207705020905, -0.01280944049358368, -0.022440262138843536, 0.05836609750986099, 0.005917747970670462, -0.006764834281057119, 0.026857277378439903, -0.02820175513625145, 0.0004464366065803915, -0.00022622999676968902, -0.006117870565503836, -0.02198936603963375, 0.017559677362442017, 0.05452246591448784, -0.05216209590435028, -0.0518161915242672, -0.037445202469825745, -0.008628499694168568, -0.02876211889088154, 0.005268210079520941, -0.011747323907911777, 0.040043946355581284, -0.04060576856136322, 0.01234216894954443, 0.02750230021774769, -0.00819802563637495, 0.021236274391412735, -0.00040158702176995575, -0.023924939334392548, 0.008073858916759491, -0.012375826016068459, 0.009828290902078152, -0.0468207411468029, -0.04082125052809715, -0.002522257389500737, -0.06748148798942566, 0.009321252815425396, -0.0008445666753686965, -0.000973266432993114, 0.040677741169929504, -0.011769426986575127, -0.022337468340992928, 0.0037489081732928753, 0.06358585506677628, -0.02248670719563961, 0.019580919295549393, 0.05059820041060448, 0.018716970458626747, 0.013256155885756016, -0.024362944066524506, 0.047236841171979904, -0.050333306193351746, -0.004127511288970709, 0.038790151476860046, 0.00717146834358573, 0.01577344350516796, -0.04997537285089493, -0.029021672904491425, 0.017613455653190613, 0.011251538060605526, 0.05648089200258255, 0.009858033619821072, -0.03708384558558464, -0.009822285734117031, 0.007418151944875717, 0.021359248086810112, 0.037450846284627914, -0.013480822555720806, 0.02689279243350029, -0.010154632851481438, 0.022950757294893265, 0.016760198399424553, -0.014968642964959145, 0.041414499282836914, 0.02973949909210205, 0.04451177269220352, 0.07584568858146667, 0.0014571392675861716, -0.011565286666154861, 0.0023818148765712976, 0.02941475249826908, -0.01563354954123497, -0.01450447179377079, 0.0002398945507593453, 0.005891288165003061, 0.001868032501079142, -0.01857263781130314, 0.005661653820425272, 0.01787559501826763, -0.014098474755883217, 0.04415636882185936, -0.025620335713028908, 0.005641623865813017, 0.009034113958477974, -0.05139355733990669, -0.025444146245718002, 0.0010094349272549152, 0.03651601821184158, -0.0021705671679228544, 0.010968991555273533, -0.0267839003354311, 0.01362055167555809, -0.07992993295192719, 0.013211457058787346, -0.021413665264844894, -0.023245811462402344, 0.05775070935487747, -0.023095637559890747, 0.07317811995744705, 0.009399188682436943, 0.012648205272853374, -0.008808239363133907, -0.03715505450963974, 0.01629755087196827, -0.044091105461120605, -0.021979287266731262, 0.003823666600510478, 0.02691243775188923, 0.03273903578519821, 0.03164564445614815, -0.001676643267273903, 0.0046908739022910595, 0.05289969965815544, 0.0031251637265086174, -0.02673213556408882, -0.05349338427186012, 0.057340096682310104, 0.0030219005420804024, -0.048695310950279236, 0.005807756446301937, 0.007021424360573292, -0.052109237760305405, -0.002377320546656847, -0.0477336086332798, 0.011827045120298862, 0.05774528905749321, -0.013496794737875462, -0.02517230622470379, 0.02124006487429142, 0.02069132588803768, 0.04005710780620575, -0.016003582626581192, 0.056027851998806, 0.02207423560321331, -0.00977385975420475, 0.00374048063531518, 0.038324419409036636, 0.003598349867388606, -0.025448769330978394, 0.014146313071250916, -0.05555684491991997, -0.026219116523861885, 0.007828855887055397, -0.05266200378537178, 0.007965612225234509, 0.019015084952116013, -0.030100606381893158, 0.021147195249795914, -0.011571214534342289, 0.014655579812824726, 0.00715300627052784, 0.033781133592128754, -0.047215428203344345, -0.04010670259594917, -0.014959165826439857, 0.003979875240474939, 0.08262410014867783, -0.03895599767565727, -0.009470253251492977, 0.03253907337784767, 0.007743699010461569, 0.05752941593527794, 0.014963109977543354, -0.013717236928641796, -0.05316995829343796, 0.04434821754693985, 0.014284667558968067, 0.029642272740602493, -0.05415010452270508, -0.059241216629743576, -0.020668521523475647, 0.012301401235163212, -0.027949925512075424, 0.004902713932096958, -0.02380838617682457, -0.004644621163606644, -0.03030397556722164, 0.047923725098371506, -0.014940598048269749, 0.06001881882548332, 0.02048325538635254, -0.016828125342726707, 0.007905556820333004, -0.004589136689901352, 0.03163378685712814, -0.0029186697211116552, -0.04165525361895561, 0.03986994922161102, 0.0009060359443537891, 0.011970387771725655, 0.018617479130625725, 0.040122829377651215, 0.02798263356089592, 0.004743225872516632, 0.00465360889211297, 0.014358889311552048, -0.030517766252160072, -0.0013020181795582175, -0.006268889643251896, -0.009461567737162113, 0.021062465384602547, 0.003136990824714303, 0.004251914564520121, 0.008595426566898823, -0.013583865016698837, 0.010416521690785885, 0.07472621649503708, 0.055528346449136734, -0.0024966581258922815, -0.046543095260858536, 0.06172499805688858, -0.026592982932925224, 0.004565465729683638, 0.049445971846580505, 0.005845524836331606, -0.007393629755824804, -0.01619456335902214, -0.02980886958539486, -0.0282368753105402, 0.018636221066117287, -0.018038015812635422, 0.0009831328643485904, 0.028758004307746887, -0.01169691514223814, -0.05204969272017479, 0.008480273187160492, 0.028604039922356606, 0.03966217488050461, 0.025967290624976158, 0.0023671083617955446, -0.011024744249880314, -0.0009116290020756423, -0.00789196603000164, 0.02387865073978901, -0.021162452176213264, -0.07139405608177185, -0.06562257558107376, 0.030883055180311203, -0.026166830211877823, 0.01735544204711914, 0.019523154944181442, 0.030077345669269562, 0.009562710300087929, -0.021834511309862137, 0.006101868115365505, -0.01275805477052927, 0.0061499327421188354, -0.007027972489595413, -0.0018335016211494803, -0.029210280627012253, -0.008689957670867443, 0.004608620423823595, -0.010278059169650078, -0.0013782192254438996, -0.017572397366166115, 0.03546721860766411, -0.03015863336622715, -0.025335537269711494, 0.03328219801187515, 0.043490201234817505, 0.02117832936346531, 0.04352293908596039, 0.024796156212687492, 0.001686282572336495, 0.005505396984517574, -0.06682871282100677, 0.03485242649912834, -0.017321394756436348, 0.032938845455646515, -0.021396569907665253, 0.0024283481761813164, -0.02017883025109768, -0.0009312030742876232, -0.01519900094717741, -0.0077768247574567795, -0.049331631511449814, 0.0090819476172328, 0.016308052465319633, 0.008187132887542248, -0.0223221592605114, -0.01828322559595108, 0.01921262964606285, 0.01539427787065506, -0.027806514874100685, 0.004774747882038355, -0.004851719364523888, -0.0005409921868704259, 0.013372678309679031, -0.008402582257986069, 0.008955174125730991, -0.01665293052792549, 0.01021036971360445, 0.02317744679749012, -0.00477938586845994, 0.03031305782496929, 0.00020414525351952761, 0.03191925585269928, 0.038257092237472534, 0.02967316471040249, -0.018905529752373695, 0.020144661888480186, 0.003143556881695986, 0.0034701379481703043, 0.0055250562727451324, -0.024287283420562744, 0.013781832531094551, 0.0012958054430782795, 0.008207676000893116, -0.041258566081523895, 0.03922323137521744, -0.019061844795942307, 0.035344675183296204, 0.04578026756644249, 0.018754368647933006, 0.006920559797435999, -0.026314062997698784, 0.00892101414501667, 0.03704836219549179, -0.002613134915009141, -0.04996656998991966, -0.027199557051062584, 0.014181175269186497, -0.008955305442214012, -0.003920808434486389, -0.02285298891365528, 0.022342000156641006, -0.019934099167585373, -0.02800118550658226, -0.016139362007379532, -0.009593556635081768, 0.025857752189040184, -0.0012669458519667387, -0.04760368540883064, -0.015553080476820469, 0.0010086935944855213, 0.0480000264942646, -0.011670375242829323, -0.016412587836384773, 0.008612803183495998 ]
Deploying the AI Comic Factory using the Inference API
jbilcke-hf
October 2, 2023
ai-comic-factory
guide, inference, api, llm, stable-diffusion
https://huggingface.co/blog/ai-comic-factory
Selecting the LLM and SD engines The AI Comic Factory supports various backend engines, which can be configured using two environment variables: - LLM_ENGINE to configure the language model (possible values are INFERENCE_API, INFERENCE_ENDPOINT, OPENAI) - RENDERING_ENGINE to configure the image generation engine (possible values are INFERENCE_API, INFERENCE_ENDPOINT, REPLICATE, VIDEOCHAIN). We'll focus on making the AI Comic Factory work on the Inference API, so they both need to be set to INFERENCE_API: You can find more information about alternative engines and vendors in the project's README and the .env config file.
[ 0.07084216922521591, -0.003548846347257495, 0.0032218806445598602, 0.038490522652864456, 0.020285727456212044, 0.06962589174509048, -0.01015504077076912, 0.04371608793735504, 0.029890581965446472, -0.04393768310546875, -0.03129163756966591, 0.027383754029870033, -0.026240520179271698, 0.07834603637456894, 0.023405561223626137, -0.03589213266968727, -0.08360310643911362, 0.035272423177957535, -0.010701389983296394, 0.06354300677776337, 0.06622777134180069, -0.04826762154698372, 0.035057034343481064, -0.0037542888894677162, -0.033025726675987244, -0.058704134076833725, -0.06638799607753754, 0.031011588871479034, -0.037513475865125656, -0.018321210518479347, 0.005377328954637051, -0.04394844174385071, -0.039495110511779785, 0.049421366304159164, 0.03262442722916603, -0.0019740948919206858, -0.12927472591400146, -0.003126057330518961, -0.013056347146630287, -0.01803692616522312, 0.034511223435401917, -0.006167486775666475, -0.07244078814983368, 0.019901471212506294, 0.03426755592226982, 0.01038802694529295, -0.041896190494298935, 0.05950482189655304, -0.03339331969618797, 0.042363882064819336, -0.05705578625202179, 0.08358588814735413, 0.006990959867835045, -0.02750537544488907, 0.06132287532091141, 0.04482259601354599, -0.006854500155895948, -0.0040613883174955845, 0.000008146746949933004, 0.08059051632881165, -0.011701167561113834, 0.0029291396494954824, 0.016748899593949318, -0.010855786502361298, 0.08057882636785507, -0.01602170802652836, -0.04845177009701729, -0.028507845476269722, -0.013186194002628326, -0.06971662491559982, 0.02378883771598339, 0.04993026703596115, -0.02631392329931259, -0.026748202741146088, 0.020947692915797234, -0.054879944771528244, -0.019020166248083115, 0.10095462203025818, -0.022592920809984207, -0.0033305808901786804, -0.07727603614330292, 0.048099763691425323, 0.042249228805303574, 0.025929685682058334, -0.030233949422836304, 0.02614911086857319, 0.0427362397313118, -0.04130587726831436, -0.044682539999485016, -0.05375095084309578, -0.039404019713401794, -0.0908394530415535, -0.02474764734506607, 0.018840555101633072, 0.02796306647360325, -0.0006246140110306442, 0.03713647648692131, 0.0350104384124279, -0.02446456253528595, -0.008696620352566242, 0.006758715957403183, 0.0016893877182155848, -0.05067240446805954, -0.03795194998383522, -0.06602364033460617, 0.02060028724372387, 0.033518336713314056, -0.05965745821595192, -0.07761012017726898, 0.008468140847980976, 0.0222784411162138, -0.048728179186582565, 0.05474897474050522, 0.022453365847468376, -0.0843241736292839, -0.012919732369482517, -0.03374193236231804, -0.0573766864836216, -0.030951397493481636, 0.041514284908771515, 0.023753223940730095, 0.026468511670827866, 0.07088518887758255, -0.04400045797228813, 0.0006185853271745145, 0.03593193367123604, -0.02512565813958645, 0.057292334735393524, -0.014103133231401443, -0.05396328121423721, 0.07854567468166351, -0.05555937439203262, 0.044130418449640274, -0.0036896388046443462, 0.024106599390506744, -0.05258634686470032, -0.0733618289232254, -0.011303536593914032, 0.030557038262486458, 0.0006463543395511806, -0.02729584462940693, -0.013853144831955433, 0.04914417117834091, -0.011678884737193584, 0.08531942963600159, 0.030210934579372406, 0.042768694460392, -0.009669625200331211, -0.04659758880734444, -0.007363706361502409, -0.044281039386987686, 0.03605714067816734, -0.019700851291418076, -0.02227902039885521, 0.0023593930527567863, 0.03092367760837078, -0.003761522239074111, 0.05229555070400238, -0.08126439154148102, -0.004117404110729694, 0.025003738701343536, -0.03190011903643608, -0.11365741491317749, 0.03302912041544914, 0.002025454305112362, -0.07919362932443619, -0.05641777440905571, 0.08199940621852875, -0.007176531013101339, -0.0009144071373157203, -0.041087668389081955, -0.018113549798727036, 0.07025640457868576, -0.04912981763482094, 0.13884836435317993, 0.023735687136650085, 0.041282203048467636, 0.07910536974668503, 0.03411494195461273, 0.04189201071858406, -0.06766518950462341, 0.043046556413173676, -0.006384779699146748, -0.004023486748337746, 0.026363413780927658, -0.09108103066682816, 0.07685412466526031, -0.10952893644571304, -0.0354049988090992, -0.00007044454105198383, -0.028370054438710213, 0.04578561708331108, 0.045993197709321976, -0.0004384883213788271, 0.04859713464975357, -0.010971886105835438, -0.0451914519071579, 0.06813319027423859, 0.09772162139415741, 0.06683985143899918, 0.02282656542956829, -0.011341551318764687, 0.040013257414102554, 0.036416973918676376, 0.028382224962115288, 0.053787462413311005, 0.0582771822810173, 0.01991560310125351, 0.04624107852578163, 0.07611080259084702, 0.07106543332338333, -0.11350807547569275, 0.03787907958030701, -0.0567561537027359, -0.019819019362330437, -0.01942392811179161, -0.05631011351943016, -0.09293028712272644, 0.03885937109589577, -0.011655564419925213, 0.09254167973995209, -0.06108172610402107, 0.016209246590733528, -0.09419932216405869, -0.016371559351682663, 0.068344347178936, 0.05647600069642067, 0.04844844341278076, 0.009371939115226269, -0.0894884467124939, 0.002440841868519783, -0.023943614214658737, -0.012561406940221786, 0.020747950300574303, -0.059854958206415176, 0.014845175668597221, 0.013052692636847496, 0.03551920875906944, 0.04441199079155922, 0.0059997946955263615, 0.015230164863169193, 0.049909718334674835, -0.04892900213599205, 0.02457886002957821, 0.02943677268922329, -0.004432092420756817, 0.03383158892393112, -0.030416857451200485, -0.07397471368312836, 0.02483254484832287, -0.01734800450503826, -0.04314552620053291, 0.013835071586072445, 0.0066459765657782555, 0.025626037269830704, -0.011200773529708385, -0.023303555324673653, 0.005803827662020922, -0.0022398538421839476, 0.017110848799347878, -0.017867188900709152, -0.008534938097000122, -0.01494061853736639, -0.025259852409362793, 0.062109727412462234, -0.016818543896079063, 0.006818481720983982, -0.027246586978435516, -0.03271360322833061, 0.00357131939381361, 0.03636915609240532, 0.03273763135075569, 0.016723038628697395, 0.008362908847630024, 0.004550393670797348, 0.06006954237818718, 0.0675826221704483, 0.0017394974129274487, -0.02803783304989338, -0.04812207445502281, 0.0247503649443388, -0.0008818275528028607, 0.0003297175280749798, 0.021023984998464584, -0.05261111631989479, -0.036168456077575684, -0.055491454899311066, -0.033356811851263046, -0.040356382727622986, -0.009190814569592476, 0.031376954168081284, 0.007155424449592829, -0.03219679370522499, 0.024549443274736404, -0.011772654950618744, -0.016398979350924492, 0.022800875827670097, -0.011160111986100674, -0.0111393416300416, -0.013623255304992199, -0.007514347322285175, -0.025646574795246124, 0.0081130750477314, 0.016122007742524147, 0.018249904736876488, 0.029269065707921982, -0.011286403983831406, -0.014076909981667995, -0.0686030164361, -0.03592533990740776, 0.016927344724535942, -0.028463367372751236, 0.013137365691363811, 0.0010093834716826677, 0.044962212443351746, -0.006855440326035023, 0.030638376250863075, 0.05518372729420662, -0.06811124831438065, -0.0035125762224197388, 0.041838400065898895, -0.008068650960922241, 0.0039004734717309475, -0.07451760768890381, -0.013381538912653923, -0.018252605572342873, -0.010824449360370636, -0.02007148787379265, -0.05196980759501457, 0.008848187513649464, -0.027160491794347763, 0.014981822110712528, 0.03857456147670746, 0.006391608156263828, 0.034240685403347015, -0.02742103859782219, -0.0019663560669869184, -0.02355836145579815, 0.009444831870496273, 0.008965807035565376, -0.0008290862897410989, -0.024083392694592476, -0.05587419494986534, 0.013743038289248943, 0.03456222265958786, 0.015998192131519318, 0.0354820191860199, 0.04714205116033554, 0.005307726562023163, -0.00513291684910655, 0.06223388761281967, -0.014034761115908623, 0.008070407435297966, 0.0011221158783882856, -0.03233226761221886, 0.004513525869697332, 0.001369700999930501, -0.023721937090158463, -0.0016973543679341674, -0.003882637247443199, -0.029816221445798874, -0.00018560528405942023, 0.02720295451581478, -0.011416815221309662, 0.036905668675899506, 0.029423242434859276, 0.025785192847251892, -0.05005535110831261, -0.06510527431964874, -0.008835827931761742, -0.040041062980890274, 0.023807233199477196, -0.03368641808629036, 0.051003698259592056, 0.024022024124860764, -0.04090239480137825, -0.006938650272786617, 0.04664826765656471, 0.02301359735429287, 0.06492289155721664, 0.01159976702183485, 0.0009183649672195315, -0.0026226092595607042, 0.018382947891950607, -0.04062685742974281, -0.029726410284638405, 0.04741741716861725, 0.027905667200684547, 0.006487670820206404, -0.004498487338423729, -0.03049497678875923, -0.011619740165770054, 0.03842291235923767, 0.0063689835369586945, -0.0008494185167364776, -0.052556607872247696, 0.02435506135225296, 0.032726991921663284, -0.00966013316065073, -0.05371573567390442, 0.031039437279105186, 0.01980265974998474, 0.0081912437453866, -0.011246729642152786, 0.0032531595788896084, 0.017440292984247208, -0.0027494619134813547, 0.014311580918729305, -0.014293840155005455, -0.024396449327468872, -0.042181938886642456, -0.016966477036476135, -0.0491890050470829, 0.0052682762034237385, 0.008797993883490562, -0.013608722947537899, 0.010577347129583359, -0.01734493300318718, -0.02043554186820984, -0.00862108264118433, 0.04225567355751991, -0.0018380010733380914, 0.02165093645453453, 0.06573805958032608, 0.025183087214827538, 0.018382754176855087, 0.007629530970007181, -0.0014586062170565128, -0.03774149715900421, 0.001999376807361841, 0.01257073413580656, -0.04028187319636345, 0.06960467994213104, -0.005493475589901209, -0.021212980151176453, 0.02037760242819786, 0.008010963909327984, -0.0006081901956349611, -0.07462504506111145, -0.009939425624907017, 0.06697537004947662, -0.0027109761722385883, 0.02108573727309704, -0.00035479990765452385, -0.06995698809623718, 0.029608428478240967, 0.018115714192390442, 0.0007945452816784382, 0.012191073037683964, 0.021860577166080475, 0.016430040821433067, 0.007944418117403984, 0.004635743796825409, 0.0236362274736166, 0.04201279208064079, 0.016163425520062447, -0.008062316104769707, 0.016863543540239334, 0.02573245018720627, 0.0002548948395997286, 0.008924290537834167, -0.02078581415116787, 0.04592754691839218, 0.006617404520511627, -0.02114640735089779, -0.003070995444431901, 0.0053455885499715805, 0.0413060337305069, 0.019979553297162056, 0.016913793981075287, -0.0024574007838964462, 0.019011178985238075, 0.04346596077084541, 0.03833223879337311, 0.027861954644322395, -0.04901266098022461, -0.0173207838088274, -0.024689599871635437, -0.02103007771074772, 0.0174164567142725, -0.03492065146565437, -0.010807513259351254, 0.010019315406680107, 0.02679489366710186, 0.06190120801329613, -0.006160687189549208, -0.024834785610437393, -0.06004445627331734, -0.012331705540418625, -0.05896107479929924, 0.04002869501709938, -0.011441742070019245, -0.008699094876646996, 0.032153356820344925, 0.04215776547789574, 0.03532281890511513, -0.0011457764776423573, 0.006050622556358576, 0.017765270546078682, 0.018075553700327873, -0.00013678826508112252, -0.013253841549158096, -0.002013117540627718, -0.005824143998324871, 0.0014257322764024138, 0.013188701122999191, 0.02957833930850029, -0.011188280768692493, 0.0010689484188333154, 0.053036414086818695, -0.027694467455148697, -0.04902106150984764, -0.0045385416597127914, -0.03563542664051056, 0.049606408923864365, 0.006261418107897043, 0.026329630985856056, 0.012736134231090546, -0.007327117025852203, -0.041773390024900436, -0.023883357644081116, -0.005450148601084948, 0.004068276844918728, -0.04967416822910309, -0.027204276993870735, 0.013039256446063519, 0.033974021673202515, 0.05536289140582085, -0.0053514400497078896, -0.07438494265079498, 0.003379796165972948, 0.007883374579250813, 0.010966266505420208, -0.025847630575299263, -0.02487492375075817, -0.007045873440802097, -0.01951543241739273, -0.021347133442759514, 0.019614428281784058, -0.040564656257629395, 0.02881678380072117, 0.0323122963309288, -0.013836036436259747, 0.017140619456768036, -0.03019174188375473, 0.024224119260907173, 0.019526399672031403, -0.015688447281718254, -0.03199504688382149, -0.02892465889453888, -0.03322479501366615, -0.017130354419350624, 0.009941182099282742, 0.04223956540226936, -0.003860226832330227, -0.015374911949038506, 0.0002428885200060904, 0.04133109375834465, 0.01151092816144228, 0.02170289121568203, 0.04083682969212532, -0.019318461418151855, 0.012472017668187618, 0.034124117344617844, 0.03387131914496422, -0.0016007093945518136, -0.03021458350121975, -0.0003035607805941254, -0.021101882681250572, -0.0037807126063853502, -0.004255740903317928, 0.002359847305342555, -0.0633556917309761, -0.01680922880768776, 0.02502073533833027, -0.02900025248527527, -0.009060556069016457, -0.014401107095181942, -0.008344714529812336, -0.04500579088926315, 0.015844054520130157, -0.023974578827619553, 0.02069331519305706, -0.03474746644496918, -0.019365999847650528, 0.013064061291515827, -0.017382506281137466, -0.01538869645446539, 0.0006819221307523549, 0.058272771537303925, 0.05593474209308624, -0.012260593473911285, 0.02439533732831478, -0.011723424308001995, 0.0620858334004879, 0.03690015524625778, -0.006776947528123856, 0.0365435853600502, -0.029881441965699196, -0.005343073047697544, 0.023967234417796135, 0.035210248082876205, -0.05721617490053177, -0.028543606400489807, 0.02467537485063076, 0.002752099884673953, -0.004514995031058788, -0.058144859969615936, 0.06025088205933571, 0.003575074952095747, -0.0025391452945768833, 0.00921779964119196, 0.0011638868600130081, -0.006007631774991751, -0.04414425417780876, -0.007003361359238625, 0.03623853623867035, 0.0337442047894001, 0.009541447274386883, 0.06724423170089722, 0.012546448968350887, -0.02346052974462509, 0.045791756361722946, -0.000522083428222686, 0.02015065774321556, -0.02817484177649021, -0.012785886414349079, 0.016020357608795166, 0.006278268061578274, 0.004051875323057175, -0.017917323857545853, -0.024119680747389793, -0.04976504296064377, -0.007835956290364265, -0.029432853683829308, -0.00763407489284873, -0.010238601826131344, -0.006770770065486431, -0.004481985699385405, -0.02262728475034237, 0.016649216413497925, 0.009361202828586102, 0.018545180559158325, -0.011246660724282265, -0.014487405307590961, -0.015212120488286018, -0.0019252658821642399, -0.0032943026162683964, -0.008690299466252327, 0.009060412645339966, -0.02768874354660511, 0.04919222742319107, 0.044497307389974594, -0.007249536458402872, 0.01492405030876398, -0.011462118476629257, 0.007127506658434868, -0.009635505266487598, -0.036870744079351425, 0.018517639487981796, -0.02472652494907379, -0.009979266673326492, 0.00556142209097743, -0.01513958815485239, -0.03907658904790878, -0.007517610676586628, 0.0002947004104498774, -0.0046553825959563255, 0.013805504888296127, 0.031130235642194748, 0.040729813277721405, -0.03389447554945946, -0.01336672529578209, -0.05047440901398659, 0.025008955970406532, -0.02523399144411087, 0.06202862784266472, 0.009585556574165821, -0.04870182275772095, -0.01996329054236412, -0.02828366681933403, 0.05130254477262497, -0.016569465398788452, 0.008566773496568203, 0.04774961993098259, 0.0481850728392601, -0.06853403896093369, 0.01780264638364315, 0.022050127387046814, -0.0061708553694188595, 0.0634349063038826, 0.023722512647509575, 0.002841037465259433, 0.030317500233650208, 0.020072756335139275, 0.010382596403360367, -0.006926803849637508, 0.0364866703748703, -0.018564242869615555, 0.016032183542847633, -0.06896160542964935, 0.01817355677485466, -0.009652373380959034, 0.045984234660863876, -0.04094306752085686, -0.016605548560619354, -0.015547226183116436, -0.03586914390325546, -0.011939290910959244, 0.009650399908423424, 0.07513019442558289, 0.039514414966106415, -0.015198476612567902, -0.03492090851068497, -0.002217227825894952, 0.02545112371444702, 0.010231719352304935, 0.04065682739019394, 0.06155603379011154, -0.04021409898996353, -0.012827379629015923, -0.005865229293704033, -0.009922962635755539, -0.02030545100569725, -0.014968020841479301, 0.025477025657892227, 0.012989036738872528, -0.037723466753959656, 0.013973420485854149, 0.013933275826275349, 0.04227752238512039, 0.012597753666341305, 0.021545952185988426, -0.014754649251699448, 0.013392423279583454, 0.012717249803245068, 0.00032312344410456717, -0.07192666083574295, -0.029643431305885315, 0.03042083978652954, -0.03857700899243355, 0.03319629281759262, -0.010173465125262737, 0.03355047106742859, -0.05197110027074814, 0.02421414479613304, 0.007567351683974266, -0.06152290850877762, -0.0040924740023911, 0.020026320591568947, -0.03039945662021637, -0.003803802654147148, -0.04197851940989494, -0.029623324051499367, -0.05835931375622749, 0.057511165738105774, 0.00683166366070509, -0.012187199667096138, -0.03692551329731941, -0.04258555918931961, 0.0016627656295895576, 0.03687579557299614, 0.002503492869436741, 0.04161546006798744, 0.051467932760715485, -0.013327899388968945, -0.010974314995110035, -0.012264011427760124 ]
Deploying the AI Comic Factory using the Inference API
jbilcke-hf
October 2, 2023
ai-comic-factory
guide, inference, api, llm, stable-diffusion
https://huggingface.co/blog/ai-comic-factory
Configuring the models The AI Comic Factory comes with the following models pre-configured: - LLM_HF_INFERENCE_API_MODEL: default value is meta-llama/Llama-2-70b-chat-hf - RENDERING_HF_RENDERING_INFERENCE_API_MODEL: default value is stabilityai/stable-diffusion-xl-base-1.0 Your PRO Hugging Face account already gives you access to those models, so you don't have anything to do or change.
[ -0.01124688982963562, 0.044855039566755295, 0.022135064005851746, -0.011421894654631615, 0.05377574637532234, 0.06723177433013916, 0.006242419593036175, 0.058980345726013184, -0.03127460554242134, -0.04945579171180725, -0.06812506169080734, 0.0426994226872921, -0.04494103416800499, 0.04617008566856384, -0.0466599203646183, -0.04095657169818878, -0.04729880392551422, 0.043170809745788574, -0.048913754522800446, 0.05247458070516586, 0.05298401787877083, -0.06293454021215439, -0.016719289124011993, -0.055985115468502045, -0.014773055911064148, -0.05722782760858536, 0.014197461307048798, 0.017719682306051254, 0.033859409391880035, -0.07515739649534225, -0.048920635133981705, -0.02633565105497837, -0.01219366304576397, 0.003151326673105359, 0.07377868890762329, 0.03804369270801544, -0.10016762465238571, 0.04969415068626404, 0.007174189202487469, -0.055251460522413254, 0.05062771216034889, -0.02808510698378086, -0.08983572572469711, 0.07038357853889465, 0.010060109198093414, -0.031129421666264534, -0.0878814309835434, 0.08897984772920609, -0.0265362448990345, 0.03966563194990158, -0.034100182354450226, 0.08294766396284103, -0.02198815904557705, -0.017563926056027412, 0.05174390226602554, -0.010815555229783058, -0.022022482007741928, 0.005736431106925011, 0.012900490313768387, 0.05000585317611694, 0.03051515482366085, -0.011429919861257076, 0.03898252174258232, -0.007093924563378096, 0.04952256381511688, -0.010618004016578197, -0.011374056339263916, -0.019545597955584526, -0.04888954386115074, -0.026304328814148903, -0.023034261539578438, 0.05058480054140091, 0.031129829585552216, -0.06531409919261932, 0.02156338095664978, -0.08993148058652878, -0.05400492250919342, 0.0582469217479229, 0.001049863058142364, -0.030913131311535835, -0.03844137489795685, 0.03665059432387352, 0.02815532498061657, 0.08204665035009384, -0.06022251024842262, 0.061856210231781006, 0.05874307081103325, -0.02745397947728634, -0.0028808326460421085, -0.0038488879799842834, -0.06183832883834839, -0.08894216269254684, -0.0797189325094223, -0.03996805474162102, 0.06539173424243927, -0.018415438011288643, 0.025857234373688698, 0.020283207297325134, 0.0091856112703681, -0.04194745048880577, -0.010740479454398155, -0.040769658982753754, -0.037342093884944916, -0.08193959295749664, -0.027636665850877762, -0.017566252499818802, 0.003807166824117303, -0.1100352331995964, -0.06898368895053864, -0.023155661299824715, -0.01837676204741001, -0.10047225654125214, 0.03699234873056412, 0.08146034181118011, -0.09441005438566208, -0.008229869417846203, -0.004723654594272375, -0.044427499175071716, -0.008775953203439713, 0.07760439813137054, 0.02509557269513607, 0.0664977878332138, 0.07100825011730194, -0.0004804438794963062, 0.026451891288161278, 0.09693560004234314, -0.005052472464740276, 0.036519914865493774, 0.04594799876213074, -0.007501866668462753, 0.010730848647654057, -0.05934494361281395, 0.021410249173641205, -0.04587245732545853, 0.056367211043834686, -0.07294779270887375, -0.07867363095283508, -0.05300116166472435, 0.05411941185593605, -0.023286227136850357, -0.047623004764318466, 0.014467143453657627, 0.026580512523651123, -0.029152762144804, 0.06515314429998398, 0.02337721548974514, 0.019945645704865456, 0.032855015248060226, -0.046111226081848145, 0.00704870093613863, -0.047304507344961166, 0.011457479558885098, -0.03061971813440323, -0.031176304444670677, 0.050536539405584335, -0.048144567757844925, -0.02866121008992195, -0.013464005663990974, -0.027989313006401062, -0.027608506381511688, 0.025202859193086624, -0.04555147513747215, -0.10095842182636261, -0.0016840711468830705, 0.03768515959382057, -0.0511198528110981, -0.035401441156864166, 0.09940731525421143, 0.036725256592035294, -0.020929604768753052, 0.015637755393981934, -0.038044918328523636, 0.07070299983024597, -0.026847893372178078, 0.04998018220067024, 0.05788850411772728, 0.03859391435980797, 0.03664335981011391, 0.01221164595335722, 0.037441421300172806, -0.04675646871328354, 0.05561617389321327, -0.04236983507871628, 0.03231331333518028, 0.075363390147686, -0.10646744072437286, 0.019542958587408066, -0.03363850340247154, -0.009498218074440956, 0.010255788452923298, 0.02266443334519863, 0.058237310498952866, 0.0546940378844738, -0.015955056995153427, 0.11967343091964722, -0.014308585785329342, -0.0903174877166748, 0.0497574657201767, 0.10226722806692123, 0.02183252014219761, 0.041293662041425705, 0.005962273105978966, 0.037098657339811325, 0.00035412251600064337, -0.025837108492851257, 0.02073672227561474, -0.010669083334505558, -0.034021761268377304, 0.02979842945933342, 0.05302753672003746, 0.0731373056769371, -0.09681951999664307, 0.0342102125287056, -0.0441584512591362, 0.04430370032787323, -0.06377144902944565, -0.049060460180044174, -0.054851215332746506, -0.010059128515422344, -0.021599888801574707, 0.16252431273460388, -0.0034545473754405975, 0.009790590032935143, -0.05755571275949478, -0.054818976670503616, 0.029824161902070045, 0.048742059618234634, 0.044419799000024796, 0.02928820438683033, -0.07544412463903427, 0.006930229719728231, -0.02372897043824196, -0.04313930869102478, 0.04593304917216301, -0.02648102305829525, -0.01676712930202484, 0.02244676649570465, 0.033822182565927505, 0.021703649312257767, 0.009532256983220577, 0.03715887293219566, -0.0024853935465216637, 0.014543135650455952, -0.025314077734947205, -0.024965498596429825, 0.000931161514017731, 0.023288710042834282, 0.03464674577116966, -0.09886743873357773, 0.01810440607368946, -0.05553559586405754, -0.005466128699481487, 0.009356544353067875, 0.017838092520833015, 0.011744323186576366, 0.0410085991024971, -0.015701204538345337, 0.011993631720542908, -0.03485051169991493, 0.021411890164017677, -0.013043968006968498, -0.014449707232415676, -0.03513317182660103, -0.006813575979322195, -0.004654435440897942, -0.06537926197052002, 0.010233111679553986, -0.019425807520747185, -0.02495700679719448, 0.01891290955245495, 0.06147465109825134, -0.011675377376377583, 0.03265814110636711, -0.0006869295029900968, 0.041624799370765686, 0.04801971837878227, 0.08383334428071976, -0.016189411282539368, -0.040325477719306946, -0.0015277375932782888, 0.04614588990807533, 0.01464924681931734, 0.019477080553770065, 0.01914719119668007, -0.021819796413183212, -0.01587863452732563, -0.019522210583090782, -0.0832974836230278, -0.043828487396240234, 0.0016024855431169271, -0.0017757046734914184, 0.04511628672480583, 0.005992928519845009, 0.005697658285498619, -0.029089001938700676, 0.007992337457835674, 0.010032913647592068, -0.0015205777017399669, -0.004321318119764328, -0.019956272095441818, 0.00768433278426528, -0.013864071108400822, 0.01905650645494461, 0.007544646505266428, 0.016044583171606064, 0.07718479633331299, 0.021848980337381363, -0.01280260644853115, -0.07986863702535629, -0.009230266325175762, -0.00034806947223842144, -0.01226627267897129, -0.011306211352348328, -0.0054654693230986595, 0.0532994419336319, 0.017925119027495384, -0.013015331700444221, 0.05319294333457947, -0.05169200897216797, 0.010434419848024845, 0.018585510551929474, 0.013686016201972961, -0.023030510172247887, -0.023844139650464058, -0.008512713946402073, -0.009109579026699066, 0.021725093945860863, -0.02733682654798031, -0.030597897246479988, 0.020771587267518044, -0.033783119171857834, 0.001497353077866137, 0.027876848354935646, 0.0008067379822023213, 0.052486125379800797, -0.02616620436310768, 0.015384129248559475, -0.013526479713618755, 0.01696619763970375, 0.001198429730720818, -0.015195246785879135, -0.019229445606470108, -0.0418674610555172, 0.008293838240206242, 0.015123493038117886, 0.027360733598470688, 0.05781180039048195, 0.019354727119207382, 0.02239370532333851, -0.01656615175306797, 0.016100356355309486, -0.037337712943553925, 0.01671096310019493, 0.004537224303930998, -0.015695005655288696, 0.019702177494764328, -0.019834572449326515, -0.023610450327396393, -0.004707424435764551, -0.009635978378355503, -0.009827046655118465, 0.021092167124152184, 0.017621789127588272, 0.030464017763733864, 0.03935832157731056, 0.029496224597096443, 0.010468903928995132, -0.04509015753865242, -0.06876371800899506, 0.011953645385801792, -0.047500234097242355, 0.0037670384626835585, -0.012719783931970596, 0.030394013971090317, 0.04683151841163635, -0.013942228630185127, 0.034998465329408646, 0.022278163582086563, 0.012210390530526638, 0.033952344208955765, -0.007010353729128838, 0.010523457080125809, -0.010583060793578625, -0.02812083624303341, -0.025171419605612755, -0.04096267744898796, 0.03672763705253601, 0.018004270270466805, 0.007753340993076563, -0.02073257975280285, 0.0021133997943252325, -0.02143882028758526, 0.015963925048708916, -0.021755171939730644, 0.014505080878734589, -0.027847297489643097, 0.022052932530641556, 0.03756013512611389, -0.01639014296233654, -0.025850698351860046, 0.0284865815192461, 0.015217416919767857, 0.003454911522567272, -0.010487542487680912, 0.01616213098168373, 0.06574241071939468, 0.004395263269543648, 0.029304079711437225, 0.030459469184279442, -0.022898823022842407, 0.001594146597199142, 0.002446045633405447, -0.03236847743391991, 0.014347676187753677, 0.015316763892769814, -0.06062814220786095, 0.03440398350358009, -0.007379923015832901, -0.009553879499435425, -0.03865942731499672, 0.022520480677485466, -0.0061588897369802, 0.04492367058992386, 0.042050331830978394, -0.0282461978495121, -0.007826605811715126, -0.044739652425050735, 0.04958439618349075, -0.0054742684587836266, 0.00500904768705368, 0.006206393241882324, -0.03642353415489197, 0.033065009862184525, 0.008182934485375881, -0.008436246775090694, 0.033367469906806946, -0.014110996387898922, -0.005506514105945826, -0.03352202847599983, -0.03641429543495178, 0.03228440508246422, 0.021674783900380135, -0.0047579859383404255, 0.0012328618904575706, -0.07185108214616776, 0.031738992780447006, 0.02367732673883438, -0.019447701051831245, 0.018021855503320694, 0.020284703001379967, 0.01653459295630455, 0.011411936953663826, 0.021706577390432358, -0.013429438695311546, -0.020443100482225418, -0.00201702443882823, -0.006385982967913151, 0.04099654406309128, 0.02556324563920498, 0.010670304298400879, -0.03166283667087555, -0.016395755112171173, 0.04763638600707054, -0.0029505013953894377, -0.04093523323535919, 0.028368806466460228, -0.010016010142862797, 0.015007803216576576, 0.01826779544353485, -0.005187547765672207, 0.002787280362099409, 0.019847936928272247, 0.05124075338244438, 0.02813309244811535, -0.0029401809442788363, -0.04315076768398285, -0.02304125763475895, -0.02099306881427765, -0.028890687972307205, 0.024044470861554146, 0.000410716631449759, -0.048186901956796646, 0.00782764796167612, 0.03961437940597534, 0.05991839990019798, 0.02345464564859867, 0.01441697683185339, -0.020280923694372177, -0.0265220794826746, -0.04042179137468338, 0.01687900349497795, -0.015658795833587646, 0.005261953920125961, 0.030959293246269226, 0.05469095706939697, 0.028402667492628098, 0.03486049920320511, 0.008767514489591122, 0.038865599781274796, -0.0014943607384338975, 0.03323596715927124, -0.04139980301260948, -0.000795296102296561, 0.007807618007063866, 0.009533697739243507, -0.0036071527283638716, 0.04663120582699776, -0.04887395724654198, 0.014588775113224983, 0.09068340808153152, -0.05090118572115898, -0.018002068623900414, 0.01707388646900654, 0.005335273686796427, 0.023134618997573853, -0.019151385873556137, 0.06645559519529343, -0.004498507361859083, -0.012224782258272171, -0.023770935833454132, 0.012962871231138706, 0.002669108333066106, 0.027882574126124382, -0.04755574092268944, -0.047192495316267014, -0.00670620845630765, 0.009871302172541618, 0.02280016429722309, -0.0029155428055673838, -0.06464529782533646, -0.04139900580048561, -0.023537147790193558, 0.038890719413757324, -0.0335996076464653, 0.007622892037034035, -0.01466373447328806, -0.01921815052628517, 0.008278418332338333, 0.01470315270125866, -0.04140351340174675, 0.042381174862384796, 0.03355976194143295, -0.004848013166338205, 0.04276895523071289, -0.061793383210897446, 0.027215369045734406, 0.04022393003106117, -0.031760603189468384, 0.008566866628825665, -0.007821827195584774, -0.035216622054576874, -0.014598161913454533, 0.014132648706436157, 0.04243718087673187, 0.05511204153299332, -0.006687851157039404, 0.011592065915465355, 0.023267054930329323, 0.0007234066142700613, 0.012660261243581772, 0.030737629160284996, -0.037296514958143234, 0.0011489208554849029, 0.02985263057053089, 0.03424573317170143, 0.00821616780012846, 0.00875223521143198, -0.015670455992221832, -0.007525902707129717, -0.0034823589958250523, -0.004741599317640066, 0.022581476718187332, -0.019960369914770126, 0.009442979469895363, 0.04015199467539787, -0.040903303772211075, -0.00046935692080296576, 0.018838003277778625, -0.0004932008450850844, 0.011203293688595295, -0.0011383934179320931, -0.021633747965097427, -0.013416917063295841, -0.03339110314846039, 0.012337403371930122, 0.027463184669613838, -0.02383187785744667, -0.018885789439082146, -0.0025025184731930494, 0.038287486881017685, 0.0706445500254631, 0.008752977475523949, 0.006735620554536581, -0.0016704897861927748, 0.05271269381046295, 0.03241025656461716, -0.0005089479382149875, 0.02326340600848198, -0.013853969983756542, 0.029219334945082664, 0.00874239206314087, 0.011418133974075317, -0.011654886417090893, 0.024934472516179085, 0.01082633901387453, 0.004057483747601509, 0.010396708734333515, -0.030692443251609802, 0.04834551364183426, 0.02227868139743805, 0.0014745272928848863, -0.005695375148206949, 0.04005778953433037, -0.01435046922415495, -0.026873307302594185, -0.006181519478559494, 0.012501726858317852, 0.0132440235465765, -0.004313555546104908, 0.03810034319758415, 0.02042766474187374, -0.025864891707897186, 0.028665481135249138, 0.014611505903303623, -0.003697268897667527, -0.06738442182540894, -0.011072601191699505, -0.04088183492422104, -0.00638237688690424, 0.03551768884062767, -0.047881461679935455, 0.019825752824544907, -0.02417982555925846, -0.020368507131934166, -0.015022299252450466, -0.007641335017979145, -0.0055533540435135365, 0.005018813535571098, 0.028392842039465904, 0.028442293405532837, 0.04359304532408714, -0.04370975121855736, 0.013208756223320961, -0.019494187086820602, -0.0073110670782625675, -0.013605951331555843, -0.005890110041946173, -0.03343209996819496, -0.016695231199264526, -0.008906722068786621, -0.0483388677239418, 0.06051020696759224, 0.03893133997917175, 0.012268534861505032, -0.011310623027384281, 0.012294132262468338, 0.00792685430496931, -0.021567218005657196, 0.012146282009780407, -0.015042363665997982, -0.039044301956892014, -0.03913101181387901, 0.0011911786859855056, 0.007238804828375578, -0.04356766492128372, -0.026107437908649445, 0.02934202551841736, 0.015620970167219639, 0.013697444461286068, 0.08291083574295044, 0.009156894870102406, -0.03554781153798103, -0.030895322561264038, -0.028585081920027733, -0.03315052017569542, 0.01237515825778246, 0.03412080556154251, 0.003779622260481119, -0.02249445579946041, -0.011102818883955479, -0.007030813954770565, 0.027429159730672836, -0.052246157079935074, 0.027851641178131104, 0.041399501264095306, 0.005374380387365818, -0.029538318514823914, 0.022806480526924133, 0.035651057958602905, -0.021734628826379776, 0.040003035217523575, 0.05266323685646057, 0.005170515738427639, 0.019618922844529152, 0.0025598572101444006, 0.002753720385953784, -0.025337036699056625, 0.011404861696064472, -0.010603285394608974, -0.012238912284374237, -0.05752043053507805, 0.017679983749985695, 0.02126356028020382, -0.001032991916872561, -0.019185923039913177, -0.01913042925298214, -0.025975676253437996, -0.030058639124035835, 0.004301843233406544, 0.02149510569870472, 0.04166417941451073, 0.03753116726875305, 0.0034236900974065065, 0.0023857159540057182, 0.014169222675263882, 0.028674859553575516, -0.012163282372057438, 0.0162222720682621, 0.03328658640384674, -0.03058721497654915, -0.019569186493754387, -0.0223748330026865, -0.016721811145544052, 0.0008945363224484026, -0.07849732041358948, 0.03193063661456108, 0.006269310601055622, -0.012604745104908943, 0.0025927810929715633, -0.03017221763730049, 0.01285302173346281, 0.03535978123545647, 0.046811752021312714, 0.008161663077771664, 0.01781914383172989, -0.014011223800480366, 0.009623452089726925, -0.05244117230176926, -0.04166489467024803, 0.021540474146604538, -0.019374791532754898, -0.004659666679799557, 0.0046120574697852135, 0.013904158025979996, -0.0020892282482236624, -0.009862516075372696, 0.006681422237306833, -0.003010630840435624, -0.008133288472890854, -0.002389931818470359, -0.050036098808050156, 0.036993805319070816, 0.012187043204903603, -0.03317169100046158, -0.030682368203997612, 0.05358218401670456, -0.04856732487678528, 0.031004145741462708, -0.020601782947778702, -0.021218305453658104, 0.01507838536053896, 0.0019747395999729633, -0.0247589610517025, 0.04492372274398804, 0.011690029874444008, -0.02488696202635765, 0.004744766745716333, -0.01832759380340576 ]
Deploying the AI Comic Factory using the Inference API
jbilcke-hf
October 2, 2023
ai-comic-factory
guide, inference, api, llm, stable-diffusion
https://huggingface.co/blog/ai-comic-factory
# Deploying the AI Comic Factory using the Inference API We recently announced Inference for PROs, our new offering that makes larger models accessible to a broader audience. This opportunity opens up new possibilities for running end-user applications using Hugging Face as a platform. An example of such an application is the AI Comic Factory - a Space that has proved incredibly popular. Thousands of users have tried it to create their own AI comic panels, fostering its own community of regular users. They share their creations, with some even opening pull requests. In this tutorial, we'll show you how to fork and configure the AI Comic Factory to avoid long wait times and deploy it to your own private space using the Inference API. It does not require strong technical skills, but some knowledge of APIs, environment variables and a general understanding of LLMs & Stable Diffusion are recommended.
[ 0.03788452222943306, -0.03265419974923134, 0.03882283717393875, 0.012199802324175835, 0.05924660339951515, 0.09598288685083389, -0.00040133274160325527, 0.04251755774021149, -0.03461365029215813, -0.04011229798197746, -0.07501652091741562, 0.013559119775891304, -0.0411020964384079, 0.08273471146821976, -0.02210521511733532, -0.08011750876903534, -0.013921815901994705, -0.027231095358729362, -0.04785724729299545, -0.0027078273706138134, 0.0018331260653212667, -0.06433451175689697, -0.030373739078640938, -0.03737865388393402, -0.022849762812256813, -0.02046711929142475, 0.009575186297297478, 0.02290581353008747, 0.03233810514211655, -0.022406065836548805, -0.051385026425123215, -0.042649466544389725, 0.014987338334321976, -0.02452087588608265, 0.03586679324507713, 0.030344581231474876, -0.13857634365558624, 0.026286110281944275, 0.06604732573032379, 0.0031894445419311523, 0.04634896293282509, -0.02275226265192032, -0.056296657770872116, 0.03536302223801613, 0.0220321137458086, -0.027634477242827415, -0.11404579132795334, 0.1100214421749115, -0.022592943161725998, 0.004051369149237871, -0.02921339124441147, 0.07904943823814392, -0.032192908227443695, -0.0251704640686512, 0.03868045285344124, 0.06878187507390976, -0.021881917491555214, -0.056755464524030685, 0.011739508248865604, 0.0250387005507946, 0.029082482680678368, -0.008909781463444233, 0.03559443727135658, 0.007891499437391758, -0.00600384222343564, 0.05575587972998619, 0.011004478670656681, 0.02361910417675972, -0.055078256875276566, -0.012918492779135704, 0.005054000299423933, 0.01207731757313013, -0.04882769659161568, -0.03263484314084053, 0.07375970482826233, -0.025034841150045395, -0.003961434122174978, 0.08028813451528549, 0.01600971259176731, -0.01091120857745409, -0.04863680899143219, -0.012068570591509342, 0.029653487727046013, 0.0558236762881279, 0.03742241859436035, 0.051412567496299744, -0.006630234885960817, -0.06107914075255394, -0.058217838406562805, -0.0175190232694149, -0.0007767558563500643, -0.10573115944862366, -0.049378104507923126, 0.02761811949312687, 0.042118825018405914, 0.028221143409609795, 0.015196570195257664, 0.04594063386321068, 0.008885370567440987, -0.027859771624207497, 0.0043616886250674725, -0.02832907624542713, -0.03558972850441933, -0.05933848395943642, -0.05851359665393829, 0.059229325503110886, 0.015034344978630543, -0.08565685898065567, -0.0506344698369503, 0.02063402347266674, 0.019110767170786858, -0.04467201977968216, 0.008281754329800606, 0.059579696506261826, -0.1301802694797516, -0.024065935984253883, -0.02596486732363701, -0.02997908741235733, 0.015615388751029968, 0.01393953152000904, 0.06331157684326172, 0.0696725845336914, 0.05303258076310158, 0.03117339499294758, -0.0062842112965881824, 0.02029583789408207, -0.005730914417654276, 0.03188549354672432, 0.0046558380126953125, -0.008264223113656044, 0.05041821300983429, -0.06256362050771713, 0.05238838866353035, -0.04962170869112015, 0.06044146418571472, -0.07638674229383469, -0.04724204167723656, -0.03264617547392845, 0.04812264069914818, 0.004546804819256067, -0.00033837612136267126, 0.007931624539196491, 0.08041442185640335, 0.021187085658311844, 0.07767359167337418, 0.003346147248521447, -0.03928346186876297, 0.00575961172580719, -0.02332560159265995, -0.009624605998396873, -0.0889534056186676, -0.01953616738319397, 0.02779395878314972, -0.04342005029320717, -0.004622878972440958, 0.01463076751679182, -0.013050751760601997, -0.03457427769899368, -0.05605842173099518, -0.014161473140120506, 0.02933589741587639, -0.05439765378832817, -0.036541931331157684, -0.029452065005898476, 0.006481125019490719, -0.0023199208080768585, -0.024144360795617104, 0.03410676121711731, -0.006418938748538494, -0.011240546591579914, -0.0478128157556057, -0.012470319867134094, 0.02272835560142994, -0.04680279642343521, 0.12397240102291107, 0.041671596467494965, 0.06745503842830658, 0.07893574237823486, 0.02119702287018299, 0.05092727392911911, -0.04314571991562843, 0.07084619998931885, 0.037974774837493896, 0.04167952388525009, 0.04375450685620308, -0.09501231461763382, 0.034911148250103, -0.04129793494939804, -0.015310834161937237, -0.022948207333683968, -0.038878004997968674, 0.022074026986956596, 0.051751814782619476, -0.044474389404058456, 0.07594279944896698, 0.0054529872722923756, -0.12138945609331131, 0.06767525523900986, 0.04356089234352112, 0.04989071190357208, 0.010246743448078632, 0.016832584515213966, 0.07539404928684235, -0.048707276582717896, -0.01486142911016941, 0.00798120815306902, 0.007021782454103231, -0.01016987580806017, 0.003534624818712473, 0.043351709842681885, 0.018362876027822495, -0.11894544959068298, 0.042105257511138916, -0.06003951281309128, -0.003453375305980444, -0.051173482090234756, -0.030316321179270744, -0.030235078185796738, -0.03432166203856468, -0.052634552121162415, 0.1649019718170166, -0.025069760158658028, 0.03767101466655731, -0.06039190664887428, -0.00632817717269063, 0.010430020280182362, 0.05543103441596031, 0.05456068366765976, 0.11915107816457748, -0.09323786199092865, -0.03987431153655052, -0.023822231218218803, -0.044674262404441833, -0.017447039484977722, -0.020151130855083466, -0.020187264308333397, 0.06970878690481186, -0.027737170457839966, 0.01836901158094406, -0.030175643041729927, 0.0348421074450016, -0.013908158987760544, 0.01420859806239605, 0.025285957381129265, 0.01594257354736328, -0.02930513583123684, 0.03637714311480522, 0.04972062632441521, -0.04454473778605461, 0.00573226111009717, -0.059899765998125076, -0.0031081801280379295, 0.003920695744454861, 0.07352367788553238, 0.043531764298677444, 0.02567780204117298, -0.024208957329392433, 0.019399067386984825, -0.03269612044095993, -0.007985653355717659, -0.006921888329088688, -0.030304796993732452, 0.00893175695091486, -0.014369785785675049, 0.0063210297375917435, -0.030399195849895477, -0.018194012343883514, 0.004444218706339598, -0.014316312037408352, 0.0007088501006364822, 0.05712272226810455, -0.016989341005682945, 0.02407379075884819, -0.012188063003122807, 0.044647425413131714, 0.0373254269361496, 0.07600162923336029, -0.010232127271592617, -0.006194160785526037, -0.011069840751588345, 0.017520906403660774, -0.03475799784064293, 0.017337728291749954, 0.037584688514471054, 0.012339834123849869, -0.007341973949223757, -0.014777864329516888, -0.03928264230489731, -0.044221919029951096, 0.018481524661183357, 0.05038880184292793, 0.05221237987279892, -0.00030238533508963883, -0.01594017632305622, 0.02859243005514145, 0.013076202012598515, 0.008448071777820587, -0.02890687808394432, -0.008220589719712734, -0.004953701514750719, 0.0330110527575016, -0.034366413950920105, -0.028357358649373055, -0.020527876913547516, 0.003977994434535503, 0.04112892970442772, 0.050133608281612396, 0.0063102152198553085, -0.08936291188001633, -0.008303919807076454, -0.012044996954500675, -0.0027811157051473856, -0.019032949581742287, -0.03137396648526192, 0.07798159867525101, -0.026626108214259148, -0.00208694813773036, 0.045296479016542435, -0.012250903062522411, 0.004540465772151947, 0.024002425372600555, -0.0076785460114479065, -0.015922488644719124, -0.032684799283742905, 0.003594622714444995, -0.00726134842261672, 0.045277588069438934, 0.0015103156911209226, -0.07584156095981598, 0.023713862523436546, 0.016548627987504005, -0.01133461482822895, 0.05592181533575058, -0.023414982482790947, 0.03567764163017273, -0.021669702604413033, 0.03419314697384834, -0.023174576461315155, 0.0006638108170591295, -0.027437953278422356, -0.0033112934324890375, -0.028567040339112282, -0.07397356629371643, 0.015941264107823372, -0.014733398333191872, -0.006436142139136791, 0.0327010340988636, 0.013398685492575169, -0.015042988583445549, 0.017234988510608673, 0.02472865767776966, -0.018341200426220894, 0.029568670317530632, -0.004961356986314058, -0.013592093251645565, 0.014254194684326649, 0.024217166006565094, -0.061675798147916794, 0.01935066469013691, 0.030371347442269325, -0.0037000461015850306, 0.029854457825422287, 0.020797237753868103, 0.008842915296554565, 0.018314575776457787, 0.03520173579454422, 0.01034074928611517, -0.03467351198196411, -0.07011223584413528, 0.01680327020585537, -0.02480553835630417, -0.0035880475770682096, -0.007059265859425068, 0.058763835579156876, 0.061156079173088074, -0.03616195544600487, 0.02034757472574711, -0.003511992748826742, 0.033699143677949905, 0.014799416065216064, -0.022809656336903572, -0.0016900509363040328, -0.016921229660511017, 0.03362207114696503, -0.020703142508864403, -0.029047345742583275, 0.06255405396223068, 0.04110649973154068, -0.006394774187356234, 0.02011762745678425, 0.0011995949316769838, -0.011647583916783333, 0.01682700589299202, 0.007998641580343246, 0.0025173474568873644, -0.012810321524739265, -0.004012973513454199, 0.04765229672193527, -0.028747566044330597, -0.021312007680535316, -0.004774259869009256, -0.0018103604670614004, 0.000832117919344455, 0.0011788350529968739, 0.0366993322968483, 0.05368828773498535, 0.02961648628115654, -0.001992081757634878, 0.0038946266286075115, -0.04288797825574875, -0.009843493811786175, 0.04615440592169762, -0.01991122215986252, 0.028839468955993652, -0.030258653685450554, -0.027799153700470924, 0.029825257137417793, -0.0008633729303255677, 0.0030504653695970774, -0.015855224803090096, 0.024680733680725098, -0.016279181465506554, 0.018364351242780685, 0.05287441983819008, -0.010173426941037178, 0.0025889715179800987, -0.059371255338191986, 0.01607791893184185, -0.010073498822748661, 0.01706187054514885, 0.0083444369956851, -0.03570329770445824, 0.010394295677542686, 0.03977297618985176, 0.019638104364275932, 0.02644561603665352, 0.006035583093762398, -0.02384026162326336, -0.035072073340415955, -0.02241281419992447, 0.030957285314798355, -0.007582843769341707, 0.008162803016602993, -0.017359605059027672, -0.05358041822910309, 0.021406589075922966, -0.0005220365710556507, 0.009880844503641129, 0.04573835805058479, -0.007727405522018671, -0.014582446776330471, -0.042332861572504044, -0.01628008671104908, 0.028021151199936867, -0.020723721012473106, 0.011858637444674969, -0.05090131610631943, 0.03302611783146858, 0.0029327378142625093, 0.0038656017277389765, -0.03550320118665695, 0.024026652798056602, 0.04648439213633537, -0.006558526307344437, 0.012638401240110397, -0.003376577515155077, 0.009929410181939602, 0.039857931435108185, 0.01051038596779108, 0.02822025492787361, -0.0015208519762381911, 0.015292995609343052, -0.0014892437029629946, 0.011336293071508408, -0.02295623905956745, -0.06974706053733826, 0.005916107911616564, -0.014667834155261517, -0.04504502937197685, 0.03770477697253227, 0.03024733066558838, -0.020162804052233696, -0.0021358090452849865, 0.05515445023775101, 0.0693960040807724, 0.03672393038868904, -0.01109949592500925, -0.03422682359814644, -0.022941989824175835, 0.0027988164220005274, 0.011680292896926403, -0.04435400292277336, -0.00718714902177453, 0.02165459841489792, 0.04596957564353943, 0.07507926970720291, -0.011955239810049534, 0.0007196131045930088, 0.00538338627666235, 0.011290539056062698, 0.013105001300573349, -0.06154503673315048, 0.009135745465755463, -0.03736691549420357, -0.026133568957448006, 0.013991665095090866, 0.028651099652051926, -0.01575629785656929, -0.0063455249182879925, 0.05309411138296127, -0.05437814071774483, -0.026199553161859512, 0.019133104011416435, -0.01302350964397192, 0.04225689545273781, -0.01455899141728878, 0.04941018298268318, -0.010379748418927193, 0.02221340872347355, -0.010638629086315632, -0.0038189678452908993, -0.007840504869818687, -0.01943223550915718, -0.015332088805735111, -0.032177653163671494, 0.011832058429718018, 0.024065347388386726, 0.041671160608530045, -0.028342563658952713, -0.07289113849401474, -0.01095391996204853, -0.010959652252495289, 0.03125809133052826, -0.022216955199837685, -0.01568264327943325, -0.0379214771091938, -0.021371429786086082, -0.014941290952265263, -0.0038893951568752527, -0.004945522174239159, 0.040082886815071106, 0.05026640743017197, -0.0017615666147321463, 0.01749001070857048, -0.03296898305416107, 0.07191586494445801, 0.037415988743305206, -0.007428968790918589, 0.014929126016795635, -0.014908931218087673, -0.009610586799681187, -0.036183685064315796, -0.020561838522553444, 0.0431075245141983, 0.07792960852384567, -0.019962536171078682, -0.012479547411203384, 0.009735756553709507, 0.010639798827469349, 0.005130078177899122, 0.009263628162443638, -0.052281059324741364, -0.007845072075724602, 0.014145640656352043, 0.032292913645505905, 0.016922106966376305, -0.02894899621605873, 0.024683620780706406, 0.019225848838686943, -0.02450709044933319, -0.017651008442044258, -0.004477010108530521, -0.02284664288163185, -0.00629949988797307, 0.04600171372294426, -0.033010274171829224, 0.004079020582139492, 0.009321268647909164, 0.019164443016052246, -0.007344252895563841, -0.0008286658558063209, -0.006404378917068243, 0.014548868872225285, -0.013306094333529472, -0.0007742004818283021, 0.0402420349419117, -0.0077078016474843025, -0.02828296646475792, 0.012402934022247791, 0.04727616161108017, 0.03718126192688942, -0.005972344893962145, 0.035194575786590576, -0.007003678474575281, 0.06385811418294907, -0.003517407225444913, 0.00046611446305178106, 0.01314033754169941, -0.0031978522893041372, -0.013794171623885632, 0.04726356640458107, 0.020824477076530457, 0.015875862911343575, 0.02271958626806736, 0.01890168897807598, -0.0505334697663784, 0.029251784086227417, -0.03552256152033806, 0.03830648213624954, 0.013312239199876785, 0.03705677390098572, -0.001819075201638043, 0.026960883289575577, 0.030019327998161316, 0.0013015029253438115, 0.018249740824103355, 0.027069389820098877, 0.03498338907957077, -0.040801603347063065, 0.04047861695289612, -0.03469414636492729, 0.007584305014461279, 0.01648646406829357, 0.04031733423471451, 0.0004149340093135834, -0.06386055052280426, -0.006484996527433395, -0.03066990152001381, 0.0009763431153260171, 0.026748154312372208, -0.014509478583931923, -0.03299902379512787, -0.023163946345448494, -0.00229504331946373, -0.0011557898251339793, -0.004033246077597141, -0.00915203895419836, -0.043514300137758255, 0.01696723699569702, -0.002115883631631732, 0.014477625489234924, -0.004083454608917236, 0.022439606487751007, -0.029131431132555008, 0.012284276075661182, -0.0013101882068440318, -0.03737523779273033, -0.03356532007455826, -0.02150961011648178, -0.02755875512957573, -0.0021210145205259323, 0.022435398772358894, 0.011363365687429905, -0.015813615173101425, 0.025011278688907623, 0.03770746663212776, 0.0101335933431983, 0.015584977343678474, 0.03269639611244202, 0.036244552582502365, -0.041337233036756516, -0.0022295943927019835, 0.0002579985302872956, -0.05050215497612953, -0.07402303814888, -0.03252079710364342, 0.013591261580586433, 0.01522362232208252, -0.012848028913140297, 0.021005362272262573, 0.05043350160121918, -0.05850427597761154, -0.023400431498885155, 0.013333196751773357, 0.002417741809040308, -0.0126951327547431, 0.042812395840883255, 0.039584022015333176, -0.009644344449043274, -0.039434369653463364, 0.006400806829333305, 0.011778952553868294, 0.006014327984303236, 0.004609949886798859, 0.046655748039484024, 0.04310620576143265, -0.09702043980360031, 0.028244663029909134, 0.010331835597753525, -0.014743258245289326, 0.040675144642591476, 0.034781116992235184, 0.02456219308078289, 0.023160172626376152, -0.019231513142585754, 0.022267544642090797, -0.03168775513768196, 0.001560162054374814, -0.017599860206246376, -0.028765112161636353, -0.04676723852753639, 0.0024880266282707453, 0.009543400257825851, -0.008156470023095608, -0.05169736221432686, -0.03424059972167015, -0.009088591672480106, -0.01658688113093376, -0.021652068942785263, -0.011285200715065002, 0.0589660182595253, 0.01132236234843731, 0.014815641567111015, 0.0038349281530827284, -0.006152361631393433, -0.006604800466448069, -0.024942131713032722, 0.05131165683269501, 0.03285679966211319, -0.013286201283335686, -0.01807313784956932, -0.02599647454917431, -0.05775899812579155, 0.0058624702505767345, -0.041495174169540405, 0.03511601313948631, 0.045659519731998444, -0.006160723511129618, -0.01622721739113331, 0.03354750946164131, 0.015597859397530556, 0.03818080201745033, 0.032426413148641586, -0.027423659339547157, 0.019590526819229126, -0.008158238604664803, 0.019282925873994827, -0.03670197352766991, -0.02213776484131813, 0.006592863705009222, 0.009981384500861168, 0.02506755106151104, -0.0019314842065796256, 0.0037173794116824865, -0.009290492162108421, 0.008682935498654842, 0.015811845660209656, -0.026973355561494827, -0.061221152544021606, -0.038466669619083405, -0.037376519292593, 0.02319803275167942, -0.007269866298884153, -0.02799100987613201, -0.04485088214278221, 0.020418209955096245, -0.029513318091630936, 0.03459710255265236, -0.0005132364458404481, -0.0022018523886799812, -0.006508832331746817, 0.01946769654750824, -0.025170955806970596, 0.05816848576068878, 0.030477162450551987, -0.005522158462554216, -0.05555513873696327, -0.005084294360131025 ]
Deploying the AI Comic Factory using the Inference API
jbilcke-hf
October 2, 2023
ai-comic-factory
guide, inference, api, llm, stable-diffusion
https://huggingface.co/blog/ai-comic-factory
Going further Support for the Inference API in the AI Comic Factory is in its early stages, and some features, such as using the refiner step for SDXL or implementing upscaling, haven't been ported over yet. Nonetheless, we hope this information will enable you to start forking and tweaking the AI Comic Factory to suit your requirements. Feel free to experiment and try other models from the community, and happy hacking!
[ 0.0573737807571888, -0.016477594152092934, 0.036008961498737335, 0.045322760939598083, 0.07621859014034271, 0.060007039457559586, -0.024015992879867554, 0.05462726205587387, 0.01804194226861, -0.08156739175319672, -0.034173715859651566, -0.008764428086578846, -0.04716334491968155, 0.09651871770620346, 0.014600497670471668, -0.017102982848882675, -0.039231278002262115, 0.018867678940296173, 0.0008753633010201156, 0.01563485525548458, 0.004430854227393866, -0.06393255293369293, -0.016834069043397903, -0.04347240552306175, -0.008619275875389576, -0.04278073459863663, -0.004935999400913715, 0.007781029213219881, -0.047577403485774994, -0.012490281835198402, -0.06898711621761322, -0.0352112241089344, 0.016183797270059586, -0.023363586515188217, 0.01730387657880783, 0.024492377415299416, -0.11033964902162552, -0.0005621762829832733, 0.012315201573073864, 0.001492226030677557, 0.013725580647587776, -0.016140298917889595, -0.028862889856100082, 0.06092361360788345, 0.04529108107089996, -0.05104423314332962, -0.13844731450080872, 0.07986989617347717, -0.015393455512821674, 0.03958045318722725, 0.027212942019104958, 0.08577476441860199, -0.05822773650288582, -0.030973851680755615, 0.03428350389003754, 0.06027856469154358, -0.055565789341926575, -0.015739740803837776, 0.05914251506328583, 0.0422096811234951, 0.04035251587629318, -0.020797673612833023, 0.04577324911952019, -0.015849022194743156, -0.0009189406409859657, 0.014248698949813843, 0.023296412080526352, 0.00142671971116215, -0.03657371550798416, -0.004351855721324682, -0.00843737367540598, -0.03988804295659065, -0.011122175492346287, 0.0218817051500082, 0.043564461171627045, -0.051649633795022964, -0.05487564951181412, 0.07524014264345169, 0.029933413490653038, 0.013532270677387714, -0.08119876682758331, 0.014245916157960892, 0.06463585048913956, 0.05013783276081085, 0.009318889118731022, 0.006381568498909473, 0.05908704921603203, -0.05412975326180458, -0.0289476215839386, 0.03274857625365257, -0.026552041992545128, -0.1406976878643036, -0.06053077429533005, 0.007193868979811668, 0.014277646318078041, -0.002405876759439707, 0.023495759814977646, 0.05041119456291199, 0.030673734843730927, -0.009342703968286514, -0.01502032857388258, -0.013977916911244392, -0.005494422744959593, -0.05110790207982063, -0.06629734486341476, 0.023126009851694107, 0.0005744550726376474, -0.09579958766698837, -0.07305908203125, 0.047380004078149796, 0.03416748344898224, -0.006211274769157171, 0.038488104939460754, 0.054566752165555954, -0.07537876069545746, -0.019924534484744072, -0.004671420436352491, -0.010959436185657978, -0.02720452845096588, 0.037110473960638046, 0.030112164095044136, 0.06566964834928513, 0.08876033127307892, 0.010445378720760345, 0.012598817236721516, 0.04926453158259392, 0.007721061818301678, 0.036337342113256454, 0.004079964943230152, 0.018335366621613503, 0.02261200174689293, -0.04028293117880821, 0.028096133843064308, -0.027950655668973923, 0.05985819548368454, -0.09014272689819336, -0.08886734396219254, -0.019229615107178688, 0.037188224494457245, 0.013419102877378464, -0.043616920709609985, -0.05517610162496567, 0.05826905369758606, 0.05197039991617203, 0.08208000659942627, -0.00247342512011528, -0.029205329716205597, 0.03228474780917168, -0.05910790339112282, 0.012018050998449326, -0.08792360872030258, 0.008090213872492313, -0.04621456563472748, -0.0658925324678421, 0.000879487837664783, -0.030980514362454414, -0.012192380614578724, -0.046992331743240356, -0.11591973155736923, 0.004147600848227739, 0.03641620650887489, -0.0351109616458416, -0.038682352751493454, -0.04160906746983528, 0.011972837150096893, -0.0038885287940502167, -0.0019629797898232937, 0.03999999538064003, 0.0024332921020686626, -0.05146748200058937, -0.025221677497029305, -0.01210187841206789, 0.07152296602725983, -0.007223051972687244, 0.07147137075662613, 0.05324466526508331, 0.085813969373703, 0.08757618069648743, -0.05783049762248993, 0.019716866314411163, -0.0637081190943718, 0.052629318088293076, -0.06141090765595436, 0.030259549617767334, 0.02137230522930622, -0.08696772903203964, 0.04062332212924957, -0.02397577092051506, -0.03939403221011162, 0.015029301866889, -0.05852457135915756, 0.017939060926437378, 0.060807276517152786, -0.027133313938975334, 0.10431168973445892, -0.01632608100771904, -0.0938047394156456, 0.07459057122468948, 0.03351498767733574, 0.0416346974670887, 0.030323883518576622, 0.03408031910657883, 0.043938588351011276, -0.0007355590350925922, 0.00623753946274519, 0.005219866055995226, 0.08351340889930725, 0.006946944631636143, -0.00565889710560441, 0.046357426792383194, -0.0006702952669002116, -0.14928600192070007, 0.031859446316957474, -0.09112877398729324, -0.027153685688972473, -0.025191932916641235, -0.02650350332260132, -0.03415760397911072, -0.004771452862769365, -0.07242727279663086, 0.1456679254770279, 0.002843528753146529, 0.015492320992052555, -0.038183923810720444, -0.002081091282889247, 0.03539783135056496, 0.08284939080476761, 0.00634688138961792, 0.028731850907206535, -0.0933271199464798, -0.02784268744289875, -0.011562801897525787, -0.024463020265102386, 0.021253015846014023, -0.030017727985978127, 0.012804903090000153, 0.03518376499414444, -0.03897687792778015, 0.025564147159457207, -0.05118795484304428, 0.06123564392328262, 0.0011697467416524887, -0.010942880995571613, 0.034677762538194656, 0.003323690500110388, 0.0026042230892926455, 0.023442314937710762, 0.041134703904390335, -0.06974668055772781, 0.0024242785293608904, -0.055618658661842346, 0.0024871339555829763, -0.013544469140470028, 0.010144275613129139, 0.04210280999541283, 0.06912937015295029, 0.00017201736045535654, -0.01727677881717682, -0.01886366493999958, -0.023366393521428108, -0.0002584551402833313, -0.042021121829748154, 0.010705624707043171, -0.018137801438570023, 0.04346413165330887, -0.05888618528842926, -0.031704649329185486, -0.017778977751731873, -0.013714529573917389, 0.04495427384972572, 0.053511589765548706, 0.005456344224512577, -0.0044315289705991745, -0.013137121684849262, 0.030477389693260193, 0.031795892864465714, 0.07763217389583588, -0.00628443481400609, 0.0004963267128914595, -0.01323201134800911, 0.012171478010714054, -0.03461465612053871, 0.028648626059293747, 0.03811492770910263, 0.006735066417604685, -0.016711704432964325, 0.0037478746380656958, -0.04856101796030998, -0.02465251088142395, 0.01892191357910633, -0.0009694790351204574, 0.012898002751171589, -0.0019224899588152766, -0.007845538668334484, 0.02906438335776329, 0.0030073572415858507, 0.014078373089432716, -0.02143472246825695, 0.003857335774227977, -0.036149974912405014, 0.03071623109281063, 0.00922023318707943, -0.0023895271588116884, -0.0024685689713805914, -0.0028807104099541903, 0.040201716125011444, 0.006200823932886124, -0.0030409544706344604, -0.10610368847846985, -0.013515965081751347, 0.030345065519213676, 0.0048427521251142025, -0.03028980642557144, -0.007214970886707306, 0.026680031791329384, -0.012728880159556866, -0.0010046983370557427, 0.023027662187814713, 0.005284575745463371, 0.010693307965993881, 0.05721578374505043, -0.010914236307144165, -0.01951204612851143, -0.02740817330777645, -0.010141332633793354, -0.0024984816554933786, 0.032722108066082, 0.013292066752910614, -0.06092386692762375, 0.03775933012366295, -0.0014982435386627913, -0.01659156195819378, 0.03430275246500969, 0.022888515144586563, 0.06475405395030975, -0.04091920703649521, 0.022879190742969513, -0.017154499888420105, -0.026031967252492905, -0.02931966446340084, -0.01028706319630146, -0.013057297095656395, -0.05635833740234375, 0.01785418577492237, -0.03233015164732933, -0.022440120577812195, 0.025598298758268356, 0.02025207318365574, 0.0277705118060112, 0.04630623385310173, 0.04696684330701828, -0.00036972289672121406, 0.016885554417967796, 0.0009430907666683197, -0.01767590269446373, 0.009837247431278229, 0.005029338411986828, -0.04246321693062782, -0.00019496558525133878, 0.018078943714499474, -0.017026333138346672, 0.015125222504138947, 0.01070382073521614, 0.0038780360482633114, 0.01578219048678875, 0.05212245136499405, 0.051696062088012695, -0.07401782274246216, -0.03232427313923836, 0.0006109925452619791, 0.010205484926700592, 0.047165725380182266, -0.03041430376470089, 0.07016266137361526, 0.06338991224765778, -0.009804057888686657, -0.016887106001377106, 0.01731589064002037, 0.022616686299443245, 0.04680407792329788, 0.016184212639927864, 0.013630673289299011, -0.0016275246161967516, 0.012472925707697868, -0.002150357700884342, -0.005859347525984049, 0.047722794115543365, 0.02024279162287712, 0.0028823434840887785, -0.007811995688825846, -0.009638253599405289, -0.025731120258569717, 0.016280803829431534, 0.020070694386959076, -0.015382369048893452, -0.005099690984934568, -0.0222164336591959, 0.04966219887137413, -0.00007902814832050353, -0.01929001696407795, 0.01784352958202362, 0.000050960483349626884, 0.010914242826402187, -0.008101973682641983, 0.060018833726644516, 0.028909018263220787, 0.029009941965341568, 0.051310405135154724, 0.01819174736738205, -0.023615816608071327, -0.031443290412425995, 0.03427320346236229, -0.03457366302609444, 0.026366377249360085, 0.0017765741795301437, -0.053681667894124985, -0.0006234000902622938, -0.023313989862799644, 0.015527613461017609, -0.017395256087183952, 0.012983604334294796, 0.00005038090966991149, 0.010812581516802311, 0.05131371691823006, 0.014698837883770466, -0.013454156927764416, -0.03752138093113899, 0.037975892424583435, -0.04362288862466812, 0.011785473674535751, -0.017831427976489067, -0.01973041519522667, -0.00011966250895056874, 0.018859704956412315, 0.0025900728069245815, 0.055145133286714554, 0.0036992200184613466, -0.018247276544570923, -0.036307480186223984, -0.0188024640083313, 0.00745166651904583, -0.008848880417644978, 0.01663704589009285, 0.010845515877008438, -0.06796763837337494, 0.03833465278148651, -0.00099781749304384, -0.02163075841963291, 0.018961193040013313, -0.0005811167065985501, 0.008384482003748417, -0.02877468802034855, 0.003745828289538622, 0.00036097472184337676, -0.0030252719298005104, -0.03376292437314987, -0.025611942633986473, 0.020970402285456657, 0.04943779855966568, -0.009345902130007744, -0.03536750003695488, 0.005703094881027937, 0.024253156036138535, -0.017855027690529823, 0.015181886963546276, 0.022190947085618973, -0.0020731971599161625, 0.05899706110358238, 0.04094548150897026, 0.01439567469060421, -0.004551085177809, 0.011097719892859459, 0.03645296394824982, 0.04263769090175629, -0.01242588646709919, -0.05924036726355553, 0.011424117721617222, 0.008071019314229488, -0.05643909052014351, 0.02814990095794201, 0.013712289743125439, -0.05287524312734604, 0.009062577970325947, 0.027707042172551155, 0.03846356272697449, 0.029595188796520233, 0.012876548804342747, -0.040327321738004684, -0.05481806769967079, -0.023730458691716194, 0.017288601025938988, -0.030148835852742195, -0.032432571053504944, 0.04061730578541756, 0.045892417430877686, 0.03722861409187317, -0.01846364326775074, 0.020171212032437325, 0.019524140283465385, 0.015397817827761173, 0.003403719048947096, -0.0642658993601799, 0.012309892103075981, -0.03462950140237808, 0.0012381899869069457, -0.005289188586175442, 0.05341983586549759, 0.008685071021318436, -0.02206387184560299, 0.040236618369817734, -0.0358966700732708, -0.04186508432030678, 0.03194910287857056, 0.011235272511839867, 0.024160511791706085, 0.007559014484286308, 0.038879550993442535, -0.017379624769091606, 0.0034486274234950542, -0.030652033165097237, -0.012860131449997425, 0.006351786199957132, 0.022117741405963898, -0.0362350195646286, -0.02635788545012474, 0.009799379855394363, 0.020644770935177803, 0.025827346369624138, 0.001309629064053297, -0.054902333766222, -0.029786989092826843, 0.016718780621886253, 0.02777005359530449, -0.023325784131884575, 0.010566290467977524, -0.03533829748630524, -0.04816731810569763, 0.01989276334643364, 0.027715088799595833, -0.005036403425037861, 0.005451553966850042, 0.05514451488852501, 0.00360393850132823, -0.0014411001466214657, -0.04684539511799812, 0.06841462105512619, 0.030076291412115097, -0.029380396008491516, -0.0021950567606836557, -0.044498056173324585, -0.027887757867574692, -0.01251262053847313, -0.0030091924127191305, 0.030982211232185364, 0.04371879994869232, -0.013165589421987534, -0.005675759632140398, 0.038476597517728806, 0.0451585054397583, -0.019505444914102554, 0.02523699216544628, -0.01969984360039234, 0.008680252358317375, 0.030428867787122726, 0.024517560377717018, -0.023341435939073563, -0.027589263394474983, -0.0031686564907431602, 0.030645964667201042, -0.028563659638166428, 0.00495984498411417, 0.013102294877171516, -0.04578767716884613, 0.01245600450783968, 0.04206061735749245, -0.018020156770944595, -0.011252840980887413, 0.0036105888430029154, 0.030466480180621147, 0.024872973561286926, -0.004955223761498928, -0.0231095552444458, -0.028417686000466347, -0.029117979109287262, -0.0002061585837509483, 0.051328495144844055, -0.03833990544080734, -0.008465586230158806, 0.021742822602391243, 0.04670033976435661, 0.022335967049002647, 0.02817368507385254, 0.007392821367830038, 0.018585391342639923, 0.0726824402809143, -0.007669173646718264, 0.01351241860538721, -0.003438660642132163, 0.018467174842953682, 0.014810268767178059, 0.04360060393810272, 0.022500203922390938, -0.01233880128711462, -0.006946046836674213, 0.032560206949710846, -0.024527322500944138, 0.02444070763885975, -0.027368156239390373, 0.04976360872387886, 0.020013976842164993, 0.017167329788208008, -0.03451601415872574, 0.03600623831152916, 0.02497098036110401, -0.034597110003232956, 0.00995146855711937, -0.00024601700715720654, 0.010971535928547382, 0.019198458641767502, 0.04941346123814583, -0.023574713617563248, -0.021339626982808113, 0.012938512489199638, 0.019019806757569313, 0.003547550644725561, -0.020501121878623962, -0.021739356219768524, 0.00903471652418375, 0.010640389285981655, -0.008363260887563229, 0.00477980449795723, 0.00020852814486715943, -0.050614405423402786, -0.05981886014342308, 0.0018435507081449032, 0.0013366041239351034, -0.004586727824062109, -0.016865910962224007, -0.0065039475448429585, -0.018294036388397217, 0.010258476249873638, -0.007900853641331196, 0.0002471666084602475, 0.0028246701695024967, 0.012024725787341595, 0.0027592750266194344, -0.002575463382527232, 0.007899395190179348, -0.013342916034162045, 0.0025294157676398754, -0.047265950590372086, 0.006444054190069437, -0.0035484626423567533, -0.010155200958251953, 0.0038623535074293613, -0.0215105339884758, -0.0021192249841988087, 0.006767288316041231, 0.03680127486586571, 0.03165552020072937, -0.040382664650678635, 0.03495556488633156, -0.004154139664024115, -0.027922216802835464, -0.05182347446680069, -0.05738810822367668, -0.0015134834684431553, 0.02392633631825447, 0.015723204240202904, 0.04573553800582886, 0.020862111821770668, -0.03405369445681572, -0.022563956677913666, -0.016732290387153625, -0.00428103469312191, 0.02669793739914894, 0.005980708636343479, 0.006599995773285627, -0.033974017947912216, -0.0010496199829503894, -0.008391456678509712, 0.03582829236984253, -0.015008772723376751, -0.00837874785065651, 0.04772372171282768, 0.027335219085216522, -0.08746473491191864, 0.016722625121474266, 0.021552670747041702, -0.028213433921337128, 0.026556802913546562, 0.028103584423661232, 0.022889070212841034, 0.030222231522202492, -0.04807323217391968, 0.003383943345397711, -0.009389490820467472, 0.013942795805633068, -0.04145488142967224, -0.011044635437428951, -0.042412254959344864, 0.0207758080214262, 0.004495813511312008, 0.0013770831283181906, -0.021992117166519165, -0.02198077365756035, -0.009164422750473022, -0.03709550201892853, -0.041839588433504105, -0.010458111763000488, 0.0819123312830925, 0.01822390779852867, 0.0014385883696377277, -0.024115270003676414, -0.017623936757445335, -0.007052813656628132, -0.047733403742313385, 0.04138416796922684, 0.04142690822482109, -0.004231972619891167, -0.021902769804000854, -0.03922417014837265, -0.019344089552760124, -0.018163297325372696, -0.05477728694677353, 0.017659110948443413, 0.0657237321138382, -0.03286057338118553, -0.045309264212846756, 0.019308118149638176, -0.004246526397764683, 0.03964463993906975, 0.04563778638839722, 0.005994413513690233, 0.007648652885109186, -0.010738683864474297, 0.019093956798315048, -0.058838002383708954, -0.028744924813508987, -0.00939101167023182, -0.022862831130623817, 0.005085452925413847, 0.0299531240016222, 0.03946651890873909, -0.015326610766351223, 0.010214039124548435, 0.040368229150772095, -0.005113915074616671, -0.005326717626303434, -0.02630203776061535, -0.02716417983174324, 0.017595630139112473, -0.027388006448745728, -0.05072128027677536, -0.018019039183855057, 0.043892960995435715, -0.01461463887244463, 0.033438608050346375, 0.03847195953130722, 0.03665650263428688, -0.007368823513388634, 0.02657315507531166, -0.02145915850996971, 0.04999839887022972, 0.04232669249176979, -0.018418582156300545, 0.010571504943072796, -0.018644973635673523 ]
Deploying the AI Comic Factory using the Inference API
jbilcke-hf
October 2, 2023
ai-comic-factory
guide, inference, api, llm, stable-diffusion
https://huggingface.co/blog/ai-comic-factory
Getting started First, ensure that you sign up for a PRO Hugging Face account, as this will grant you access to the Llama-2 and SDXL models.
[ 0.04187081754207611, 0.0002106963365804404, 0.05587099865078926, 0.025840388610959053, 0.11632250249385834, 0.0012655832106247544, 0.03309233486652374, 0.028088655322790146, 0.010434267111122608, -0.04933441802859306, -0.03107220120728016, 0.05173302814364433, -0.06026790291070938, 0.04988839849829674, 0.04187409207224846, -0.07426914572715759, 0.016984866932034492, 0.03152797743678093, 0.03165591508150101, 0.052217308431863785, 0.03099246136844158, -0.07942909747362137, 0.0026542542036622763, -0.04031024128198624, -0.02685770019888878, -0.07949373871088028, 0.02631152793765068, 0.07415048032999039, 0.031912073493003845, -0.030513616278767586, -0.0633244514465332, -0.029438605532050133, 0.009624002501368523, -0.03649475798010826, 0.0851774588227272, 0.041690945625305176, -0.13598142564296722, 0.042233582586050034, 0.019821517169475555, -0.058299869298934937, -0.016295824199914932, -0.022674351930618286, -0.05253245681524277, 0.06990183889865875, -0.0445251539349556, -0.05979849770665169, -0.1948961317539215, 0.061774011701345444, -0.005890667904168367, 0.0328526645898819, -0.04219697788357735, 0.048952389508485794, 0.014613696373999119, -0.03394328057765961, 0.03233134374022484, -0.003422992769628763, -0.006626170594245195, -0.01583247445523739, 0.022404715418815613, 0.017275597900152206, 0.05746842175722122, -0.0032616977114230394, 0.008579506538808346, -0.028223982080817223, 0.00010210702748736367, -0.004971987102180719, 0.024058066308498383, -0.053023021668195724, -0.06196112185716629, -0.039376404136419296, 0.021056776866316795, -0.04886845126748085, -0.04551728442311287, -0.031389325857162476, 0.06876058876514435, -0.09030470997095108, -0.02634832076728344, 0.053001292049884796, 0.0844021737575531, 0.06662876158952713, -0.0028102060314267874, 0.018523499369621277, 0.059688501060009, 0.06270605325698853, -0.012497681193053722, 0.012021014466881752, 0.05616811662912369, -0.06151049956679344, -0.020532505586743355, 0.08397915214300156, -0.008812683634459972, -0.07357398420572281, -0.027640601620078087, -0.01418596226722002, 0.09906189888715744, -0.04877116531133652, -0.003761117812246084, -0.0013604932464659214, 0.035742733627557755, -0.02348150685429573, -0.0436859168112278, -0.03910229727625847, -0.008259122259914875, -0.050162751227617264, -0.052378810942173004, -0.0033624302595853806, -0.06327168643474579, -0.055779293179512024, -0.04515025019645691, -0.007046783808618784, -0.003737518796697259, -0.004716356750577688, 0.06344734132289886, 0.03427368402481079, -0.08043691515922546, 0.04069649800658226, 0.028464172035455704, 0.0007408807869069278, 0.017682848498225212, 0.01866747997701168, 0.014071336947381496, 0.1107841283082962, 0.028682662174105644, -0.0075800782069563866, 0.041522860527038574, 0.06311523914337158, 0.002645655069500208, 0.01738213188946247, -0.006695125252008438, -0.036236923187971115, -0.02450500801205635, -0.04118578881025314, 0.06132759898900986, -0.028297506272792816, 0.04630750045180321, -0.044825054705142975, -0.03821969032287598, -0.04345059394836426, 0.04619929939508438, -0.016727076843380928, -0.025317814201116562, 0.08443047851324081, 0.01833450421690941, 0.011056584306061268, 0.07485702633857727, -0.024666041135787964, -0.07524365186691284, 0.06801163405179977, -0.10212040692567825, 0.014789502136409283, -0.03871564567089081, 0.009303434751927853, -0.057909294962882996, -0.03634956479072571, 0.021736888214945793, 0.006108478177338839, -0.029077837243676186, -0.007251458242535591, -0.07564537972211838, 0.006879487540572882, 0.017361829057335854, -0.007292632013559341, -0.08682350814342499, 0.033098574727773666, 0.056299980729818344, -0.012048903852701187, -0.010396208614110947, -0.015293417498469353, -0.007437781896442175, -0.062232133001089096, 0.0468938909471035, -0.031878769397735596, 0.03999781236052513, 0.002692370442673564, -0.0058257500641047955, 0.04793335497379303, 0.07707439363002777, 0.05063065141439438, -0.013252767734229565, 0.002480413531884551, -0.022029604762792587, 0.03783842548727989, -0.045865368098020554, 0.04645371809601784, 0.0438232421875, -0.06520109623670578, 0.02120641991496086, -0.008879529312252998, -0.03235750272870064, -0.0434885174036026, -0.04581412300467491, -0.014956502243876457, 0.04368980601429939, -0.01820691116154194, -0.017145827412605286, -0.04701565206050873, -0.044750068336725235, 0.09879244118928909, 0.037993915379047394, 0.06723083555698395, 0.0437457337975502, 0.038574300706386566, 0.03595222160220146, 0.006195730064064264, -0.0607306994497776, 0.01878630556166172, 0.05552896112203598, -0.035549916326999664, -0.0012231019791215658, 0.03714868053793907, 0.030591221526265144, -0.14255358278751373, 0.04651825875043869, -0.04215357080101967, 0.03377281129360199, -0.03610869497060776, -0.01387602649629116, 0.0010459647746756673, 0.03480130061507225, -0.014704596251249313, 0.10925513505935669, -0.027480220422148705, -0.030181214213371277, -0.023626241832971573, -0.029626501724123955, 0.08200781047344208, 0.09734989702701569, 0.034663375467061996, 0.02803928032517433, -0.11120863258838654, -0.022248413413763046, -0.044904690235853195, 0.012997504323720932, 0.08083883672952652, 0.0006613492150790989, -0.023776711896061897, 0.011852150782942772, -0.07181825488805771, 0.030227109789848328, 0.019438179209828377, 0.011694087646901608, -0.007110757753252983, 0.00597693445160985, -0.012662138789892197, -0.01380226667970419, -0.06571032106876373, 0.0033993704710155725, 0.031613051891326904, -0.0645751878619194, 0.014309322461485863, -0.09004399925470352, 0.03823985531926155, 0.04234045371413231, 0.02658206783235073, 0.02841637283563614, 0.019649861380457878, -0.01779458113014698, 0.006777971982955933, -0.023319123312830925, 0.03545491397380829, 0.030434058979153633, -0.013672685250639915, -0.02836587280035019, -0.04562483727931976, -0.039100661873817444, -0.032605964690446854, -0.012604964897036552, -0.012301268987357616, -0.024260947480797768, 0.028389018028974533, 0.03853001073002815, -0.05275654047727585, 0.04499435797333717, 0.009646939113736153, 0.015063553117215633, -0.01294296607375145, 0.05386853590607643, 0.0032416917383670807, -0.014567162841558456, -0.015485231764614582, 0.0429854653775692, 0.0066360970959067345, 0.06229269504547119, 0.049380477517843246, 0.008292975835502148, -0.03151499852538109, 0.004775612615048885, -0.0464998222887516, -0.03993696719408035, 0.011578666977584362, -0.01032966747879982, 0.02917717769742012, -0.026218943297863007, -0.014588952995836735, -0.02832614630460739, -0.0366702675819397, 0.04752776771783829, 0.011732305400073528, -0.015589616261422634, 0.020716527476906776, 0.017355874180793762, -0.0008764023659750819, 0.00928141362965107, -0.028373247012495995, -0.030522363260388374, -0.012180334888398647, 0.028701376169919968, -0.01929003931581974, -0.11934410780668259, -0.02756565622985363, -0.008336328901350498, 0.010239788331091404, -0.014811055734753609, -0.029011573642492294, 0.03516814485192299, -0.044451821595430374, -0.0311634112149477, 0.013359402306377888, -0.013404605910182, 0.024622632190585136, 0.014224152080714703, -0.033119428902864456, -0.002173338085412979, -0.027601046487689018, 0.013803206384181976, -0.0028900867328047752, 0.057633765041828156, 0.006666346453130245, -0.003660845337435603, 0.07550462335348129, -0.009867046028375626, 0.0029853140003979206, 0.000007210645435407059, 0.015784060582518578, 0.03966210409998894, 0.004555112682282925, 0.02313217706978321, -0.023015709593892097, -0.0022967681288719177, -0.013905899599194527, -0.03209679201245308, 0.017855579033493996, -0.08053520321846008, 0.005109763704240322, -0.01093890517950058, 0.005736446939408779, 0.07555408775806427, -0.0026695416308939457, 0.03281347453594208, 0.006595146376639605, 0.03563142195343971, -0.014434839598834515, -0.04359075799584389, 0.014557713642716408, -0.0027633258141577244, -0.002932104980573058, 0.03971267119050026, 0.0034658825024962425, 0.0023859739303588867, 0.0334465317428112, 0.017480915412306786, 0.05960390344262123, 0.008798875845968723, 0.019958047196269035, 0.03135306015610695, 0.04296300932765007, -0.0013061383506283164, -0.027289751917123795, -0.06955830752849579, -0.0048846290446817875, -0.012345114722847939, 0.04686620831489563, -0.0006693594623357058, 0.043180570006370544, 0.04552490636706352, -0.007345552556216717, -0.0041120462119579315, 0.02883399836719036, -0.002306332578882575, 0.022324297577142715, -0.013394549489021301, 0.013886217027902603, 0.006924609187990427, 0.025516696274280548, -0.010953838936984539, -0.040608037263154984, 0.04724445566534996, -0.0010453849099576473, -0.006764622405171394, -0.01778552494943142, 0.0028497381135821342, -0.03004336915910244, 0.002752399304881692, 0.0025568183045834303, 0.006151036825031042, 0.0038291113451123238, 0.00920588057488203, 0.07507814466953278, 0.005080309230834246, -0.008448883891105652, 0.016985146328806877, -0.004313773009926081, 0.02238697186112404, -0.00402025505900383, 0.03826257959008217, -0.009086503647267818, -0.004725324455648661, 0.03025212697684765, 0.021438052877783775, -0.001492425100877881, -0.010941105894744396, 0.014820989221334457, -0.0005105658201500773, 0.03070344403386116, -0.005913180764764547, -0.08281378448009491, 0.0274411141872406, -0.016198916360735893, -0.008114781230688095, -0.040717221796512604, 0.025101283565163612, -0.017716696485877037, -0.018460584804415703, 0.00725982990115881, -0.0006191645516082644, -0.009799492545425892, -0.058692701160907745, 0.0384456031024456, -0.02132546342909336, 0.01847895234823227, -0.014447345398366451, -0.04115172103047371, 0.04042892903089523, -0.027262868359684944, 0.00855083018541336, 0.04647083207964897, -0.008054258301854134, 0.01271100528538227, -0.03557003289461136, -0.05104552209377289, 0.035456858575344086, -0.015457473695278168, -0.008894444443285465, -0.004332595504820347, -0.03982779011130333, 0.029042931273579597, -0.009139073081314564, -0.04689004644751549, 0.0069908746518194675, 0.009602069854736328, 0.06489132344722748, -0.00645535858348012, 0.04130684584379196, -0.00006939110608072951, -0.008877688087522984, 0.017401713877916336, -0.02738623507320881, 0.008168964646756649, 0.02440437115728855, -0.04466279223561287, 0.0015780627727508545, 0.05552991107106209, -0.00535503588616848, 0.0075168367475271225, 0.033196549862623215, 0.012358410283923149, -0.0032486477866768837, 0.020590178668498993, -0.017933813855051994, -0.041118424385786057, -0.0473715178668499, 0.04995729401707649, 0.038505516946315765, -0.014150016009807587, -0.009304886683821678, -0.055098745971918106, 0.005585221573710442, -0.0016879054019227624, -0.030919987708330154, -0.004721619188785553, 0.04269559681415558, -0.03720707446336746, -0.011828071437776089, 0.02983287163078785, 0.08778849244117737, -0.012029397301375866, 0.02220654860138893, 0.03391111642122269, -0.05195704847574234, -0.03431735932826996, 0.02828419953584671, -0.011160941794514656, 0.005928648170083761, 0.01031828299164772, 0.0599677711725235, 0.02762596867978573, 0.04327047988772392, 0.01950087584555149, -0.0048032584600150585, -0.012563834898173809, 0.010918872430920601, -0.03304951637983322, 0.010974857024848461, -0.0004599604581017047, 0.014449340291321278, -0.004114707000553608, 0.008878867141902447, -0.018386557698249817, -0.006465306039899588, 0.009283732622861862, -0.05136988312005997, -0.023100513964891434, 0.0050940862856805325, 0.003847519401460886, 0.00012501649325713515, -0.019029824063181877, 0.037589430809020996, -0.03162205591797829, -0.016751110553741455, 0.0009817295940592885, 0.010612176731228828, -0.01710626296699047, -0.013320240192115307, -0.024933231994509697, -0.06127138063311577, 0.028565485030412674, 0.02371150813996792, -0.009602620266377926, 0.03232019022107124, -0.012166831642389297, -0.012970926240086555, -0.0024975286796689034, 0.028257621452212334, -0.01134243793785572, -0.02359575219452381, 0.04179013520479202, -0.01958325132727623, 0.028254123404622078, 0.02211327850818634, -0.005763206630945206, 0.030658898875117302, 0.030291887000203133, -0.007228586357086897, 0.03961791843175888, -0.04669187590479851, 0.005582503974437714, 0.013600056059658527, -0.010386290960013866, 0.007603177800774574, -0.010807080194354057, -0.03980512544512749, -0.026643160730600357, -0.015227306634187698, 0.019352275878190994, 0.05909951031208038, -0.009738687425851822, 0.017590805888175964, -0.0032126319129019976, 0.012642115354537964, -0.0035016026813536882, 0.023419929668307304, -0.003100953297689557, 0.018165847286581993, 0.04365914314985275, 0.020596737042069435, 0.011314666830003262, 0.019574344158172607, -0.021409904584288597, 0.00717177614569664, -0.05898608639836311, 0.014694174751639366, 0.047004032880067825, -0.00822981633245945, 0.00873042643070221, -0.005376186687499285, -0.03414113074541092, -0.01309206523001194, 0.044666826725006104, 0.000006574883173016133, 0.015107164159417152, 0.033811304718256, -0.0057362099178135395, -0.0392155684530735, -0.03557828813791275, 0.01374988816678524, 0.029180314391851425, -0.007380661554634571, 0.02624558098614216, -0.0018932921811938286, 0.025501755997538567, 0.0550394207239151, 0.02086571417748928, -0.009385732002556324, 0.07108574360609055, 0.07475452870130539, 0.00800066627562046, 0.043185099959373474, 0.019832195714116096, -0.0275031216442585, -0.032576389610767365, -0.006402755156159401, -0.022988075390458107, -0.017301803454756737, 0.0023080245591700077, 0.01822294108569622, -0.022523995488882065, 0.005814358592033386, -0.06250686943531036, 0.07791989296674728, 0.05804651603102684, 0.03109274059534073, -0.026619553565979004, 0.021934958174824715, -0.008860875852406025, -0.004470855928957462, 0.008154664188623428, -0.007286505773663521, -0.003909938968718052, 0.006827396806329489, 0.02209463343024254, -0.010819741524755955, 0.022276468575000763, 0.01722746528685093, 0.02905908040702343, 0.032975517213344574, 0.0033793419133871794, 0.01596318557858467, -0.004377837758511305, 0.006314687896519899, -0.017282266169786453, -0.01814781129360199, 0.016279375180602074, -0.04083753377199173, -0.05653470754623413, -0.000119871023343876, 0.015636468306183815, 0.00035928923171013594, -0.01258892472833395, 0.042366571724414825, 0.021280702203512192, 0.011527618393301964, -0.018088139593601227, -0.0003649163991212845, 0.039989225566387177, 0.016774645075201988, -0.0027116562705487013, -0.017855551093816757, -0.03128516674041748, -0.005941541399806738, -0.004655138123780489, -0.0353369414806366, 0.03850908949971199, 0.010933325625956059, -0.02684945799410343, -0.004964551422744989, -0.007568801753222942, 0.011557286605238914, 0.046944886445999146, 0.015080776996910572, 0.008021687157452106, -0.02027307264506817, 0.016605379059910774, -0.00856856070458889, -0.007398519665002823, -0.03282570838928223, -0.055686648935079575, 0.032935235649347305, -0.0054672230035066605, -0.016865171492099762, 0.058890629559755325, 0.010613136924803257, 0.0028938204050064087, -0.026232946664094925, -0.019904522225260735, -0.046397048979997635, -0.007873623631894588, 0.05269185081124306, -0.012778518721461296, -0.028213076293468475, 0.008448946289718151, 0.01158161461353302, 0.03091699630022049, -0.004931399133056402, 0.019749050959944725, 0.015767371281981468, 0.001364699681289494, -0.01111428253352642, -0.00342367822304368, 0.07240018993616104, -0.015679268166422844, 0.009975409135222435, 0.027202710509300232, 0.022379523143172264, 0.007349892519414425, -0.03739144653081894, 0.019405968487262726, -0.012330947443842888, 0.03098311461508274, -0.029644301161170006, -0.04004498943686485, 0.0035425906535238028, -0.038692083209753036, 0.0024965268094092607, 0.013477456755936146, -0.03819418326020241, -0.03820602223277092, -0.01127142645418644, -0.02355516329407692, 0.004439142998307943, 0.009125981479883194, 0.05111449584364891, 0.045749299228191376, 0.014875785447657108, 0.026075322180986404, -0.00968430656939745, 0.029233073815703392, -0.022770486772060394, 0.01898220367729664, 0.03844483941793442, -0.026420658454298973, -0.032208580523729324, -0.03439359739422798, 0.02259824424982071, -0.0030280454084277153, -0.06966469436883926, 0.020327389240264893, 0.007311108056455851, -0.013665148057043552, -0.00681952154263854, -0.028194541111588478, -0.0026630540378391743, 0.004631194286048412, 0.04202519357204437, -0.01292048767209053, -0.0163593590259552, 0.0008366730180568993, 0.010693969205021858, -0.058357033878564835, 0.01980973780155182, 0.01973281055688858, 0.008892890065908432, 0.005202325526624918, -0.0038147359155118465, -0.0019166456768289208, -0.018373312428593636, -0.007859822362661362, 0.01509648747742176, 0.03559663146734238, -0.00942801684141159, 0.006683648563921452, 0.009076826274394989, 0.03897424787282944, 0.01647784374654293, -0.053006112575531006, -0.006128471344709396, -0.007476856000721455, -0.022249290719628334, -0.018090378493070602, -0.012890497222542763, -0.011700348928570747, 0.0094652334228158, -0.004173237830400467, -0.010042522102594376, 0.08114984631538391, 0.008665286935865879, -0.012107587419450283, -0.007272941060364246, -0.0004625551518984139 ]
Deploying the AI Comic Factory using the Inference API
jbilcke-hf
October 2, 2023
ai-comic-factory
guide, inference, api, llm, stable-diffusion
https://huggingface.co/blog/ai-comic-factory
How the AI Comic Factory works The AI Comic Factory is a bit different from other Spaces running on Hugging Face: it is a NextJS application, deployed using Docker, and is based on a client-server approach, requiring two APIs to work: - a Language Model API (Currently Llama-2) - a Stable Diffusion API (currently SDXL 1.0)
[ -0.0013633532216772437, -0.058717284351587296, 0.05330011621117592, -0.02912808023393154, 0.05651593580842018, 0.06154422089457512, -0.019065292552113533, 0.07681649178266525, -0.012664848007261753, -0.05525136739015579, -0.0993274673819542, 0.04214105382561684, -0.08001862466335297, 0.0994855985045433, -0.025455230847001076, -0.04795830696821213, 0.008988133631646633, -0.023432865738868713, -0.0387735478579998, 0.02842925488948822, -0.03418290615081787, -0.05904747545719147, 0.015141308307647705, -0.07160983234643936, -0.013713383115828037, -0.02094234712421894, -0.022996805608272552, 0.0010257664835080504, 0.013622966594994068, -0.060982149094343185, -0.062308501452207565, -0.017532052472233772, -0.0055734566412866116, -0.026686616241931915, 0.060104575008153915, -0.01639159768819809, -0.11816756427288055, 0.057482507079839706, 0.021385716274380684, -0.05325538292527199, -0.031031735241413116, -0.002816969295963645, -0.07409067451953888, 0.05401187017560005, -0.019707707688212395, 0.016694389283657074, -0.09916391968727112, 0.08721394836902618, -0.028384657576680183, 0.02238396927714348, -0.027476537972688675, 0.023209016770124435, -0.03456861898303032, -0.005038381088525057, -0.004990103654563427, 0.06250786781311035, -0.03733621910214424, -0.0031969668343663216, 0.04039570689201355, 0.03481245040893555, 0.032824836671352386, -0.01137616764754057, 0.037061724811792374, -0.02460860088467598, 0.01882406696677208, 0.02362579107284546, 0.024297159165143967, -0.004185732454061508, -0.0368071049451828, -0.058927230536937714, -0.0043784743174910545, 0.011585218831896782, -0.035117339342832565, -0.0004123369581066072, 0.0440710224211216, -0.028229258954524994, -0.04671112820506096, 0.10218194872140884, 0.019574835896492004, 0.01143574807792902, -0.05295640975236893, 0.03569738566875458, 0.02684365026652813, 0.07329430431127548, -0.009542351588606834, 0.035225752741098404, 0.01913684606552124, -0.05764390900731087, -0.07529869675636292, 0.0024251574650406837, 0.010353153571486473, -0.09135976433753967, -0.08973539620637894, 0.0464022234082222, 0.08935776352882385, 0.030285334214568138, 0.004003442823886871, 0.08015269786119461, -0.012523467652499676, 0.009514805860817432, 0.000950939953327179, -0.023907754570245743, -0.03554388880729675, -0.05143098905682564, -0.07088380306959152, 0.05861424654722214, -0.00231053470633924, -0.08227422088384628, -0.025566155090928078, -0.03629070147871971, 0.018684232607483864, -0.06584662199020386, 0.005459508392959833, 0.05020803213119507, -0.10546643286943436, 0.014749745838344097, -0.03634597361087799, -0.0221030842512846, -0.026460275053977966, 0.058798857033252716, 0.04828691482543945, 0.042557183653116226, 0.03783860430121422, 0.001215619035065174, 0.008522904478013515, 0.013446570374071598, -0.04859861359000206, 0.0273548886179924, -0.00732529116794467, -0.01871013268828392, 0.06658807396888733, -0.10490640997886658, 0.04311028867959976, 0.017491821199655533, 0.0498766265809536, -0.0373607873916626, -0.05976560711860657, 0.011064965277910233, 0.04914567247033119, 0.011158580891788006, -0.005509639624506235, 0.028385458514094353, 0.058191269636154175, 0.05996223911643028, 0.07952708750963211, -0.0549049973487854, -0.024691252037882805, -0.0011869237059727311, -0.03280866891145706, -0.02407461404800415, -0.07529007643461227, -0.03656226396560669, -0.006604666355997324, -0.0326872244477272, -0.03413846343755722, -0.03071541339159012, -0.013713458552956581, -0.004380212165415287, -0.03526442497968674, -0.0010735713876783848, -0.006513960659503937, -0.02218807302415371, -0.09992850571870804, -0.029095331206917763, 0.016438700258731842, -0.009171503596007824, -0.0625235065817833, 0.0446476973593235, 0.005475333891808987, -0.013848396018147469, -0.024846095591783524, 0.002507108263671398, 0.02526627667248249, -0.024502938613295555, 0.0937298908829689, 0.03933979943394661, 0.08791325986385345, 0.056615959852933884, 0.0018654554150998592, 0.051118236035108566, -0.0190125759691, 0.10520284622907639, 0.04505515098571777, 0.06532709300518036, 0.02045065350830555, -0.08495252579450607, 0.004280133172869682, 0.0010072864824905992, -0.04107920080423355, 0.01893506571650505, 0.005571715068072081, 0.07014666497707367, 0.041437067091464996, -0.0034458674490451813, 0.08547626435756683, 0.02712268941104412, -0.099952831864357, 0.06153491884469986, 0.06651738286018372, 0.01172953937202692, -0.008460882119834423, 0.02008889988064766, 0.018992392346262932, -0.03588149696588516, -0.015928449109196663, 0.012260988354682922, 0.05522371083498001, -0.012268311344087124, -0.024223629385232925, 0.010796968825161457, 0.010420645587146282, -0.11143644154071808, 0.013935682363808155, -0.012607472948729992, 0.02467087283730507, -0.04001908376812935, -0.0035500298254191875, -0.05986384302377701, -0.029666779562830925, -0.03624437749385834, 0.15022283792495728, -0.046954445540905, 0.026513561606407166, -0.033586129546165466, 0.01571274735033512, 0.0688043013215065, 0.06970946490764618, 0.03400884568691254, 0.09386342018842697, -0.1280001550912857, -0.013342383317649364, -0.03185003623366356, -0.04007891193032265, -0.00533266318961978, -0.03314424678683281, -0.024692406877875328, 0.10391746461391449, 0.026745181530714035, 0.04684233292937279, -0.0016650271136313677, 0.03580384701490402, -0.001546856015920639, -0.03346670791506767, 0.010504052974283695, 0.010657340288162231, 0.0007371965330094099, 0.03687053173780441, 0.014276127330958843, -0.10207779705524445, -0.0021450829226523638, -0.06776998192071915, -0.004630334675312042, -0.003382332157343626, 0.014625165611505508, 0.010482443496584892, 0.06452217698097229, -0.0022025967482477427, 0.0016602019313722849, -0.03755667805671692, 0.0018093492835760117, -0.0323360376060009, -0.04540429636836052, -0.027062395587563515, -0.005973847582936287, 0.0007957796915434301, -0.011507130227982998, -0.0040729837492108345, -0.024332618340849876, -0.014387382194399834, 0.022577108815312386, 0.06304975599050522, 0.014110137708485126, 0.002759179100394249, -0.021710291504859924, 0.0081279706209898, 0.016785385087132454, 0.06272311508655548, -0.013285997323691845, -0.01822434365749359, -0.0019748446065932512, 0.0068090227432549, 0.007981974631547928, 0.07318431884050369, 0.03720717504620552, -0.004698473960161209, 0.01274991873651743, 0.014232798479497433, -0.06626453250646591, -0.02512894570827484, 0.03144306316971779, 0.02501162514090538, 0.013680468313395977, -0.012024790979921818, 0.01912396401166916, 0.013699963688850403, -0.009041844867169857, 0.028004294261336327, -0.01372838020324707, -0.007640707306563854, 0.012055198661983013, 0.03061184473335743, 0.015037303790450096, -0.02735297568142414, 0.0024853888899087906, 0.020677024498581886, 0.01921812631189823, 0.008727933280169964, 0.018889235332608223, -0.08407432585954666, -0.005364452954381704, -0.0021982728503644466, 0.019419515505433083, -0.027788395062088966, -0.03406134247779846, 0.07037931680679321, 0.006973459850996733, -0.00878062192350626, 0.08113975822925568, -0.0005341047653928399, 0.034887660294771194, 0.029766226187348366, 0.0018261756049469113, -0.0014262202894315124, -0.02122391201555729, -0.00986279547214508, 0.00999411940574646, 0.027822205796837807, -0.0010191445471718907, -0.08985140919685364, 0.0014010588638484478, 0.006913432851433754, -0.024547528475522995, 0.02871665172278881, -0.03135030344128609, 0.04938321188092232, -0.021286528557538986, 0.011922761797904968, -0.019076142460107803, -0.024042513221502304, -0.004364772699773312, -0.010061499662697315, 0.014870750717818737, -0.057924650609493256, 0.00301959365606308, 0.007167673669755459, -0.01769474521279335, 0.0004039639316033572, 0.02001611329615116, 0.00907047837972641, 0.0012079925509169698, 0.02583007700741291, -0.02023685723543167, 0.042870838195085526, 0.009945639409124851, -0.03950300067663193, -0.00756619218736887, -0.003932978957891464, -0.016383042559027672, 0.012436390854418278, 0.0013605962740257382, -0.054180823266506195, 0.050895798951387405, 0.0004614217614289373, 0.02538292668759823, 0.017857307568192482, 0.039672985672950745, 0.012162687256932259, -0.019092196598649025, -0.0539204441010952, 0.004847733769565821, -0.05783316120505333, -0.02627074159681797, -0.020407434552907944, 0.06843715906143188, 0.05228124558925629, -0.019276119768619537, 0.015301112085580826, -0.004897411912679672, 0.0327925942838192, 0.005458091851323843, -0.008084695786237717, 0.0025145222898572683, -0.018876703456044197, 0.009520694613456726, 0.00278487172909081, -0.04065795987844467, 0.04366780444979668, 0.014502894133329391, -0.006399788428097963, 0.00957499723881483, 0.018886318430304527, -0.011757462285459042, 0.03279305249452591, -0.02041739411652088, 0.024937184527516365, -0.007110766135156155, -0.0013829143717885017, 0.04967047646641731, -0.0024291682057082653, -0.05124568194150925, 0.033714938908815384, 0.015125494450330734, 0.013079261407256126, -0.01241298858076334, 0.0065023223869502544, 0.04676502197980881, 0.010055833496153355, 0.04086127132177353, -0.006461655721068382, -0.030927050858736038, -0.03567461669445038, 0.03431878983974457, -0.03362701088190079, 0.04005107656121254, 0.0023804535157978535, -0.042694173753261566, 0.03589634597301483, 0.010100094601511955, 0.022495528683066368, 0.016714073717594147, 0.0230171550065279, -0.0027363430708646774, 0.01735570654273033, 0.03484373167157173, 0.013352211564779282, -0.0015490850200876594, -0.04856996610760689, 0.0050218054093420506, 0.012031412683427334, -0.01377605926245451, -0.028539106249809265, -0.02216336876153946, 0.007018647622317076, 0.017247583717107773, 0.0013503237860277295, 0.007044408470392227, -0.00854744017124176, -0.004073241725564003, -0.05477350950241089, -0.01845710165798664, 0.012464377097785473, -0.03214580565690994, -0.0018223014194518328, -0.013604741543531418, -0.03359376639127731, 0.0017098421230912209, 0.004795030225068331, -0.024461762979626656, 0.015241059474647045, -0.004197603091597557, -0.005580363795161247, -0.049395203590393066, -0.010433591902256012, 0.001708386349491775, 0.015691431239247322, 0.011295760981738567, -0.0006078745354898274, 0.03000318817794323, 0.023656178265810013, -0.013440720736980438, -0.04584021121263504, 0.016621554270386696, 0.05112748593091965, -0.0029247463680803776, 0.015523753128945827, 0.00585222477093339, -0.004698935896158218, 0.04866732656955719, 0.029018329456448555, -0.009846015833318233, -0.00775140943005681, -0.018574858084321022, 0.011073078960180283, 0.013070882298052311, 0.0010653338395059109, -0.05752523988485336, 0.002418965334072709, -0.02034037932753563, -0.0461740717291832, 0.035906046628952026, 0.022540222853422165, -0.021386850625276566, -0.03260262310504913, 0.033861689269542694, 0.0493752583861351, 0.019508149474859238, -0.03567009046673775, -0.0489710234105587, -0.029529260471463203, 0.015714554116129875, -0.005423692055046558, -0.01955268904566765, 0.027666494250297546, 0.012767449952661991, 0.06011442840099335, 0.056235477328300476, -0.03068263828754425, 0.036047790199518204, 0.029931722208857536, -0.0024822652339935303, 0.021173624321818352, -0.05126458406448364, 0.012042638845741749, 0.0010721596190705895, -0.03797626867890358, 0.008788210339844227, 0.0710088461637497, -0.014770641922950745, 0.017305627465248108, 0.02420373074710369, -0.07639547437429428, -0.012974048033356667, -0.002375568263232708, 0.017915766686201096, 0.017853181809186935, -0.013411318883299828, 0.03134502097964287, 0.014195342548191547, -0.0063746473751962185, -0.041033387184143066, -0.010297409258782864, -0.020226849243044853, 0.00408170185983181, -0.04737409949302673, -0.012051831930875778, 0.0013557055499404669, 0.04286346957087517, 0.0485721118748188, -0.020777789875864983, -0.04284858703613281, -0.04580085352063179, -0.016645563766360283, 0.019963739439845085, -0.019648529589176178, 0.007427299860864878, -0.04525495693087578, -0.03363962098956108, -0.012281744740903378, 0.08609972894191742, -0.013740754686295986, 0.0241144560277462, 0.0012239562347531319, 0.0008108246838673949, 0.002675458788871765, -0.021108929067850113, 0.0643315464258194, 0.029789891093969345, -0.005905921570956707, -0.0019810569938272238, -0.016499564051628113, -0.023582778871059418, -0.009932457469403744, 0.017651675269007683, 0.05623301491141319, 0.07192038744688034, 0.003816876793280244, 0.023429086431860924, 0.03344320133328438, -0.0016185794956982136, -0.009831842966377735, 0.03462526947259903, -0.023586641997098923, 0.00554009061306715, 0.035764195024967194, 0.015956932678818703, 0.0018160142935812473, -0.03249229118227959, -0.03747030347585678, 0.015825485810637474, -0.016393598169088364, 0.014592512510716915, -0.00799656379967928, 0.0077280509285628796, -0.008974750526249409, 0.03616229444742203, -0.04651458188891411, 0.007788369897753, 0.02376669831573963, 0.03259582817554474, 0.02019546739757061, -0.01902078650891781, -0.011393178254365921, -0.020133966580033302, -0.03507759049534798, -0.0065728845074772835, 0.044219695031642914, -0.012083042412996292, 0.022990144789218903, 0.01996341347694397, 0.0489451140165329, 0.0157353263348341, 0.016347406432032585, 0.011016148142516613, 0.022790927439928055, 0.05240229517221451, -0.0030815727077424526, 0.04629789665341377, 0.02131633087992668, -0.010989720933139324, -0.0073399851098656654, 0.040493473410606384, 0.003954571671783924, -0.003201842773705721, 0.00974426418542862, 0.028768891468644142, 0.006211086641997099, 0.023460712283849716, -0.040657442063093185, 0.02396625094115734, 0.01898626983165741, 0.014612243510782719, -0.012103362008929253, 0.015051129274070263, 0.00446099229156971, -0.034760311245918274, 0.041898179799318314, 0.022482555359601974, -0.001902656746096909, -0.022943340241909027, 0.04401181638240814, -0.006352351978421211, 0.004236407112330198, 0.0301060751080513, 0.047768108546733856, 0.02159777656197548, -0.02989163063466549, -0.023005306720733643, -0.02312789298593998, -0.028606092557311058, 0.008265136741101742, -0.027079496532678604, -0.004126160405576229, -0.005824642721563578, -0.011529076844453812, 0.0003949046949855983, -0.0288674496114254, -0.00361184892244637, -0.027438323944807053, 0.01442249957472086, -0.007137298118323088, 0.025740230455994606, -0.038541775196790695, 0.013742134906351566, -0.025666965171694756, -0.0025415855925530195, 0.02355414628982544, -0.040478870272636414, -0.02268468774855137, -0.0041856965981423855, 0.008127275854349136, -0.011270786635577679, 0.016200676560401917, 0.03002932481467724, -0.005030341912060976, 0.017889028415083885, 0.03290731832385063, -0.002091796835884452, 0.009686165489256382, 0.036224525421857834, 0.03490373492240906, -0.04063267633318901, -0.010961972177028656, 0.01320665329694748, -0.027846524491906166, -0.05856848880648613, -0.01689254306256771, 0.015487407334148884, 0.021906403824687004, 0.004932462237775326, 0.07040460407733917, 0.06381739675998688, -0.0073085627518594265, -0.018712053075432777, -0.022216686978936195, -0.017397265881299973, -0.023744011297822, 0.053954217582941055, 0.004160085693001747, -0.018540162593126297, -0.03190094977617264, -0.0022436429280787706, 0.03174056112766266, -0.015805207192897797, 0.024222591891884804, 0.04064108431339264, 0.03632316738367081, -0.08595578372478485, 0.015504172071814537, 0.01909475214779377, 0.009723751805722713, 0.042808521538972855, 0.048400215804576874, 0.010204737074673176, -0.016232812777161598, -0.021425461396574974, 0.06485884636640549, -0.03168240189552307, -0.0012983332853764296, -0.046001166105270386, -0.031230969354510307, -0.03837815672159195, -0.01626516878604889, 0.021159948781132698, 0.006000307854264975, -0.0532626211643219, 0.0041196029633283615, 0.01957240328192711, -0.005192232318222523, 0.0015553920529782772, 0.03391173481941223, 0.05065141245722771, 0.03807833045721054, 0.0017508602468296885, -0.021986549720168114, -0.019874045625329018, 0.008012866601347923, -0.018602469936013222, 0.04259485378861427, 0.07458376884460449, -0.011166197247803211, -0.01315243262797594, -0.03691244497895241, -0.041719112545251846, -0.009151170030236244, -0.04159993678331375, 0.041396621614694595, 0.021442865952849388, -0.02625080570578575, -0.00973387062549591, 0.02849789336323738, 0.009665784426033497, 0.023087183013558388, 0.028452489525079727, -0.05178677290678024, 0.006666186265647411, -0.0035038692876696587, 0.020738890394568443, -0.04361830651760101, -0.028363710269331932, 0.037531137466430664, -0.0038077456410974264, 0.020259929820895195, 0.003812693292275071, 0.002396038733422756, -0.017530903220176697, 0.011993877589702606, 0.05965369567275047, -0.020804794505238533, -0.013888372108340263, -0.03119196929037571, -0.06127571687102318, -0.001132027362473309, -0.0022406927309930325, -0.04498077183961868, -0.03202493116259575, 0.01963759958744049, 0.002657450968399644, 0.00932446401566267, 0.0027661833446472883, -0.05196550488471985, -0.008593958802521229, 0.023327313363552094, -0.019229397177696228, 0.060762617737054825, 0.015207084827125072, -0.0492217130959034, -0.03987940028309822, -0.029570793733000755 ]
Deploying the AI Comic Factory using the Inference API
jbilcke-hf
October 2, 2023
ai-comic-factory
guide, inference, api, llm, stable-diffusion
https://huggingface.co/blog/ai-comic-factory
Duplicating the Space To duplicate the AI Comic Factory, go to the Space and click on "Duplicate": You'll observe that the Space owner, name, and visibility are already filled in for you, so you can leave those values as is. Your copy of the Space will run inside a Docker container that doesn't require many resources, so you can use the smallest instance. The official AI Comic Factory Space utilizes a bigger CPU instance, as it caters to a large user base. To operate the AI Comic Factory under your account, you need to configure your Hugging Face token:
[ 0.001650200574658811, -0.0008290145196951926, 0.015182506293058395, 0.028669364750385284, 0.029443664476275444, 0.06352846324443817, 0.020187709480524063, 0.020459908992052078, -0.08145605027675629, -0.07287916541099548, -0.08383894711732864, -0.0036781062372028828, -0.03455880284309387, 0.052325498312711716, -0.03772379085421562, -0.03538840264081955, 0.02698395401239395, 0.01679416559636593, -0.03811333328485489, 0.04025798290967941, -0.009835401549935341, -0.05975094810128212, 0.053702615201473236, -0.015799950808286667, 0.00786398071795702, 0.03528260812163353, -0.00243374309502542, -0.025048958137631416, 0.024645023047924042, 0.02023402974009514, -0.060565415769815445, -0.024231277406215668, 0.07088710367679596, 0.007747115567326546, 0.07222412526607513, -0.012738746590912342, -0.07172693312168121, 0.07216279208660126, 0.03949734941124916, 0.00016533734742552042, -0.034315887838602066, 0.01026750635355711, -0.060446981340646744, 0.025150757282972336, 0.014944996684789658, 0.012902899645268917, -0.08153059333562851, 0.04768881946802139, -0.010200309567153454, 0.019209181889891624, -0.03110818937420845, -0.008993562310934067, -0.029919112101197243, -0.04067690670490265, 0.00880708359181881, 0.04145117104053497, -0.0478537380695343, 0.013706172816455364, -0.014498451724648476, 0.03037950024008751, 0.06083323806524277, 0.028193240985274315, 0.08017655462026596, 0.06876686960458755, -0.02651539444923401, 0.03640565648674965, 0.024019114673137665, -0.0084215197712183, -0.04508240520954132, -0.025637753307819366, 0.03613434359431267, -0.014470134861767292, -0.0034150397405028343, -0.028209330514073372, -0.036503784358501434, -0.011508229188621044, 0.01404266245663166, 0.11521215736865997, 0.008164155296981335, 0.05533508211374283, 0.021666711196303368, 0.05308877304196358, 0.0024689147248864174, 0.04683408886194229, 0.003968515899032354, -0.02331366203725338, -0.09712877869606018, -0.039300285279750824, -0.09623390436172485, 0.06290372461080551, 0.001399774570018053, -0.07981047034263611, -0.07049793750047684, 0.05730583891272545, 0.05410737544298172, 0.05805285647511482, 0.03901226818561554, 0.003688734956085682, 0.014882009476423264, 0.02611062116920948, -0.030469998717308044, -0.056226860731840134, -0.022886905819177628, -0.0732448548078537, -0.07658663392066956, -0.013442816212773323, -0.01047853846102953, -0.060448549687862396, -0.02045992761850357, 0.016894210129976273, 0.001420642714947462, -0.04557698592543602, 0.011893007904291153, 0.06781693547964096, -0.14240168035030365, -0.004836336709558964, -0.022949829697608948, -0.054049745202064514, 0.00753400381654501, 0.02078939415514469, 0.10111121088266373, 0.07228168100118637, 0.08626802265644073, 0.007030971813946962, 0.026501253247261047, 0.01701912097632885, -0.037677597254514694, 0.0029530730098485947, -0.0002395722985966131, -0.05906928330659866, 0.0148905199021101, -0.05114767700433731, 0.07701898366212845, -0.009365708567202091, 0.067585788667202, -0.04132635518908501, 0.006319642532616854, -0.007119256071746349, 0.037605974823236465, -0.04881179705262184, 0.008305119350552559, 0.047802943736314774, 0.02350127510726452, 0.029363146051764488, 0.05803517997264862, 0.042142603546381, -0.09275345504283905, -0.001614134176634252, -0.01938830129802227, 0.044290803372859955, -0.055667027831077576, -0.01334480382502079, -0.006858939304947853, -0.017619673162698746, -0.010471024550497532, -0.02950475364923477, -0.041261978447437286, -0.014764998108148575, -0.0918629840016365, 0.03736124187707901, 0.016440054401755333, -0.05643606558442116, -0.04368438944220543, -0.045779116451740265, -0.0004291397926863283, 0.010916192084550858, -0.04293104261159897, 0.06402896344661713, 0.014796809293329716, -0.0640735998749733, 0.007792636752128601, -0.006048643030226231, 0.03432394936680794, -0.017297916114330292, 0.05660371482372284, 0.11127906292676926, 0.07944068312644958, 0.07798221707344055, -0.022450435906648636, -0.027093103155493736, -0.04880818724632263, 0.0720004066824913, 0.00560033181682229, 0.09778298437595367, 0.0789625346660614, -0.13473039865493774, 0.0076720230281353, -0.019724253565073013, 0.021267397329211235, 0.02233080379664898, -0.03612581267952919, -0.0119416993111372, 0.03826241195201874, 0.006582182832062244, 0.038018856197595596, -0.02990516647696495, -0.11941806226968765, 0.10008951276540756, 0.09175916761159897, 0.02799364924430847, -0.05355323106050491, 0.00840538740158081, 0.011423744261264801, -0.04277888312935829, -0.0004524158139247447, 0.03185408189892769, 0.046875085681676865, -0.07677357643842697, -0.006672495976090431, 0.020596737042069435, 0.009747324511408806, -0.10932843387126923, 0.05302754044532776, -0.08159030973911285, 0.008936340920627117, -0.05050456523895264, -0.025529218837618828, -0.049466416239738464, -0.01604325696825981, -0.014884122647345066, 0.15790170431137085, -0.002993857255205512, 0.0022110564168542624, -0.029332686215639114, 0.022136380895972252, 0.054117023944854736, 0.03497762605547905, 0.02432488277554512, 0.05388670414686203, -0.09144194424152374, -0.012279809452593327, -0.027961084619164467, -0.06657493114471436, 0.010485918261110783, -0.07502754032611847, -0.0045736245810985565, 0.09979123622179031, 0.019075891003012657, 0.0414862185716629, -0.006660464685410261, -0.06845010817050934, -0.04595034569501877, -0.02503242902457714, -0.004167192615568638, 0.041441865265369415, 0.04048764705657959, -0.0021010867785662413, 0.06896734237670898, -0.06005918234586716, -0.040219251066446304, -0.028154494240880013, 0.015233675949275494, -0.011569357477128506, -0.00851783249527216, 0.03482037037611008, 0.014539899304509163, 0.009674656204879284, -0.006020881701260805, -0.050300661474466324, 0.011163981631398201, -0.04868759214878082, -0.011193950660526752, -0.03280916064977646, 0.0005941748968325555, 0.005486434791237116, -0.00884085614234209, -0.013608401641249657, 0.003978933673352003, -0.018471205607056618, -0.01127952802926302, -0.008605143055319786, 0.014335071668028831, -0.006145976949483156, -0.0050620646215975285, 0.011407030746340752, -0.005681759212166071, 0.00835160631686449, -0.04311487823724747, -0.015759112313389778, 0.014549623243510723, 0.006595366168767214, -0.025068817660212517, -0.016324542462825775, 0.03098217025399208, 0.013806466944515705, 0.030046731233596802, -0.011640287935733795, -0.06126025319099426, -0.025717470794916153, 0.01276905182749033, 0.018531080335378647, 0.04811607673764229, 0.027419231832027435, 0.012267766520380974, 0.01676325686275959, 0.014825251884758472, -0.016126209869980812, 0.0021900052670389414, 0.03727352246642113, 0.026566989719867706, 0.019818421453237534, 0.01005104836076498, -0.010463305748999119, -0.009883779101073742, -0.014184181578457355, 0.012875141575932503, -0.00604650704190135, -0.029311425983905792, -0.0835493877530098, -0.027893878519535065, -0.0006494741537608206, 0.029657937586307526, -0.04008912667632103, -0.014608708210289478, 0.029864463955163956, 0.03716855123639107, 0.0016528135165572166, 0.050338827073574066, 0.0008876564679667354, -0.0059283128939569, 0.03218968212604523, 0.024230586364865303, -0.020972440019249916, -0.010604750365018845, 0.010124052874743938, -0.008832191117107868, 0.015857508406043053, -0.005838814657181501, -0.0676296055316925, 0.0020474293269217014, 0.015420129522681236, 0.011301328428089619, 0.0350540392100811, -0.03001595102250576, 0.031122714281082153, 0.014190901070833206, 0.030928341671824455, -0.02213876135647297, 0.0009553992422297597, -0.01519746147096157, -0.01387764047831297, -0.03714139387011528, -0.03296872600913048, 0.014441980980336666, -0.03217669203877449, -0.01485209260135889, 0.019389284774661064, -0.004683934152126312, 0.011507601477205753, 0.013194877654314041, 0.04476277902722359, -0.020805828273296356, 0.020002378150820732, -0.008220969699323177, -0.014503587037324905, -0.025825854390859604, 0.019254086539149284, -0.035779062658548355, 0.022746175527572632, -0.018188782036304474, 0.021092809736728668, 0.011955088935792446, 0.01357468031346798, 0.028466083109378815, 0.011646375991404057, 0.027616050094366074, 0.01285847183316946, -0.023268338292837143, -0.06650472432374954, -0.006944170221686363, -0.033460527658462524, -0.004566838499158621, 0.0031327500473707914, 0.048339132219552994, 0.006960636004805565, -0.018996387720108032, 0.017155008390545845, 0.04984467104077339, 0.008270449936389923, -0.021374523639678955, -0.004485021345317364, 0.008382881991565228, 0.000912350311409682, -0.012079695239663124, -0.022986754775047302, -0.022073784843087196, 0.015509084798395634, 0.018145851790905, -0.01687971130013466, 0.054553769528865814, 0.0198507159948349, -0.007944652810692787, -0.003683611052110791, -0.03368449956178665, -0.003289572661742568, -0.0019644724670797586, 0.0015983916819095612, 0.03191366046667099, -0.03794190660119057, -0.0448327362537384, 0.018537716940045357, -0.02421114593744278, 0.00007600928074680269, -0.05816350504755974, 0.003617251059040427, 0.030791204422712326, -0.02251836657524109, 0.012796753086149693, 0.02220548689365387, -0.023413239046931267, -0.003623564261943102, 0.007396891247481108, -0.025366811081767082, 0.05205060541629791, -0.021246155723929405, -0.04674680158495903, 0.017419040203094482, 0.02345932275056839, 0.021264974027872086, -0.014817614108324051, 0.00003219306017854251, 0.009186780080199242, -0.0038337386213243008, 0.038800597190856934, 0.028736582025885582, -0.007963738404214382, -0.0342593640089035, 0.04510025680065155, -0.026100553572177887, 0.017438236624002457, -0.03906102105975151, -0.027986083179712296, -0.010527845472097397, 0.016644269227981567, 0.036117780953645706, -0.018580539152026176, 0.0036164321936666965, -0.006972411181777716, -0.035102542489767075, 0.00837728101760149, 0.027588164433836937, 0.01829935982823372, -0.015024813823401928, -0.014662070199847221, -0.04426223784685135, 0.012155634351074696, 0.024925902485847473, -0.003314550966024399, 0.023356454446911812, -0.0069864606484770775, 0.019486989825963974, -0.04732632264494896, 0.031175527721643448, 0.041510846465826035, -0.01118265837430954, -0.004054445307701826, -0.021453555673360825, 0.019324086606502533, 0.04383851960301399, 0.006620556581765413, -0.06793294847011566, 0.04885043203830719, 0.042587440460920334, -0.023570481687784195, -0.035782720893621445, -0.030081143602728844, -0.01410731766372919, 0.03184229135513306, 0.009001974016427994, -0.02490229159593582, -0.051222190260887146, -0.008836908265948296, -0.0051044560968875885, 0.006639124359935522, 0.0343019999563694, -0.01943710632622242, -0.0031247481238096952, 0.0025367646012455225, -0.04146554693579674, 0.02330576442182064, -0.028130916878581047, -0.011667181737720966, -0.011848852969706059, 0.04314560070633888, 0.06398561596870422, 0.04741707071661949, -0.01402839832007885, -0.018690183758735657, -0.03039313293993473, 0.036117155104875565, -0.005389486439526081, -0.01828695647418499, 0.018806669861078262, 0.02975321374833584, 0.05895299091935158, 0.09146898239850998, -0.01434301771223545, 0.002940403064712882, 0.001027774065732956, 0.02252652496099472, -0.010518565773963928, -0.0718449205160141, 0.04496726393699646, -0.0074935550801455975, 0.005543794482946396, 0.04448928311467171, 0.053642868995666504, 0.0050591398030519485, 0.03266169875860214, 0.04482291638851166, -0.05182579904794693, -0.02576710470020771, 0.021796884015202522, 0.034221116453409195, 0.03189161792397499, 0.0083962706848979, 0.05345262214541435, -0.022526444867253304, -0.008908985182642937, -0.04876801744103432, -0.015520598739385605, -0.04212043061852455, -0.0043457262217998505, -0.0018055288819596171, -0.0490666888654232, 0.025742925703525543, 0.023270228877663612, 0.04180377721786499, -0.018100526183843613, -0.07969226688146591, -0.0361902117729187, 0.013136114925146103, -0.022264422848820686, -0.024096084758639336, 0.041728775948286057, -0.018991990014910698, -0.008936328813433647, -0.02014293149113655, 0.06159102916717529, -0.0018204780062660575, 0.013790084980428219, 0.03457794338464737, -0.014467574656009674, 0.01701756939291954, 0.013795390725135803, 0.05241302028298378, -0.011102908290922642, -0.04406148940324783, 0.018964480608701706, -0.020541975274682045, -0.019924674183130264, -0.014275278896093369, 0.0032962055411189795, 0.017083602026104927, 0.06923642754554749, 0.01970841735601425, 0.026534952223300934, -0.008431450463831425, 0.012157886289060116, -0.0365755669772625, 0.004527669865638018, -0.004977074451744556, 0.0009028263157233596, 0.009730570018291473, -0.010460026562213898, 0.013625002466142178, -0.01415508333593607, -0.016513939946889877, 0.026396753266453743, -0.018478572368621826, 0.006811333354562521, 0.008201122283935547, -0.025309599936008453, -0.028776204213500023, -0.02232801914215088, -0.018371183425188065, -0.014052888378500938, 0.011250202544033527, 0.03150855004787445, 0.028953632339835167, 0.012833645567297935, 0.013399170711636543, -0.047883257269859314, 0.031469691544771194, 0.011019488796591759, 0.0322289802134037, -0.018469298258423805, 0.03796360269188881, 0.020820841193199158, 0.05849238857626915, 0.02334984764456749, -0.0038404271472245455, -0.004585706163197756, -0.017945019528269768, 0.06128678098320961, -0.013785289600491524, 0.008906127884984016, 0.014824246056377888, -0.005995011888444424, 0.0045339250937104225, 0.024860017001628876, 0.040685318410396576, -0.018798425793647766, 0.020763101056218147, 0.04301924630999565, -0.04587327688932419, 0.044792745262384415, -0.05911024659872055, 0.04814516380429268, 0.009960067458450794, -0.0037355925887823105, -0.044239237904548645, -0.034258004277944565, 0.003680707421153784, -0.003700010944157839, 0.03086785040795803, 0.030358903110027313, 0.025621039792895317, 0.02094554342329502, 0.03289727866649628, 0.0021472848020493984, -0.017614463344216347, 0.007469899486750364, 0.007093220483511686, 0.02065827138721943, -0.03546883165836334, -0.03337080404162407, -0.02369922399520874, -0.006460933946073055, -0.039667945355176926, -0.0066471826285123825, 0.02167447656393051, -0.03889859467744827, 0.021240541711449623, -0.016273757442831993, 0.015938010066747665, 0.005442238412797451, 0.023185163736343384, -0.010916491039097309, -0.0029789593536406755, 0.029054075479507446, -0.02328898385167122, 0.027576303109526634, 0.004805291537195444, 0.04531695693731308, -0.013810181990265846, -0.03383505716919899, -0.02108820527791977, -0.025657081976532936, 0.007329464890062809, -0.03266509249806404, 0.04977281019091606, -0.01575551927089691, -0.009454897604882717, 0.010792413726449013, 0.062431853264570236, -0.010522750206291676, 0.025024553760886192, 0.0054939822293818, 0.02669135108590126, -0.0573573037981987, -0.026693787425756454, 0.004658844321966171, -0.03586233779788017, -0.036873020231723785, -0.021465899422764778, 0.02382170967757702, 0.013966338708996773, 0.012005077674984932, 0.03162933886051178, 0.004017231985926628, -0.016277233138680458, -0.025680476799607277, -0.004486313555389643, -0.016736159101128578, -0.011772659607231617, 0.03451956436038017, 0.01228112168610096, 0.008288288488984108, 0.027302216738462448, -0.00776616670191288, 0.018001560121774673, -0.010666858404874802, 0.005117510445415974, 0.027808263897895813, -0.0017597543774172664, -0.08604494482278824, 0.06366042792797089, 0.059279557317495346, 0.0049125272780656815, 0.015932274982333183, 0.0506824366748333, 0.028178203850984573, 0.029437081888318062, -0.013834693469107151, 0.06717996299266815, -0.007620167452841997, 0.02095634490251541, -0.05834383890032768, -0.0015204361407086253, -0.007265327963978052, -0.05189629644155502, -0.007698491681367159, 0.019923003390431404, -0.053511254489421844, -0.02686583250761032, 0.020028891041874886, 0.011324785649776459, -0.02535206638276577, 0.005057527683675289, 0.05145111307501793, 0.04276926442980766, 0.03584199771285057, -0.022561904042959213, -0.011701836250722408, -0.01833100989460945, -0.037766143679618835, 0.03139124810695648, 0.010784508660435677, -0.02639504335820675, -0.011568570509552956, -0.05156147480010986, -0.05273611098527908, -0.01936972886323929, -0.04800014942884445, 0.021209772676229477, 0.018117593601346016, -0.0031270741019397974, 0.0001999207161134109, -0.0007710968493483961, -0.008418835699558258, 0.041149940341711044, 0.017337165772914886, -0.05383848026394844, -0.04368264600634575, 0.023762209340929985, 0.05153946578502655, -0.04136722534894943, -0.001729841809719801, 0.02429383061826229, 0.002858417108654976, 0.03570883348584175, 0.028447918593883514, 0.012279834598302841, -0.012180433608591557, -0.029670417308807373, 0.03787805140018463, -0.025552745908498764, -0.01955099031329155, -0.010824164375662804, -0.02252175658941269, 0.03650928661227226, 0.0005212104297243059, -0.03143628314137459, -0.008826855570077896, 0.021636098623275757, -0.03707839548587799, 0.02343083918094635, 0.03791522979736328, 0.013088641688227654, 0.010645853355526924, 0.011420244351029396, -0.02025607042014599, 0.012331503443419933, 0.040100086480379105, -0.007034177426248789, -0.025957435369491577, 0.009282036684453487 ]
Chat Templates: An End to the Silent Performance Killer
rocketknight1
October 3, 2023
chat-templates
LLM, nlp, community
https://huggingface.co/blog/chat-templates
Why bother doing this? Why not just pick a standard format? This is an excellent idea! Unfortunately, it's too late, because multiple important models have already been trained with very different chat formats. However, we can still mitigate this problem a bit. We think the closest thing to a 'standard' for formatting is the ChatML format created by OpenAI. If you're training a new model for chat, and this format is suitable for you, we recommend using it and adding special <|im_start|> and <|im_end|> tokens to your tokenizer. It has the advantage of being very flexible with roles, as the role is just inserted as a string rather than having specific role tokens. If you'd like to use this one, it's the third of the templates above, and you can set it with this simple one-liner: py tokenizer.chat_template = "{% for message in messages %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}" There's also a second reason not to hardcode a standard format, though, beyond the proliferation of existing formats - we expect that templates will be broadly useful in preprocessing for many types of models, including those that might be doing very different things from standard chat. Hardcoding a standard format limits the ability of model developers to use this feature to do things we haven't even thought of yet, whereas templating gives users and developers maximum freedom. It's even possible to encode checks and logic in templates, which is a feature we don't use extensively in any of the default templates, but which we expect to have enormous power in the hands of adventurous users. We strongly believe that the open-source ecosystem should enable you to do what you want, not dictate to you what you're permitted to do.
[ -0.008662699721753597, 0.013888043351471424, 0.014777002856135368, 0.07157568633556366, 0.06598982214927673, 0.03285478055477142, 0.04873659834265709, -0.02536286599934101, -0.024187689647078514, 0.0010630136821419, -0.09164916723966599, -0.01935684122145176, -0.019555578008294106, 0.06863660365343094, -0.02546345442533493, 0.024073073640465736, 0.021870363503694534, 0.020465323701500893, -0.003910643979907036, 0.019345326349139214, -0.06439365446567535, -0.011327278800308704, 0.017208989709615707, -0.011423678137362003, 0.03723141551017761, -0.02700009010732174, -0.027305027469992638, 0.012844998389482498, -0.06813836842775345, 0.023610541597008705, -0.08418171852827072, 0.019373144954442978, -0.026601430028676987, 0.01752541773021221, 0.010809204541146755, -0.014408094808459282, -0.044218119233846664, 0.03179973363876343, -0.01173219084739685, -0.011424972675740719, 0.05608426034450531, -0.06300483644008636, -0.012482810765504837, 0.027230462059378624, -0.013644441962242126, -0.06942301988601685, -0.18922483921051025, 0.06513915210962296, 0.02048429660499096, -0.03593948483467102, -0.10672270506620407, 0.06339792162179947, -0.06199830397963524, 0.02228396385908127, 0.007110351696610451, -0.05103682354092598, -0.06048261746764183, -0.07491439580917358, -0.04315514490008354, 0.014520070515573025, 0.014755620621144772, 0.014771858230233192, -0.0006250716978684068, -0.026157954707741737, 0.04926101863384247, 0.06108333542943001, -0.025456571951508522, 0.01623542793095112, -0.02274884283542633, -0.026808319613337517, 0.028548942878842354, 0.028655700385570526, 0.023110995069146156, -0.034537699073553085, 0.06295200437307358, -0.06873398274183273, -0.04181523248553276, 0.013248585164546967, 0.027254706248641014, 0.008601969107985497, -0.030931351706385612, 0.03467590734362602, 0.05719748139381409, 0.007452329620718956, 0.010437235236167908, 0.0363692007958889, 0.08540216088294983, -0.02628003992140293, 0.015008802525699139, 0.013622395694255829, 0.003234919160604477, -0.10223748534917831, 0.07086735963821411, 0.045296382158994675, 0.009177395142614841, -0.026670565828680992, -0.04596507549285889, 0.06387608498334885, 0.015002899803221226, -0.058450911194086075, 0.03087867982685566, -0.07218356430530548, 0.021830931305885315, -0.046459611505270004, -0.07978127896785736, 0.050113171339035034, -0.08809693902730942, -0.10630185157060623, -0.00349294301122427, -0.04131221026182175, 0.03204231336712837, 0.004983596969395876, -0.0241495743393898, 0.10578763484954834, -0.039435166865587234, -0.003065494354814291, -0.023624170571565628, 0.0030513284727931023, -0.020663771778345108, -0.02651238813996315, 0.07217299193143845, 0.03566087409853935, 0.12685953080654144, -0.02382453717291355, -0.02913975529372692, 0.05245335027575493, 0.02904094196856022, 0.07392780482769012, -0.01857779175043106, -0.026251183822751045, 0.003710377961397171, 0.06866660714149475, 0.031134944409132004, 0.010718715377151966, -0.03258760645985603, -0.04325961321592331, 0.022929508239030838, -0.08384422957897186, 0.05141910910606384, -0.06255806982517242, 0.025221535935997963, 0.045148976147174835, 0.03885966166853905, 0.06198913976550102, 0.013777091167867184, 0.013437272980809212, -0.04523954540491104, 0.017546704038977623, -0.006908327806740999, -0.05465254932641983, -0.06300851702690125, 0.0024901344440877438, 0.06375368684530258, -0.04138844087719917, -0.03083401918411255, 0.08371134102344513, -0.018742697313427925, -0.03183341026306152, -0.037677962332963943, -0.0495435856282711, 0.05440789833664894, 0.012403033673763275, -0.0530686192214489, 0.039572153240442276, 0.027350766584277153, -0.034743133932352066, -0.0682939812541008, -0.06493005901575089, 0.01822233572602272, -0.020430833101272583, 0.054344918578863144, 0.0087423175573349, 0.03438214212656021, 0.0064368476159870625, 0.010698661208152771, 0.007248599082231522, 0.008175036869943142, 0.02372959442436695, 0.009179530665278435, -0.0477449968457222, -0.04179728403687477, 0.0333162322640419, -0.01978396810591221, -0.02169427089393139, 0.04609556496143341, -0.09314130246639252, 0.017822733148932457, -0.08502154052257538, -0.032547373324632645, 0.03860742598772049, -0.04723243787884712, -0.005554536823183298, 0.045740123838186264, 0.03579128906130791, 0.04640009626746178, -0.04203350096940994, -0.030562104657292366, 0.06972433626651764, 0.04920661821961403, 0.10844563692808151, 0.0626438558101654, 0.004432328045368195, -0.05571800470352173, -0.005464834626764059, 0.03956417366862297, 0.059102654457092285, -0.008583500981330872, -0.05691500008106232, 0.020594557747244835, 0.019281776621937752, 0.01488343346863985, -0.060733288526535034, 0.09472895413637161, -0.048442550003528595, -0.0020761035848408937, -0.032444607466459274, 0.004929681774228811, 0.007654064334928989, -0.005719452630728483, -0.011711581610143185, 0.16477276384830475, -0.07391916960477829, 0.022781090810894966, 0.00955525878816843, 0.027270419523119926, 0.04030698165297508, 0.01135217398405075, 0.06151391193270683, 0.10091625154018402, -0.09921995550394058, -0.014399808831512928, -0.006096542347222567, -0.0033624039497226477, 0.019957803189754486, -0.06308590620756149, -0.04083416610956192, 0.02214604988694191, 0.0084978137165308, 0.05285091698169708, -0.04054105654358864, 0.011740426532924175, -0.008953229524195194, -0.0022571973968297243, -0.01764962635934353, -0.026005256921052933, 0.035389337688684464, 0.04609648138284683, -0.003041594522073865, -0.01796112209558487, 0.03567597270011902, -0.03849581256508827, 0.013798568397760391, -0.014877358451485634, -0.07108084112405777, -0.02992202900350094, 0.07064759731292725, 0.008518456481397152, -0.020935343578457832, -0.026633428409695625, 0.0230115819722414, 0.0031869979575276375, 0.014701769687235355, -0.01502208411693573, -0.03519662097096443, -0.030583001673221588, -0.022480079904198647, -0.014900104142725468, -0.013651454821228981, -0.00048744474770501256, 0.04780243709683418, 0.032682906836271286, -0.007749271113425493, -0.018637610599398613, 0.026689713820815086, 0.022797733545303345, 0.04366954416036606, 0.015471311286091805, -0.04073736444115639, 0.018006589263677597, 0.0010498481569811702, -0.026409225538372993, -0.024352001026272774, 0.03229803219437599, 0.04830440133810043, 0.019261730834841728, 0.03559180349111557, 0.01327241025865078, -0.0060624051839113235, -0.0768919363617897, -0.008639369159936905, 0.050080303102731705, 0.03454754129052162, 0.02496221289038658, 0.028152821585536003, 0.04077461361885071, 0.03294546529650688, -0.025505749508738518, 0.009042207151651382, -0.005167893134057522, 0.05420229211449623, -0.01672760397195816, -0.018312104046344757, 0.017589332535862923, 0.008039937354624271, -0.008301454596221447, -0.013002102263271809, -0.010277576744556427, -0.011934970505535603, -0.09084401279687881, -0.003642165334895253, -0.002531610196456313, 0.023958003148436546, -0.02673722617328167, -0.010737128555774689, 0.07903038710355759, -0.04311278462409973, -0.03291301056742668, 0.026491273194551468, -0.04708172380924225, 0.03867149353027344, -0.011997988447546959, -0.0019374111434444785, 0.004597053397446871, -0.013631676323711872, -0.017510464414954185, -0.010654638521373272, 0.062046680599451065, 0.013975580222904682, -0.035008810460567474, 0.05252404138445854, 0.007843154482543468, 0.0354214645922184, 0.005249400157481432, 0.02292732335627079, 0.05507612228393555, 0.026100631803274155, 0.04631568118929863, -0.023394009098410606, -0.013612976297736168, -0.031470656394958496, -0.016900023445487022, -0.026580143719911575, -0.03530808165669441, -0.006341506261378527, -0.006257778499275446, 0.0313018299639225, 0.013988246209919453, -0.004005174618214369, 0.006704464089125395, 0.03862195089459419, 0.04025522992014885, -0.027216171845793724, 0.022673960775136948, -0.025220360606908798, -0.01961120031774044, -0.024250172078609467, 0.02874189056456089, -0.011984809301793575, -0.004263193346560001, -0.028829319402575493, 0.023111553862690926, 0.06529024243354797, -0.023343194276094437, 0.026105524972081184, 0.01720489002764225, 0.032567769289016724, -0.006785115227103233, -0.04990607127547264, -0.04289073124527931, 0.022842708975076675, -0.010165424086153507, 0.020148759707808495, -0.00788906216621399, 0.021472090855240822, -0.02065228298306465, 0.01669885776937008, 0.033607639372348785, 0.0629243329167366, -0.026713639497756958, 0.008117590099573135, -0.0007439430919475853, 0.021890364587306976, -0.015483944676816463, -0.013225535862147808, -0.00013975895126350224, -0.04978069290518761, 0.011059392243623734, -0.00973068829625845, -0.015947259962558746, -0.02091820351779461, -0.04799739271402359, -0.00607688445597887, 0.003535775700584054, 0.022004492580890656, 0.04159855097532272, -0.009328405372798443, 0.02743254043161869, 0.035380326211452484, 0.010265637189149857, -0.05543412268161774, 0.03269907087087631, 0.0196075402200222, -0.015541489236056805, 0.01355996448546648, 0.004842675756663084, -0.01813814602792263, -0.02474673092365265, 0.039381563663482666, 0.02087719365954399, -0.04274507984519005, 0.01516182441264391, -0.015008443966507912, 0.022471755743026733, 0.007551650516688824, -0.011515668593347073, -0.06197098642587662, 0.013697625137865543, 0.0025175772607326508, 0.010939959436655045, 0.004356998950242996, 0.005324247758835554, 0.016482269391417503, 0.03055427595973015, 0.042395707219839096, -0.00681321369484067, 0.00628723343834281, -0.057029109448194504, 0.015426723286509514, -0.04651074483990669, -0.015145695768296719, 0.005228712689131498, 0.013501088134944439, 0.0033529852516949177, -0.04687555506825447, 0.043824683874845505, -0.037431828677654266, 0.027691088616847992, -0.009554038755595684, -0.022881630808115005, -0.021790245547890663, -0.010513117536902428, 0.004813144914805889, 0.04545817896723747, 0.008859065361320972, 0.04027135297656059, 0.01298734825104475, 0.01129926834255457, -0.05975615978240967, -0.04453471302986145, -0.024539465084671974, 0.00923513900488615, -0.032423097640275955, 0.018383489921689034, 0.016413958743214607, -0.03565455228090286, -0.018001636490225792, 0.04654859006404877, 0.05104054510593414, 0.0061214086599648, 0.014670061878859997, -0.035179536789655685, -0.05118689313530922, -0.02219947800040245, -0.02110143005847931, -0.032212790101766586, 0.003030266147106886, 0.02063252404332161, 0.02474948950111866, 0.005908450111746788, -0.0020761783234775066, -0.0030010705813765526, 0.0019197085639461875, 0.029495837166905403, -0.029971109703183174, -0.006315337028354406, -0.06787223368883133, 0.024731026962399483, 0.00034839092404581606, -0.037867315113544464, -0.01696924678981304, 0.015963749960064888, -0.005635946989059448, 0.039655573666095734, -0.011374060995876789, 0.026228895410895348, 0.06354986876249313, -0.0015541247557848692, -0.020840708166360855, -0.04419606551527977, 0.01118964422494173, 0.020725863054394722, 0.008493093773722649, -0.0120250154286623, 0.0364435613155365, 0.02145680971443653, 0.048289068043231964, 0.032027650624513626, 0.04485905542969704, -0.027968186885118484, 0.01095928531140089, 0.01987139694392681, -0.0025765534956008196, -0.0011247810907661915, 0.006989217828959227, -0.03718987852334976, -0.00027724335086531937, -0.007447598967701197, -0.011027579195797443, 0.04216286912560463, 0.02831616997718811, 0.012811834923923016, -0.021158279851078987, -0.01365253422409296, 0.01572960801422596, -0.02581813745200634, -0.04445746913552284, -0.03080383501946926, -0.048842400312423706, 0.005642678588628769, -0.012652046978473663, 0.028876766562461853, -0.007970198057591915, 0.04946961998939514, 0.0010858173482120037, -0.008932641707360744, -0.004823456984013319, -0.02149709314107895, 0.07421708106994629, 0.0034374776296317577, -0.02948077581822872, -0.05661628767848015, 0.004643024876713753, 0.01680447906255722, -0.03215634450316429, 0.005072309169918299, 0.03775576129555702, -0.019063416868448257, 0.022050296887755394, 0.034658271819353104, -0.03655796870589256, -0.0017928436864167452, 0.05109470337629318, -0.007799698039889336, -0.016762586310505867, -0.07165145874023438, 0.05205290764570236, 0.011394263245165348, -0.04921777918934822, -0.0064986348152160645, -0.022555578500032425, -0.046594467014074326, 0.03125077858567238, 0.0003421971632633358, 0.009446301497519016, 0.017406458035111427, -0.0033736927434802055, -0.012244594283401966, 0.01242609228938818, 0.02949710749089718, -0.02648729272186756, 0.01798216626048088, -0.019517768174409866, 0.009996837936341763, -0.052955903112888336, 0.0407174751162529, 0.007668083067983389, 0.017566371709108353, 0.004294182173907757, 0.011514632031321526, -0.05425487458705902, 0.0035470500588417053, 0.006831974256783724, 0.011704000644385815, 0.05611874908208847, 0.01258801855146885, -0.047587405890226364, -0.03452738747000694, -0.0305754616856575, 0.03081579878926277, 0.04074062407016754, -0.0024363938719034195, 0.004014531150460243, -0.010929002426564693, -0.00840271357446909, -0.0028856275603175163, 0.07253508269786835, -0.009448571130633354, 0.05599866434931755, 0.002308177063241601, 0.011392987333238125, 0.015102283097803593, 0.06903258711099625, -0.00425818283110857, 0.012257610447704792, 0.05162006989121437, -0.018579304218292236, -0.024026669561862946, -0.007925385609269142, -0.002243174472823739, 0.03717116639018059, -0.0730833113193512, 0.03200773149728775, -0.011140267364680767, 0.01541152223944664, 0.048894792795181274, 0.015551526099443436, 0.0249506626278162, 0.00021704203390982002, 0.03527972102165222, 0.04250113666057587, -0.0033976139966398478, 0.026735540479421616, -0.011256818659603596, 0.0556928776204586, 0.009321031160652637, 0.01671685092151165, 0.07538940012454987, -0.001489176182076335, -0.025267869234085083, 0.048772864043712616, 0.03232593089342117, 0.0029057590290904045, -0.0003956837463192642, -0.006807387340813875, 0.06772676855325699, 0.022687822580337524, -0.008431410416960716, 0.024614574387669563, -0.02788998745381832, -0.02276550605893135, -0.03567880764603615, -0.02492489665746689, -0.005085891578346491, -0.02820691466331482, -0.02506011538207531, -0.03567437455058098, 0.004949844442307949, -0.015714064240455627, 0.019444379955530167, 0.04511965811252594, -0.013196360319852829, -0.017207695171236992, 0.008054166100919247, 0.001419730018824339, 0.016064221039414406, -0.014887654222548008, 0.011999922804534435, -0.00285081984475255, -0.021544037386775017, -0.028178995475172997, -0.04044076055288315, 0.0009112385450862348, -0.02217753790318966, -0.007475984748452902, 0.029729127883911133, 0.03932184725999832, -0.010212691500782967, 0.02581390179693699, 0.0031491757836192846, 0.04201401025056839, -0.012146287597715855, -0.005270893219858408, -0.012312216684222221, -0.04436938092112541, -0.033310774713754654, -0.04223513603210449, 0.004636475350707769, 0.023704031482338905, 0.0399625264108181, -0.015498440712690353, 0.01509436871856451, -0.04300759360194206, -0.08812887221574783, -0.03246993571519852, -0.014432189054787159, 0.004827763419598341, 0.026264667510986328, 0.04097022861242294, -0.016956724226474762, -0.012553771026432514, -0.04633171856403351, -0.00913028884679079, -0.043044231832027435, 0.008468197658658028, 0.05243111774325371, 0.03527459874749184, -0.029515357688069344, -0.020578579977154732, 0.013796331360936165, 0.05708792060613632, 0.018411047756671906, -0.01342102512717247, -0.02724509686231613, 0.03540786728262901, 0.002645674627274275, 0.011757289059460163, -0.0380118191242218, 0.009121919982135296, -0.023299308493733406, -0.008222580887377262, -0.034452129155397415, 0.03783855214715004, -0.005731895565986633, -0.012054653838276863, -0.02188451588153839, 0.005722786765545607, 0.004281987436115742, -0.033884111791849136, -0.03382166847586632, 0.017985714599490166, 0.05218994617462158, 0.004675731062889099, 0.03572453185915947, -0.026128418743610382, -0.04582560807466507, 0.00047872806317172945, 0.002182559110224247, -0.003488055197522044, 0.02083330787718296, 0.006306597962975502, -0.008612198755145073, 0.03204519674181938, 0.019284458830952644, -0.02774239331483841, -0.03569987416267395, -0.0005221001338213682, 0.010604691691696644, 0.012417144142091274, 0.0030893106013536453, 0.008036285638809204, 0.022931821644306183, -0.031070267781615257, 0.018211698159575462, 0.0386701300740242, -0.009885366074740887, -0.012425725348293781, -0.01418317761272192, -0.044577088207006454, -0.026076355949044228, -0.04631449282169342, -0.016205623745918274, 0.03331923857331276, -0.030548233538866043, 0.031539469957351685, -0.004629823379218578, 0.016068143770098686, -0.010315311141312122, -0.012166820466518402, -0.0263369083404541, -0.03356907144188881, 0.04538464546203613, 0.01847231574356556, -0.017462749034166336, 0.007092030718922615, 0.035608015954494476, 0.008418232202529907, -0.0034716834779828787, -0.053999871015548706, 0.02503695897758007, 0.00102324434556067, -0.016455529257655144, 0.009477461688220501, 0.010782286524772644, 0.061763036996126175, 0.04691724106669426, 0.002841823035851121, -0.017984382808208466, 0.05696900561451912 ]
Chat Templates: An End to the Silent Performance Killer
rocketknight1
October 3, 2023
chat-templates
LLM, nlp, community
https://huggingface.co/blog/chat-templates
Why templates? Although Jinja can be confusing at first if you're unfamiliar with it, in practice we find that Python programmers can pick it up quickly. During development of this feature, we considered other approaches, such as a limited system to allow users to specify per-role prefixes and suffixes for messages. We found that this could become confusing and unwieldy, and was so inflexible that hacky workarounds were needed for several models. Templating, on the other hand, is powerful enough to cleanly support all of the message formats that we're aware of.
[ 0.0708654522895813, 0.03196801245212555, 0.04415322467684746, 0.04567691683769226, 0.026148347184062004, 0.02581213042140007, 0.027981987223029137, -0.011539729312062263, -0.04155491292476654, -0.008342958986759186, -0.08958984166383743, -0.019101059064269066, -0.006785565055906773, 0.07291364669799805, -0.024370109662413597, -0.006585670169442892, 0.03932502865791321, 0.014317364431917667, -0.03958740457892418, 0.027845660224556923, -0.02247554250061512, -0.00830061174929142, 0.09239291399717331, -0.011120638810098171, 0.021094469353556633, -0.013350003398954868, -0.007310819812119007, -0.005209776107221842, -0.10930222272872925, 0.02813519537448883, -0.058404646813869476, 0.027475152164697647, -0.029990574344992638, 0.052728984504938126, -0.011003109626471996, -0.026432618498802185, -0.05202196165919304, 0.097488172352314, -0.005163232795894146, -0.06523796170949936, 0.014683360233902931, -0.08135436475276947, -0.04087531939148903, 0.05619242787361145, -0.036423210054636, -0.04788053780794144, -0.20255634188652039, 0.09355854243040085, -0.020534571260213852, -0.05429672822356224, -0.11731621623039246, 0.0782761201262474, -0.01509774848818779, -0.022599929943680763, -0.014574665576219559, -0.028912696987390518, 0.011414986103773117, -0.0033229184336960316, -0.017253778874874115, -0.005273416172713041, -0.004770767875015736, 0.031244108453392982, 0.01028378400951624, -0.03165625408291817, 0.05251239985227585, 0.029208078980445862, 0.002296077786013484, 0.07166378200054169, -0.028935518115758896, -0.02537553757429123, -0.03308863937854767, 0.05479738861322403, -0.04565174877643585, -0.0049696615897119045, 0.04902544617652893, -0.029625002294778824, 0.019574960693717003, 0.02559921145439148, 0.0023536081425845623, 0.04299905523657799, 0.002763917436823249, 0.03683052211999893, 0.021775374189019203, 0.023136449977755547, 0.045547641813755035, -0.027162671089172363, 0.05138731002807617, -0.025060376152396202, -0.05922222509980202, -0.00716821663081646, 0.04737229272723198, -0.09445776790380478, 0.0218666885048151, -0.008598457090556622, 0.07913205027580261, -0.045882243663072586, -0.02638103999197483, 0.07588053494691849, 0.018894288688898087, -0.04370048642158508, 0.04743524640798569, -0.07949041575193405, 0.028858529403805733, -0.01855507679283619, -0.049138475209474564, 0.048021163791418076, -0.015626179054379463, -0.1043562963604927, -0.03376512601971626, 0.018837295472621918, 0.023349596187472343, 0.012750084511935711, 0.0002965749881695956, 0.12469251453876495, 0.04086832329630852, 0.030462071299552917, -0.00203221314586699, -0.02281320095062256, -0.04393304884433746, -0.014964635483920574, 0.06288343667984009, 0.045505672693252563, 0.07343781739473343, 0.014398854225873947, 0.006311366800218821, 0.010627512820065022, 0.02745487354695797, 0.027010366320610046, -0.013686174526810646, -0.05870819464325905, 0.019980106502771378, 0.08316405862569809, 0.01614910177886486, 0.013216241262853146, -0.03732093796133995, -0.04051981121301651, 0.021836280822753906, -0.04768858850002289, 0.08418870717287064, -0.04139631986618042, -0.0373123362660408, 0.0345177948474884, 0.023039761930704117, 0.08992797136306763, -0.03057817928493023, 0.024586748331785202, -0.016979781910777092, 0.008246585726737976, -0.06223157420754433, -0.02829427644610405, 0.010677028447389603, 0.00661386689171195, 0.010239502415060997, -0.02223808877170086, 0.005759113468229771, 0.09804987907409668, 0.04948540776968002, -0.023904776200652122, -0.040777985006570816, -0.062157563865184784, 0.019619189202785492, 0.03776784986257553, 0.013389596715569496, 0.05694963410496712, 0.006321128457784653, -0.05175279080867767, -0.020266391336917877, -0.023084482178092003, 0.06386788189411163, -0.01691184937953949, -0.008280670270323753, 0.024676527827978134, -0.008449294604361057, 0.0034431477542966604, 0.006253588944673538, 0.03925519064068794, 0.027886176481842995, 0.01094023883342743, 0.027940422296524048, -0.05022714287042618, -0.02557111717760563, 0.03590237721800804, -0.013955224305391312, -0.04950284957885742, 0.018386507406830788, -0.0945269912481308, -0.008322693407535553, -0.09313806146383286, -0.035317547619342804, -0.006764349993318319, -0.09117849171161652, -0.04376989230513573, 0.05586786940693855, 0.020442405715584755, 0.010009324178099632, -0.0390198789536953, -0.043934475630521774, 0.11763378232717514, 0.01388914417475462, 0.06947007775306702, 0.05557094141840935, 0.0012080048909410834, -0.04547273740172386, -0.011124290525913239, 0.05690277740359306, 0.0680660754442215, 0.05766605958342552, -0.05766359344124794, 0.003948090132325888, 0.019446469843387604, 0.056394871324300766, -0.0617457777261734, 0.08124643564224243, -0.09072902053594589, -0.02160940133035183, -0.008487502112984657, 0.01580551080405712, -0.03305796533823013, -0.04648454487323761, -0.024461213499307632, 0.10605588555335999, -0.050510942935943604, -0.05155858024954796, 0.0074553838931024075, 0.013965575024485588, 0.08535567671060562, 0.0036088500637561083, -0.009225132875144482, 0.09240776300430298, -0.10591350495815277, 0.02199585549533367, 0.025771791115403175, 0.005507677793502808, 0.05738985165953636, -0.007949206978082657, -0.003094251034781337, 0.0041053988970816135, -0.033702779561281204, 0.01988801173865795, -0.0022292681969702244, 0.0070333597250282764, 0.0091094970703125, -0.04100945591926575, 0.0454457625746727, -0.028009435161948204, -0.04224821925163269, 0.06176230311393738, -0.006739816628396511, -0.028943119570612907, 0.036144666373729706, -0.06969520449638367, 0.015399829484522343, 0.07830926030874252, -0.0667124092578888, 0.053372424095869064, 0.046150851994752884, 0.022340478375554085, -0.04001760482788086, -0.014855030924081802, 0.014695892110466957, -0.012513375841081142, -0.016854971647262573, -0.03791141137480736, -0.044972941279411316, -0.0011500202817842364, -0.024986466392874718, -0.004128582775592804, -0.018918894231319427, -0.01157333143055439, 0.040740277618169785, 0.010814626701176167, -0.05131702125072479, -0.04104374349117279, 0.013383686542510986, -0.008515756577253342, -0.017919622361660004, 0.019595326855778694, -0.008192104287445545, 0.02306278608739376, -0.05747409909963608, -0.022115390747785568, -0.02741388790309429, 0.056877490133047104, -0.006850388832390308, -0.004171385429799557, -0.011553963646292686, 0.01760146953165531, -0.01664172112941742, -0.049123793840408325, -0.009230242110788822, 0.003659231588244438, 0.02927323430776596, 0.013835535384714603, 0.011805792339146137, 0.024060819298028946, 0.010737542994320393, 0.040645528584718704, 0.007665626704692841, 0.01022402010858059, 0.03162089362740517, 0.035847533494234085, -0.00857385341078043, 0.011899085715413094, -0.015244639478623867, -0.03011181205511093, 0.0395711287856102, -0.00497080385684967, -0.014340799301862717, -0.1048671081662178, -0.039102476090192795, 0.023194238543510437, -0.027471695095300674, 0.008482144214212894, 0.01364140771329403, 0.028911462053656578, -0.041690900921821594, 0.023259004577994347, 0.021179480478167534, -0.030716944485902786, 0.0334184505045414, -0.0165385864675045, -0.005525034386664629, 0.007358252070844173, -0.02216038666665554, 0.0011231868993490934, 0.03634762763977051, 0.06883388757705688, 0.010895800776779652, -0.011973296292126179, 0.074257493019104, -0.0028036197181791067, 0.018416693434119225, -0.0324762724339962, 0.006195500493049622, 0.05131802335381508, 0.03928443789482117, 0.013294941745698452, -0.03299224004149437, 0.002096202690154314, -0.02308490499854088, -0.011344623751938343, -0.038525357842445374, -0.019942238926887512, -0.004355459939688444, 0.025310102850198746, -0.0026114685460925102, 0.017960112541913986, 0.012042718008160591, -0.026463106274604797, -0.030267952010035515, 0.04509339481592178, -0.001529040397144854, -0.004811967723071575, -0.021291475743055344, -0.015053918585181236, -0.0032003240194171667, 0.04598964750766754, -0.0008188688661903143, 0.0002739497576840222, -0.04596728831529617, 0.02064419724047184, 0.028526518493890762, 0.04960372671484947, 0.008738718926906586, -0.0012271052692085505, 0.04856910556554794, 0.00039639187161810696, -0.020615214481949806, -0.01350830402225256, -0.0016145609552040696, 0.025425557047128677, -0.003508915426209569, -0.0353674590587616, 0.08272609859704971, -0.010844392701983452, 0.015448154881596565, 0.02208007499575615, 0.014384925365447998, -0.007189078256487846, 0.025309298187494278, -0.016954073682427406, 0.014674694277346134, 0.006722890771925449, 0.007539242506027222, -0.011372486129403114, -0.013124309480190277, 0.04422122240066528, -0.006855049170553684, -0.018847109749913216, -0.028139319270849228, -0.03412903472781181, -0.01610778272151947, 0.031666964292526245, 0.05888255313038826, -0.004635579418390989, 0.027071015909314156, -0.011420833878219128, 0.03564366698265076, 0.01682509109377861, -0.028329821303486824, 0.033350870013237, 0.042647771537303925, 0.0036953077651560307, 0.03508211299777031, 0.015481808222830296, -0.0062508671544492245, 0.013236426748335361, -0.014470983296632767, -0.004119571764022112, -0.044523924589157104, -0.02884318120777607, -0.015213431790471077, 0.01529043447226286, 0.033988818526268005, -0.03364470973610878, -0.041664641350507736, 0.005181935615837574, 0.02072536200284958, -0.008928251452744007, 0.015311791561543941, 0.018222784623503685, -0.028740977868437767, 0.0030011036433279514, 0.06651131063699722, 0.006872732192277908, -0.010531974025070667, -0.029756668955087662, 0.04212937131524086, -0.041661519557237625, 0.011586840264499187, 0.009182457812130451, 0.004972194787114859, -0.01817222312092781, -0.024657778441905975, 0.032884690910577774, -0.034579839557409286, 0.002656363183632493, 0.02384600229561329, -0.002167384373024106, -0.032443784177303314, -0.034287940710783005, 0.004264522343873978, 0.050497427582740784, 0.01846693828701973, -0.004312761593610048, 0.04525158926844597, -0.009862461127340794, -0.07902457565069199, -0.05508863553404808, -0.021202875301241875, 0.029942279681563377, -0.022455986589193344, 0.05652429535984993, -0.02974005602300167, -0.03594691678881645, -0.008716069161891937, 0.037551410496234894, 0.03411205857992172, 0.04740733653306961, 0.021946897730231285, -0.01027266588062048, -0.04407186061143875, 0.001366438576951623, -0.0008493140921927989, -0.038475535809993744, -0.005263410974293947, 0.006222701631486416, 0.025557417422533035, -0.014524973928928375, -0.032115429639816284, -0.03023318015038967, 0.007701575290411711, -0.013537783175706863, -0.012643308378756046, 0.005228285677731037, -0.053062792867422104, 0.040431734174489975, 0.0015917196869850159, -0.06677192449569702, 0.01527174562215805, 0.013571596704423428, -0.008139529265463352, 0.01963513158261776, 0.009041485376656055, 0.016987385228276253, 0.03334452211856842, 0.018648143857717514, -0.04679349809885025, -0.01649697870016098, 0.016837401315569878, 0.02076580747961998, 0.00683709979057312, -0.02524634450674057, 0.009970386512577534, -0.0075774178840219975, 0.023792818188667297, 0.029653705656528473, 0.01165966596454382, 0.018082179129123688, -0.010728798806667328, 0.0027240572962909937, -0.06620410084724426, 0.03066207468509674, 0.028789125382900238, -0.03842552751302719, -0.02188674360513687, -0.025083711370825768, 0.010371247306466103, 0.011753709055483341, 0.045621782541275024, -0.007216461934149265, -0.02397257275879383, -0.013750886544585228, 0.02754736877977848, 0.019162852317094803, -0.061735447496175766, -0.0035621249116957188, -0.06657641381025314, 0.0054902806878089905, -0.00950341671705246, 0.013588454574346542, -0.01156677957624197, 0.009638150222599506, -0.05530837923288345, -0.04480142146348953, 0.01761796697974205, 0.020056316629052162, -0.0008826726116240025, -0.017108630388975143, 0.006442621815949678, -0.0440533310174942, 0.027878478169441223, 0.016709912568330765, -0.0045103952288627625, -0.02272578701376915, 0.039392631500959396, -0.013912237249314785, -0.011712606996297836, 0.04130902886390686, -0.011333400383591652, 0.02763214334845543, 0.03530680015683174, -0.029513977468013763, -0.004170731641352177, -0.05144934356212616, 0.060919035226106644, 0.005422523710876703, -0.023337963968515396, -0.011789937503635883, -0.036845821887254715, -0.05660253018140793, 0.013036909513175488, 0.011276669800281525, 0.04118601977825165, 0.051055457442998886, 0.021169167011976242, -0.01928609237074852, 0.04599979892373085, 0.022097904235124588, -0.0019806597847491503, -0.0007011567358858883, -0.010402564890682697, 0.03379426151514053, -0.022432982921600342, 0.04194425046443939, 0.007614352274686098, 0.021883495151996613, -0.03115726076066494, 0.026266006752848625, -0.021463023498654366, -0.013418827205896378, 0.0011377295013517141, -0.0036500392016023397, 0.033936500549316406, 0.022806020453572273, -0.039815064519643784, -0.016817696392536163, -0.04104962944984436, -0.0022147158160805702, 0.0622372031211853, 0.029618239030241966, -0.004057748708873987, 0.0013961518416181207, -0.010545285418629646, -0.00547148659825325, 0.023790908977389336, 0.023186055943369865, 0.06726381927728653, 0.020068472251296043, 0.03880015015602112, 0.040702465921640396, 0.02832881547510624, -0.022064106538891792, -0.002866242313757539, 0.0636337623000145, -0.01877610571682453, 0.003836905350908637, -0.019948242232203484, -0.025108573958277702, 0.0009199394262395799, -0.05231689661741257, 0.019672084599733353, -0.062446240335702896, -0.012712441384792328, 0.03780006989836693, -0.004786231089383364, -0.008185271173715591, -0.030018219724297523, 0.03316594287753105, 0.04015737399458885, 0.003094832878559828, 0.024484040215611458, -0.0444028340280056, 0.021072471514344215, 0.008909723721444607, 0.007288326509296894, 0.052714910358190536, -0.004728366620838642, -0.026796376332640648, 0.03214605897665024, 0.04088709130883217, 0.006204305682331324, -0.029942063614726067, 0.01409924402832985, 0.024553436785936356, -0.04663914814591408, 0.006482613738626242, 0.0280036311596632, -0.02449687197804451, 0.0008071241900324821, -0.002140388358384371, -0.03734525665640831, -0.0007162304245866835, -0.03274216130375862, 0.008568056859076023, -0.005786548834294081, -0.0006687024724669755, -0.026445971801877022, -0.005617488641291857, 0.04588418826460838, -0.006861474830657244, -0.04640393331646919, -0.02322886697947979, -0.012190579436719418, 0.030678313225507736, 0.03349979594349861, 0.02069784514605999, -0.0021631731651723385, -0.038703955709934235, -0.04938700795173645, -0.017952440306544304, -0.0012292795581743121, 0.02092498168349266, -0.0013443722855299711, 0.01075588446110487, -0.0009374122601002455, -0.012471525929868221, 0.040471211075782776, -0.02411731518805027, 0.01554224081337452, -0.012498431839048862, 0.0018667225958779454, -0.05511016026139259, -0.0782640129327774, -0.013819792307913303, -0.005242315586656332, 0.022073764353990555, 0.001265966217033565, 0.0030017176177352667, -0.03138025104999542, 0.00010573831968940794, -0.04276279732584953, -0.032397862523794174, -0.009754989296197891, 0.00790474284440279, 0.0030475070234388113, 0.05717124417424202, 0.06172855570912361, -0.003752055810764432, 0.03269331529736519, -0.02076956257224083, 0.021128378808498383, -0.05186718329787254, -0.023509053513407707, 0.03608084097504616, 0.005708908662199974, 0.004630273208022118, -0.04502194747328758, 0.047929540276527405, 0.020261500030755997, 0.04473463445901871, -0.01447281613945961, -0.00040884932968765497, 0.009323390200734138, -0.016203952953219414, 0.009249838069081306, -0.022629158571362495, 0.05230093002319336, 0.0014411744195967913, -0.007879765704274178, -0.02224232442677021, 0.023185374215245247, 0.011605537496507168, 0.003698423970490694, -0.04577098414301872, 0.03610469773411751, 0.005519997328519821, 0.010603167116641998, -0.07088761031627655, 0.030185101553797722, 0.06493770331144333, 0.03371743485331535, 0.01240351889282465, 0.02462722733616829, -0.044159434735774994, -0.01788378320634365, -0.007923442870378494, 0.019468845799565315, 0.036937225610017776, -0.014325084164738655, -0.021944982931017876, -0.026461616158485413, 0.01586799882352352, -0.021351458504796028, -0.03485936298966408, 0.0005282730562612414, 0.039306506514549255, -0.03137127682566643, -0.02782280556857586, 0.010747818276286125, 0.03057531826198101, -0.03773653879761696, 0.002752239815890789, 0.038261301815509796, -0.027964239940047264, -0.008147173561155796, -0.004674001596868038, -0.05485917627811432, -0.028800999745726585, -0.04746899753808975, -0.01234755851328373, 0.06237064301967621, -0.0008644434274174273, 0.011556712910532951, -0.00024248160480055958, 0.006377170328050852, 0.0271319430321455, -0.013902553357183933, -0.020429152995347977, -0.03358650580048561, 0.02927747182548046, 0.017583101987838745, -0.0264224074780941, -0.024858223274350166, 0.029027488082647324, -0.003823925042524934, 0.001658872002735734, -0.022146303206682205, 0.014165753498673439, -0.017000650987029076, 0.03791501745581627, 0.031193263828754425, 0.03135005012154579, 0.05415815860033035, 0.02438376285135746, 0.018765687942504883, -0.012133967131376266, 0.01999085582792759 ]
Chat Templates: An End to the Silent Performance Killer
rocketknight1
October 3, 2023
chat-templates
LLM, nlp, community
https://huggingface.co/blog/chat-templates
Templates: A way to save format information Right now, if you're lucky, the format you need is correctly documented somewhere in the model card. If you're unlucky, it isn't, so good luck if you want to use that model. In extreme cases, we've even put the whole prompt format in a blog post to ensure that users don't miss it! Even in the best-case scenario, though, you have to locate the template information and manually code it up in your fine-tuning or inference pipeline. We think this is an especially dangerous issue because using the wrong chat format is a silent error - you won't get a loud failure or a Python exception to tell you something is wrong, the model will just perform much worse than it would have with the right format, and it'll be very difficult to debug the cause! This is the problem that chat templates aim to solve. Chat templates are Jinja template strings that are saved and loaded with your tokenizer, and that contain all the information needed to turn a list of chat messages into a correctly formatted input for your model. Here are three chat template strings, corresponding to the three message formats above: jinja {% for message in messages %} {% if message['role'] == 'user' %} {{ "User : " }} {% else %} {{ "Bot : " }} {{ message['content'] + '\n' }} {% endfor %} jinja {% for message in messages %} {% if message['role'] == 'user' %} {{ "[USER] " + message['content'] + " [/USER]" }} {% else %} {{ "[ASST] " + message['content'] + " [/ASST]" }} {{ message['content'] + '\n' }} {% endfor %} jinja "{% for message in messages %}" "{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}" "{% endfor %}" If you're unfamiliar with Jinja, I strongly recommend that you take a moment to look at these template strings, and their corresponding template outputs, and see if you can convince yourself that you understand how the template turns a list of messages into a formatted string! The syntax is very similar to Python in a lot of ways.
[ -0.009760676883161068, -0.0007530237198807299, -0.002869623713195324, 0.04959509149193764, 0.04472126066684723, 0.0007063706289045513, 0.05800122022628784, -0.04330555722117424, -0.015231050550937653, -0.009332545101642609, -0.06383087486028671, -0.013506309129297733, 0.028847401961684227, 0.046226754784584045, -0.09729176759719849, -0.017122836783528328, 0.005642819218337536, 0.03424305468797684, -0.02300172857940197, 0.02219242975115776, -0.018257569521665573, -0.012297257781028748, 0.06697598099708557, -0.010804266668856144, 0.07019007205963135, -0.06678988039493561, -0.016606777906417847, 0.005942920222878456, -0.06944159418344498, -0.0009476327686570585, -0.07357519119977951, 0.011158658191561699, -0.03308561444282532, -0.046968936920166016, 0.01917283423244953, -0.0006496669957414269, -0.053024012595415115, 0.07485929876565933, -0.020309580489993095, -0.009411604143679142, 0.02518320642411709, -0.05580868944525719, 0.0019194928463548422, 0.035568322986364365, 0.03758104145526886, -0.048058513551950455, -0.19910836219787598, 0.0615333653986454, -0.04677126556634903, -0.008922560140490532, -0.06448546051979065, 0.07370171695947647, -0.07776906341314316, -0.0034625730477273464, -0.021882066503167152, -0.017237553372979164, -0.022148728370666504, -0.01797385886311531, -0.06623183935880661, 0.06934656202793121, 0.022614924237132072, 0.035342998802661896, 0.04404868930578232, -0.011894379742443562, 0.06973101943731308, 0.023304913192987442, 0.027152907103300095, 0.052611012011766434, -0.008623444475233555, -0.0635550320148468, 0.0005178775754757226, 0.06377170979976654, 0.03572188317775726, -0.029514143243432045, 0.014011767692863941, -0.05727788805961609, -0.012569531798362732, 0.07389450818300247, -0.002149718115106225, -0.0029281924944370985, -0.06732165813446045, 0.014166873879730701, 0.062071263790130615, 0.026606373488903046, 0.01929946430027485, 0.01611429825425148, 0.05983223021030426, -0.044631391763687134, -0.012487342581152916, -0.014370149932801723, -0.019898423925042152, -0.103476382791996, 0.04111305624246597, 0.033502060920000076, -0.008664179593324661, -0.04116099700331688, -0.05576916038990021, 0.05508062243461609, -0.005539667792618275, -0.032622192054986954, 0.056833043694496155, -0.05469135940074921, 0.02976217307150364, -0.041781917214393616, -0.07916439324617386, 0.03453117981553078, -0.06911569088697433, -0.10095815360546112, 0.0029429744463413954, -0.030328722670674324, 0.003286866471171379, 0.005896523129194975, -0.001134941354393959, 0.0974486842751503, -0.0075407191179692745, 0.012585854157805443, -0.001253791619092226, 0.0007439446053467691, -0.05668064206838608, 0.02096468396484852, 0.05550086125731468, 0.005397814325988293, 0.12166064977645874, -0.036750998347997665, -0.02733028121292591, 0.049632225185632706, 0.03516441956162453, 0.060031063854694366, -0.013886682689189911, -0.053847696632146835, -0.012177524156868458, 0.060965389013290405, -0.022503485903143883, 0.0043960255570709705, -0.011448879726231098, -0.047147661447525024, 0.009384533390402794, -0.06545727699995041, 0.04917003586888313, -0.028240559622645378, -0.02718287520110607, 0.02973099797964096, 0.03575650230050087, 0.0592038594186306, 0.007725443225353956, 0.023196984082460403, -0.04075043275952339, 0.004897948820143938, -0.019496746361255646, -0.04429633915424347, -0.008045999333262444, -0.005706581752747297, 0.07740989327430725, -0.049621980637311935, -0.019744982942938805, 0.06608270108699799, 0.015549973584711552, -0.004627997986972332, -0.04014777019619942, -0.0773305594921112, 0.03547926992177963, 0.062092725187540054, -0.02699204348027706, 0.06643082201480865, 0.04182856157422066, -0.01894954778254032, -0.04722709208726883, -0.04940655827522278, 0.08936846256256104, -0.028218526393175125, 0.04708249494433403, -0.023659540340304375, 0.05758918076753616, 0.026738306507468224, 0.028303327038884163, 0.017754020169377327, 0.0374869629740715, 0.013457909226417542, 0.033775217831134796, -0.05184740573167801, -0.06701009720563889, 0.026533272117376328, -0.043768104165792465, -0.011770838871598244, 0.03823511675000191, -0.07054752111434937, -0.004587891511619091, -0.08429544419050217, -0.01768512651324272, 0.00888010859489441, -0.026840949431061745, -0.007909993641078472, 0.05705230310559273, 0.03952576220035553, 0.03328247740864754, -0.04770838841795921, -0.05518374219536781, 0.06813132762908936, 0.08972391486167908, 0.08317174017429352, 0.02960381843149662, 0.009367462247610092, -0.024202806875109673, 0.010251701809465885, 0.052529226988554, 0.05557142198085785, 0.009397533722221851, -0.09502747654914856, -0.010163811966776848, 0.03463519737124443, -0.0021221612114459276, -0.08190065622329712, 0.13457302749156952, -0.06317821145057678, -0.05219634994864464, -0.07051044702529907, -0.011927369982004166, 0.0023448155261576176, -0.03467525169253349, -0.004963058512657881, 0.1342024803161621, -0.042733438313007355, -0.005228797439485788, 0.0017449691658839583, 0.006569294258952141, 0.06237801909446716, -0.018790490925312042, 0.09471510350704193, 0.1345701813697815, -0.12279660999774933, -0.004296106286346912, -0.00836047064512968, 0.023104531690478325, 0.026347432285547256, -0.012736143544316292, -0.006630615796893835, 0.035845447331666946, 0.014676269143819809, 0.029282523319125175, -0.007665922865271568, 0.021321384236216545, -0.004960924852639437, 0.020560704171657562, -0.014469824731349945, -0.011725871823728085, 0.04755125939846039, 0.05137057974934578, 0.012714940123260021, -0.034122634679079056, 0.039207302033901215, -0.041672177612781525, 0.03421896696090698, -0.001191021641716361, -0.04110341519117355, -0.0026364095974713564, 0.05166657641530037, 0.062037546187639236, -0.01749671809375286, -0.02009119652211666, 0.03762749210000038, -0.015110043808817863, 0.01115436665713787, -0.021681498736143112, -0.031104588881134987, 0.008465487509965897, -0.06074419245123863, 0.014627207070589066, -0.02642829157412052, -0.02827647142112255, 0.0325264148414135, 0.016991043463349342, -0.02217947132885456, -0.026837674900889397, 0.036701418459415436, 0.029864268377423286, 0.023415518924593925, 0.01444182638078928, -0.04689883440732956, 0.03003118187189102, -0.00023198421695269644, -0.014938144944608212, -0.028189649805426598, 0.020148908719420433, 0.019399894401431084, -0.0008125767926685512, 0.03588065877556801, 0.03495647758245468, 0.000733580207452178, -0.028370488435029984, -0.03399307653307915, 0.011108720675110817, 0.03608860820531845, 0.009837541729211807, 0.010296168737113476, 0.02579045481979847, 0.02540123090147972, -0.00591447064653039, 0.038943689316511154, -0.009564288891851902, 0.0622367337346077, 0.0000519440982316155, -0.04028705134987831, 0.01427103579044342, -0.013471792452037334, 0.01778542436659336, 0.033368032425642014, -0.020986732095479965, -0.000007780390660627745, -0.09185212105512619, -0.012168154120445251, 0.01290728896856308, 0.021481633186340332, -0.0026930703315883875, 0.003967946395277977, 0.05579182878136635, 0.0004072326992172748, -0.019225595518946648, 0.0213755015283823, -0.0401185117661953, 0.03619669750332832, -0.0182204470038414, 0.031125681474804878, 0.018503088504076004, 0.015110369771718979, -0.02010476402938366, -0.024768952280282974, 0.07275774329900742, -0.007164887152612209, -0.05262957140803337, 0.0474073626101017, -0.01241972204297781, 0.03014427423477173, -0.00719404174014926, 0.024521155282855034, 0.09837527573108673, 0.05298576503992081, -0.01086451206356287, -0.028156349435448647, -0.0007832946721464396, -0.04331455007195473, -0.023057332262396812, -0.02606099657714367, -0.047601405531167984, 0.02098689042031765, -0.0017816931940615177, 0.00443457905203104, 0.032207027077674866, -0.012512302957475185, -0.028184952214360237, 0.02672308124601841, 0.04847254231572151, -0.018393483012914658, 0.022207196801900864, -0.010781005024909973, -0.005220167804509401, -0.0005646756035275757, -0.012513883411884308, -0.004460895899683237, 0.011862488463521004, -0.04559338092803955, 0.0196763314306736, 0.05219799652695656, -0.003450734307989478, 0.017766345292329788, 0.015505209565162659, 0.014215925708413124, 0.0012598497560247779, -0.03349822759628296, -0.059634074568748474, 0.03162631765007973, -0.010218142531812191, -0.00013268851034808904, 0.0033707863185554743, 0.023447135463356972, -0.004313330166041851, 0.0062183113768696785, 0.02760642021894455, 0.07299020141363144, -0.02908002771437168, 0.013451026752591133, -0.0017807071562856436, 0.012101286090910435, -0.02173866145312786, 0.0007811146788299084, -0.035469625145196915, -0.027137434110045433, 0.02338225767016411, 0.015181471593677998, -0.020845329388976097, -0.007363840937614441, -0.06761304289102554, -0.0036545759066939354, 0.03356214240193367, 0.019369402900338173, 0.05606041103601456, 0.010153587907552719, -0.0021404256112873554, 0.032386135309934616, 0.02112003043293953, -0.028063086792826653, 0.03303620591759682, 0.018053939566016197, -0.010018742643296719, 0.01547964382916689, -0.0020546126179397106, -0.01209074817597866, 0.01233914028853178, 0.00571791548281908, -0.004521640483289957, -0.053384482860565186, 0.022954992949962616, -0.0244060717523098, 0.02261730469763279, 0.020244218409061432, -0.034767426550388336, -0.05833993852138519, 0.0005385684198699892, -0.0000036918579553457676, -0.007062491495162249, -0.010664091445505619, -0.0059761605225503445, 0.0099827004596591, 0.017630338668823242, 0.028503920882940292, 0.012633632868528366, 0.020368320867419243, -0.013155770488083363, 0.025719573721289635, -0.04002244770526886, -0.026301536709070206, -0.011799580417573452, 0.012511547654867172, 0.010696052573621273, -0.02470637485384941, 0.033147044479846954, -0.048051122575998306, 0.019411422312259674, 0.00034585566027089953, 0.001154638361185789, -0.026886237785220146, -0.004186195321381092, 0.016168011352419853, 0.0467715784907341, 0.021581163629889488, -0.00893324613571167, 0.015395186841487885, -0.0060303304344415665, -0.05922362208366394, -0.03864084184169769, -0.037667129188776016, 0.035804763436317444, -0.041752543300390244, 0.017093390226364136, -0.002230808138847351, -0.027305828407406807, 0.014426040463149548, 0.0746096521615982, 0.03524201363325119, 0.021820159628987312, 0.001741982763633132, -0.01993584632873535, -0.052763763815164566, 0.006762589793652296, 0.01001841202378273, -0.05697628855705261, -0.0025050451513379812, 0.02100706845521927, 0.02251598611474037, -0.0049822283908724785, -0.0035632688086479902, -0.019723324105143547, 0.03730333223938942, 0.02629963867366314, -0.02927447110414505, 0.02627241238951683, -0.07217467576265335, 0.0425167977809906, -0.017672577872872353, -0.022478410974144936, 0.0037933909334242344, 0.018244225531816483, -0.0037860237061977386, 0.045440178364515305, -0.01018510665744543, 0.020803341642022133, 0.05360028147697449, 0.003075827145949006, -0.06195541471242905, -0.042060721665620804, 0.03287042677402496, 0.04700876399874687, 0.007317242678254843, -0.027057478204369545, 0.004346820060163736, 0.030122773721814156, 0.05427563562989235, 0.007488975767046213, 0.03755028918385506, 0.006300539243966341, 0.0033247568644583225, 0.01358533650636673, -0.03832433745265007, 0.003441902343183756, 0.020422331988811493, -0.024906186386942863, -0.004477733746170998, 0.0008214311674237251, -0.0027218747418373823, 0.0755351334810257, 0.03218718245625496, -0.01456495001912117, -0.015239695087075233, 0.024114277213811874, -0.005652384366840124, -0.017671069130301476, -0.02082129381597042, 0.0005126864416524768, -0.04408377781510353, 0.006803001742810011, -0.023699821904301643, 0.003709159092977643, -0.009144295938313007, 0.050829898566007614, -0.02241591177880764, -0.028188979253172874, -0.0030491326469928026, -0.0033513607922941446, 0.0981924906373024, -0.017896031960844994, 0.018865328282117844, -0.04182015359401703, -0.010664879344403744, -0.001867742626927793, -0.025479385629296303, 0.015242919325828552, 0.017826378345489502, -0.02181536890566349, -0.00017441452655475587, 0.04370436817407608, -0.0179888978600502, -0.007715762592852116, 0.05091613531112671, -0.010533531196415424, -0.009057062678039074, -0.07121098041534424, 0.030617572367191315, 0.010646460577845573, -0.03519723191857338, -0.01522210706025362, -0.007896289229393005, -0.04943597689270973, 0.02336539700627327, 0.002695573028177023, 0.026664555072784424, 0.03407420590519905, -0.0012749378802254796, -0.04077381268143654, 0.016919882968068123, -0.0022292996291071177, -0.025580519810318947, 0.016077879816293716, -0.00008189473010133952, 0.0024316501803696156, -0.010205959901213646, 0.03794945776462555, -0.0016652372432872653, 0.0046449871733784676, 0.005640476476401091, 0.02513936161994934, -0.04113544896245003, 0.001629797974601388, 0.005726765841245651, 0.025143500417470932, 0.043121978640556335, 0.014120490290224552, -0.030926255509257317, -0.02344907633960247, -0.03430590406060219, 0.022385012358427048, 0.024218032136559486, 0.01105035562068224, 0.0004931940347887576, 0.012218981049954891, -0.009486386552453041, 0.0008118415134958923, 0.07538329809904099, -0.018353410065174103, 0.07239773124456406, -0.01129633467644453, 0.00036237610038369894, -0.006688491441309452, 0.05230635032057762, -0.04176303744316101, -0.009138151071965694, 0.033535782247781754, -0.022447308525443077, -0.028916923329234123, 0.006218241527676582, -0.020793620496988297, 0.026863250881433487, -0.01966983638703823, 0.02696319855749607, -0.010052281431853771, -0.0003137422609142959, 0.012014264240860939, 0.0222171563655138, -0.006980548612773418, -0.015397096984088421, 0.053654566407203674, 0.026446104049682617, 0.00914025492966175, 0.003313702531158924, -0.008246547542512417, 0.024967847391963005, -0.023443838581442833, -0.013238143175840378, 0.05836726352572441, 0.01903042010962963, -0.016608668491244316, 0.05165434628725052, -0.003866408485919237, 0.010758290998637676, 0.005607422906905413, 0.021661659702658653, 0.03430497646331787, -0.012653837911784649, -0.02277836948633194, 0.01063363254070282, -0.028806278482079506, -0.019920507445931435, -0.043781500309705734, -0.009996682405471802, 0.024428412318229675, -0.03254332393407822, 0.006319022737443447, -0.035711031407117844, -0.01754496991634369, -0.025501303374767303, -0.0018781027756631374, 0.04113351181149483, -0.0036164349876344204, -0.03892882913351059, -0.009182523936033249, -0.015675636008381844, -0.01505285408347845, 0.008063231594860554, 0.011018437333405018, 0.0009731921018101275, -0.037185657769441605, 0.009101774543523788, -0.032892823219299316, -0.006586592178791761, -0.008095215074717999, -0.007951916195452213, 0.027569571509957314, 0.007010960020124912, -0.030908625572919846, 0.036718711256980896, -0.00294104334898293, 0.01891169138252735, -0.014172361232340336, -0.006956442724913359, -0.005816148594021797, -0.05508106201887131, -0.05246448516845703, -0.04944562911987305, -0.01025979034602642, 0.021257763728499413, 0.020870761945843697, -0.03603000193834305, -0.005624644458293915, -0.04140424355864525, -0.09197770059108734, 0.010535003617405891, -0.03438717499375343, 0.006236259825527668, 0.017131604254245758, 0.030251136049628258, -0.020856207236647606, -0.00019454755238257349, -0.01992919109761715, -0.014323419891297817, -0.04529613256454468, 0.0004968347493559122, 0.05117066204547882, 0.012796727940440178, -0.010237514041364193, -0.02572508715093136, 0.027414871379733086, 0.05329529941082001, 0.027369191870093346, -0.01630006730556488, -0.006374309305101633, 0.008858682587742805, -0.009860856458544731, 0.0082943020388484, -0.04147113487124443, 0.006149833556264639, -0.016826767474412918, -0.012672503478825092, -0.02647329680621624, 0.02832941710948944, -0.014394544996321201, 0.03284647315740585, -0.029506709426641464, 0.011133809573948383, 0.011055592447519302, -0.019675225019454956, -0.05186780169606209, 0.045794494450092316, 0.08423738181591034, -0.0059436713345348835, 0.05230659246444702, 0.0074278321117162704, -0.03086826764047146, -0.015858599916100502, 0.020119300112128258, 0.03611277788877487, 0.00560135580599308, 0.007761253975331783, -0.032013844698667526, 0.019261207431554794, 0.03727935627102852, -0.025690963491797447, -0.022673264145851135, -0.014971097931265831, 0.020587561652064323, -0.016512159258127213, -0.0013923374935984612, 0.003492860123515129, 0.021276818588376045, -0.013527141883969307, 0.024253547191619873, 0.0313793383538723, -0.02527162991464138, -0.03081180341541767, 0.01697182096540928, -0.062024157494306564, -0.008312155492603779, -0.03557148575782776, -0.01285118330270052, 0.008002662099897861, -0.03214148059487343, 0.049822721630334854, -0.0216273944824934, -0.017838668078184128, 0.022249959409236908, -0.012085848487913609, -0.03492565080523491, -0.022014377638697624, 0.03093227557837963, 0.022525673732161522, -0.02451007440686226, -0.006254870444536209, 0.014651574194431305, -0.014734513126313686, -0.011673877947032452, -0.039269641041755676, 0.007877848111093044, 0.013616933487355709, 0.004413609858602285, 0.0010318632703274488, 0.0015079418662935495, 0.044135916978120804, 0.00847979448735714, -0.03317875415086746, -0.043766994029283524, 0.043244171887636185 ]
Chat Templates: An End to the Silent Performance Killer
rocketknight1
October 3, 2023
chat-templates
LLM, nlp, community
https://huggingface.co/blog/chat-templates
Introduction If you're familiar with the ๐Ÿค— Transformers library, you've probably written code like this: python tokenizer = AutoTokenizer.from_pretrained(checkpoint) model = AutoModel.from_pretrained(checkpoint) By loading the tokenizer and model from the same checkpoint, you ensure that inputs are tokenized in the way the model expects. If you pick a tokenizer from a different model, the input tokenization might be completely different, and the result will be that your model's performance will be seriously damaged. The term for this is a distribution shift - the model has been learning data from one distribution (the tokenization it was trained with), and suddenly it has shifted to a completely different one. Whether you're fine-tuning a model or using it directly for inference, it's always a good idea to minimize these distribution shifts and keep the input you give it as similar as possible to the input it was trained on. With regular language models, it's relatively easy to do that - simply load your tokenizer and model from the same checkpoint, and you're good to go. With chat models, however, it's a bit different. This is because "chat" is not just a single string of text that can be straightforwardly tokenized - it's a sequence of messages, each of which contains a role as well as content, which is the actual text of the message. Most commonly, the roles are "user" for messages sent by the user, "assistant" for responses written by the model, and optionally "system" for high-level directives given at the start of the conversation. If that all seems a bit abstract, here's an example chat to make it more concrete: python [ {"role": "user", "content": "Hi there!"}, {"role": "assistant", "content": "Nice to meet you!"} ] This sequence of messages needs to be converted into a text string before it can be tokenized and used as input to a model. The problem, though, is that there are many ways to do this conversion! You could, for example, convert the list of messages into an "instant messenger" format: User: Hey there! Bot: Nice to meet you! Or you could add special tokens to indicate the roles: [USER] Hey there! [/USER] [ASST] Nice to meet you! [/ASST] Or you could add tokens to indicate the boundaries between messages, but insert the role information as a string: <|im_start|>user Hey there!<|im_end|> <|im_start|>assistant Nice to meet you!<|im_end|> There are lots of ways to do this, and none of them is obviously the best or correct way to do it. As a result, different models have been trained with wildly different formatting. I didn't make these examples up; they're all real and being used by at least one active model! But once a model has been trained with a certain format, you really want to ensure that future inputs use the same format, or else you could get a performance-destroying distribution shift.
[ -0.015154254622757435, -0.019343644380569458, -0.02148381993174553, 0.0021403697319328785, 0.02903645858168602, 0.06045136973261833, 0.029340222477912903, 0.03065897338092327, -0.03818843141198158, 0.008226544596254826, -0.05905589833855629, 0.03863609582185745, -0.03417336195707321, 0.020868532359600067, -0.05368860065937042, 0.00003415654646232724, 0.0509660542011261, 0.0022108491975814104, -0.0029922286048531532, 0.01346162986010313, -0.021324967965483665, -0.006550935562700033, 0.03745974972844124, -0.02787141501903534, 0.029498623684048653, -0.04968482255935669, 0.009617475792765617, 0.028802653774619102, -0.04558611288666725, 0.014435971155762672, -0.11791512370109558, -0.02162856049835682, 0.014031335711479187, -0.013171866536140442, 0.028244752436876297, -0.022254059091210365, -0.0672881007194519, 0.02475738152861595, 0.029258012771606445, -0.03075692243874073, 0.0042308359406888485, -0.007057496812194586, -0.03829175606369972, 0.006727803498506546, 0.029252801090478897, -0.020408887416124344, -0.23830169439315796, 0.049261122941970825, -0.00459667481482029, -0.03969888016581535, -0.10916915535926819, 0.02073446847498417, -0.05415361374616623, 0.024780424311757088, 0.02738008089363575, -0.031953632831573486, -0.02400677464902401, -0.08068285882472992, -0.017494795843958855, 0.03681077063083649, 0.047883324325084686, 0.05486171320080757, -0.01196807436645031, -0.02985539473593235, 0.030398128554224968, 0.05935663729906082, 0.003908733371645212, 0.012735697440803051, -0.04933048412203789, -0.08247078210115433, -0.006589400582015514, 0.0027221674099564552, -0.049738023430109024, -0.04646309092640877, 0.02859330177307129, -0.06363728642463684, -0.06052439287304878, 0.009978960268199444, -0.01057196594774723, 0.009713046252727509, -0.016374358907341957, 0.035155873745679855, 0.042833101004362106, 0.0544368177652359, 0.04274186119437218, 0.015229473821818829, 0.07164112478494644, -0.03552739694714546, -0.01585191674530506, 0.02021797001361847, -0.053835995495319366, -0.13787399232387543, 0.02001420222222805, 0.002965764608234167, 0.036454178392887115, 0.011386990547180176, 0.033843085169792175, 0.06725948303937912, -0.006130142603069544, -0.033494532108306885, -0.010843053460121155, -0.07626566290855408, 0.01504187285900116, -0.043870072811841965, -0.04513737931847572, 0.039180561900138855, -0.04271634668111801, -0.05060774087905884, -0.009895246475934982, 0.004386909306049347, 0.0274872537702322, -0.009850310161709785, 0.017911860719323158, 0.13528142869472504, -0.028970841318368912, -0.010095376521348953, -0.024886906147003174, 0.013799455016851425, 0.03203532099723816, 0.04189780354499817, 0.04099278151988983, 0.036648787558078766, 0.0883617177605629, -0.007167546544224024, 0.018073875457048416, 0.0746372863650322, 0.02164342813193798, 0.036028604954481125, -0.033460699021816254, -0.029613910242915154, 0.020337626338005066, 0.04125583916902542, 0.032579537481069565, 0.04346819221973419, -0.01718921959400177, -0.05859995260834694, 0.04715612530708313, -0.06570246815681458, 0.09031333029270172, -0.04615331068634987, -0.031386859714984894, 0.01832510717213154, 0.002427887637168169, 0.02376212179660797, 0.05234543979167938, 0.042163148522377014, -0.09662029892206192, 0.051219355314970016, -0.013907955959439278, -0.0052355509251356125, -0.0636582002043724, 0.033918220549821854, 0.006432803347706795, -0.038429100066423416, 0.019693857058882713, 0.04935663938522339, 0.008793921209871769, -0.017287155613303185, -0.04246107488870621, -0.02667110785841942, -0.012451454997062683, 0.003917327616363764, -0.03776443377137184, 0.025603584945201874, -0.009195986203849316, -0.00012898241402581334, -0.003684527240693569, 0.006899633910506964, 0.06971391290426254, 0.016580911353230476, 0.028828466311097145, -0.007126267533749342, 0.03962189331650734, -0.01644843816757202, 0.02271309867501259, 0.077066570520401, -0.004632953554391861, 0.023499447852373123, -0.012163740582764149, -0.043968044221401215, -0.011116462759673595, 0.06678789854049683, -0.04283876717090607, 0.026235437020659447, 0.07736274600028992, -0.06098255142569542, 0.03576084226369858, -0.05516452714800835, -0.056870780885219574, 0.03322469815611839, -0.05212381109595299, -0.0002366461994824931, 0.0634419247508049, 0.012975485064089298, 0.02161935344338417, -0.10730022192001343, -0.04178640618920326, 0.10093460232019424, 0.024372756481170654, 0.057670075446367264, 0.08694512397050858, -0.02768734097480774, -0.029594993218779564, -0.01322868186980486, -0.0059404210187494755, 0.06498449295759201, -0.023956971243023872, -0.0940893292427063, 0.05582571402192116, 0.016350945457816124, 0.00027890989440493286, -0.06259523332118988, 0.01855297200381756, -0.07260344922542572, -0.016849743202328682, -0.024601949378848076, -0.028718028217554092, -0.0030337958596646786, -0.06277792900800705, -0.04888201877474785, 0.174087792634964, -0.0868285670876503, 0.047495968639850616, -0.015934020280838013, 0.005157331936061382, 0.038177233189344406, 0.03791968524456024, 0.033954232931137085, 0.10227888822555542, -0.08878529816865921, -0.060481294989585876, -0.05959447845816612, 0.025193000212311745, 0.00029377778992056847, -0.05022965744137764, -0.01669183000922203, 0.020645903423428535, -0.0035238638520240784, 0.006591315846890211, -0.035177141427993774, 0.03481903672218323, -0.04322334751486778, -0.021726593375205994, 0.04071798920631409, -0.05707429721951485, 0.028550870716571808, 0.04474802315235138, -0.0003834405215457082, -0.045936718583106995, 0.02234366349875927, -0.08685579150915146, 0.020541252568364143, 0.0226473119109869, -0.06317952275276184, 0.05082380399107933, 0.021010858938097954, -0.00871024839580059, 0.007919938303530216, -0.01950567401945591, 0.030357062816619873, 0.02369784191250801, -0.00011255827848799527, -0.028367340564727783, -0.026306217536330223, -0.05100633203983307, -0.03897473216056824, 0.0042021432891488075, 0.021580617874860764, -0.014826714061200619, 0.0463813953101635, 0.029068533331155777, -0.025846082717180252, 0.02018561400473118, 0.031019387766718864, 0.0021102975588291883, 0.06187267228960991, 0.0183976162225008, -0.027324901893734932, 0.005840761587023735, 0.01801360957324505, -0.013768053613603115, -0.047390054911375046, 0.04545966163277626, 0.028060661628842354, -0.02393365651369095, -0.024095220491290092, 0.022404631599783897, -0.01784946396946907, -0.05833324044942856, -0.0037559326738119125, 0.03565428406000137, 0.036797333508729935, -0.017538009211421013, 0.006418142002075911, 0.014728303998708725, 0.00889548473060131, -0.0179478470236063, 0.0003592072753235698, 0.019242802634835243, 0.042746447026729584, -0.030561814084649086, 0.019266312941908836, 0.03943677619099617, 0.03040674887597561, -0.017273254692554474, 0.02391972579061985, -0.026596106588840485, -0.007326636929064989, -0.09923550486564636, -0.005208837799727917, 0.04482024535536766, -0.0031620662193745375, -0.01210289541631937, -0.05136818438768387, 0.09922976791858673, -0.044815920293331146, -0.05288960784673691, -0.0031501748599112034, 0.018435858190059662, 0.022287452593445778, 0.012605655007064342, -0.015469829551875591, -0.02099994570016861, -0.020119044929742813, -0.032007887959480286, -0.01323784701526165, 0.032192960381507874, 0.011650375090539455, -0.03250933811068535, 0.02245429717004299, 0.009432891383767128, -0.00007985386764630675, -0.023115769028663635, -0.005844774190336466, 0.053098876029253006, 0.036242686212062836, 0.01720975525677204, -0.04451877996325493, -0.03108365461230278, -0.014329726807773113, -0.023470524698495865, 0.0008490585605613887, -0.023689931258559227, -0.02420966699719429, 0.01299147680401802, 0.017576297745108604, 0.032391101121902466, 0.027033686637878418, -0.0034508532844483852, 0.009726356714963913, 0.032881323248147964, -0.02774340845644474, 0.014441217295825481, -0.02716803550720215, -0.0038895627949386835, -0.012690543197095394, 0.021672943606972694, -0.04634488373994827, 0.015165760181844234, -0.032895203679800034, 0.006594355683773756, 0.05580951273441315, 0.019665753468871117, 0.036022379994392395, 0.03376816213130951, 0.03307603299617767, 0.019601842388510704, -0.023757390677928925, -0.03974733129143715, 0.01686190441250801, -0.028000567108392715, -0.020905854180455208, -0.03579306975007057, 0.04937809705734253, -0.01135189924389124, 0.020865995436906815, 0.024998405948281288, 0.046346623450517654, -0.05866332724690437, 0.016737712547183037, 0.008944161236286163, 0.009241427294909954, 0.0040221912786364555, 0.003937957342714071, -0.011956858448684216, -0.030610281974077225, 0.03297179564833641, 0.01683826372027397, -0.010687930509448051, -0.024845467880368233, -0.06449617445468903, -0.004155327565968037, -0.032659269869327545, 0.018788708373904228, 0.03986949473619461, -0.01587657444179058, 0.010552707128226757, 0.029332753270864487, 0.016930866986513138, -0.021299157291650772, 0.05670025199651718, 0.009816359728574753, -0.005063771735876799, 0.01667419821023941, 0.00579898850992322, -0.016224626451730728, -0.028800003230571747, -0.009528502821922302, 0.05935428664088249, -0.0005073497886769474, -0.0028397771529853344, -0.0023764180950820446, 0.024003639817237854, 0.04302094131708145, -0.030478231608867645, -0.06129984185099602, 0.02827000431716442, -0.011753387749195099, -0.0030576877761632204, 0.0036444661673158407, 0.001919024740345776, 0.017679065465927124, 0.052027396857738495, 0.042831648141145706, -0.00974227860569954, -0.003964127507060766, -0.011288328096270561, 0.013837420381605625, -0.07889984548091888, -0.004247190430760384, 0.039695944637060165, -0.02149040251970291, 0.012203616090118885, -0.026025859639048576, 0.05019330233335495, -0.008430982939898968, 0.019742920994758606, -0.014555064029991627, -0.024981224909424782, -0.00656375614926219, 0.030059048905968666, 0.009443266317248344, 0.004876000806689262, -0.013343378901481628, 0.03167935088276863, 0.04058179259300232, -0.001197769888676703, -0.04796656593680382, -0.0455920584499836, -0.01277985516935587, -0.00015996108413673937, -0.0322093591094017, 0.03317343071103096, 0.011257650330662727, -0.024704191833734512, -0.020947398617863655, 0.021513497456908226, 0.009610041044652462, 0.06205879896879196, 0.014558095484972, -0.01642421819269657, -0.022111717611551285, 0.02847171761095524, -0.014549421146512032, -0.002269251737743616, 0.011924137361347675, 0.006963782012462616, 0.030681967735290527, -0.0052221124060451984, 0.008543488569557667, -0.024352729320526123, -0.011831344105303288, 0.01948283612728119, -0.0035288806539028883, -0.016689682379364967, -0.05620022863149643, 0.021864475682377815, 0.0018770681926980615, -0.015427268110215664, -0.019362397491931915, -0.016436634585261345, -0.003417384345084429, 0.019224848598241806, 0.002618995029479265, 0.022740814834833145, 0.036081116646528244, -0.01773238368332386, -0.009729640558362007, -0.02149772271513939, -0.007081099785864353, 0.031218592077493668, -0.016085708513855934, -0.0028361277654767036, 0.007368495222181082, 0.040659159421920776, 0.02611323446035385, 0.0263894684612751, 0.04252908006310463, -0.03200048208236694, 0.01739153265953064, -0.009642288088798523, -0.032649897038936615, 0.011430483311414719, 0.016716789454221725, -0.06156964227557182, 0.016184929758310318, -0.01871984452009201, 0.007214787416160107, 0.0559166818857193, 0.06198558583855629, -0.0066878837533295155, -0.02548212930560112, 0.004841384012252092, -0.010861461982131004, 0.0034435931593179703, -0.05579184740781784, -0.0043725743889808655, -0.03868812322616577, 0.03655017912387848, -0.03141703084111214, 0.025142813101410866, -0.026513556018471718, 0.042895734310150146, -0.026662670075893402, -0.028618713840842247, 0.03623919561505318, 0.010610871948301792, 0.04130984842777252, 0.018085571005940437, -0.02798825316131115, -0.06855843216180801, -0.013776257634162903, 0.034597933292388916, -0.04584109038114548, 0.004212148953229189, 0.04663219302892685, -0.014416959136724472, 0.026900114491581917, 0.025998473167419434, 0.017477072775363922, 0.002871486824005842, 0.05170641466975212, -0.020929578691720963, -0.012510078027844429, -0.020983468741178513, 0.028277907520532608, 0.014651664532721043, -0.05200567841529846, 0.0415160246193409, -0.014038185589015484, -0.03411484137177467, -0.0012935519916936755, -0.023028336465358734, 0.04930915683507919, 0.021182604134082794, -0.0013250242918729782, -0.02068060077726841, 0.03677435964345932, 0.03216404840350151, -0.022372420877218246, 0.00014271450345404446, -0.005733218975365162, 0.009216847829520702, -0.01584014669060707, 0.037197913974523544, 0.019850488752126694, 0.01447442825883627, -0.0032688062638044357, 0.030203185975551605, -0.0812213346362114, 0.014282641932368279, -0.014259763062000275, 0.019863830879330635, 0.022025059908628464, 0.04597615450620651, -0.031712085008621216, -0.009984219446778297, 0.0019188947044312954, 0.024259811267256737, 0.007957112975418568, 0.0038967968430370092, 0.021660756319761276, 0.0007760708103887737, -0.010842684656381607, 0.021009553223848343, 0.05568996071815491, -0.036337971687316895, 0.05623351410031319, 0.024379359558224678, 0.03173376992344856, -0.0009216629550792277, 0.064745232462883, 0.04172170162200928, -0.008556562475860119, 0.03712286800146103, -0.007989750243723392, 0.023203928023576736, -0.051485199481248856, 0.004090013448148966, 0.01955532841384411, -0.07302554696798325, 0.013421304523944855, 0.02590966410934925, 0.04615328833460808, 0.024302437901496887, -0.0003585555241443217, 0.03752719610929489, 0.02236061729490757, 0.03399323299527168, 0.032010722905397415, 0.0319615863263607, 0.02015472948551178, -0.025503123179078102, 0.041781965643167496, -0.0024473571684211493, 0.030448755249381065, 0.06928910315036774, 0.010761613957583904, -0.024829881265759468, 0.05299007520079613, 0.03614615648984909, 0.015435351058840752, 0.007577072829008102, -0.017556630074977875, 0.041547615081071854, -0.03458486497402191, -0.03511197119951248, 0.006566945463418961, -0.011722762137651443, 0.0059534418396651745, -0.04827345162630081, -0.00696048978716135, -0.0038216402754187584, -0.048314113169908524, -0.007000821176916361, -0.018051128834486008, 0.029913324862718582, -0.011533892713487148, 0.023588094860315323, 0.05363602563738823, 0.020168934017419815, -0.055152636021375656, -0.007082557305693626, -0.013564047403633595, 0.02225552313029766, -0.015083391219377518, 0.0073480247519910336, -0.005146235227584839, -0.020881127566099167, -0.013884246349334717, -0.01819715090095997, -0.020521754398941994, -0.005995062179863453, -0.017384910956025124, 0.036001212894916534, 0.02344473823904991, -0.014510865323245525, 0.024022886529564857, 0.020468588918447495, 0.004019385669380426, -0.007225039880722761, -0.010351358912885189, -0.014212344773113728, -0.012924407608807087, 0.011477798223495483, -0.05272528901696205, -0.01901612989604473, 0.0025706447195261717, 0.00749850831925869, 0.05703577771782875, 0.027874385938048363, -0.03536378592252731, -0.04798215627670288, -0.025628188624978065, -0.02218971587717533, -0.008848361670970917, 0.004088069312274456, 0.009383244439959526, 0.005103672854602337, 0.009177613072097301, -0.045744799077510834, -0.023139232769608498, -0.025700971484184265, -0.045021332800388336, 0.053269028663635254, -0.0009710795129649341, -0.022265948355197906, -0.0258867759257555, 0.042208291590213776, 0.06363266706466675, 0.04829656332731247, 0.019672568887472153, -0.018202103674411774, 0.023229600861668587, 0.024922089651226997, 0.024403106421232224, -0.06672609597444534, 0.0016247449675574899, -0.003414909355342388, -0.01036739256232977, -0.029416915029287338, -0.011678875423967838, -0.0022357639390975237, 0.01851971633732319, -0.04356548562645912, 0.004160021897405386, -0.027811944484710693, 0.005237320903688669, -0.018528098240494728, 0.017934001982212067, 0.06461337953805923, -0.013933933340013027, 0.010210948996245861, 0.038799725472927094, -0.028732119128108025, -0.041622553020715714, 0.016491658985614777, -0.005235274322330952, 0.033860042691230774, 0.006295967381447554, 0.03320302441716194, -0.0055353217758238316, 0.019058292731642723, -0.0001273061498068273, -0.03992414101958275, 0.013174913823604584, 0.00474445940926671, 0.005895629525184631, -0.028454573825001717, 0.016096103936433792, 0.017514444887638092, 0.007027251645922661, 0.009873875416815281, 0.011214308440685272, -0.016894282773137093, -0.01065804623067379, 0.01810765080153942, -0.05699840933084488, -0.032730937004089355, -0.03905641287565231, -0.0010127900168299675, 0.04495207220315933, 0.008715351112186909, 0.008318821899592876, 0.0177818164229393, -0.013156883418560028, 0.036809176206588745, -0.0014049727469682693, -0.022227630019187927, -0.06432262808084488, -0.00001235546005773358, 0.027917228639125824, -0.01872490532696247, -0.012309319339692593, 0.05495404079556465, 0.00841413252055645, -0.0036248748656362295, -0.011547379195690155, 0.00844546128064394, 0.009503104723989964, 0.011463280767202377, 0.0045131598599255085, -0.0008305941009894013, 0.04932525381445885, 0.05911673605442047, -0.02105947770178318, -0.024635091423988342, 0.017540384083986282 ]
Chat Templates: An End to the Silent Performance Killer
rocketknight1
October 3, 2023
chat-templates
LLM, nlp, community
https://huggingface.co/blog/chat-templates
How do templates work? Chat templates are part of the tokenizer, because they fulfill the same role as tokenizers do: They store information about how data is preprocessed, to ensure that you feed data to the model in the same format that it saw during training. We have designed it to be very easy to add template information to an existing tokenizer and save it or upload it to the Hub. Before chat templates, chat formatting information was stored at the class level - this meant that, for example, all LLaMA checkpoints would get the same chat formatting, using code that was hardcoded in transformers for the LLaMA model class. For backward compatibility, model classes that had custom chat format methods have been given default chat templates instead. Default chat templates are also set at the class level, and tell classes like ConversationPipeline how to format inputs when the model does not have a chat template. We're doing this purely for backwards compatibility - we highly recommend that you explicitly set a chat template on any chat model, even when the default chat template is appropriate. This ensures that any future changes or deprecations in the default chat template don't break your model. Although we will be keeping default chat templates for the foreseeable future, we hope to transition all models to explicit chat templates over time, at which point the default chat templates may be removed entirely. For information about how to set and apply chat templates, please see the technical documentation.
[ 0.022703906521201134, -0.026814468204975128, -0.002606421709060669, 0.04207517206668854, 0.08455532044172287, 0.0021106384228914976, 0.03326809033751488, 0.03759273141622543, 0.009312203153967857, -0.023421287536621094, -0.07359576970338821, 0.03460976481437683, 0.01829838566482067, 0.08128174394369125, -0.0737239345908165, -0.008515961468219757, 0.028535164892673492, 0.00663330964744091, -0.011840550228953362, 0.036987584084272385, -0.018979240208864212, -0.03897835314273834, 0.012279670685529709, -0.019771261140704155, 0.05967255309224129, -0.03736827149987221, 0.012054426595568657, 0.005864305887371302, -0.057289399206638336, 0.022671619430184364, -0.0444941446185112, 0.00015840998094063252, -0.0015988501254469156, -0.023927388712763786, -0.015429534018039703, -0.05095185711979866, -0.07041294872760773, 0.06981325894594193, -0.021151887252926826, -0.05400068312883377, -0.022389138117432594, -0.03133261576294899, -0.04336501285433769, 0.04120376706123352, 0.016035955399274826, -0.043829645961523056, -0.20631837844848633, 0.014392053708434105, -0.018826276063919067, 0.001029401202686131, -0.11859744042158127, 0.06961613148450851, -0.019458835944533348, 0.022627610713243484, 0.02759585902094841, -0.011500727385282516, -0.035063013434410095, -0.05670467019081116, 0.003410423407331109, 0.01025504432618618, 0.018404345959424973, 0.04314001277089119, 0.02060815878212452, -0.029620734974741936, 0.03722614049911499, 0.003068281104788184, -0.004651682451367378, 0.004780891817063093, -0.019572986289858818, -0.05271170288324356, 0.0069627841003239155, 0.014752582646906376, 0.03736573085188866, -0.01763596013188362, -0.011772430501878262, -0.018750974908471107, -0.022461649030447006, 0.047300174832344055, 0.024602919816970825, 0.015618550591170788, -0.046228840947151184, 0.036878831684589386, 0.011216330341994762, -0.0018734136829152703, -0.009927764534950256, 0.03794179856777191, 0.057629670947790146, -0.010395651683211327, -0.018835673108696938, 0.014443700201809406, -0.032194528728723526, -0.13953469693660736, -0.01723574474453926, 0.004062141757458448, 0.0462878979742527, -0.0035325114149600267, 0.017136871814727783, 0.04768539220094681, 0.023659078404307365, -0.04495779797434807, -0.005746936425566673, -0.07301322370767593, 0.0012460617581382394, -0.01490214467048645, -0.022820577025413513, 0.010252985171973705, -0.03643365576863289, -0.15741759538650513, 0.015737907961010933, -0.006855533458292484, -0.021059757098555565, -0.06354355067014694, 0.0493718758225441, 0.10654625296592712, -0.053632356226444244, 0.010332123376429081, 0.028231240808963776, -0.024808617308735847, 0.009867994114756584, 0.02120884507894516, 0.05049881711602211, 0.049718745052814484, 0.1328326016664505, -0.004046982619911432, -0.029147284105420113, 0.08627001941204071, 0.025248253718018532, 0.03790586069226265, -0.030644400045275688, -0.058830492198467255, -0.00534229539334774, 0.022367026656866074, 0.006998011842370033, -0.005183365195989609, -0.016700658947229385, -0.058869656175374985, 0.020448651164770126, -0.09827297180891037, 0.07320239394903183, -0.001095369691029191, -0.014702672138810158, 0.09083850681781769, 0.02045140229165554, -0.003527518594637513, -0.027368539944291115, 0.02108227089047432, -0.054893385618925095, 0.024591868743300438, -0.018470602110028267, -0.03359837085008621, -0.03028462454676628, 0.010549886152148247, 0.06159651279449463, -0.06855315715074539, 0.0009882714366540313, 0.017865076661109924, 0.00019669967878144234, -0.01542193628847599, -0.07124276459217072, -0.031885817646980286, -0.006913109682500362, 0.04783997684717178, -0.023462826386094093, 0.08434374630451202, 0.031032120808959007, 0.003404338611289859, -0.0453602634370327, -0.03729040548205376, 0.018000483512878418, -0.015106444247066975, 0.057304274290800095, -0.04714050516486168, 0.041821349412202835, 0.0060087512247264385, 0.0014970693737268448, 0.044786710292100906, 0.04530639573931694, 0.04271534085273743, 0.04452450945973396, -0.020444944500923157, -0.05791741982102394, 0.011277354322373867, -0.03909016028046608, 0.02913355827331543, 0.05922659486532211, -0.10308986902236938, -0.01649646833539009, -0.08452904969453812, -0.08530931174755096, 0.03974463790655136, -0.0330173633992672, 0.0027833536732941866, 0.07082469761371613, 0.035495031625032425, 0.027604777365922928, -0.05094161629676819, -0.01819182001054287, 0.07600376009941101, 0.06404464691877365, 0.10818693786859512, 0.08367633819580078, 0.04233469441533089, -0.07160206884145737, -0.02542920596897602, -0.00032246860791929066, 0.04421929270029068, 0.02653689496219158, -0.06420670449733734, 0.017434729263186455, 0.01422071736305952, -0.005141366273164749, -0.07943536341190338, 0.06187053769826889, -0.04274982959032059, 0.02646687440574169, -0.08341573923826218, -0.031069565564393997, -0.017751550301909447, 0.022193387150764465, -0.03019762597978115, 0.16059349477291107, -0.10459941625595093, 0.013024608604609966, -0.012530107982456684, 0.01010502502322197, 0.06287971884012222, 0.037347741425037384, 0.04592343419790268, 0.11529380828142166, -0.07466995716094971, 0.019932787865400314, -0.039438601583242416, -0.01573902554810047, 0.032114993780851364, -0.045254409313201904, 0.003890843130648136, 0.048847541213035583, -0.0025159677024930716, 0.033322256058454514, -0.0061909956857562065, 0.01962508074939251, -0.0027904431335628033, 0.04778124392032623, -0.0011852494208142161, -0.007674175780266523, 0.09189993143081665, 0.05897704139351845, 0.00842711515724659, -0.05399952456355095, 0.027621636167168617, -0.054048627614974976, 0.051105767488479614, 0.027330432087183, -0.06470543891191483, -0.0012443818850442767, 0.04781541973352432, 0.0005377306952141225, -0.033076997846364975, -0.028938138857483864, 0.009915698319673538, -0.0024910252541303635, -0.0057234251871705055, -0.0767279639840126, -0.05457031726837158, -0.007241496816277504, -0.08402227610349655, 0.025242894887924194, 0.0019409115193411708, 0.003999342210590839, -0.009885495528578758, 0.04584696888923645, -0.028434155508875847, 0.004455634392797947, 0.023703526705503464, 0.019161317497491837, 0.028900718316435814, -0.0013914135051891208, -0.03803916648030281, 0.002871447941288352, -0.0005806726985611022, 0.026356441900134087, -0.036464493721723557, 0.015576113015413284, 0.06519017368555069, 0.021940868347883224, 0.01798218861222267, 0.03593851998448372, -0.022053513675928116, -0.05957050994038582, -0.03921904414892197, 0.014446256682276726, 0.015274722129106522, -0.0034324077423661947, 0.05124635621905327, 0.0002383921091677621, 0.019205862656235695, -0.02890835702419281, 0.006517283618450165, 0.002429896267130971, 0.04147885739803314, 0.013857356272637844, -0.001658805413171649, -0.002546468749642372, 0.002031606389209628, -0.013294297270476818, 0.024914802983403206, -0.0085581224411726, 0.003389928489923477, -0.10099856555461884, 0.002294715726748109, 0.015229867771267891, 0.007856733165681362, -0.026995748281478882, -0.002486384240910411, 0.029325878247618675, -0.04207126796245575, -0.0336303748190403, 0.02644987404346466, -0.04890674725174904, 0.04121296852827072, -0.007586590480059385, 0.008453608490526676, -0.030240226536989212, -0.0092579685151577, -0.029258081689476967, 0.0029579130932688713, 0.04821242392063141, 0.008043459616601467, -0.05013378709554672, 0.055255573242902756, 0.003129251068457961, 0.03675265237689018, -0.031008373945951462, 0.01101183332502842, 0.07401186227798462, 0.020816810429096222, 0.024333259090781212, -0.028565093874931335, -0.004503934178501368, 0.0009018282871693373, -0.035783976316452026, 0.014499904587864876, -0.04426681995391846, 0.008211798034608364, 0.006661794148385525, 0.0023960790131241083, 0.02276214398443699, 0.03175605088472366, 0.011403648182749748, 0.01925940252840519, 0.029849162325263023, -0.013996398076415062, 0.030263751745224, 0.00797306839376688, -0.02053428255021572, -0.016525225713849068, 0.024003714323043823, -0.0019166936399415135, -0.012786070816218853, -0.034406647086143494, 0.009054555557668209, 0.04156901314854622, -0.02823486551642418, 0.010964230634272099, -0.0073491293005645275, 0.008699469268321991, -0.002428104169666767, -0.03914792463183403, -0.05595789849758148, 0.0059282127767801285, -0.02239879220724106, 0.0026875659823417664, -0.048276495188474655, 0.05206497013568878, 0.007538065779954195, 0.026638465002179146, 0.008557052351534367, 0.0279235802590847, -0.029885582625865936, 0.05475272983312607, -0.007110802456736565, 0.01476326771080494, -0.002575930207967758, 0.017015568912029266, 0.0064305588603019714, -0.05416220799088478, 0.058476660400629044, 0.01731071062386036, 0.001730295130982995, -0.010257351212203503, -0.03588946908712387, -0.012602784670889378, -0.0167420394718647, 0.00348415388725698, 0.05014616250991821, -0.023619677871465683, 0.005667436867952347, 0.025402024388313293, 0.008165274746716022, -0.03527260571718216, 0.0393376387655735, 0.0015769744059070945, 0.020657438784837723, 0.008059851825237274, -0.012153612449765205, 0.003057972528040409, -0.00991906225681305, 0.0029824955854564905, 0.036689165979623795, -0.029643690213561058, -0.01982739008963108, 0.0013560194056481123, 0.03050524741411209, 0.03504054620862007, -0.04565559700131416, -0.05715184658765793, 0.008402965031564236, 0.008550791069865227, 0.0168794933706522, 0.004424749407917261, 0.00403914600610733, 0.013282187283039093, 0.006771273910999298, 0.044260699301958084, -0.01539936475455761, 0.0189351849257946, -0.01702139340341091, 0.010846761055290699, 0.0010055381571874022, 0.021255647763609886, 0.008161849342286587, -0.007351983338594437, -0.010104309767484665, -0.019148457795381546, 0.03833349421620369, -0.02585482969880104, 0.011365649290382862, 0.02155422791838646, 0.004401850514113903, -0.0020035081543028355, -0.020746583119034767, 0.02530435286462307, 0.015520608983933926, 0.03068617358803749, -0.02364262007176876, 0.014789227396249771, 0.024196110665798187, -0.05180014669895172, -0.028380898758769035, 0.005682504270225763, 0.032890334725379944, -0.017289651557803154, 0.03856353089213371, 0.010179252363741398, -0.048914775252342224, -0.007339655887335539, 0.03930094465613365, 0.014958567917346954, 0.028735848143696785, -0.004413190763443708, -0.017721885815262794, -0.052948854863643646, -0.01071529183536768, -0.019143246114253998, -0.05207476392388344, -0.005746733862906694, 0.002584745641797781, 0.03482942655682564, -0.01429080031812191, 0.005993219558149576, -0.04351011663675308, 0.0015814128564670682, 0.036142412573099136, -0.013779829256236553, -0.01821940578520298, -0.054769501090049744, 0.005971282720565796, -0.01758183352649212, -0.01594768837094307, -0.010968691669404507, 0.0063779023475945, -0.010642757639288902, 0.009753447026014328, 0.026532353833317757, 0.044929761439561844, 0.05841713026165962, 0.010670183226466179, -0.023067042231559753, -0.017702195793390274, -0.006292487028986216, 0.019105711951851845, 0.006294082850217819, -0.028660202398896217, 0.02404642477631569, 0.06266151368618011, 0.07190615683794022, 0.014880720525979996, 0.06461965292692184, 0.01063772663474083, -0.007765253074467182, 0.011465259827673435, -0.01373194344341755, -0.02612978219985962, -0.009612794034183025, -0.02093176543712616, 0.03547509387135506, -0.01727188751101494, 0.01925080083310604, 0.042734116315841675, 0.07225226610898972, -0.011722031980752945, 0.015539952553808689, -0.009413394145667553, -0.016089700162410736, -0.013919739983975887, -0.04976788908243179, -0.0018775745993480086, -0.0321195013821125, -0.03218984231352806, -0.02581639029085636, -0.01091060508042574, -0.006034631747752428, 0.040368277579545975, -0.03398479148745537, -0.041504714637994766, 0.014587163925170898, 0.03842020034790039, 0.05606525018811226, -0.001970079494640231, 0.004672438371926546, -0.04776568338274956, 0.011764273047447205, 0.005556345917284489, -0.017711155116558075, 0.02603478729724884, 0.007900169119238853, -0.03280055522918701, 0.00014491377805825323, 0.015775691717863083, -0.007669372484087944, 0.005597095470875502, 0.054126616567373276, -0.024739734828472137, 0.007508902344852686, -0.08052521198987961, -0.001502261613495648, 0.03177206218242645, -0.07847192883491516, -0.0011531863128766418, -0.03256630152463913, -0.05802873894572258, 0.005471115466207266, -0.03146734461188316, 0.027765801176428795, 0.04932544752955437, 0.0032086230348795652, 0.01818174496293068, 0.007010003551840782, 0.018799131736159325, -0.03989594802260399, 0.005436362233012915, 0.011871355585753918, 0.006442545913159847, -0.007156378589570522, 0.025370996445417404, 0.023564305156469345, 0.0282545518130064, -0.029168175533413887, 0.018240911886096, -0.03671826049685478, -0.020139092579483986, 0.002503273542970419, -0.02608257345855236, 0.04377095401287079, 0.017480943351984024, -0.0020611868239939213, -0.0282824095338583, -0.024114014580845833, 0.015626000240445137, 0.027560407295823097, 0.01449926570057869, -0.0069043743424117565, 0.003042250871658325, -0.024376466870307922, 0.026146698743104935, 0.08857855945825577, 0.00012919136497657746, 0.05174044519662857, 0.02404937520623207, 0.025132985785603523, 0.02960871532559395, 0.0669650286436081, 0.0011131978826597333, 0.036115776747465134, 0.043891239911317825, -0.002510592807084322, -0.016980862244963646, 0.003949355334043503, -0.023558568209409714, -0.0016456119483336806, -0.04431427642703056, 0.019581278786063194, -0.005218580365180969, 0.002011651173233986, 0.0023472034372389317, 0.03416590765118599, 0.02789604663848877, -0.009940183721482754, 0.05635121464729309, 0.022071905434131622, 0.010930492542684078, -0.0007464800728484988, 0.0022977411281317472, 0.03358287736773491, -0.0006897787097841501, 0.03136073425412178, 0.06393603980541229, 0.0050645130686461926, -0.00993531383574009, 0.04471845179796219, 0.02047337405383587, 0.0010983007960021496, -0.010600302368402481, -0.010796158574521542, 0.01654868759214878, 0.008372483775019646, -0.009823411703109741, -0.004872529301792383, 0.001341726048849523, -0.01049687247723341, -0.04071139171719551, -0.005021374206990004, 0.011406568810343742, -0.006434150971472263, -0.0066884164698421955, -0.025004081428050995, -0.003910516854375601, -0.019020741805434227, -0.0026028468273580074, 0.05637334659695625, 0.03164583072066307, -0.07039901614189148, -0.01715186983346939, -0.0016110200667753816, -0.016927992925047874, -0.017017284408211708, 0.0296158604323864, 0.012009098194539547, -0.0020693899132311344, 0.004283374175429344, -0.020247532054781914, 0.005112890154123306, -0.00654172245413065, -0.026076912879943848, 0.020644083619117737, 0.021745625883340836, -0.011522517539560795, 0.034127626568078995, -0.023616472259163857, 0.015048392117023468, -0.0376240611076355, -0.041107285767793655, -0.021463919430971146, -0.02798241376876831, -0.004043722990900278, -0.045878540724515915, 0.010057223029434681, 0.012953553348779678, 0.04108903184533119, -0.0009681235533207655, 0.02370569482445717, -0.03788384422659874, -0.05634058639407158, -0.04300060123205185, -0.040266260504722595, 0.028609439730644226, 0.025539301335811615, 0.03124593198299408, -0.010361519642174244, 0.03493904694914818, -0.019841795787215233, -0.020376352593302727, -0.020112380385398865, 0.027453333139419556, 0.05356351286172867, 0.000596255820710212, 0.0032494289334863424, -0.03374817594885826, 0.05678463727235794, 0.032042860984802246, 0.022153176367282867, 0.026421690359711647, 0.006211983505636454, -0.0005894728237763047, -0.0343511626124382, 0.0157399233430624, -0.04479832574725151, 0.012691827490925789, 0.000007901351636974141, -0.023993993178009987, -0.03734889626502991, 0.013884841464459896, 0.007250957190990448, 0.026189720258116722, -0.050118546932935715, 0.003397631226107478, -0.005041202530264854, -0.02678082510828972, -0.042151208966970444, 0.02050268091261387, 0.07939393818378448, -0.01063741184771061, 0.04261556267738342, -0.012325304560363293, -0.019585080444812775, 0.0004177271912340075, 0.01847955398261547, 0.04076371341943741, 0.0616033598780632, -0.013423114083707333, -0.029430881142616272, 0.005064606200903654, 0.021743303164839745, -0.007929941639304161, -0.055621303617954254, 0.013675546273589134, -0.0028256301302462816, 0.0000991171327768825, -0.000673173984978348, -0.008128643035888672, 0.0377398356795311, -0.007711780723184347, 0.042409613728523254, -0.016384217888116837, 0.005816434044390917, -0.014166846871376038, 0.008510909043252468, -0.06189434602856636, -0.023874660953879356, -0.04139268770813942, -0.02646084502339363, -0.004985574632883072, 0.008883630856871605, 0.006849844474345446, -0.00815983023494482, -0.016454584896564484, 0.027154404670000076, 0.016367068514227867, -0.02318301610648632, 0.004523595329374075, 0.009194467216730118, -0.0035077480133622885, -0.029095562174916267, 0.005120103247463703, 0.022933494299650192, 0.00360490707680583, -0.005026520229876041, -0.02458019182085991, 0.003768324386328459, -0.005815724842250347, 0.00433734618127346, 0.012646856717765331, 0.038003720343112946, 0.012226663529872894, 0.034861668944358826, -0.041810594499111176, -0.049975328147411346, 0.017154062166810036 ]
Chat Templates: An End to the Silent Performance Killer
rocketknight1
October 3, 2023
chat-templates
LLM, nlp, community
https://huggingface.co/blog/chat-templates
tl;dr Chat models have been trained with very different formats for converting conversations into a single tokenizable string. Using a format different from the format a model was trained with will usually cause severe, silent performance degradation, so matching the format used during training is extremely important! Hugging Face tokenizers now have a chat_template attribute that can be used to save the chat format the model was trained with. This attribute contains a Jinja template that converts conversation histories into a correctly formatted string. Please see the technical documentation for information on how to write and apply chat templates in your code.
[ -0.036768268793821335, -0.017501594498753548, 0.011605304665863514, -0.004321396816521883, 0.03534151241183281, 0.010498988442122936, 0.0314861536026001, 0.027559705078601837, -0.04383062198758125, -0.028251418843865395, -0.07414309680461884, 0.049673546105623245, -0.026798099279403687, 0.08562231808900833, -0.07579655945301056, -0.046699024736881256, 0.0197287704795599, 0.019490251317620277, 0.03536432608962059, 0.044576629996299744, -0.02887916751205921, -0.058075737208127975, 0.03656633943319321, -0.004305155482143164, 0.039527297019958496, -0.0519869402050972, 0.0031826095655560493, -0.03399419039487839, -0.05994725227355957, 0.013688208535313606, -0.06309255212545395, 0.0042741079814732075, -0.012053672224283218, 0.00798895861953497, 0.00912204384803772, 0.006407315377146006, -0.10407517850399017, 0.03761095553636551, -0.042503438889980316, -0.044881220906972885, -0.011351385153830051, -0.03720324859023094, -0.017735818400979042, 0.02678997628390789, 0.018479229882359505, -0.020899659022688866, -0.22504279017448425, 0.051349055022001266, -0.028748005628585815, -0.01308123767375946, -0.08400388807058334, 0.06654947251081467, -0.02004852704703808, 0.00922153890132904, -0.03666754812002182, 0.0005841017700731754, -0.019972993060946465, -0.06248829513788223, -0.01998252607882023, 0.035299576818943024, 0.002728418679907918, 0.009241295978426933, 0.012241914868354797, -0.013270663097500801, 0.021263400092720985, 0.06741964817047119, -0.009156141430139542, 0.011236357502639294, -0.016721179708838463, -0.01750749722123146, -0.004778893198817968, 0.027827944606542587, -0.001415509614162147, -0.008272423408925533, 0.0022189768496900797, -0.008457398973405361, -0.013984563760459423, 0.0353788360953331, 0.04681193828582764, -0.015405062586069107, -0.03394763544201851, 0.03213837742805481, 0.021966906264424324, 0.02744363620877266, 0.024545082822442055, 0.04540082439780235, 0.10608280450105667, -0.03608185052871704, -0.057839684188365936, 0.014464701525866985, -0.02748296968638897, -0.08559658378362656, -0.006688691675662994, 0.02812299132347107, 0.032572731375694275, -0.02178487554192543, -0.012205095030367374, 0.04023132845759392, 0.031032612547278404, -0.0030814812052994967, 0.018010906875133514, -0.11131955683231354, -0.009309719316661358, -0.019869301468133926, -0.04693467542529106, 0.024159759283065796, -0.08039186149835587, -0.10437320172786713, 0.005533991847187281, -0.015699004754424095, 0.024403434246778488, 0.018419736996293068, 0.0030863441061228514, 0.10318899899721146, -0.06721725314855576, 0.03276923671364784, 0.0269941259175539, -0.023635130375623703, 0.023613223806023598, 0.020972786471247673, 0.01767481118440628, 0.07871166616678238, 0.07527577131986618, -0.07090107351541519, 0.003458281047642231, 0.07103613018989563, 0.04750952124595642, 0.030456602573394775, 0.0050523169338703156, -0.019003024324774742, -0.027356142178177834, 0.05817659571766853, 0.01554110087454319, 0.04193350672721863, -0.019956303760409355, -0.05623618885874748, 0.007577137555927038, -0.09717192500829697, 0.05022846534848213, -0.024150285869836807, -0.015146106481552124, 0.08245443552732468, -0.004051017574965954, 0.05603478103876114, 0.0036919524427503347, 0.06807010620832443, -0.07983877509832382, 0.006376261822879314, -0.03438001126050949, -0.041119642555713654, -0.0629405751824379, 0.007664349861443043, 0.04895501211285591, -0.05993117392063141, -0.019359691068530083, 0.066293865442276, -0.03569735214114189, -0.04428119212388992, -0.0612124465405941, -0.04904976114630699, 0.004205113742500544, 0.011459097266197205, -0.0145381735637784, 0.044951844960451126, 0.052016064524650574, 0.006182718090713024, -0.03976636007428169, -0.021326158195734024, 0.010855947621166706, -0.05980141460895538, 0.062222715467214584, -0.005202768836170435, 0.05148991942405701, -0.018613336607813835, -0.0015062751481309533, 0.07172825187444687, 0.03123736009001732, 0.036663152277469635, -0.016357669606804848, -0.04632323980331421, -0.05623798072338104, 0.0471147745847702, -0.03665995970368385, 0.017628801986575127, 0.08718844503164291, -0.059444598853588104, -0.011038929224014282, -0.04466666281223297, -0.01617720164358616, 0.061454690992832184, -0.007740972563624382, -0.034916047006845474, 0.05475276708602905, 0.017107440158724785, 0.08447426557540894, -0.07237350195646286, 0.005527035798877478, 0.1297813355922699, 0.04805760458111763, 0.10921205580234528, 0.045645084232091904, 0.0019336461555212736, -0.051829393953084946, -0.02090257592499256, 0.029123982414603233, 0.04344913735985756, 0.003911170642822981, -0.05904945358633995, 0.017705494537949562, -0.016070792451500893, 0.028577186167240143, -0.0985199511051178, 0.08804993331432343, -0.05229029804468155, -0.03094591200351715, -0.07080340385437012, -0.022661007940769196, -0.007849703542888165, -0.041656702756881714, -0.009159618988633156, 0.16420534253120422, -0.07743177562952042, 0.04110810533165932, -0.02330484800040722, 0.0009513405384495854, 0.0631735771894455, 0.020032154396176338, 0.09595344215631485, 0.13234080374240875, -0.09988023340702057, -0.009751915000379086, -0.0574895516037941, -0.010791748762130737, 0.016357917338609695, -0.040800921618938446, -0.018549315631389618, 0.04708366096019745, 0.008900614455342293, 0.007700028829276562, 0.012312167324125767, 0.010463373735547066, -0.022643422707915306, 0.05107850208878517, 0.018159441649913788, -0.0578920878469944, 0.025452302768826485, 0.011421429924666882, 0.00031373617821373045, -0.04660680517554283, 0.023920312523841858, -0.06707309931516647, 0.02592826448380947, 0.016575274989008904, -0.02712676115334034, 0.014649506658315659, 0.051563508808612823, 0.011674224399030209, -0.02810308337211609, -0.01565132848918438, 0.0478387251496315, 0.0031538584735244513, -0.01428790483623743, -0.03323507681488991, -0.051593050360679626, 0.0024152672849595547, -0.069304458796978, -0.009988006204366684, 0.005818847566843033, -0.008651787415146828, 0.03753075376152992, 0.02439187280833721, -0.030815638601779938, 0.004516199696809053, 0.04431246221065521, 0.006180782802402973, 0.026379598304629326, 0.018843868747353554, -0.043125592172145844, 0.013248545117676258, 0.00015722190437372774, 0.01687329262495041, -0.04746554419398308, 0.023679712787270546, 0.03765656054019928, 0.0037280009128153324, 0.021279942244291306, 0.019429558888077736, -0.024888942018151283, -0.031146543100476265, 0.015100602060556412, 0.03837507218122482, 0.018600497394800186, -0.011880071833729744, 0.006677337922155857, 0.008934867568314075, 0.020392844453454018, 0.004722541198134422, 0.006442445795983076, 0.014039363712072372, 0.048523373901844025, 0.0006421728758141398, 0.025769751518964767, 0.007104040123522282, -0.009853419847786427, 0.005414195824414492, 0.05230842903256416, -0.0027101505547761917, -0.012705379165709019, -0.10073979943990707, -0.018122142180800438, 0.03749804571270943, -0.00680938083678484, -0.03155316784977913, -0.011472879908978939, 0.0639803558588028, -0.025812240317463875, -0.015640554949641228, 0.022929925471544266, -0.033921197056770325, 0.03213656321167946, 0.010328086093068123, -0.005648443475365639, -0.025175759568810463, -0.008403252810239792, -0.019210029393434525, -0.006989163346588612, 0.06121761351823807, 0.03567895293235779, -0.018922260031104088, 0.03776269406080246, -0.0035192049108445644, 0.014775259420275688, -0.00359997246414423, 0.014441056177020073, 0.05264625698328018, 0.0071182348765432835, 0.012509477324783802, -0.03361600264906883, 0.009929034858942032, -0.03208520635962486, 0.0024127340875566006, -0.002063136547803879, -0.0780576691031456, 0.006923270411789417, 0.0010089457500725985, 0.027031632140278816, 0.031039288267493248, 0.0190647691488266, 0.00709759583696723, 0.015064623206853867, 0.03698555380105972, -0.03050285018980503, 0.00584683520719409, -0.013786979019641876, -0.025488900020718575, -0.003435322782024741, 0.00007449380791513249, -0.02520073764026165, 0.00361358723603189, -0.04625409469008446, -0.008157291449606419, 0.055301483720541, 0.004893769044429064, 0.035504963248968124, 0.015127206221222878, 0.010358089581131935, -0.007158495485782623, -0.034683965146541595, -0.065611831843853, 0.03193693980574608, -0.028023215010762215, -0.02844393067061901, -0.03792748972773552, 0.03707363083958626, -0.021364381536841393, 0.027082260698080063, 0.007225416135042906, 0.041461072862148285, -0.034278832376003265, 0.001548150205053389, -0.031080026179552078, 0.020762499421834946, -0.03591950610280037, 0.017155436798930168, -0.030328571796417236, -0.02803671918809414, 0.02931477688252926, 0.013545039109885693, -0.035154812037944794, 0.008358018472790718, -0.032972559332847595, -0.016683192923665047, 0.00945678073912859, 0.0024998781736940145, 0.021448520943522453, 0.005056293215602636, 0.019545426592230797, 0.038436174392700195, 0.017614031210541725, -0.04354386031627655, 0.05350959673523903, 0.017054762691259384, -0.03662192076444626, 0.002232011640444398, 0.02663801796734333, -0.008565656840801239, -0.00721106119453907, 0.023555509746074677, 0.03247511014342308, -0.001363288378342986, -0.0018086859490722418, -0.008388250134885311, 0.038573477417230606, 0.026383616030216217, -0.020505696535110474, -0.057397209107875824, 0.025866245850920677, 0.00011236393766012043, 0.012407832778990269, -0.006153303664177656, -0.012523074634373188, -0.006054659374058247, 0.018236037343740463, 0.02636623941361904, 0.008333238773047924, -0.011574094183743, -0.027615824714303017, 0.03216739743947983, -0.035732630640268326, 0.036338698118925095, 0.016007354483008385, 0.004497482907027006, 0.0063890693709254265, -0.02965841442346573, 0.02514595352113247, -0.026836121454834938, 0.006670019123703241, -0.010676052421331406, -0.010112917050719261, -0.019019920378923416, 0.031367044895887375, 0.01905631273984909, 0.043212082237005234, 0.01271898578852415, -0.0013154952321201563, 0.010497941635549068, 0.0009912203531712294, -0.05402762070298195, -0.041687559336423874, -0.0144997239112854, 0.020421195775270462, -0.011213659308850765, 0.016629258170723915, 0.027629274874925613, -0.02701943926513195, -0.006422323174774647, 0.05766292288899422, 0.02012268267571926, 0.01740999147295952, -0.004069649614393711, -0.041644301265478134, -0.02889193966984749, -0.00896365474909544, -0.003885662415996194, -0.021592454984784126, 0.014140554703772068, 0.0035038634669035673, 0.03835499286651611, -0.010277084074914455, 0.018570538610219955, -0.0028804095927625895, 0.018342429772019386, 0.027381468564271927, -0.029132185503840446, 0.003916827961802483, -0.034419648349285126, 0.017946757376194, 0.017414206638932228, -0.013620357029139996, 0.0029304849449545145, 0.010451482608914375, -0.01570088416337967, 0.04849744588136673, 0.03668978437781334, 0.047839920967817307, 0.04034106805920601, 0.01885109953582287, -0.002565534319728613, -0.012633481062948704, 0.01209301594644785, 0.015045160427689552, -0.010161951184272766, 0.008530700579285622, 0.004219835624098778, 0.07395245134830475, 0.0829320028424263, 0.005690672900527716, 0.039659347385168076, -0.017672304064035416, 0.024550598114728928, 0.014646450988948345, -0.04611929878592491, -0.0005666326615028083, 0.014809519052505493, -0.02632620744407177, 0.00296645425260067, -0.004322411958128214, 0.027987638488411903, 0.03660852089524269, 0.05191236734390259, -0.019560033455491066, -0.005172634031623602, -0.00818607397377491, -0.02848876640200615, -0.035340774804353714, -0.03879194334149361, 0.003146782284602523, -0.031524717807769775, 0.02017606794834137, -0.044438865035772324, 0.003791624680161476, -0.012641014531254768, 0.03085995465517044, -0.026174236088991165, -0.027003467082977295, 0.0032609605696052313, 0.009130985476076603, 0.0331849567592144, -0.004999077413231134, 0.009470096789300442, -0.07651866227388382, -0.022241080179810524, -0.004145943559706211, -0.031546927988529205, -0.007031845394521952, 0.03256039321422577, -0.041866786777973175, 0.016501668840646744, 0.03556426241993904, -0.017016448080539703, -0.0015109521336853504, 0.06466309726238251, -0.02290371246635914, -0.008673595264554024, -0.02317187190055847, 0.01485941931605339, -0.004124634433537722, -0.051112622022628784, 0.02799920178949833, -0.018470706418156624, -0.04745601490139961, 0.011539737693965435, -0.02380160056054592, 0.010143136605620384, 0.0430181547999382, 0.03047621250152588, 0.01888664811849594, 0.035537850111722946, 0.032532949000597, -0.030722055584192276, 0.03204844892024994, -0.01577904261648655, 0.009745686315000057, -0.010655887424945831, 0.03225213289260864, 0.0047279782593250275, -0.03170693665742874, -0.02207864820957184, 0.01280741672962904, -0.05954550951719284, -0.011957437731325626, 0.0022981364745646715, -0.0164070762693882, 0.04617680609226227, 0.030347071588039398, -0.03563828021287918, -0.016001570969820023, -0.005591255147010088, 0.0164940245449543, 0.009131344966590405, 0.0021927535999566317, 0.008835016749799252, -0.006033144425600767, -0.013591821305453777, 0.03712918981909752, 0.09488791227340698, -0.01592504419386387, 0.062292229384183884, 0.006428977008908987, 0.013677232898771763, 0.013237939216196537, 0.06216994673013687, 0.014361395500600338, -0.006744349841028452, 0.05488179251551628, -0.018299689516425133, 0.006533174309879541, -0.014367456547915936, -0.026749499142169952, 0.011789457872509956, -0.015788210555911064, 0.03322900831699371, 0.005355915520340204, 0.008899158798158169, 0.03358907252550125, 0.028622256591916084, -0.0007609210442751646, -0.004729775246232748, 0.029717398807406425, 0.04096565395593643, -0.00011953138891840354, -0.005481906235218048, -0.007617369294166565, 0.03760780766606331, 0.02234780415892601, 0.006333325058221817, 0.085089311003685, 0.01371904369443655, 0.01048573199659586, 0.06452712416648865, 0.03496693819761276, 0.032402414828538895, -0.004447726998478174, -0.01870468631386757, 0.036655426025390625, 0.023768004029989243, -0.009275785647332668, -0.002937624929472804, -0.004617888946086168, 0.014013668522238731, -0.028629422187805176, -0.01292479783296585, 0.01285837683826685, -0.005561263766139746, -0.0022732485085725784, -0.0015763894189149141, -0.0035413496661931276, -0.006987395230680704, 0.006151469890028238, 0.06466858088970184, 0.016699286177754402, -0.05763861536979675, 0.030435295775532722, -0.00931073259562254, -0.012659704312682152, -0.009943250566720963, -0.023028088733553886, -0.004088752903044224, -0.014205937273800373, -0.009805959649384022, -0.037921059876680374, -0.005728666204959154, -0.03838398680090904, 0.007136775646358728, -0.014127401635050774, 0.013792716898024082, 0.0005514601361937821, 0.03390799090266228, -0.00440581189468503, 0.03342868387699127, -0.03148855268955231, -0.031086023896932602, -0.023877568542957306, -0.023812921717762947, -0.036128122359514236, -0.0548979751765728, 0.008593163453042507, 0.020725617185235023, 0.028670581057667732, 0.001818852499127388, 0.010679922997951508, -0.02925168350338936, -0.05361202731728554, -0.025319645181298256, -0.03776055946946144, -0.007414205465465784, 0.02947312407195568, 0.02401060424745083, -0.026810789480805397, -0.013271248899400234, -0.02236674726009369, -0.02175208181142807, -0.022358734160661697, 0.003612846601754427, 0.04977096617221832, 0.006703858729451895, -0.0009783447021618485, -0.04664969444274902, 0.060885511338710785, 0.05457708612084389, 0.0036215088330209255, 0.013541286811232567, -0.010073288343846798, -0.0016779915895313025, -0.05805506184697151, 0.03549662232398987, -0.06636890023946762, -0.029632961377501488, -0.0225298460572958, -0.02778145670890808, -0.018819941207766533, 0.011866329237818718, -0.006773320492357016, 0.02461140975356102, -0.03832568600773811, -0.01859162002801895, -0.00021855485101696104, 0.014418354257941246, -0.016850534826517105, 0.025680040940642357, 0.07930739223957062, 0.04012903571128845, 0.012682839296758175, 0.013331332243978977, -0.05012034624814987, -0.004719257354736328, 0.04990515112876892, 0.05332396179437637, 0.04108339548110962, -0.004678257741034031, -0.028300132602453232, -0.021310297772288322, 0.007462294772267342, -0.0035495003685355186, -0.02109849825501442, -0.006152136251330376, -0.01538965292274952, -0.020661817863583565, -0.00949149951338768, -0.006718921009451151, 0.005476954858750105, -0.021296141669154167, 0.03879674896597862, -0.003723891917616129, -0.030459627509117126, -0.015211113728582859, 0.019963735714554787, -0.06601769477128983, 0.00024340373056475073, -0.046951454132795334, -0.009987890720367432, 0.03454313427209854, -0.01840481162071228, 0.01986420340836048, -0.0208441149443388, -0.019795192405581474, 0.023590167984366417, 0.014901552349328995, -0.028229346498847008, -0.028712743893265724, 0.01634765788912773, 0.005553057882934809, -0.008808202110230923, -0.006948100868612528, 0.05793653056025505, 0.022547153756022453, -0.031166665256023407, -0.04091760516166687, 0.009578675962984562, -0.007143659982830286, -0.007241842336952686, 0.019467877224087715, 0.00845463015139103, 0.029206532984972, 0.004712706431746483, -0.0419609509408474, -0.014672472141683102, 0.038690537214279175 ]
Chat Templates: An End to the Silent Performance Killer
rocketknight1
October 3, 2023
chat-templates
LLM, nlp, community
https://huggingface.co/blog/chat-templates
Conclusion: Template philosophy We think templates are a very exciting change. In addition to resolving a huge source of silent, performance-killing bugs, we think they open up completely new approaches and data modalities. Perhaps most importantly, they also represent a philosophical shift: They take a big function out of the core transformers codebase and move it into individual model repos, where users have the freedom to do weird and wild and wonderful things. We're excited to see what uses you find for them!
[ 0.059377461671829224, -0.00620916485786438, 0.00944384653121233, 0.07364270091056824, 0.022706544026732445, -0.016752857714891434, -0.007413029205054045, -0.010399525985121727, 0.014030607417225838, -0.06581063568592072, -0.06317208707332611, -0.012373635545372963, 0.02851906418800354, 0.06119956076145172, 0.0006877480773255229, 0.00319710117764771, 0.02354695089161396, -0.01625075191259384, 0.00109868124127388, 0.038174502551555634, -0.012445218861103058, -0.04253928363323212, 0.06835376471281052, -0.042071714997291565, 0.008568154647946358, -0.025965292006731033, 0.04566160961985588, -0.005152885336428881, -0.07511619478464127, 0.055413659662008286, -0.07324732840061188, -0.013393674977123737, -0.058899637311697006, -0.01683163456618786, -0.11388742923736572, -0.020866284146904945, -0.05566057190299034, 0.040320832282304764, -0.036793239414691925, -0.06767582148313522, 0.0033006430603563786, -0.045116912573575974, -0.024595819413661957, -0.012186894193291664, 0.007939934730529785, -0.015460582450032234, -0.19506819546222687, 0.0696350708603859, -0.09944252669811249, -0.053843021392822266, -0.06515523046255112, 0.03379322960972786, -0.029075875878334045, 0.028378672897815704, 0.00886534247547388, -0.0171342846006155, -0.008399397134780884, 0.011334732174873352, 0.0004928698763251305, -0.026024773716926575, 0.00387729168869555, 0.02528402954339981, 0.07449124753475189, -0.009696196764707565, 0.06229054555296898, 0.018986579030752182, -0.0063641928136348724, 0.07604382187128067, -0.03299899771809578, 0.004319244530051947, -0.021299811080098152, -0.005092740524560213, -0.03554670885205269, 0.0008534243679605424, -0.01207773294299841, 0.03458119183778763, -0.004622581414878368, 0.10462097078561783, 0.03632613644003868, 0.024520106613636017, 0.05239268019795418, 0.028688017278909683, 0.04784178361296654, 0.048964723944664, 0.0005857080686837435, 0.004427640698850155, 0.04863365367054939, -0.05799175053834915, -0.05504199117422104, 0.037692151963710785, 0.09683316946029663, -0.18379925191402435, 0.004597535822540522, -0.021739328280091286, 0.04911074787378311, -0.0484992116689682, -0.0246230810880661, 0.012676025740802288, -0.01461805310100317, -0.026334796100854874, -0.016996392980217934, 0.007669467944651842, -0.021054474636912346, -0.052244290709495544, -0.014055268839001656, -0.0073725078254938126, -0.006948140449821949, -0.1515195071697235, 0.02521158568561077, 0.057264212518930435, -0.02693070098757744, -0.017893243581056595, 0.05719135329127312, 0.05416101589798927, -0.009348249062895775, 0.05861758440732956, -0.006240097805857658, -0.033045947551727295, -0.021737346425652504, 0.004393539857119322, 0.046928245574235916, 0.04153492674231529, 0.030885368585586548, 0.039417535066604614, 0.015908848494291306, 0.028557077050209045, 0.005000344943255186, 0.049807120114564896, -0.009506464004516602, -0.08309177309274673, 0.09090406447649002, 0.04530242085456848, -0.009764556773006916, -0.025241579860448837, -0.012504594400525093, -0.10542760789394379, 0.0466194786131382, -0.05607900768518448, 0.005482934415340424, 0.0011599526042118669, -0.027047855779528618, 0.021509690210223198, 0.05224531516432762, 0.036054208874702454, -0.031139742583036423, -0.04494702070951462, -0.021605629473924637, 0.0902772769331932, -0.011867278255522251, -0.04139459878206253, -0.007442385423928499, 0.050890613347291946, -0.018129725009202957, -0.0635131448507309, 0.03680066019296646, 0.05552580580115318, 0.04075419530272484, 0.0002743970835581422, 0.0026173510123044252, -0.01666104793548584, 0.0021163278724998236, 0.03161584213376045, 0.015290838666260242, 0.029747921973466873, 0.06017206236720085, -0.06452745944261551, -0.047158677130937576, 0.0030213056597858667, 0.023788413032889366, 0.019217483699321747, -0.030920682474970818, -0.0377601683139801, 0.013702444732189178, -0.002773461164906621, -0.033583126962184906, 0.04359619319438934, 0.05273256450891495, 0.016159258782863617, 0.025484001263976097, 0.019900983199477196, -0.0426541268825531, 0.03707187622785568, -0.016662610694766045, -0.00931482668966055, 0.0499381497502327, -0.06399629265069962, -0.00293211848475039, -0.033223167061805725, -0.025962116196751595, 0.014835222624242306, -0.09891858696937561, -0.03044178895652294, 0.09764570742845535, -0.033042073249816895, 0.05421290546655655, 0.0227015670388937, -0.047015462070703506, 0.08242038637399673, 0.04141803830862045, 0.07224995642900467, 0.081745445728302, -0.012326457537710667, -0.047924160957336426, -0.07714417576789856, 0.05260980501770973, 0.04894441366195679, 0.07355641573667526, -0.011966255493462086, 0.010896892286837101, 0.021821478381752968, 0.015605433844029903, -0.08827976137399673, 0.06040695309638977, -0.01664632186293602, 0.007456721737980843, -0.09178857505321503, 0.006636474747210741, 0.02529473602771759, 0.013567284680902958, -0.046369925141334534, 0.06701754033565521, -0.10084120184183121, -0.033950164914131165, -0.010380860418081284, 0.013040648773312569, 0.03859228640794754, 0.035901255905628204, 0.006107512395828962, 0.09667185693979263, -0.08757877349853516, 0.049365196377038956, 0.024368973448872566, -0.050686560571193695, 0.0680471882224083, 0.045021459460258484, 0.06150594726204872, 0.02102518081665039, -0.0031515818554908037, 0.0013749942881986499, 0.0009287382126785815, -0.06131165474653244, 0.0409739650785923, 0.04982798546552658, 0.08355161547660828, 0.023456551134586334, -0.047607891261577606, 0.018331602215766907, 0.0036804552655667067, 0.008057856932282448, -0.0016129236901178956, -0.06526311486959457, 0.028069129213690758, 0.022217312827706337, -0.06628408282995224, 0.03470132127404213, 0.026716072112321854, 0.016619332134723663, -0.03776693716645241, -0.03398226201534271, 0.035310108214616776, -0.03588109090924263, -0.03299430385231972, -0.053931642323732376, -0.06742319464683533, 0.01986539550125599, -0.03387627750635147, -0.009786393493413925, 0.03889160230755806, 0.010813966393470764, 0.019133079797029495, 0.026371724903583527, -0.03882376104593277, -0.00808632280677557, 0.021330196410417557, 0.007560787722468376, -0.014265064150094986, 0.03813046216964722, -0.038938868790864944, -0.0039455038495361805, -0.04887521639466286, 0.020375845953822136, -0.016844218596816063, 0.018117787316441536, 0.0011577795958146453, 0.005641964264214039, 0.0044192960485816, 0.0509285144507885, 0.0032998532988131046, -0.03688783571124077, -0.013074290938675404, -0.013991832733154297, -0.005363228265196085, -0.0364338755607605, -0.019800832495093346, 0.034704580903053284, -0.015258997678756714, 0.007559997029602528, -0.015823176130652428, -0.01685238815844059, -0.001167397596873343, 0.006322039291262627, 0.011485712602734566, 0.012782583013176918, -0.017942337319254875, 0.003415122628211975, 0.07032061368227005, 0.009409706108272076, 0.016062110662460327, -0.11240720003843307, -0.0730849951505661, -0.01213803980499506, 0.027375007048249245, -0.01392693817615509, -0.010085303336381912, 0.025508509948849678, -0.03380879759788513, 0.00835439283400774, 0.028368545696139336, 0.003142945235595107, 0.011955705471336842, -0.0007023444632068276, 0.04080302268266678, -0.0007608063751831651, -0.005089392885565758, -0.026071861386299133, 0.04664904624223709, 0.03283429145812988, 0.031470734626054764, -0.0006331459153443575, 0.03194444626569748, -0.012109748087823391, -0.006282507907599211, -0.006574427708983421, 0.0036743413656949997, 0.04348120838403702, 0.07097423076629639, -0.007284820545464754, -0.01762423850595951, 0.014022168703377247, 0.0021688491106033325, -0.04245876893401146, 0.013780119828879833, 0.03068450093269348, 0.0010725551983341575, 0.01194792054593563, -0.015873704105615616, -0.04425521567463875, 0.03270881250500679, 0.020719697698950768, -0.018177293241024017, 0.0028268094174563885, 0.018296975642442703, -0.0055504050105810165, 0.021443072706460953, 0.010788233950734138, -0.002711275592446327, 0.015478173270821571, -0.027185669168829918, -0.025695284828543663, -0.005817684344947338, 0.021895913407206535, 0.015004013665020466, -0.019827621057629585, -0.008203014731407166, -0.0009254534961655736, -0.0031565490644425154, -0.013831287622451782, -0.0056038531474769115, -0.016770265996456146, 0.007395898923277855, 0.04038211330771446, 0.017433125525712967, -0.03239291533827782, 0.07087933272123337, 0.010196896269917488, 0.014469032175838947, 0.001100580906495452, -0.006346695125102997, -0.009582496248185635, 0.03503843769431114, -0.02460184134542942, 0.009830842725932598, 0.00807192176580429, 0.022829832509160042, 0.010501681827008724, -0.07714024931192398, 0.05837308242917061, -0.004579416010528803, -0.030940786004066467, -0.07576580345630646, -0.011875848285853863, 0.025081505998969078, -0.001674077706411481, 0.058209117501974106, 0.03790239617228508, -0.010043171234428883, 0.01570816896855831, 0.02555071748793125, 0.03675929829478264, -0.04648512974381447, 0.011266304180026054, -0.004104330204427242, -0.02303251437842846, 0.011625275947153568, -0.023474207147955894, -0.008126853033900261, 0.017727073282003403, -0.020549574866890907, 0.017218969762325287, -0.03324919193983078, -0.04072445258498192, 0.03718681260943413, 0.010084718465805054, 0.018307100981473923, -0.025367464870214462, -0.049082957208156586, -0.009424037300050259, 0.030090445652604103, 0.02529730275273323, -0.0038907926063984632, -0.0002155057154595852, -0.005487062502652407, -0.002914149546995759, 0.06010693684220314, -0.019709765911102295, 0.0016505056992173195, -0.023143840953707695, 0.03535299375653267, -0.010898112319409847, -0.029840558767318726, -0.007593341171741486, 0.029563847929239273, -0.006229134742170572, -0.015629826113581657, 0.0021527381613850594, -0.021329127252101898, -0.006767146289348602, 0.03036327473819256, -0.017933262512087822, -0.029470199719071388, -0.030764741823077202, 0.03710373863577843, 0.023522432893514633, 0.06673580408096313, 0.006023904774338007, 0.024696504697203636, -0.02172273024916649, -0.06263219565153122, -0.020884718745946884, -0.01872790977358818, 0.04489047825336456, -0.0024853453505784273, 0.053658563643693924, -0.018964214250445366, -0.03394993394613266, 0.007378194015473127, -0.0026515035424381495, 0.030857326462864876, 0.028956955298781395, -0.03117305040359497, -0.020214933902025223, -0.019167287275195122, 0.0030311341397464275, 0.0009872850496321917, -0.017101209610700607, 0.0005729469121433794, -0.007425033953040838, 0.0475495383143425, -0.010674485936760902, 0.012154286727309227, -0.058905456215143204, 0.0007082431111484766, 0.010569684207439423, -0.0021800317335873842, 0.03306972607970238, -0.08112083375453949, -0.02041994035243988, -0.0004444303922355175, -0.002477345522493124, 0.006477596238255501, -0.0017836169572547078, -0.042634736746549606, 0.004173391964286566, 0.0011803486850112677, 0.016152875497937202, 0.018960969522595406, 0.016110677272081375, -0.007660435978323221, 0.0010369233787059784, 0.022133054211735725, -0.0013876218581572175, -0.018522582948207855, 0.04162849485874176, 0.0051685175858438015, 0.02526943013072014, 0.09161761403083801, -0.026195861399173737, 0.012676484882831573, 0.043968211859464645, -0.02017751894891262, -0.004896840546280146, -0.04263337329030037, 0.006949543487280607, -0.023731103166937828, 0.006144811864942312, -0.007718709297478199, -0.015287837944924831, 0.023816769942641258, 0.006759364623576403, 0.0444677472114563, 0.006490609608590603, -0.005239930935204029, 0.02719791978597641, 0.018543116748332977, 0.024867098778486252, -0.039782341569662094, 0.018123943358659744, -0.019610663875937462, 0.016859179362654686, -0.01489888597279787, -0.014170728623867035, -0.047089170664548874, 0.0024173392448574305, -0.0662110298871994, -0.032185669988393784, 0.008840840309858322, -0.024753956124186516, 0.016855349764227867, 0.006054615136235952, 0.012735564261674881, -0.005860518664121628, 0.012744162231683731, 0.00925880391150713, -0.035586994141340256, 0.01083365734666586, 0.015574248507618904, -0.014043805189430714, -0.04454653337597847, 0.05255774036049843, 0.002446481492370367, -0.0020273784175515175, 0.010644476860761642, -0.0232024434953928, -0.01918695494532585, -0.040622543543577194, 0.07767230272293091, 0.031571973115205765, -0.08325982093811035, -0.029084401205182076, -0.030952204018831253, -0.03800872713327408, -0.01096996571868658, -0.03780653700232506, 0.031684987246990204, 0.04793040454387665, 0.005959087051451206, -0.015892749652266502, 0.03622487187385559, 0.016803458333015442, 0.018251709640026093, 0.0004946531844325364, 0.015208018012344837, 0.046330831944942474, -0.014697179198265076, 0.039432793855667114, -0.0035289409570395947, 0.01029861532151699, 0.0033232481218874454, 0.007251162081956863, 0.00733032263815403, 0.004715340211987495, 0.007611625827848911, -0.045687295496463776, 0.06249405816197395, 0.032636888325214386, -0.05005217716097832, -0.03540850803256035, -0.026202822104096413, -0.008884645067155361, 0.05109836533665657, 0.02812940441071987, 0.022773535922169685, 0.015787260606884956, -0.03753625601530075, 0.01379359234124422, 0.024976808577775955, 0.04987348988652229, 0.025874417275190353, 0.04470130801200867, 0.04826704412698746, 0.0634271651506424, 0.015467115677893162, -0.00437918771058321, 0.006790843326598406, 0.021786026656627655, -0.029756871983408928, 0.003948427736759186, 0.049146804958581924, -0.020630938932299614, -0.026316912844777107, 0.03368093818426132, 0.00866053719073534, -0.036378148943185806, 0.0009137946763075888, 0.009076880291104317, -0.02454211749136448, 0.014017237350344658, -0.0566784143447876, 0.03798883408308029, -0.015724647790193558, 0.02007095329463482, -0.004564359318464994, -0.011397695168852806, 0.030299251899123192, 0.028732532635331154, -0.005839572753757238, 0.051897741854190826, 0.026694420725107193, 0.004719945602118969, 0.05317576602101326, 0.006992086302489042, 0.012892097234725952, -0.0025263470597565174, 0.02774653770029545, 0.023151766508817673, -0.03206315636634827, 0.019120553508400917, 0.02850019559264183, -0.04981140419840813, -0.0309059526771307, -0.0011967550963163376, 0.005529572255909443, 0.01592891849577427, -0.017600828781723976, 0.026324212551116943, -0.01987151801586151, -0.038455791771411896, -0.06368206441402435, -0.028809549286961555, 0.050400909036397934, 0.030645765364170074, 0.0026554716750979424, 0.002822333248332143, 0.007152112666517496, 0.0008164055179804564, 0.0417090505361557, -0.011269007809460163, 0.023837145417928696, -0.0036508035846054554, 0.01276450976729393, 0.003857244271785021, -0.006931279320269823, 0.003651189152151346, -0.025236006826162338, 0.019711898639798164, 0.02039390057325363, -0.025378063321113586, 0.016266774386167526, 0.011183075606822968, 0.01286885142326355, -0.061180561780929565, 0.0012382976710796356, -0.04907374083995819, -0.05011652037501335, -0.03171597421169281, -0.01874583587050438, 0.002131900517269969, 0.0031711701303720474, 0.02663116529583931, -0.006555564701557159, 0.03231744095683098, -0.05675573647022247, 0.014834246598184109, -0.004443264566361904, -0.03827023133635521, 0.01904633268713951, 0.037776876240968704, 0.01848846860229969, -0.048937663435935974, 0.016827598214149475, -0.0009416724205948412, 0.028329530730843544, -0.02419709600508213, -0.00031847486388869584, 0.0810617133975029, -0.020428555086255074, -0.0029605927411466837, -0.007974496111273766, 0.04872633144259453, 0.0305088609457016, 0.02045700140297413, 0.008421213366091251, 0.060679707676172256, -0.033194590359926224, -0.01578374207019806, -0.016100799664855003, 0.00545277027413249, 0.008915483951568604, -0.010375218465924263, -0.033955805003643036, 0.0033584986813366413, 0.017967648804187775, 0.024844374507665634, 0.013731732033193111, -0.026628192514181137, 0.015328340232372284, 0.0305270217359066, -0.019017208367586136, -0.03878059983253479, 0.034529462456703186, 0.030003271996974945, 0.014898751862347126, 0.014172099530696869, -0.03972902521491051, 0.01953943260014057, 0.015674706548452377, -0.03082074411213398, 0.035779934376478195, 0.020981932058930397, 0.002122442005202174, -0.04479026421904564, -0.026661526411771774, -0.0192270427942276, -0.05931811407208443, -0.049156129360198975, 0.010714109055697918, 0.03245861828327179, -0.01203310675919056, -0.004445585422217846, -0.040329042822122574, 0.030027244240045547, -0.04296175763010979, -0.004103479906916618, 0.005740148015320301, 0.005894343834370375, -0.01859179139137268, -0.00039327910053543746, -0.032516106963157654, -0.003367312252521515, -0.02158677950501442, -0.021830588579177856, 0.014050805941224098, 0.0038726504426449537, 0.006174820009618998, -0.03089052252471447, -0.020069221034646034, 0.029486726969480515, -0.017140410840511322, -0.027804553508758545, -0.038088880479335785, 0.03850400820374489, -0.0008636600687168539, -0.026430871337652206, -0.0389348641037941, 0.02373284474015236, 0.011481111869215965, 0.009551765397191048, -0.0014433241449296474, 0.04196503013372421, 0.03170737996697426, -0.0048591927625238895, 0.0441557839512825, 0.022801702842116356, -0.00005502399289980531, 0.035487156361341476, 0.011611076071858406, -0.0174738559871912, -0.004126783926039934 ]
Chat Templates: An End to the Silent Performance Killer
rocketknight1
October 3, 2023
chat-templates
LLM, nlp, community
https://huggingface.co/blog/chat-templates
# Chat Templates > A spectre is haunting chat models - the spectre of incorrect formatting!
[ 0.027616122737526894, -0.031151091679930687, 0.006023870315402746, 0.03884038329124451, 0.07513684779405594, -0.02352578565478325, 0.037706002593040466, -0.023572983220219612, -0.028934668749570847, -0.03945554047822952, -0.07203376293182373, -0.019557254388928413, 0.00808559451252222, 0.092547707259655, -0.029546590521931648, 0.022247053682804108, 0.018336649984121323, -0.010236847214400768, -0.009913015179336071, -0.03253565728664398, -0.008071164600551128, -0.004666015971451998, -0.0003393939114175737, -0.029703859239816666, 0.011338545009493828, -0.0029073585756123066, -0.033144883811473846, 0.0076219746842980385, -0.0999257043004036, 0.01089475303888321, -0.039029233157634735, 0.03465390205383301, -0.032020457088947296, -0.021353304386138916, -0.03343342989683151, -0.06116046383976936, -0.03397534415125847, 0.044412191957235336, -0.06132959574460983, -0.029606681317090988, -0.037332192063331604, -0.09838208556175232, 0.040083494037389755, 0.0342571847140789, -0.01343563199043274, 0.009940496645867825, -0.2057577222585678, 0.044736478477716446, -0.06561432778835297, -0.03736252337694168, -0.05743414908647537, 0.09343058615922928, -0.04290074110031128, -0.03603710979223251, -0.02083963342010975, -0.03926791995763779, -0.01585119217634201, -0.05194876343011856, 0.0002426969731459394, 0.03482571616768837, 0.10360205918550491, -0.04689555615186691, -0.0007784396293573081, -0.05825052782893181, -0.05010213330388069, 0.06868786364793777, 0.014842766337096691, 0.02724064514040947, -0.08650082349777222, 0.00432652048766613, 0.013879615813493729, 0.0437927283346653, 0.046438176184892654, -0.035248178988695145, 0.011121555231511593, -0.003934510983526707, -0.026296814903616905, 0.1017334908246994, 0.02630123309791088, 0.019695784896612167, 0.019341230392456055, 0.02085193805396557, 0.09074298292398453, 0.057133883237838745, -0.037008173763751984, 0.0030506562907248735, 0.0750109851360321, 0.058020759373903275, -0.007603838574141264, 0.002170422114431858, -0.004753919783979654, -0.08796631544828415, -0.03409995138645172, 0.025093769654631615, 0.014006637036800385, -0.004333402495831251, 0.04220300912857056, -0.03716156259179115, 0.04630717262625694, -0.005568583030253649, -0.007774511352181435, -0.037829022854566574, -0.019982654601335526, -0.03043154440820217, -0.08808497339487076, 0.05499730631709099, -0.04065687209367752, -0.007706969510763884, 0.015404852107167244, -0.011906765401363373, -0.020146550610661507, 0.04331938549876213, 0.026281533762812614, 0.05583227425813675, -0.04957820847630501, 0.009480522014200687, 0.022621138021349907, -0.014736080542206764, 0.021207528188824654, -0.006812262814491987, 0.05560450255870819, 0.04996369779109955, 0.14509765803813934, -0.003266082378104329, 0.00902717374265194, 0.06553144007921219, 0.0765652060508728, 0.011772449128329754, -0.07055747509002686, -0.02774541825056076, -0.014993441291153431, 0.013726952485740185, -0.023867333307862282, -0.008465518243610859, 0.02478266879916191, -0.033439651131629944, 0.04318777471780777, -0.06194518133997917, 0.05756131559610367, 0.07050128281116486, 0.0074542914517223835, -0.0005885885329917073, 0.026526235044002533, 0.10891463607549667, -0.03717981278896332, -0.007104628719389439, -0.06513522565364838, 0.04498646780848503, -0.0058929091319441795, -0.00833542738109827, -0.023076171055436134, -0.030658192932605743, 0.04187096282839775, -0.07753632962703705, 0.013308209367096424, 0.048216212540864944, -0.0002691462286747992, 0.0002018625964410603, -0.025413785129785538, -0.05351995304226875, -0.015332946553826332, -0.07095713913440704, -0.03608481585979462, 0.05228628218173981, 0.068526990711689, -0.002314555225893855, -0.10424841195344925, 0.03716587647795677, 0.015818126499652863, -0.03997955098748207, 0.04289223998785019, -0.02438938058912754, 0.050839103758335114, 0.048590391874313354, 0.009716028347611427, 0.045833706855773926, 0.06795486062765121, 0.017785504460334778, 0.07365100085735321, -0.017733145505189896, 0.013911660760641098, 0.0015165758086368442, -0.03370644524693489, 0.03587550297379494, -0.008796784095466137, -0.024476222693920135, 0.012168324552476406, -0.021700585260987282, -0.0556403324007988, 0.06886210292577744, -0.08156515657901764, -0.02922985889017582, 0.06110164150595665, -0.026097603142261505, 0.03380018100142479, -0.060803089290857315, -0.06335659325122833, 0.04214388132095337, 0.08189786225557327, 0.07161469757556915, 0.049345582723617554, 0.03318116068840027, -0.0474129393696785, -0.027438657358288765, -0.021367186680436134, 0.016748463734984398, 0.007056236732751131, 0.01262589544057846, -0.0577239915728569, 0.03812088817358017, -0.001269832020625472, -0.06443798542022705, 0.12046930938959122, 0.02856621704995632, -0.022266071289777756, -0.08231913298368454, -0.016119493171572685, -0.05778538063168526, -0.03726661577820778, -0.033153485506772995, 0.11108467727899551, -0.032570771872997284, -0.03218565881252289, 0.026856252923607826, 0.0019592365715652704, 0.07245723158121109, 0.0958792045712471, -0.02125703915953636, 0.12737621366977692, -0.08792899549007416, 0.0040152729488909245, 0.03494107350707054, -0.019668029621243477, -0.0036701071076095104, -0.030941223725676537, 0.0012966126669198275, -0.07144039124250412, 0.03863222151994705, 0.1179630309343338, -0.0283430814743042, -0.009998800233006477, 0.007198230363428593, 0.044436268508434296, -0.0018602776108309627, 0.00941007025539875, 0.022631820291280746, 0.009598519653081894, -0.027774561196565628, -0.01833932474255562, 0.03658665716648102, -0.03622988611459732, -0.030627217143774033, -0.029755767434835434, -0.01505263987928629, 0.04819154366850853, 0.004468746017664671, 0.003314347006380558, -0.023567089810967445, -0.03415756672620773, 0.025937257334589958, 0.008622129447758198, -0.026635373011231422, -0.013994116336107254, -0.019254975020885468, 0.0006284482078626752, -0.017053041607141495, 0.034747328609228134, 0.009298022836446762, 0.007754011079668999, 0.015941768884658813, 0.043739307671785355, -0.028208980336785316, 0.0056786322966217995, 0.0047341217286884785, 0.004021527711302042, 0.025480767711997032, -0.009953483007848263, -0.03558526188135147, 0.059492867439985275, -0.0001403759088134393, 0.007507937494665384, -0.02152329683303833, 0.02260407991707325, -0.0014107105089351535, 0.008744597434997559, 0.0330352820456028, 0.053474582731723785, -0.027296792715787888, -0.024211827665567398, -0.03839351609349251, 0.012238817289471626, 0.04455981031060219, -0.025960931554436684, 0.027944251894950867, 0.04180049151182175, -0.027077414095401764, -0.003540271194651723, 0.001835153321735561, -0.0439835749566555, 0.0035181636922061443, 0.016421964392066002, 0.023953935131430626, -0.0002782215306069702, -0.023801105096936226, -0.009045584127306938, 0.021198591217398643, 0.014218409545719624, 0.013242033310234547, -0.1023038700222969, 0.00011449717567302287, 0.048863086849451065, -0.006665857043117285, -0.03121744841337204, 0.000427982653491199, 0.0476989671587944, -0.038012903183698654, -0.012093777768313885, -0.0034774967934936285, -0.013559806160628796, 0.054896675050258636, 0.015056414529681206, -0.006488745100796223, -0.017724446952342987, -0.025034846737980843, -0.012562820687890053, -0.011608785949647427, -0.009170432575047016, -0.014974632300436497, -0.049376230686903, 0.093304343521595, 0.03791803494095802, 0.025792958214879036, -0.0034082315396517515, 0.03452485427260399, 0.0336725190281868, 0.004832692444324493, -0.007919724099338055, -0.03826913982629776, 0.005759227089583874, 0.03178825229406357, 0.0022815882693976164, 0.03586365282535553, -0.06605763733386993, 0.023542286828160286, 0.0014622502494603395, -0.0247025229036808, 0.036530449986457825, 0.010778985917568207, 0.03392171114683151, 0.04143591970205307, 0.01208131480962038, 0.003830099245533347, -0.021418869495391846, -0.03912636265158653, -0.007774831727147102, 0.025197884067893028, -0.0048790243454277515, -0.032645322382450104, -0.017229732125997543, -0.028389938175678253, -0.008463501930236816, 0.027981560677289963, -0.018200619146227837, 0.04139326512813568, 0.007032171823084354, 0.024439964443445206, 0.026920029893517494, -0.05107227340340614, -0.020268714055418968, 0.016541684046387672, -0.015837542712688446, 0.022109869867563248, -0.01674249954521656, 0.02237527072429657, -0.009759603068232536, -0.005036942195147276, 0.027891596779227257, -0.009015195071697235, -0.022591013461351395, -0.04228443652391434, -0.03068237565457821, 0.015313110314309597, -0.012622153386473656, 0.005043018143624067, 0.0029399266932159662, -0.009428346529603004, 0.03190022334456444, -0.006189382169395685, -0.04019973799586296, 0.012087458744645119, -0.06009839475154877, -0.006684490945190191, -0.02244865521788597, -0.03970722854137421, 0.005444286856800318, 0.020527876913547516, 0.02237287349998951, 0.05502711236476898, 0.01800217293202877, -0.04597293213009834, 0.04980262368917465, -0.001604924793355167, 0.003728035604581237, 0.02192782610654831, 0.011839895509183407, 0.04979458823800087, -0.0039514461532235146, 0.010197121649980545, 0.05725831538438797, -0.024572672322392464, 0.0018363374983891845, -0.004702580161392689, -0.009622368030250072, 0.053324684500694275, -0.02568085491657257, -0.041234683245420456, 0.017044266685843468, 0.01328964438289404, -0.006174434907734394, -0.013786844909191132, -0.02246955782175064, 0.0156386811286211, 0.01761096902191639, -0.006045775022357702, -0.01752062700688839, 0.02943498268723488, -0.006497456692159176, 0.011103503406047821, -0.030271461233496666, 0.04866833612322807, 0.008870796300470829, 0.0347747728228569, -0.030131440609693527, -0.044176727533340454, 0.04821186512708664, -0.03215719014406204, -0.005659561138600111, 0.000819683016743511, -0.006645931862294674, -0.022868381813168526, -0.007160999346524477, -0.0010502333752810955, 0.07144574820995331, 0.008998622186481953, 0.025734104216098785, 0.04228641465306282, -0.00568777322769165, -0.05487737059593201, -0.014228384010493755, 0.0029650195501744747, -0.0050805555656552315, -0.023581476882100105, 0.014181829057633877, 0.00016288268670905381, 0.012343198992311954, 0.028298648074269295, 0.07876668125391006, 0.04605775326490402, 0.015213675796985626, -0.00020941910042893142, -0.00784521084278822, -0.025515353307127953, -0.054419830441474915, 0.01732788048684597, -0.029392601922154427, -0.012719763442873955, -0.01765788532793522, 0.05768692120909691, -0.0011061454424634576, 0.013341748155653477, -0.039944808930158615, 0.006949916947633028, 0.004300104454159737, -0.030148644000291824, 0.018782934173941612, -0.014605110511183739, 0.014724544249475002, 0.011263255961239338, -0.028217162936925888, 0.011213501915335655, 0.03260079398751259, 0.028080938383936882, -0.002127828076481819, 0.021877184510231018, 0.032389119267463684, 0.03731275722384453, 0.012406373396515846, -0.0255020372569561, 0.01690380647778511, 0.05561470240354538, 0.023505207151174545, -0.0033717763144522905, 0.014127842150628567, 0.019196586683392525, 0.007976748049259186, 0.03533240035176277, 0.011957020498812199, 0.015617282129824162, 0.05404594913125038, 0.015464555472135544, -0.013582184910774231, -0.0008413293398916721, -0.002669441280886531, -0.010714175179600716, -0.015971660614013672, 0.009952068328857422, -0.04378984868526459, -0.033359747380018234, 0.02934359945356846, 0.027898864820599556, -0.015469544567167759, 0.0034230444580316544, -0.012019719928503036, -0.03726930916309357, 0.005064883269369602, -0.04800626263022423, -0.02009725384414196, 0.032089509069919586, -0.028913261368870735, -0.024798689410090446, -0.013999907299876213, -0.030559377744793892, 0.02241179719567299, -0.049262918531894684, -0.027742067351937294, -0.04155461862683296, 0.03987031802535057, 0.043999746441841125, 0.013872790150344372, -0.03611034154891968, 0.017602352425456047, 0.001361930393613875, 0.031020788475871086, -0.006278462242335081, 0.04140761122107506, 0.04544071853160858, -0.013833045028150082, 0.0040575978346168995, 0.005720564629882574, 0.060661621391773224, -0.006208417937159538, 0.02219219133257866, 0.028822803869843483, 0.05340541899204254, -0.048060525208711624, 0.025264957919716835, 0.03249770402908325, -0.04255698248744011, -0.026929613202810287, -0.023232752457261086, -0.039941463619470596, -0.018561478704214096, -0.01038347091525793, 0.021844210103154182, 0.034990373998880386, -0.005870812572538853, 0.017860423773527145, 0.032641198486089706, 0.03237023204565048, -0.048706211149692535, -0.020063597708940506, 0.0022386000491678715, 0.01034523919224739, -0.029392903670668602, 0.06239674612879753, -0.010069777257740498, -0.003950047306716442, -0.06352806091308594, 0.036945365369319916, -0.04938366636633873, 0.030477894470095634, -0.005424417555332184, 0.007624716963618994, 0.06116987392306328, 0.06152570620179176, -0.006653741467744112, 0.000776530709117651, 0.018693629652261734, 0.02289208583533764, -0.021971583366394043, 0.0050743017345666885, 0.0037989579141139984, 0.016785109415650368, -0.022674215957522392, 0.04463883861899376, 0.06611178070306778, 0.008513620123267174, 0.032836008816957474, 0.016065483912825584, -0.021013880148530006, 0.00920945219695568, 0.0479198694229126, -0.014919119887053967, 0.061210449784994125, 0.061360687017440796, -0.052796896547079086, -0.004777505528181791, -0.011564810760319233, -0.031018149107694626, -0.016019191592931747, 0.0044770622625947, -0.003428954165428877, -0.026834925636649132, 0.032222647219896317, 0.014654950238764286, -0.015525001101195812, -0.026219168677926064, 0.006797212176024914, 0.026356970891356468, 0.03316749259829521, -0.01047950703650713, -0.02676418423652649, -0.006741121411323547, -0.032762572169303894, -0.020178737118840218, -0.01868697628378868, 0.0524655282497406, 0.036113619804382324, -0.013320944271981716, 0.04579267278313637, -0.0023153701331466436, 0.0021453327499330044, 0.001773697673343122, -0.015614247880876064, 0.047114815562963486, 0.0077069466933608055, -0.04362388700246811, -0.0380692221224308, -0.019251858815550804, -0.009519039653241634, -0.027818361297249794, -0.016047971323132515, 0.022316936403512955, -0.025414343923330307, 0.025165071710944176, 0.025787968188524246, 0.0032554150093346834, -0.01774197444319725, -0.02227504923939705, 0.0021941184531897306, 0.010459471493959427, -0.03132825717329979, -0.011864254251122475, -0.04677588865160942, -0.01840779557824135, -0.00014439247024711221, -0.015787459909915924, 0.013144247233867645, -0.025120116770267487, -0.0100905392318964, -0.02216418646275997, 0.03374030813574791, -0.0037063590716570616, 0.03016079030930996, -0.022298390045762062, -0.0037185128312557936, -0.024210091680288315, 0.032938551157712936, -0.022763317450881004, 0.01344920601695776, -0.011252225376665592, 0.017630407586693764, -0.029796672984957695, -0.034949008375406265, -0.01004305575042963, -0.0444541871547699, -0.00811944529414177, 0.02741057239472866, 0.04370710253715515, 0.003267869586125016, -0.002639261307194829, -0.05115480720996857, -0.05116540193557739, -0.01379847526550293, -0.05586395040154457, 0.0293854009360075, 0.017691349610686302, 0.0003450924123171717, 0.013167581520974636, -0.03476902097463608, 0.0019982350058853626, 0.014421594329178333, -0.045668162405490875, -0.00422622449696064, 0.06478085368871689, 0.023853279650211334, 0.012510578148066998, -0.06332583725452423, 0.039411693811416626, 0.006156029645353556, 0.006650760769844055, -0.03626692295074463, 0.048185862600803375, -0.03042389266192913, -0.028137363493442535, 0.01903536356985569, -0.03028503619134426, 0.012538197450339794, -0.03610464185476303, 0.009331157431006432, -0.020545050501823425, 0.008001545444130898, 0.02301935665309429, 0.00845622643828392, -0.052106160670518875, 0.019758719950914383, 0.0013573055621236563, 0.005538451950997114, -0.023401649668812752, -0.01692933402955532, 0.04282951354980469, 0.009642289020121098, -0.0014490322209894657, -0.0439312644302845, 0.00014381640357896686, -0.0018613488646224141, -0.037585608661174774, 0.022504430264234543, 0.02264704927802086, 0.0011043705744668841, -0.024553310126066208, -0.01049116998910904, 0.04467741400003433, -0.06376095861196518, -0.04737436771392822, 0.029800672084093094, 0.03792925924062729, 0.007156027480959892, 0.0607149638235569, -0.05049681290984154, 0.03661063313484192, -0.04453658312559128, 0.022872135043144226, 0.01669219508767128, -0.010482490994036198, -0.022502554580569267, -0.012051740661263466, -0.033554088324308395, 0.009669965133070946, 0.002225942211225629, 0.017958354204893112, 0.022170359268784523, 0.00231432868167758, -0.01630987599492073, -0.020565908402204514, -0.0132188331335783, 0.006158352829515934, 0.0229449812322855, -0.027711380273103714, -0.0255719106644392, -0.00935784075409174, 0.002556870924308896, -0.018919724971055984, -0.009844438172876835, 0.0038728106301277876, 0.00636186171323061, -0.003735264763236046, -0.030355360358953476, 0.0434165857732296, -0.0294545479118824, -0.018846800550818443, 0.019631212577223778, -0.011510648764669895, 0.021993035450577736, 0.03096778877079487, -0.017542779445648193, -0.005775048863142729, 0.03259717673063278 ]
Chat Templates: An End to the Silent Performance Killer
rocketknight1
October 3, 2023
chat-templates
LLM, nlp, community
https://huggingface.co/blog/chat-templates
How do I get started with templates? Easy! If a tokenizer has the chat_template attribute set, it's ready to go. You can use that model and tokenizer in ConversationPipeline, or you can call tokenizer.apply_chat_template() to format chats for inference or training. Please see our developer guide or the apply_chat_template documentation for more! If a tokenizer doesn't have a chat_template attribute, it might still work, but it will use the default chat template set for that model class. This is fragile, as we mentioned above, and it's also a source of silent bugs when the class template doesn't match what the model was actually trained with. If you want to use a checkpoint that doesn't have a chat_template, we recommend checking docs like the model card to verify what the right format is, and then adding a correct chat_templatefor that format. We recommend doing this even if the default chat template is correct - it future-proofs the model, and also makes it clear that the template is present and suitable. You can add a chat_template even for checkpoints that you're not the owner of, by opening a pull request. The only change you need to make is to set the tokenizer.chat_template attribute to a Jinja template string. Once that's done, push your changes and you're ready to go! If you'd like to use a checkpoint for chat but you can't find any documentation on the chat format it used, you should probably open an issue on the checkpoint or ping the owner! Once you figure out the format the model is using, please open a pull request to add a suitable chat_template. Other users will really appreciate it!
[ 0.031669050455093384, -0.039973799139261246, 0.006108177825808525, 0.04388587549328804, 0.08027124404907227, 0.03160660341382027, 0.03524434566497803, 0.028731530532240868, -0.00198466912843287, -0.04625294730067253, -0.05064660310745239, 0.018245846033096313, 0.018683210015296936, 0.09026604145765305, -0.01946684531867504, -0.01353355124592781, 0.06513676792383194, 0.038168925791978836, -0.02592461369931698, 0.010220376774668694, 0.006544527132064104, -0.01587425172328949, 0.025018729269504547, -0.01735719107091427, 0.04964008927345276, -0.07172443717718124, 0.03760182112455368, 0.024535562843084335, -0.05176730826497078, 0.05091053247451782, -0.044238608330488205, 0.016463004052639008, 0.009196058847010136, -0.03206188604235649, 0.020492207258939743, 0.009386022575199604, -0.08790094405412674, 0.04015427827835083, 0.0026780450716614723, -0.04373546317219734, 0.02680780738592148, -0.03703223168849945, -0.044690411537885666, 0.027353908866643906, 0.013926300220191479, -0.0381813570857048, -0.18336836993694305, 0.032747361809015274, -0.020912906154990196, -0.017093531787395477, -0.08022116869688034, 0.07495615631341934, -0.012588214129209518, -0.03334873169660568, 0.009360861964523792, -0.028639156371355057, -0.04704291373491287, -0.06586893647909164, 0.004082490224391222, 0.010917093604803085, 0.03616422042250633, 0.041125789284706116, -0.007209330797195435, -0.03233344107866287, 0.0594613216817379, 0.05766575038433075, -0.011549386195838451, 0.04880809411406517, -0.029159214347600937, -0.02449645660817623, 0.027051860466599464, -0.004482775926589966, 0.02458258345723152, 0.02196197584271431, 0.034189656376838684, -0.0386248379945755, -0.0043343110010027885, 0.05916402116417885, 0.027808798477053642, 0.018099945038557053, -0.01728808879852295, 0.0076174684800207615, 0.014796406961977482, 0.0011454637860879302, 0.018084989860653877, 0.005868304520845413, 0.07392536848783493, -0.015424486249685287, -0.030186591669917107, -0.003001144388690591, -0.027852362021803856, -0.13799616694450378, 0.00014777232718188316, -0.037020619958639145, 0.005627520848065615, -0.04127609357237816, 0.0010431577684357762, 0.056064262986183167, 0.03745538741350174, -0.0810808464884758, 0.006052320823073387, -0.08633316308259964, -0.00450935959815979, -0.011375460773706436, -0.0423978790640831, 0.03947775438427925, -0.02195802889764309, -0.1069701537489891, -0.03146996349096298, -0.02069471776485443, 0.021255837753415108, -0.028420191258192062, 0.00828174501657486, 0.13478747010231018, -0.06472073495388031, 0.027317974716424942, 0.039661750197410583, -0.05078441649675369, 0.012432459741830826, -0.02328740991652012, 0.0425211600959301, 0.042016152292490005, 0.1259499043226242, -0.02811780758202076, -0.020070156082510948, 0.09119123220443726, 0.03146719932556152, 0.05861686170101166, -0.05046303942799568, -0.06071874126791954, -0.002442449564114213, -0.004031838849186897, -0.014126665890216827, -0.011425472795963287, -0.004421166609972715, -0.05596157908439636, 0.03098169155418873, -0.12460959702730179, 0.07018031924962997, 0.011663824319839478, -0.049896277487277985, 0.06826140731573105, 0.03678758069872856, 0.02637656219303608, 0.0013389935484156013, 0.0396859347820282, -0.01984455995261669, -0.004491027444601059, -0.012889496050775051, -0.019779924303293228, -0.06194879859685898, 0.033849820494651794, 0.02725764736533165, -0.04689455032348633, -0.01847429946064949, 0.059253670275211334, 0.02595563419163227, -0.018799936398863792, -0.04488465189933777, -0.04761093854904175, 0.0004493442829698324, 0.004058533348143101, -0.03642408549785614, 0.07777271419763565, 0.041889265179634094, -0.018738744780421257, -0.03710051253437996, -0.03383292630314827, 0.036144498735666275, -0.012260152027010918, 0.05920427665114403, -0.03783944249153137, 0.037730872631073, 0.036024197936058044, 0.044107913970947266, 0.04090546816587448, 0.015581476502120495, 0.012301485985517502, 0.004217669367790222, -0.009660276584327221, -0.06586708873510361, 0.045677121728658676, -0.05826462432742119, -0.005057319533079863, 0.062062300741672516, -0.10447007417678833, 0.0035135734360665083, -0.05967520549893379, -0.04313051700592041, 0.021540340036153793, -0.042212001979351044, -0.043780550360679626, 0.06180175766348839, 0.049590107053518295, 0.01052087265998125, -0.03471612557768822, -0.006916048005223274, 0.08821378648281097, 0.025587189942598343, 0.12157931178808212, 0.06261123716831207, 0.0054343207739293575, -0.03255876526236534, -0.017846792936325073, 0.01665581203997135, 0.05426598712801933, 0.00820068921893835, -0.08315807580947876, 0.0389396995306015, 0.04360165819525719, 0.012161200866103172, -0.08797696977853775, 0.07394316792488098, -0.06675343960523605, -0.015660949051380157, -0.06335560977458954, -0.00004361217361292802, -0.010845687240362167, -0.0013758622808381915, -0.004475087393075228, 0.15877485275268555, -0.10495416074991226, -0.006653681863099337, -0.025361306965351105, -0.029117656871676445, 0.05287850648164749, 0.0398419052362442, 0.05442974343895912, 0.11307749152183533, -0.0946037545800209, 0.0008446511928923428, -0.054412201046943665, -0.01710617169737816, 0.05764712020754814, -0.04788839444518089, 0.003199745202437043, 0.05031103268265724, -0.02842109091579914, 0.028651777654886246, -0.026124030351638794, 0.043769001960754395, -0.029428189620375633, 0.019983692094683647, -0.016571059823036194, -0.00016678633983246982, 0.05571581423282623, 0.06257526576519012, 0.002665563253685832, -0.03120715171098709, 0.018040666356682777, -0.03779730200767517, 0.03285440430045128, -0.006548854988068342, -0.06498933583498001, 0.030956462025642395, 0.05807720124721527, 0.005052158143371344, -0.020197609439492226, -0.02920282445847988, 0.02636639215052128, -0.010403232648968697, 0.02432919107377529, -0.0637618750333786, -0.02636219561100006, -0.011083032004535198, -0.057731855660676956, 0.000042199873860226944, -0.0008522460702806711, 0.007785850204527378, 0.025910038501024246, 0.0321866013109684, -0.045512665063142776, -0.006436760071665049, 0.039245378226041794, 0.012839003466069698, 0.015446946024894714, 0.0065802657045423985, -0.013138738460838795, -0.005455635488033295, -0.012769012711942196, 0.024006390944123268, -0.044322460889816284, 0.0094339894130826, 0.03899894282221794, 0.0146405678242445, 0.015987250953912735, 0.030198197811841965, -0.016789529472589493, -0.04754101112484932, -0.020315267145633698, -0.0023074254859238863, 0.043292466551065445, 0.0014414817560464144, 0.027064841240644455, 0.010268663056194782, 0.02924984134733677, 0.009007428772747517, 0.027709217742085457, 0.0001186657027574256, 0.03635440021753311, 0.01027008332312107, -0.015462267212569714, 0.003466626862064004, -0.020179687067866325, -0.033876992762088776, 0.05274881422519684, 0.005907487124204636, -0.00499675702303648, -0.1031891256570816, -0.0034672878682613373, 0.04240724444389343, -0.0015472155064344406, -0.026546724140644073, -0.031484656035900116, 0.05052565783262253, -0.04240863025188446, -0.014268364757299423, 0.008889026939868927, -0.04301157593727112, 0.03420761972665787, 0.009335126727819443, 0.008828599005937576, 0.0008670772658661008, -0.025669751688838005, -0.03906312957406044, -0.024755708873271942, 0.03129134327173233, 0.004963933955878019, -0.04299429431557655, 0.07025651633739471, 0.011532800272107124, 0.020654067397117615, 0.014499624259769917, 0.00636625848710537, 0.05593767389655113, 0.04507284611463547, 0.02815135009586811, -0.03263964504003525, 0.004453284665942192, -0.020313754677772522, -0.036616865545511246, 0.026271753013134003, -0.0537014864385128, -0.00025283402646891773, -0.023845409974455833, -0.0014329608529806137, 0.0242017712444067, 0.017601262778043747, -0.011591737158596516, -0.007756213657557964, 0.03809531405568123, -0.018048299476504326, 0.028345342725515366, 0.001896830159239471, -0.01778276450932026, -0.010033910162746906, 0.030284643173217773, -0.01798112876713276, 0.0014362429501488805, -0.005725020542740822, 0.04298171028494835, 0.0470193587243557, -0.013937495648860931, 0.020411547273397446, -0.009782574139535427, 0.04149264469742775, 0.012120895087718964, -0.028463667258620262, -0.06074085831642151, 0.02763805352151394, 0.014472858980298042, -0.0042287749238312244, -0.03482736647129059, 0.05488867312669754, 0.017194338142871857, 0.003321785479784012, -0.0021982660982757807, 0.01223602145910263, -0.03582795709371567, 0.048139940947294235, -0.0026656982954591513, 0.020230716094374657, 0.008323194459080696, 0.01805257983505726, -0.025750909000635147, -0.04617587476968765, 0.04073618724942207, 0.018926996737718582, -0.016621682792901993, -0.022830625995993614, -0.05728362128138542, -0.015436834655702114, -0.022213658317923546, 0.0274055078625679, 0.058911506086587906, -0.022202134132385254, 0.017307564616203308, 0.019227853044867516, 0.012909765355288982, -0.034321267157793045, 0.02273687906563282, -0.006114016752690077, 0.00008109788177534938, 0.013571247458457947, 0.00030855293152853847, -0.007658457849174738, 0.0008097604149952531, 0.017395691946148872, 0.02238810807466507, -0.026230746880173683, -0.001948617398738861, -0.006150140427052975, 0.03129441663622856, 0.02357986941933632, -0.046934954822063446, -0.06999168545007706, -0.00015712871390860528, 0.0030699067283421755, 0.011243239045143127, 0.0067880600690841675, 0.006719005759805441, 0.015650030225515366, 0.00031614862382411957, 0.072588250041008, 0.0023620612919330597, 0.00035167159512639046, -0.0030389942694455385, 0.029420966282486916, -0.009626520797610283, 0.0066828010603785515, 0.01482569333165884, 0.0007221888517960906, 0.004828257951885462, -0.030137693509459496, 0.06249484047293663, -0.04477154463529587, 0.010644974187016487, 0.025761805474758148, -0.0002642407198436558, -0.02889157086610794, -0.0111096715554595, 0.002437703311443329, 0.0323626883327961, 0.016385074704885483, -0.02841670624911785, 0.019625652581453323, 0.0005277155432850122, -0.043975699692964554, -0.023730412125587463, -0.0007436046726070344, 0.051473915576934814, -0.0048461295664310455, 0.04348718747496605, -0.003142549656331539, -0.05351366102695465, -0.006665393244475126, 0.04204550385475159, 0.04287326708436012, 0.008322902955114841, 0.0095360167324543, -0.014873608946800232, -0.055544767528772354, -0.0027520267758518457, -0.012510842643678188, -0.017041103914380074, 0.0023456704802811146, 0.02697662264108658, 0.04363449662923813, -0.021456504240632057, 0.0021588439121842384, -0.00899109523743391, 0.007915979251265526, 0.03176100552082062, -0.015159334987401962, -0.021926529705524445, -0.09528046101331711, 0.00750374048948288, 0.009167151525616646, -0.02731764316558838, -0.008862475864589214, 0.0028662888798862696, -0.019391817972064018, 0.02083275094628334, 0.017848996445536613, 0.05382714420557022, 0.047375019639730453, 0.013030512258410454, -0.017400052398443222, -0.04011057689785957, -0.007942595519125462, 0.02911987528204918, 0.015354931354522705, -0.012037178501486778, 0.01098090223968029, 0.05316003039479256, 0.050110239535570145, 0.029962539672851562, 0.042670365422964096, 0.0018269463907927275, -0.017545489594340324, 0.02044246345758438, -0.024064090102910995, -0.028204113245010376, -0.015903938561677933, -0.03367523476481438, -0.001623567659407854, -0.006789186038076878, -0.027176769450306892, 0.016959721222519875, 0.06615298986434937, 0.0013501655776053667, -0.0036464319564402103, 0.013118409551680088, -0.0007129455334506929, -0.011743884533643723, -0.03651338815689087, 0.0031394236721098423, -0.04448151960968971, -0.016237620264291763, -0.03063502348959446, -0.017258090898394585, -0.003993300721049309, 0.04541859030723572, -0.01810249499976635, -0.008453067392110825, 0.02599876932799816, 0.030129842460155487, 0.05895354598760605, -0.0009937288705259562, -0.0030646028462797403, -0.044723693281412125, 0.0014657306019216776, 0.0037319220136851072, -0.014957524836063385, -0.006404284853488207, 0.017296532168984413, -0.04919631406664848, 0.0052961064502596855, -0.0007744882605038583, -0.019350964576005936, 0.025173107162117958, 0.07609924674034119, -0.009778840467333794, -0.007156800013035536, -0.059246648102998734, 0.017076794058084488, 0.03193333372473717, -0.05466127395629883, -0.0038053616881370544, -0.044600099325180054, -0.044763192534446716, -0.027534082531929016, -0.031476616859436035, 0.04768131300806999, 0.05651283264160156, -0.016606859862804413, -0.0011309870751574636, 0.03779762238264084, 0.023277578875422478, -0.010416029021143913, 0.022977836430072784, -0.010263897478580475, 0.026855187490582466, -0.007311573252081871, 0.040717899799346924, 0.008383495733141899, 0.0038731954991817474, -0.015776339918375015, 0.007826849818229675, -0.05689648911356926, 0.017793849110603333, -0.00670047290623188, -0.03486447408795357, 0.013903974555432796, 0.017093395814299583, -0.022603610530495644, -0.05248820036649704, 0.004192149732261896, 0.01176127977669239, 0.01693021133542061, -0.0015270952135324478, -0.002438068389892578, -0.020489783957600594, 0.0079905204474926, 0.020471487194299698, 0.060772351920604706, -0.029643721878528595, 0.05798528343439102, 0.02312461845576763, 0.019324518740177155, 0.014031631872057915, 0.06975418329238892, 0.014694207347929478, 0.02816803753376007, 0.042803190648555756, 0.009038245305418968, -0.008825297467410564, -0.011782210320234299, -0.03122556582093239, -0.022546030580997467, -0.04824891313910484, 0.023256314918398857, -0.0000701173921697773, -0.025306575000286102, 0.02413775585591793, 0.02950763702392578, 0.013909545727074146, -0.005601296201348305, 0.031731702387332916, 0.028404973447322845, 0.005802939645946026, -0.007698050234466791, -0.017884835600852966, 0.037074681371450424, 0.004145590588450432, 0.0025200508534908295, 0.08965040743350983, 0.01179567538201809, -0.012499846518039703, 0.05085141584277153, 0.04521458223462105, -0.0119559895247221, 0.003975244238972664, 0.004433232359588146, 0.006104010622948408, -0.02336185984313488, -0.01754501461982727, -0.011522018350660801, -0.009403319098055363, -0.01711868867278099, -0.05691889673471451, -0.0020754626020789146, -0.010680338367819786, -0.032230015844106674, -0.029479872435331345, -0.03403835371136665, -0.006627528928220272, -0.009529875591397285, 0.013554451055824757, 0.04630311205983162, 0.0019299397245049477, -0.04472203180193901, 0.0078059108927845955, 0.012998655438423157, -0.011682864278554916, -0.005004364065825939, 0.00924618262797594, -0.004772618878632784, 0.006098248530179262, -0.009239559061825275, -0.03361658751964569, -0.0046288431622087955, -0.01326028723269701, -0.02188809961080551, 0.002884414279833436, 0.02698289044201374, 0.005781850311905146, 0.024859584867954254, -0.006301586050540209, -0.002475038170814514, -0.020489811897277832, -0.014348999597132206, -0.025626158341765404, -0.030834870412945747, -0.022941121831536293, -0.05278640240430832, 0.009414217434823513, 0.0037099886685609818, 0.02451297827064991, -0.012946265749633312, 0.007360525894910097, -0.022772496566176414, -0.0857408419251442, -0.03388303518295288, -0.02558348886668682, 0.010158260352909565, 0.04529064893722534, 0.031066367402672768, -0.008245967328548431, 0.010373113676905632, -0.029249828308820724, 0.009017039090394974, 0.00376893300563097, 0.023887798190116882, 0.04341617971658707, -0.0015546826180070639, -0.015097753144800663, -0.04006776958703995, 0.01972985453903675, 0.03382653370499611, 0.05099554732441902, 0.028769468888640404, -0.01633193902671337, 0.017434755340218544, -0.006601489149034023, -0.011559625156223774, -0.0427020788192749, 0.00048185521154664457, -0.03409147262573242, -0.032914042472839355, -0.028920071199536324, 0.025221077725291252, -0.007400314323604107, 0.03499506041407585, -0.034988146275281906, -0.021869998425245285, -0.02490890584886074, -0.028804894536733627, -0.036648184061050415, 0.030885614454746246, 0.07785000652074814, -0.010652909986674786, 0.03827435523271561, 0.004313731100410223, -0.028136201202869415, 0.016402047127485275, 0.008656555786728859, 0.04712168872356415, 0.03984787315130234, -0.0019445668440312147, -0.011417894624173641, 0.01911732740700245, 0.022511111572384834, -0.008274851366877556, -0.03661816567182541, 0.02406175248324871, 0.003240282414481044, -0.03163831681013107, -0.03270822390913963, 0.0068273418582975864, 0.04152357205748558, -0.002621909836307168, 0.022305268794298172, -0.007083800621330738, -0.006638581398874521, -0.007743632420897484, 0.00790583249181509, -0.07270493358373642, -0.02714851126074791, -0.03882647305727005, -0.04383905231952667, 0.020619764924049377, 0.008407053537666798, -0.0015796622028574347, 0.0008033635676838458, -0.03699244558811188, 0.02964853122830391, 0.013252331875264645, -0.01666865684092045, -0.017240334302186966, 0.046771563589572906, 0.014679128304123878, -0.04246997833251953, 0.012658601626753807, 0.020121950656175613, 0.02486049197614193, -0.03673467040061951, -0.04258931428194046, 0.009789405390620232, -0.004848761484026909, 0.026495087891817093, 0.023275207728147507, 0.016306286677718163, 0.025192007422447205, 0.05589522421360016, -0.03716132417321205, -0.0354766920208931, 0.038135964423418045 ]
Accelerating Stable Diffusion XL Inference with JAX on Cloud TPU v5e
pcuenq
October 3, 2023
sdxl_jax
sdxl, jax, stable diffusion, guide, tpu, google
https://huggingface.co/blog/sdxl_jax
Why JAX + TPU v5e for SDXL? Serving SDXL with JAX on Cloud TPU v5e with high performance and cost-efficiency is possible thanks to the combination of purpose-built TPU hardware and a software stack optimized for performance. Below we highlight two key factors: JAX just-in-time (jit) compilation and XLA compiler-driven parallelism with JAX pmap.
[ 0.058690473437309265, 0.03409276530146599, 0.03956475481390953, 0.054664723575115204, 0.024282921105623245, -0.04000229388475418, 0.006169215310364962, 0.019208768382668495, 0.038980454206466675, -0.03784389793872833, 0.0026647101622074842, 0.003043280215933919, -0.042356256395578384, 0.029688086360692978, -0.03090428188443184, -0.06597361713647842, 0.029167715460062027, 0.015318566001951694, 0.07103969901800156, -0.024372974410653114, 0.009783849120140076, 0.004846865776926279, -0.02686910890042782, 0.027903597801923752, -0.03464891389012337, -0.028407707810401917, -0.04803832620382309, -0.01694362610578537, 0.015611391514539719, -0.036415476351976395, 0.04756450280547142, 0.023866306990385056, -0.03888921067118645, 0.004339959472417831, -0.0017651933012530208, -0.014999349601566792, -0.018851058557629585, 0.0704040378332138, -0.014374916441738605, -0.014398487284779549, -0.023240339010953903, -0.05653448402881622, -0.04900909960269928, 0.04328833892941475, 0.0010505651589483023, 0.009218594059348106, -0.1033700555562973, 0.02594582550227642, -0.07227160036563873, 0.051792994141578674, 0.012450991198420525, 0.029793238267302513, 0.008549424819648266, 0.029058536514639854, 0.06837964802980423, 0.09068039804697037, -0.02831256203353405, -0.0032686961349099874, 0.06375188380479813, -0.015905534848570824, 0.028553452342748642, -0.006636965088546276, 0.02217000722885132, -0.021110111847519875, 0.029085718095302582, -0.07760994881391525, 0.013537516817450523, -0.010528948158025742, -0.07441119104623795, -0.0009284382103942335, -0.007613462395966053, 0.01855749823153019, 0.005841686390340328, 0.1042642593383789, 0.02463584579527378, -0.03716723620891571, -0.06097634136676788, 0.01084675919264555, 0.07463793456554413, 0.10063233971595764, -0.012587559409439564, 0.08270800113677979, 0.031913239508867264, -0.021961886435747147, 0.013285624794661999, -0.022667929530143738, 0.05855927616357803, -0.041718196123838425, -0.07951848208904266, 0.06494171917438507, 0.12633444368839264, -0.05761232227087021, 0.006444218102842569, -0.014625580981373787, -0.009327288717031479, -0.012540027499198914, 0.021087924018502235, 0.03534481301903725, 0.0361802875995636, 0.02154933288693428, -0.00693514384329319, 0.0024492545053362846, 0.009005647152662277, -0.050822753459215164, -0.04557337611913681, 0.038031402975320816, -0.028472909703850746, -0.08665280789136887, 0.04817529395222664, 0.025695214048027992, 0.014229810796678066, 0.019602173939347267, 0.013638877309858799, 0.027507061138749123, -0.029056202620267868, 0.07891761511564255, 0.040586717426776886, 0.01691504940390587, -0.027600757777690887, -0.030329745262861252, -0.038411401212215424, 0.12898017466068268, 0.04645867273211479, -0.05260417237877846, 0.003678329288959503, 0.03156251460313797, -0.0023278153967112303, 0.00843092706054449, 0.008206513710319996, -0.06486395746469498, 0.047670893371105194, 0.018520386889576912, 0.015675155445933342, 0.011171452701091766, 0.05909040570259094, 0.0032458442728966475, 0.0517067015171051, -0.011678744107484818, -0.009755116887390614, 0.022132644429802895, -0.052863799035549164, 0.07854493707418442, 0.0416889488697052, -0.007632428780198097, -0.03660650923848152, 0.028706302866339684, 0.0328838974237442, 0.035335130989551544, -0.057561811059713364, -0.058820925652980804, -0.0031457655131816864, 0.0012355439830571413, -0.06656190007925034, -0.009259911254048347, 0.026260754093527794, 0.07472061365842819, 0.037768661975860596, -0.031345754861831665, -0.14360155165195465, -0.023758718743920326, -0.033244095742702484, 0.0004041330248583108, -0.03882287070155144, 0.002412391360849142, -0.050495125353336334, 0.07259001582860947, 0.04002216458320618, -0.02644769661128521, 0.030340120196342468, -0.05234041064977646, 0.016888625919818878, -0.018759706988930702, 0.03303172066807747, 0.04372436925768852, 0.009104839526116848, -0.02689855359494686, 0.08676357567310333, 0.07717454433441162, -0.03757525980472565, -0.0691867470741272, -0.034888867288827896, 0.0659589171409607, -0.020023474469780922, 0.07844243943691254, -0.00569754745811224, -0.08061077445745468, 0.12180886417627335, -0.030354132875800133, -0.02888491190969944, -0.03710327297449112, -0.054529234766960144, -0.018403643742203712, 0.03030022792518139, -0.033099833875894547, -0.007339981384575367, 0.044674426317214966, -0.025405867025256157, 0.04397439584136009, -0.009690756909549236, 0.03444298729300499, 0.053880222141742706, 0.004221328534185886, -0.0628352090716362, 0.046205777674913406, -0.02800888754427433, -0.04369022697210312, 0.09670565277338028, 0.03860309347510338, 0.015956390649080276, -0.03262076899409294, -0.025584345683455467, -0.09804946184158325, 0.001807964756153524, -0.02722899615764618, -0.10378196835517883, -0.07046235352754593, 0.048513252288103104, -0.0075275409035384655, 0.021267736330628395, -0.052855297923088074, 0.0880768895149231, -0.07389440387487411, -0.020010685548186302, 0.07553437352180481, -0.027799228206276894, 0.00519458157941699, 0.033729128539562225, -0.011940251104533672, -0.0028844745829701424, -0.03242803364992142, -0.025694970041513443, -0.0728287473320961, -0.10382382571697235, -0.044001251459121704, 0.09822627902030945, 0.09561926126480103, 0.04883940517902374, -0.10564184933900833, 0.012299797497689724, -0.02544642798602581, 0.009784262627363205, 0.008617118000984192, 0.04232561215758324, -0.009935579262673855, 0.06787237524986267, -0.06635503470897675, -0.0003408129559829831, -0.039204347878694534, -0.036862026900053024, -0.016498466953635216, -0.10386331379413605, -0.013169369660317898, -0.003770713461562991, -0.03204312548041344, 0.02189953252673149, -0.010178559459745884, 0.002148598665371537, -0.06052003055810928, -0.017481863498687744, 0.034662336111068726, 0.0018598466413095593, -0.018843768164515495, -0.012900644913315773, -0.044885724782943726, 0.025152143090963364, -0.0035590764600783587, 0.01218322291970253, 0.0073746927082538605, 0.007830236107110977, 0.022440969944000244, -0.0012402028078213334, -0.04494677484035492, -0.02905150130391121, -0.0432811975479126, 0.0005777679034508765, -0.008435076102614403, -0.003973149228841066, -0.02241494134068489, -0.007947014644742012, -0.03365369513630867, 0.027385985478758812, -0.02410227246582508, 0.05895097181200981, -0.003517699195072055, -0.025762569159269333, -0.010820770636200905, 0.06441288441419601, -0.0009828213369473815, -0.07846181839704514, -0.0008870817837305367, -0.038429632782936096, -0.006133973132818937, -0.04417663440108299, 0.01159913744777441, 0.007768694311380386, -0.03032924234867096, 0.02713966555893421, -0.03943054750561714, -0.02305011637508869, 0.00524168973788619, -0.035016369074583054, -0.02238413318991661, 0.010661182925105095, -0.021528588607907295, 0.0034589015413075686, -0.02981964871287346, -0.02349798195064068, 0.02148866467177868, -0.08292166888713837, -0.028507525101304054, -0.026301920413970947, -0.01555410772562027, -0.002522008027881384, 0.00871302094310522, -0.007615908980369568, -0.044404756277799606, -0.03299752250313759, 0.009290706366300583, 0.019064132124185562, 0.028935657814145088, 0.02097780629992485, -0.042261648923158646, 0.03561655059456825, 0.025400318205356598, 0.03593439981341362, 0.03456022962927818, 0.04376188665628433, -0.006414587609469891, -0.061273619532585144, -0.011589789763092995, 0.02931423857808113, -0.04483921453356743, -0.01687757670879364, 0.02767757698893547, -0.0017189873615279794, -0.05600709468126297, 0.003530967514961958, 0.007793390657752752, -0.03624911233782768, -0.00034337909892201424, 0.012695257551968098, 0.012474967166781425, -0.01647423394024372, -0.031107481569051743, 0.04214874655008316, 0.04621503874659538, -0.0056876870803534985, -0.01744232140481472, 0.05262408033013344, -0.02495412714779377, 0.03374893590807915, -0.02400008961558342, 0.0057091740891337395, 0.03850255906581879, 0.06423685699701309, -0.0038435026071965694, 0.013026716187596321, 0.02874065935611725, -0.02394687384366989, 0.044476691633462906, 0.0047850701957941055, -0.014080668799579144, 0.017347391694784164, 0.009528381749987602, -0.0017475169152021408, -0.020203886553645134, 0.026969678699970245, -0.025109730660915375, -0.016473324969410896, -0.06331764906644821, 0.0033732939045876265, 0.03037429414689541, -0.011720720678567886, 0.008314626291394234, 0.01907920651137829, -0.0346524678170681, -0.04508741572499275, 0.046094052493572235, -0.031166667118668556, 0.016682129353284836, 0.03558215871453285, 0.017772648483514786, -0.0012615062296390533, 0.023162566125392914, -0.002376302145421505, 0.007961328141391277, 0.014796670526266098, 0.014396654441952705, -0.01624450273811817, -0.003970279823988676, -0.008881054818630219, 0.003304562997072935, 0.03111974522471428, 0.04944823309779167, -0.018178943544626236, 0.06542842090129852, -0.01544930785894394, 0.04645885154604912, 0.0031037903390824795, -0.029421010985970497, 0.009258419275283813, -0.008237041532993317, -0.012870394624769688, -0.05416398495435715, 0.004841865040361881, 0.023890282958745956, -0.008622980676591396, -0.018945233896374702, 0.04317615553736687, -0.002675045281648636, 0.01688694767653942, 0.03003242425620556, -0.025810208171606064, -0.01806166209280491, -0.007989455945789814, -0.01025991141796112, 0.019952308386564255, 0.06662054359912872, 0.030714653432369232, -0.022078633308410645, -0.00907638669013977, -0.0278459619730711, -0.009653231129050255, 0.033087000250816345, 0.0199600737541914, 0.01758214272558689, 0.005807674489915371, 0.009875524789094925, -0.008594483137130737, 0.022501619532704353, 0.019192490726709366, -0.0142312441021204, -0.014588107354938984, -0.00774877006188035, -0.012255722656846046, 0.030834974721074104, 0.0018252345034852624, 0.02907048538327217, 0.006895290222018957, -0.021018845960497856, 0.05910846218466759, -0.0016840220196172595, -0.02169666811823845, -0.013535096310079098, -0.012709527276456356, 0.00760012399405241, -0.01306838821619749, -0.05534771829843521, 0.013264351524412632, 0.033674370497465134, 0.007521543651819229, -0.029350725933909416, 0.017255723476409912, -0.0027538954745978117, -0.06551721692085266, 0.00785935390740633, -0.03713090717792511, -0.02890554443001747, 0.06838375329971313, -0.05960128828883171, 0.0023510835599154234, -0.020120568573474884, -0.005085330456495285, 0.02228001318871975, 0.04412374272942543, 0.007127001881599426, 0.01974540948867798, 0.027968812733888626, -0.02375202439725399, 0.011436212807893753, -0.002047404646873474, -0.016383957117795944, 0.06918981671333313, 0.010212196037173271, 0.004443631041795015, -0.02704114466905594, -0.021138573065400124, -0.025571169331669807, -0.03851497545838356, -0.018256889656186104, 0.009004281833767891, -0.01769854687154293, -0.0036336700432002544, -0.017050717025995255, 0.033570028841495514, 0.021038774400949478, 0.005868564359843731, 0.007910534739494324, -0.03193297237157822, -0.021955231204628944, -0.028050720691680908, -0.0387808196246624, 0.03342040255665779, -0.004318071063607931, 0.04542117565870285, 0.015532080084085464, 0.00002112809306709096, 0.040177121758461, 0.019199365749955177, -0.04082346707582474, -0.021134275943040848, 0.02444310300052166, 0.03533167392015457, -0.07804631441831589, 0.022193673998117447, 0.015906142070889473, 0.00872968602925539, 0.015333237126469612, 0.0022807300556451082, 0.0036521872971206903, -0.017239682376384735, -0.0012750504538416862, -0.01751524955034256, 0.020600438117980957, 0.020518433302640915, -0.004505046643316746, -0.007217469625174999, -0.024504609405994415, -0.023736877366900444, 0.009469257667660713, -0.011948181316256523, 0.01632063463330269, -0.01694924756884575, -0.03133354336023331, -0.040456097573041916, 0.03825690969824791, -0.009862068109214306, -0.04453454911708832, 0.0683496966958046, 0.0032589093316346407, -0.00010372164251748472, -0.01757599413394928, -0.005199137609452009, 0.02132154256105423, 0.012554335407912731, -0.023279113695025444, -0.04025719314813614, 0.008900091052055359, -0.000023119448087527417, 0.02720036543905735, -0.025689121335744858, 0.0036539763677865267, 0.03345930576324463, 0.005750391166657209, 0.0004389568930491805, -0.001962598878890276, 0.031470440328121185, -0.03640427440404892, -0.043281231075525284, -0.022093769162893295, -0.028484543785452843, 0.008142608217895031, -0.0467284694314003, 0.03092213161289692, 0.03393824025988579, -0.023966727778315544, -0.010377460159361362, 0.0015780968824401498, 0.028260929509997368, -0.03834756091237068, -0.02062316983938217, -0.0030797142535448074, 0.02312546595931053, 0.048569485545158386, 0.030155854299664497, -0.008555890060961246, 0.0035322385374456644, -0.05540455877780914, -0.016300253570079803, -0.054573602974414825, 0.03691402077674866, 0.06760714948177338, -0.033418528735637665, 0.02855193428695202, 0.025079045444726944, -0.02037840336561203, -0.0060245138593018055, -0.006538764573633671, -0.010596605949103832, -0.0154359620064497, 0.027584685012698174, -0.02775667794048786, -0.024390950798988342, -0.011643456295132637, -0.024340912699699402, 0.041140370070934296, 0.015529765747487545, 0.01783381588757038, 0.021818803623318672, 0.010280673392117023, 0.008241207338869572, 0.030544184148311615, -0.058891262859106064, 0.04546283185482025, 0.03123999573290348, -0.01766485720872879, 0.0719207227230072, 0.032892290502786636, -0.007662284187972546, -0.03808052837848663, 0.025182191282510757, -0.007816283032298088, -0.08867035061120987, -0.014228420332074165, -0.03280867636203766, -0.037751439958810806, -0.036270882934331894, -0.03289486840367317, 0.07834675908088684, 0.029217028990387917, 0.030776148661971092, 0.0010337370913475752, -0.014986560679972172, -0.02260012924671173, 0.010254506021738052, 0.024296587333083153, -0.017570339143276215, -0.013113063760101795, 0.053956303745508194, 0.0024787704460322857, -0.010225700214505196, 0.03689942508935928, -0.00648079439997673, 0.03910880163311958, 0.00406148424372077, 0.0027162209153175354, -0.025850558653473854, 0.058953430503606796, -0.027096999809145927, -0.022254809737205505, -0.011691887862980366, -0.021621016785502434, 0.0002721443597692996, -0.015088915824890137, 0.020690729841589928, 0.009055121801793575, -0.007103070616722107, 0.01482777576893568, 0.04579904302954674, 0.030104799196124077, -0.01755303330719471, -0.03776323050260544, 0.0184654351323843, 0.0021131110843271017, 0.05004239082336426, 0.032609712332487106, -0.05912935733795166, -0.006522830110043287, -0.006065318360924721, 0.01636969856917858, 0.0003978583263233304, 0.013693107292056084, 0.016558365896344185, -0.03778071328997612, 0.01247587613761425, -0.022560836747288704, 0.005389441270381212, 0.021019484847784042, 0.024498602375388145, 0.06603241711854935, -0.002322918036952615, 0.04401608556509018, -0.022095592692494392, -0.07913483679294586, -0.0077399504370987415, 0.016519563272595406, 0.05756218358874321, 0.021834786981344223, 0.004862670321017504, 0.015206906013190746, 0.015575996600091457, 0.018707403913140297, -0.01817196048796177, 0.0055772396735847, 0.027114523574709892, 0.0020319351460784674, 0.012839262373745441, 0.036065034568309784, -0.015803232789039612, 0.043179698288440704, 0.012538673356175423, 0.0529642254114151, 0.01482226699590683, 0.023605363443493843, 0.06576427072286606, -0.02040986530482769, -0.004877009894698858, -0.033509738743305206, 0.03483026474714279, -0.021112628281116486, 0.014760752208530903, -0.018832964822649956, 0.03049156814813614, -0.0189418513327837, -0.043519895523786545, -0.007427546661347151, 0.0019619683735072613, 0.0018182584317401052, -0.020770015195012093, -0.06039080023765564, 0.014441951178014278, -0.034810759127140045, -0.0021306434646248817, 0.035660311579704285, -0.014317619614303112, 0.026424963027238846, 0.026685867458581924, -0.06099981442093849, -0.025697223842144012, -0.01604749821126461, 0.004259014967828989, -0.015074599534273148, -0.03558897599577904, -0.012895303778350353, -0.0522049181163311, 0.010641484521329403, -0.05333803594112396, 0.05338877812027931, 0.045596394687891006, 0.037375692278146744, -0.0230831578373909, -0.04242418706417084, 0.0048912642523646355, 0.06286980956792831, 0.033297933638095856, 0.035451214760541916, 0.02017873525619507, -0.010307875461876392, -0.01969749666750431, 0.020346486940979958, 0.01786397024989128, -0.03227273002266884, 0.03437923267483711, -0.035726968199014664, 0.03871798887848854, 0.020528391003608704, -0.0365460179746151, -0.00847143866121769, 0.026099249720573425, -0.005818614736199379, -0.008838929235935211, 0.020452750846743584, 0.01451932080090046, 0.03289070725440979, -0.04141784831881523, -0.0026210832875221968, 0.030692843720316887, 0.017420578747987747, -0.026617305353283882, 0.010679244063794613, -0.02399742230772972, 0.05516347661614418, -0.0075065637938678265, -0.05959266796708107, -0.01442006602883339, -0.01931767538189888, -0.011188511736690998, -0.014640958979725838, 0.03432329371571541, 0.01361987367272377, 0.012806370854377747, 0.017842605710029602, 0.010992019437253475, 0.036434151232242584, 0.04265829548239708, 0.019055213779211044, 0.016981298103928566, -0.04036923497915268 ]
Accelerating Stable Diffusion XL Inference with JAX on Cloud TPU v5e
pcuenq
October 3, 2023
sdxl_jax
sdxl, jax, stable diffusion, guide, tpu, google
https://huggingface.co/blog/sdxl_jax
# Accelerating Stable Diffusion XL Inference with JAX on Cloud TPU v5e Generative AI models, such as Stable Diffusion XL (SDXL), enable the creation of high-quality, realistic content with wide-ranging applications. However, harnessing the power of such models presents significant challenges and computational costs. SDXL is a large image generation model whose UNet component is about three times as large as the one in the previous version of the model. Deploying a model like this in production is challenging due to the increased memory requirements, as well as increased inference times. Today, we are thrilled to announce that Hugging Face Diffusers now supports serving SDXL using JAX on Cloud TPUs, enabling high-performance, cost-efficient inference. Google Cloud TPUs are custom-designed AI accelerators, which are optimized for training and inference of large AI models, including state-of-the-art LLMs and generative AI models such as SDXL. The new Cloud TPU v5e is purpose-built to bring the cost-efficiency and performance required for large-scale AI training and inference. At less than half the cost of TPU v4, TPU v5e makes it possible for more organizations to train and deploy AI models. ๐Ÿงจ Diffusers JAX integration offers a convenient way to run SDXL on TPU via XLA, and we built a demo to showcase it. You can try it out in this Space or in the playground embedded below: Under the hood, this demo runs on several TPU v5e-4 instances (each instance has 4 TPU chips) and takes advantage of parallelization to serve four large 1024ร—1024 images in about 4 seconds. This time includes format conversions, communications time, and frontend processing; the actual generation time is about 2.3s, as we'll see below! In this blog post, 1. We describe why JAX + TPU + Diffusers is a powerful framework to run SDXL 2. Explain how you can write a simple image generation pipeline with Diffusers and JAX 3. Show benchmarks comparing different TPU settings
[ -0.008564509451389313, 0.016351398080587387, 0.028042953461408615, 0.03571397066116333, 0.03436461091041565, 0.014144486747682095, -0.02026444301009178, -0.0007870403351262212, 0.042074140161275864, -0.08169766515493393, -0.0067002614960074425, -0.02701379917562008, -0.041661035269498825, 0.03169125318527222, 0.007184175308793783, -0.11300835013389587, -0.009892050176858902, 0.004821126349270344, -0.015796901658177376, 0.025529492646455765, 0.024840576574206352, -0.008430883288383484, -0.05038721486926079, -0.02636331133544445, -0.048082537949085236, -0.034187138080596924, -0.026863662526011467, -0.002892668591812253, 0.0715545117855072, -0.048973940312862396, -0.020618697628378868, 0.0231772530823946, -0.01942945085465908, -0.006305152550339699, 0.04109139367938042, -0.033206596970558167, -0.0866684690117836, 0.017165014520287514, 0.03137998655438423, 0.02305535413324833, 0.024201473221182823, 0.0004815453721676022, -0.0474843792617321, 0.06561338901519775, 0.0353894978761673, -0.028524888679385185, -0.09200075268745422, 0.020810483023524284, -0.09009116142988205, 0.06258415430784225, -0.06204322353005409, 0.003331475192680955, 0.006577135995030403, -0.02303406037390232, 0.05732319876551628, 0.07150132954120636, 0.0134491678327322, -0.06363316625356674, 0.06892668455839157, -0.022520968690514565, 0.019873332232236862, -0.05837441235780716, 0.0035953109618276358, 0.005590916145592928, 0.06921610981225967, -0.039339855313301086, -0.0042471615597605705, -0.002660953439772129, -0.05997854098677635, -0.05494624748826027, 0.006548620760440826, 0.044825952500104904, -0.006801473908126354, 0.07939491420984268, 0.027389967814087868, 0.006677595898509026, -0.039962079375982285, 0.04449930787086487, 0.05904650688171387, 0.03305651992559433, -0.08514699339866638, 0.01901925541460514, 0.03040141426026821, -0.020347757264971733, 0.0029376090969890356, 0.013521618209779263, 0.04091457650065422, -0.04214506968855858, -0.07248394191265106, -0.014651003293693066, 0.04870736598968506, -0.0768350139260292, -0.008085615001618862, 0.002818358363583684, -0.01898636296391487, 0.035326216369867325, -0.0031124975066632032, 0.0008849955629557371, 0.06196095421910286, -0.022801412269473076, -0.02947397716343403, -0.01103135384619236, -0.017776377499103546, -0.08838654309511185, -0.07352395355701447, 0.040173355489969254, -0.06929997354745865, -0.1278228759765625, 0.008252476342022419, 0.01422762032598257, 0.025030093267560005, 0.043519847095012665, -0.03177371993660927, 0.039314426481723785, -0.10476980358362198, 0.07098641991615295, -0.022290537133812904, 0.028094463050365448, 0.03608999401330948, 0.0359024815261364, -0.039580486714839935, 0.08909384161233902, 0.0778697207570076, -0.07144537568092346, -0.049201853573322296, 0.09481389075517654, -0.01069565862417221, 0.02035028487443924, -0.03513985127210617, -0.017389563843607903, 0.016252348199486732, -0.06792635470628738, 0.06668034940958023, -0.030294422060251236, 0.07284986972808838, -0.05775082856416702, -0.03303547948598862, -0.05905089154839516, 0.02451634407043457, 0.028820473700761795, -0.022450001910328865, 0.06791692972183228, 0.03669314458966255, -0.041078370064496994, 0.00258648325689137, -0.0027320568915456533, -0.004686353262513876, -0.010628771968185902, -0.0557204931974411, -0.007644342724233866, -0.08184297382831573, 0.06253168731927872, -0.06435850262641907, -0.023884939029812813, 0.03914344310760498, 0.09660010039806366, 0.023757895454764366, -0.03587944805622101, -0.03443336859345436, 0.002632697345688939, -0.039156053215265274, -0.03482181578874588, -0.041920971125364304, -0.0008635679841972888, 0.002236315282061696, 0.009308247826993465, 0.04237804561853409, 0.023553619161248207, 0.015914371237158775, -0.018582334741950035, 0.034633561968803406, 0.03276742622256279, 0.053442779928445816, 0.024678349494934082, 0.008630266413092613, -0.0039526415057480335, 0.043463483452796936, 0.08926627039909363, -0.0003062467440031469, -0.056720975786447525, -0.06894677877426147, 0.06834480166435242, 0.029476484283804893, 0.0606960728764534, 0.05714120715856552, -0.12568649649620056, 0.09232965111732483, -0.015153461135923862, -0.008982284925878048, -0.02616230957210064, -0.008523105643689632, 0.035354260355234146, 0.08982694894075394, 0.017140109091997147, -0.015675388276576996, -0.027098819613456726, -0.03449356555938721, 0.04345528408885002, 0.0020452337339520454, 0.012187710031867027, 0.013927735388278961, -0.005531239788979292, 0.023985624313354492, -0.0146997245028615, -0.05620751157402992, -0.04715791717171669, 0.05126165971159935, -0.013559706509113312, -0.002687757136300206, 0.021232301369309425, -0.028691232204437256, -0.15328320860862732, -0.037604399025440216, -0.012969194911420345, -0.08294224739074707, -0.05805213004350662, 0.03358875960111618, -0.06542085856199265, 0.018959369510412216, -0.06884238123893738, 0.09789104759693146, -0.04433775320649147, -0.04822676628828049, 0.023345978930592537, -0.032838981598615646, 0.006724254228174686, 0.05994947999715805, -0.04937710985541344, 0.009893488138914108, -0.04309486597776413, -0.07029784470796585, -0.07018221169710159, -0.04192383587360382, -0.06539794057607651, 0.05752452462911606, 0.016550609841942787, 0.06269988417625427, -0.0668627917766571, -0.003022722667083144, -0.030154190957546234, 0.03760327398777008, 0.010117929428815842, -0.03106633760035038, 0.015391259454190731, 0.03943367302417755, -0.011703984811902046, 0.021274585276842117, 0.06292739510536194, -0.05658719688653946, 0.0027566319331526756, -0.08236893266439438, 0.019709492102265358, -0.04867291450500488, -0.05313464254140854, 0.005219433456659317, 0.016584325581789017, -0.011646631173789501, 0.003052136627957225, -0.03386811912059784, 0.04901726171374321, -0.017512666061520576, 0.007230864837765694, -0.013887581415474415, -0.019174251705408096, 0.03851507231593132, -0.04097680374979973, 0.010902080684900284, -0.024175697937607765, -0.004129498731344938, 0.029015030711889267, 0.03300252929329872, -0.014663287438452244, -0.019020654261112213, -0.014708937145769596, -0.008789418265223503, -0.006297105457633734, 0.014186881482601166, -0.017821982502937317, -0.005014205817133188, -0.04049040377140045, 0.03112824447453022, 0.016676776111125946, 0.048143986612558365, 0.012178481556475163, -0.012910068035125732, -0.019731780514121056, 0.021573591977357864, -0.03819606080651283, -0.06382443010807037, -0.004662099294364452, 0.027344772592186928, 0.018646348267793655, 0.0022676417138427496, -0.010536386631429195, 0.010770989581942558, -0.014266117475926876, -0.004674367140978575, -0.07985088229179382, -0.019285958260297775, 0.03315688297152519, 0.01232151873409748, -0.056896984577178955, 0.003652445273473859, 0.005012582987546921, 0.005401735194027424, 0.02045236900448799, -0.024430233985185623, 0.022553352639079094, -0.06973602622747421, -0.011758169159293175, -0.04672233387827873, 0.01604451797902584, 0.004436366725713015, -0.005950302816927433, 0.04929028078913689, -0.051218803972005844, -0.00040875081322155893, 0.04405070096254349, 0.04039919376373291, 0.06868214905261993, -0.005274197086691856, -0.03272170573472977, 0.03102400340139866, -0.016980625689029694, 0.015225172974169254, -0.01856783591210842, 0.04219407960772514, -0.009136596694588661, -0.08441946655511856, -0.004523030947893858, 0.0016985880210995674, -0.032962847501039505, 0.022883282974362373, 0.019271982833743095, 0.008591307327151299, -0.053480010479688644, 0.01928679086267948, -0.016077082604169846, -0.02800477296113968, -0.026247538626194, 0.011339029297232628, 0.05116733908653259, -0.06634093821048737, 0.022085115313529968, -0.0019180449889972806, 0.05455166473984718, 0.049914564937353134, 0.021234111860394478, 0.06202225759625435, -0.006406017579138279, 0.03974520042538643, 0.025406192988157272, 0.029644306749105453, 0.031332504004240036, 0.057774558663368225, -0.0023361665662378073, -0.002525770803913474, 0.005216467659920454, -0.003511087503284216, 0.05473348870873451, -0.004901469219475985, 0.005149326752871275, 0.018837057054042816, 0.044874925166368484, -0.026392484083771706, -0.011675246059894562, 0.003665267489850521, -0.02690173126757145, -0.033441755920648575, 0.010028745047748089, 0.014225670136511326, 0.009990212507545948, 0.011552487500011921, 0.035512372851371765, 0.0367143414914608, -0.03997084125876427, -0.029251351952552795, 0.05694063752889633, 0.0055112531408667564, 0.05279459431767464, 0.026019908487796783, 0.007954743690788746, -0.018176820129156113, -0.02117064595222473, -0.012719983235001564, -0.020131567493081093, 0.00884435884654522, 0.024702029302716255, -0.046324700117111206, 0.006916215177625418, -0.04672577977180481, 0.006056450307369232, 0.0241962019354105, 0.02918332628905773, -0.00032591877970844507, -0.0030203768983483315, 0.02449781261384487, 0.036210253834724426, -0.0007116784690879285, 0.004481851123273373, -0.014080564491450787, -0.010886766947805882, 0.020290067419409752, -0.03734515607357025, 0.02778397686779499, 0.026039041578769684, -0.008225839585065842, -0.0005904482677578926, 0.027524331584572792, -0.013694927096366882, 0.005896841641515493, 0.018677303567528725, -0.04019441083073616, -0.013161907903850079, -0.00022129868739284575, 0.019820252433419228, 0.018285565078258514, 0.036432765424251556, 0.020109061151742935, -0.011324191465973854, -0.009140788577497005, -0.007143127266317606, -0.007944448851048946, 0.03746257349848747, 0.0031170507427304983, 0.007442043628543615, -0.016584349796175957, 0.0019458536989986897, -0.014698142185807228, 0.04276688024401665, 0.005473783239722252, -0.04085509851574898, 0.011626447550952435, 0.0685327798128128, -0.04679388925433159, 0.024207521229982376, 0.002095984760671854, 0.009265751577913761, -0.04796067252755165, -0.02925770729780197, 0.08376475423574448, 0.020388182252645493, -0.02630828320980072, -0.03991428390145302, -0.03393135219812393, -0.006509356200695038, -0.02546374872326851, -0.006017555017024279, 0.007191373500972986, 0.03943026438355446, 0.024235254153609276, -0.009702689945697784, 0.014979882165789604, 0.01110408827662468, -0.01373488549143076, -0.015431821346282959, -0.041252393275499344, -0.029854638502001762, 0.05547303706407547, -0.029223334044218063, -0.050808049738407135, -0.03135516867041588, 0.0377664640545845, -0.008039910346269608, -0.004885562229901552, -0.029086699709296227, 0.032798394560813904, 0.02383749559521675, -0.026689346879720688, 0.05468856170773506, -0.015176251530647278, 0.014416439458727837, 0.014916750602424145, 0.033839114010334015, -0.001083963317796588, -0.018153825774788857, -0.04242515563964844, -0.016336336731910706, -0.02971111796796322, 0.01247697975486517, 0.03329320624470711, -0.006267435383051634, -0.005883267614990473, 0.036999378353357315, 0.03275332227349281, 0.007962004281580448, -0.018724555149674416, 0.019448962062597275, -0.07302311807870865, -0.01279523503035307, 0.0031510679982602596, -0.03583390638232231, 0.041003692895174026, 0.0009012369555421174, 0.03873620554804802, 0.012544939294457436, 0.029524177312850952, 0.02486020140349865, -0.024837149307131767, 0.009154144674539566, -0.03411870449781418, 0.015809467062354088, 0.017267024144530296, -0.03724042326211929, 0.015599614940583706, 0.05444730445742607, -0.008891621604561806, -0.005665887612849474, -0.00521071208640933, 0.010757089592516422, -0.029627902433276176, -0.035726163536310196, -0.001684937858954072, 0.02746887132525444, -0.004218520596623421, 0.0017954491777345538, 0.02203565277159214, -0.032616980373859406, -0.0025459211319684982, -0.005718564614653587, -0.01714281365275383, -0.0010969344293698668, 0.00387966213747859, -0.03324079513549805, -0.00011357347102602944, 0.05071331560611725, 0.016171542927622795, -0.007541490253061056, -0.011972986161708832, -0.010531540028750896, -0.0018683811649680138, -0.04799627512693405, 0.017950911074876785, -0.03723180294036865, -0.005566404201090336, -0.030564505606889725, -0.021303633227944374, 0.01094972062855959, 0.015830758959054947, 0.04621056467294693, -0.03109077922999859, 0.024052267894148827, 0.035899702459573746, 0.013050559908151627, 0.009577916003763676, 0.029529117047786713, 0.050422437489032745, 0.018442820757627487, 0.0018287013517692685, 0.0066794343292713165, -0.030955806374549866, 0.006016272120177746, -0.05618986859917641, 0.07115600258111954, -0.018774546682834625, -0.029675070196390152, -0.029939638450741768, -0.003223155392333865, 0.027958735823631287, -0.025981003418564796, -0.003934443462640047, -0.02742520347237587, 0.025415439158678055, 0.05041129142045975, 0.03807207569479942, -0.014183234423398972, 0.03640447184443474, -0.020449969917535782, -0.023488780483603477, -0.03209427744150162, 0.06787752360105515, 0.01674748584628105, -0.007682335563004017, 0.023281609639525414, -0.007303124759346247, -0.03142154589295387, 0.028029821813106537, 0.017424006015062332, -0.00913984701037407, -0.041752446442842484, 0.0038715137634426355, -0.02643098309636116, -0.00791964028030634, 0.0251297689974308, -0.011784297414124012, 0.049148861318826675, -0.008960033766925335, 0.009416786022484303, 0.050851430743932724, 0.050397325307130814, 0.05343746393918991, -0.024434026330709457, 0.01683891750872135, 0.023399008437991142, 0.04345451295375824, 0.01679275929927826, 0.03238648176193237, 0.03289097547531128, 0.002196568762883544, -0.017309434711933136, 0.010740803554654121, -0.01210600882768631, -0.07999467849731445, 0.01680506393313408, 0.007865832187235355, 0.013339295983314514, -0.019144117832183838, -0.027642562985420227, 0.045100558549165726, 0.05061449110507965, 0.08973001688718796, 0.021780412644147873, 0.012866280041635036, -0.007156878709793091, 0.024848096072673798, 0.025941021740436554, -0.018893759697675705, 0.008168386295437813, 0.05390484258532524, 0.002635054290294647, 0.01344188954681158, 0.03620348125696182, 0.03468155115842819, 0.05347849428653717, 0.002086888300254941, 0.014257208444178104, -0.03125063702464104, 0.001006829203106463, -0.014436488971114159, 0.012334056198596954, -0.016939260065555573, -0.019113510847091675, -0.023952359333634377, -0.006201071664690971, 0.0177279282361269, 0.0004470809071790427, 0.002522871596738696, 0.03754593804478645, 0.020404811948537827, -0.00770306633785367, 0.011754384264349937, -0.029421312734484673, 0.013323578052222729, -0.011229239404201508, 0.06456968933343887, 0.04031920060515404, -0.02287030965089798, -0.03344164043664932, 0.0024698427878320217, 0.03537147119641304, 0.008525765500962734, 0.030068231746554375, -0.022816555574536324, -0.019350752234458923, 0.005603922996670008, -0.0064062015153467655, 0.0603884682059288, 0.0483393631875515, 0.037671905010938644, 0.03822411224246025, -0.015052414499223232, 0.024155719205737114, -0.00130942661780864, -0.06615598499774933, -0.01924949884414673, -0.010875995270907879, 0.004318718798458576, 0.034121494740247726, 0.03618980199098587, 0.031222958117723465, 0.050331369042396545, -0.00204256409779191, -0.037555523216724396, 0.017112653702497482, 0.00860561802983284, 0.02397143840789795, -0.0020505888387560844, 0.03362525254487991, -0.03676244989037514, -0.016704825684428215, -0.002407483756542206, 0.04469310864806175, -0.0025941021740436554, 0.020766671746969223, 0.045704808086156845, -0.018202444538474083, -0.029433678835630417, -0.015579435043036938, 0.012045667506754398, 0.006796039175242186, 0.024754732847213745, 0.02950902096927166, -0.005023974925279617, -0.028314972296357155, -0.020346518605947495, -0.0040892139077186584, -0.01735493540763855, 0.009561913087964058, -0.04275934025645256, -0.032569874078035355, 0.003589663188904524, 0.0037186485715210438, -0.01610780693590641, 0.041320402175188065, -0.017796333879232407, -0.01385282352566719, -0.020681757479906082, -0.026138799265027046, -0.043305084109306335, -0.009398194961249828, 0.04747510328888893, -0.01696377992630005, -0.011606734246015549, 0.005666567012667656, -0.06428748369216919, -0.017530297860503197, -0.04046882688999176, 0.041337333619594574, 0.046634066849946976, 0.022771097719669342, -0.036778774112463, -0.03672102093696594, -0.009253548458218575, 0.059036873281002045, -0.025554819032549858, 0.04915512725710869, 0.04354048892855644, -0.03887351602315903, -0.05487119406461716, 0.03615614399313927, 0.02170463837683201, 0.00652668671682477, 0.05557866394519806, -0.016746705397963524, 0.00955942366272211, 0.030177850276231766, -0.012334882281720638, -0.04556409269571304, -0.002215471351519227, 0.014165666885674, 0.043278083205223083, 0.04159613698720932, -0.027138246223330498, 0.029427288100123405, -0.03559444844722748, 0.007050768006592989, 0.012957504019141197, 0.015288873575627804, -0.02724176086485386, 0.0007066624239087105, -0.0093318410217762, 0.018873626366257668, -0.002455776557326317, -0.006427333690226078, -0.014740698970854282, 0.01168945711106062, 0.004507186822593212, -0.03553067892789841, 0.03021436184644699, 0.0013140785740688443, -0.009864455088973045, 0.015397687442600727, -0.009574932046234608, 0.03525597229599953, 0.07156657427549362, -0.00472820270806551, -0.013035427778959274, -0.04944523796439171 ]
Accelerating Stable Diffusion XL Inference with JAX on Cloud TPU v5e
pcuenq
October 3, 2023
sdxl_jax
sdxl, jax, stable diffusion, guide, tpu, google
https://huggingface.co/blog/sdxl_jax
JIT compilation A notable feature of JAX is its just-in-time (jit) compilation. The JIT compiler traces code during the first run and generates highly optimized TPU binaries that are re-used in subsequent calls. The catch of this process is that it requires all input, intermediate, and output shapes to be static, meaning that they must be known in advance. Every time we change the shapes a new and costly compilation process will be triggered again. JIT compilation is ideal for services that can be designed around static shapes: compilation runs once, and then we take advantage of super-fast inference times. Image generation is well-suited for JIT compilation. If we always generate the same number of images and they have the same size, then the output shapes are constant and known in advance. The text inputs are also constant: by design, Stable Diffusion and SDXL use fixed-shape embedding vectors (with padding) to represent the prompts typed by the user. Therefore, we can write JAX code that relies on fixed shapes, and that can be greatly optimized!
[ 0.07685544341802597, -0.00958758220076561, -0.02070007286965847, 0.0028524170629680157, 0.021600501611828804, 0.008389980532228947, 0.02609543316066265, 0.016439486294984818, -0.031016584485769272, -0.06975758820772171, -0.04628301411867142, -0.043558623641729355, -0.024536777287721634, 0.01936662197113037, -0.040168095380067825, -0.0014310694532468915, 0.09447146952152252, 0.011609367094933987, -0.0203213132917881, 0.007711492478847504, -0.028864610940217972, 0.004796649795025587, -0.039989173412323, -0.07609087973833084, -0.016688913106918335, -0.02645888179540634, -0.02828877791762352, -0.05434548109769821, -0.020930742844939232, -0.015450256876647472, -0.023148613050580025, -0.008349851705133915, -0.01228656992316246, -0.022448882460594177, -0.07127505540847778, -0.04598025232553482, -0.07236132770776749, 0.06790487468242645, 0.024874264374375343, -0.022123603150248528, -0.010774660855531693, -0.02604239620268345, -0.01580515317618847, 0.004578637424856424, 0.03656713664531708, -0.009723437950015068, -0.16028794646263123, 0.04485849663615227, -0.03632188215851784, 0.002841695211827755, -0.061714187264442444, 0.046798765659332275, -0.03981805592775345, 0.05038371682167053, -0.023866593837738037, 0.06932339072227478, 0.040540698915719986, -0.013126559555530548, 0.011829760856926441, -0.07300946116447449, 0.004179157316684723, -0.034479983150959015, 0.042807042598724365, -0.007596863433718681, 0.017192233353853226, -0.0024900895077735186, -0.009015927091240883, -0.027789831161499023, -0.0794597789645195, -0.0791376456618309, 0.0061372728087008, 0.021478671580553055, 0.010314755141735077, 0.0853523388504982, 0.03634205460548401, 0.03980948030948639, -0.05927059054374695, 0.05524451658129692, 0.03345055505633354, 0.0471310093998909, 0.051619336009025574, 0.04339881241321564, 0.06268797069787979, 0.03944826498627663, 0.02492823451757431, -0.005513906013220549, 0.04950525984168053, -0.03361537307500839, -0.11486872285604477, -0.017070043832063675, 0.08252663165330887, -0.11246857792139053, -0.05784737691283226, 0.0002503509458620101, -0.052088260650634766, 0.021258888766169548, -0.009977122768759727, 0.042341895401477814, 0.06686846911907196, 0.022894181311130524, -0.024620437994599342, 0.002651300048455596, -0.027550488710403442, -0.0684267058968544, -0.0931198000907898, 0.061342447996139526, -0.05254965275526047, -0.12312807887792587, -0.0031408395152539015, 0.03128412365913391, 0.0019381593447178602, 0.0506778210401535, 0.06497884541749954, 0.035257499665021896, -0.09292512387037277, 0.04971734434366226, 0.024924062192440033, 0.01921890676021576, -0.025151537731289864, -0.014723400585353374, -0.03663796931505203, 0.08855897188186646, 0.06756488978862762, -0.05432397499680519, -0.025298485532402992, 0.031670164316892624, 0.046415042132139206, 0.037459392100572586, 0.02858789637684822, -0.07779471576213837, -0.009638510644435883, -0.00533112371340394, 0.004022916313260794, -0.029019758105278015, 0.0726957768201828, -0.0356457494199276, 0.011753875762224197, -0.005215582903474569, -0.05381006374955177, 0.02190563641488552, -0.0405409149825573, 0.06481380760669708, -0.007805978879332542, -0.01794721744954586, -0.05844845622777939, -0.01701604202389717, 0.008233469910919666, -0.021125810220837593, -0.02429220825433731, -0.017197569832205772, 0.036103714257478714, 0.06684615463018417, -0.026657773181796074, 0.004209183156490326, -0.046894621104002, 0.09459530562162399, 0.07193455845117569, -0.0020347198005765676, -0.10690506547689438, -0.048403050750494, -0.06327013671398163, 0.04995066672563553, -0.011163377203047276, -0.006580994464457035, 0.015096002258360386, -0.05294293537735939, 0.01774410530924797, -0.014603140763938427, 0.10565800219774246, 0.007289665285497904, 0.03937926143407822, -0.0333377905189991, 0.03435676544904709, -0.05153854936361313, -0.014242276549339294, -0.030648905783891678, 0.034422967582941055, 0.08257929235696793, -0.006159744691103697, -0.014219813980162144, -0.034695103764534, 0.017437467351555824, 0.05728845298290253, 0.09375419467687607, 0.04847314953804016, -0.1299143135547638, 0.041192132979631424, -0.029854362830519676, -0.07574978470802307, -0.05736682564020157, -0.00990302860736847, 0.026140723377466202, 0.0753035843372345, -0.010731101967394352, 0.0034697384107857943, -0.05082784220576286, -0.08170568197965622, 0.09849680960178375, 0.016273539513349533, 0.048876307904720306, 0.015827223658561707, -0.008613476529717445, -0.02662562020123005, -0.014612004160881042, -0.0032942425459623337, -0.016566583886742592, 0.04336220398545265, 0.02725411020219326, -0.006870733108371496, -0.03922578692436218, -0.03373592346906662, -0.040653977543115616, -0.024359704926609993, -0.01744796894490719, -0.048380326479673386, -0.0674225389957428, 0.04706553369760513, 0.009582921862602234, -0.02076895162463188, -0.067682184278965, 0.11738462001085281, -0.06854695081710815, -0.02806980162858963, 0.01609857566654682, 0.02158515527844429, -0.02553965523838997, 0.020910630002617836, -0.03426444157958031, 0.037238962948322296, -0.06222129613161087, -0.029237044975161552, -0.043298471719026566, -0.07817009836435318, -0.04540757089853287, 0.053207166492938995, 0.04977230355143547, 0.08776398748159409, -0.08489128202199936, 0.02710540220141411, -0.035354726016521454, 0.06130559369921684, 0.00147408084012568, 0.008561422117054462, -0.014385798946022987, 0.06896897405385971, -0.017840813845396042, 0.003094871761277318, -0.05990388244390488, -0.027685021981596947, 0.0012871073558926582, -0.07079999893903732, 0.003088492900133133, 0.0499567873775959, -0.08201394975185394, 0.05075396969914436, -0.03111739084124565, 0.002897541970014572, -0.014827963896095753, -0.019322630017995834, 0.008454938419163227, -0.02340184710919857, -0.014456714503467083, -0.013092951849102974, -0.017744071781635284, -0.021897166967391968, -0.03652240335941315, 0.008947232738137245, 0.008334786631166935, 0.015186814591288567, 0.028261549770832062, 0.03469402343034744, -0.012529488652944565, -0.04585226625204086, -0.031657684594392776, -0.001712702913209796, -0.017154548317193985, -0.023104729130864143, -0.004798658192157745, -0.0016112779267132282, 0.004139327444136143, 0.018786616623401642, -0.016550982370972633, 0.02548229694366455, 0.011115788482129574, 0.01321455929428339, 0.016392674297094345, 0.05583366006612778, -0.020530181005597115, -0.08840784430503845, 0.01893291063606739, -0.03256169334053993, 0.033583302050828934, -0.00156446045730263, 0.012510167434811592, 0.027346134185791016, 0.03156768158078194, 0.02915090136229992, -0.01668420433998108, -0.03234216570854187, -0.00831726286560297, -0.002876108745113015, 0.0008817577036097646, 0.018455933779478073, -0.0034655604977160692, 0.010476800613105297, -0.006577317137271166, -0.0077615296468138695, 0.028933534398674965, -0.09215174615383148, -0.06617129594087601, 0.036443956196308136, 0.0000863309542182833, 0.0009730558376759291, -0.003274897811934352, 0.03991401940584183, -0.041914165019989014, 0.012016650289297104, 0.03236854821443558, 0.03747018054127693, 0.04814179614186287, -0.016466669738292694, 0.010684381239116192, 0.014831709675490856, 0.000861041247844696, 0.009315630421042442, 0.046619560569524765, 0.02286095917224884, 0.042203206568956375, -0.04373694956302643, -0.013840042985975742, 0.012864676304161549, -0.029769092798233032, -0.038317084312438965, 0.02084943652153015, 0.011317542754113674, -0.0007263262523338199, 0.006131760310381651, 0.023466382175683975, -0.012370623648166656, -0.01550772413611412, 0.016300365328788757, 0.03341973200440407, -0.051631052047014236, 0.009956110268831253, 0.01794731803238392, 0.032878030091524124, -0.007711291778832674, 0.0007962941890582442, 0.01926569454371929, -0.0269854087382555, -0.007853349670767784, 0.006117512471973896, 0.023709211498498917, 0.013241142965853214, 0.04009615257382393, -0.01845565252006054, -0.0022296602837741375, -0.0005756919272243977, -0.020383981987833977, -0.00687077222391963, 0.0004277496482245624, 0.010845998302102089, -0.004346039611846209, -0.017471550032496452, -0.052433136850595474, -0.031139595434069633, -0.0004332992830313742, -0.04510373994708061, -0.027712274342775345, -0.035243865102529526, -0.0028485460206866264, -0.029411276802420616, -0.004793121945112944, 0.008481020107865334, -0.023728497326374054, 0.010011325590312481, -0.030508674681186676, 0.05516275390982628, 0.04486843943595886, 0.0308226328343153, 0.02318952977657318, 0.0011181458830833435, 0.009442380629479885, 0.052976109087467194, -0.03526229038834572, 0.019730156287550926, 0.03733239695429802, 0.006372997537255287, 0.0034051304683089256, -0.02788950316607952, 0.009207505732774734, 0.013989945873618126, 0.0010530862491577864, 0.016336575150489807, 0.04442001134157181, 0.026324037462472916, -0.019195279106497765, -0.00442504184320569, 0.037425778806209564, 0.04026221111416817, 0.005404595285654068, -0.03509495034813881, -0.009691877290606499, -0.004628842230886221, 0.02949463576078415, 0.004628684371709824, -0.0006525481585413218, -0.02149396948516369, 0.03678440675139427, -0.05454730987548828, 0.013418400660157204, 0.01799820177257061, -0.00577215850353241, -0.03301091864705086, -0.01625422015786171, 0.011650500819087029, 0.03440311923623085, 0.04728403314948082, 0.027955621480941772, -0.04477580636739731, -0.012200819328427315, 0.015794802457094193, 0.01906047761440277, -0.014236871153116226, -0.0017618938582018018, 0.003551777917891741, 0.009329325519502163, 0.013606498017907143, 0.0066970884799957275, 0.044091299176216125, -0.004177018068730831, -0.01245232205837965, 0.011017708107829094, -0.02197881042957306, -0.025270976126194, 0.032841235399246216, -0.006007305346429348, 0.0012660454958677292, 0.027953865006566048, 0.025734305381774902, 0.04416736960411072, 0.031587038189172745, -0.017583418637514114, -0.027976544573903084, 0.0050642467103898525, -0.00792357511818409, 0.010590240359306335, -0.0522460900247097, -0.027203453704714775, -0.0018245209939777851, 0.027662120759487152, -0.018827712163329124, 0.0011883698171004653, 0.008103638887405396, -0.03363088145852089, 0.030448053032159805, -0.025019807741045952, -0.0052240458317101, 0.058645591139793396, -0.05043322220444679, -0.05528780817985535, 0.0052410028874874115, 0.004615827929228544, -0.032424796372652054, 0.0028551085852086544, -0.03878084197640419, 0.03880869969725609, 0.04087669402360916, -0.016123604029417038, 0.053513653576374054, -0.013736824505031109, -0.00806066207587719, 0.034967001527547836, -0.01687905751168728, 0.03497947007417679, -0.020202860236167908, -0.002160414820536971, -0.050954606384038925, -0.04466935247182846, 0.011863895691931248, 0.023779109120368958, -0.023792985826730728, -0.004876734688878059, -0.02260391041636467, 0.009986583143472672, 0.025740761309862137, -0.005912875756621361, 0.004397975746542215, -0.016907231882214546, -0.00162880914285779, 0.043660569936037064, -0.037933629006147385, 0.03014872409403324, 0.0003139792534057051, 0.023037390783429146, 0.03791280835866928, 0.003114498220384121, 0.02431795559823513, 0.005409291014075279, -0.017154594883322716, 0.024674853309988976, 0.002545125549659133, 0.019975459203124046, -0.04116741940379143, 0.003660129616037011, 0.024281037971377373, 0.03603013604879379, -0.031170837581157684, 0.005641171243041754, -0.00442841649055481, -0.02922215312719345, -0.015138842165470123, -0.02012859657406807, 0.05016759783029556, -0.006568633019924164, -0.03994587063789368, 0.020061371847987175, -0.006627944298088551, -0.006309461779892445, -0.021581077948212624, -0.014225929044187069, 0.012500992976129055, -0.01692391373217106, -0.04781484603881836, -0.017881590873003006, -0.005644521676003933, 0.03985094651579857, -0.037141889333724976, -0.010904772207140923, -0.022672642022371292, -0.03465717285871506, 0.002095552859827876, 0.027429919689893723, 0.021358704194426537, -0.010008440352976322, -0.033693764358758926, -0.004631823394447565, 0.03164663538336754, 0.018996361643075943, 0.03289806470274925, -0.019824283197522163, 0.00303610204719007, 0.025227604433894157, -0.016323065385222435, -0.025192007422447205, 0.04495955631136894, 0.02429613284766674, -0.039822258055210114, -0.015225041657686234, 0.021707262843847275, -0.045169711112976074, -0.022711822763085365, -0.008669930510222912, 0.05500296130776405, 0.014249663800001144, -0.05796128138899803, -0.02546331100165844, 0.030421437695622444, -0.008516484871506691, -0.023919841274619102, 0.011758353561162949, -0.024715783074498177, -0.02250632643699646, 0.047647710889577866, 0.04086628556251526, -0.0033360375091433525, 0.010905458591878414, -0.056313008069992065, -0.01062976848334074, -0.03394373133778572, 0.011944087222218513, 0.02708764374256134, -0.055006444454193115, 0.0048830872401595116, 0.021378716453909874, -0.006206553895026445, 0.010073833167552948, 0.012619784101843834, -0.018422065302729607, 0.0009514305857010186, 0.02216794341802597, 0.013098866678774357, -0.001245426363311708, -0.017318222671747208, -0.04508671164512634, 0.08034887164831161, 0.03736618533730507, 0.04742295295000076, 0.029036393389105797, 0.03759973496198654, 0.020894285291433334, -0.0025751313660293818, 0.005869005806744099, 0.040217768400907516, 0.01606650836765766, 0.012786920182406902, 0.03982657194137573, 0.00040157249895855784, -0.0016541420482099056, 0.006740503013134003, -0.008699568919837475, -0.023100510239601135, -0.08699119091033936, -0.000010062416549772024, -0.018404968082904816, -0.01571773551404476, -0.05324564874172211, -0.029222048819065094, 0.07505181431770325, 0.0394904688000679, 0.026135962456464767, 0.05167939513921738, 0.0045435549691319466, 0.032920897006988525, 0.045502468943595886, 0.00579911470413208, 0.006761905737221241, 0.022588282823562622, 0.0007191200857050717, 0.05459759011864662, -0.0019490099512040615, 0.03599884733557701, -0.012793346308171749, 0.047127097845077515, 0.04335670545697212, 0.031910307705402374, 0.013469154946506023, 0.013352141715586185, 0.03079160489141941, -0.03100578300654888, -0.01301883440464735, -0.007185358088463545, -0.012246026657521725, 0.031323228031396866, 0.030073033645749092, 0.01319991983473301, -0.06231667846441269, 0.021187137812376022, 0.03387998789548874, 0.01719270646572113, 0.0050375633873045444, -0.04627298563718796, 0.002587290247902274, 0.0025601014494895935, 0.04257349297404289, 0.031041979789733887, -0.033982500433921814, -0.010891171172261238, 0.03722555562853813, 0.010641754604876041, 0.02496081404387951, 0.002773906569927931, 0.021542146801948547, -0.024315742775797844, -0.010446432046592236, 0.022196633741259575, 0.011019574478268623, 0.031603679060935974, 0.01722540892660618, 0.05872028321027756, -0.059023626148700714, -0.028259368613362312, -0.009590767323970795, -0.04659848287701607, -0.020956460386514664, -0.0002651319664437324, 0.014840519055724144, 0.03426988795399666, 0.05284959450364113, 0.016057021915912628, 0.018910884857177734, -0.021439891308546066, 0.007510584779083729, 0.020960619673132896, 0.010536331683397293, 0.02657824568450451, -0.006235410925000906, 0.03426782041788101, -0.008373633958399296, 0.03269078582525253, -0.0021058390848338604, 0.033617712557315826, 0.00414801761507988, 0.030231423676013947, 0.05529563128948212, -0.023703360930085182, -0.019285837188363075, -0.010665333829820156, 0.06054215133190155, 0.0333748534321785, 0.021649084985256195, 0.0007821266772225499, 0.04793195426464081, -0.037733059376478195, -0.02516639046370983, 0.005655390210449696, -0.006049964111298323, 0.025936240330338478, -0.03959578275680542, -0.02585403062403202, 0.017397206276655197, 0.010099353268742561, 0.02600358985364437, 0.01928902231156826, -0.008347897790372372, 0.01948932744562626, 0.02185540646314621, -0.055636558681726456, -0.04981785640120506, 0.022212866693735123, 0.033141061663627625, -0.03249930590391159, 0.022772228345274925, 0.02426636964082718, -0.002148303436115384, -0.0030710946302860975, -0.03148394078016281, 0.08083764463663101, 0.07400766015052795, 0.029505552724003792, -0.023376308381557465, -0.01680854521691799, -0.014977814629673958, 0.004471276421099901, -0.007893700152635574, 0.020704176276922226, 0.013333535753190517, -0.02272159419953823, -0.008888131007552147, 0.04266495630145073, 0.05278168246150017, 0.019336361438035965, 0.02296832576394081, -0.03447335585951805, 0.044835567474365234, 0.010787563398480415, -0.010648687370121479, 0.004492301028221846, 0.014434987679123878, 0.02393709495663643, 0.024489162489771843, 0.041165802627801895, 0.025719789788126945, 0.0077679771929979324, -0.03126714751124382, -0.008199270814657211, 0.035080987960100174, 0.01826995052397251, -0.008351461961865425, -0.03185909986495972, -0.014029565267264843, 0.03155827522277832, 0.00454028882086277, -0.03174028918147087, -0.05447292700409889, 0.009261544793844223, -0.022370295599102974, 0.0016612596809864044, 0.04638652876019478, -0.015325515531003475, -0.012338929809629917, 0.02695692516863346, -0.0076042842119932175, 0.04462404176592827, 0.0819741040468216, 0.015722695738077164, 0.010021232068538666, -0.010450356639921665 ]
Accelerating Stable Diffusion XL Inference with JAX on Cloud TPU v5e
pcuenq
October 3, 2023
sdxl_jax
sdxl, jax, stable diffusion, guide, tpu, google
https://huggingface.co/blog/sdxl_jax
High-performance throughput for high batch sizes Workloads can be scaled across multiple devices using JAX's pmap, which expresses single-program multiple-data (SPMD) programs. Applying pmap to a function will compile a function with XLA, then execute it in parallel on various XLA devices. For text-to-image generation workloads this means that increasing the number of images rendered simultaneously is straightforward to implement and doesn't compromise performance. For example, running SDXL on a TPU with 8 chips will generate 8 images in the same time it takes for 1 chip to create a single image. TPU v5e instances come in multiple shapes, including 1, 4 and 8-chip shapes, all the way up to 256 chips (a full TPU v5e pod), with ultra-fast ICI links between chips. This allows you to choose the TPU shape that best suits your use case and easily take advantage of the parallelism that JAX and TPUs provide.
[ 0.0535743348300457, 0.03813967481255531, 0.008043486624956131, -0.04369546100497246, 0.0650838240981102, 0.016935981810092926, -0.026189658790826797, -0.008639347739517689, 0.03984653577208519, -0.08833899348974228, -0.002366013824939728, 0.021186653524637222, -0.005930296145379543, 0.015659548342227936, 0.028515033423900604, -0.037150874733924866, 0.013145459815859795, 0.025248553603887558, 0.034479815512895584, 0.026079688221216202, 0.029815828427672386, -0.05109751224517822, 0.0571918822824955, 0.06387094408273697, -0.07277186959981918, 0.016417859122157097, -0.01494046300649643, -0.03129712492227554, 0.054212167859077454, -0.06187991052865982, -0.003905436024069786, -0.013548986986279488, -0.025506308302283287, 0.04734770581126213, 0.008645196445286274, -0.013649704866111279, -0.035963188856840134, 0.06710124760866165, 0.021035335958003998, -0.010741174221038818, -0.02319018356502056, -0.02105404995381832, -0.0332486629486084, 0.0039289724081754684, 0.023307761177420616, 0.009568535722792149, -0.05544102564454079, 0.02686016820371151, -0.029425112530589104, 0.052781280130147934, -0.052056021988391876, 0.0429721437394619, 0.0650864839553833, -0.01410620380192995, 0.05896427482366562, 0.12847168743610382, -0.036190006881952286, -0.07704184949398041, 0.029651328921318054, 0.016831105574965477, -0.003676352323964238, -0.038555022329092026, -0.004046838264912367, -0.0003397008986212313, 0.03191768750548363, -0.02745208330452442, 0.018529798835515976, 0.001624655444175005, -0.045532479882240295, -0.039955753833055496, 0.01554447878152132, 0.05954267829656601, 0.016941150650382042, 0.05689221993088722, 0.016518307849764824, -0.057992275804281235, -0.0700908899307251, -0.05825202167034149, 0.0442943200469017, -0.002752678468823433, 0.0009441852453164756, 0.051372937858104706, 0.011357123963534832, 0.02193690463900566, -0.00872886460274458, -0.0022693120408803225, 0.04401923716068268, -0.08811511844396591, -0.04994755610823631, 0.06289394944906235, 0.0661981925368309, -0.09481030702590942, 0.01905437558889389, -0.0028940683696419, -0.01384760718792677, 0.0026834383606910706, -0.06338633596897125, 0.018016405403614044, 0.022369319573044777, 0.0229509100317955, 0.016676682978868484, 0.026360556483268738, 0.011232937686145306, -0.0073903268203139305, -0.09098701179027557, 0.05488818511366844, -0.01835557073354721, -0.12048105150461197, -0.008054868318140507, 0.013128184713423252, 0.02689363993704319, 0.03748422861099243, 0.011846417561173439, 0.03659297898411751, 0.034815799444913864, 0.006674603559076786, 0.08652125298976898, 0.047102805227041245, -0.018117515370249748, -0.05900249630212784, 0.01681431569159031, 0.10414016991853714, 0.06204960495233536, -0.07678385078907013, -0.04797902703285217, 0.00590145168825984, 0.040875595062971115, -0.014399339444935322, -0.04030583053827286, -0.024961983785033226, 0.016124451532959938, -0.0044716433621943, 0.04532259330153465, 0.0504949651658535, 0.07241875678300858, 0.004840801935642958, 0.01656171679496765, 0.07680154591798782, -0.012811195105314255, 0.02371365576982498, 0.009065557271242142, 0.050209466367959976, 0.005128741730004549, -0.040509141981601715, -0.03532961383461952, -0.008607504889369011, -0.0018495521508157253, 0.058951184153556824, -0.04099569097161293, -0.046003710478544235, -0.07103419303894043, 0.04028135538101196, -0.02529854141175747, 0.027593042701482773, 0.07063967734575272, 0.08131381869316101, 0.04191022738814354, -0.02271345630288124, -0.14096739888191223, -0.029533544555306435, -0.047952331602573395, -0.02175809070467949, 0.00939143355935812, 0.00331561709754169, -0.06820043176412582, 0.04323511943221092, 0.03327382355928421, -0.023912709206342697, 0.01987866684794426, -0.03793622553348541, -0.017993418499827385, 0.012380487285554409, -0.028119442984461784, -0.0001365213975077495, 0.04477328062057495, -0.018338751047849655, 0.05786262825131416, 0.020590273663401604, 0.008129558525979519, -0.012737127020955086, -0.030187495052814484, 0.03064378909766674, -0.0038931029848754406, 0.06821755319833755, -0.02539663575589657, -0.09508655220270157, 0.09736541658639908, 0.021542029455304146, -0.15084774792194366, 0.03023148514330387, -0.08605723828077316, -0.013681944459676743, 0.08858323842287064, -0.055462546646595, -0.011278494261205196, -0.0005345485988073051, -0.0664551705121994, 0.02274518832564354, 0.07258468866348267, 0.010865547694265842, 0.025825755670666695, 0.008454621769487858, -0.020166920498013496, 0.0026418673805892467, -0.031733158975839615, -0.08305321633815765, 0.037929803133010864, 0.03655993565917015, 0.010958974249660969, 0.015270565636456013, -0.06314240396022797, -0.10298675298690796, -0.08013053983449936, -0.05053184926509857, -0.0622376911342144, 0.006121848244220018, 0.03407760709524155, -0.0530724935233593, 0.0006908413488417864, -0.036911897361278534, 0.0903085246682167, -0.03961436450481415, -0.045744068920612335, 0.0653887614607811, 0.04356638342142105, 0.10579649358987808, 0.0075521524995565414, 0.023020796477794647, -0.03784240782260895, -0.04282647743821144, -0.015438166446983814, -0.036879315972328186, -0.09413173794746399, -0.002328355796635151, 0.05659671500325203, 0.03887953981757164, 0.02262873761355877, -0.025450527667999268, -0.00406569242477417, -0.08166729658842087, -0.02911907620728016, 0.06428705155849457, -0.05921925604343414, -0.04292953759431839, 0.05755709856748581, -0.05469340831041336, -0.00079315435141325, -0.034340567886829376, -0.015666425228118896, -0.04239552095532417, -0.07002262026071548, 0.02956768497824669, 0.02737828902900219, -0.04097164794802666, -0.00236963527277112, -0.02162327617406845, -0.002699288073927164, -0.06512913107872009, -0.03298628702759743, 0.01710154302418232, -0.017829420045018196, -0.018884653225541115, -0.0247790664434433, -0.01630610227584839, 0.00729654124006629, 0.005573534406721592, 0.025526612997055054, -0.0024535588454455137, 0.01290513388812542, -0.01866842806339264, 0.019279662519693375, -0.015999365597963333, -0.00033102132147178054, -0.03035007230937481, -0.03110443614423275, -0.013404365628957748, -0.021451011300086975, -0.005587471183389425, 0.02044268138706684, -0.025970570743083954, 0.034465041011571884, -0.05673205107450485, 0.04615284129977226, 0.0030218998435884714, -0.03577645495533943, 0.004796799272298813, 0.04490097239613533, -0.01831667311489582, -0.05607735738158226, -0.02465999498963356, -0.0008240500465035439, 0.020882444456219673, -0.08272583037614822, -0.026292258873581886, 0.009001451544463634, -0.03748834505677223, 0.003318259958177805, -0.052145909518003464, -0.031208671629428864, -0.023253777995705605, -0.01831674389541149, -0.037544943392276764, -0.009128774516284466, -0.010636640712618828, -0.009678803384304047, -0.036945804953575134, -0.03668325021862984, 0.05006072670221329, -0.06211239472031593, -0.001837861374951899, -0.03585661202669144, 0.01672361232340336, -0.03954574465751648, 0.009962509386241436, 0.016712555661797523, -0.038596488535404205, 0.019473645836114883, 0.020107530057430267, 0.03856430575251579, 0.02538153901696205, 0.02911193296313286, -0.0636841207742691, 0.03319191560149193, -0.001428329385817051, -0.028537403792142868, -0.025743363425135612, 0.05413557589054108, 0.029910510405898094, 0.01083458960056305, -0.063669852912426, 0.022434810176491737, 0.0021371289622038603, 0.005574436858296394, 0.024049989879131317, -0.009346351958811283, -0.05846523866057396, -0.006081703584641218, -0.020124543458223343, -0.02897951565682888, 0.005581514444202185, -0.006227817852050066, 0.019986342638731003, -0.013883369043469429, -0.05218330770730972, 0.03270312398672104, 0.02352708764374256, -0.03341853618621826, 0.00724937254562974, 0.053520526736974716, -0.03161998093128204, 0.028714008629322052, -0.015892617404460907, 0.011840731836855412, 0.013110385276377201, 0.03904116153717041, -0.001676826854236424, 0.03695587441325188, -0.024497395381331444, -0.005738898180425167, 0.0200897715985775, 0.019101474434137344, 0.009401650168001652, -0.011401097290217876, 0.018687771633267403, -0.02983062155544758, 0.02047671005129814, -0.0010580101516097784, -0.02330048382282257, 0.006838538683950901, -0.02688012272119522, -0.03262946382164955, 0.020471354946494102, -0.0068028150126338005, 0.053735747933387756, 0.011130237951874733, -0.03892923891544342, -0.04445938766002655, 0.07393196225166321, -0.01405871007591486, 0.015769459307193756, 0.004597399849444628, -0.0035131017211824656, 0.006797438487410545, 0.012431144714355469, -0.03450023755431175, 0.002922964282333851, 0.00232145469635725, 0.017552049830555916, 0.0036691813729703426, -0.0037460345774888992, -0.05522087216377258, -0.040543247014284134, 0.04299241676926613, 0.015247798524796963, -0.042018089443445206, 0.03799457103013992, 0.0018306903075426817, 0.028516583144664764, 0.029517479240894318, 0.0015652283327654004, 0.007770920637995005, 0.002215771935880184, -0.024105602875351906, -0.04114706069231033, 0.04034394770860672, 0.06001982465386391, -0.00016699868137948215, -0.005908690392971039, 0.019105419516563416, -0.007834317162632942, 0.0027324825059622526, 0.032692015171051025, -0.013130798004567623, -0.0020381510257720947, -0.007901561446487904, 0.00484352745115757, 0.01997520960867405, 0.02975095808506012, -0.035851772874593735, -0.033332303166389465, -0.0012627665419131517, -0.007389846723526716, 0.01043375488370657, -0.018779151141643524, 0.03792192041873932, 0.014937824569642544, 0.031594712287187576, -0.03903816640377045, 0.0022037639282643795, 0.04631108045578003, -0.004131298512220383, -0.03065941296517849, 0.026943575590848923, -0.005389762111008167, -0.013519496656954288, 0.011808231472969055, -0.0001926742697833106, -0.0033605690114200115, 0.03975905478000641, -0.006599834188818932, 0.03346871957182884, 0.02647821418941021, -0.053087104111909866, -0.03585185110569, -0.034915078431367874, -0.01571120321750641, -0.030857853591442108, -0.04210188239812851, 0.0368117094039917, 0.037026818841695786, 0.0013570821611210704, -0.0015612926799803972, 0.011401200667023659, -0.01120186410844326, -0.010670123621821404, 0.03819616883993149, -0.050258029252290726, -0.013016752898693085, 0.032179247587919235, -0.00948429200798273, -0.06320372968912125, -0.02433348447084427, 0.023275332525372505, -0.009114095941185951, 0.0403827540576458, -0.020691102370619774, -0.008945288136601448, 0.04522988945245743, -0.029305022209882736, 0.002539277309551835, -0.016293752938508987, -0.03670364245772362, 0.016382386907935143, 0.02539204992353916, -0.01931270956993103, -0.022859549149870872, -0.011435259133577347, -0.0428975448012352, -0.022243745625019073, -0.006859679240733385, -0.002559705637395382, -0.050731807947158813, 0.0028136372566223145, 0.04203597828745842, 0.0002361665538046509, 0.019461743533611298, 0.021085137501358986, 0.020947568118572235, -0.04410220682621002, 0.007216210477054119, 0.01685871183872223, -0.015315544791519642, 0.0363265797495842, 0.025672120973467827, 0.03836840018630028, -0.02217543125152588, 0.012303519994020462, 0.02661580964922905, -0.0045795803889632225, 0.00031273253262043, -0.007629069499671459, 0.008381032384932041, 0.016339346766471863, -0.019313087686896324, -0.034223709255456924, 0.025696486234664917, 0.0021101394668221474, 0.011729459278285503, -0.012054027058184147, 0.04654629901051521, 0.00037112145218998194, -0.044448528438806534, -0.028429465368390083, -0.005964911077171564, -0.04002612829208374, 0.009086742997169495, -0.05524865537881851, -0.00230847904458642, 0.008969311602413654, 0.028291434049606323, 0.01237819530069828, 0.02730986662209034, -0.03754984587430954, -0.0374072827398777, -0.01964743249118328, 0.04389793053269386, 0.014310186728835106, -0.028303874656558037, -0.005521677900105715, -0.017335761338472366, 0.018084319308400154, 0.015878919512033463, -0.008680722676217556, -0.003981270361691713, 0.00403211684897542, -0.021597448736429214, -0.006310931406915188, 0.02125496044754982, 0.03237477317452431, 0.017494136467576027, -0.03436409309506416, 0.034350212663412094, 0.06636412441730499, -0.025901852175593376, -0.004520800430327654, 0.048800915479660034, -0.006712971720844507, -0.0009789203759282827, -0.035557426512241364, -0.0030948540661484003, -0.0044928123243153095, 0.04172148182988167, -0.030017541721463203, 0.056177858263254166, 0.023512331768870354, -0.00510071124881506, -0.0116860531270504, 0.03518960252404213, 0.026885461062192917, -0.03431810438632965, -0.012609834782779217, -0.00511851254850626, 0.0008944971486926079, 0.04764832556247711, 0.04239274561405182, -0.04347837343811989, 0.017724204808473587, -0.0439799502491951, 0.0021682693623006344, -0.02063322439789772, 0.04628045856952667, 0.007038195617496967, 0.007878377102315426, -0.012348688207566738, 0.00710259610787034, 0.009246216155588627, 0.008458766154944897, 0.021130697801709175, -0.0037956302985548973, -0.018637049943208694, -0.024441134184598923, 0.03365575149655342, 0.015057634562253952, -0.014665004797279835, -0.007084871642291546, 0.011289977468550205, 0.04885180667042732, 0.008945354260504246, 0.012115095742046833, 0.04861881211400032, 0.009629515931010246, 0.006213673856109381, 0.008863828144967556, 0.031132295727729797, 0.055473778396844864, -0.024363335222005844, 0.048278432339429855, 0.04534893110394478, 0.04094261676073074, -0.01504735741764307, 0.004405840300023556, -0.00005551996218855493, -0.05214190110564232, 0.016809720546007156, 0.003618731861934066, -0.00037973711732774973, -0.04462128132581711, -0.0005338646587915719, 0.05065450072288513, 0.045223284512758255, 0.003006569342687726, 0.020695751532912254, -0.028019102290272713, -0.039817895740270615, 0.012676462531089783, 0.0012255857000127435, -0.0061207241378724575, 0.012810557149350643, 0.014246571809053421, -0.014076708815991879, 0.004765666089951992, 0.013523800298571587, -0.0057000392116606236, -0.005839107558131218, -0.0009619710617698729, -0.0251159630715847, 0.005315572489053011, 0.015468022786080837, -0.013314446434378624, -0.012553781270980835, -0.0029468396678566933, -0.05584979057312012, -0.04088558629155159, -0.004869685508310795, 0.03904830291867256, 0.006981855258345604, -0.03524645045399666, 0.026387134566903114, 0.03527221456170082, 0.004872689954936504, 0.006054773926734924, -0.032922323793172836, 0.020875222980976105, 0.0051442477852106094, 0.04491741210222244, 0.04327288269996643, -0.07757006585597992, -0.01131265889853239, -0.0003951659018639475, 0.057829007506370544, 0.06872201710939407, 0.018875455483794212, 0.07264769822359085, -0.010050536133348942, 0.017223993316292763, -0.01733984798192978, 0.03135376796126366, 0.03933640196919441, -0.0011800259817391634, 0.04171927645802498, -0.03979276493191719, 0.05452612414956093, 0.0055276681669056416, -0.07538314163684845, 0.01191897876560688, 0.017466183751821518, 0.024304453283548355, -0.0075208996422588825, 0.02187633514404297, 0.014402956701815128, 0.05146266520023346, 0.0021614704746752977, 0.007300575263798237, -0.02468355931341648, -0.007887274026870728, -0.0018529118970036507, 0.05376514792442322, 0.05653676018118858, -0.030972547829151154, 0.040471624583005905, -0.0020423848181962967, 0.05343027040362358, 0.03620908781886101, 0.03468670696020126, 0.05785243585705757, 0.027703026309609413, -0.030683131888508797, -0.029445823282003403, 0.007859219796955585, 0.04536588490009308, 0.0160440132021904, -0.004070133436471224, -0.024068430066108704, 0.00030166679061949253, 0.034806862473487854, -0.01882042922079563, 0.015248918905854225, -0.025227362290024757, 0.0017520410474389791, -0.03535309061408043, -0.001337131136097014, -0.05417235940694809, -0.03235022723674774, 0.022555116564035416, -0.02568294107913971, 0.021237175911664963, 0.028513947501778603, -0.027504023164510727, -0.04681588336825371, -0.015340441837906837, 0.02980717085301876, 0.026176340878009796, 0.04566183686256409, -0.005558369215577841, -0.05729401111602783, 0.03389158472418785, -0.054432064294815063, 0.04779569059610367, 0.044472090899944305, -0.020821843296289444, -0.0021022798027843237, -0.030977409332990646, 0.013649383559823036, 0.07167887687683105, -0.025519948452711105, -0.023003866896033287, 0.05426257848739624, -0.002411126159131527, 0.0009200936765410006, 0.033896371722221375, 0.07370786368846893, -0.0030834143981337547, 0.019545072689652443, -0.01981545239686966, 0.054972387850284576, 0.025077413767576218, -0.025695450603961945, -0.024217553436756134, -0.006195656955242157, 0.006878461688756943, 0.029385730624198914, 0.036096055060625076, -0.03224939852952957, 0.0007316777482628822, -0.046169087290763855, -0.014273645356297493, 0.0520285964012146, -0.017196735367178917, -0.0024793175980448723, 0.04284046217799187, -0.03137664124369621, 0.02534385956823826, -0.0017746980302035809, -0.045118704438209534, -0.041745707392692566, 0.01328890398144722, 0.025716060772538185, -0.018062133342027664, -0.02239956334233284, -0.011224372312426567, -0.043048784136772156, 0.028351491317152977, 0.02907770499587059, 0.014401501044631004, 0.07372298091650009, 0.0059737516567111015, 0.007849602028727531, -0.06568209826946259 ]
Accelerating Stable Diffusion XL Inference with JAX on Cloud TPU v5e
pcuenq
October 3, 2023
sdxl_jax
sdxl, jax, stable diffusion, guide, tpu, google
https://huggingface.co/blog/sdxl_jax
Benchmark The following measures were obtained running SDXL 1.0 base for 20 steps, with the default Euler Discrete scheduler. We compare Cloud TPU v5e with TPUv4 for the same batch sizes. Do note that, due to parallelism, a TPU v5e-4 like the ones we use in our demo will generate 4 images when using a batch size of 1 (or 8 images with a batch size of 2). Similarly, a TPU v5e-8 will generate 8 images when using a batch size of 1. The Cloud TPU tests were run using Python 3.10 and jax version 0.4.16. These are the same specs used in our demo Space. | | Batch Size | Latency | Perf/$ | |-----------------|------------|:--------:|--------| | TPU v5e-4 (JAX) | 4 | 2.33s | 21.46 | | | 8 | 4.99s | 20.04 | | TPU v4-8 (JAX) | 4 | 2.16s | 9.05 | | | 8 | 4.17 | 8.98 | TPU v5e achieves up to 2.4x greater perf/$ on SDXL compared to TPU v4, demonstrating the cost-efficiency of the latest TPU generation. To measure inference performance, we use the industry-standard metric of throughput. First, we measure latency per image when the model has been compiled and loaded. Then, we calculate throughput by dividing batch size over latency per chip. As a result, throughput measures how the model is performing in production environments regardless of how many chips are used. We then divide throughput by the list price to get performance per dollar.
[ 0.07037506997585297, 0.022712498903274536, -0.021372301504015923, 0.08096088469028473, 0.031804729253053665, 0.0643341913819313, -0.009207460097968578, 0.018195686861872673, 0.000454190478194505, -0.08490214496850967, 0.016751280054450035, -0.01569148525595665, -0.020677262917160988, 0.020796099677681923, -0.02231358364224434, -0.046514105051755905, -0.01888716034591198, 0.023117005825042725, 0.026791898533701897, -0.03917146846652031, -0.009424586780369282, -0.022955264896154404, 0.02777080051600933, -0.026151971891522408, -0.07898519188165665, -0.02517518773674965, -0.03989288583397865, -0.01425743754953146, -0.007164222188293934, -0.031396329402923584, -0.050422776490449905, 0.022794164717197418, -0.008022735826671124, 0.0014349875273182988, 0.06820611655712128, -0.04792967066168785, -0.04929457977414131, 0.02983003295958042, 0.010825980454683304, -0.018314843997359276, 0.03360676020383835, -0.014789246022701263, -0.017008114606142044, 0.04016190394759178, -0.024918638169765472, 0.033934079110622406, -0.02581907995045185, 0.0050884089432656765, -0.03989361599087715, 0.0646950826048851, -0.026384420692920685, 0.015414925292134285, 0.040287550538778305, -0.037503909319639206, 0.0716405063867569, 0.06999693810939789, 0.009957720525562763, -0.029918741434812546, 0.05447295680642128, 0.04078847914934158, 0.020147377625107765, -0.051296938210725784, 0.04731946066021919, -0.016236010938882828, 0.03937692940235138, -0.06223753094673157, 0.02440190501511097, 0.05954680219292641, -0.05174429714679718, -0.005460895132273436, 0.005931165535002947, -0.017969783395528793, 0.01975267007946968, 0.08845198154449463, 0.016528043895959854, -0.016247671097517014, -0.01087015401571989, 0.04675126448273659, 0.07461772114038467, 0.0828913226723671, -0.05627721920609474, 0.08156932890415192, 0.009887468069791794, -0.01770438253879547, 0.013209834694862366, -0.001023524790070951, 0.023164760321378708, -0.031147191300988197, -0.059547118842601776, 0.04138043150305748, 0.026717551052570343, -0.017128033563494682, 0.0930069088935852, 0.02922588214278221, -0.056575339287519455, -0.03340182080864906, 0.010899970307946205, 0.02355845645070076, 0.028998687863349915, 0.02444596216082573, 0.02464749477803707, -0.012875600717961788, 0.004218073561787605, -0.060122329741716385, -0.03373860567808151, 0.04597017168998718, -0.03993748873472214, -0.0844433531165123, 0.01122573297470808, 0.031151464208960533, 0.010992409661412239, 0.05007639527320862, -0.021379781886935234, 0.062041524797677994, -0.052580609917640686, 0.01495397835969925, -0.05944210663437843, 0.04243193194270134, -0.01334292907267809, -0.018217328935861588, -0.011072956025600433, 0.06694956868886948, 0.0792294293642044, -0.09580954164266586, -0.03299305588006973, 0.02751036360859871, 0.0011675895657390356, 0.0789932981133461, -0.06143290922045708, -0.03689003735780716, 0.057736873626708984, -0.03762221336364746, 0.07841824740171432, -0.012165493331849575, -0.012232063338160515, -0.035006869584321976, -0.006598128005862236, -0.06857774406671524, -0.02521139569580555, 0.02475808374583721, -0.018199985846877098, 0.030359042808413506, 0.02495637908577919, -0.03132396936416626, 0.0016016585286706686, -0.027792006731033325, 0.014316342771053314, -0.02581041492521763, -0.051801249384880066, 0.008629191666841507, -0.10190566629171371, 0.027080178260803223, -0.05365484580397606, 0.011862128973007202, 0.010877872817218304, 0.09590146690607071, 0.022328903898596764, -0.03389335796236992, -0.11819864809513092, -0.0716211125254631, -0.00944123137742281, -0.01595263183116913, -0.03260771557688713, -0.0617867186665535, 0.011511843651533127, 0.06479141116142273, 0.06629858911037445, -0.021563058719038963, 0.0006730994791723788, -0.00971042551100254, -0.020009823143482208, 0.034214310348033905, 0.06364594399929047, 0.020976446568965912, 0.019115924835205078, -0.008688805624842644, 0.03695719689130783, 0.04720185697078705, 0.02060692384839058, -0.039475519210100174, -0.03177100792527199, 0.0373813770711422, -0.009683175012469292, 0.06843414157629013, 0.021791521459817886, -0.16457277536392212, 0.07392895221710205, 0.009133131243288517, -0.05539223551750183, 0.03958737850189209, -0.0434998944401741, -0.03278471156954765, 0.09652459621429443, -0.07211639732122421, 0.0059530893340706825, -0.04917405545711517, 0.014585194177925587, 0.004616275429725647, 0.04001208767294884, -0.017668403685092926, 0.01368972472846508, 0.051754627376794815, -0.012170547619462013, 0.01950128935277462, -0.0015819937689229846, -0.04618988186120987, 0.04410763084888458, -0.003648298792541027, -0.016606399789452553, 0.009311836212873459, -0.03838525712490082, -0.15903359651565552, -0.02996234968304634, -0.010073305107653141, -0.06327606737613678, -0.037721939384937286, 0.002600892446935177, -0.040690451860427856, 0.06775779277086258, -0.05268661677837372, 0.0868687778711319, -0.02574854902923107, -0.019878709688782692, 0.03889351710677147, -0.044864118099212646, -0.027094563469290733, 0.04641859605908394, 0.019947214052081108, -0.028017040342092514, -0.07338926196098328, -0.04302091896533966, -0.14648191630840302, -0.0550415925681591, 0.035183198750019073, 0.03639097511768341, -0.01304714661091566, 0.030388053506612778, -0.05449848994612694, 0.00570323970168829, -0.0470598004758358, 0.0003505968488752842, 0.04387379437685013, -0.0033752210438251495, 0.00726852472871542, -0.00647954223677516, -0.010202954523265362, 0.045863475650548935, -0.06195129081606865, -0.07153486460447311, -0.03163790702819824, -0.09760435670614243, 0.0022681711707264185, -0.020023543387651443, -0.048974305391311646, 0.08353311568498611, 0.039831556379795074, 0.009361249394714832, -0.02662576548755169, -0.02327079139649868, -0.010378394275903702, -0.02803104557096958, -0.009255718439817429, -0.039896320551633835, -0.010392691008746624, 0.05958162620663643, -0.02330605871975422, 0.00761647941544652, -0.04483024775981903, 0.004147793166339397, 0.006815646775066853, 0.01753544621169567, 0.002659126417711377, 0.000740871939342469, -0.006845539435744286, -0.014204186387360096, -0.011979326605796814, -0.008014993742108345, -0.015397208742797375, -0.014888172037899494, -0.03443378955125809, 0.011710655875504017, -0.021043576300144196, 0.04972309619188309, 0.009873094968497753, -0.012943495996296406, -0.004721319768577814, 0.025933772325515747, -0.02795492857694626, -0.07778605818748474, -0.029870787635445595, 0.016232643276453018, -0.006504311691969633, 0.00965401902794838, -0.008654092438519001, 0.0247817225754261, 0.009419741109013557, -0.0054064663127064705, -0.07338515669107437, -0.00723744323477149, 0.022282978519797325, -0.03902486339211464, -0.025128988549113274, -0.01380804181098938, -0.014979560859501362, -0.019851861521601677, -0.01827688328921795, -0.004556457977741957, 0.06049010530114174, -0.07791490852832794, -0.008997741155326366, -0.017173809930682182, 0.017799371853470802, -0.027582956477999687, 0.006304472219198942, 0.01710468903183937, -0.03542206436395645, 0.017204711213707924, 0.04354455694556236, -0.0042188167572021484, 0.005374707747250795, -0.001297729671932757, -0.03720615431666374, 0.0411577932536602, -0.007791097741574049, 0.05926024541258812, -0.017856108024716377, 0.029405564069747925, -0.015984345227479935, -0.05423397943377495, -0.018204381689429283, 0.0011693097185343504, -0.0217040553689003, -0.02005745656788349, 0.04242636635899544, 0.033158715814352036, -0.07093709707260132, 0.02309494838118553, -0.009518060833215714, -0.04399340972304344, -0.01495753787457943, 0.008861048147082329, 0.03987416252493858, -0.014521263539791107, -0.04896935075521469, 0.0005041585536673665, 0.04169420897960663, 0.009488362818956375, 0.011085559614002705, 0.04667454585433006, -0.01612132228910923, 0.043401625007390976, 0.01674930565059185, 0.06082066148519516, 0.016327833756804466, 0.039358966052532196, -0.018840011209249496, 0.010804153978824615, 0.003805027576163411, 0.00019716285169124603, 0.04897517338395119, -0.012755945324897766, 0.0426635704934597, 0.021191341802477837, 0.025816721841692924, -0.023942766711115837, 0.022021403536200523, 0.036445558071136475, -0.03144168108701706, -0.0439477413892746, -0.01635129749774933, 0.037817105650901794, 0.029208077117800713, 0.0038387849926948547, 0.032850105315446854, 0.009002050384879112, -0.03782965987920761, -0.0652901902794838, 0.019835496321320534, -0.020942281931638718, 0.06105480715632439, -0.004349823109805584, 0.0036010725889354944, -0.008813027292490005, 0.011109731160104275, 0.004996693227440119, -0.0197020024061203, 0.017474185675382614, 0.05053058639168739, -0.01153086218982935, 0.0032145967707037926, -0.022900942713022232, 0.008723788894712925, 0.04774598777294159, 0.05974085256457329, -0.019340522587299347, -0.018985841423273087, -0.005825298838317394, 0.027222365140914917, 0.03834279999136925, -0.014472818933427334, -0.02102493681013584, 0.01985262520611286, -0.01601218990981579, -0.07422789931297302, 0.05864277854561806, 0.01409731525927782, -0.0101585378870368, 0.026928672567009926, 0.04881511256098747, 0.005565918982028961, 0.011581202037632465, 0.007044409867376089, -0.023203356191515923, 0.02164725959300995, -0.025406455621123314, -0.031498994678258896, -0.04260770604014397, 0.043332457542419434, 0.015642791986465454, -0.003633813001215458, 0.010883128270506859, -0.018242929130792618, 0.0459570549428463, 0.03667919710278511, 0.0711166188120842, -0.008287530392408371, -0.010521027259528637, -0.00977469701319933, -0.007677851244807243, 0.03653295710682869, -0.006090469658374786, -0.03026917390525341, 0.044262517243623734, -0.001793152536265552, -0.04726782813668251, 0.04762846603989601, 0.010040843859314919, -0.01638464629650116, -0.03330996260046959, 0.011458516120910645, 0.044983044266700745, 0.003923953045159578, -0.013238057494163513, 0.012152615003287792, -0.01324585173279047, -0.014705302193760872, -0.037863124161958694, -0.0356125570833683, 0.04482289403676987, 0.0621165968477726, -0.0034277334343641996, 0.007180127780884504, 0.008699670433998108, 0.027523115277290344, -0.011499720625579357, -0.0010653628269210458, -0.019245587289333344, 0.01254116278141737, 0.05763637274503708, -0.04951964691281319, 0.010332304053008556, -0.023652322590351105, 0.024112969636917114, -0.011325064115226269, 0.019602131098508835, -0.02547518163919449, 0.013058493845164776, 0.043864551931619644, -0.027475744485855103, 0.03780505806207657, -0.021549362689256668, 0.021767234429717064, 0.019940247759222984, 0.03001054748892784, -0.035550422966480255, -0.016100794076919556, 0.02594696171581745, -0.032238319516181946, -0.03889023885130882, -0.030899494886398315, -0.01019227597862482, -0.006079412996768951, 0.04463057592511177, 0.020879583433270454, 0.0013755103573203087, -0.003037962829694152, 0.022743571549654007, 0.032187916338443756, -0.062104322016239166, -0.03758693113923073, 0.004027818329632282, -0.014033721759915352, 0.025858929380774498, 0.006005372852087021, 0.023046797141432762, 0.026096023619174957, 0.034495603293180466, 0.05036942660808563, -0.0037568232510238886, 0.015080131590366364, 0.0019498174078762531, -0.00632138829678297, 0.0049699703231453896, -0.03967565670609474, 0.025397351011633873, 0.052135955542325974, -0.022874629124999046, -0.00014286981604527682, -0.006544528529047966, -0.002660479163751006, -0.025897959247231483, -0.033800940960645676, 0.027817538008093834, 0.021067963913083076, -0.024578673765063286, 0.01741022802889347, -0.0033478259574621916, -0.03458999842405319, -0.017026053741574287, 0.002164756180718541, -0.10090388357639313, 0.011069380678236485, -0.007151042576879263, -0.05347391217947006, -0.01531701348721981, 0.06449931114912033, 0.005408340133726597, -0.017659097909927368, -0.034787021577358246, -0.010910630226135254, 0.007177331950515509, -0.026735177263617516, 0.00748156663030386, 0.002247614786028862, -0.010597837157547474, -0.037036195397377014, -0.05000760778784752, 0.029067562893033028, -0.033696774393320084, 0.016935693100094795, -0.0229070745408535, 0.004495008382946253, 0.03634446859359741, 0.02865234762430191, 0.028416845947504044, 0.010590572841465473, 0.01017086673527956, -0.030662624165415764, -0.06132280454039574, 0.042638082057237625, 0.0014185769250616431, 0.026047358289361, -0.06301246583461761, 0.04895712807774544, 0.075922392308712, -0.03217850252985954, -0.0342404879629612, 0.020800409838557243, 0.013848469592630863, -0.025083180516958237, 0.023649165406823158, -0.005668553989380598, 0.02275884710252285, 0.00789461750537157, 0.030365558341145515, -0.01471842359751463, 0.010286912322044373, 0.01674700528383255, -0.0025107332039624453, -0.0414196252822876, 0.04079395905137062, 0.03110763616859913, -0.031724508851766586, 0.03922571241855621, 0.026968948543071747, -0.029316360130906105, 0.026956157758831978, 0.005523437634110451, 0.020362472161650658, -0.01245199516415596, 0.0017440223600715399, -0.007534484378993511, -0.013144677504897118, -0.005833652801811695, -0.010679114609956741, 0.039319202303886414, -0.0005265084910206497, 0.0027047155890613794, 0.02119939774274826, 0.051401469856500626, 0.016941193491220474, 0.0044079930521547794, -0.043705232441425323, 0.01942380517721176, 0.09136147797107697, -0.017871439456939697, 0.026542596518993378, 0.07087300717830658, -0.01268774550408125, -0.030657490715384483, 0.020771579816937447, -0.019817214459180832, -0.053031738847494125, -0.025555454194545746, -0.017421552911400795, -0.031015649437904358, -0.004277647938579321, 0.01094923447817564, 0.023211361840367317, 0.023426467552781105, 0.005724966060370207, 0.0160141009837389, -0.03746414557099342, -0.03061784990131855, 0.012284570373594761, -0.010817630216479301, -0.016433175653219223, 0.012540311552584171, 0.018010037019848824, 0.016995778307318687, -0.015042511746287346, -0.010353469289839268, 0.00851388368755579, -0.0025043063797056675, -0.005643301177769899, -0.012987480498850346, -0.029161108657717705, 0.006722201593220234, -0.006676143500953913, 0.03330189734697342, -0.031958647072315216, -0.032715436071157455, -0.05387941002845764, -0.02984069660305977, -0.011117969639599323, -0.010458479635417461, 0.021089840680360794, 0.018921997398138046, 0.040524326264858246, 0.027888275682926178, -0.015340549871325493, -0.029631463810801506, 0.03421211987733841, 0.0234262403100729, 0.02850620448589325, 0.03094545751810074, -0.02936522662639618, 0.005490999203175306, -0.0025959142949432135, 0.07002009451389313, 0.02088155969977379, 0.03823678568005562, -0.009627795778214931, 0.01716274581849575, 0.010925143957138062, -0.04186718910932541, 0.020812205970287323, 0.032491523772478104, 0.04108738526701927, 0.04182850569486618, -0.0026141696143895388, 0.03648920729756355, -0.005288324784487486, -0.05819391459226608, 0.011024612002074718, 0.013280103914439678, 0.013237077742815018, 0.022823253646492958, 0.04473334178328514, 0.010560145601630211, 0.02462308667600155, 0.02676178701221943, -0.0031054296996444464, -0.013179090805351734, -0.030313076451420784, -0.04397131875157356, 0.03606360778212547, 0.017325052991509438, -0.023401714861392975, 0.02589990198612213, -0.03128065913915634, 0.06433739513158798, 0.007544027175754309, 0.001397959073074162, 0.026861760765314102, -0.013842171989381313, -0.022789835929870605, -0.027396488934755325, 0.01060462836176157, 0.01512273121625185, 0.04404326528310776, 0.027586711570620537, -0.014096662402153015, 0.003149819327518344, -0.017411665990948677, -0.008751574903726578, -0.009193126112222672, 0.00015676017210353166, -0.04877982288599014, -0.009202769957482815, -0.031154561787843704, 0.0024173937272280455, -0.03452199697494507, 0.0363023616373539, -0.042430248111486435, 0.009535790421068668, -0.03404141589999199, -0.03914220631122589, -0.01186074037104845, -0.03240344673395157, 0.06887540221214294, 0.026859525591135025, -0.013352403417229652, 0.011838970705866814, -0.045218974351882935, 0.049163032323122025, -0.07091105729341507, 0.052957840263843536, 0.025421779602766037, 0.04600189998745918, -0.0059564015828073025, -0.045840851962566376, 0.024111106991767883, 0.06754101812839508, 0.01542579848319292, 0.02932370826601982, 0.07775212824344635, -0.01565626822412014, -0.007396000437438488, 0.056255534291267395, 0.016240688040852547, 0.0005081197014078498, 0.05392768979072571, 0.016434386372566223, 0.04358659312129021, 0.02067476324737072, -0.006908038165420294, -0.04423868656158447, -0.02408304437994957, 0.033969946205616, 0.024091903120279312, 0.031116057187318802, -0.038232624530792236, 0.02896897681057453, -0.03493510186672211, 0.033917125314474106, 0.00701522221788764, -0.02752300351858139, -0.02274869941174984, -0.00019112757581751794, -0.02541201189160347, 0.014579837210476398, -0.016430536285042763, -0.012502125464379787, -0.018874524161219597, 0.006520567461848259, 0.030535362660884857, -0.009432988241314888, 0.018409283831715584, -0.006867852993309498, -0.028231149539351463, 0.03102596290409565, -0.0047421203926205635, -0.005929236300289631, 0.052023112773895264, 0.05777030065655708, 0.015501907095313072, 0.010872493498027325 ]
Accelerating Stable Diffusion XL Inference with JAX on Cloud TPU v5e
pcuenq
October 3, 2023
sdxl_jax
sdxl, jax, stable diffusion, guide, tpu, google
https://huggingface.co/blog/sdxl_jax
How to write an image generation pipeline in JAX We'll go step by step over the code you need to write to run inference super-fast using JAX! First, let's import the dependencies. python # Show best practices for SDXL JAX import jax import jax.numpy as jnp import numpy as np from flax.jax_utils import replicate from diffusers import FlaxStableDiffusionXLPipeline import time We'll now load the base SDXL model and the rest of the components required for inference. The diffusers pipeline takes care of downloading and caching everything for us. Adhering to JAX's functional approach, the model's parameters are returned separately and will have to be passed to the pipeline during inference: python pipeline, params = FlaxStableDiffusionXLPipeline.from_pretrained( "stabilityai/stable-diffusion-xl-base-1.0", split_head_dim=True ) Model parameters are downloaded in 32-bit precision by default. To save memory and run computation faster we'll convert them to bfloat16, an efficient 16-bit representation. However, there's a caveat: for best results, we have to keep the scheduler state in float32, otherwise precision errors accumulate and result in low-quality or even black images. python scheduler_state = params.pop("scheduler") params = jax.tree_util.tree_map(lambda x: x.astype(jnp.bfloat16), params) params["scheduler"] = scheduler_state We are now ready to set up our prompt and the rest of the pipeline inputs. python default_prompt = "high-quality photo of a baby dolphin โ€‹โ€‹playing in a pool and wearing a party hat" default_neg_prompt = "illustration, low-quality" default_seed = 33 default_guidance_scale = 5.0 default_num_steps = 25 The prompts have to be supplied as tensors to the pipeline, and they always have to have the same dimensions across invocations. This allows the inference call to be compiled. The pipeline prepare_inputs method performs all the necessary steps for us, so we'll create a helper function to prepare both our prompt and negative prompt as tensors. We'll use it later from our generate function: python def tokenize_prompt(prompt, neg_prompt): prompt_ids = pipeline.prepare_inputs(prompt) neg_prompt_ids = pipeline.prepare_inputs(neg_prompt) return prompt_ids, neg_prompt_ids To take advantage of parallelization, we'll replicate the inputs across devices. A Cloud TPU v5e-4 has 4 chips, so by replicating the inputs we get each chip to generate a different image, in parallel. We need to be careful to supply a different random seed to each chip so the 4 images are different: python NUM_DEVICES = jax.device_count() # Model parameters don't change during inference, # so we only need to replicate them once. p_params = replicate(params) def replicate_all(prompt_ids, neg_prompt_ids, seed): p_prompt_ids = replicate(prompt_ids) p_neg_prompt_ids = replicate(neg_prompt_ids) rng = jax.random.PRNGKey(seed) rng = jax.random.split(rng, NUM_DEVICES) return p_prompt_ids, p_neg_prompt_ids, rng We are now ready to put everything together in a generate function: python def generate( prompt, negative_prompt, seed=default_seed, guidance_scale=default_guidance_scale, num_inference_steps=default_num_steps, ): prompt_ids, neg_prompt_ids = tokenize_prompt(prompt, negative_prompt) prompt_ids, neg_prompt_ids, rng = replicate_all(prompt_ids, neg_prompt_ids, seed) images = pipeline( prompt_ids, p_params, rng, num_inference_steps=num_inference_steps, neg_prompt_ids=neg_prompt_ids, guidance_scale=guidance_scale, jit=True, ).images # convert the images to PIL images = images.reshape((images.shape[0] * images.shape[1], ) + images.shape[-3:]) return pipeline.numpy_to_pil(np.array(images)) jit=True indicates that we want the pipeline call to be compiled. This will happen the first time we call generate, and it will be very slow โ€“ JAX needs to trace the operations, optimize them, and convert them to low-level primitives. We'll run a first generation to complete this process and warm things up: python start = time.time() print(f"Compiling ...") generate(default_prompt, default_neg_prompt) print(f"Compiled in {time.time() - start}") This took about three minutes the first time we ran it. But once the code has been compiled, inference will be super fast. Let's try again! python start = time.time() prompt = "llama in ancient Greece, oil on canvas" neg_prompt = "cartoon, illustration, animation" images = generate(prompt, neg_prompt) print(f"Inference in {time.time() - start}") It now took about 2s to generate the 4 images!
[ 0.03134957700967789, 0.0238932054489851, 0.014887955039739609, 0.0003176215395797044, 0.0615265853703022, 0.012715599499642849, 0.014886759221553802, 0.01830468699336052, 0.03395844250917435, -0.06142362207174301, -0.013376744464039803, -0.0041155400685966015, 0.01002404186874628, 0.05867256224155426, -0.006388083565980196, -0.06775787472724915, 0.04954507574439049, 0.04499596729874611, 0.020498428493738174, 0.01899474486708641, -0.020321333780884743, -0.03795712813735008, -0.09966129064559937, -0.031810685992240906, -0.009467784315347672, -0.08823133260011673, 0.006516675464808941, -0.005990572273731232, 0.05240707844495773, 0.0017986397724598646, -0.04639693349599838, -0.0342881977558136, -0.05733146890997887, 0.01302022859454155, 0.021661505103111267, -0.03459133207798004, -0.10959896445274353, 0.03687000274658203, 0.05491997301578522, 0.011559809558093548, -0.009841063991189003, 0.04668065160512924, -0.003730424214154482, 0.03078358992934227, 0.029521366581320763, -0.06298474967479706, -0.13465920090675354, -0.017329495400190353, -0.07078572362661362, 0.05670452117919922, -0.06302943825721741, 0.04501325264573097, -0.01745392382144928, -0.010634398087859154, -0.011930032633244991, 0.03907134011387825, 0.007131312973797321, -0.03751952573657036, 0.04642360284924507, -0.001076826942153275, 0.012878790497779846, -0.02194945700466633, -0.03216415271162987, 0.05400017648935318, 0.07746218144893646, -0.006218481343239546, -0.029790615662932396, 0.08185391873121262, -0.033662691712379456, -0.057222116738557816, 0.028754692524671555, 0.005312147084623575, 0.004738822113722563, 0.02423642948269844, 0.03699982911348343, -0.03467987850308418, -0.032212238758802414, 0.012181425467133522, 0.023207537829875946, 0.058376893401145935, -0.02856210619211197, 0.029283316805958748, 0.07832860201597214, 0.01790809817612171, 0.051448941230773926, 0.020871834829449654, 0.06540602445602417, -0.03829443082213402, -0.07057059556245804, 0.06121889874339104, 0.042423639446496964, -0.0767575353384018, -0.06705041229724884, 0.008908248506486416, -0.029436122626066208, 0.010218732059001923, -0.03495507314801216, 0.05621569603681564, 0.052174657583236694, -0.03344614803791046, -0.027959095314145088, -0.008230085484683514, -0.03458340838551521, -0.056674763560295105, -0.0660630390048027, 0.0656033605337143, -0.04310029000043869, -0.0748310387134552, -0.039416637271642685, -0.018945399671792984, 0.02932196669280529, 0.04938364401459694, -0.005297238938510418, 0.05869065225124359, -0.08280929177999496, 0.01887015625834465, -0.02310287579894066, -0.020240070298314095, -0.05949614569544792, -0.04350125044584274, -0.008685018867254257, 0.10937995463609695, 0.14684371650218964, -0.030372342094779015, -0.10809843242168427, 0.06874570995569229, 0.044267311692237854, 0.06771759688854218, -0.03546722233295441, 0.007914049550890923, -0.010411283932626247, -0.060443516820669174, 0.020797157660126686, 0.027220871299505234, 0.06563016772270203, -0.08870375901460648, -0.01165065262466669, -0.05228537321090698, 0.06023082882165909, 0.06318759173154831, 0.007039139047265053, 0.020198501646518707, 0.018972303718328476, -0.01244353223592043, 0.03313488885760307, -0.0530862957239151, 0.014812825247645378, 0.00817134603857994, -0.0006293181795626879, 0.021716013550758362, -0.017171690240502357, 0.08424637466669083, -0.0391499325633049, -0.03233989700675011, -0.028843840584158897, 0.04715673252940178, 0.039119746536016464, -0.04057225212454796, -0.06451661884784698, -0.01356520876288414, -0.007384308148175478, 0.006314708851277828, -0.02311042696237564, -0.019525064155459404, -0.029408926144242287, 0.00185772858094424, 0.04710542783141136, -0.04010874405503273, 0.07185481488704681, 0.01637018658220768, 0.04200807958841324, 0.012012721039354801, -0.011323744431138039, 0.023093748837709427, 0.073372982442379, -0.030764412134885788, 0.03766154497861862, 0.04076194018125534, -0.006976342760026455, -0.040768176317214966, -0.021608145907521248, 0.06377304345369339, 0.017482515424489975, 0.06781711429357529, 0.0684640109539032, -0.10820761322975159, 0.04407716169953346, -0.03245971351861954, -0.027756324037909508, 0.0023420010693371296, -0.00794405210763216, 0.009410127066075802, 0.1001068651676178, 0.018341204151511192, -0.01170278899371624, -0.036750443279743195, -0.058263685554265976, 0.026002859696745872, 0.028425173833966255, 0.017435435205698013, 0.009165688417851925, 0.016147926449775696, 0.005793788470327854, -0.01887417957186699, -0.04393269866704941, -0.0180355291813612, 0.005804839078336954, -0.014919724315404892, 0.060150884091854095, 0.04062137380242348, -0.056447435170412064, -0.0718466117978096, -0.00016091954603325576, -0.04831303656101227, -0.03369852900505066, 0.0011995300883427262, -0.0005729348049499094, -0.08147796243429184, 0.0253245048224926, -0.02175195887684822, 0.11608376353979111, -0.04160827770829201, -0.03032352589070797, -0.0024806794244796038, 0.04163210839033127, 0.016254452988505363, 0.07611419260501862, -0.01091056875884533, -0.000010635805665515363, -0.08803357928991318, -0.08699749410152435, 0.00601836247369647, -0.08441132307052612, -0.0030598242301493883, 0.015019137412309647, 0.026621101424098015, 0.03737640008330345, -0.05822264775633812, -0.023075828328728676, -0.022508928552269936, 0.11111363768577576, 0.02862142212688923, -0.06410777568817139, -0.03487011417746544, 0.03828109800815582, -0.018761854618787766, 0.023941462859511375, 0.01713971607387066, -0.07137328386306763, 0.008151980116963387, -0.057702161371707916, 0.03524205461144447, -0.02782375179231167, -0.08757064491510391, 0.012175649404525757, 0.04171169921755791, -0.01544569805264473, 0.013952522538602352, -0.03615245968103409, 0.032791782170534134, -0.021213669329881668, 0.03787591680884361, -0.014374812133610249, -0.039375707507133484, 0.004174765665084124, -0.019424807280302048, 0.010593908838927746, -0.005086354445666075, 0.02647259272634983, 0.04347644001245499, 0.07098317891359329, 0.004879856947809458, -0.0036108435597270727, -0.0018105343915522099, -0.030270224437117577, -0.03358035162091255, 0.019918221980333328, -0.0024469310883432627, 0.04893655702471733, -0.02630597911775112, 0.03598126769065857, -0.005290119908750057, 0.02571035921573639, 0.048716653138399124, 0.014203667640686035, -0.005119866691529751, 0.048512354493141174, -0.025028767064213753, -0.06509149819612503, -0.0190244372934103, 0.019059011712670326, 0.0517217293381691, 0.04805731773376465, -0.033459343016147614, -0.03421083465218544, 0.01344283577054739, -0.030091919004917145, -0.03205382823944092, 0.006838229484856129, -0.017910094931721687, -0.035547155886888504, -0.061190612614154816, 0.016465701162815094, -0.013063125312328339, -0.02484872192144394, 0.016746021807193756, -0.019292810931801796, -0.003419269807636738, -0.08541185408830643, -0.024383878335356712, -0.006455024238675833, 0.005634693428874016, 0.017898382619023323, -0.023249857127666473, 0.03885269910097122, -0.03208743780851364, 0.0158856064081192, -0.007821374572813511, 0.019957102835178375, 0.06155403330922127, -0.03942229971289635, -0.011722567491233349, 0.05333150178194046, -0.039108455181121826, -0.004205821081995964, -0.00302814575843513, 0.042319122701883316, -0.002848623087629676, -0.08278504759073257, 0.013758833520114422, -0.0035455310717225075, -0.026825938373804092, 0.03921464458107948, 0.014679204672574997, 0.032746344804763794, -0.021122226491570473, 0.022419823333621025, -0.01905183494091034, -0.0104447603225708, -0.029390962794423103, 0.03242785111069679, 0.0421084389090538, -0.06006283685564995, 0.027181630954146385, -0.012557083740830421, 0.006574693601578474, 0.026341043412685394, -0.03042137809097767, 0.008670110255479813, -0.020544011145830154, -0.02398105151951313, 0.009740239009261131, 0.04273517429828644, -0.004408424254506826, 0.05718949809670448, -0.02818351797759533, 0.020435716956853867, -0.029927212744951248, -0.04160073772072792, 0.022810833528637886, 0.013047751039266586, 0.034161392599344254, 0.01768891140818596, 0.03884761035442352, -0.047751858830451965, 0.02429254911839962, 0.01681050844490528, -0.016756979748606682, -0.021290037781000137, -0.02481977269053459, -0.012649411335587502, -0.0009029268985614181, 0.007998338900506496, 0.041224218904972076, 0.032785285264253616, -0.01114626880735159, -0.016174426302313805, 0.05408536270260811, -0.0033395574428141117, 0.04609057679772377, 0.030124137178063393, 0.00456832442432642, -0.01626322604715824, -0.036533091217279434, -0.027669383212924004, -0.028829360380768776, 0.038162097334861755, 0.006419678218662739, -0.025969071313738823, -0.046771176159381866, -0.010708126239478588, 0.003471996868029237, -0.005809097085148096, 0.036023616790771484, 0.008516768924891949, -0.0553387887775898, 0.026760874316096306, -0.008747411891818047, -0.026898128911852837, 0.011071526445448399, -0.0029371255077421665, -0.06653840094804764, -0.011267845518887043, -0.0475381538271904, 0.03033110313117504, -0.0037438212893903255, -0.02016662247478962, -0.005120967049151659, 0.0038647595793008804, -0.016832487657666206, -0.02180134505033493, 0.03419756144285202, -0.0011931241024285555, -0.007482978515326977, -0.029114695265889168, 0.01584712415933609, 0.029525812715291977, -0.0019137338967993855, 0.026457829400897026, -0.023400073871016502, 0.019387293606996536, -0.004054703284054995, -0.0014178617857396603, 0.05059181898832321, -0.004185357131063938, -0.01759052835404873, 0.010590440593659878, 0.0022567412815988064, -0.037866126745939255, -0.006021893583238125, 0.001452638185583055, -0.02391345612704754, 0.005385031923651695, 0.00694082397967577, 0.0183863565325737, 0.03977952152490616, 0.026393860578536987, -0.014434642158448696, 0.01923452876508236, -0.008263315074145794, 0.05248697102069855, 0.007085169665515423, -0.04563262686133385, -0.0005862893885932863, -0.03583843633532524, -0.01847877725958824, 0.005937821231782436, 0.0005789121496491134, 0.04189939424395561, 0.020347924903035164, 0.030059898272156715, -0.003493322990834713, 0.01381171215325594, 0.04507168382406235, -0.032807156443595886, 0.004880588036030531, -0.040464866906404495, -0.032439935952425, 0.05373726040124893, -0.0005176119157113135, -0.036361414939165115, -0.049663059413433075, 0.029300332069396973, -0.026369499042630196, 0.022491974756121635, -0.07120807468891144, 0.032051339745521545, 0.009650658816099167, 0.009889867156744003, 0.00369662931188941, -0.0055288407020270824, 0.05724544823169708, 0.009872903116047382, -0.0012644999660551548, -0.03745559602975845, -0.04366112872958183, -0.016171934083104134, -0.03315276280045509, -0.023057835176587105, 0.04210086539387703, 0.05636210739612579, -0.033480603247880936, -0.017279235646128654, 0.06548446416854858, 0.02991168387234211, 0.058021996170282364, -0.04236293584108353, -0.050160001963377, -0.06556356698274612, -0.02318148873746395, 0.020649196580052376, -0.025383224710822105, 0.008323170244693756, 0.01712004654109478, 0.040293607860803604, 0.0311183650046587, 0.005962476134300232, 0.05001843348145485, 0.0028086432721465826, -0.005448387004435062, -0.00018394952348899096, 0.0057986145839095116, -0.0006427063490264118, -0.030773859471082687, -0.03370339423418045, 0.036938879638910294, 0.0020444851834326982, -0.032333388924598694, 0.018187079578638077, 0.030723845586180687, 0.0009278450743295252, -0.0361953042447567, -0.026907047256827354, 0.025098593905568123, -0.055296801030635834, 0.001247880863957107, 0.014905664138495922, -0.01923772506415844, 0.035237137228250504, -0.034879956394433975, -0.006607901770621538, 0.017357738688588142, 0.004860419314354658, -0.0041037630289793015, 0.004287687595933676, 0.021611997857689857, 0.028146659955382347, 0.009534946642816067, 0.00038216676330193877, -0.0229274220764637, -0.0012609846889972687, 0.005225509405136108, 0.028017261996865273, -0.019428038969635963, 0.020506607368588448, -0.02997550740838051, -0.028651537373661995, 0.03443450108170509, 0.009173929691314697, 0.024622933939099312, -0.031389303505420685, 0.03493628278374672, 0.0014913998311385512, -0.018232472240924835, -0.023719672113656998, 0.05040718615055084, 0.06054718792438507, 0.011606000363826752, -0.021503707394003868, 0.004033896140754223, -0.037451036274433136, 0.03359295055270195, -0.0429350920021534, 0.05471079796552658, 0.006667112000286579, -0.023853009566664696, -0.015367201529443264, 0.026730315759778023, 0.02611309289932251, -0.015315193682909012, 0.025645829737186432, -0.039035946130752563, -0.006733832880854607, 0.04885954409837723, 0.021195026114583015, -0.03481867536902428, 0.029882941395044327, -0.04802057147026062, 0.005383497569710016, -0.04160146415233612, -0.001081434078514576, 0.01365803461521864, -0.004216704051941633, 0.03336811438202858, 0.0035771301481872797, -0.011603723280131817, 0.0015632788417860866, 0.033600155264139175, 0.04057728499174118, -0.0055290875025093555, -0.014801349490880966, 0.005414003040641546, 0.027647556737065315, 0.037939753383398056, -0.04334960877895355, 0.03245709091424942, 0.011039042845368385, 0.025988660752773285, 0.03783373907208443, 0.015496264211833477, 0.019369982182979584, -0.016566339880228043, 0.015524760819971561, 0.004362772684544325, 0.06417971849441528, 0.02545250579714775, 0.046565521508455276, 0.04277892783284187, 0.02906271629035473, -0.025740517303347588, -0.015155047178268433, -0.050216563045978546, -0.07262641191482544, 0.048249952495098114, 0.048443421721458435, 0.009205082431435585, -0.01797289028763771, -0.016376905143260956, 0.04686403647065163, 0.04874268174171448, 0.03291402757167816, 0.02450004778802395, -0.01221652701497078, 0.03940260782837868, -0.013091715052723885, 0.0033913045190274715, 0.0304233618080616, 0.04855114594101906, -0.027357537299394608, 0.02838943898677826, -0.0067452555522322655, 0.016024284064769745, 0.04591110348701477, 0.044850897043943405, 0.014879187569022179, 0.014527412131428719, -0.007565432693809271, -0.01729237288236618, 0.023196589201688766, -0.04045048728585243, -0.01928902044892311, -0.042319998145103455, -0.04686087369918823, 0.0005159539869055152, 0.00778660923242569, 0.004615924321115017, -0.01921307109296322, 0.03984171524643898, 0.02840494178235531, -0.02985926903784275, 0.010904640890657902, -0.04834078252315521, 0.0039840321987867355, 0.001121274777688086, 0.020614029839634895, 0.0070344326086342335, -0.02187209203839302, -0.008714195340871811, 0.011516517028212547, 0.014544500969350338, -0.03153782710433006, 0.006026371382176876, -0.028878837823867798, -0.05623091012239456, -0.014234756119549274, -0.01871883124113083, 0.011277101933956146, 0.04290774092078209, 0.013354322873055935, 0.013559402897953987, 0.012427184730768204, -0.0022701560519635677, -0.008382473140954971, -0.05271846801042557, -0.008610032498836517, 0.03193692862987518, 0.003437145845964551, 0.019489163532853127, 0.05000472441315651, -0.012582345865666866, 0.024466851726174355, -0.027642732486128807, -0.021123135462403297, -0.001315504894591868, -0.02010340616106987, 0.04309080168604851, 0.0034889017697423697, -0.014385830610990524, -0.023399706929922104, 0.010471840389072895, -0.013526957482099533, 0.057268962264060974, 0.02814030647277832, 0.02657393552362919, 0.01646159589290619, 0.0014574214583262801, -0.04628264158964157, -0.03591759502887726, 0.036386117339134216, 0.006972425151616335, 0.03654339537024498, 0.012448945082724094, 0.0003960194590035826, -0.012551135383546352, 0.024805482476949692, -0.0013132739113643765, -0.03025055304169655, -0.005826915148645639, -0.06486593186855316, -0.0019570966251194477, -0.0061321742832660675, -0.003815337084233761, -0.05655726045370102, 0.03455033898353577, -0.014741815626621246, -0.024680471047759056, -0.02691599354147911, -0.03487904369831085, -0.04661783576011658, -0.01754681020975113, 0.07209563255310059, -0.008380264975130558, 0.03794587776064873, -0.018512992188334465, -0.05224829539656639, 0.0036659729667007923, -0.0313129648566246, 0.053585443645715714, 0.029836183413863182, 0.03562444821000099, -0.01593185029923916, -0.019565517082810402, 0.026524148881435394, 0.036025289446115494, -0.03214157745242119, -0.036870479583740234, 0.012346521019935608, -0.028474602848291397, -0.04737621918320656, 0.038341645151376724, 0.027444390580058098, 0.019906572997570038, 0.045064639300107956, -0.025459598749876022, 0.044607505202293396, 0.0357765331864357, 0.0017619073623791337, -0.03085486590862274, 0.042252469807863235, -0.003066716017201543, 0.021762069314718246, -0.0036531772930175066, -0.006310827098786831, 0.03154485672712326, -0.026920294389128685, -0.017146697267889977, 0.012708863243460655, 0.017146149650216103, 0.01426385436207056, -0.01506416592746973, 0.030908998101949692, 0.026212263852357864, 0.008294587023556232, -0.007948890328407288, -0.023982588201761246, 0.0019218296511098742, -0.023518741130828857, -0.00017484977433923632, 0.026915714144706726, -0.0025803535245358944, -0.016522716730833054, 0.03744455799460411, -0.007534231524914503, 0.03047386184334755, 0.07001125812530518, 0.0024523900356143713, -0.02281993441283703, -0.05113321915268898 ]
Accelerating Stable Diffusion XL Inference with JAX on Cloud TPU v5e
pcuenq
October 3, 2023
sdxl_jax
sdxl, jax, stable diffusion, guide, tpu, google
https://huggingface.co/blog/sdxl_jax
How does the demo work? The demo we showed before was built using a script that essentially follows the code we posted in this blog post. It runs on a few Cloud TPU v5e devices with 4 chips each, and there's a simple load-balancing server that routes user requests to backend servers randomly. When you enter a prompt in the demo, your request will be assigned to one of the backend servers, and you'll receive the 4 images it generates. This is a simple solution based on several pre-allocated TPU instances. In a future post, we'll cover how to create dynamic solutions that adapt to load using GKE. All the code for the demo is open-source and available in Hugging Face Diffusers today. We are excited to see what you build with Diffusers + JAX + Cloud TPUs!
[ 0.0803661197423935, -0.04987950250506401, 0.014894386753439903, -0.02673688530921936, 0.07899633049964905, 0.082887664437294, -0.018325256183743477, -0.0040792725048959255, 0.008632667362689972, -0.07165110111236572, -0.034435369074344635, -0.016013048589229584, -0.02847995050251484, 0.0778324082493782, -0.05324803292751312, -0.03450761362910271, 0.03517735376954079, -0.03500157967209816, -0.0010381601750850677, 0.01879410445690155, 0.004849203862249851, -0.020207341760396957, 0.028658168390393257, -0.0661754310131073, -0.025299720466136932, -0.06341996788978577, 0.002955351723358035, 0.044174592941999435, 0.041453488171100616, 0.007355694659054279, -0.021764952689409256, 0.011939439922571182, -0.007528294343501329, -0.024572031572461128, 0.03618266433477402, -0.03138483315706253, -0.0905059427022934, 0.03626016899943352, 0.021404298022389412, 0.003745672293007374, 0.009399168193340302, -0.03231504186987877, -0.06682143360376358, 0.039215486496686935, -0.008561776950955391, -0.05690901726484299, -0.1548442244529724, 0.058795321732759476, -0.12200138717889786, -0.009070247411727905, -0.11906725913286209, -0.009082511998713017, 0.036725085228681564, -0.06462908536195755, 0.0534319169819355, 0.06214110553264618, 0.018216319382190704, -0.02623393014073372, 0.08394476771354675, -0.032071925699710846, 0.013745788484811783, -0.015051553957164288, 0.008304120041429996, 0.04947887733578682, 0.031567253172397614, -0.023396071046590805, 0.030671501532197, 0.05417998880147934, 0.0007694350206293166, -0.018020331859588623, 0.022303231060504913, 0.015348046086728573, 0.026219017803668976, 0.05289893597364426, 0.024736907333135605, 0.010773394256830215, -0.0007574279443360865, 0.06918998062610626, 0.04693034291267395, 0.060594648122787476, -0.011138436384499073, -0.008310552686452866, 0.029749946668744087, -0.02049674279987812, 0.02071482315659523, 0.014197050593793392, 0.02297060564160347, -0.022744154557585716, -0.06660264730453491, 0.026270372793078423, -0.003194409189745784, -0.09128522872924805, 0.034389179199934006, 0.008355173282325268, 0.02720891684293747, -0.002475361805409193, -0.0007322022574953735, 0.03661034256219864, 0.047937531024217606, 0.002275836654007435, 0.01339995488524437, -0.020556310191750526, -0.004294767510145903, -0.09706567227840424, -0.037310391664505005, 0.028062904253602028, -0.00496129784733057, -0.11453433334827423, -0.007553740404546261, 0.023139432072639465, 0.02335827611386776, -0.033083029091358185, 0.0715780109167099, 0.09166541695594788, -0.10275644809007645, 0.021406792104244232, 0.007844517938792706, -0.012762943282723427, 0.04653659090399742, -0.03849960118532181, -0.017857607454061508, 0.06577661633491516, -0.03960608318448067, -0.04978233203291893, -0.0010420270264148712, 0.04963994771242142, -0.025165745988488197, -0.00803922489285469, -0.037259116768836975, -0.051914796233177185, 0.030682524666190147, -0.049449656158685684, 0.044843606650829315, -0.03370720148086548, 0.0315406508743763, -0.013168801553547382, 0.04521847516298294, -0.05966447666287422, 0.0632271021604538, 0.023862075060606003, 0.02569100260734558, 0.055448126047849655, -0.034668032079935074, -0.04985661059617996, -0.029234619811177254, -0.023065168410539627, -0.040174826979637146, -0.013579954393208027, -0.06382893770933151, 0.03494451940059662, -0.06562774628400803, 0.08827127516269684, 0.010519425384700298, -0.00849485956132412, -0.020187705755233765, 0.06346603482961655, -0.0037084114737808704, -0.02748115547001362, -0.010155268013477325, -0.05311989411711693, -0.04423767700791359, 0.0005476322839967906, -0.03862997889518738, 0.04894198477268219, -0.02241164818406105, 0.09696167707443237, 0.034787554293870926, 0.025277448818087578, 0.051108505576848984, -0.048986874520778656, -0.015078680589795113, -0.01830359734594822, 0.0014067854499444366, 0.019730040803551674, 0.052014995366334915, -0.011362418532371521, 0.10001596808433533, 0.017361510545015335, 0.06191941723227501, -0.049853768199682236, -0.08006740361452103, 0.05458960309624672, 0.06019272655248642, 0.009365912526845932, -0.00016811149544082582, -0.051781006157398224, 0.04365800321102142, 0.05614939332008362, 0.007701235357671976, 0.0020182214211672544, 0.005418079439550638, 0.025860706344246864, 0.07122506201267242, 0.022883091121912003, -0.008796592243015766, -0.03165503218770027, -0.06779574602842331, 0.007753042969852686, 0.014157140627503395, 0.043205276131629944, 0.052209872752428055, 0.04394081234931946, 0.027518991380929947, -0.08170991390943527, -0.04419945552945137, -0.02661857195198536, 0.044172994792461395, -0.022859079763293266, -0.001704995520412922, -0.010958361439406872, -0.07022159546613693, -0.10478159040212631, -0.007309761829674244, -0.004926896654069424, -0.010599030181765556, 0.0010632236953824759, -0.01266496628522873, -0.039795149117708206, -0.008101457729935646, 0.006857725791633129, 0.10216284543275833, 0.037085387855768204, -0.0006028112838976085, -0.008478670381009579, 0.02076439931988716, 0.03882260620594025, 0.08807920664548874, 0.01314370334148407, 0.0875064805150032, -0.04394613578915596, -0.058813177049160004, -0.04859045892953873, -0.09653139114379883, -0.013007748872041702, -0.01659855991601944, 0.0289166197180748, 0.08118625730276108, -0.046838391572237015, -0.02475249394774437, -0.031156176701188087, 0.0010121166706085205, 0.04839830845594406, -0.040889568626880646, 0.030039489269256592, -0.026394763961434364, -0.05096733197569847, 0.023310400545597076, 0.040358345955610275, -0.1378396600484848, -0.024481596425175667, -0.062097132205963135, 0.0075107053853571415, -0.07083701342344284, -0.04030744731426239, 0.060448773205280304, -0.00617631059139967, -0.008577324450016022, -0.0036811844911426306, -0.03509493172168732, 0.03950854018330574, -0.008222038857638836, 0.018605168908834457, -0.03352244943380356, -0.048794180154800415, -0.006880549248307943, -0.012025214731693268, -0.003777740290388465, 0.0005448284791782498, 0.054805122315883636, -0.04584608972072601, 0.03514724597334862, -0.010582531802356243, 0.013628077693283558, 0.010640126653015614, -0.04021038860082626, -0.0022984116803854704, -0.01494616363197565, -0.0022410599049180746, 0.016963966190814972, -0.04014819487929344, 0.024579057469964027, -0.024583032354712486, 0.05697363615036011, 0.011352118104696274, 0.04272540286183357, -0.011570410802960396, 0.03815039247274399, -0.012108298018574715, -0.06675022840499878, 0.014056545682251453, 0.016269706189632416, 0.0009421739378012717, 0.004341553896665573, 0.013141746632754803, -0.022189872339367867, 0.0012225243262946606, -0.036406245082616806, 0.004374744836241007, -0.030147889629006386, 0.046271912753582, -0.01177994441241026, -0.044667989015579224, -0.030953221023082733, -0.00452114874497056, -0.013526481576263905, 0.015763351693749428, 0.0023118224926292896, 0.03052709437906742, -0.0838155746459961, -0.04588424414396286, 0.010600266046822071, 0.019380133599042892, 0.028138235211372375, 0.012904474511742592, 0.03976980596780777, -0.046413324773311615, 0.02359885163605213, 0.04104685038328171, 0.008502807468175888, 0.01340712234377861, -0.02510162815451622, -0.05504247173666954, -0.006327372044324875, -0.025256477296352386, 0.024321407079696655, 0.015967749059200287, 0.07236337661743164, -0.010939630679786205, -0.07887250930070877, 0.006650935392826796, 0.017592817544937134, -0.03188059478998184, -0.016225960105657578, 0.018782954663038254, 0.029204048216342926, -0.021858857944607735, 0.017877742648124695, -0.028482936322689056, -0.008380800485610962, -0.008591256104409695, -0.008252810686826706, 0.057632725685834885, -0.014743003994226456, 0.0006761553813703358, -0.005859721451997757, -0.009447378106415272, 0.02692449279129505, 0.009475423023104668, 0.005638763774186373, 0.030630232766270638, -0.0039966111071407795, 0.03661739081144333, 0.036538511514663696, 0.027697836980223656, -0.008049585856497288, 0.02178327925503254, 0.06595779955387115, 0.011570420116186142, -0.012108918279409409, 0.016871202737092972, -0.006791641935706139, 0.015375947579741478, 0.014770696870982647, -0.004911486059427261, -0.000804981857072562, 0.01479523815214634, 0.009279618971049786, -0.006269445177167654, -0.029184795916080475, -0.003655219916254282, 0.00874077994376421, 0.004918504972010851, 0.006698746234178543, 0.06449241936206818, 0.02324184775352478, 0.0058781602419912815, -0.04411464184522629, -0.02802492119371891, 0.02178320288658142, 0.051662709563970566, 0.018705349415540695, 0.0015590217662975192, 0.03859325870871544, -0.0010797340655699372, 0.013526005670428276, -0.02951139025390148, 0.04081982001662254, 0.016128648072481155, 0.0021105033811181784, 0.029343990609049797, -0.02027006819844246, -0.04206714406609535, 0.03748580813407898, -0.03799565136432648, -0.006318983621895313, -0.013429991900920868, 0.0033354090992361307, 0.017675016075372696, 0.014358974061906338, -0.05219770595431328, 0.011570928618311882, -0.018347622826695442, 0.007122879382222891, 0.02086833491921425, 0.03122073784470558, 0.062216226011514664, 0.003830039408057928, -0.01080541592091322, 0.03285316377878189, -0.04487122222781181, -0.04032393917441368, 0.025474539026618004, -0.017329752445220947, -0.027979329228401184, -0.06054523587226868, -0.03206755220890045, 0.0155327208340168, 0.045588020235300064, 0.023834358900785446, 0.010860295966267586, -0.003059995360672474, -0.007046871818602085, 0.02916513755917549, 0.03981110453605652, 0.02319185435771942, -0.012784186750650406, 0.003312516724690795, -0.023028532043099403, -0.012166788801550865, 0.005699630361050367, 0.035258498042821884, -0.044487833976745605, -0.008123161271214485, 0.035775717347860336, -0.025664448738098145, 0.023168817162513733, -0.019725194200873375, -0.020483098924160004, 0.014583957381546497, -0.07119240611791611, 0.04689725115895271, 0.025584101676940918, -0.02763448655605316, 0.007169974502176046, -0.030049869790673256, 0.022315284237265587, -0.026768431067466736, -0.03739622235298157, 0.0172978974878788, -0.014977398328483105, 0.040232010185718536, -0.014918756671249866, 0.017965039238333702, 0.017885224893689156, -0.01433633640408516, 0.01834041252732277, -0.0203684214502573, -0.04312572628259659, 0.026803817600011826, -0.02327851764857769, -0.06852047145366669, -0.012595799751579762, 0.0330720916390419, 0.00882902555167675, -0.031469520181417465, -0.011391816660761833, 0.01600080169737339, 0.043824512511491776, -0.03167804330587387, 0.04363909363746643, -0.046420734375715256, -0.0020143690053373575, -0.02947138622403145, 0.018911579623818398, -0.02670465037226677, -0.002393309259787202, -0.01788516528904438, 0.01711166277527809, 0.008325068280100822, -0.02323576621711254, -0.0077937887981534, 0.015038100071251392, -0.0018421569839119911, 0.05474363639950752, 0.024597113952040672, 0.008077871985733509, 0.004589538089931011, 0.0453466959297657, -0.03829336538910866, 0.05158344656229019, 0.03066529519855976, -0.06598208844661713, 0.054838430136442184, -0.0012356819352135062, 0.040529798716306686, 0.027029013261198997, 0.026639746502041817, 0.04014129191637039, -0.053803738206624985, 0.0009040310396812856, -0.02857896126806736, 0.008553926832973957, 0.03166583552956581, -0.06516038626432419, -0.006847165524959564, 0.06950848549604416, -0.03587979078292847, -0.012684154324233532, -0.0001615612127352506, 0.05850937217473984, -0.03479761257767677, -0.013996947556734085, 0.019402001053094864, 0.005408490542322397, 0.0016722804866731167, 0.03476054593920708, 0.015882916748523712, -0.05290447175502777, -0.01490306667983532, -0.0035245022736489773, -0.021859554573893547, -0.024599244818091393, -0.016993289813399315, -0.03338169679045677, -0.022209221497178078, -0.024999374523758888, 0.04656961187720299, 0.04470585659146309, -0.009249648079276085, -0.006513040047138929, 0.010809814557433128, -0.028984351083636284, -0.004275573417544365, -0.03442509472370148, 0.02338463068008423, 0.017602751031517982, -0.026708312332630157, -0.002901321742683649, 0.036789678037166595, 0.014901194721460342, -0.019408395513892174, -0.03318927064538002, 0.029687821865081787, -0.00816264282912016, 0.008474967442452908, -0.017475517466664314, 0.027945253998041153, -0.013142511248588562, -0.0007829557871446013, -0.011294436641037464, -0.02541225031018257, -0.008909875527024269, -0.0402350127696991, 0.05011367425322533, 0.058543406426906586, -0.043838609009981155, 0.018161874264478683, -0.010512982495129108, 0.009823013097047806, 0.020236104726791382, -0.05469290539622307, -0.026253486052155495, 0.013938430696725845, 0.017549941316246986, 0.012601564638316631, 0.01372118853032589, 0.0037860677111893892, 0.008797109127044678, -0.016148628666996956, -0.043628670275211334, 0.022146450355648994, 0.015655260533094406, -0.03381151333451271, 0.01936132274568081, 0.004584355279803276, 0.02642648108303547, 0.01721152663230896, -0.0016458642203360796, 0.0064437552355229855, 0.014116044156253338, -0.01581200584769249, -0.02964719757437706, -0.010519271716475487, 0.01212987955659628, 0.006086170673370361, 0.06788713485002518, 0.023007657378911972, 0.013107920065522194, 0.04412097483873367, 0.07257453352212906, -0.008553792722523212, 0.027790570631623268, -0.021390222012996674, -0.008580666035413742, 0.07111924141645432, -0.002094432944431901, 0.06300511956214905, 0.02917257323861122, -0.017279906198382378, -0.016397781670093536, 0.02068597450852394, -0.05364109203219414, -0.032268036156892776, 0.022112136706709862, 0.023387892171740532, 0.007980922237038612, -0.03470887616276741, -0.019948752596974373, 0.049625612795352936, 0.06406066566705704, 0.07019416987895966, 0.012563519179821014, -0.015788458287715912, 0.026324598118662834, 0.03069530799984932, 0.055376987904310226, 0.03307056799530983, 0.005609267391264439, 0.0024320923257619143, 0.0288560651242733, -0.005190955474972725, 0.0299308393150568, -0.009747128002345562, 0.03825335204601288, 0.027885621413588524, -0.017176466062664986, -0.03161506727337837, 0.04135611653327942, -0.01059435959905386, 0.013509050942957401, -0.021679438650608063, -0.0490528866648674, -0.019148334860801697, -0.0035386132076382637, -0.001639643800444901, 0.021329810842871666, -0.017197279259562492, 0.042058851569890976, 0.005755238234996796, 0.02114143781363964, 0.030621444806456566, -0.026233792304992676, 0.019111759960651398, 0.024940604344010353, 0.024528995156288147, 0.02689201571047306, -0.06004713848233223, -0.02642582729458809, -0.028743579983711243, 0.03176426142454147, 0.0447218082845211, -0.027662592008709908, 0.01606651581823826, -0.020806370303034782, 0.006319600157439709, 0.026041824370622635, 0.01422722078859806, 0.0371917225420475, 0.04000147059559822, 0.0031109058763831854, -0.010666738264262676, 0.015525473281741142, -0.006995057221502066, -0.024321530014276505, -0.041909463703632355, -0.03770549222826958, 0.004786652512848377, 0.006554738152772188, -0.005513111129403114, -0.06077554076910019, 0.021602898836135864, -0.01882505603134632, -0.043364208191633224, 0.050459589809179306, 0.019158290699124336, -0.009349020197987556, 0.04174664616584778, -0.004412755835801363, -0.023134607821702957, 0.027168549597263336, 0.0037043693009763956, 0.027966933324933052, 0.003298050258308649, -0.007028232794255018, 0.005743253510445356, -0.0011418999638408422, -0.05476333945989609, 0.020287830382585526, 0.040456101298332214, 0.03521593660116196, 0.060945503413677216, 0.03381528705358505, -0.005163608118891716, -0.0244966521859169, 0.01539110578596592, 0.03044821135699749, -0.054549604654312134, 0.04438023641705513, -0.051737044006586075, -0.04732297733426094, -0.007772217039018869, -0.020260831341147423, 0.01793026551604271, 0.0526367612183094, -0.03133881464600563, 0.004084034822881222, -0.019225575029850006, -0.01865937002003193, -0.057698287069797516, 0.008875899948179722, 0.022219793871045113, -0.014579216949641705, 0.031842757016420364, 0.01971258968114853, 0.0010540846269577742, -0.01383950561285019, -0.027976008132100105, 0.0018820337718352675, 0.039954546838998795, 0.042867373675107956, 0.003947542514652014, -0.0674748346209526, -0.03625846654176712, 0.020050816237926483, -0.028106575831770897, 0.01333973091095686, 0.048591431230306625, -0.015390238724648952, -0.04457797110080719, 0.000008229641935031395, -0.0008384693646803498, -0.02965420112013817, 0.06378455460071564, -0.042382415384054184, 0.01836492121219635, 0.027905398979783058, 0.02091546542942524, -0.040273167192935944, 0.010953264310956001, -0.011029485613107681, 0.015788041055202484, 0.0063177235424518585, -0.02598813734948635, -0.007267994340509176, -0.020538441836833954, -0.006688284687697887, 0.0598611943423748, 0.01976645365357399, -0.041671037673950195, -0.005776986945420504, -0.011345591396093369, 0.020223302766680717, -0.02135615237057209, -0.02030695043504238, -0.038452550768852234, 0.0008106657769531012, -0.013394715264439583, -0.004769417457282543, -0.011467919684946537, -0.049428146332502365, -0.030317027121782303, -0.004810819402337074, -0.014875994063913822, 0.058150514960289, 0.013287095353007317, -0.031102262437343597, -0.00946928933262825, -0.007848802022635937 ]
Accelerating over 130,000 Hugging Face models with ONNX Runtime
sschoenmeyer
October 4, 2023
ort-accelerating-hf-models
open-source-collab, onnxruntime, onnx, inference
https://huggingface.co/blog/ort-accelerating-hf-models
What is ONNX Runtime? ONNX Runtime is a cross-platform machine learning tool that can be used to accelerate a wide variety of models, particularly those with ONNX support.
[ 0.016025537624955177, -0.02823541685938835, 0.034507300704717636, -0.011251226998865604, 0.0463925376534462, 0.06940818578004837, -0.0007734484970569611, 0.05869797617197037, -0.02716282568871975, -0.039408836513757706, -0.09921584278345108, 0.03517136722803116, 0.016436997801065445, 0.03838278353214264, 0.05545685440301895, -0.022860044613480568, -0.01019605714827776, -0.05709445849061012, 0.02532121166586876, -0.03208623826503754, -0.009813366457819939, -0.0781332403421402, 0.048733901232481, -0.031221458688378334, -0.07780489325523376, -0.015120073221623898, -0.017014089971780777, -0.05146324262022972, -0.062030185014009476, 0.025132767856121063, -0.07926201820373535, 0.021045399829745293, -0.023842401802539825, -0.05244535952806473, -0.03420355170965195, -0.0127711808308959, -0.059722159057855606, 0.05781332403421402, 0.02827773615717888, -0.037370141595602036, -0.012783856131136417, -0.020553037524223328, -0.08250545710325241, 0.0461684875190258, 0.02318883128464222, -0.0024244235828518867, -0.16272161900997162, 0.019182275980710983, 0.014769208617508411, -0.04644782468676567, -0.060069724917411804, 0.031840432435274124, -0.07255508005619049, -0.0013633794151246548, -0.013337631709873676, 0.0738338828086853, -0.015644386410713196, -0.05526672303676605, 0.0153995081782341, 0.0340874008834362, 0.07185686379671097, -0.00823825504630804, 0.01920797862112522, 0.005911848973482847, 0.00911205355077982, -0.03138775750994682, 0.013801946304738522, -0.002154305810108781, -0.03633248060941696, -0.02210218831896782, -0.04225226864218712, 0.05669889226555824, -0.026747191324830055, -0.011648236773908138, 0.0008960582199506462, -0.05909239128232002, -0.0029259331058710814, 0.05115243420004845, 0.1080123782157898, 0.040413748472929, 0.010714772157371044, 0.05632803961634636, 0.0784175917506218, 0.03293193504214287, -0.017331412062048912, 0.024902256205677986, -0.017999835312366486, 0.005952782463282347, -0.04549766331911087, -0.025081561878323555, 0.08293727785348892, -0.09460657835006714, 0.03974300995469093, 0.025098346173763275, 0.00021768886654172093, -0.019700637087225914, 0.0504327118396759, -0.013161293230950832, -0.014983294531702995, -0.01974128931760788, 0.021497812122106552, -0.10785222053527832, 0.032652515918016434, -0.04034464806318283, -0.03293962404131889, 0.018676895648241043, -0.009114151820540428, -0.05128457024693489, -0.10793211311101913, 0.021040193736553192, -0.018775392323732376, 0.03113139420747757, 0.011070698499679565, 0.034808449447155, -0.04220375791192055, 0.030984751880168915, -0.014584222808480263, 0.03253345191478729, 0.03539396822452545, 0.024581681936979294, 0.013648363761603832, 0.06934650987386703, -0.024388430640101433, 0.0012632409343495965, 0.02238372713327408, 0.08231858909130096, 0.06602457165718079, -0.01268170215189457, 0.058095283806324005, -0.05390559881925583, 0.020339548587799072, -0.02307942323386669, -0.011873007752001286, 0.01998099870979786, 0.026218494400382042, -0.002913197036832571, -0.009728405624628067, -0.00893475767225027, -0.004692533984780312, 0.04702385514974594, -0.0931796059012413, -0.01917733997106552, 0.011874339543282986, 0.06551558524370193, 0.04678025096654892, -0.0036832368932664394, -0.03940996527671814, 0.04523475095629692, -0.057597920298576355, -0.04253179952502251, -0.03132154047489166, 0.01988322101533413, 0.004170297645032406, -0.02683349885046482, -0.03419569507241249, 0.04418144002556801, -0.0417967326939106, -0.0599244125187397, -0.07649959623813629, -0.021420227363705635, -0.03895777836441994, -0.005649595521390438, -0.04591122269630432, 0.025143016129732132, 0.03520873934030533, -0.030908038839697838, 0.04510417580604553, 0.01402860227972269, -0.008264758624136448, -0.07499166578054428, 0.003797076642513275, -0.07284431904554367, 0.056219957768917084, -0.047402508556842804, 0.003938817419111729, -0.05315985158085823, 0.006771406624466181, 0.05570821091532707, 0.04311536252498627, -0.038359541445970535, -0.03699273243546486, 0.08392836898565292, 0.017932765185832977, 0.014425023458898067, -0.017143085598945618, -0.03383726254105568, 0.016061583533883095, -0.05153752863407135, 0.028487510979175568, 0.04753725975751877, -0.04683839902281761, -0.06881004571914673, 0.06447692215442657, -0.06919408589601517, 0.012901035137474537, -0.048042282462120056, -0.02327727898955345, 0.11837851256132126, -0.023501047864556313, 0.0984453484416008, 0.09013043344020844, -0.036799460649490356, 0.04943251609802246, -0.04645668715238571, -0.029921673238277435, 0.014254642650485039, 0.08250080794095993, -0.09142102301120758, 0.040690403431653976, -0.01368999294936657, -0.010502920486032963, -0.09394130110740662, 0.061420831829309464, -0.05137411132454872, 0.013207693584263325, 0.03772653266787529, -0.08284083008766174, -0.006534939631819725, 0.018488343805074692, -0.0003587591927498579, 0.15446847677230835, -0.056033652275800705, 0.03704158216714859, -0.07588785886764526, -0.016227640211582184, -0.014793487265706062, 0.005874945316463709, -0.01849864237010479, 0.0599127821624279, -0.09562156349420547, 0.042703162878751755, 0.007435465697199106, -0.042264580726623535, 0.0690331757068634, -0.026178859174251556, 0.07087329030036926, 0.07623979449272156, 0.01816324144601822, 0.03610411286354065, -0.03286343440413475, -0.017295166850090027, -0.011689869686961174, -0.01364177092909813, 0.04065554961562157, 0.03459807485342026, -0.03942038118839264, 0.06244312971830368, -0.10101286321878433, 0.0592382587492466, -0.022498754784464836, -0.005834940820932388, -0.03366970643401146, 0.09385377913713455, -0.11226807534694672, 0.008929348550736904, 0.04721735790371895, 0.002684825100004673, -0.014052052982151508, 0.004027870949357748, 0.04075126349925995, 0.026652609929442406, -0.03749069944024086, 0.03349578380584717, -0.012225261889398098, 0.035451240837574005, -0.03133828192949295, 0.012763758189976215, 0.05754213035106659, 0.01894337125122547, 0.018975097686052322, 0.050846826285123825, -0.07523752748966217, -0.0029261275194585323, -0.013861848041415215, 0.023280760273337364, 0.004639496561139822, 0.011250593699514866, -0.025564689189195633, -0.06447696685791016, -0.05540180206298828, 0.002360202372074127, -0.02470959722995758, 0.04507283866405487, 0.024123521521687508, 0.04149007424712181, -0.018057819455862045, 0.02552161179482937, -0.02071201801300049, -0.022044677287340164, 0.019328542053699493, -0.015003212727606297, -0.010255122557282448, 0.009402851574122906, 0.039697811007499695, 0.023434890434145927, -0.024963559582829475, 0.038400936871767044, 0.004896863363683224, -0.026133883744478226, 0.023921843618154526, 0.006295980419963598, 0.002433459274470806, 0.00018674899183679372, 0.0021038285922259092, -0.02007976546883583, 0.06259436160326004, 0.0007760050939396024, 0.01680050604045391, -0.10737575590610504, -0.02960461564362049, -0.03807487338781357, 0.013949411921203136, -0.011831633746623993, -0.06915779411792755, 0.0014015048509463668, 0.05966750159859657, 0.023747600615024567, 0.053548216819763184, -0.013065177947282791, 0.024198874831199646, 0.005932979751378298, -0.010573063977062702, 0.0226507019251585, -0.00620666891336441, 0.004886961542069912, 0.03388798609375954, 0.00020928747835569084, 0.017158912494778633, -0.02719910256564617, 0.027642952278256416, -0.000042835428757825866, 0.02148672565817833, -0.03869866952300072, 0.04959983751177788, -0.0005659175221808255, 0.019142985343933105, -0.03634927421808243, -0.022379402071237564, -0.033044543117284775, -0.027420490980148315, -0.03759647533297539, -0.00836120080202818, -0.021490834653377533, -0.00819355621933937, -0.017495064064860344, -0.023123912513256073, 0.06051374971866608, 0.03631403297185898, -0.011733961291611195, -0.027890751138329506, 0.0548287108540535, -0.024896720424294472, 0.0042954240925610065, -0.008919455111026764, 0.022430026903748512, -0.024704178795218468, 0.010288877412676811, 0.008643418550491333, -0.049407970160245895, 0.0003422890149522573, 0.008542411960661411, 0.022906124591827393, 0.017899153754115105, 0.008316240273416042, -0.03494151309132576, 0.000026228830392938107, 0.048331428319215775, -0.008635015226900578, -0.04704543575644493, 0.011846416629850864, 0.027023624628782272, -0.0023200104478746653, -0.05529239401221275, -0.015909118577837944, 0.0426226407289505, 0.03745159134268761, -0.022058114409446716, 0.007276260759681463, 0.014814643189311028, 0.027154872193932533, 0.0019487824756652117, 0.01668975129723549, -0.007255292031913996, 0.028693245723843575, -0.03578289970755577, -0.030341176316142082, 0.03983708843588829, -0.010239087045192719, 0.004661369137465954, -0.003224701853469014, 0.007618416100740433, -0.016091983765363693, 0.007962046191096306, 0.033763352781534195, -0.022645972669124603, 0.013485364615917206, 0.0036585121415555477, 0.030023181810975075, -0.003399844514206052, -0.06063494831323624, 0.06092445179820061, 0.008909548632800579, 0.013457933440804482, 0.013734575361013412, 0.01275666430592537, 0.03708311915397644, -0.007117713335901499, -0.010506944730877876, -0.0218321792781353, -0.031597163528203964, -0.006394267547875643, -0.022620022296905518, -0.0010361868189647794, 0.02512967400252819, -0.006231512874364853, -0.025900229811668396, 0.017948441207408905, -0.04791583865880966, 0.009880182333290577, -0.04278389364480972, -0.01717468723654747, 0.01515459455549717, 0.0019066280219703913, 0.0007282219594344497, -0.018251441419124603, 0.010901202447712421, -0.023673243820667267, 0.0360560268163681, -0.02972901426255703, 0.018452143296599388, -0.021870361641049385, 0.0017115769442170858, 0.010637922212481499, -0.011458766646683216, 0.02939063310623169, -0.002601807238534093, 0.0033059059642255306, -0.013761481270194054, -0.026077931746840477, 0.0339060015976429, 0.04059116169810295, 0.058890845626592636, 0.01474207267165184, 0.00510199973359704, -0.0020648809149861336, -0.024526625871658325, 0.00688872579485178, -0.0395166277885437, -0.006881585344672203, -0.007446978706866503, 0.024377472698688507, -0.0017438422655686736, 0.050763729959726334, 0.014577019959688187, -0.0457289032638073, 0.019294532015919685, -0.020482419058680534, 0.02264012023806572, 0.004101757425814867, -0.011492923833429813, -0.007923761382699013, -0.02294144593179226, 0.022623274475336075, 0.031288035213947296, 0.017684973776340485, -0.015485084615647793, -0.0019495734013617039, 0.03442124277353287, -0.00007136327621992677, -0.05112215131521225, 0.01428973488509655, -0.0427745096385479, 0.03602857515215874, 0.013296708464622498, 0.03113556280732155, -0.03805335983633995, 0.004032328724861145, -0.0069830031134188175, -0.040213100612163544, 0.011277110315859318, -0.012957560829818249, -0.032096102833747864, -0.012346288189291954, 0.023119917139410973, 0.03685188293457031, 0.006248150020837784, -0.016794046387076378, 0.022002480924129486, -0.017541034147143364, 0.015553887002170086, -0.018507912755012512, -0.018012208864092827, -0.008247978053987026, 0.05492004379630089, 0.05232490599155426, 0.0286931861191988, -0.00890151597559452, 0.005634386092424393, 0.004590957425534725, -0.010010371915996075, 0.021308064460754395, -0.04708360880613327, 0.044045474380254745, -0.004485118668526411, -0.032843247056007385, -0.004927915520966053, -0.027349960058927536, -0.035160940140485764, 0.003221271326765418, 0.004953363444656134, 0.014102699235081673, -0.02575337328016758, 0.05391018092632294, -0.01542828232049942, 0.0022077150642871857, -0.011701815761625767, -0.012864969670772552, 0.008396347984671593, -0.016788920387625694, -0.009477325715124607, -0.01816912181675434, 0.005321923177689314, -0.005281844642013311, -0.024605661630630493, -0.010838385671377182, 0.0286263320595026, 0.016635946929454803, 0.010519659146666527, -0.013226966373622417, -0.01870647817850113, -0.019200557842850685, 0.015258034691214561, 0.011280004866421223, -0.006585275754332542, 0.01310795173048973, 0.01885763555765152, 0.005336733069270849, 0.024963539093732834, 0.055193182080984116, -0.0020150847267359495, 0.018688471987843513, 0.009410939179360867, 0.04543624818325043, -0.007122203707695007, -0.015395772643387318, 0.05269823595881462, 0.020234445109963417, -0.014208834618330002, -0.013365493156015873, -0.005775490775704384, -0.023699156939983368, -0.013864013366401196, -0.04348573088645935, -0.015563215129077435, 0.03248162195086479, -0.019854597747325897, 0.04892775043845177, 0.02994411066174507, 0.026238858699798584, -0.02781396172940731, 0.023227497935295105, -0.012142455205321312, -0.0035462460946291685, 0.003975728526711464, 0.027601834386587143, -0.028583528473973274, -0.004477720707654953, -0.005606439895927906, 0.014882230199873447, -0.035491034388542175, -0.003053834894672036, 0.011353226378560066, -0.036838285624980927, 0.03211688995361328, -0.01622897945344448, -0.002969972789287567, 0.03264988213777542, 0.043962784111499786, -0.0051885382272303104, 0.05089779570698738, 0.034055158495903015, 0.046865176409482956, -0.00509272888302803, -0.0013559825019910932, -0.012167554348707199, 0.10610175877809525, 0.0035288576036691666, 0.07390524446964264, 0.016103016212582588, 0.06207875907421112, 0.012688412331044674, 0.004205045755952597, 0.0009355499059893191, 0.009706729091703892, 0.09700076282024384, -0.024653593078255653, 0.02767927013337612, 0.04536203294992447, -0.02405875362455845, -0.03883256018161774, 0.007059299387037754, 0.034184832125902176, -0.047679074108600616, -0.005812063347548246, -0.007872029207646847, 0.015602321363985538, 0.03160388767719269, -0.01830778829753399, 0.037262216210365295, 0.007673599757254124, 0.041166216135025024, 0.009248802438378334, 0.04089032858610153, 0.018656041473150253, 0.038106679916381836, 0.026016445830464363, 0.010520154610276222, 0.009201260283589363, 0.0042361789382994175, 0.05071384459733963, -0.0019925814121961594, 0.03229852765798569, -0.012243969365954399, 0.02097337506711483, 0.014467376284301281, -0.011359989643096924, -0.028822891414165497, -0.014590751379728317, 0.020675787702202797, -0.008647540584206581, -0.004095608834177256, -0.007738024927675724, -0.040879987180233, 0.008783857338130474, -0.009709290228784084, 0.016878247261047363, 0.017008217051625252, -0.020795470103621483, -0.0149696571752429, 0.012640653178095818, -0.011007399298250675, 0.04304184392094612, -0.03691960126161575, -0.0002518676337786019, -0.007537298370152712, 0.03971119597554207, -0.02938530035316944, -0.020889023318886757, -0.017960069701075554, 0.019955866038799286, -0.021161196753382683, 0.01096876710653305, -0.000186237579328008, -0.0010698758997023106, -0.014198792167007923, 0.01927335560321808, -0.020489443093538284, 0.003323909593746066, 0.06379760056734085, 0.04387092962861061, -0.048169080168008804, 0.00033405309659428895, -0.02260967716574669, -0.03186877444386482, 0.0030639555770903826, -0.008841073140501976, -0.023195866495370865, -0.028616394847631454, 0.03199069947004318, 0.02627214975655079, 0.04375879466533661, -0.027342965826392174, 0.0012242243392392993, 0.018913310021162033, -0.03219278156757355, -0.03966916352510452, 0.053059764206409454, 0.003063617739826441, 0.0006956003489904106, 0.017685648053884506, -0.006190906278789043, -0.007963727228343487, -0.01480054296553135, -0.0010635392973199487, 0.02099696919322014, -0.0048156436532735825, -0.010316338390111923, -0.04523824155330658, 0.03181249648332596, 0.026072364300489426, 0.026526883244514465, 0.02551974356174469, 0.06033308804035187, -0.0004883547080680728, -0.047312457114458084, 0.03165683522820473, -0.018680889159440994, 0.04996751248836517, -0.013769170269370079, -0.033567868173122406, -0.028727062046527863, 0.009781119413673878, 0.014164097607135773, 0.012152044102549553, -0.020213482901453972, 0.019510386511683464, 0.024497605860233307, 0.013541413471102715, -0.043554842472076416, -0.006620632950216532, 0.017730476334691048, 0.058690931648015976, -0.0010565794073045254, 0.007078607566654682, -0.000013319457139004953, 0.038856230676174164, -0.008887688629329205, 0.0751759335398674, 0.07124331593513489, -0.0049901725724339485, -0.03689947724342346, -0.0023219557479023933, 0.05305862054228783, -0.06556562334299088, -0.04557495564222336, 0.002990908222272992, 0.0050934976898133755, 0.02216687612235546, -0.012610075995326042, 0.014460104517638683, 0.016284512355923653, -0.0366315133869648, 0.038465920835733414, -0.024076538160443306, 0.01527412049472332, -0.046151772141456604, -0.02134164795279503, -0.06662523001432419, -0.01377106737345457, -0.01867336966097355, -0.04454172030091286, 0.001747561851516366, -0.012065405957400799, 0.005270105786621571, -0.010374225676059723, -0.023053595796227455, 0.004191985819488764, -0.014996569603681564, -0.025003721937537193, 0.002981410827487707, -0.020325426012277603, 0.011377179063856602, -0.012126968242228031, -0.011519378051161766, 0.03179240971803665, 0.018068362027406693, -0.005122925620526075, -0.023610610514879227, 0.0006122186896391213, 0.027968214824795723, 0.03948657959699631, 0.05245206877589226, -0.05972376465797424, 0.048425912857055664, 0.03300818055868149, -0.01813052035868168, -0.008923038840293884, 0.02419489622116089 ]
Accelerating over 130,000 Hugging Face models with ONNX Runtime
sschoenmeyer
October 4, 2023
ort-accelerating-hf-models
open-source-collab, onnxruntime, onnx, inference
https://huggingface.co/blog/ort-accelerating-hf-models
Learn More To learn more about accelerating Hugging Face models with ONNX Runtime, check out our recent post on the Microsoft Open Source Blog.
[ 0.00927004124969244, -0.05925112962722778, 0.06491158157587051, -0.010131705552339554, 0.05546367168426514, 0.07639091461896896, 0.0217082891613245, 0.08311580866575241, -0.030064815655350685, -0.09409045428037643, -0.07936209440231323, 0.04589412733912468, -0.0072190603241324425, 0.03893866017460823, 0.042154088616371155, -0.028358550742268562, 0.032607607543468475, -0.03285926207900047, -0.010579983703792095, 0.012308270670473576, -0.007311742287129164, -0.0685335174202919, 0.07400309294462204, 0.011273423209786415, -0.0473986491560936, -0.06275317817926407, 0.011518995277583599, -0.062303993850946426, -0.01918221265077591, 0.022241581231355667, -0.08762280642986298, -0.018243439495563507, 0.011985099874436855, -0.016768330708146095, 0.006716392934322357, 0.024469967931509018, -0.13783176243305206, 0.054999224841594696, 0.022563418373465538, -0.02944197505712509, 0.019018162041902542, -0.018740909174084663, -0.0636589527130127, 0.039234694093465805, 0.022244401276111603, -0.02131226845085621, -0.21985626220703125, 0.061342909932136536, 0.01915358565747738, -0.04168721288442612, -0.04068000614643097, 0.008213410153985023, -0.02903679758310318, 0.01831522211432457, 0.004526825156062841, 0.025639960542321205, -0.008528800681233406, -0.05819480121135712, -0.00934766884893179, -0.02582228183746338, 0.05109727382659912, -0.028529496863484383, -0.00393864419311285, 0.016859695315361023, 0.05083650350570679, 0.02881390042603016, -0.013621648773550987, -0.01928996481001377, -0.03604793921113014, -0.0117629524320364, 0.023366598412394524, -0.004737601149827242, -0.0023228826466947794, -0.004402327351272106, 0.01646345481276512, -0.04985753074288368, 0.0020098844543099403, 0.027783486992120743, 0.12210230529308319, 0.05602816492319107, 0.004475679248571396, 0.00809811893850565, 0.07263029366731644, 0.08323537558317184, -0.007572484668344259, 0.04310803487896919, 0.04185137152671814, -0.022582905367016792, -0.049924589693546295, 0.01740015670657158, -0.023079633712768555, -0.05937209352850914, 0.046919047832489014, 0.013436192646622658, 0.05650122091174126, -0.012050907127559185, 0.03091205097734928, 0.025069208815693855, 0.027802729979157448, -0.020441746339201927, 0.008952297270298004, -0.09065959602594376, -0.020814169198274612, -0.05174362659454346, -0.057056546211242676, 0.008297048509120941, -0.022393113002181053, -0.09873820841312408, -0.08558176457881927, 0.02866416983306408, -0.012973046861588955, 0.02897387184202671, -0.01036796160042286, 0.042700860649347305, -0.09184671938419342, 0.04810157045722008, -0.0010505755199119449, -0.005505724344402552, 0.023827848955988884, 0.024067508056759834, 0.02419099025428295, 0.10407279431819916, 0.01904887706041336, -0.02468428574502468, 0.039700835943222046, 0.06185464933514595, 0.043237339705228806, -0.004708782769739628, -0.03355485200881958, -0.05524618923664093, -0.023111524060368538, -0.02902798168361187, 0.01797027885913849, 0.015577815473079681, 0.021489817649126053, -0.04442502185702324, 0.014072283171117306, -0.03180675581097603, 0.01779939979314804, 0.023030851036310196, -0.047493938356637955, 0.03604546934366226, 0.024058310315012932, 0.04474528878927231, 0.06670177727937698, -0.00866125337779522, -0.12819361686706543, 0.06916818022727966, -0.03925449028611183, -0.017070870846509933, 0.006223767995834351, 0.0579042062163353, 0.0027299667708575726, -0.04094550013542175, 0.0018081386806443334, 0.04210849478840828, -0.00751962186768651, -0.0420534722507, -0.04498780518770218, -0.03913130611181259, -0.0300312377512455, 0.002140404423698783, -0.04359656572341919, -0.019467251375317574, 0.05353471264243126, -0.00088907202007249, 0.028609810397028923, -0.00032463265233673155, -0.014372568577528, -0.07691822201013565, 0.010511789470911026, -0.028674792498350143, 0.03807774558663368, -0.06294994801282883, -0.015618651174008846, 0.01356473844498396, 0.033221159130334854, 0.07301090657711029, 0.02467065118253231, -0.032235290855169296, -0.0707114115357399, 0.06607218831777573, 0.036816708743572235, 0.021191928535699844, 0.03618522733449936, -0.050026532262563705, 0.041176244616508484, -0.02806752361357212, -0.015309937298297882, 0.010937917046248913, -0.0651916041970253, -0.04399024695158005, 0.07647661864757538, -0.0463835708796978, -0.008453570306301117, -0.04190094769001007, -0.029538432136178017, 0.16294454038143158, 0.007872844114899635, 0.10137420892715454, 0.09917499870061874, 0.014026087708771229, 0.06252393871545792, -0.007172636687755585, -0.0491165928542614, 0.00391008798032999, 0.0612664632499218, -0.06183113902807236, -0.0069936891086399555, -0.0030755088664591312, 0.012047622352838516, -0.13073967397212982, 0.020156564190983772, -0.03764236345887184, 0.03400956094264984, -0.010444289073348045, -0.048013124614953995, -0.01713816076517105, -0.001550390850752592, -0.011691801249980927, 0.15319497883319855, -0.031984876841306686, 0.04019487276673317, -0.03966766595840454, -0.03006218746304512, 0.022418079897761345, 0.07104968279600143, 0.01613932102918625, 0.09065549075603485, -0.09319742023944855, -0.0043884082697331905, -0.04108315706253052, -0.04212667793035507, 0.08732342720031738, 0.018879564478993416, 0.022523896768689156, 0.03322504088282585, -0.02103530429303646, 0.03857576474547386, -0.016185060143470764, -0.00782078318297863, -0.059077173471450806, 0.012795261107385159, 0.04673859477043152, 0.008901122957468033, -0.05634836107492447, 0.05164610967040062, -0.0013994063483551145, -0.02640724927186966, -0.017467278987169266, -0.0701146274805069, 0.07438948005437851, 0.03945218399167061, -0.07226041704416275, 0.059764668345451355, 0.057453811168670654, 0.0037070182152092457, 0.0016234902432188392, -0.038887519389390945, 0.04386478662490845, 0.03328096866607666, -0.0018471390940248966, -0.014451319351792336, -0.019584618508815765, -0.018033115193247795, -0.03822891414165497, -0.00988948903977871, 0.02631724253296852, 0.013861877843737602, 0.06426768004894257, 0.018903277814388275, -0.059166550636291504, 0.005415437277406454, 0.0006230326252989471, 0.00507903890684247, 0.0018237937474623322, 0.05750463157892227, -0.004241051152348518, -0.04026562720537186, -0.05110080540180206, -0.013644348829984665, -0.039013445377349854, 0.04202849417924881, 0.03299889340996742, 0.030613338574767113, -0.013672859407961369, 0.027594327926635742, -0.03205832093954086, -0.022671706974506378, 0.043947696685791016, 0.0064820293337106705, -0.012705303728580475, -0.002990567358210683, -0.0252329520881176, 0.01923409290611744, 0.0033808995503932238, 0.01818675734102726, 0.0002575275138951838, -0.02320592664182186, 0.028213191777467728, -0.006162830162793398, -0.011022335849702358, 0.0194453913718462, -0.007717851549386978, -0.01609453558921814, 0.042367059737443924, 0.011892412789165974, 0.020734546706080437, -0.12475103884935379, -0.028738265857100487, -0.02486162818968296, 0.04048912599682808, -0.018155615776777267, -0.05051375925540924, 0.03032262623310089, 0.008867342956364155, -0.01529387291520834, 0.02292937971651554, 0.004158462397754192, 0.039552781730890274, 0.014126910828053951, -0.016674429178237915, -0.006351993419229984, -0.014070418663322926, -0.006114615593105555, 0.01146028470247984, 0.015290187671780586, 0.0035812596324831247, -0.029801297932863235, 0.029117777943611145, -0.010397813282907009, -0.01878131553530693, -0.015882954001426697, 0.010398090817034245, 0.015652166679501534, 0.017280500382184982, 0.010261070914566517, -0.02361890859901905, -0.021731942892074585, -0.010446056723594666, -0.029705023393034935, 0.033327288925647736, -0.030076470226049423, -0.013994595967233181, -0.03975432738661766, -0.019636182114481926, 0.03064657188951969, 0.02221529372036457, 0.018305258825421333, -0.024663373827934265, 0.038941890001297, -0.0072158509865403175, -0.01582973077893257, -0.0018552951514720917, 0.0039411187171936035, -0.0076523046009242535, 0.0632382184267044, -0.005227146204560995, -0.045678094029426575, -0.0010276262182742357, 0.023750126361846924, 0.0544310137629509, 0.004350723698735237, 0.02875380963087082, -0.029147468507289886, 0.022830341011285782, 0.030069099739193916, -0.008903705514967442, -0.05144243314862251, 0.022622741758823395, -0.003723067929968238, -0.00032966159051284194, -0.02851291000843048, 0.04048994928598404, 0.001629738137125969, 0.008856589905917645, -0.04166947677731514, 0.017483418807387352, 0.010748191736638546, 0.01462478470057249, -0.022369543090462685, 0.016182823106646538, -0.008060758002102375, 0.03465616703033447, -0.02545134536921978, -0.02384154684841633, 0.05491207167506218, -0.016004003584384918, -0.012703738175332546, -0.01457579992711544, 0.0119406096637249, 0.004246246535331011, -0.003841640427708626, 0.017974236980080605, 0.01605943590402603, 0.03818235546350479, 0.003042787779122591, 0.04013263061642647, -0.02380797639489174, -0.029440712183713913, 0.038560427725315094, -0.003349966136738658, 0.03238324820995331, 0.007239514496177435, 0.0453488826751709, 0.039943765848875046, 0.012698438949882984, 0.009603782556951046, -0.00861290656030178, -0.01286492869257927, -0.0030662280041724443, 0.0014027052093297243, 0.008972636424005032, 0.03004922717809677, -0.020075829699635506, -0.035292018204927444, 0.035642195492982864, -0.019099347293376923, 0.0026846646796911955, -0.050677139312028885, -0.01867516338825226, -0.03081379272043705, 0.006640205625444651, -0.0024217197205871344, -0.005786136258393526, -0.014661237597465515, -0.049341149628162384, 0.030785737559199333, -0.02192302979528904, 0.03939582407474518, -0.014761319383978844, 0.003520952770486474, 0.019108207896351814, 0.0012206431711092591, 0.006935433018952608, 0.002258313586935401, -0.0027074136305600405, 0.008115186356008053, -0.005922926124185324, -0.01755908690392971, 0.049232665449380875, 0.03473803028464317, 0.009299319237470627, 0.0004232214705552906, -0.0062980796210467815, 0.017270196229219437, -0.015632638707756996, -0.0503808818757534, -0.009728819131851196, 0.0017093006754294038, 0.015815556049346924, -0.02337413653731346, 0.03796146810054779, 0.016586847603321075, -0.034286607056856155, 0.0010946645634248853, 0.001935608685016632, 0.03772111237049103, 0.04130252078175545, -0.03195510804653168, -0.030765391886234283, 0.0285443477332592, 0.050281818956136703, 0.025759687647223473, 0.02302035130560398, -0.0020520754624158144, 0.0027255292516201735, 0.03474385663866997, -0.01154155470430851, -0.007837073877453804, -0.0542939268052578, 0.01638772338628769, 0.007189689204096794, -0.000322635198244825, 0.001787800807505846, -0.04949120432138443, 0.015687385573983192, -0.007575194351375103, -0.02550210803747177, -0.006716371048241854, -0.0018212073482573032, -0.01776754856109619, -0.00959160178899765, 0.029854005202651024, 0.07366584241390228, 0.006195745896548033, 0.008169690147042274, 0.030782027170062065, -0.0108059486374259, 0.014231382869184017, 0.03306862339377403, -0.013577562756836414, -0.0013802535831928253, 0.0437653474509716, 0.05938756465911865, 0.034130048006772995, 0.007907774299383163, 0.007953548803925514, -0.0246946532279253, -0.017321724444627762, -0.004873768426477909, -0.03189536929130554, 0.01962376944720745, 0.017912402749061584, -0.024779316037893295, -0.020774515345692635, -0.00981006771326065, -0.00640740105882287, 0.005070981103926897, 0.03119579702615738, -0.012917186133563519, -0.007263572420924902, 0.027762116864323616, -0.00023432172019965947, -0.01425640657544136, -0.013800605200231075, 0.011829783208668232, -0.03311178460717201, -0.01679242216050625, 0.0016396983992308378, -0.027720967307686806, -0.013060307130217552, 0.009804856032133102, -0.02642095275223255, -0.041635580360889435, 0.03561769798398018, 0.02061818726360798, 0.04473559185862541, -0.010719357058405876, -0.003495872253552079, -0.0379241518676281, -0.009480860084295273, 0.005415191873908043, -0.0178285650908947, -0.011950712651014328, 0.0054458132945001125, -0.016222355887293816, 0.030172929167747498, 0.021709032356739044, -0.02375067211687565, -0.019192788749933243, 0.035601336508989334, 0.03282700851559639, 0.012189121916890144, -0.04252712056040764, 0.02856340818107128, 0.010233447887003422, 0.004149573855102062, 0.00990427564829588, -0.03733339533209801, -0.02160147950053215, -0.040603067725896835, -0.06728599965572357, 0.01905413717031479, 0.06650754064321518, -0.02292993851006031, 0.018102677538990974, 0.004707737360149622, 0.024796823039650917, -0.01850234344601631, 0.020402925089001656, -0.023121794685721397, 0.013466869480907917, -0.0012860361021012068, 0.02282700501382351, -0.024229301139712334, -0.014205265790224075, -0.014933427795767784, -0.0009907592320814729, -0.07115547358989716, 0.013817785307765007, 0.012539432384073734, -0.03852800279855728, 0.041372667998075485, -0.0020119959954172373, -0.015587697736918926, 0.04594004154205322, 0.03311999887228012, 0.007372732274234295, 0.03228207305073738, 0.012143220752477646, 0.006034791003912687, -0.009518415667116642, -0.01071631908416748, 0.045442406088113785, 0.09996502846479416, 0.019652489572763443, 0.024087777361273766, 0.010453470051288605, 0.04101729393005371, 0.014017482288181782, 0.0048934780061244965, 0.0007634881185367703, -0.0015716293128207326, 0.07341625541448593, -0.004810295067727566, 0.044028401374816895, 0.034898512065410614, -0.024714943021535873, -0.010348771698772907, -0.02746761590242386, 0.0022258127573877573, -0.040834296494722366, -0.011324604041874409, -0.0050666057504713535, -0.00020099582616239786, 0.02900981903076172, -0.03479629382491112, 0.045780621469020844, 0.03891197219491005, 0.01904817298054695, -0.004511387553066015, -0.0087497653439641, 0.030284371227025986, 0.0282431673258543, 0.005005051847547293, 0.024973485618829727, -0.018119744956493378, 0.009537176229059696, 0.046540457755327225, 0.01738821528851986, 0.017970403656363487, -0.0038930291775614023, 0.00968236569315195, 0.0423966646194458, -0.015042086131870747, -0.009589001536369324, -0.03426087647676468, 0.036172714084386826, -0.009325429797172546, 0.0036066242028027773, 0.005568584427237511, -0.056600045412778854, -0.022237595170736313, 0.0033090724609792233, 0.010690851137042046, -0.02141219936311245, 0.004932894837111235, 0.026244616135954857, 0.0470956526696682, 0.00047787977382540703, 0.007557269651442766, 0.010157798416912556, 0.018896665424108505, 0.014048406854271889, 0.02581801451742649, -0.020408382639288902, -0.012646250426769257, -0.018539728596806526, -0.014257033355534077, -0.004129044245928526, -0.005609705112874508, -0.012454855255782604, -0.01342773251235485, 0.0195176862180233, 0.02943119779229164, 0.0016403418267145753, 0.02031378075480461, 0.04276217892765999, 0.007418851368129253, -0.05446944758296013, 0.026920581236481667, 0.004537209868431091, -0.020898982882499695, -0.010049553588032722, -0.03950205817818642, -0.004178262315690517, -0.03526950627565384, 0.009894280694425106, 0.02141975611448288, 0.03972363471984863, -0.03903775289654732, -0.03866066038608551, -0.0018891225336119533, -0.018010985106229782, 0.004724663682281971, 0.03324151039123535, 0.003563871141523123, -0.027613596990704536, -0.023233851417899132, 0.0066004348918795586, -0.01668591797351837, -0.019403235986828804, 0.0063423290848731995, -0.006100271362811327, -0.04042278602719307, -0.03191174939274788, -0.03557426854968071, 0.0719904974102974, 0.033952467143535614, 0.027327442541718483, 0.033014602959156036, 0.019342495128512383, 0.025381339713931084, -0.06353899091482162, 0.016113394871354103, -0.015868928283452988, 0.026266543194651604, -0.018010485917329788, -0.03698223829269409, -0.013780126348137856, -0.024329718202352524, 0.01745278760790825, -0.007169338874518871, -0.023162897676229477, -0.009811178781092167, -0.004383551888167858, 0.03339585289359093, -0.03302374482154846, 0.006320333108305931, 0.03256358951330185, 0.0514688603579998, 0.010618685744702816, 0.03685446456074715, 0.0005930349580012262, 0.022669930011034012, 0.0025757174007594585, 0.05803347006440163, 0.08221971988677979, 0.004479848779737949, -0.04299602657556534, -0.02845514751970768, 0.02661946602165699, -0.028667286038398743, -0.080971859395504, 0.02577890269458294, 0.006149550434201956, 0.0001525023253634572, -0.03074084222316742, -0.0009604764054529369, 0.009085780940949917, -0.02620096690952778, 0.04609881341457367, -0.015801724046468735, -0.03865988925099373, -0.025587715208530426, 0.03889232128858566, -0.054923009127378464, 0.016306238248944283, -0.03055620566010475, 0.00808623805642128, 0.03594495356082916, -0.01421909686177969, 0.003118314314633608, -0.007027589250355959, -0.011010327376425266, 0.0002774801687337458, -0.005157717503607273, -0.04408589377999306, -0.006245502270758152, -0.02278585359454155, 0.00306259305216372, 0.0043219029903411865, -0.04648648947477341, 0.04433026537299156, 0.023833882063627243, -0.011351126246154308, -0.028907161206007004, -0.029076576232910156, 0.006423706654459238, 0.004452724475413561, 0.03612884506583214, -0.01684698462486267, 0.0639096274971962, 0.03842047601938248, -0.035443179309368134, -0.019174057990312576, 0.01761293038725853 ]
Accelerating over 130,000 Hugging Face models with ONNX Runtime
sschoenmeyer
October 4, 2023
ort-accelerating-hf-models
open-source-collab, onnxruntime, onnx, inference
https://huggingface.co/blog/ort-accelerating-hf-models
Hugging Face ONNX Runtime Support There are over 130,000 ONNX-supported models on Hugging Face, an open source community that allows users to build, train, and deploy hundreds of thousands of publicly available machine learning models. These ONNX-supported models, which include many increasingly popular large language models (LLMs) and cloud models, can leverage ONNX Runtime to improve performance, along with other benefits. For example, using ONNX Runtime to accelerate the whisper-tiny model can improve average latency per inference, with an up to 74.30% gain over PyTorch. ONNX Runtime works closely with Hugging Face to ensure that the most popular models on the site are supported. In total, over 90 Hugging Face model architectures are supported by ONNX Runtime, including the 11 most popular architectures (where popularity is determined by the corresponding number of models uploaded to the Hugging Face Hub): | Model Architecture | Approximate No. of Models | |:------------------:|:-------------------------:| | BERT | 28180 | | GPT2 | 14060 | | DistilBERT | 11540 | | RoBERTa | 10800 | | T5 | 10450 | | Wav2Vec2 | 6560 | | Stable-Diffusion | 5880 | | XLM-RoBERTa | 5100 | | Whisper | 4400 | | BART | 3590 | | Marian | 2840 |
[ -0.014330188743770123, -0.027320168912410736, 0.010504266247153282, -0.04665980488061905, 0.004142128396779299, 0.12052704393863678, 0.029712429270148277, 0.09325093775987625, -0.032131485641002655, -0.027264278382062912, -0.11789368838071823, 0.059678249061107635, -0.013491013087332249, 0.024165531620383263, 0.029589900746941566, -0.08827044069766998, 0.02047238126397133, -0.002796897664666176, -0.022114435210824013, 0.005893560592085123, 0.025862758979201317, -0.08607976883649826, 0.04114161804318428, -0.04461513087153435, -0.0630856305360794, -0.03888968378305435, -0.010119547136127949, -0.031130721792578697, -0.045263003557920456, 0.015289167873561382, -0.1116454005241394, 0.0007724007009528577, -0.01633138582110405, -0.05004841089248657, 0.028996363282203674, -0.004383806139230728, -0.10419269651174545, 0.05911378934979439, 0.04344587028026581, 0.011392996646463871, 0.026298291981220245, -0.033187586814165115, -0.10157470405101776, 0.06428781896829605, 0.022497404366731644, -0.0068047624081373215, -0.08686896413564682, 0.03607429563999176, 0.03792900592088699, -0.014476638287305832, -0.12255469709634781, 0.036334328353405, -0.029487965628504753, 0.01904814876616001, 0.0209328792989254, 0.027413543313741684, -0.005106139462441206, -0.05118587613105774, 0.009498342871665955, 0.05235562101006508, 0.001664914540015161, -0.044367626309394836, 0.02511044405400753, 0.030472908169031143, 0.015950022265315056, 0.0251307375729084, -0.06981818377971649, -0.022522063925862312, -0.010315125808119774, -0.021934377029538155, 0.016544293612241745, 0.024393972009420395, -0.005879754666239023, -0.015269762836396694, 0.003440583124756813, -0.03095014952123165, 0.010457945056259632, 0.023083891719579697, 0.10076329857110977, 0.006883109919726849, 0.000788782665040344, 0.014159937389194965, 0.014777250587940216, 0.032502125948667526, 0.006326989736407995, 0.046058040112257004, 0.008891225792467594, -0.014310544356703758, -0.08987627923488617, 0.01237237174063921, 0.020031416788697243, -0.08315833657979965, 0.0598367340862751, 0.021412426605820656, 0.01540423184633255, 0.017029788345098495, -0.017550675198435783, -0.011242017149925232, -0.009765014052391052, -0.030948670580983162, 0.0306717399507761, -0.10064341872930527, 0.009973148815333843, -0.07272964715957642, -0.06334145367145538, 0.06065090745687485, -0.01714380271732807, -0.07136690616607666, -0.07420741021633148, -0.007187551353126764, 0.007851839996874332, -0.04923654720187187, -0.011712735518813133, 0.03152437135577202, -0.08969855308532715, 0.05257220193743706, -0.02708820253610611, 0.007692242972552776, 0.05740297585725784, 0.04146784916520119, 0.01398439146578312, 0.0784081369638443, 0.024268316105008125, -0.030079536139965057, 0.020144877955317497, 0.08807005733251572, 0.017884541302919388, -0.02132011391222477, 0.013031981885433197, -0.04670175537467003, 0.01440709363669157, -0.022987542673945427, 0.007302318699657917, -0.03889565169811249, 0.04330608248710632, -0.020178774371743202, 0.00016941862122621387, -0.033577244728803635, 0.06224283203482628, 0.030948016792535782, -0.08556542545557022, 0.07951059937477112, 0.014914172701537609, 0.0471930131316185, 0.0944729819893837, 0.004939224570989609, -0.07382603734731674, 0.03949350863695145, -0.04566939175128937, -0.02921813167631626, -0.08650454133749008, 0.03511068597435951, 0.00373747106641531, -0.03874773904681206, -0.002340781968086958, 0.053790610283613205, -0.028805643320083618, -0.044175297021865845, -0.01439285185188055, -0.029061049222946167, -0.04704916104674339, -0.03849563002586365, -0.033596139401197433, 0.009250886738300323, 0.0500871017575264, -0.015731478109955788, 0.022883430123329163, 0.01106746681034565, -0.015564993023872375, -0.02980218455195427, 0.0288002397865057, -0.052757326513528824, 0.016116168349981308, -0.05229632183909416, 0.004051774274557829, -0.0005521725979633629, 0.03824780508875847, 0.06087560951709747, 0.0668129175901413, -0.040708526968955994, -0.05997037515044212, 0.05820240080356598, 0.06487506628036499, 0.05158907175064087, 0.02623564563691616, -0.0674005001783371, 0.034105945378541946, -0.03486413508653641, 0.0012226286344230175, 0.04110691696405411, 0.022552331909537315, -0.01777878776192665, 0.0647779032588005, 0.006825502961874008, 0.0065376730635762215, -0.014161424711346626, -0.025356419384479523, 0.1154930591583252, 0.007600045297294855, 0.06709536910057068, 0.12447986751794815, -0.028229447081685066, 0.07368773221969604, 0.011025731451809406, -0.03307443484663963, 0.018025794997811317, 0.028576454147696495, -0.09894780069589615, -0.004653607029467821, 0.0015893732197582722, 0.041349757462739944, -0.13307948410511017, 0.03089377097785473, -0.027550965547561646, 0.03469640389084816, -0.07971210032701492, -0.06410329043865204, -0.04789965972304344, 0.04841746762394905, 0.027509016916155815, 0.19344846904277802, -0.030355354771018028, 0.0154331149533391, -0.0767526924610138, -0.05037879943847656, 0.007050305604934692, 0.060500618070364, 0.060249049216508865, 0.05568118393421173, -0.04655805975198746, -0.003509383648633957, -0.05379440635442734, -0.041571538895368576, 0.02047043666243553, 0.01907346211373806, 0.04866459220647812, 0.06584291160106659, 0.01103390846401453, 0.0027667998801916838, -0.021527152508497238, -0.0381634458899498, -0.03330843150615692, 0.009594819508492947, 0.05046788975596428, 0.02855471707880497, -0.030995875597000122, 0.041726138442754745, -0.037708111107349396, 0.023761749267578125, -0.024044064804911613, -0.05692709609866142, 0.03398535028100014, 0.03659232333302498, -0.07240753620862961, 0.0005379626527428627, 0.06097306311130524, 0.0012399906991049647, 0.02250821702182293, -0.02524370513856411, 0.051240697503089905, 0.029053259640932083, -0.02157304808497429, -0.009988348931074142, 0.0013914144365116954, -0.0024264121893793344, -0.026212163269519806, -0.01992974802851677, 0.0070304484106600285, 0.017780404537916183, 0.027953799813985825, 0.0723009780049324, -0.05911371856927872, 0.00023317993327509612, 0.008093908429145813, 0.021228577941656113, 0.018157020211219788, 0.033655427396297455, -0.0019911229610443115, -0.051601897925138474, -0.05640742555260658, 0.019913822412490845, -0.027934817597270012, 0.037929631769657135, 0.028790652751922607, 0.009964408352971077, -0.010060080327093601, 0.026905041188001633, -0.06138860061764717, -0.042471203953027725, 0.012290921062231064, 0.02830876223742962, -0.00009710547601571307, -0.004228292964398861, -0.019208868965506554, 0.002543120412155986, -0.01579509675502777, 0.011938952840864658, -0.01816467195749283, -0.05299412086606026, 0.02982347272336483, -0.011492641642689705, -0.028473319485783577, -0.002776765963062644, -0.0030787368305027485, -0.00880750548094511, 0.051176294684410095, 0.01043335534632206, 0.014989268034696579, -0.08994859457015991, 0.005269591696560383, -0.06764049082994461, 0.022043738514184952, -0.0052856444381177425, -0.06069706380367279, 0.030820971354842186, 0.03654338791966438, 0.027626603841781616, 0.08425357192754745, 0.012688587419688702, 0.02775610238313675, 0.004978199489414692, -0.026122767478227615, 0.011792706325650215, -0.0043238126672804356, -0.009962422773241997, 0.011962272226810455, 0.04345431551337242, -0.004583837930113077, -0.03350437805056572, -0.004181030672043562, 0.017966607585549355, 0.013058345764875412, -0.010041948407888412, -0.032695189118385315, 0.030291570350527763, 0.00553926033899188, 0.01171900425106287, -0.03680366650223732, 0.00482561532407999, -0.00926603376865387, -0.030804123729467392, 0.005760091822594404, -0.058632466942071915, -0.014416144229471684, -0.0036988917272537947, 0.003618778195232153, 0.05941504240036011, 0.03469443321228027, -0.022525137290358543, -0.007382044568657875, 0.03541884571313858, 0.00982598029077053, 0.02231724001467228, 0.01277551893144846, -0.010556031949818134, -0.045934583991765976, 0.029311083257198334, 0.030823225155472755, -0.03187623992562294, -0.007138688117265701, 0.003796084551140666, 0.011298892088234425, 0.006369263865053654, 0.007174291647970676, -0.024544622749090195, -0.005571303423494101, 0.017145546153187752, -0.0015876287361606956, -0.05443432182073593, 0.02105056680738926, -0.02784748002886772, 0.0027238279581069946, -0.010209348984062672, 0.011905193328857422, 0.022318365052342415, -0.00787887442857027, 0.00978862028568983, 0.004943441599607468, 0.012754221446812153, 0.03414610028266907, -0.01594526134431362, 0.007849552668631077, -0.026194844394922256, 0.016435815021395683, -0.04600538685917854, -0.03358343988656998, 0.04988441616296768, 0.016567640006542206, -0.018293119966983795, -0.00800555944442749, -0.0070501770824193954, 0.006966446992009878, 0.019872566685080528, -0.005765915382653475, 0.01741604506969452, 0.0068684532307088375, 0.03025766834616661, 0.044392772018909454, -0.026566673070192337, -0.05513324588537216, 0.02833474427461624, 0.012734421528875828, 0.03585274890065193, -0.014082197099924088, -0.0036256664898246527, 0.057754889130592346, -0.012921611778438091, 0.00024854662478901446, -0.025457488372921944, -0.048982009291648865, -0.005375910084694624, -0.04115702956914902, -0.014102484099566936, 0.015529932454228401, -0.018989892676472664, -0.040651220828294754, 0.01898549497127533, -0.029662461951375008, -0.0013827502261847258, -0.008376018144190311, -0.010264625772833824, -0.011452344246208668, 0.057273201644420624, 0.007264045067131519, -0.009358767420053482, 0.01080726832151413, -0.0288343857973814, 0.01852642372250557, 0.0008366302936337888, 0.03286467492580414, -0.021986426785588264, 0.002231297316029668, 0.020698437467217445, 0.024282138794660568, 0.022132916375994682, -0.018858125433325768, -0.0051168533973395824, -0.0005276916781440377, -0.028939509764313698, 0.00195879559032619, 0.05293426662683487, 0.03747156262397766, -0.016031485050916672, -0.018881499767303467, -0.016771206632256508, 0.01179804652929306, -0.010603087954223156, -0.021460864692926407, -0.030225582420825958, 0.008485667407512665, 0.021179569885134697, 0.00316316494718194, 0.03189004585146904, 0.01440039835870266, -0.020351175218820572, 0.005222241394221783, -0.034268688410520554, 0.041537608951330185, 0.02964111603796482, -0.03547519072890282, -0.018721414729952812, 0.02303740568459034, 0.03692356497049332, 0.004272904247045517, -0.012270903214812279, 0.0198031235486269, 0.03483927622437477, 0.04976784437894821, -0.02017800323665142, 0.012332013808190823, -0.013048326596617699, 0.000993239344097674, -0.00021032962831668556, 0.00603893306106329, 0.018402419984340668, -0.03371043875813484, -0.03116278164088726, 0.01166041661053896, -0.04117831215262413, -0.00380525435321033, -0.02027783915400505, -0.017611082643270493, 0.005542390514165163, 0.03384445607662201, 0.047408539801836014, -0.00717393821105361, -0.010012166574597359, 0.04278005659580231, -0.027199506759643555, -0.005719298031181097, -0.00010864411160582677, -0.005259332247078419, 0.0013254901859909296, 0.03520969673991203, 0.06500724703073502, 0.07309853285551071, 0.0014341259375214577, 0.012086180038750172, -0.01062935683876276, -0.000833237252663821, 0.008409107103943825, -0.034017324447631836, 0.0279370229691267, -0.014755163341760635, -0.016875293105840683, 0.005373475607484579, -0.003953095059841871, -0.015122701413929462, -0.008995423093438148, 0.026241404935717583, -0.009003618732094765, 0.018366090953350067, 0.03496614471077919, -0.005326362792402506, 0.012897830456495285, -0.030724581331014633, 0.012399501167237759, -0.03363111615180969, -0.030622832477092743, -0.020521605387330055, -0.0112450597807765, 0.018043600022792816, 0.041048452258110046, -0.026181604713201523, -0.04117584601044655, 0.025613930076360703, 0.0241592638194561, 0.01854776032269001, -0.024381639435887337, -0.027146685868501663, -0.03702007979154587, -0.0353960357606411, -0.011507493443787098, -0.03204052522778511, -0.019685762003064156, -0.0007619779207743704, -0.013757209293544292, 0.005001702345907688, 0.05693049356341362, -0.0005465265712700784, 0.011040990240871906, 0.012856222689151764, 0.04256146401166916, -0.0034902601037174463, -0.017360061407089233, 0.03225848451256752, 0.031407423317432404, -0.00879834033548832, -0.024327438324689865, 0.013551106676459312, -0.008441469632089138, -0.014529353007674217, -0.04580999165773392, -0.0087262112647295, 0.028941074386239052, -0.02237272821366787, 0.009796497412025928, 0.0062764305621385574, 0.037914980202913284, 0.014232962392270565, 0.020650723949074745, -0.036336325109004974, 0.0055747064761817455, 0.006423795595765114, 0.03498273342847824, -0.027770454064011574, -0.0019181253155693412, 0.015281370840966702, 0.030182786285877228, -0.04279334843158722, 0.0158948116004467, 0.025034990161657333, -0.04633467271924019, -0.0035558363888412714, -0.016103005036711693, -0.028749633580446243, 0.03686892241239548, 0.04538358002901077, 0.025641346350312233, 0.00018533985712565482, 0.00941280834376812, 0.013990228995680809, -0.005623959004878998, 0.007864048704504967, 0.021631022915244102, 0.10142997652292252, 0.005411580670624971, 0.039364252239465714, 0.01792396977543831, 0.02612721361219883, 0.04351033642888069, 0.010812068358063698, 0.014920344576239586, -0.010975428856909275, 0.08908866345882416, 0.008357319980859756, 0.04002302885055542, 0.035742953419685364, -0.060059528797864914, -0.034279339015483856, -0.021343473345041275, 0.021294817328453064, -0.042281314730644226, -0.024973701685667038, -0.01243526116013527, 0.010068782605230808, 0.03397233784198761, -0.008351470343768597, 0.05186447501182556, 0.0354224294424057, 0.06343011558055878, 0.016867881640791893, 0.028491217643022537, 0.02283778227865696, 0.04046708717942238, 0.014235958456993103, 0.005455123260617256, 0.0001557019422762096, -0.003168818773701787, 0.026781462132930756, 0.03953874483704567, 0.052926674485206604, -0.00468690088018775, 0.02111579291522503, -0.024952711537480354, -0.035490404814481735, -0.015770310536026955, -0.005720214452594519, -0.0017613500822335482, 0.004419055767357349, -0.029600350186228752, 0.014535403810441494, -0.055936411023139954, -0.004662938881665468, -0.023610226809978485, 0.003191485768184066, 0.01799772121012211, -0.0006890754448249936, 0.004665552172809839, 0.027301030233502388, -0.012926468625664711, 0.014332782477140427, -0.012675534933805466, 0.0025888115633279085, -0.015761958435177803, 0.03797260299324989, -0.03099614940583706, -0.0342676006257534, 0.007455281913280487, 0.004172677174210548, -0.02098924107849598, 0.033558037132024765, -0.014319601468741894, -0.018889501690864563, -0.005272492300719023, 0.04308202490210533, 0.022569453343749046, 0.01088135875761509, 0.00907665304839611, 0.012716722674667835, -0.04664392024278641, -0.009972934611141682, -0.020900962874293327, -0.02328532561659813, -0.015230703167617321, -0.03714516758918762, -0.020039858296513557, -0.05975070595741272, 0.038201749324798584, 0.0221087709069252, 0.050534456968307495, -0.03775253891944885, -0.023890461772680283, 0.002870831871405244, -0.015361085534095764, -0.03607051447033882, 0.04910647124052048, 0.023097852244973183, -0.012609169818460941, 0.014990182593464851, -0.0038327635265886784, -0.024695130065083504, -0.02564530447125435, -0.006623351946473122, 0.023741675540804863, 0.0009807716123759747, -0.0316859669983387, -0.015026167035102844, 0.029855886474251747, 0.06188228726387024, 0.026908040046691895, 0.028016749769449234, 0.008032992482185364, 0.031725212931632996, -0.059138599783182144, 0.022540481761097908, -0.041684530675411224, 0.013714589178562164, -0.02264806441962719, -0.015028548426926136, -0.030583538115024567, 0.0070238676853477955, -0.01778465509414673, 0.00852273404598236, -0.015242896974086761, 0.01734173856675625, -0.012359135784208775, 0.027057921513915062, -0.018506648018956184, 0.01640343852341175, -0.0024373612832278013, 0.07152359932661057, -0.008716791868209839, 0.016655055806040764, -0.008701673708856106, 0.02951839379966259, -0.008261715061962605, 0.048208922147750854, 0.06967336684465408, -0.0142414765432477, -0.05052047222852707, -0.0025888001546263695, -0.01455251220613718, -0.01579107530415058, -0.06438499689102173, 0.01798761636018753, -0.002843513386324048, -0.0018658691551536322, -0.014977680519223213, 0.01686209812760353, 0.022967621684074402, -0.06552412360906601, 0.049371138215065, -0.02606884203851223, -0.0016701890854164958, -0.023843545466661453, 0.0329325795173645, -0.04784015193581581, 0.016256239265203476, -0.004036618862301111, -0.01642468012869358, 0.018788976594805717, -0.041040536016225815, 0.0036808843724429607, 0.00675449101254344, 0.022389737889170647, 0.013332733884453773, -0.02100159227848053, -0.07347042113542557, 0.013088012114167213, -0.00579297449439764, 0.0548212006688118, -0.003644264303147793, -0.009884902276098728, 0.028571896255016327, 0.019947923719882965, -0.004756126552820206, -0.03963159769773483, -0.00009277735080104321, -0.018415549769997597, 0.03814910352230072, 0.017537618055939674, -0.0527246817946434, 0.04408431053161621, 0.04016944393515587, -0.019696146249771118, -0.03563842549920082, 0.0002529292250983417 ]
Accelerating over 130,000 Hugging Face models with ONNX Runtime
sschoenmeyer
October 4, 2023
ort-accelerating-hf-models
open-source-collab, onnxruntime, onnx, inference
https://huggingface.co/blog/ort-accelerating-hf-models
# Accelerating over 130,000 Hugging Face models with ONNX Runtime
[ -0.013312800787389278, -0.019565781578421593, 0.0683802142739296, -0.034303706139326096, 0.012993406504392624, 0.0744435116648674, 0.024816270917654037, 0.04929168149828911, -0.032151542603969574, -0.06505564600229263, -0.0756450966000557, 0.0493701733648777, -0.011051126755774021, 0.05519391968846321, 0.03030039556324482, -0.04023434594273567, 0.023419052362442017, -0.022145122289657593, 0.0003267998108640313, -0.016426682472229004, -0.0003846175968647003, -0.08972270041704178, 0.0970195010304451, -0.017457012087106705, -0.07558377832174301, -0.03385067358613014, -0.011024460196495056, -0.0410136878490448, -0.03098679706454277, 0.014992333948612213, -0.09703423827886581, 0.0004965926054865122, 0.02519119158387184, -0.012378860265016556, -0.014325309544801712, 0.021576713770627975, -0.13792885839939117, 0.05290982872247696, 0.03978804498910904, -0.02137458696961403, -0.00866194162517786, -0.026613816618919373, -0.06626447290182114, 0.05353279784321785, 0.030217638239264488, -0.013542878441512585, -0.20601393282413483, 0.06804372370243073, 0.027957361191511154, -0.0345432385802269, -0.06949092447757721, 0.023707536980509758, -0.027452075853943825, -0.014486981555819511, -0.012299761176109314, 0.031183334067463875, -0.040457211434841156, -0.057853393256664276, -0.006999549921602011, -0.012772331945598125, 0.042861998081207275, -0.012786533683538437, 0.028641682118177414, 0.03655001521110535, 0.021187352016568184, 0.04642268270254135, -0.009379357099533081, -0.0017320489278063178, -0.05175255239009857, -0.012084594927728176, 0.03228309378027916, -0.005162413232028484, -0.007518320344388485, 0.016791805624961853, 0.013905894942581654, -0.054186105728149414, -0.002638892037793994, 0.023675188422203064, 0.13447749614715576, 0.06479120999574661, -0.004920256789773703, 0.0027417961973696947, 0.07230991870164871, 0.07478999346494675, 0.007229325361549854, 0.04245331510901451, 0.041408076882362366, -0.017519334331154823, -0.0530235692858696, 0.03366035595536232, 0.013873947784304619, -0.07468840479850769, 0.023491716012358665, 0.01013923343271017, 0.024667888879776, -0.005957710091024637, 0.017916936427354813, -0.014729039743542671, 0.03394719585776329, -0.02980867587029934, 0.037717122584581375, -0.0642271488904953, 0.009831457398831844, -0.05464715138077736, -0.0551992803812027, 0.030483033508062363, -0.02389143779873848, -0.11157388985157013, -0.07213012874126434, 0.01867959089577198, -0.021539155393838882, 0.018570441752672195, -0.009408843703567982, 0.008807801641523838, -0.08838491141796112, 0.06635673344135284, -0.008178339339792728, -0.008867624215781689, 0.05158521234989166, 0.04215202108025551, 0.02656550146639347, 0.09285794943571091, 0.0381598062813282, -0.004238876048475504, 0.03511857986450195, 0.07946345210075378, 0.03838777914643288, 0.01214711181819439, -0.025517230853438377, -0.027012396603822708, -0.008569411002099514, -0.0497228279709816, 0.01815970242023468, 0.013936644420027733, 0.007498765829950571, -0.0504763163626194, -0.003018473507836461, 0.019905904307961464, 0.008408230729401112, 0.03441639244556427, -0.07915876060724258, 0.03768718242645264, 0.025787353515625, 0.05100960284471512, 0.1011459082365036, -0.024347489699721336, -0.0906309112906456, 0.0764022171497345, -0.06624007970094681, -0.022430995479226112, -0.04771212115883827, 0.02601385861635208, -0.041754115372896194, -0.043947722762823105, 0.007240000646561384, 0.07371150702238083, -0.020410863682627678, -0.06940626353025436, -0.05122539401054382, -0.02345643751323223, -0.012211231514811516, -0.018897978588938713, -0.020963842049241066, -0.036708395928144455, 0.050669003278017044, -0.02585979551076889, 0.005360011477023363, 0.007100927643477917, -0.010606730356812477, -0.07685458660125732, 0.011796165257692337, -0.04602714627981186, 0.019514283165335655, -0.03534002602100372, -0.054661691188812256, 0.003701060311868787, 0.04774550348520279, 0.06371432542800903, 0.0023041083477437496, -0.0018274735193699598, -0.055077217519283295, 0.059455230832099915, 0.03700271621346474, 0.06922028958797455, 0.04774702340364456, -0.06467049568891525, 0.02342022769153118, 0.010896382853388786, 0.0049881162121891975, 0.05817727372050285, -0.026340926066040993, -0.035532597452402115, 0.09978866577148438, -0.04611244425177574, 0.021259158849716187, -0.06478682905435562, -0.004747762810438871, 0.13319453597068787, 0.024562234058976173, 0.08804496377706528, 0.06154564768075943, 0.049110300838947296, 0.10598012059926987, -0.03350938484072685, -0.04320391267538071, 0.00736128119751811, 0.032815154641866684, -0.07697048038244247, 0.017878131940960884, 0.004587666597217321, 0.030358048155903816, -0.1527176946401596, 0.028245268389582634, -0.05998338386416435, 0.0027029775083065033, -0.03636230155825615, -0.016940750181674957, -0.006098175887018442, 0.00031994120217859745, 0.003620425472036004, 0.1447916030883789, -0.0173338633030653, 0.003286423860117793, -0.05335955321788788, -0.03376741334795952, 0.027894018217921257, 0.0496077761054039, -0.007098119705915451, 0.06368394941091537, -0.08971843868494034, -0.0008561996510252357, -0.046472012996673584, -0.05452559143304825, 0.07009313255548477, 0.025093618780374527, 0.01977499946951866, 0.04493635892868042, 0.006614163517951965, 0.03254811838269234, -0.043947722762823105, -0.031407762318849564, -0.051031287759542465, 0.02409159392118454, 0.04938776046037674, -0.03192097321152687, -0.051817040890455246, 0.043623145669698715, -0.007198534440249205, -0.02559473179280758, -0.04307340085506439, -0.05455085262656212, 0.03517517074942589, 0.006128848996013403, -0.05678854137659073, 0.051351260393857956, 0.03266559913754463, -0.012625853531062603, -0.013173739425837994, -0.03629975765943527, 0.04109941050410271, 0.057882070541381836, -0.01540694572031498, -0.003273871261626482, -0.0017620752332732081, -0.005089480429887772, -0.03349592909216881, -0.01160159520804882, 0.013657129369676113, -0.00031155534088611603, 0.049672771245241165, 0.035994645208120346, -0.05805118754506111, 0.044590070843696594, 0.009415419772267342, 0.02268330566585064, 0.010869261808693409, 0.06209759786725044, -0.017590491101145744, -0.032122574746608734, -0.04189814254641533, 0.008387873880565166, -0.018097972497344017, 0.030817028135061264, 0.008693746291100979, 0.03884635120630264, -0.004363387823104858, 0.042834844440221786, -0.02561767026782036, -0.02810823917388916, 0.039564378559589386, 0.022201061248779297, 0.010706177912652493, 0.008287782780826092, -0.01802433282136917, 0.019892867654561996, -0.03256910294294357, -0.0002730731794144958, -0.012559588998556137, -0.02228960208594799, 0.024888766929507256, 0.005083079915493727, -0.010295943357050419, -0.028127722442150116, -0.007061854936182499, -0.015835581347346306, 0.03827119991183281, 0.021073678508400917, 0.02857106737792492, -0.12544205784797668, -0.029292156919836998, -0.026557985693216324, 0.03445368632674217, -0.020903145894408226, -0.03505658730864525, 0.032725051045417786, -0.003642746713012457, 0.011867755092680454, 0.02334025874733925, 0.006273072212934494, 0.03874640539288521, 0.018856482580304146, -0.012924447655677795, -0.011387113481760025, -0.0045427437871694565, 0.004648350644856691, 0.03250329941511154, 0.015646759420633316, 0.02304457500576973, -0.03496341407299042, 0.007850278168916702, -0.0204129908233881, 0.00818394124507904, -0.0038100082892924547, 0.012441868893802166, 0.012893546372652054, 0.024244671687483788, 0.010121511295437813, -0.03667829930782318, -0.012428716756403446, -0.00683620385825634, -0.0347791388630867, 0.030473748221993446, -0.03359303995966911, -0.012545967474579811, -0.011141512542963028, -0.006973151583224535, 0.033158078789711, 0.01179511658847332, 0.015425264835357666, -0.009286540560424328, 0.04785936325788498, -0.00865453202277422, -0.00587971368804574, 0.004339649807661772, 0.0034474441781640053, -0.014336830005049706, 0.05828176066279411, -0.0108367083594203, -0.03498530760407448, -0.008536439388990402, 0.013728637248277664, 0.028704151511192322, 0.009461730718612671, 0.0185735784471035, -0.04835323616862297, 0.009787626564502716, 0.05572333186864853, -0.018358059227466583, -0.03947894275188446, 0.00952838733792305, -0.013235967606306076, 0.007075724191963673, -0.03696630522608757, 0.029971979558467865, 0.014700422063469887, 0.003253135597333312, -0.006631083320826292, 0.019238537177443504, -0.003001164412125945, 0.004248583223670721, -0.03513156995177269, 0.018976232036948204, -0.02054365910589695, 0.042953409254550934, -0.013722948729991913, -0.030299421399831772, 0.048122189939022064, -0.020775141194462776, -0.03198879212141037, -0.008476216346025467, -0.012952473014593124, -0.010446220636367798, 0.021609731018543243, 0.015884142369031906, 0.011274762451648712, 0.0011088961036875844, 0.0254009161144495, 0.04315972700715065, -0.03740135207772255, -0.024169251322746277, 0.033936310559511185, -0.005185619927942753, 0.02638278529047966, -0.001344387768767774, 0.037078529596328735, 0.04016561806201935, 0.00386447599157691, 0.004459970630705357, -0.007287375163286924, -0.04203099384903908, 0.006411899346858263, -0.01830827258527279, -0.009760293178260326, 0.04527580738067627, -0.013376978226006031, -0.04414299130439758, 0.01279426272958517, -0.012618038803339005, 0.022564241662621498, -0.021885963156819344, -0.023684540763497353, -0.03386121988296509, 0.03000240959227085, 0.004352274816483259, -0.013166614808142185, -0.012163876555860043, -0.06347589939832687, 0.02744392305612564, -0.026036925613880157, 0.04140136390924454, -0.03065802901983261, 0.00014538269897457212, 0.02370789274573326, -0.003720903769135475, 0.010518884286284447, -0.013704926706850529, -0.012219265103340149, -0.0019444191129878163, -0.03201020136475563, -0.018758920952677727, 0.05305198207497597, 0.017686452716588974, 0.013406473211944103, -0.0040788184851408005, -0.007779132574796677, -0.009604868479073048, 0.0023082527332007885, -0.04833609610795975, -0.011253857985138893, 0.017800012603402138, 0.014371766708791256, -0.0031097792088985443, 0.0408768355846405, 0.012375421822071075, -0.031021419912576675, 0.001986314309760928, -0.04125295951962471, 0.05223780870437622, 0.022291939705610275, -0.03732307255268097, -0.03928181529045105, 0.02999621257185936, 0.031131800264120102, 0.02901601605117321, 0.013684138655662537, 0.004803095478564501, 0.014212556183338165, 0.040678273886442184, -0.018041368573904037, -0.0121305575594306, -0.0346408449113369, 0.013313710689544678, 0.016081443056464195, 0.0025729683693498373, 0.014468252658843994, -0.05893128365278244, 0.002242766786366701, -0.006741459481418133, -0.03060447983443737, -0.0033087334595620632, -0.00192824041005224, -0.0179228987544775, -0.00461010355502367, 0.02525338903069496, 0.032342325896024704, -0.010341266170144081, 0.002231268212199211, 0.05363110080361366, -0.007826266810297966, 0.028979074209928513, 0.005485715810209513, -0.003935324493795633, 0.009670097380876541, 0.031818680465221405, 0.051374100148677826, 0.04555300995707512, 0.019246550276875496, 0.022792207077145576, 0.004513512831181288, -0.026423530653119087, 0.0025642167311161757, -0.030602185055613518, 0.02342407777905464, 0.0011508670868352056, -0.018516195937991142, -0.0005083628930151463, -0.021155603229999542, -0.02587490901350975, 0.00530556496232748, 0.009421820752322674, 0.006303686648607254, -0.021097393706440926, 0.04032959043979645, 0.004873388446867466, -0.006797244306653738, -0.01585214212536812, 0.014726845547556877, -0.03780645132064819, 0.014017380774021149, -0.001911770086735487, -0.028800353407859802, -0.017942560836672783, 0.009999941103160381, -0.006947819609194994, -0.035000115633010864, 0.03258340433239937, 0.026272064074873924, 0.026158541440963745, -0.02436215803027153, -0.02125740982592106, -0.017330938950181007, -0.016583021730184555, -0.004420255310833454, -0.016784850507974625, -0.024127326905727386, 0.004495698027312756, -0.0035298001021146774, 0.052903059870004654, 0.02082665264606476, -0.015992246568202972, 0.012586184777319431, 0.027973605319857597, 0.05560078099370003, 0.015753425657749176, -0.03805622085928917, 0.06346022337675095, 0.011498389765620232, 0.009323308244347572, 0.006753971334546804, 0.006219479255378246, -0.01521629374474287, -0.0023203494492918253, -0.047134075313806534, 0.004101098980754614, 0.06103290617465973, 0.014742059633135796, 0.03677491098642349, 0.009412211365997791, 0.03819951415061951, -0.003665957832708955, 0.0031796160619705915, -0.019909605383872986, 0.018107470124959946, 0.00048044949653558433, 0.0023046073038131, -0.03908774256706238, 0.009420652873814106, -0.011675269342958927, 0.023522885516285896, -0.029377402737736702, 0.032219480723142624, 0.018389446660876274, -0.02908298745751381, 0.05120130255818367, -0.007210421375930309, -0.03111204318702221, 0.051065582782030106, 0.06680136173963547, 0.005439033266156912, 0.016550680622458458, -0.0028516650199890137, 0.025817884132266045, -0.01829947531223297, -0.0175661388784647, 0.03312726318836212, 0.09008672833442688, 0.02150566317141056, 0.03495822846889496, 0.018194425851106644, 0.036682672798633575, 0.02555692382156849, 0.001404033973813057, 0.006033108104020357, 0.0040823607705533504, 0.0626533105969429, -0.009213448502123356, 0.038546159863471985, 0.04238581284880638, -0.012338717468082905, -0.005676474887877703, -0.012501968070864677, 0.005818934645503759, -0.025593267753720284, -0.0016896069282665849, 0.0282957311719656, -0.004181040450930595, 0.03913114592432976, -0.024267440661787987, 0.04913804307579994, 0.025179246440529823, 0.03201235830783844, -0.015107320621609688, -0.00429841922596097, 0.02213032729923725, 0.028668999671936035, 0.016235262155532837, 0.0073778326623141766, -0.008116821758449078, 0.012422317638993263, 0.04506034776568413, 0.009177707135677338, 0.05025480315089226, -0.0025822347961366177, -0.01679960824549198, 0.013659396208822727, -0.02454182878136635, -0.022354623302817345, -0.018732313066720963, 0.03469941392540932, 0.0014236042043194175, -0.02636679820716381, 0.0031411179807037115, -0.04122775048017502, -0.010984312742948532, -0.0196370892226696, 0.013089556246995926, -0.032838962972164154, -0.0041997116059064865, -0.0028724439907819033, 0.023793229833245277, -0.004485367797315121, 0.015489031560719013, 0.025455182418227196, -0.007343203295022249, 0.011769589968025684, 0.02761884033679962, -0.03455892950296402, -0.0143708735704422, 0.0012281507952138782, 0.0005422287504188716, -0.020777568221092224, 0.00872830580919981, -0.018222561106085777, -0.00794338807463646, 0.006976998411118984, 0.015745291486382484, 0.011727824807167053, 0.03063984215259552, 0.039392538368701935, 0.01774655096232891, -0.03418221324682236, -0.003308377228677273, -0.01718916743993759, -0.0019954764284193516, -0.023428719490766525, -0.049031369388103485, -0.022780004888772964, -0.022071734070777893, 0.030734123662114143, 0.03799848631024361, 0.02392333187162876, -0.027362262830138206, -0.02814263291656971, -0.00479111447930336, -0.033846355974674225, -0.011476539075374603, 0.03704109415411949, -0.009428117424249649, -0.019143154844641685, -0.019232505932450294, -0.0036487586330622435, -0.021458474919199944, -0.0279645174741745, 0.0020545318257063627, 0.006113360170274973, -0.052653007209300995, -0.023903222754597664, -0.026844751089811325, 0.05233989655971527, 0.04544947296380997, 0.030811293050646782, 0.049443066120147705, 0.03125688433647156, 0.01294778473675251, -0.082023486495018, 0.0019321737345308065, -0.02289157547056675, 0.025950269773602486, -0.03218638524413109, -0.022113190963864326, -0.02197878807783127, -0.03956080228090286, -0.0022200997918844223, -0.010317923501133919, -0.02523079514503479, -0.011811858043074608, -0.018241625279188156, 0.018418999388813972, -0.025621909648180008, 0.02246769145131111, 0.04030892252922058, 0.07157804816961288, 0.051369547843933105, 0.011213577352464199, -0.010401061736047268, 0.019776489585638046, 0.0037530309055000544, 0.046486955136060715, 0.061536554247140884, 0.008394324220716953, -0.04559875652194023, -0.02081415429711342, 0.03051581047475338, -0.03282313421368599, -0.07485684752464294, 0.019233273342251778, -0.0004991550813429058, -0.00691596744582057, -0.03298598900437355, -0.008968881331384182, 0.0052147782407701015, -0.043102726340293884, 0.058194007724523544, -0.010016368702054024, -0.03631068393588066, -0.023514382541179657, 0.0507827065885067, -0.05904353782534599, 0.00823731254786253, 0.005271945148706436, 0.006773123983293772, 0.041807495057582855, -0.0024091799277812243, 0.0020526552107185125, 0.017175661399960518, -0.03757006675004959, 0.006260286085307598, -0.009784444235265255, -0.06259631365537643, -0.008671115152537823, -0.020222822204232216, 0.005387115757912397, -0.004724374506622553, -0.04501999542117119, 0.04300474375486374, 0.03081171028316021, 0.0001545409468235448, -0.036725595593452454, -0.03837547078728676, 0.013438530266284943, -0.007844359613955021, 0.028395239263772964, -0.02647584117949009, 0.048358138650655746, 0.054486971348524094, -0.028682837262749672, 0.014751432463526726, 0.02198568917810917 ]
Gradio-Lite: Serverless Gradio Running Entirely in Your Browser
abidlabs
October 19, 2023
gradio-lite
gradio, open-source, serverless
https://huggingface.co/blog/gradio-lite
Benefits of Using @gradio/lite
[ 0.02309294417500496, 0.010958505794405937, 0.09464958310127258, 0.04992535337805748, 0.10422658175230026, 0.050935786217451096, 0.048610370606184006, 0.017969438806176186, -0.046548519283533096, -0.07817652076482773, -0.04867780953645706, 0.0535450279712677, -0.024866070598363876, 0.01989937201142311, -0.006007624790072441, 0.07409626245498657, 0.036966174840927124, -0.06332572549581528, -0.008989010937511921, 0.026904109865427017, -0.024294624105095863, -0.06834983080625534, 0.03780560567975044, 0.028028851374983788, 0.00474591925740242, -0.018604950979351997, -0.028433063998818398, -0.02302308939397335, -0.10841696709394455, 0.024828676134347916, -0.0421871580183506, -0.03345916420221329, 0.031155599281191826, -0.04850729927420616, -0.005996078252792358, -0.007571363355964422, 0.004486619494855404, 0.04983507841825485, -0.011559002101421356, -0.06603098660707474, 0.011451443657279015, -0.07461153715848923, -0.050996508449316025, 0.014879710972309113, -0.05603034421801567, 0.03404639661312103, -0.27658259868621826, 0.043723758310079575, -0.03766922652721405, 0.004466990940272808, -0.07429743558168411, 0.0649004876613617, -0.04832475632429123, -0.01134925801306963, -0.015895750373601913, 0.035282813012599945, 0.05679672956466675, -0.03278044983744621, 0.01979334093630314, -0.0953759253025055, 0.01345540676265955, 0.0019489413825795054, -0.019189119338989258, 0.03875898942351341, 0.055018600076436996, -0.015205535106360912, -0.04595470800995827, 0.008482079952955246, -0.03938784822821617, 0.03662509843707085, 0.003963330294936895, 0.0007692764629609883, -0.02762484736740589, -0.05836160480976105, 0.03790121525526047, -0.009253491647541523, -0.07369781285524368, 0.0311540849506855, 0.052883706986904144, 0.07955949753522873, 0.02237354777753353, 0.012556138448417187, 0.07708793878555298, 0.02951418235898018, 0.03131823241710663, 0.01165036577731371, 0.050303079187870026, -0.01753125712275505, -0.02917173132300377, 0.01938568986952305, -0.03424490988254547, -0.10542823374271393, 0.0417538583278656, 0.03840215504169464, 0.04890312999486923, -0.035626135766506195, 0.049951307475566864, 0.04111262783408165, 0.06772785633802414, 0.01122046448290348, -0.02234087511897087, 0.0023441684897989035, -0.024068964645266533, -0.0373249426484108, -0.009669510647654533, -0.053427234292030334, -0.07127193361520767, -0.058301590383052826, -0.027201207354664803, 0.0846213698387146, -0.059227705001831055, 0.031068870797753334, 0.00046683085383847356, -0.005597556009888649, -0.024508723989129066, 0.029765091836452484, 0.007322733290493488, 0.027494344860315323, 0.01820889115333557, 0.020722856745123863, 0.020191967487335205, 0.13163618743419647, 0.08757986128330231, 0.05546480789780617, 0.027790317311882973, 0.02143976092338562, 0.04030248522758484, 0.02967551350593567, -0.045372553169727325, -0.01450526062399149, 0.0005542895523831248, 0.06530293822288513, 0.04407810792326927, 0.005162464454770088, -0.07452757656574249, -0.07631604373455048, 0.003935167565941811, -0.005511252675205469, -0.003809430403634906, -0.02335701696574688, 0.012201662175357342, 0.07041840255260468, -0.03314666822552681, 0.06583248823881149, -0.023667994886636734, -0.06905101984739304, 0.011841272003948689, 0.012330828234553337, -0.0018872577929869294, 0.02995213121175766, -0.0008328658877871931, 0.04950999841094017, -0.05807166546583176, -0.03174310550093651, -0.02174941450357437, 0.07039675861597061, 0.006405704189091921, -0.005096003413200378, -0.07979102432727814, -0.010525905527174473, -0.004258614964783192, -0.034871529787778854, -0.018076971173286438, -0.0363638810813427, 0.07862482219934464, 0.007683730684220791, 0.0005096889799460769, -0.017054647207260132, 0.04901192709803581, -0.050910498946905136, -0.038905199617147446, -0.017747459933161736, 0.029861118644475937, -0.02717946469783783, -0.043549247086048126, 0.06727542728185654, 0.04750273376703262, 0.031143618747591972, -0.016795620322227478, -0.005580177530646324, -0.019665420055389404, 0.005882457830011845, -0.020005496218800545, -0.0011196889681741595, -0.005469630006700754, -0.05945572629570961, 0.0135489571839571, -0.06493301689624786, -0.018493760377168655, -0.016861191019415855, -0.09886375814676285, -0.014993668533861637, 0.09280309826135635, -0.05076567456126213, 0.03375805541872978, -0.05254103243350983, -0.004757620394229889, 0.10655631124973297, 0.07160750776529312, 0.030110478401184082, 0.07250525057315826, 0.03090372309088707, 0.06616593152284622, -0.008202308788895607, -0.05941852182149887, 0.03343191370368004, 0.07417929917573929, 0.010567533783614635, 0.02665930986404419, 0.025190819054841995, -0.0077150133438408375, -0.09537485241889954, 0.08771630376577377, -0.051837820559740067, 0.00008300942135974765, 0.04050758481025696, 0.03913518786430359, -0.008793342858552933, 0.018632996827363968, -0.03844577074050903, 0.07901232689619064, -0.011377747170627117, -0.07356773316860199, 0.0531482994556427, -0.003751286305487156, 0.10775881260633469, 0.06988898664712906, -0.02804401144385338, 0.09002838283777237, -0.07395075261592865, -0.0021177344024181366, -0.030872203409671783, -0.00022180695668794215, 0.09724266827106476, 0.018890127539634705, 0.029194680973887444, -0.0028111280407756567, -0.0660564973950386, 0.05013114959001541, -0.006588800344616175, 0.00478070043027401, 0.0037986061070114374, -0.017587073147296906, 0.03924013674259186, -0.0035364925861358643, -0.04645291715860367, 0.01052282378077507, 0.020511174574494362, -0.03038075380027294, -0.040110353380441666, -0.01584094762802124, 0.048642244189977646, 0.05873069167137146, 0.009839417412877083, 0.07661960273981094, -0.04852575063705444, -0.026295006275177002, -0.024647623300552368, -0.023905614390969276, 0.029143936932086945, -0.027644911780953407, -0.039826907217502594, -0.007958468981087208, -0.04694634675979614, 0.029141560196876526, -0.01925504580140114, -0.002867260482162237, 0.033662352710962296, 0.02373036928474903, 0.02126346528530121, -0.023032907396554947, -0.032470230013132095, 0.014230027794837952, -0.006858108099550009, -0.01174422912299633, -0.008078048937022686, 0.00862665381282568, -0.013080698437988758, 0.0019393210532143712, -0.03988680988550186, -0.015048845671117306, -0.010777583345770836, 0.015452869236469269, 0.0005797235062345862, 0.04914932698011398, -0.015115030109882355, 0.013085457496345043, -0.033647600561380386, -0.02383754588663578, 0.02812209352850914, -0.01041554007679224, 0.008722580969333649, -0.008794178254902363, -0.010380947031080723, 0.03486011549830437, -0.02098679542541504, 0.00016911851707845926, -0.004654723219573498, -0.021503383293747902, -0.011817564256489277, -0.0018763302359730005, -0.004484048578888178, 0.0041518970392644405, 0.009208543226122856, -0.05240160599350929, 0.040306318551301956, 0.020258527249097824, -0.009106084704399109, -0.14519824087619781, -0.019290205091238022, 0.02062118425965309, 0.03406178951263428, -0.021576743572950363, 0.010773148387670517, 0.03835366666316986, -0.047425638884305954, -0.020545871928334236, -0.005729949101805687, 0.0005884412094019353, -0.00871717743575573, 0.02892054058611393, -0.009109115228056908, 0.0004419506585691124, -0.002938599092885852, 0.004122030455619097, 0.020860331133008003, 0.024079984053969383, -0.029708877205848694, -0.008345521986484528, 0.05444648861885071, -0.022855503484606743, -0.016901995986700058, -0.028597908094525337, 0.04513878375291824, 0.0017470938619226217, 0.03192517161369324, 0.02804127335548401, -0.023315250873565674, 0.030981408432126045, 0.027462052181363106, -0.03404925763607025, 0.026662681251764297, -0.016694817692041397, -0.007469716016203165, -0.0017035130877047777, -0.011071095243096352, -0.010269582271575928, 0.009239116683602333, 0.032317355275154114, 0.027349762618541718, 0.03434959053993225, 0.022235948592424393, -0.027389245107769966, -0.009136914275586605, 0.01845116727054119, 0.0030756741762161255, 0.07091034948825836, -0.023091834038496017, -0.042255133390426636, 0.017777130007743835, -0.012465055100619793, 0.06029390171170235, -0.0008207205682992935, -0.030203627422451973, -0.011976965703070164, 0.02299368940293789, 0.026147939264774323, -0.007097691763192415, -0.01714416593313217, 0.014497064985334873, 0.0027590852696448565, 0.005715881008654833, -0.056216850876808167, 0.04131859540939331, -0.01882990449666977, 0.027876833453774452, -0.021871350705623627, 0.02498820796608925, -0.0011713359272107482, 0.0038627164904028177, -0.0014974684454500675, 0.026760198175907135, 0.00006176986789796501, 0.03040703944861889, -0.0263382401317358, -0.0019565648399293423, 0.06742127984762192, -0.03139690309762955, 0.015535615384578705, -0.042226359248161316, 0.0023592219222337008, -0.016831230372190475, -0.02549009956419468, 0.03909340128302574, -0.018869828432798386, 0.005295093171298504, -0.022776328027248383, 0.043411657214164734, 0.014124788343906403, -0.005435955710709095, 0.019414285197854042, -0.0035612164065241814, -0.02567966841161251, 0.022861529141664505, 0.08771476149559021, -0.014615186490118504, 0.007085020188242197, -0.0013943014200776815, 0.00014002401439938694, -0.030981004238128662, 0.027850963175296783, 0.0014683553017675877, 0.022557171061635017, 0.05753163620829582, -0.04561557248234749, -0.027183443307876587, 0.004034919198602438, 0.03552359342575073, 0.008186709135770798, -0.02825084701180458, -0.014108676463365555, -0.02011924609541893, 0.0017547572497278452, 0.03076770156621933, -0.02011791430413723, -0.04674492031335831, -0.05395934358239174, 0.026089992374181747, -0.041657350957393646, 0.009025003761053085, 0.015991879627108574, -0.019439442083239555, -0.026097172871232033, -0.0073424819856882095, 0.011709929443895817, -0.00461767241358757, 0.01595034822821617, -0.011183733120560646, -0.04666847363114357, -0.021954627707600594, 0.04506605118513107, -0.008204353973269463, 0.054613061249256134, -0.006084910128265619, 0.016694720834493637, 0.03642438352108002, -0.0005717755411751568, -0.0832202136516571, 0.009383524768054485, 0.016668887808918953, -0.005439030472189188, -0.03178882226347923, 0.03853601589798927, -0.01430370844900608, -0.02269122563302517, 0.0003697385254781693, -0.027785252779722214, 0.038607172667980194, 0.0257103331387043, -0.059739500284194946, -0.014551475644111633, 0.01199707854539156, 0.03133523836731911, 0.023109205067157745, 0.02097625657916069, 0.0031095545273274183, -0.027605321258306503, 0.014128860086202621, 0.009248380549252033, -0.015646612271666527, -0.07667890936136246, 0.03862692043185234, -0.0043830666691064835, -0.002770097693428397, -0.025912046432495117, -0.01069144532084465, -0.009615770541131496, -0.024566471576690674, -0.002890214789658785, 0.019212333485484123, 0.005133805330842733, -0.009362363256514072, 0.021542511880397797, 0.010384274646639824, 0.018400859087705612, 0.014540796168148518, 0.04744792729616165, 0.02846483327448368, 0.007560419384390116, -0.023149389773607254, 0.044832222163677216, 0.02255144901573658, 0.0013675433583557606, -0.02796887420117855, 0.009350474923849106, 0.01172124594449997, 0.0033533049281686544, 0.04792732745409012, -0.024294413626194, -0.011047493666410446, 0.03479707986116409, -0.01671702228486538, 0.013699961826205254, -0.033559635281562805, 0.005196899175643921, 0.01887914538383484, -0.012474045157432556, -0.03263784945011139, 0.01577397622168064, 0.017917558550834656, -0.010768589563667774, -0.0027210810221731663, -0.0013661141274496913, 0.05092901363968849, 0.01349884644150734, -0.04445794224739075, -0.01169899944216013, -0.004042220301926136, -0.007931847125291824, -0.01997649483382702, -0.008423414081335068, -0.021772071719169617, -0.012123316526412964, -0.047218531370162964, -0.060461971908807755, 0.02331632561981678, -0.00037962247733958066, 0.007551294285804033, 0.0017698643496260047, 0.0018303360557183623, -0.040406759828329086, 0.03855214640498161, 0.05590714514255524, -0.01614494062960148, 0.012644484639167786, 0.031600888818502426, -0.044350121170282364, 0.0483923964202404, 0.03311222791671753, -0.009778612293303013, -0.007532384246587753, -0.004736451897770166, 0.027597548440098763, 0.05690185725688934, -0.04867939651012421, 0.0255613811314106, -0.005855169612914324, -0.013299144804477692, -0.0012818536488339305, 0.014194882474839687, -0.018893836066126823, -0.010977128520607948, -0.050633013248443604, 0.010973284021019936, 0.044678181409835815, -0.006995474919676781, -0.007017937488853931, 0.020966093987226486, 0.0542558915913105, -0.01734215021133423, 0.026357315480709076, 0.003984701819717884, 0.02781069092452526, 0.0005384649848565459, 0.002880074316635728, 0.0069342064671218395, 0.009504158049821854, -0.002336027566343546, 0.035154249519109726, 0.018466534093022346, 0.00751960463821888, 0.0468418225646019, 0.0002628107904456556, 0.032791800796985626, -0.013642334379255772, -0.0238804891705513, 0.011318469420075417, -0.0031709156464785337, -0.030030982568860054, 0.022587474435567856, 0.05456645041704178, -0.0014858574140816927, 0.02819174714386463, -0.012026282027363777, 0.02379457838833332, 0.03997226804494858, 0.030897745862603188, -0.0006937133730389178, 0.031554531306028366, 0.033136673271656036, 0.02646583504974842, -0.017242953181266785, -0.021322179585695267, -0.001784637337550521, 0.024067306891083717, 0.013112873770296574, 0.02381618693470955, 0.012853567488491535, 0.0028905742801725864, 0.018356231972575188, -0.0178865734487772, 0.001546751707792282, -0.03603561595082283, 0.013544338755309582, 0.015211282297968864, -0.01714245229959488, 0.0038764658384025097, -0.025677941739559174, 0.055489398539066315, 0.023402336984872818, 0.02341318316757679, 0.01827799715101719, -0.008276318199932575, -0.014775048941373825, 0.031223522499203682, -0.000930893060285598, 0.0376785546541214, -0.03956807777285576, 0.005434473976492882, 0.051565367728471756, -0.008020254783332348, 0.010260791517794132, 0.01224293652921915, -0.053944725543260574, 0.043857328593730927, 0.0010038584005087614, 0.014787121675908566, 0.015395413152873516, 0.06662467867136002, -0.020580727607011795, -0.010556346736848354, -0.02333074063062668, -0.032374102622270584, -0.043301425874233246, 0.004968962166458368, 0.019715534523129463, -0.01741795614361763, -0.01802792213857174, 0.011510297656059265, 0.013850096613168716, 0.0018205513479188085, -0.0020384383387863636, -0.030321283265948296, 0.0017473901389166713, 0.03865930065512657, 0.03988325223326683, 0.0010368992807343602, 0.001985186943784356, -0.005544668063521385, -0.01454918086528778, 0.004961857572197914, 0.01634472794830799, -0.02420802228152752, 0.015076457522809505, -0.03159463405609131, 0.005627213511615992, -0.03168533742427826, 0.029432594776153564, -0.025279482826590538, 0.030583301559090614, -0.026536909863352776, 0.06545979529619217, -0.07362700998783112, -0.04259628430008888, -0.009995898231863976, -0.009479619562625885, 0.014503112062811852, -0.009918613359332085, 0.019323306158185005, 0.017154574394226074, -0.011266320012509823, -0.028288105502724648, -0.048871807754039764, -0.006984421983361244, -0.034563563764095306, -0.011300901882350445, 0.005343176424503326, 0.02217009849846363, -0.023803845047950745, -0.02167021669447422, 0.008785766549408436, 0.02387048490345478, -0.011265640147030354, -0.0028215714264661074, 0.007056304719299078, -0.0018019787967205048, -0.021420342847704887, 0.01126067340373993, 0.07353989034891129, 0.04245908185839653, 0.020738834515213966, 0.03380509838461876, 0.04170113429427147, -0.02372926101088524, -0.011887453496456146, -0.0017271931283175945, 0.0393795482814312, 0.013477482832968235, -0.001870189094915986, -0.022839704528450966, -0.01801788993179798, -0.049605511128902435, -0.0026723758783191442, 0.0037368861958384514, -0.0176610816270113, -0.032538194209337234, -0.0165316890925169, -0.004639985505491495, -0.06709281355142593, 0.039712440222501755, 0.04364635422825813, 0.020738918334245682, 0.001641925424337387, -0.03252631053328514, 0.0007924030069261789, -0.016218382865190506, 0.0002525830641388893, -0.0026952640619128942, 0.032712534070014954, 0.03096594102680683, -0.011291596107184887, -0.053842250257730484, 0.02496339939534664, -0.0324433334171772, -0.03419814258813858, -0.008053377270698547, 0.049066849052906036, -0.020318370312452316, -0.006471874192357063, 0.023179776966571808, 0.02948591858148575, -0.013666706159710884, 0.019623324275016785, 0.018905505537986755, -0.030264751985669136, 0.022961730137467384, 0.004223901778459549, -0.05021100118756294, 0.005038365721702576, -0.0026007932610809803, 0.032115984708070755, 0.029707981273531914, -0.028681138530373573, -0.00198991852812469, -0.02882051281630993, -0.06013084575533867, 0.013721835799515247, -0.0018918858841061592, -0.005013695918023586, -0.011571425013244152, -0.010557024739682674, 0.009552455507218838, -0.03117523342370987, -0.040291089564561844, 0.011401347815990448, -0.0011589820496737957, 0.01291024312376976, -0.01685420051217079, -0.018881214782595634, 0.004190039820969105, 0.02102557010948658, 0.0366533063352108, 0.008091352880001068, 0.050731465220451355, 0.01062023639678955, -0.032118961215019226, -0.033054810017347336, 0.009850324131548405 ]
Gradio-Lite: Serverless Gradio Running Entirely in Your Browser
abidlabs
October 19, 2023
gradio-lite
gradio, open-source, serverless
https://huggingface.co/blog/gradio-lite
1. Serverless Deployment The primary advantage of @gradio/lite is that it eliminates the need for server infrastructure. This simplifies deployment, reduces server-related costs, and makes it easier to share your Gradio applications with others.
[ 0.018353359773755074, 0.06265991926193237, 0.09295014292001724, 0.11926043033599854, 0.034239739179611206, 0.05823739245533943, 0.035312801599502563, 0.032921116799116135, -0.038948945701122284, -0.07049683481454849, -0.09534122049808502, 0.024720488116145134, -0.04372793063521385, 0.054143596440553665, -0.04437369108200073, 0.0409904308617115, 0.05879444256424904, -0.09984491020441055, -0.00195569870993495, 0.008149174973368645, -0.010086211375892162, -0.009726704098284245, 0.049621980637311935, 0.01998163014650345, -0.04253982752561569, -0.01634705252945423, -0.03667467087507248, 0.025463910773396492, -0.06399541348218918, 0.007416123989969492, 0.008366230875253677, -0.05966130644083023, 0.0007573338225483894, -0.04554110765457153, 0.012220075353980064, 0.016468988731503487, 0.016742322593927383, 0.11469901353120804, -0.034528542309999466, -0.06260022521018982, 0.012458222918212414, -0.04614534601569176, -0.07623512297868729, 0.040521882474422455, -0.0761244148015976, 0.03508644178509712, -0.18778909742832184, 0.03383064270019531, -0.06167800351977348, 0.04004482552409172, -0.09751923382282257, 0.10130518674850464, -0.07243794202804565, 0.01572892814874649, -0.013150160200893879, 0.04579278454184532, 0.03283553570508957, -0.02302735298871994, 0.020908933132886887, -0.04226428270339966, -0.007137180306017399, -0.026139987632632256, -0.008517607115209103, 0.04272356629371643, 0.040439363569021225, -0.07130803912878036, -0.029161391779780388, 0.006747890263795853, 0.004805699922144413, 0.060791924595832825, -0.003217288525775075, -0.046089354902505875, -0.06060202792286873, -0.0688178688287735, 0.01200151164084673, 0.0002887254813686013, -0.06717436760663986, 0.04241520166397095, 0.033455606549978256, 0.08035998046398163, 0.032069843262434006, 0.05071548745036125, 0.025002239271998405, -0.04130268469452858, 0.05157396197319031, -0.025506343692541122, 0.029302066192030907, 0.013606786727905273, -0.09808753430843353, 0.021876607090234756, 0.012785743921995163, -0.10539717972278595, 0.01849053055047989, 0.001321174087934196, 0.0716174840927124, 0.016025880351662636, 0.01673814095556736, 0.03540048003196716, 0.04393543303012848, 0.029191698879003525, 0.01676804944872856, -0.020160023123025894, -0.060922324657440186, -0.01623145490884781, -0.009403815492987633, -0.05502406507730484, -0.049722105264663696, -0.0657307431101799, 0.00371992657892406, 0.09652343392372131, -0.056660473346710205, 0.004180516581982374, -0.05335000157356262, 0.001665521296672523, 0.00314490613527596, 0.03673740103840828, -0.011776234954595566, 0.01187927182763815, 0.028043262660503387, 0.012703553773462772, 0.05869114026427269, 0.06349499523639679, 0.05512497201561928, 0.0829424187541008, -0.0259027648717165, 0.015908796340227127, 0.016800014302134514, -0.00395023450255394, 0.015275601297616959, -0.0055527156218886375, 0.016994299367070198, 0.05989448353648186, -0.005629267543554306, 0.010405519045889378, -0.02925172634422779, -0.0570930540561676, -0.02371082827448845, -0.027885902673006058, 0.015174679458141327, -0.015765592455863953, -0.022989995777606964, 0.07356590032577515, -0.004416103940457106, 0.046236712485551834, -0.006954529322683811, -0.0320575013756752, 0.06636296957731247, -0.06208997219800949, -0.017414018511772156, 0.002328800968825817, -0.004983429331332445, 0.020511934533715248, -0.06377988308668137, -0.020037157461047173, -0.02621331997215748, 0.06251698732376099, 0.005360189359635115, -0.02736629545688629, 0.01011718064546585, 0.02032637409865856, -0.03356345370411873, -0.03018338419497013, -0.02234380878508091, -0.05585235729813576, 0.08157380670309067, 0.050458889454603195, 0.0023138595279306173, 0.003677506698295474, 0.09376339614391327, -0.03587920963764191, -0.11775221675634384, -0.04175558686256409, 0.020234791561961174, -0.004649152513593435, 0.011849853210151196, 0.04177110642194748, 0.06297093629837036, 0.03865625709295273, -0.05649455264210701, -0.021629370748996735, -0.001916630077175796, 0.03660968691110611, 0.008209324441850185, -0.03675166517496109, -0.033319562673568726, -0.03823032230138779, -0.010339212603867054, -0.06623747199773788, -0.001893024891614914, -0.05180865153670311, -0.040199682116508484, 0.016405582427978516, -0.012296641245484352, -0.05707653984427452, 0.021978069096803665, 0.009611508809030056, -0.005415370687842369, 0.09592404216527939, 0.055238205939531326, -0.0005875909700989723, 0.09553536027669907, -0.0072498018853366375, -0.03682166337966919, 0.0019717782270163298, -0.06876299530267715, 0.014082450419664383, 0.03237748518586159, 0.03494755178689957, 0.027883870527148247, 0.00899961031973362, -0.007605731021612883, -0.07668086886405945, 0.029356004670262337, 0.015726745128631592, -0.007141788024455309, 0.024082323536276817, 0.01611635461449623, 0.0021654763258993626, -0.004320225212723017, 0.02690981887280941, 0.11904649436473846, -0.05521010980010033, -0.015306441113352776, 0.06324701011180878, 0.05501548573374748, 0.04053253307938576, 0.08223901689052582, -0.05353673920035362, 0.11878587305545807, -0.018338726833462715, -0.003570140805095434, -0.038651373237371445, -0.027524175122380257, 0.07930247485637665, 0.06795363873243332, 0.0654190331697464, 0.010488014668226242, -0.062223900109529495, 0.0279476847499609, 0.01724913902580738, -0.027198508381843567, -0.03967616334557533, -0.02117740921676159, 0.04984697327017784, 0.04024055227637291, -0.07158496230840683, 0.03864605352282524, -0.029821934178471565, 0.038050759583711624, -0.07241016626358032, 0.002762892749160528, -0.05388738214969635, 0.04032427817583084, 0.004638665821403265, 0.07239897549152374, -0.059269145131111145, -0.011413884349167347, -0.025635456666350365, -0.01145714521408081, 0.03817671909928322, -0.05169449374079704, -0.04454493522644043, 0.027570029720664024, -0.04298007860779762, 0.04217509552836418, -0.03606410697102547, -0.028395235538482666, 0.027663709595799446, 0.026095254346728325, 0.023871447890996933, -0.006150225177407265, -0.0412156768143177, -0.013518158346414566, -0.016637662425637245, -0.024896826595067978, -0.02196411043405533, -0.025569548830389977, -0.028849922120571136, 0.004613091237843037, -0.043288704007864, -0.014468152076005936, 0.002952893963083625, 0.027780769392848015, 0.008439027704298496, -0.011127309873700142, 0.017637411132454872, 0.001009242027066648, -0.025521421805024147, 0.005037218332290649, -0.026431990787386894, -0.04391768202185631, -0.020044809207320213, -0.0064489697106182575, 0.017361510545015335, 0.03304705023765564, -0.023602096363902092, 0.016910480335354805, -0.015953827649354935, -0.02864365093410015, -0.01841476373374462, -0.006149700377136469, -0.02410770393908024, 0.00038504955591633916, 0.005773414392024279, -0.042425092309713364, 0.030008837580680847, 0.04279246926307678, -0.0181750375777483, -0.1120205670595169, -0.013624639250338078, -0.001883992226794362, 0.034658316522836685, -0.009221594780683517, 0.021140312775969505, 0.04208685830235481, -0.013575495220720768, -0.0185850802809, 0.031332701444625854, -0.018349289894104004, -0.004920285195112228, 0.017497247084975243, -0.009932267479598522, -0.011085434816777706, -0.01239064708352089, 0.028320664539933205, 0.05143994465470314, 0.02446085587143898, -0.023177871480584145, -0.019271083176136017, 0.023235490545630455, -0.006418869365006685, -0.027779772877693176, -0.02495759353041649, -0.02287956327199936, 0.022085784003138542, -0.005931977182626724, 0.017130570486187935, 0.009656554087996483, 0.0121312215924263, -0.0003671068116091192, -0.052613768726587296, -0.03091360814869404, -0.028321798890829086, 0.02053375169634819, 0.034243904054164886, 0.023980742320418358, 0.03503312170505524, 0.014042927883565426, 0.023357145488262177, -0.014307809993624687, 0.04058896005153656, -0.0031745790038257837, 0.022291889414191246, -0.025984352454543114, 0.034045200794935226, 0.012534724548459053, 0.07784352451562881, -0.0052100662142038345, -0.035371918231248856, 0.029746314510703087, -0.0018256166949868202, 0.05755406990647316, 0.02773442491889, -0.05131329596042633, 0.003958775661885738, 0.01695139892399311, 0.02697795443236828, 0.03113391064107418, -0.016251452267169952, 0.00013585771375801414, 0.03233213722705841, -0.011788828298449516, -0.05914469063282013, 0.017929237335920334, 0.00232005980797112, 0.000844020745716989, 0.00046719686361029744, -0.02713695354759693, -0.005132721737027168, 0.03941421955823898, 0.025647398084402084, 0.02024718187749386, -0.019197776913642883, -0.011469217948615551, -0.016515642404556274, 0.02186458557844162, 0.054550956934690475, 0.00664998684078455, 0.026967545971274376, -0.0378379262983799, 0.03172798827290535, -0.02195410430431366, -0.014763486571609974, 0.05616645887494087, -0.03683646395802498, 0.01606670208275318, -0.03431611880660057, 0.035493653267621994, -0.0066613685339689255, -0.051065292209386826, 0.07823135703802109, 0.008585064671933651, -0.02197786420583725, -0.005656861700117588, 0.06444155424833298, -0.02099292352795601, -0.002528207376599312, -0.029884276911616325, 0.007639274001121521, -0.026586638763546944, 0.029067598283290863, 0.012927223928272724, 0.00735790329053998, 0.047927647829055786, -0.015422915108501911, -0.007500017993152142, -0.009856031276285648, 0.02506381832063198, 0.04016507789492607, 0.043209098279476166, 0.0007869667606428266, -0.02261039800941944, 0.009102338925004005, 0.03245861455798149, -0.0074843489564955235, -0.010135269723832607, -0.014046051539480686, 0.029722468927502632, -0.04175645858049393, -0.005986868869513273, 0.017372502014040947, 0.003009009873494506, -0.03762976825237274, -0.0010648710886016488, 0.02578703872859478, -0.023275451734662056, 0.02497003600001335, -0.03152373433113098, -0.026506910100579262, -0.016713066026568413, 0.03301742672920227, -0.009762649424374104, 0.03624921292066574, -0.007457168307155371, 0.044286198914051056, 0.04056565836071968, 0.016138073056936264, -0.03157224506139755, 0.009709448553621769, 0.013629055581986904, -0.013919021002948284, -0.04010394960641861, 0.03704078495502472, 0.020985987037420273, -0.0655740350484848, -0.01120442058891058, -0.04295385256409645, 0.03118748962879181, 0.013166320510208607, -0.04178943485021591, 0.008088737726211548, 0.018884580582380295, 0.02174239233136177, 0.010865746065974236, 0.0028071035631000996, -0.007979512214660645, -0.02062043361365795, -0.022062979638576508, 0.03556138277053833, -0.033041633665561676, -0.03847822546958923, -0.0020598829723894596, 0.021242264658212662, 0.021387461572885513, 0.0029340144246816635, -0.026649033650755882, -0.014773335307836533, 0.0017895034980028868, 0.031718745827674866, 0.05792943760752678, -0.0130268270149827, 0.0035949682351201773, 0.006090441253036261, 0.014076310209929943, 0.018201569095253944, 0.05724355950951576, 0.05351787060499191, 0.01567000336945057, -0.0017064957646653056, 0.014939436689019203, 0.019660823047161102, 0.003574284492060542, 0.018183566629886627, -0.04618051275610924, 0.01580131985247135, 0.03533470258116722, -0.014234248548746109, 0.05322549119591713, 0.0024708511773496866, 0.025979477912187576, 0.02370697446167469, -0.0075964489951729774, 0.059006787836551666, -0.054564639925956726, 0.005848780274391174, 0.03023603744804859, 0.007397179026156664, -0.014136336743831635, 0.0045908731408417225, 0.01692892052233219, -0.035842977464199066, 0.005697264801710844, 0.016049131751060486, 0.049951523542404175, 0.03289156034588814, -0.039365801960229874, 0.005473673809319735, 0.015081885270774364, 0.0011618497082963586, -0.029163789004087448, -0.012591978535056114, -0.0028509136755019426, -0.027750730514526367, -0.0374547578394413, -0.06905020773410797, 0.02160387858748436, -0.017242154106497765, -0.024058733135461807, 0.001087941462174058, -0.010977798141539097, -0.05824411287903786, -0.014127048663794994, 0.01534738764166832, 0.01870083622634411, -0.0024487872142344713, 0.018890969455242157, -0.051483578979969025, 0.010401779785752296, 0.015537966042757034, -0.032307159155607224, 0.032926641404628754, -0.02367866411805153, 0.01137487031519413, 0.035261839628219604, -0.012487437576055527, 0.006851073354482651, -0.0049932305701076984, -0.05207349732518196, -0.023839758709073067, -0.014209406450390816, -0.0215060543268919, -0.0033484280575066805, -0.05624828115105629, -0.027361705899238586, 0.05672891065478325, 0.009136734530329704, -0.00928856898099184, 0.015157479792833328, 0.037332627922296524, -0.026113972067832947, 0.023493574932217598, -0.02291218750178814, 0.025570686906576157, -0.003525899024680257, 0.025263100862503052, 0.02260424569249153, 0.005499459803104401, -0.007436954416334629, 0.019502704963088036, 0.0140532860532403, -0.019446436315774918, 0.023670898750424385, 0.04181987792253494, 0.008677959442138672, -0.0022389364894479513, -0.05953090637922287, -0.020359979942440987, -0.017886977642774582, -0.01947972923517227, 0.044367291033267975, -0.010543287731707096, 0.007546382490545511, 0.021377624943852425, -0.016446148976683617, 0.030124733224511147, 0.028734954074025154, 0.02426765486598015, 0.049121517688035965, 0.029276510700583458, 0.06794445961713791, -0.0005937163368798792, -0.024038191884756088, -0.013898988254368305, -0.02824825420975685, 0.00928089115768671, 0.005351845175027847, 0.05015202611684799, 0.02807723730802536, 0.014100831001996994, 0.015114318579435349, 0.0010172291658818722, 0.011846148408949375, -0.03556337207555771, 0.007648995146155357, -0.018585558980703354, -0.020335616543889046, 0.006474007852375507, 0.007530940230935812, 0.0065928432159125805, 0.0004910279531031847, 0.012257732450962067, 0.007466907612979412, -0.0019063818035647273, 0.0006679049110971391, 0.025400511920452118, 0.013014184311032295, 0.05210195854306221, -0.010913044214248657, -0.007349987048655748, 0.0348750539124012, 0.012114961631596088, 0.027518829330801964, 0.003338039852678776, -0.020540311932563782, 0.004338629078119993, 0.0141295762732625, 0.06275883316993713, 0.021344373002648354, 0.02874557301402092, -0.09115003794431686, 0.008293801918625832, 0.009457194246351719, 0.01179538108408451, 0.019497355446219444, 0.038141507655382156, 0.0014017625944688916, 0.007794815115630627, -0.017505908384919167, 0.032243210822343826, -0.01749747432768345, 0.030697990208864212, -0.021226251497864723, -0.04043954983353615, -0.022528916597366333, 0.03541942685842514, 0.030600376427173615, -0.027519959956407547, -0.02332136780023575, 0.021341750398278236, -0.008252051658928394, 0.00656023807823658, 0.004948582965880632, -0.029574096202850342, 0.030491139739751816, -0.02180197834968567, 0.005751872900873423, -0.038366615772247314, -0.007382450625300407, -0.006920576095581055, 0.038943659514188766, -0.012967059388756752, 0.05724538490176201, -0.06426779180765152, -0.0657508596777916, -0.019737087190151215, -0.020817890763282776, 0.024633372202515602, -0.024182399734854698, 0.038154881447553635, -0.03544541820883751, -0.006579605396836996, -0.021576179191470146, -0.02456294558942318, 0.018230292946100235, -0.01144590973854065, 0.002217063447460532, 0.005829683039337397, 0.002144882455468178, -0.049881067126989365, 0.011429651640355587, 0.03116788901388645, 0.007662530988454819, 0.0018131909891963005, 0.005063599906861782, 0.04972599074244499, 0.008389027789235115, -0.024258246645331383, 0.028736717998981476, 0.07814347743988037, 0.025352509692311287, 0.047541309148073196, -0.0024154779966920614, 0.024438627064228058, -0.06908794492483139, -0.03994888439774513, -0.019215287640690804, 0.039323948323726654, -0.0001037829351844266, -0.0029279240407049656, -0.01457690354436636, -0.004333820194005966, -0.04391050338745117, 0.013420570641756058, 0.0009275511838495731, -0.00816909410059452, -0.0062879459001123905, 0.012387645430862904, 0.0016929111443459988, -0.07042781263589859, 0.009672642685472965, 0.01212454866617918, 0.011916600167751312, 0.01059877872467041, -0.032204173505306244, -0.015336403623223305, -0.022414563223719597, -0.004526275675743818, -0.0024685815442353487, 0.02466362901031971, 0.039873458445072174, -0.01575879007577896, -0.03570055961608887, 0.015881214290857315, -0.02676328457891941, -0.0019087851978838444, -0.0024440507404506207, 0.018608512356877327, -0.006397828925400972, 0.010211009532213211, 0.020539067685604095, 0.020436128601431847, -0.02425246499478817, 0.036044977605342865, -0.011575986631214619, -0.05649879202246666, 0.012998655438423157, -0.009666807949543, -0.028064051643013954, 0.006861953996121883, -0.01151296216994524, 0.018770897760987282, 0.011192181147634983, -0.04639715328812599, 0.004874488804489374, -0.06999755650758743, -0.03225601091980934, 0.04249336197972298, -0.035049617290496826, -0.04378560185432434, -0.025611449033021927, -0.0617222897708416, 0.034587714821100235, -0.024691732600331306, -0.032244645059108734, -0.018272388726472855, -0.013153765350580215, 0.015248293057084084, 0.025900980457663536, 0.015077615156769753, -0.009207058697938919, 0.03727243095636368, 0.039680738002061844, 0.011397925205528736, 0.0495070144534111, 0.009947210550308228, -0.022050974890589714, -0.031779371201992035, 0.004078487399965525 ]
Gradio-Lite: Serverless Gradio Running Entirely in Your Browser
abidlabs
October 19, 2023
gradio-lite
gradio, open-source, serverless
https://huggingface.co/blog/gradio-lite
3. Write your Gradio app inside of the tags Now, write your Gradio app as you would normally, in Python! Keep in mind that since this is Python, whitespace and indentations matter. html <html> <head> <script type="module" crossorigin src="https://cdn.jsdelivr.net/npm/@gradio/lite/dist/lite.js"></script> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@gradio/lite/dist/lite.css" /> </head> <body> <gradio-lite> import gradio as gr def greet(name): return "Hello, " + name + "!" gr.Interface(greet, "textbox", "textbox").launch() </gradio-lite> </body> </html> And that's it! You should now be able to open your HTML page in the browser and see the Gradio app rendered! Note that it may take a little while for the Gradio app to load initially since Pyodide can take a while to install in your browser. Note on debugging: to see any errors in your Gradio-lite application, open the inspector in your web browser. All errors (including Python errors) will be printed there.
[ 0.03301948308944702, 0.058393049985170364, 0.04519365355372429, 0.018421536311507225, 0.10018236935138702, 0.06339030712842941, 0.0946342945098877, 0.022199613973498344, 0.01741483062505722, -0.01797385700047016, -0.07211887836456299, 0.03172602877020836, -0.018728921189904213, 0.04198835417628288, -0.008845379576086998, 0.04317444935441017, 0.061309102922677994, -0.07662500441074371, -0.060761284083127975, -0.017022348940372467, -0.035947639495134354, -0.03258218616247177, -0.05497298017144203, 0.07667621225118637, -0.03302960842847824, -0.025474153459072113, -0.0031714257784187794, 0.0617336705327034, -0.06350553035736084, 0.017679424956440926, -0.02838067151606083, -0.03653370216488838, -0.019459109753370285, -0.07813529670238495, 0.0037880688905715942, 0.08621979504823685, -0.046614546328783035, 0.07927139103412628, 0.022302640601992607, -0.04542958736419678, 0.013099214062094688, -0.05681459605693817, -0.09613493829965591, 0.0369250513613224, -0.030725538730621338, -0.01509026251733303, -0.1893945038318634, 0.026634136214852333, 0.02381705865263939, -0.011154032312333584, -0.07283256947994232, 0.013995632529258728, -0.06433139741420746, -0.04374527558684349, -0.07828600704669952, -0.014837492257356644, 0.03284764289855957, -0.01158630196005106, -0.02870168536901474, 0.013941692188382149, 0.010717209428548813, 0.07341397553682327, -0.07401725649833679, 0.051890891045331955, 0.00035884379758499563, 0.04604574292898178, -0.052373796701431274, 0.06079917773604393, -0.033616382628679276, 0.011837456375360489, -0.015510743483901024, -0.0013333802344277501, -0.048695579171180725, -0.10814932733774185, 0.04055530205368996, -0.030895765870809555, -0.05719078704714775, 0.06494270265102386, -0.032369375228881836, 0.06987526267766953, 0.04798293113708496, 0.0063290949910879135, 0.044962961226701736, 0.03407059237360954, 0.07580459862947464, -0.011050709523260593, -0.007079175673425198, 0.012406811118125916, -0.002025577938184142, 0.0322861410677433, 0.00527878338471055, -0.09139233082532883, -0.048027798533439636, 0.05709857866168022, 0.06818623840808868, 0.010443574748933315, -0.028040243312716484, 0.046581365168094635, 0.026765765622258186, 0.017813226208090782, -0.0025949603877961636, -0.08216007053852081, -0.03622886538505554, -0.06063702329993248, -0.04562970623373985, 0.014996065758168697, -0.0422871932387352, -0.0024429208133369684, 0.00546468747779727, 0.054074570536613464, -0.06702912598848343, -0.005922466050833464, -0.0006251382874324918, 0.04535691440105438, -0.0057940357364714146, 0.05360831320285797, -0.04747185856103897, 0.06402048468589783, -0.051816511899232864, 0.009428017772734165, 0.033555950969457626, -0.004272144753485918, 0.02190166525542736, 0.08719729632139206, 0.004743646830320358, 0.08006923645734787, -0.02064700238406658, 0.0189061276614666, -0.014708706177771091, -0.05497068911790848, 0.041096992790699005, 0.05527440086007118, 0.06750859320163727, -0.008206541649997234, -0.016306621953845024, -0.06114071607589722, 0.008493990637362003, -0.022316893562674522, -0.0015343951527029276, -0.0640357956290245, 0.022205233573913574, 0.06292854249477386, -0.03185369819402695, 0.05215584486722946, 0.014180021360516548, -0.06407372653484344, 0.01530569326132536, 0.001026931102387607, -0.025008993223309517, -0.020671768113970757, -0.007351136766374111, 0.052658554166555405, -0.016238311305642128, 0.012273258529603481, -0.04898521304130554, 0.06254804134368896, -0.01132615003734827, 0.07160592079162598, -0.022987158969044685, 0.0034216048661619425, 0.055765073746442795, 0.018348529934883118, -0.07102754712104797, -0.046135313808918, 0.03945005685091019, 0.047982506453990936, -0.023426609113812447, -0.012098267674446106, 0.12138622999191284, -0.034227870404720306, -0.057246606796979904, -0.00694382144138217, 0.02823553793132305, -0.004964823834598064, 0.011877075769007206, 0.02729123830795288, 0.048978958278894424, -0.030145389959216118, -0.0029819756746292114, 0.0013891690177842975, -0.000019016644728253596, 0.05117921158671379, 0.010310017503798008, 0.01648082584142685, -0.028082361444830894, -0.006317483726888895, 0.0029730077367275953, -0.11897504329681396, -0.008084135130047798, -0.038291480392217636, -0.04873819276690483, 0.010981148108839989, -0.0325048565864563, -0.07251206040382385, 0.02444607764482498, 0.008529421873390675, 0.04667206481099129, 0.03785877302289009, 0.01445004716515541, 0.0719355046749115, 0.051154930144548416, -0.013954482041299343, 0.046244457364082336, -0.022288819774985313, -0.020383460447192192, 0.03178178519010544, 0.03492119535803795, -0.004963690415024757, -0.009071310982108116, -0.0025025014765560627, -0.00006926725473022088, -0.0522041916847229, 0.15404517948627472, -0.0014911358011886477, -0.0027417957317084074, 0.05147496610879898, 0.06419901549816132, 0.034551721066236496, -0.018545428290963173, 0.042892053723335266, 0.0965447872877121, -0.02374415099620819, 0.011622733436524868, 0.010032414458692074, -0.016978520900011063, 0.03852542117238045, 0.09694933891296387, -0.03503125533461571, 0.1057475209236145, -0.10518813878297806, -0.027101842686533928, 0.004243096802383661, -0.006274254061281681, 0.08231526613235474, -0.026271864771842957, -0.029783543199300766, 0.009911732748150826, 0.005532199516892433, 0.042739201337099075, -0.03206309676170349, 0.05655016377568245, -0.03582001477479935, -0.08612041920423508, -0.025618940591812134, -0.024472476914525032, -0.05055491626262665, 0.06901566684246063, 0.0033502355217933655, 0.01942017674446106, 0.025281252339482307, 0.0172840915620327, -0.04297811537981033, 0.022436538711190224, 0.035426340997219086, 0.031618114560842514, -0.01816732808947563, -0.019011909142136574, -0.021622126922011375, -0.026452356949448586, 0.04916279390454292, -0.025821518152952194, 0.0021210850682109594, 0.028334151953458786, -0.012399127706885338, -0.014324506744742393, 0.017682017758488655, -0.004927847068756819, 0.010156715288758278, 0.01469311211258173, 0.014577552676200867, 0.0003064340562559664, -0.006518117152154446, -0.019719243049621582, -0.06152746453881264, 0.00482448935508728, 0.03908239305019379, -0.050384365022182465, -0.006285638548433781, 0.009527171030640602, 0.007950091734528542, -0.03908933326601982, -0.01667974703013897, 0.009821292012929916, 0.010012873448431492, -0.007278071716427803, 0.016640009358525276, -0.020824285224080086, -0.022919747978448868, -0.054962288588285446, 0.01716672070324421, 0.000394654693081975, 0.04250218719244003, -0.013345228508114815, 0.012326150201261044, 0.023816026747226715, -0.003090000245720148, 0.03829532116651535, -0.00021490108338184655, -0.00692009087651968, 0.02883738838136196, -0.0001495545729994774, -0.006836757063865662, 0.008133324794471264, -0.004707776475697756, -0.0497824028134346, 0.020145855844020844, 0.04474605992436409, -0.02393839694559574, -0.09645503759384155, -0.007884293794631958, 0.0042689209803938866, 0.01734423078596592, 0.0235766414552927, 0.01113825011998415, 0.06079168990254402, -0.018209826201200485, -0.01135734748095274, -0.0033247368410229683, -0.0549057237803936, 0.01177235972136259, 0.0006322331028059125, -0.013928268104791641, 0.036767084151506424, -0.0031456309370696545, -0.014062801375985146, 0.04610815644264221, 0.04582931101322174, -0.015026109293103218, -0.033814702183008194, 0.049890682101249695, -0.013150334358215332, -0.02992209605872631, -0.013571511022746563, 0.0064199501648545265, 0.03915099427103996, 0.01028592512011528, 0.03353867307305336, -0.045162834227085114, -0.012166868895292282, -0.0430234856903553, -0.021237393841147423, -0.017133498564362526, -0.03477859124541283, -0.012943017296493053, -0.00104706606362015, -0.03795579448342323, 0.0061318832449615, -0.014642189256846905, 0.0008180444710887969, 0.05235609784722328, 0.006189547013491392, 0.001410438446328044, 0.03175906836986542, -0.028219588100910187, -0.04378397762775421, -0.006096471566706896, 0.024661028757691383, 0.0023585024755448103, -0.017392843961715698, 0.0267875287681818, 0.019276795908808708, 0.07345384359359741, -0.012118796817958355, -0.030103430151939392, 0.022206030786037445, 0.024881431832909584, 0.025639476254582405, 0.02678230218589306, -0.011246639303863049, 0.014188048429787159, -0.005266549997031689, -0.006679067853838205, -0.029581241309642792, 0.019790712743997574, 0.039881493896245956, 0.002119319513440132, 0.026572708040475845, 0.013962975703179836, -0.014298866502940655, 0.008408312685787678, 0.015033259056508541, 0.020448561757802963, 0.01233267318457365, -0.04879375547170639, -0.03023945353925228, -0.01315355021506548, 0.07492633908987045, 0.009962145239114761, 0.05389596149325371, 0.010087241418659687, 0.02332289330661297, -0.024640576913952827, -0.010216183960437775, 0.0312754288315773, 0.01975509338080883, -0.06174906715750694, 0.03043275885283947, 0.014800834469497204, 0.027281764894723892, -0.04079850763082504, 0.00417572446167469, -0.004912807606160641, -0.019606629386544228, -0.007330221589654684, 0.04134513810276985, -0.01825922355055809, 0.016742127016186714, -0.0251326784491539, -0.0173195768147707, -0.04314352571964264, 0.030492793768644333, 0.030034299939870834, 0.02288956195116043, 0.010857856832444668, -0.028166024014353752, -0.01343250460922718, 0.00577842490747571, -0.025287257507443428, -0.009159956127405167, 0.01051316037774086, -0.03289661183953285, -0.025983035564422607, -0.005263203755021095, 0.03760242834687233, 0.006582890637218952, -0.03988628089427948, -0.008029788732528687, 0.04810473695397377, -0.034551218152046204, -0.040161773562431335, 0.00958356261253357, -0.003613037057220936, -0.016976607963442802, -0.017496177926659584, 0.039762359112501144, -0.03808429837226868, 0.044356659054756165, -0.020776795223355293, -0.014519269578158855, -0.033631954342126846, -0.010804426856338978, 0.009363281540572643, 0.028132837265729904, 0.012838069349527359, 0.06842487305402756, 0.015936147421598434, 0.05977919325232506, -0.047886427491903305, -0.025287121534347534, -0.005068566184490919, -0.007638087961822748, -0.0995578020811081, 0.004127128049731255, -0.010303526185452938, -0.058176249265670776, 0.027433307841420174, -0.03762224316596985, -0.004953558556735516, -0.005507808644324541, -0.04890786483883858, 0.0138466265052557, 0.015051420778036118, -0.01141352765262127, -0.03492981567978859, 0.003992714919149876, 0.0023374909069389105, 0.012464172206819057, 0.0009549961541779339, 0.008361497893929482, -0.026664912700653076, -0.029325125738978386, 0.04968177154660225, 0.003589874366298318, 0.007032834924757481, 0.0016636367654427886, -0.0569283589720726, -0.00969056598842144, 0.0022104934323579073, -0.023396622389554977, 0.05682915076613426, -0.02006375975906849, -0.015706295147538185, -0.007652891334146261, 0.011280832812190056, 0.0036823477130383253, 0.019342869520187378, 0.0059720855206251144, 0.015024532563984394, 0.03137459605932236, 0.003214157186448574, 0.056007836014032364, -0.0334932766854763, -0.054395366460084915, -0.026948312297463417, -0.019367216154932976, -0.012238162569701672, 0.03209488093852997, 0.01361552532762289, -0.007784727960824966, -0.05351235717535019, 0.03570697456598282, -0.04393744841217995, 0.036408744752407074, -0.044171690940856934, -0.045890387147665024, 0.0004635939549189061, 0.005086135119199753, -0.04217757657170296, 0.01932169497013092, -0.0163715910166502, -0.029900597408413887, 0.01976601965725422, 0.011869837529957294, 0.020202813670039177, 0.013157235458493233, -0.047246530652046204, 0.04770360514521599, 0.013443890027701855, 0.023242825642228127, -0.02373954840004444, -0.004639824852347374, -0.002714573871344328, -0.02134801633656025, -0.01987132616341114, -0.007085594814270735, -0.016583632677793503, -0.011620629578828812, 0.05854266881942749, -0.008887807838618755, -0.009059439413249493, -0.00330993696115911, 0.035542428493499756, 0.03723973035812378, 0.01613653264939785, 0.005404788069427013, 0.012780838645994663, -0.012704133056104183, 0.008566075004637241, 0.04774109274148941, -0.004862033762037754, 0.04859420657157898, -0.010343454778194427, -0.02066468447446823, 0.01718403585255146, -0.03201108053326607, -0.007833817042410374, 0.01796591468155384, -0.008116045966744423, 0.012987973168492317, -0.009909004904329777, -0.027066802605986595, 0.005309257656335831, -0.0033418508246541023, -0.025394722819328308, 0.08131115138530731, -0.0006632620352320373, -0.024527445435523987, -0.006872083060443401, 0.03538355976343155, -0.018770169466733932, 0.01588125340640545, -0.012005819007754326, -0.002985462313517928, 0.014015880413353443, 0.01595984399318695, 0.00017672445392236114, 0.030312713235616684, -0.015138059854507446, 0.033208295702934265, -0.011935140937566757, 0.0019258366664871573, 0.003602368989959359, 0.06186981871724129, -0.008384416811168194, -0.005652199499309063, -0.035469233989715576, -0.04358546435832977, 0.026157408952713013, -0.008160808123648167, 0.056412506848573685, 0.04803353175520897, 0.01838209293782711, 0.07398682087659836, -0.046789027750492096, -0.0045470669865608215, 0.03673284128308296, -0.006273955572396517, 0.03545526787638664, 0.023741701617836952, -0.0016504399245604873, 0.00857786275446415, -0.026805534958839417, -0.010622619651257992, -0.03203258663415909, 0.049190402030944824, 0.009876872412860394, 0.023057514801621437, 0.013657632283866405, -0.02851683646440506, 0.014852911233901978, -0.04016340151429176, -0.0018989471718668938, -0.005785566754639149, 0.0506364144384861, 0.02110968343913555, 0.004658463876694441, -0.01424513477832079, -0.014832409098744392, 0.06778412312269211, 0.010909649543464184, 0.042270224541425705, 0.005379923619329929, 0.01253113429993391, 0.041861578822135925, 0.030961841344833374, -0.03869893029332161, 0.013722757808864117, 0.000513856706675142, -0.015964612364768982, 0.041926223784685135, 0.013835152611136436, 0.022277893498539925, 0.019153153523802757, 0.02529386803507805, 0.043228212743997574, -0.018545443192124367, -0.019105220213532448, 0.00694611482322216, 0.05413682386279106, -0.07635162770748138, -0.017769496887922287, -0.02402917481958866, -0.030424820259213448, -0.0042680250480771065, 0.006709638983011246, 0.003255680436268449, 0.020863644778728485, -0.007803059183061123, 0.01350113470107317, -0.006630525458604097, 0.025096304714679718, 0.0012855409877374768, -0.015780093148350716, 0.019909778609871864, 0.014128116890788078, 0.004114136565476656, -0.00934237614274025, -0.032338663935661316, -0.007824251428246498, -0.027480462566018105, -0.00664489483460784, 0.016688872128725052, 0.001250821747817099, -0.022326143458485603, -0.0015284712426364422, -0.004350768402218819, -0.01258103083819151, 0.040502578020095825, -0.015688611194491386, 0.010329559445381165, -0.05067199468612671, 0.0646076500415802, -0.07832332700490952, -0.029008865356445312, 0.01441276166588068, -0.002472852123901248, 0.0030411165207624435, -0.030739538371562958, 0.005044147372245789, -0.04047933965921402, -0.007177354302257299, -0.02979889139533043, -0.05764566734433174, 0.05006646364927292, 0.03696804121136665, -0.03923066332936287, 0.024215232580900192, -0.012669344432651997, 0.0002655801363289356, 0.0027464376762509346, 0.015478606335818768, 0.019377680495381355, 0.03626948222517967, 0.006027756258845329, 0.027575133368372917, 0.007520483341068029, -0.007891963236033916, 0.007490753661841154, 0.03897412121295929, 0.03010709397494793, 0.020230179652571678, 0.015359558165073395, 0.01481494028121233, -0.028887512162327766, 0.014884660951793194, 0.01079562772065401, -0.005286581814289093, -0.0007327478379011154, -0.04368693009018898, -0.0238506942987442, -0.03310385346412659, -0.019621022045612335, 0.011976758018136024, -0.03177054971456528, -0.03881329670548439, -0.0013639582321047783, 0.007631817366927862, -0.007433953229337931, 0.0022995586041361094, -0.007118884474039078, 0.001551730907522142, 0.023375675082206726, 0.005513171199709177, -0.007931292057037354, 0.013852452859282494, 0.03986141085624695, 0.031423259526491165, -0.031162505969405174, 0.012660094536840916, 0.025629354640841484, -0.01819201186299324, -0.028931457549333572, 0.03935666009783745, -0.03778308629989624, -0.029189296066761017, -0.021724775433540344, 0.00947851873934269, 0.003076460910961032, -0.04092671349644661, 0.0019453949062153697, 0.02975534088909626, -0.011563850566744804, 0.004747544415295124, -0.023936554789543152, -0.07073654234409332, 0.025254957377910614, 0.0047327145002782345, -0.008492144756019115, 0.027270516380667686, -0.007738347165286541, 0.003734471509233117, 0.017774755135178566, -0.03142938390374184, 0.018872037529945374, -0.010963541455566883, -0.011196152307093143, 0.023200126364827156, 0.012255127541720867, -0.035421594977378845, -0.05723412334918976, -0.07219573855400085, 0.05762861669063568, -0.06440922617912292, 0.02292821556329727, 0.0026178520638495684, -0.008116778917610645, -0.019576862454414368, 0.01609116792678833, 0.0357431061565876, -0.014562973752617836, 0.011601299978792667, 0.046715542674064636, -0.013022070750594139, 0.04107142612338066, -0.02840450219810009, -0.09858103096485138, -0.025662491098046303, 0.05573231726884842 ]
Gradio-Lite: Serverless Gradio Running Entirely in Your Browser
abidlabs
October 19, 2023
gradio-lite
gradio, open-source, serverless
https://huggingface.co/blog/gradio-lite
What is @gradio/lite? @gradio/lite is a JavaScript library that enables you to run Gradio applications directly within your web browser. It achieves this by utilizing Pyodide, a Python runtime for WebAssembly, which allows Python code to be executed in the browser environment. With @gradio/lite, you can write regular Python code for your Gradio applications, and they will run seamlessly in the browser without the need for server-side infrastructure.
[ 0.015185732394456863, 0.036707863211631775, 0.10665368288755417, 0.020457498729228973, 0.06989401578903198, 0.06192300468683243, 0.0724114328622818, 0.029252521693706512, -0.0030294039752334356, 0.0019117549527436495, -0.09393230080604553, 0.00012972406693734229, -0.05783384293317795, 0.04770137369632721, 0.029419880360364914, 0.06430377066135406, 0.05055273696780205, -0.07653623074293137, -0.0768774226307869, 0.03646855428814888, -0.02161676064133644, -0.051953740417957306, -0.033340103924274445, 0.015368819236755371, -0.054113760590553284, -0.019737055525183678, -0.019992215558886528, 0.006721194833517075, -0.1065187081694603, 0.021784741431474686, -0.04827997833490372, -0.041123319417238235, -0.019194142892956734, -0.07764756679534912, 0.007351093925535679, 0.054136600345373154, -0.04427704960107803, 0.11792972683906555, 0.0033237941097468138, -0.019349610432982445, 0.005975490901619196, -0.03755601495504379, -0.04791942238807678, 0.031134111806750298, -0.03127361461520195, 0.032225362956523895, -0.1556987166404724, 0.018980206921696663, -0.03302750736474991, -0.039195671677589417, -0.07119607925415039, 0.06425637751817703, -0.06087140738964081, -0.03283480182290077, -0.07602353394031525, 0.0990627110004425, 0.023237193003296852, -0.05082547664642334, 0.03863690048456192, -0.024853497743606567, -0.03352321684360504, 0.022227276116609573, -0.0700390487909317, 0.04892894625663757, 0.04660255089402199, 0.023291749879717827, -0.03575959429144859, 0.04777203127741814, -0.018146105110645294, 0.0204186849296093, 0.0015123782213777304, 0.04005526751279831, -0.06653118133544922, -0.06997625529766083, 0.021118026226758957, -0.020670494064688683, -0.083022341132164, 0.07084333151578903, 0.016069604083895683, 0.085382379591465, 0.04726187512278557, 0.01833675242960453, 0.06751465797424316, 0.02235129475593567, 0.05354171618819237, 0.015808476135134697, 0.003117429558187723, 0.012799388729035854, -0.048679932951927185, 0.013169405981898308, -0.018158040940761566, -0.08771850913763046, 0.002198829548433423, 0.03971173241734505, 0.08312582224607468, 0.0379258394241333, -0.030871601775288582, 0.038801584392786026, 0.04994264245033264, 0.033681273460388184, 0.030799493193626404, -0.051348112523555756, -0.047379497438669205, -0.07252350449562073, -0.022752543911337852, 0.04958931729197502, -0.04665052145719528, -0.002280971733853221, 0.0031488798558712006, 0.052603889256715775, -0.07388219982385635, -0.014092832803726196, -0.04742523282766342, -0.00223629386164248, 0.016335133463144302, 0.02024175226688385, -0.017506351694464684, 0.057646047323942184, -0.049236688762903214, 0.006241682916879654, 0.0023270975798368454, 0.043617889285087585, 0.051655784249305725, 0.06495843082666397, 0.03581049665808678, 0.05670160800218582, 0.013124384917318821, 0.036343563348054886, 0.04769120365381241, -0.03326531499624252, 0.07932604849338531, 0.06942009925842285, 0.02793162688612938, 0.004653324373066425, 0.005445525981485844, -0.022486897185444832, -0.0007160987006500363, -0.023694410920143127, -0.014436129480600357, -0.020979853346943855, -0.005191374570131302, 0.05201060697436333, -0.04375794157385826, 0.0391000360250473, -0.0021642635110765696, -0.06435506045818329, 0.030165204778313637, 0.03574392572045326, -0.030139977112412453, 0.020985465496778488, -0.05435721576213837, 0.03472762927412987, -0.058139074593782425, 0.009612523950636387, -0.05587196722626686, 0.05031045526266098, -0.005683438386768103, 0.01002334151417017, -0.006456273142248392, 0.01157144084572792, 0.016915490850806236, 0.007245783694088459, -0.10132008045911789, -0.057463470846414566, 0.0920308455824852, 0.06626221537590027, -0.04150889813899994, -0.001839930540882051, 0.11381301283836365, -0.07242186367511749, -0.055036865174770355, -0.01878257468342781, 0.045940082520246506, -0.01433912105858326, 0.03611873462796211, 0.04865681007504463, 0.040968187153339386, -0.0057126921601593494, -0.0024329645093530416, -0.008230330422520638, 0.005421548616141081, 0.00413909275084734, 0.024189196527004242, 0.001912857056595385, -0.05269147455692291, -0.019578993320465088, -0.004080690443515778, -0.07027817517518997, -0.013698677532374859, -0.004754354711622, -0.056254640221595764, 0.008315103128552437, -0.01853923872113228, -0.06618373095989227, 0.06914793699979782, -0.02597045712172985, -0.002537395106628537, 0.06147168204188347, 0.06156182661652565, 0.03425803408026695, 0.058519765734672546, -0.01540305931121111, 0.06009675934910774, -0.03612320497632027, -0.042920906096696854, 0.047244247049093246, 0.06885267794132233, 0.007712343707680702, 0.03709522262215614, -0.0001211837661685422, -0.021562114357948303, -0.052598170936107635, 0.08570215851068497, -0.01876850798726082, -0.014935793355107307, 0.10145469009876251, 0.009923926554620266, 0.0015626292442902923, -0.023333998396992683, 0.001266131759621203, 0.08771902322769165, -0.0677812322974205, -0.03266311436891556, -0.007796869147568941, -0.016960054636001587, 0.08292732387781143, 0.07973889261484146, -0.0569702573120594, 0.10473344475030899, -0.05423831567168236, 0.05811803415417671, -0.0020330946426838636, 0.022978100925683975, 0.04076438024640083, -0.0005809466238133609, -0.02120472863316536, 0.05383949354290962, -0.015443537384271622, 0.049234647303819656, 0.005206507630646229, 0.05967416614294052, 0.02587823197245598, -0.04520514979958534, -0.006440607365220785, 0.014267975464463234, -0.04437818378210068, 0.06120631843805313, -0.0013113104505464435, 0.04514969885349274, 0.003737799357622862, 0.027562730014324188, -0.06559830904006958, 0.053033385425806046, 0.04765075072646141, 0.017731819301843643, -0.04255283623933792, -0.029988938942551613, -0.017684949561953545, -0.013437545858323574, 0.043385718017816544, -0.02556176297366619, -0.043126825243234634, 0.007395678665488958, -0.008457467891275883, 0.0025797805283218622, 0.0022423481568694115, 0.03122927062213421, 0.04883424565196037, 0.055514417588710785, 0.008293219842016697, 0.005205961875617504, -0.04763288423418999, -0.011053121648728848, -0.040489666163921356, 0.013594741001725197, 0.03392145037651062, -0.008448307402431965, -0.03262748569250107, -0.00737783731892705, -0.029497263953089714, -0.04204897582530975, -0.00004696233372669667, 0.02336265705525875, 0.011098574846982956, -0.002774575026705861, -0.004353082273155451, -0.020669957622885704, -0.037243690341711044, -0.04626690223813057, 0.027465565130114555, -0.023864543065428734, 0.01780989021062851, -0.01127457432448864, 0.014467381872236729, 0.04317763075232506, -0.042265117168426514, 0.03541433811187744, 0.007635734509676695, -0.027541203424334526, -0.0009613481815904379, 0.013248303905129433, -0.026445772498846054, 0.011733346618711948, 0.02414359338581562, -0.024175049737095833, 0.019245754927396774, 0.039710044860839844, -0.01641067862510681, -0.09720804542303085, -0.02496953308582306, -0.0005451141041703522, 0.017600681632757187, 0.005175435449928045, 0.013959118165075779, 0.06621648371219635, 0.004171035252511501, -0.012407715432345867, 0.013367945328354836, -0.024139946326613426, -0.00253989826887846, 0.015762286260724068, -0.009899606928229332, 0.02448066510260105, -0.029644643887877464, -0.007607750594615936, 0.018650535494089127, 0.03004382736980915, -0.018838610500097275, -0.012572303414344788, 0.04121159762144089, -0.035888686776161194, -0.03564804419875145, -0.003784428583458066, -0.013316654600203037, 0.005801244173198938, -0.00001936825537995901, 0.031804345548152924, 0.01326465979218483, 0.029527289792895317, -0.014742319472134113, -0.01901172660291195, 0.0035692842211574316, -0.04193549603223801, -0.015345919877290726, 0.024973351508378983, -0.03107485920190811, 0.007849760353565216, -0.027346165850758553, -0.014189048670232296, 0.017659079283475876, -0.0020675312262028456, -0.005875119939446449, 0.034985724836587906, -0.02347189001739025, -0.021516425535082817, 0.02507009729743004, 0.02722683548927307, -0.01428789272904396, -0.04471389576792717, 0.05031731724739075, -0.0014677426079288125, 0.05069468915462494, 0.02368314005434513, -0.03072286769747734, 0.02168775536119938, 0.03941275179386139, 0.029179537668824196, 0.014586822129786015, -0.02710680291056633, 0.011039221659302711, 0.0058480543084442616, 0.013674331828951836, -0.031006239354610443, 0.025848617777228355, 0.05365215614438057, 0.019081467762589455, -0.006226568017154932, -0.014128672890365124, -0.011417354457080364, 0.03423843905329704, 0.02813277393579483, 0.018145626410841942, 0.003360999748110771, -0.032285258173942566, -0.04639396816492081, 0.003206142457202077, 0.05418013036251068, 0.011883222497999668, 0.05969909206032753, -0.015928488224744797, 0.022335611283779144, -0.029638171195983887, -0.020973781123757362, 0.003691986668854952, -0.02213093265891075, -0.03674796223640442, 0.008343151770532131, 0.02426590584218502, 0.01237922441214323, -0.026079095900058746, 0.04889567941427231, 0.005134396720677614, -0.03209036961197853, 0.013900546357035637, 0.0403020866215229, 0.003690668847411871, 0.015113762579858303, -0.032028183341026306, -0.01137794554233551, -0.0650344267487526, 0.02588677778840065, -0.023243524134159088, -0.003085522213950753, 0.04194793850183487, 0.0017266495851799846, -0.014568794518709183, 0.0013845650246366858, -0.0030563229229301214, 0.007386629469692707, 0.028351295739412308, -0.0012338883243501186, 0.018102936446666718, -0.0019016952719539404, -0.008413408882915974, 0.0027410658076405525, -0.06202855333685875, -0.007443531882017851, 0.030795227736234665, -0.0361621119081974, -0.01870613731443882, 0.013175113126635551, 0.014070789329707623, -0.046903230249881744, -0.04435991123318672, -0.010023949667811394, -0.037935443222522736, 0.03763189911842346, -0.02563324384391308, -0.04802807420492172, -0.0049260943196713924, -0.004481392912566662, -0.009001866914331913, 0.051599398255348206, -0.004731755703687668, 0.07829800248146057, -0.020784595981240273, 0.03889905661344528, -0.048963241279125214, -0.021146943792700768, -0.009758018888533115, -0.012626557610929012, -0.04918406158685684, 0.004923243075609207, 0.010864012874662876, -0.055453862994909286, 0.0341571606695652, -0.048637036234140396, 0.031050007790327072, -0.025098426267504692, -0.07101143151521683, 0.01241490337997675, 0.011140674352645874, 0.019848903641104698, 0.018403377383947372, -0.006869921460747719, 0.013374723494052887, -0.009374024346470833, 0.001017988659441471, 0.01970841735601425, -0.03552091866731644, -0.045681893825531006, 0.011143515817821026, -0.004039428196847439, -0.0023211974184960127, 0.009406019933521748, -0.007168874144554138, 0.014015608467161655, -0.012524652294814587, -0.044437963515520096, 0.04967556893825531, -0.01824028231203556, -0.0009171307319775224, -0.01130410935729742, 0.017624493688344955, -0.01607595756649971, 0.011371009051799774, -0.002558967564254999, 0.027837932109832764, 0.016114236786961555, -0.0315643846988678, 0.05578194186091423, -0.02133190631866455, -0.00406669033691287, -0.036767780780792236, -0.024457832798361778, 0.03104308620095253, 0.002662213984876871, 0.03746337071061134, 0.0046708472073078156, -0.02811523713171482, 0.04876966401934624, -0.012609596364200115, 0.05813678354024887, -0.03196802735328674, -0.05029737576842308, 0.006500895135104656, -0.0007152673206292093, -0.05346088483929634, 0.0315103679895401, -0.022250548005104065, -0.0334499217569828, 0.018777815625071526, 0.01624535396695137, 0.0463421493768692, -0.004142965655773878, -0.06650446355342865, 0.013768283650279045, 0.012793448753654957, 0.00408184714615345, -0.018226144835352898, 0.00841515976935625, 0.009546668268740177, -0.017708448693156242, -0.022534377872943878, -0.019216381013393402, -0.015342656522989273, -0.0035850433632731438, 0.0295565128326416, -0.012649929150938988, 0.006156820338219404, 0.0011992724612355232, 0.015767425298690796, 0.011700073257088661, 0.006588295102119446, -0.003840117948129773, 0.01770039089024067, -0.005036977585405111, 0.024037903174757957, 0.0577014721930027, 0.019027991220355034, 0.04113559424877167, -0.03928711637854576, -0.002299757208675146, 0.01703944243490696, -0.02529805339872837, 0.012768094427883625, -0.003720767330378294, -0.04746439680457115, 0.001254266477189958, -0.017913969233632088, -0.034759603440761566, 0.010125182569026947, -0.02146954834461212, -0.027058487758040428, 0.0640462189912796, 0.0008051153854466975, 0.012698202393949032, 0.0049913302063941956, 0.047257713973522186, -0.011500942520797253, 0.028104111552238464, -0.0584416501224041, 0.0072422632947564125, 0.030824963003396988, 0.037371210753917694, -0.006481772754341364, 0.020596250891685486, -0.04016822949051857, 0.040613021701574326, -0.002676313277333975, -0.01164502277970314, 0.05242053046822548, 0.01670537143945694, 0.006111010909080505, 0.001124212401919067, -0.05137632042169571, -0.038366951048374176, 0.02292259968817234, -0.04051436111330986, 0.04457838460803032, 0.03776819631457329, 0.010141856968402863, 0.053240012377500534, -0.044514693319797516, -0.031237389892339706, 0.03636656329035759, 0.01062828116118908, 0.03252735361456871, 0.03133983537554741, 0.03602835163474083, 0.018399985507130623, -0.011943505145609379, -0.013231100514531136, -0.049342211335897446, 0.08006101846694946, 0.012069804593920708, 0.023772846907377243, 0.01405725535005331, -0.04006803780794144, 0.030575018376111984, -0.009405220858752728, -0.006407575681805611, -0.02158428728580475, 0.012090206146240234, -0.004447923973202705, 0.0013261983403936028, -0.006251071114093065, -0.016207341104745865, 0.07074625045061111, 0.017979908734560013, 0.036026179790496826, 0.012120820581912994, 0.01587618887424469, -0.002177715301513672, 0.035701435059309006, -0.01669216901063919, 0.026475852355360985, -0.017303170636296272, -0.018801722675561905, 0.05697373300790787, 0.013019794598221779, 0.03047545626759529, 0.024729974567890167, 0.0043082814663648605, -0.003935941029340029, -0.021737420931458473, -0.009218460880219936, 0.020373651757836342, 0.024667851626873016, -0.04307691007852554, 0.012710834853351116, -0.028343230485916138, -0.023136284202337265, -0.012251324951648712, 0.021710066124796867, 0.010251078754663467, 0.005767624359577894, -0.015898099169135094, -0.0021605168003588915, -0.037024375051259995, 0.0010346691124141216, 0.022114232182502747, -0.007731159683316946, 0.01071698497980833, 0.03356024995446205, 0.012846213765442371, -0.023710597306489944, -0.03266601264476776, -0.015153607353568077, -0.009314618073403835, -0.01571899838745594, 0.02480500563979149, -0.022846873849630356, -0.028443695977330208, -0.04424136504530907, 0.009264567866921425, -0.0063094645738601685, 0.020136380568146706, -0.015793634578585625, 0.05477330833673477, -0.07380032539367676, 0.0362183079123497, -0.06296314299106598, -0.03445188328623772, -0.01623167283833027, -0.006712058093398809, 0.016624361276626587, -0.02232184447348118, 0.03200637176632881, -0.01100083440542221, -0.0019788069184869528, -0.020447174087166786, -0.047841716557741165, 0.024159058928489685, -0.023323705419898033, -0.02461453154683113, 0.02146923914551735, -0.011630602180957794, 0.010703520849347115, 0.012293766252696514, 0.005973499268293381, 0.06316132843494415, 0.03349762409925461, 0.0001573938934598118, 0.04607226327061653, 0.014043595641851425, -0.023974789306521416, 0.022240759804844856, 0.00670760590583086, 0.026200605556368828, 0.02100238762795925, 0.028012080118060112, 0.039856649935245514, -0.04384578764438629, 0.007269158959388733, -0.0007603949634358287, 0.00844887737184763, 0.016031833365559578, -0.006856197025626898, -0.05531873181462288, -0.024717064574360847, -0.033422812819480896, 0.008703265339136124, -0.005651597399264574, -0.023435082286596298, -0.016287382692098618, -0.007611738983541727, -0.017495067790150642, -0.03520403802394867, 0.0244353786110878, -0.03457581251859665, 0.04907509312033653, -0.007213205564767122, -0.041192956268787384, 0.017873400822281837, 0.003046440426260233, 0.006536342203617096, -0.022573573514819145, 0.04228496924042702, -0.011690149083733559, -0.006180893629789352, -0.055451128631830215, 0.0025601291563361883, -0.014500071294605732, -0.03547429293394089, -0.04134272411465645, 0.01211987342685461, -0.03684966638684273, -0.021803786978125572, 0.01771925389766693, 0.02791076898574829, -0.005358187481760979, 0.020002737641334534, -0.007737268693745136, -0.046593789011240005, 0.017501570284366608, -0.00959568191319704, -0.03988812863826752, 0.02133062481880188, 0.001010664040222764, 0.0007346064085140824, 0.005417752545326948, -0.05026093125343323, 0.027283702045679092, -0.04192427545785904, -0.012537508271634579, 0.035313814878463745, -0.027198098599910736, -0.0005764454836025834, -0.03768862038850784, -0.06885825097560883, 0.032381571829319, -0.05199461802840233, 0.027692923322319984, -0.002679727040231228, -0.045140862464904785, -0.007998252287507057, 0.003108695615082979, 0.03005366027355194, 0.004453843459486961, 0.04040885716676712, 0.0736161321401596, -0.057110343128442764, 0.04633333534002304, -0.01349758543074131, -0.07600025832653046, -0.04273292049765587, 0.020256204530596733 ]
Gradio-Lite: Serverless Gradio Running Entirely in Your Browser
abidlabs
October 19, 2023
gradio-lite
gradio, open-source, serverless
https://huggingface.co/blog/gradio-lite
2. Low Latency By running in the browser, @gradio/lite offers low-latency interactions for users. There's no need for data to travel to and from a server, resulting in faster responses and a smoother user experience.
[ 0.014668627642095089, 0.014015941880643368, 0.12115020304918289, 0.045491695404052734, 0.024523360654711723, -0.007838580757379532, 0.04205656051635742, 0.10310903936624527, -0.010791006498038769, -0.08821822702884674, -0.0682692602276802, 0.007609752472490072, -0.03723397105932236, -0.012008427642285824, -0.03791925683617592, 0.046633679419755936, 0.019778836518526077, -0.10469108074903488, -0.013067985884845257, -0.004158508963882923, -0.0014178314013406634, -0.02450570836663246, -0.006183162331581116, 0.01816718280315399, -0.04504496231675148, -0.006215830333530903, -0.0628877580165863, 0.007509669288992882, -0.1323215216398239, -0.01845434308052063, -0.02315397746860981, -0.024921443313360214, 0.01501447707414627, -0.04861702024936676, 0.01746027171611786, 0.015886062756180763, 0.018429389223456383, 0.11908501386642456, -0.020367290824651718, -0.07359325140714645, -0.0005572665249928832, -0.06385092437267303, -0.08433687686920166, 0.06017841398715973, -0.06608541309833527, 0.02053828537464142, -0.22513459622859955, 0.015563326887786388, -0.0483715794980526, 0.0012825805461034179, -0.12184828519821167, 0.10323014110326767, -0.04107361659407616, 0.04529678076505661, -0.014366582036018372, 0.031893279403448105, 0.042798757553100586, 0.0031103563960641623, 0.04407881945371628, -0.03228210657835007, 0.03393997624516487, 0.02374582551419735, -0.05508793890476227, 0.0135059654712677, 0.0008888942538760602, -0.021655313670635223, -0.02782757394015789, -0.0015387432649731636, 0.013891047798097134, 0.020295217633247375, 0.007670216728001833, 0.023569298908114433, -0.0185114536434412, -0.06280313432216644, -0.00229685939848423, 0.025513920933008194, -0.09919930249452591, 0.024332748726010323, 0.024689938873052597, 0.08793788403272629, 0.023460060358047485, 0.011417527683079243, 0.07102970033884048, 0.035631582140922546, 0.05351674556732178, 0.019628487527370453, 0.03585876524448395, 0.011887024156749249, -0.0611359179019928, -0.005798293277621269, 0.0007412585546262562, -0.12503620982170105, 0.06700331717729568, 0.011079971678555012, 0.07029210031032562, 0.037005070596933365, 0.032132651656866074, 0.07514775544404984, -0.009867980144917965, 0.014559308998286724, 0.016497747972607613, -0.08370688557624817, -0.022355668246746063, -0.06552165001630783, -0.007582108490169048, 0.0008800000650808215, -0.08356883376836777, -0.0818716287612915, -0.00039967490010894835, 0.10871356725692749, -0.06218520179390907, 0.024566330015659332, -0.00021503434982150793, -0.015752429142594337, -0.03381185606122017, 0.04021323099732399, -0.02171994186937809, 0.042320962995290756, -0.007686803117394447, 0.00940181128680706, 0.004453712608665228, 0.048840247094631195, 0.041977692395448685, 0.07189364731311798, 0.006930498871952295, 0.02768571861088276, 0.053113486617803574, 0.02587733045220375, 0.023245319724082947, 0.012489675544202328, 0.054927024990320206, 0.06579870730638504, 0.0017547786701470613, 0.04678080230951309, -0.02327744849026203, -0.02110394276678562, -0.028506917878985405, -0.02954239584505558, 0.004249488469213247, -0.02454303205013275, 0.0055926647037267685, 0.017443377524614334, 0.0038897679187357426, 0.0226636603474617, 0.0010949538554996252, -0.06456688046455383, -0.017962591722607613, -0.034480154514312744, -0.0021842746064066887, 0.012084410525858402, -0.03585806488990784, 0.030507275834679604, -0.052521269768476486, -0.025390615686774254, -0.05257342383265495, 0.0557430274784565, 0.00440061604604125, -0.0258319191634655, 0.011335320770740509, 0.008774103596806526, -0.014255610294640064, -0.05209529772400856, -0.04739952087402344, -0.04257367178797722, 0.09128382802009583, 0.0353846438229084, -0.026989761739969254, 0.002769680693745613, 0.06873223930597305, -0.043438587337732315, -0.05751149728894234, 0.04187570884823799, 0.05652246251702309, -0.028403442353010178, -0.021095355972647667, 0.08486886322498322, 0.060429222881793976, 0.03438200801610947, 0.0031232149340212345, -0.01503969356417656, 0.020393598824739456, -0.0015358671080321074, 0.010211693122982979, -0.0008650665986351669, -0.01681084930896759, -0.08597083389759064, 0.00792493112385273, -0.04918817803263664, -0.03856929391622543, -0.02842871844768524, -0.026416746899485588, -0.00594785762950778, -0.0005389134166762233, -0.06109793856739998, 0.024376144632697105, -0.01563720963895321, 0.0006628144183196127, 0.0910990983247757, 0.0469953827559948, 0.06181840971112251, 0.03522837907075882, -0.009553815238177776, 0.05175875127315521, -0.019562799483537674, -0.06510546803474426, 0.0021512454841285944, 0.08471166342496872, 0.012779836542904377, 0.00993744283914566, -0.026233622804284096, -0.04938419163227081, -0.09900958091020584, 0.06303778290748596, -0.0005919984541833401, -0.015244279988110065, 0.07142326235771179, 0.07323186844587326, 0.004289623815566301, 0.003178390907123685, -0.019419539719820023, 0.0829552635550499, -0.015500219538807869, -0.022568201646208763, 0.03673340752720833, -0.01268773339688778, 0.07802505046129227, 0.07527513802051544, -0.06595703214406967, 0.11745485663414001, -0.0023597213439643383, 0.00973594095557928, -0.01175788976252079, -0.01285870186984539, 0.03715357184410095, 0.038387566804885864, 0.0191925298422575, 0.009346417151391506, -0.017393724992871284, 0.03218220919370651, 0.04074452072381973, -0.01688515581190586, -0.026240410283207893, -0.016581851989030838, 0.03584379330277443, -0.03271869197487831, -0.07462237775325775, 0.014985633082687855, -0.013949967920780182, 0.031741540879011154, -0.03171706944704056, -0.021358901634812355, -0.03669951483607292, 0.02092825248837471, 0.04234834760427475, 0.06968393921852112, -0.04357501491904259, 0.0060796840116381645, -0.011534999124705791, 0.006306960713118315, 0.018626879900693893, -0.0007149560260586441, -0.0384724959731102, 0.029829123988747597, -0.009434607811272144, 0.02629883959889412, -0.0236420389264822, -0.008549570105969906, -0.00038441031938418746, 0.043881334364414215, -0.007182080298662186, 0.008530589751899242, -0.01946653053164482, -0.01000258605927229, -0.026083778589963913, -0.027073923498392105, 0.019993845373392105, 0.021328793838620186, -0.00836461503058672, 0.014066837728023529, -0.03725998103618622, -0.021064518019557, -0.011990501545369625, 0.07124461978673935, -0.004802826792001724, 0.027920803055167198, 0.010538456030189991, -0.024039918556809425, -0.011860925704240799, -0.04735765978693962, 0.0007590876193717122, 0.00727735785767436, -0.043797507882118225, -0.016821984201669693, 0.02269795536994934, 0.0347864106297493, -0.03242510184645653, 0.060375869274139404, -0.03410576283931732, -0.026469355449080467, -0.0484807975590229, -0.013602083548903465, -0.04563889652490616, -0.007828587666153908, 0.021441113203763962, -0.024448230862617493, 0.02463311143219471, 0.01298173051327467, -0.021028289571404457, -0.11509227752685547, -0.006791333667933941, -0.0036870830226689577, 0.012362722307443619, -0.010834652930498123, -0.0203572828322649, 0.04992673918604851, -0.01977727562189102, -0.029539059847593307, 0.016637645661830902, -0.0383741594851017, 0.010589871555566788, 0.0009226779220625758, -0.027066683396697044, 0.004932986106723547, -0.0012043839087709785, 0.019539060071110725, 0.05991153419017792, 0.0011824308894574642, -0.0494137778878212, 0.0030790874734520912, 0.032445624470710754, -0.013635574840009212, -0.03233415633440018, -0.03598896786570549, 0.0373452790081501, 0.023120183497667313, -0.02282830700278282, 0.03055095300078392, 0.013582611456513405, 0.021665876731276512, 0.004573552869260311, -0.015896789729595184, 0.010815744288265705, -0.012849193997681141, -0.001567609142512083, 0.0366847962141037, -0.008629289455711842, 0.025270719081163406, -0.015811646357178688, 0.002403236459940672, 0.0075730518437922, 0.031101858243346214, -0.003460658248513937, 0.006155168171972036, -0.019552985206246376, 0.018518082797527313, 0.021508799865841866, 0.08623943477869034, -0.042362675070762634, -0.03646310046315193, 0.03392763435840607, -0.008938794024288654, 0.04760221391916275, 0.024638889357447624, -0.041555870324373245, -0.024783888831734657, 0.009039743803441525, 0.035637930035591125, 0.009202192537486553, -0.03079122118651867, 0.00047247493057511747, 0.025797152891755104, 0.015865938737988472, -0.07846397906541824, 0.028422756120562553, 0.02649274840950966, 0.05046016722917557, -0.0045258644968271255, -0.006902217864990234, -0.00976216048002243, 0.018904022872447968, 0.03433874249458313, 0.024724088609218597, 0.022842522710561752, -0.018055623397231102, -0.019295338541269302, 0.009344668127596378, 0.0765763446688652, -0.008733142167329788, 0.04105681926012039, -0.03228354454040527, 0.0037516066804528236, -0.011309693567454815, -0.01135906483978033, 0.013553419150412083, 0.0017245837952941656, 0.028317473828792572, -0.006764903664588928, 0.023456741124391556, 0.024100014939904213, -0.02822134830057621, 0.05287601798772812, -0.012863533571362495, -0.009001325815916061, -0.0019932794384658337, 0.06238362565636635, 0.00964186992496252, 0.005017134360969067, -0.026004312559962273, 0.006464135367423296, -0.02584349736571312, 0.025310704484581947, 0.0042477077804505825, -0.01574152521789074, 0.04942161589860916, -0.010114560835063457, -0.010462944395840168, 0.012845098040997982, 0.029657844454050064, 0.020077131688594818, 0.05258803814649582, 0.005049854516983032, -0.009487062692642212, 0.022118235006928444, 0.015373715199530125, -0.006249816156923771, -0.03215137869119644, -0.014706450514495373, 0.018487533554434776, -0.027674144133925438, 0.0036580918822437525, 0.014777615666389465, 0.013933605514466763, -0.008754653856158257, 0.008638359606266022, -0.011220847256481647, -0.025997720658779144, 0.015403484925627708, -0.019364003092050552, -0.024639395996928215, -0.024128124117851257, 0.020667510107159615, 0.025393858551979065, 0.08830007165670395, -0.035258229821920395, 0.02679215371608734, 0.019638290628790855, 0.012434735894203186, -0.061393529176712036, -0.010402374900877476, -0.004463886842131615, 0.008613628335297108, -0.0316305086016655, 0.00912097655236721, 0.020106418058276176, -0.04596637189388275, 0.02285427786409855, -0.06144065409898758, 0.015028460882604122, 0.0037567922845482826, -0.05228191241621971, -0.0024110511876642704, 0.029626471921801567, 0.03574548289179802, -0.0012801048578694463, -0.004525387659668922, 0.016917454078793526, -0.018117671832442284, -0.004284429829567671, 0.01379349734634161, -0.03234495595097542, -0.03505917266011238, 0.04722590744495392, 0.017954273149371147, -0.031848713755607605, -0.0176644716411829, 0.00830895360559225, -0.0023856882471591234, -0.017292454838752747, 0.0007342375465668738, 0.05036836490035057, -0.01711292192339897, -0.007030338514596224, 0.016730016097426414, 0.004620739258825779, -0.0011019038502126932, 0.02628595381975174, 0.06628434360027313, 0.04012325033545494, -0.00967216957360506, 0.008445776998996735, 0.051480796188116074, 0.007362158969044685, 0.010953225195407867, -0.056780774146318436, 0.009031268768012524, 0.03652708977460861, 0.024683302268385887, 0.050575997680425644, 0.02091250941157341, 0.019567063078284264, 0.01623682864010334, -0.0469532273709774, 0.04645846039056778, -0.05536885932087898, -0.008981244638562202, -0.0019522764487192035, -0.01542492862790823, -0.02317994460463524, 0.019264845177531242, -0.01973353512585163, -0.01776573248207569, 0.036088068038225174, 0.019967706874012947, 0.04591122642159462, 0.04092124104499817, -0.04566578567028046, 0.005438596475869417, 0.016596553847193718, -0.01714349165558815, -0.006447129882872105, 0.005900091025978327, -0.0027685535605996847, -0.015565699897706509, -0.04870720952749252, -0.05659559741616249, 0.002887843642383814, 0.006860828027129173, 0.03404151275753975, -0.013133881613612175, -0.013250676915049553, -0.05860954150557518, 0.009317358955740929, 0.01852608658373356, 0.014189479872584343, 0.004205767530947924, 0.010168259963393211, -0.035510074347257614, 0.056816067546606064, 0.06345032900571823, 0.011257202364504337, 0.022003602236509323, -0.027248406782746315, 0.010174575261771679, 0.06049312278628349, -0.01750515028834343, 0.003486266825348139, -0.01704460196197033, -0.03811806067824364, -0.007563102059066296, -0.011896070092916489, -0.042872533202171326, 0.005421159323304892, -0.03824104741215706, -0.03026311844587326, 0.08901768177747726, 0.02016039937734604, -0.016863923519849777, -0.006393857300281525, 0.044862985610961914, -0.02505897916853428, 0.022993391379714012, -0.017677992582321167, 0.025846177712082863, -0.011842875741422176, 0.014221427030861378, 0.013972294516861439, 0.006843412294983864, -0.01978066749870777, 0.023217100650072098, 0.00594174861907959, -0.022399885579943657, 0.05292387306690216, 0.010440252721309662, 0.05213407427072525, 0.02840370126068592, -0.03630991280078888, 0.005672188941389322, 0.019696006551384926, -0.02707994356751442, 0.02652285248041153, 0.025643816217780113, 0.019578861072659492, 0.021290624514222145, -0.037135422229766846, 0.02416813373565674, 0.0357217863202095, 0.02361300215125084, 0.036461979150772095, 0.04656831547617912, 0.041120272129774094, 0.028200240805745125, -0.02487241104245186, -0.024410078302025795, -0.053872279822826385, -0.0007415706058964133, 0.001741595915518701, 0.05331876873970032, 0.012130268849432468, 0.0006347017479129136, 0.008893605321645737, 0.007436312269419432, -0.005753374192863703, -0.022044314071536064, -0.003833661088719964, -0.0200908575206995, -0.007924973964691162, 0.00917393434792757, -0.04705832526087761, 0.022739043459296227, 0.037383999675512314, 0.017989475280046463, 0.025040294975042343, 0.005155930295586586, -0.0027068713679909706, 0.040119849145412445, -0.013501068577170372, 0.009528173133730888, -0.010923649184405804, 0.0007749972282908857, 0.02478174678981304, 0.019178669899702072, 0.004710288718342781, 0.0029586907476186752, -0.023168588057160378, 0.02532248944044113, 0.006270154379308224, 0.020592883229255676, 0.016058985143899918, 0.019857751205563545, -0.04352453723549843, 0.028976179659366608, -0.003271375084295869, -0.008286193013191223, 0.00301540270447731, 0.03262251988053322, -0.007817661389708519, 0.000295555277261883, 0.005136844236403704, 0.016232511028647423, -0.008699479512870312, 0.012137334793806076, 0.01846904121339321, -0.03428156301379204, -0.009421172551810741, 0.020249849185347557, 0.02518651634454727, -0.017903311178088188, -0.05121847242116928, 0.016160838305950165, -0.007924765348434448, 0.021949036046862602, 0.04529493302106857, -0.032206129282712936, 0.02927643246948719, -0.017962399870157242, 0.008269168436527252, -0.023425985127687454, -0.019696248695254326, -0.017032232135534286, 0.04270143806934357, -0.0229955967515707, 0.026054777204990387, -0.07799404859542847, -0.05994768440723419, 0.020597970113158226, 0.002462055068463087, 0.032882072031497955, -0.03923781216144562, 0.05479011312127113, 0.008629621006548405, -0.013614739291369915, -0.03535101190209389, -0.03316030278801918, 0.0149601511657238, -0.0253012515604496, -0.012395943515002728, 0.012776202522218227, 0.01761888712644577, -0.025719599798321724, 0.0019463500939309597, 0.04155401140451431, 0.0310691986232996, -0.02600756101310253, 0.03451099991798401, 0.04180164635181427, 0.00016612377658020705, -0.03852757439017296, 0.0026092692278325558, 0.030606303364038467, 0.03628727048635483, 0.015146532095968723, 0.018893364816904068, 0.03363371640443802, -0.05650585889816284, -0.02269335463643074, 0.014178846031427383, 0.010905547067523003, 0.012420176528394222, -0.006486278492957354, -0.031127367168664932, -0.03134239464998245, -0.04082511365413666, -0.012134123593568802, -0.01597459428012371, -0.014152397401630878, -0.015680214390158653, -0.013282308354973793, -0.003340848721563816, -0.0514962300658226, 0.00871989130973816, 0.0018128938972949982, -0.008737441152334213, -0.03623047471046448, -0.010523278266191483, -0.0008109578629955649, -0.032186493277549744, -0.01705067604780197, -0.010119055397808552, 0.03540284186601639, -0.003013675333932042, -0.019403396174311638, -0.035113558173179626, 0.024718360975384712, -0.040776751935482025, -0.03141854330897331, -0.0013413525884971023, 0.017849387601017952, -0.007567742373794317, -0.007821004837751389, 0.022401057183742523, 0.04339596629142761, -0.03310413658618927, 0.05196591466665268, 0.011551949195563793, -0.05837951600551605, 0.0074061122722923756, -0.008539047092199326, -0.018232543021440506, 0.001973335165530443, 0.034621719270944595, 0.02221772074699402, 0.00968556385487318, -0.03338630869984627, 0.009424567222595215, -0.05678437650203705, 0.00011401412484701723, 0.04237551987171173, -0.035476040095090866, -0.043663859367370605, -0.04819558560848236, -0.048649415373802185, 0.008567997254431248, -0.04441453143954277, -0.0022245219442993402, 0.024974361062049866, -0.04657970368862152, 0.008299184963107109, -0.01866871677339077, -0.007883872836828232, -0.013933426700532436, 0.021643495187163353, 0.04348975419998169, -0.03913235664367676, 0.03795996680855751, 0.007740254048258066, -0.025844547897577286, -0.01981591247022152, -0.011644918471574783 ]
Gradio-Lite: Serverless Gradio Running Entirely in Your Browser
abidlabs
October 19, 2023
gradio-lite
gradio, open-source, serverless
https://huggingface.co/blog/gradio-lite
1. Import JS and CSS Start by creating a new HTML file, if you don't have one already. Importing the JavaScript and CSS corresponding to the @gradio/lite package by using the following code: html <html> <head> <script type="module" crossorigin src="https://cdn.jsdelivr.net/npm/@gradio/lite/dist/lite.js"></script> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@gradio/lite/dist/lite.css" /> </head> </html> Note that you should generally use the latest version of @gradio/lite that is available. You can see the versions available here.
[ 0.04508984088897705, 0.05873896926641464, 0.043762512505054474, 0.028311992064118385, 0.09284229576587677, 0.010871270671486855, 0.0484495609998703, 0.033579450100660324, 0.032891009002923965, -0.021775495260953903, -0.06331063061952591, 0.0590207539498806, -0.010084596462547779, 0.06067679449915886, 0.050036437809467316, 0.06933115422725677, 0.029305361211299896, -0.08440197259187698, -0.017835740000009537, 0.012619085609912872, -0.02510007657110691, -0.04526813328266144, -0.04824592545628548, 0.040482763200998306, 0.03232134133577347, -0.03248563036322594, -0.028094260022044182, 0.06389680504798889, -0.044453639537096024, 0.01656731590628624, -0.0006907163187861443, -0.05578901246190071, -0.02845248207449913, -0.09635945409536362, -0.0034900838509202003, 0.07017933577299118, 0.009579717181622982, 0.10489094257354736, 0.04579142853617668, -0.05108502879738808, -0.0025363292079418898, -0.028395583853125572, -0.09239432960748672, 0.028935564681887627, -0.021755646914243698, -0.01552279107272625, -0.1855059415102005, 0.06368373334407806, -0.016703831031918526, 0.023706084117293358, -0.021868858486413956, 0.018932970240712166, -0.03514593094587326, -0.03699363023042679, -0.06349126994609833, -0.008216874673962593, -0.0010353433899581432, 0.01622818037867546, -0.003703720634803176, -0.03476634621620178, 0.04112192615866661, 0.06456857919692993, -0.0819358304142952, 0.05519389361143112, 0.051221076399087906, 0.03976735472679138, -0.06273535639047623, 0.013551858253777027, -0.03178025037050247, -0.007909391075372696, 0.07378094643354416, 0.016666246578097343, -0.008971398696303368, -0.09420964866876602, 0.028401080518960953, 0.01686519756913185, -0.064706951379776, 0.06677614897489548, -0.009763380512595177, 0.0587959922850132, 0.04237773269414902, 0.027949422597885132, 0.055632226169109344, 0.016166934743523598, 0.03478198125958443, 0.011945720762014389, 0.030408894643187523, 0.02877032943069935, -0.014527003280818462, 0.06388077884912491, -0.03295020014047623, -0.05991354584693909, -0.03645378351211548, 0.0798874944448471, 0.11330308765172958, 0.005262158811092377, -0.00790505949407816, 0.033637020736932755, 0.07198268920183182, 0.006404313258826733, 0.02665463276207447, 0.03400832414627075, -0.03302392363548279, -0.08311282843351364, -0.03120381571352482, -0.006463509518653154, -0.06156063452363014, 0.010673338547348976, 0.044761478900909424, 0.02815755270421505, -0.05073109641671181, 0.0001521477970527485, -0.014495683833956718, 0.030904026702046394, -0.024267714470624924, 0.08417541533708572, 0.01978125609457493, 0.0020015137270092964, -0.06158139929175377, 0.05173032730817795, -0.01276626717299223, 0.025934012606739998, 0.036392614245414734, 0.041581202298402786, 0.06544579565525055, 0.08587028831243515, 0.03643399477005005, 0.017877936363220215, 0.0015612503048032522, -0.06363627314567566, 0.07078033685684204, 0.036919645965099335, 0.025256667286157608, 0.02641267329454422, -0.007647396996617317, -0.04616699367761612, 0.038920965045690536, -0.019931020215153694, 0.06349193304777145, -0.0070926775224506855, -0.0010609100572764874, 0.06745967268943787, -0.0373382568359375, 0.057769156992435455, 0.040892262011766434, -0.0830148234963417, -0.006569684948772192, -0.021725846454501152, -0.02450573444366455, 0.08253142982721329, 0.0036314537283033133, 0.05505349487066269, -0.022070283070206642, 0.005589825101196766, -0.07249253243207932, 0.034103382378816605, 0.05541570857167244, 0.025621384382247925, -0.04542571306228638, -0.011414888314902782, 0.020140722393989563, 0.0003422894806135446, -0.042294200509786606, -0.029325325042009354, 0.04510347545146942, 0.02837175317108631, -0.0671500712633133, 0.041206058114767075, 0.12176529318094254, -0.045323729515075684, -0.06938400119543076, -0.025481803342700005, 0.018007075414061546, -0.030889520421624184, 0.009430628269910812, 0.09570001810789108, 0.05743325501680374, 0.020116455852985382, -0.03448638692498207, 0.005741484463214874, -0.00551336444914341, 0.01667805388569832, 0.009973159059882164, -0.05268000811338425, -0.027274498715996742, -0.029296452179551125, -0.005715538747608662, -0.0830894336104393, 0.0026518891099840403, -0.014773671515285969, -0.03996242210268974, -0.022487783804535866, 0.03596491739153862, -0.04081712290644646, -0.0015225415118038654, -0.004562781658023596, 0.01294955424964428, 0.0719161331653595, 0.04532211273908615, 0.06689969450235367, 0.00953697320073843, 0.007953413762152195, 0.09911829233169556, -0.001864770776592195, 0.007822280749678612, 0.0177821796387434, 0.041449159383773804, -0.0013098879717290401, 0.03056415542960167, -0.008791482076048851, -0.0005782121443189681, -0.0945855975151062, 0.10133574903011322, -0.027721907943487167, 0.004212719388306141, 0.05171993002295494, 0.04602029547095299, 0.0372421070933342, 0.005202564410865307, 0.0504499226808548, 0.1257891058921814, -0.019807934761047363, -0.03207750245928764, 0.0012238307390362024, -0.022941244766116142, 0.049820587038993835, 0.10011830925941467, -0.05702785402536392, 0.06611666828393936, -0.06744459271430969, -0.00955595076084137, -0.01897796057164669, -0.03730011358857155, 0.05492090806365013, -0.02146930806338787, -0.02518513612449169, 0.0028457054868340492, -0.03820886090397835, 0.022082872688770294, -0.02056383714079857, 0.06905673444271088, -0.05184510722756386, -0.05304007977247238, 0.0024163031484931707, -0.014926753006875515, 0.0020637689158320427, 0.03342311829328537, 0.039606813341379166, 0.03554929792881012, -0.03285674378275871, 0.03855454921722412, -0.061741411685943604, 0.0638357475399971, 0.06044420599937439, 0.026009904220700264, 0.0014619408175349236, -0.017149826511740685, 0.007315182592719793, -0.010586042888462543, 0.06762324273586273, -0.01870180480182171, -0.02932262420654297, -0.022478334605693817, -0.010648665018379688, -0.007541776169091463, 0.003564283950254321, -0.007258046418428421, 0.016405241563916206, -0.001062633702531457, -0.0019859352614730597, 0.008066562935709953, -0.039741966873407364, -0.015371418558061123, -0.025769894942641258, -0.01746494136750698, 0.028628969565033913, -0.019801964983344078, -0.03714023530483246, -0.029425354674458504, -0.02152436040341854, -0.017967140302062035, -0.0019852237310260534, 0.033689308911561966, -0.015139239840209484, 0.00848511140793562, 0.007194999139755964, -0.02019316516816616, -0.05284910649061203, -0.004583009518682957, 0.026125887408852577, 0.005978857632726431, 0.0031538684852421284, -0.009326612576842308, 0.005786463618278503, 0.004557305946946144, -0.06991197168827057, 0.039813634008169174, 0.026781102642416954, -0.03807470202445984, 0.03320542350411415, -0.006266613490879536, -0.0188309233635664, 0.007512176875025034, -0.0430014468729496, -0.04672064632177353, 0.0217928234487772, 0.041311755776405334, -0.009293309412896633, -0.10434266924858093, -0.016818339005112648, 0.025880560278892517, 0.04262891784310341, -0.016325755044817924, 0.000864897039718926, 0.01452471874654293, -0.051288627088069916, -0.015704413875937462, -0.0033572844695299864, -0.03518655523657799, 0.004241088405251503, 0.03478868678212166, 0.018415674567222595, 0.021005265414714813, -0.022850293666124344, -0.013761507347226143, 0.048155222088098526, 0.03423352167010307, -0.019541779533028603, -0.04268669709563255, 0.037840332835912704, -0.03665769472718239, -0.023764701560139656, 0.0044857715256512165, 0.01274050958454609, 0.04549755901098251, 0.029161185026168823, 0.03866875171661377, -0.015648426488041878, 0.022936217486858368, 0.016007430851459503, -0.026716986671090126, -0.00014037874643690884, -0.05663442611694336, -0.007130110636353493, 0.005818796344101429, -0.007767417002469301, -0.004466760903596878, -0.051557689905166626, 0.002270505530759692, 0.03842330351471901, 0.0048502348363399506, 0.023055991157889366, 0.022798916324973106, -0.033876847475767136, -0.021257009357213974, 0.021696297451853752, 0.036758337169885635, -0.009034636430442333, -0.019447969272732735, 0.024453671649098396, 0.030209187418222427, 0.021708957850933075, -0.02904815971851349, -0.029150141403079033, 0.02819107659161091, 0.026777032762765884, 0.022057494148612022, -0.004627684131264687, -0.012436174787580967, 0.0005346222314983606, -0.0049113002605736256, -0.023689119145274162, -0.03729471564292908, 0.037365373224020004, 0.018317164853215218, 0.011387445963919163, -0.007630850188434124, 0.005831035785377026, -0.03938521072268486, -0.021203570067882538, -0.006827878300100565, 0.018883751705288887, -0.015938403084874153, -0.04161952808499336, -0.06851841509342194, 0.0015518231084570289, 0.06709389388561249, 0.01588025875389576, 0.021283358335494995, 0.009389203041791916, -0.005552181974053383, -0.05492483824491501, -0.02202218770980835, 0.004002723377197981, 0.012737120501697063, -0.02485623210668564, -0.005708407610654831, 0.020272094756364822, 0.030058208853006363, -0.035131216049194336, 0.0031748609617352486, -0.011617674492299557, -0.04173855856060982, -0.027761384844779968, 0.06430936604738235, -0.02552628330886364, 0.03195406496524811, 0.003350367769598961, -0.027483103796839714, -0.04161520302295685, 0.03549864515662193, -0.01643109880387783, 0.021201152354478836, 0.006295389961451292, -0.0035673025995492935, 0.01440358441323042, 0.030263826251029968, 0.003599569434300065, 0.025344224646687508, 0.025661639869213104, -0.013015776872634888, -0.0062404233030974865, -0.030803827568888664, 0.026155976578593254, -0.018094057217240334, -0.036653146147727966, -0.032287463545799255, 0.051056064665317535, -0.030771853402256966, -0.06263456493616104, 0.02198488637804985, -0.0033432594500482082, -0.021393582224845886, -0.018820788711309433, 0.02520591765642166, -0.021353036165237427, 0.017191793769598007, -0.0039009361062198877, -0.03116360865533352, -0.05571237578988075, 0.022450650110840797, -0.005427594296634197, 0.04398137331008911, -0.007124158088117838, 0.0570896714925766, 0.012767366133630276, 0.04598057270050049, -0.05920083448290825, 0.012701228260993958, -0.009326141327619553, 0.027510056272149086, -0.05657309293746948, 0.026165172457695007, 0.006447328254580498, -0.04753893241286278, 0.018838241696357727, -0.04324040189385414, -0.0030138499569147825, 0.013163577765226364, -0.0235977191478014, 0.012914614751935005, -0.0014707392547279596, -0.0035954827908426523, -0.00508888391777873, 0.02926008217036724, 0.004440366756170988, -0.00445135310292244, -0.004752236418426037, 0.002669470850378275, -0.028829079121351242, -0.05288807675242424, 0.01694597490131855, 0.008708975277841091, -0.00865777488797903, 0.003428625874221325, -0.03752162307500839, -0.035255398601293564, 0.018920082598924637, -0.010967937298119068, 0.04546959698200226, -0.02390858344733715, -0.03460956737399101, -0.013862470164895058, 0.0195716992020607, 0.02039339579641819, -0.010182620026171207, 0.009280377067625523, 0.012242953293025494, 0.03468266502022743, -0.009658505208790302, 0.011517294682562351, -0.008868653327226639, -0.046672433614730835, -0.032959360629320145, -0.018886588513851166, 0.004077662713825703, 0.010992331430315971, -0.0065362704917788506, -0.0038215545937418938, -0.04285934567451477, 0.042696382850408554, -0.047158896923065186, 0.041521623730659485, -0.07417310774326324, -0.020998941734433174, 0.009175560437142849, 0.014463579282164574, -0.027468929067254066, 0.005153416655957699, 0.03248254954814911, -0.045161232352256775, 0.0008116282988339663, 0.007509515155106783, 0.012355388142168522, 0.02017066814005375, -0.0616295151412487, 0.03608979284763336, 0.021389469504356384, 0.009487226605415344, -0.03490349277853966, 0.029023263603448868, -0.024588298052549362, -0.0336395800113678, -0.035719867795705795, -0.05494292825460434, -0.04834538325667381, 0.01144829485565424, 0.05483586713671684, 0.004062748048454523, 0.005451836623251438, -0.05219004303216934, 0.02431546524167061, -0.0034519413020461798, -0.007957256399095058, 0.005793340038508177, 0.0207092072814703, -0.029871562495827675, -0.005844918079674244, 0.07185197621583939, -0.0036699259653687477, 0.04070805385708809, -0.012860012240707874, 0.03195786103606224, 0.07307928800582886, -0.035936594009399414, -0.009096098132431507, 0.054593347012996674, -0.022218428552150726, -0.02392517402768135, -0.007481109816581011, -0.029440978541970253, -0.022983063012361526, -0.022999709472060204, -0.0317094549536705, 0.07142078876495361, 0.01783490553498268, -0.01741468347609043, 0.011050661094486713, 0.057217858731746674, -0.010435032658278942, 0.029231373220682144, -0.011494836769998074, -0.005748468916863203, 0.02460148185491562, -0.010502008721232414, 0.02140466310083866, -0.012918432243168354, -0.010212159715592861, 0.023365996778011322, -0.013134516775608063, -0.027158906683325768, -0.01914028637111187, 0.02581973932683468, -0.023052703589200974, -0.011366722173988819, -0.01101417001336813, -0.03833021968603134, 0.043152935802936554, -0.004472809378057718, 0.05852809548377991, 0.026573345065116882, 0.013837193138897419, 0.018741007894277573, -0.0045127784833312035, -0.0056478893384337425, 0.011136169545352459, -0.020430389791727066, 0.02750215493142605, 0.015107255429029465, -0.014258581213653088, 0.014125236310064793, 0.002729566767811775, -0.003118481021374464, -0.0032231935765594244, 0.057927921414375305, 0.005177428014576435, 0.03233892470598221, 0.017553897574543953, -0.022021792829036713, -0.014012775383889675, -0.007044789846986532, 0.008556555956602097, -0.026226546615362167, 0.05835956335067749, 0.01747799851000309, -0.008821322582662106, -0.03948383405804634, -0.03452087193727493, 0.04830746352672577, -0.011497681960463524, 0.06665525585412979, -0.02825476974248886, -0.007763097062706947, 0.03114277869462967, 0.026052601635456085, -0.00713337492197752, 0.05721860006451607, -0.014469482935965061, -0.044916413724422455, 0.05411732196807861, 0.03685930743813515, 0.009686978533864021, 0.01789587177336216, 0.02232840098440647, 0.024160197004675865, 0.023488633334636688, -0.022317061200737953, 0.02628295309841633, 0.038407325744628906, -0.06890958547592163, -0.019538171589374542, -0.030246615409851074, -0.05377054587006569, 0.0065675899386405945, 0.00824070442467928, 0.012305274605751038, -0.015063028782606125, -0.029228122904896736, -0.0013273985823616385, 0.005910860374569893, -0.021399732679128647, 0.014546960592269897, -0.017583029344677925, 0.02162535861134529, 0.044665589928627014, -0.003945896867662668, -0.002575282473117113, -0.014585360884666443, 0.001440941821783781, -0.004313592333346605, 0.0044058021157979965, -0.00020124763250350952, -0.01941108889877796, -0.014679702930152416, -0.010211274959146976, 0.0012851085048168898, -0.02911246381700039, 0.011002833023667336, -0.011529837734997272, 0.015135138295590878, -0.03801213577389717, 0.04130979999899864, -0.041938282549381256, -0.05086575448513031, -0.028151407837867737, 0.007723275572061539, 0.022630194202065468, -0.020824456587433815, 0.009209641255438328, -0.021800244227051735, -0.014389874413609505, -0.005169541575014591, -0.046483710408210754, 0.027591345831751823, -0.03023175708949566, -0.0003297138027846813, 0.0432199090719223, -0.014778642915189266, 0.0008640392916277051, 0.0005015319911763072, 0.005220517981797457, 0.05006139725446701, 0.015571480616927147, 0.005574345123022795, -0.0008641832391731441, 0.004973744507879019, -0.04757566750049591, 0.01943603716790676, 0.030692704021930695, 0.00996620673686266, 0.004943710286170244, 0.0248905960470438, 0.020603220909833908, -0.040722090750932693, 0.0022040437906980515, 0.010806074365973473, 0.02439076453447342, 0.026281647384166718, -0.020744239911437035, -0.025594931095838547, -0.008439835160970688, -0.029637042433023453, -0.0006873030215501785, -0.0036607461515814066, -0.03302768990397453, -0.020197151228785515, -0.03257142752408981, -0.04831337556242943, -0.009858889505267143, 0.02493683621287346, -0.0007402434712275863, -0.011673328466713428, 0.009159019216895103, -0.02596730925142765, 0.011782693676650524, 0.024170758202672005, 0.0036744498647749424, 0.015092619694769382, 0.009139751084148884, 0.01994623988866806, -0.019671311601996422, -0.028963502496480942, 0.04723125323653221, -0.010783263482153416, -0.026554659008979797, -0.002386248903349042, 0.018303213641047478, 0.008452153764665127, -0.06605794280767441, 0.021989252418279648, 0.05067510902881622, 0.018027933314442635, 0.008373084478080273, -0.03492935746908188, -0.07699909061193466, 0.02570486254990101, 0.03419860824942589, -0.03204850107431412, 0.008397270925343037, 0.0180492103099823, 0.01737932302057743, 0.030885029584169388, -0.025700697675347328, -0.01482869777828455, -0.023783203214406967, -0.059497274458408356, -0.016179997473955154, 0.039770908653736115, -0.016981972381472588, -0.0211703609675169, -0.048684097826480865, 0.05343979224562645, -0.07324424386024475, -0.011193805374205112, -0.013159457594156265, -0.033227961510419846, -0.03379442170262337, -0.011384973302483559, 0.009729718789458275, -0.030111130326986313, 0.010052921250462532, 0.06098479405045509, -0.0408271923661232, -0.003873432520776987, -0.03046821430325508, -0.07253497838973999, -0.0347161702811718, 0.0033378838561475277 ]
Gradio-Lite: Serverless Gradio Running Entirely in Your Browser
abidlabs
October 19, 2023
gradio-lite
gradio, open-source, serverless
https://huggingface.co/blog/gradio-lite
Additional Requirements If your Gradio app has additional requirements, it is usually possible to install them in the browser using micropip. We've created a wrapper to make this paticularly convenient: simply list your requirements in the same syntax as a requirements.txt and enclose them with <gradio-requirements> tags. Here, we install transformers_js_py to run a text classification model directly in the browser! html <gradio-lite> <gradio-requirements> transformers_js_py </gradio-requirements> <gradio-file name="app.py" entrypoint> from transformers_js import import_transformers_js import gradio as gr transformers = await import_transformers_js() pipeline = transformers.pipeline pipe = await pipeline('sentiment-analysis') async def classify(text): return await pipe(text) demo = gr.Interface(classify, "textbox", "json") demo.launch() </gradio-file> </gradio-lite> Try it out: You can see this example running in this Hugging Face Static Space, which lets you host static (serverless) web applications for free. Visit the page and you'll be able to run a machine learning model without internet access!
[ -0.01940138265490532, 0.009764245711266994, 0.03506312891840935, 0.06513356417417526, 0.07620131224393845, 0.09144336730241776, 0.10569240152835846, 0.09556902945041656, 0.02515687420964241, -0.05805095657706261, -0.08915437757968903, 0.03243023529648781, -0.04350000247359276, 0.07148090749979019, 0.05369619280099869, 0.005669281352311373, 0.08314552158117294, -0.05335989594459534, -0.06610248237848282, -0.023886723443865776, -0.030303753912448883, -0.07042022049427032, -0.0005297331954352558, 0.07683101296424866, -0.04533767327666283, -0.07838211208581924, 0.03195448964834213, 0.024576887488365173, -0.03949503228068352, 0.031577084213495255, -0.046517275273799896, -0.005721528083086014, -0.0002686108637135476, -0.08136822283267975, 0.014494785107672215, 0.08135306090116501, -0.06534567475318909, 0.07017900049686432, -0.009372103959321976, 0.0021889086347073317, 0.011881751008331776, -0.003543600207194686, -0.10413618385791779, 0.07641472667455673, -0.013584861531853676, 0.02260589599609375, -0.13663944602012634, 0.025078685954213142, -0.03483681380748749, 0.03648518770933151, -0.03997470438480377, 0.10066869109869003, -0.045482538640499115, -0.0023886128328740597, -0.02255280874669552, 0.006400189362466335, 0.02399599924683571, -0.0667344257235527, -0.0011567416368052363, 0.015049789100885391, -0.0291487704962492, 0.028124038130044937, -0.07219087332487106, 0.040502626448869705, -0.04168824106454849, -0.03660120069980621, -0.07000241428613663, 0.0003294429916422814, -0.02434045821428299, -0.03626078739762306, -0.012477340176701546, 0.02700584940612316, -0.027152763679623604, -0.0780014917254448, -0.015224408358335495, 0.008944080211222172, -0.047347769141197205, 0.059754639863967896, 0.021131398156285286, 0.0926600843667984, 0.04857858270406723, -0.01002033706754446, 0.02988637611269951, 0.018104035407304764, 0.04627265781164169, -0.02527966909110546, 0.028145596385002136, -0.010713890194892883, -0.026901014149188995, 0.05347404256463051, 0.008977155201137066, -0.09707696735858917, -0.021727008745074272, 0.0076378947123885155, 0.08962219208478928, 0.07000535726547241, -0.05393384397029877, 0.029283398762345314, -0.03054032102227211, -0.00918103288859129, -0.007307103369385004, -0.03716446831822395, -0.051387716084718704, -0.062003616243600845, -0.046408236026763916, 0.03968234732747078, -0.0329303964972496, -0.001866958918981254, -0.02091287449002266, 0.03173030540347099, -0.025343354791402817, -0.006724983919411898, -0.015926895663142204, 0.0488152839243412, -0.08971130847930908, 0.0537855438888073, 0.037167612463235855, 0.03367013856768608, 0.013026592321693897, -0.007029695436358452, 0.03699639067053795, 0.04666346684098244, 0.025753311812877655, 0.053701743483543396, 0.015371260233223438, 0.09340295195579529, 0.011058293282985687, 0.003082351991906762, 0.027569498866796494, -0.035204704850912094, 0.07707265019416809, 0.04921241104602814, 0.028532324358820915, 0.006174471694976091, 0.006163960322737694, 0.003354746848344803, -0.02290460839867592, -0.07336711883544922, 0.02882480062544346, -0.038153454661369324, 0.05576290562748909, 0.09713510423898697, -0.055949751287698746, -0.0017422970850020647, 0.042372871190309525, -0.059913840144872665, -0.010126610286533833, -0.0005835510673932731, -0.051817432045936584, -0.026834847405552864, -0.0739942193031311, 0.09057522565126419, -0.0068929907865822315, 0.022042134776711464, -0.05995471030473709, 0.02429680898785591, -0.00455440441146493, 0.028536630794405937, 0.016829906031489372, 0.004584458656609058, -0.019951965659856796, 0.01828967221081257, -0.08248360455036163, -0.02719707600772381, 0.11077176779508591, 0.03599053993821144, -0.008519530296325684, 0.015742754563689232, 0.09805577993392944, -0.00258166017010808, 0.016068365424871445, -0.02854529395699501, 0.04770706966519356, -0.012181026861071587, -0.019349638372659683, 0.02736368402838707, -0.013206914998590946, -0.01905958168208599, -0.009439666755497456, -0.04214925318956375, 0.0012289428850635886, 0.025524619966745377, 0.027478540316224098, 0.018827777355909348, -0.008894537575542927, -0.02509642206132412, 0.03904514014720917, -0.060061611235141754, -0.021813375875353813, -0.04325677081942558, -0.015406636521220207, 0.01564219407737255, 0.023070646449923515, -0.023348715156316757, 0.03726011514663696, 0.033835895359516144, 0.011729661375284195, 0.05450131371617317, 0.03967607393860817, 0.04923437163233757, 0.06222428008913994, -0.001155201462097466, 0.06378528475761414, 0.012118557468056679, -0.022710906341671944, 0.032720599323511124, -0.04622308537364006, -0.051823690533638, -0.005334213376045227, -0.017791086807847023, -0.04490162804722786, -0.09856406599283218, 0.07276366651058197, -0.0442156121134758, 0.0031957814935594797, 0.045231640338897705, -0.01626099832355976, 0.052556052803993225, -0.011219896376132965, 0.019918015226721764, 0.13127818703651428, -0.05066968500614166, -0.006920666433870792, -0.010503925383090973, 0.016920244321227074, -0.006392754148691893, 0.07767075300216675, -0.0037685383576899767, 0.08104939758777618, -0.08973928540945053, -0.0013352710520848632, -0.018595291301608086, -0.05164654552936554, 0.03561010584235191, -0.07240074127912521, -0.022879693657159805, -0.0019185426644980907, -0.025952566415071487, 0.0562770813703537, -0.0178329236805439, -0.000309279392240569, 0.013255059719085693, -0.032979000359773636, -0.0027427414897829294, 0.024601323530077934, -0.06696995347738266, 0.056827351450920105, 0.03310775011777878, -0.011799594387412071, -0.027343085035681725, -0.015249760821461678, 0.01696876809000969, -0.016315128654241562, 0.020854322239756584, -0.009095652028918266, 0.04225440323352814, 0.021116862073540688, -0.008782065473496914, -0.021082637831568718, 0.05398432910442352, 0.00910862721502781, 0.019781053066253662, 0.053236037492752075, -0.05607194826006889, -0.01906013675034046, -0.01555230189114809, -0.01975034736096859, -0.0029925971757620573, 0.025963516905903816, 0.03183014318346977, 0.002502435352653265, -0.0223622415214777, -0.0327606126666069, -0.014114615507423878, 0.01878868043422699, 0.058466751128435135, -0.04545396566390991, 0.011555886827409267, -0.02126702293753624, -0.009988231584429741, -0.017248651012778282, -0.05431047081947327, 0.02864738740026951, 0.003939705900847912, 0.01624624989926815, 0.005690612830221653, 0.0015148642705753446, -0.07466546446084976, -0.0009699977235868573, -0.005193775519728661, 0.0001787806540960446, 0.036774687469005585, -0.004514723550528288, -0.013224244117736816, 0.008330038748681545, -0.01737341843545437, 0.05314501374959946, 0.02217603661119938, -0.01831193082034588, 0.019907817244529724, -0.009525297209620476, 0.008771673776209354, -0.002295843558385968, -0.03121701441705227, -0.02671165019273758, -0.008860648609697819, 0.03769920766353607, -0.03311785310506821, -0.0797528624534607, -0.030885763466358185, -0.014377986080944538, 0.020330848172307014, -0.013914089649915695, -0.020163405686616898, 0.04798460006713867, 0.004935172386467457, -0.009408257901668549, 0.02560523711144924, -0.03456154465675354, -0.017863072454929352, 0.02604895643889904, 0.0033789961598813534, 0.0020716344006359577, -0.03736782819032669, 0.00653114914894104, 0.03242989256978035, 0.0504828505218029, -0.019069520756602287, -0.009216192178428173, 0.04217240959405899, 0.005247423890978098, -0.03565894439816475, 0.02024710923433304, 0.020053282380104065, 0.037571828812360764, 0.020052634179592133, 0.037765976041555405, -0.036030177026987076, 0.011401550844311714, -0.0636434480547905, -0.03826303407549858, 0.04034113138914108, -0.019159886986017227, -0.015845758840441704, -0.019191790372133255, 0.0095381960272789, 0.0037857210263609886, 0.01490809302777052, -0.03315543383359909, 0.013796281069517136, 0.019667312502861023, -0.024574019014835358, 0.03700952231884003, -0.02092370018362999, -0.003622215474024415, -0.009355864487588406, 0.03523022308945656, 0.009309858083724976, -0.03412184119224548, 0.041344042867422104, 0.009418380446732044, 0.0995268002152443, -0.00024117567227222025, -0.007748991250991821, 0.03759031370282173, 0.0331416092813015, -0.009628440253436565, -0.009458153508603573, -0.04707430303096771, 0.03184229135513306, -0.02555699646472931, -0.0010836130240932107, -0.001727132243104279, 0.016256915405392647, 0.03284576162695885, 0.017862888053059578, -0.00043548556277528405, -0.03711190074682236, -0.0271812304854393, 0.01135815866291523, 0.04590856656432152, 0.01259536948055029, -0.0011077765375375748, -0.02633509412407875, -0.04392172396183014, -0.05737371742725372, 0.07187993079423904, 0.04239550232887268, 0.011577199213206768, -0.014131543226540089, -0.044993940740823746, -0.03454078733921051, 0.006627465598285198, -0.008875210769474506, 0.005009786691516638, -0.06415002048015594, 0.004523846320807934, 0.044802725315093994, -0.000721698219422251, -0.026459984481334686, 0.03378814458847046, -0.05172768235206604, -0.024196838960051537, -0.026489002630114555, 0.06677445024251938, 0.010433747433125973, 0.011578894220292568, -0.0048948307521641254, -0.02856692485511303, -0.0328688807785511, 0.02549009583890438, 0.01832517422735691, -0.013384477235376835, 0.011378920637071133, -0.040891069918870926, -0.009336629882454872, 0.03674209117889404, -0.012165633030235767, 0.041655708104372025, 0.03589789196848869, -0.0047156549990177155, 0.024380287155508995, 0.010179474949836731, 0.020635316148400307, 0.0022524804808199406, -0.0007919011986814439, -0.022371506318449974, 0.03265112638473511, -0.004970797803252935, -0.04252447560429573, 0.005882032681256533, -0.011546219699084759, -0.005749326199293137, -0.01381736621260643, 0.02297343872487545, 0.028674524277448654, 0.005525259301066399, -0.031027203425765038, 0.009632866829633713, -0.05649225786328316, -0.0050428942777216434, 0.00427346071228385, 0.048269275575876236, 0.002007086994126439, 0.028097467496991158, 0.002635454060509801, 0.02912643924355507, -0.017581716179847717, -0.018145063892006874, -0.030502334237098694, 0.031096652150154114, -0.06667362153530121, 0.0019578449428081512, 0.008801193907856941, -0.038234829902648926, 0.02564755454659462, -0.0620311014354229, -0.019211353734135628, -0.012241791933774948, -0.02277494966983795, 0.014555337838828564, 0.035119470208883286, 0.020946327596902847, -0.016238322481513023, -0.01303213182836771, 0.021676264703273773, 0.04493149742484093, 0.01882903277873993, 0.0034064315259456635, -0.009311074391007423, -0.041833970695734024, 0.03087471053004265, 0.01989269070327282, -0.004386053420603275, -0.02655939571559429, -0.05163279548287392, -0.010014614090323448, -0.01740347035229206, -0.012331072241067886, 0.03887772560119629, 0.008068046532571316, 0.00237838551402092, -0.03323175013065338, 0.012034581042826176, 0.015621640719473362, 0.02166392281651497, -0.02276274934411049, 0.05513271689414978, 0.029593192040920258, -0.023579295724630356, 0.035156235098838806, -0.014288246631622314, -0.0017526380252093077, 0.00871467124670744, 0.036295417696237564, 0.02196415141224861, 0.058612123131752014, 0.017470605671405792, -0.009449976496398449, -0.011867641471326351, 0.032979730516672134, -0.019925082102417946, 0.04712742194533348, -0.06275373697280884, 0.023979807272553444, 0.045349445194005966, 0.0025448419619351625, -0.022860612720251083, 0.011334243230521679, -0.005348386242985725, -0.04121747612953186, 0.00243145483545959, 0.03154029697179794, 0.03401302173733711, -0.01777159422636032, -0.043297309428453445, 0.04732202738523483, 0.010609514079988003, -0.01204847451299429, -0.04448944702744484, 0.02030087821185589, -0.02463623136281967, -0.020631423220038414, -0.019837085157632828, -0.023210877552628517, 0.011892280541360378, 0.019858868792653084, 0.06396394968032837, -0.029575584456324577, -0.03633049875497818, 0.00483449874445796, 0.027856314554810524, 0.008932710625231266, 0.002607536967843771, 0.041444312781095505, 0.0002767882542684674, -0.060557764023542404, 0.023035265505313873, 0.020346293225884438, 0.008797631599009037, 0.03265305608510971, 0.01670755259692669, -0.011725541204214096, 0.0064566899091005325, -0.038776695728302, 0.0033774215262383223, 0.03909125179052353, -0.028638849034905434, -0.0005208684015087783, -0.02516787126660347, -0.0443880595266819, -0.017351072281599045, -0.021137507632374763, -0.008331346325576305, 0.051678914576768875, -0.028116483241319656, -0.02236856333911419, -0.022531673312187195, 0.026953140273690224, -0.013016261160373688, 0.008204820565879345, -0.012539243325591087, 0.022151295095682144, 0.013806214556097984, -0.0019452540436759591, 0.02725437469780445, 0.03171312063932419, 0.036237288266420364, 0.016077598556876183, -0.046413205564022064, -0.02588287927210331, 0.044396765530109406, 0.03650372102856636, -0.0034385984763503075, -0.03298206627368927, -0.041670382022857666, -0.03897342085838318, 0.03113926760852337, 0.005468845367431641, 0.03870263695716858, 0.005710390862077475, -0.03757837787270546, -0.007921410724520683, -0.021086551249027252, 0.03500376269221306, 0.043190568685531616, 0.011127197183668613, 0.010718201287090778, 0.010622858069837093, 0.03887415677309036, -0.014659465290606022, -0.016880368813872337, -0.01809736341238022, 0.0059853410348296165, 0.07178587466478348, 0.016956914216279984, 0.005741917062550783, 0.018729325383901596, -0.01474695187062025, 0.029970185831189156, -0.027293438091874123, -0.02537286840379238, -0.037929877638816833, 0.007066634949296713, -0.017151808366179466, 0.005847649183124304, -0.008381004445254803, -0.016772396862506866, 0.08161413669586182, 0.03803495317697525, 0.04311951994895935, 0.04995911195874214, 0.006175887305289507, 0.014830359257757664, 0.03448997437953949, -0.00232129218056798, 0.021690811961889267, -0.033276092261075974, -0.016757803037762642, -0.00819055363535881, 0.018771231174468994, 0.02090676873922348, 0.014689117670059204, -0.016624273732304573, 0.003363756462931633, -0.050512995570898056, -0.0027502900920808315, 0.0023320517502725124, 0.01609831117093563, -0.02982541359961033, 0.044175904244184494, -0.03151574358344078, -0.01973690092563629, 0.053484320640563965, -0.008664633147418499, 0.010105585679411888, 0.008995773270726204, 0.032493267208337784, 0.018616441637277603, -0.02264258824288845, -0.005296404007822275, -0.0004769977822434157, -0.004639765247702599, -0.006374035030603409, -0.006208423059433699, -0.008357131853699684, -0.0398007333278656, -0.02861630916595459, 0.011050418950617313, -0.05516057834029198, 0.02923889271914959, 0.06542705744504929, -0.030377449467778206, -0.007462726440280676, -0.017230739817023277, 0.045548561960458755, -0.023543106392025948, 0.008874382823705673, -0.013115569949150085, 0.016579028218984604, -0.034427765756845474, 0.020838173106312752, -0.05660795047879219, -0.06301369518041611, 0.0035930913873016834, -0.03405303508043289, 0.006855697836726904, -0.03605252504348755, 0.012510337866842747, -0.02070671133697033, 0.02013218402862549, -0.022721337154507637, -0.01879820227622986, 0.04467984661459923, 0.03372805938124657, -0.06004069745540619, 0.030880432575941086, -0.039649926126003265, 0.010418253019452095, -0.020222051069140434, 0.00831615924835205, 0.028814803808927536, 0.04210611805319786, 0.013473821803927422, 0.030670102685689926, 0.010812964290380478, -0.042702093720436096, 0.01684175804257393, -0.012023829855024815, 0.055183105170726776, 0.02370549738407135, 0.030131494626402855, 0.008624041453003883, -0.04726577177643776, -0.004637088160961866, 0.016837818548083305, -0.0022750787902623415, -0.02691146731376648, -0.04501019045710564, -0.0456627756357193, -0.01230042427778244, 0.03466318920254707, -0.0026691406965255737, 0.0030437149107456207, -0.03984225541353226, -0.026184096932411194, -0.029744712635874748, -0.030489711090922356, -0.03488048538565636, -0.017095953226089478, -0.01717478409409523, 0.06120198965072632, 0.02365952357649803, -0.03930538520216942, 0.009118732996284962, 0.007809013593941927, -0.008929302915930748, 0.0004604634887073189, 0.060204941779375076, 0.0060316817834973335, -0.035741567611694336, -0.033099960535764694, 0.002797672525048256, -0.005059049930423498, -0.045010268688201904, -0.005670155864208937, 0.027684515342116356, 0.026670757681131363, -0.05484343320131302, 0.02020951546728611, 0.04860296845436096, -0.0075874594040215015, 0.004181624390184879, -0.01990904100239277, -0.056782301515340805, 0.02177777700126171, 0.035120002925395966, -0.06656041741371155, -0.0025689429603517056, -0.010719571262598038, -0.00008201222954085097, 0.033023737370967865, -0.05084497481584549, -0.005939056631177664, -0.06894434243440628, -0.026542512699961662, 0.041871555149555206, -0.01247510313987732, -0.0576053187251091, -0.013196461834013462, -0.048862140625715256, 0.05679425597190857, -0.01380558218806982, 0.026314787566661835, -0.001817200449295342, 0.01365197915583849, -0.03406432271003723, 0.018411951139569283, 0.008311795070767403, 0.01729515753686428, 0.026313303038477898, 0.03847675025463104, -0.023247264325618744, 0.010968334972858429, 0.00007267848559422418, -0.05724242702126503, -0.05993539094924927, 0.016248801723122597 ]
Gradio-Lite: Serverless Gradio Running Entirely in Your Browser
abidlabs
October 19, 2023
gradio-lite
gradio, open-source, serverless
https://huggingface.co/blog/gradio-lite
# Gradio-Lite: Serverless Gradio Running Entirely in Your Browser Gradio is a popular Python library for creating interactive machine learning apps. Traditionally, Gradio applications have relied on server-side infrastructure to run, which can be a hurdle for developers who need to host their applications. Enter Gradio-lite (@gradio/lite): a library that leverages Pyodide to bring Gradio directly to your browser. In this blog post, we'll explore what @gradio/lite is, go over example code, and discuss the benefits it offers for running Gradio applications.
[ 0.02008095569908619, 0.03054303489625454, 0.07984047383069992, 0.04504569619894028, 0.02793869562447071, 0.07264441251754761, 0.03802384063601494, 0.03375442326068878, -0.030071387067437172, -0.014269023202359676, -0.11609282344579697, -0.009331012144684792, -0.04155744984745979, 0.053400661796331406, 0.020088011398911476, 0.03512665629386902, 0.059367235749959946, -0.08836931735277176, -0.06693311035633087, 0.04555552825331688, -0.016427265480160713, -0.054069437086582184, -0.008499851450324059, 0.005208203569054604, -0.07768423855304718, -0.040072280913591385, -0.003975143190473318, -0.006522666662931442, -0.06998750567436218, 0.0062607754953205585, -0.03796696662902832, -0.013818797655403614, 0.00490098912268877, -0.0749424397945404, 0.0021427671890705824, 0.06825126707553864, -0.05465322360396385, 0.09915520250797272, 0.002754207467660308, -0.024735568091273308, -0.012587395496666431, -0.043218620121479034, -0.0698622390627861, 0.059745028614997864, -0.06493914872407913, 0.0480605810880661, -0.17889058589935303, -0.010778822004795074, -0.02747417986392975, -0.018223294988274574, -0.09284709393978119, 0.08113624155521393, -0.047278307378292084, -0.042399436235427856, -0.051738474518060684, 0.07776504755020142, 0.053017109632492065, -0.04772147163748741, 0.02464117854833603, 0.01570936106145382, 0.006689777597784996, 0.006018825341016054, -0.055802516639232635, 0.05172494798898697, 0.004438119474798441, -0.01531962025910616, -0.029522312805056572, -0.004745333921164274, 0.00008162827725755051, -0.01041204109787941, 0.005442477762699127, 0.03077329881489277, -0.05497662350535393, -0.06351429969072342, 0.0424019917845726, -0.0284330602735281, -0.08305882662534714, 0.07839010655879974, 0.007967199198901653, 0.06589578092098236, 0.029186179861426353, 0.03324401378631592, 0.06675512343645096, 0.004582526627928019, 0.0796772688627243, 0.014061822555959225, -0.015574986115098, -0.00758246099576354, -0.031051766127347946, 0.02534286119043827, -0.009067543782293797, -0.1138743981719017, 0.0014956342056393623, 0.020917613059282303, 0.08465103805065155, 0.021796708926558495, -0.04538851976394653, 0.03479395806789398, 0.0439615361392498, -0.00849845353513956, 0.0039831604808568954, -0.11088410019874573, -0.022037707269191742, -0.08155890554189682, -0.034578610211610794, 0.042399484664201736, -0.034800950437784195, -0.01558220386505127, -0.035875432193279266, 0.05040248483419418, -0.051595233380794525, 0.024123167619109154, -0.05984239652752876, 0.040119659155607224, 0.004798347130417824, 0.049465812742710114, -0.008912008255720139, 0.059428051114082336, -0.03739006072282791, -0.0012744751293212175, -0.008748535998165607, 0.018389111384749413, 0.0603499673306942, 0.048471685498952866, -0.0066809565760195255, 0.059752628207206726, -0.01352421659976244, 0.017755094915628433, 0.06830577552318573, -0.018893564119935036, 0.05356871336698532, 0.0631488710641861, 0.033458009362220764, -0.01693134196102619, -0.0275710579007864, -0.039017871022224426, -0.02377251349389553, -0.04607625678181648, -0.035953741520643234, -0.01944584771990776, -0.00985046662390232, 0.07647759467363358, -0.03956092894077301, 0.02283347211778164, 0.038653984665870667, -0.05621730908751488, 0.05658630654215813, -0.020156254991889, -0.029888832941651344, -0.026721041649580002, -0.07159991562366486, 0.05286862701177597, -0.049679044634103775, 0.013152982108294964, -0.04781004413962364, 0.06322282552719116, -0.02230842597782612, 0.007806738372892141, 0.031064758077263832, 0.007191881537437439, 0.028953896835446358, -0.008503508754074574, -0.07760432362556458, -0.06132180988788605, 0.11204961687326431, 0.050143446773290634, -0.02678625099360943, 0.04013495519757271, 0.09903253614902496, -0.028930164873600006, -0.08056367188692093, -0.02924853190779686, 0.041978444904088974, 0.019638853147625923, 0.03213520720601082, 0.014935117214918137, 0.051656849682331085, -0.026221929118037224, 0.0001247502805199474, -0.005037538707256317, -0.005343170370906591, 0.0029036933556199074, 0.029557203873991966, -0.00985054112970829, -0.041224509477615356, 0.004518995527178049, 0.02013733796775341, -0.06428011506795883, 0.03719624504446983, -0.021759027615189552, -0.04618808254599571, 0.01267529558390379, 0.009820721112191677, -0.03645149990916252, 0.03546944260597229, 0.006469293497502804, -0.003173248143866658, 0.05893714353442192, 0.05398589372634888, 0.04349453002214432, 0.0743008702993393, -0.006732109934091568, 0.05028897151350975, -0.047311194241046906, -0.04928545653820038, 0.03534648194909096, 0.04604485630989075, 0.015113229863345623, 0.02886180765926838, -0.022975601255893707, -0.012760520912706852, -0.04425640404224396, 0.0617794506251812, -0.0139340003952384, -0.02535061351954937, 0.07746993005275726, -0.030939189717173576, 0.010856584645807743, -0.02956918068230152, 0.012023123912513256, 0.1167667955160141, -0.06376536190509796, 0.00333743030205369, 0.001103743095882237, -0.023839034140110016, 0.08501413464546204, 0.11687937378883362, -0.03565523400902748, 0.11597517877817154, -0.07685793936252594, 0.01281046774238348, 0.006292364560067654, 0.010160744190216064, 0.05632895976305008, 0.01656068116426468, -0.01646926999092102, 0.031063701957464218, -0.01892886310815811, 0.06792399287223816, 0.00930510088801384, 0.02685433253645897, 0.013409842737019062, -0.06381383538246155, 0.00322692166082561, 0.0313471257686615, -0.09334667026996613, 0.06656387448310852, -0.022899994626641273, 0.03795197978615761, -0.01158867310732603, 0.015781300142407417, -0.03865133970975876, 0.0027089461218565702, 0.04543093964457512, 0.0173956248909235, -0.0374433659017086, -0.021062904968857765, -0.007283862214535475, -0.005074016284197569, 0.06532522290945053, -0.023334303870797157, 0.00002247673910460435, 0.035175833851099014, -0.023324601352214813, 0.004329022951424122, -0.02205037884414196, -0.0055607883259654045, 0.014405191875994205, 0.06510207802057266, 0.030629443004727364, 0.00792544987052679, -0.024622557684779167, -0.01097820047289133, -0.037399016320705414, 0.021959124132990837, 0.030666034668684006, -0.010754069313406944, -0.023436404764652252, -0.0116265332326293, -0.0400908999145031, -0.014978975057601929, -0.010884053073823452, 0.046324074268341064, 0.02508661523461342, 0.005171750672161579, 0.0018672612495720387, -0.015667643398046494, -0.02485390566289425, -0.01954975351691246, 0.01890280842781067, -0.04141679033637047, 0.02781764417886734, -0.013612103648483753, 0.01327981986105442, 0.009752681478857994, -0.03591138496994972, 0.023484377190470695, -0.001246586674824357, -0.04322455823421478, 0.015668559819459915, 0.005636586807668209, -0.01730942726135254, 0.0034676222130656242, 0.03373192995786667, -0.0033382135443389416, 0.027878304943442345, 0.04412679746747017, -0.023144548758864403, -0.08838257938623428, -0.007502551656216383, -0.007818919606506824, 0.016226572915911674, 0.017757631838321686, 0.005616679787635803, 0.08920741081237793, 0.011188804171979427, -0.004249071702361107, 0.022512229159474373, -0.01768336445093155, -0.016997061669826508, 0.01159397792071104, 0.013409522362053394, 0.0057809860445559025, -0.020801329985260963, -0.006936376914381981, 0.0214648749679327, 0.029293563216924667, -0.024728909134864807, -0.010406608693301678, 0.055150650441646576, -0.007452982943505049, -0.031144779175519943, -0.007813632488250732, -0.01791267655789852, 0.028707951307296753, 0.00436020502820611, 0.02039957419037819, 0.00683323061093688, 0.0010220485273748636, -0.023714350536465645, -0.027506673708558083, 0.017655031755566597, -0.039721470326185226, -0.008748548105359077, 0.030337508767843246, -0.005538664758205414, 0.026904525235295296, -0.015379433520138264, -0.020271923393011093, -0.0005132866790518165, 0.025958899408578873, -0.016421398147940636, 0.024833383038640022, -0.02830996736884117, -0.019560357555747032, 0.02703152224421501, 0.02709217369556427, -0.02994956448674202, -0.027007048949599266, 0.03191407024860382, 0.0013320798752829432, 0.08085407316684723, 0.023334650322794914, -0.031450383365154266, 0.014814307913184166, 0.04064974561333656, 0.02193400077521801, 0.00806073471903801, -0.03755844011902809, -0.007261799182742834, 0.04332037270069122, -0.01036529615521431, -0.03172144666314125, 0.02303878590464592, 0.028903797268867493, 0.0069134836085140705, -0.012362198904156685, -0.02945604734122753, -0.0018738805083557963, 0.041236672550439835, 0.022599419578909874, 0.011392667889595032, -0.002948564710095525, -0.03542685508728027, -0.005024378187954426, -0.02025316096842289, 0.0676710307598114, 0.045807354152202606, 0.04841187223792076, -0.04008571058511734, -0.0041348813101649284, -0.036059461534023285, 0.010355508886277676, 0.00448777386918664, -0.03659544885158539, -0.06021581217646599, 0.0050086150877177715, 0.01910911127924919, 0.008327340707182884, -0.017560278996825218, 0.034719571471214294, 0.008431771770119667, 0.0002526869357097894, -0.006306956522166729, 0.055059805512428284, 0.01748386211693287, 0.02005937695503235, -0.04292513057589531, -0.021621523424983025, -0.08240177482366562, 0.009149481542408466, 0.01783761754631996, -0.01869845949113369, 0.04929047450423241, -0.013653893955051899, -0.017150387167930603, -0.017978250980377197, -0.016123007982969284, 0.025472210720181465, 0.028273288160562515, -0.013768192380666733, 0.011784684844315052, 0.014880556613206863, 0.03369520232081413, 0.0010566528653725982, -0.03898261860013008, 0.005802753381431103, 0.014493577182292938, -0.0240225438028574, -0.003276180475950241, 0.021396242082118988, 0.0016809210646897554, -0.0259059090167284, -0.03644970431923866, 0.0004740247968584299, -0.02963259071111679, 0.056355539709329605, -0.03986906632781029, -0.04379139468073845, -0.03321722894906998, -0.012616224586963654, 0.0036949242930859327, 0.051362693309783936, -0.007383150979876518, 0.05181851610541344, 0.0016594735207036138, 0.017471110448241234, -0.040815796703100204, 0.0020321947522461414, -0.0039131478406488895, -0.0030751011800020933, -0.059102319180965424, 0.020489951595664024, 0.011415734887123108, -0.04606368765234947, 0.02327803336083889, -0.02499239705502987, 0.023824628442525864, -0.016019247472286224, -0.05228455364704132, 0.004977088421583176, 0.002933101961389184, 0.03424915298819542, 0.0005892731714993715, 0.01596398465335369, 0.02196752093732357, 0.011120427399873734, 0.0024814954958856106, 0.011814964935183525, -0.03855506703257561, -0.0255372766405344, 0.022818515077233315, -0.01520350482314825, -0.005647776182740927, 0.008222118951380253, -0.00003063010080950335, -0.0032385806553065777, -0.0243635606020689, -0.02206188440322876, 0.04358954727649689, 0.0027667537797242403, 0.009568470530211926, -0.00871723797172308, 0.0371275320649147, 0.01602429337799549, 0.0282047837972641, -0.017402131110429764, 0.0199467521160841, -0.020761528983712196, -0.02516879327595234, 0.04914824292063713, -0.014035359025001526, 0.008631034754216671, -0.037897441536188126, -0.0015111957909539342, 0.022869089618325233, 0.011427990160882473, 0.0388430692255497, 0.0010547693818807602, -0.018740322440862656, 0.03322696313261986, 0.014256194233894348, 0.05747201666235924, -0.03846392408013344, -0.046199437230825424, 0.028963211923837662, 0.01409381628036499, -0.051475878804922104, 0.041536685079336166, -0.026916848495602608, -0.02156749926507473, 0.030637560412287712, 0.025953330099582672, 0.03321855887770653, -0.006772798020392656, -0.05489293858408928, 0.006786433979868889, -0.015231335535645485, 0.029676949605345726, -0.02465621381998062, -0.00008573113882448524, 0.014112183824181557, -0.025845181196928024, -0.011643089354038239, -0.008484721183776855, 0.0027653758879750967, -0.008282083086669445, 0.014006275683641434, -0.01702319271862507, 0.011708956211805344, 0.0014910285826772451, 0.001227529370225966, -0.004477736074477434, 0.0016943307127803564, -0.011400377377867699, 0.009794026613235474, -0.016832033172249794, 0.006373027339577675, 0.04644707590341568, 0.019586049020290375, 0.06910013407468796, -0.029467882588505745, -0.01521124318242073, 0.0007858546450734138, -0.008256517350673676, 0.020173346623778343, 0.0024265972897410393, -0.03367355465888977, -0.016497360542416573, -0.026445766910910606, -0.02981196530163288, 0.018337327986955643, -0.043845150619745255, -0.023020869120955467, 0.06287181377410889, 0.024591073393821716, 0.018153999000787735, -0.023648157715797424, 0.041628576815128326, -0.016209419816732407, 0.03292873874306679, -0.02726416476070881, 0.030666455626487732, 0.003890818916261196, 0.04442448914051056, -0.001004852238111198, 0.022161707282066345, -0.0257568322122097, 0.01486960705369711, -0.004451158456504345, -0.00221030181273818, 0.02964966371655464, 0.043418627232313156, 0.0009616779279895127, 0.007829095236957073, -0.03728649020195007, -0.02461765892803669, 0.027456164360046387, -0.02902422845363617, 0.044114936143159866, 0.016371464356780052, 0.0047407313250005245, 0.03545039892196655, -0.03062395006418228, -0.007822496816515923, 0.04812093824148178, 0.0013743616873398423, 0.03171242028474808, 0.011837638914585114, 0.05791591480374336, 0.0015138399321585894, -0.03933185338973999, -0.01210705004632473, -0.04500269889831543, 0.06946663558483124, 0.02738327719271183, 0.01529198233038187, 0.053512949496507645, -0.028859196230769157, 0.012019874528050423, -0.013079306110739708, -0.02187916822731495, 0.009385520592331886, 0.021832648664712906, 0.015583700500428677, 0.013304934836924076, -0.023152412846684456, -0.014123736880719662, 0.0742640271782875, 0.011954421177506447, 0.024046316742897034, 0.03953725844621658, 0.02998081035912037, 0.023453835397958755, 0.013840163126587868, 0.011497116647660732, 0.024515720084309578, -0.030276121571660042, -0.014258287847042084, 0.03696014732122421, 0.024846265092492104, 0.03837955370545387, 0.0038515343330800533, -0.008463983424007893, -0.024330036714673042, -0.02224152348935604, -0.011712911538779736, 0.025504115968942642, 0.007334456779062748, -0.03157135099172592, 0.026223400607705116, -0.017547771334648132, -0.014956461265683174, -0.011407172307372093, 0.012365334667265415, 0.01625612936913967, 0.01908521167933941, -0.010666992515325546, 0.020572107285261154, -0.0554078109562397, 0.011824487708508968, 0.004919019527733326, -0.022847982123494148, 0.011586240492761135, 0.033283766359090805, 0.015159951522946358, -0.03289739415049553, -0.04890591651201248, -0.01935804821550846, -0.003129180520772934, 0.0012144115753471851, 0.022873250767588615, -0.011563032865524292, -0.013208243995904922, -0.02571883238852024, 0.022521313279867172, -0.02185973711311817, 0.004600020591169596, -0.017793800681829453, 0.06145289167761803, -0.05043211206793785, 0.0451681911945343, -0.07723668217658997, -0.019198009744286537, -0.005417348816990852, -0.023559074848890305, -0.002949198242276907, -0.05137240141630173, 0.029326794669032097, -0.02872302010655403, -0.009382136166095734, -0.025718895718455315, -0.05454505234956741, 0.046858299523591995, 0.008334693498909473, -0.06647142022848129, 0.013877742923796177, 0.010780198499560356, 0.010933424346148968, 0.003599326591938734, 0.007773783057928085, 0.03940403088927269, 0.039179831743240356, 0.015749478712677956, 0.050666894763708115, 0.004462955519556999, -0.024041462689638138, 0.033476345241069794, 0.005155601073056459, 0.017608642578125, 0.03326581418514252, 0.01120404340326786, 0.02540568821132183, -0.0446329340338707, -0.01946728490293026, 0.02043401077389717, 0.007536367513239384, 0.011117793619632721, -0.022879615426063538, -0.05795775353908539, -0.016533464193344116, -0.004322515334933996, -0.012016929686069489, -0.03069373406469822, -0.04115627706050873, -0.02531346306204796, -0.010421338491141796, -0.01843724586069584, -0.053695473819971085, 0.0008084552246145904, -0.00789013970643282, 0.03974401578307152, -0.00982165802270174, -0.03541038557887077, -0.00406288355588913, 0.025845982134342194, -0.011704487726092339, 0.0011591456132009625, 0.04078522324562073, 0.0067814551293849945, -0.017379578202962875, -0.0579143725335598, 0.015707343816757202, -0.011334767565131187, -0.024095850065350533, -0.022180043160915375, 0.02649626135826111, -0.018675101920962334, -0.04836472123861313, 0.01753835938870907, 0.02614615671336651, -0.01971035823225975, 0.012440807186067104, 0.00047509613796137273, -0.06369848549365997, 0.015074234455823898, -0.017598548904061317, -0.03725367784500122, 0.006561285816133022, 0.0044459993951022625, -0.017941176891326904, -0.012534447014331818, -0.04950835183262825, 0.02124425582587719, -0.0653914138674736, -0.01860555075109005, 0.026704972609877586, -0.04444235563278198, -0.05811488628387451, -0.033939480781555176, -0.06368928402662277, 0.04776930809020996, -0.045836322009563446, 0.03333544358611107, -0.010154266841709614, 0.0006804901058785617, -0.012466313317418098, 0.023196645081043243, 0.038592368364334106, 0.017266375944018364, 0.04817631095647812, 0.06462492793798447, -0.03616524115204811, 0.05870344489812851, -0.003144914982840419, -0.06705933809280396, -0.03894195333123207, 0.0239899680018425 ]
Gradio-Lite: Serverless Gradio Running Entirely in Your Browser
abidlabs
October 19, 2023
gradio-lite
gradio, open-source, serverless
https://huggingface.co/blog/gradio-lite
Try it out! You can immediately try out @gradio/lite by copying and pasting this code in a local index.html file and opening it with your browser: html <html> <head> <script type="module" crossorigin src="https://cdn.jsdelivr.net/npm/@gradio/lite/dist/lite.js"></script> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@gradio/lite/dist/lite.css" /> </head> <body> <gradio-lite> import gradio as gr def greet(name): return "Hello, " + name + "!" gr.Interface(greet, "textbox", "textbox").launch() </gradio-lite> </body> </html> We've also created a playground on the Gradio website that allows you to interactively edit code and see the results immediately! Playground: https://www.gradio.app/playground
[ 0.03430163860321045, 0.0227180365473032, 0.08330225199460983, 0.0222721379250288, 0.08040937781333923, 0.04629983752965927, 0.08239232003688812, 0.04544835537672043, 0.02617940865457058, -0.04086166247725487, -0.08961997926235199, 0.05851789936423302, -0.018105410039424896, 0.013999061658978462, -0.008852002210915089, 0.03697541356086731, 0.028641710057854652, -0.0928763747215271, -0.037969328463077545, -0.0027614894788712263, -0.06722049415111542, -0.03286851570010185, 0.0009615861927159131, 0.03549351543188095, -0.01809384860098362, -0.04298870265483856, 0.02130761370062828, 0.035677164793014526, -0.07345185428857803, 0.033549368381500244, -0.02784380130469799, -0.05792614072561264, 0.017425216734409332, -0.0565352588891983, -0.03653428703546524, 0.04918986186385155, 0.008983680047094822, 0.0809609666466713, 0.0253467857837677, -0.031325291842222214, 0.03001595474779606, -0.06562948226928711, -0.07334244251251221, 0.03348572552204132, -0.0566079281270504, -0.00048200637684203684, -0.2012811303138733, 0.012734838761389256, -0.005503515712916851, 0.01985345594584942, -0.07238753139972687, -0.002463832963258028, -0.040578823536634445, -0.043959539383649826, -0.059301797300577164, -0.014665612950921059, -0.008304720744490623, -0.032804690301418304, 0.03524933382868767, -0.015198803506791592, 0.010945719666779041, 0.07523729652166367, -0.07155662029981613, 0.06691647320985794, 0.0506615974009037, 0.0641053169965744, -0.03675580769777298, 0.06908171623945236, -0.019595732912421227, -0.019683878868818283, 0.009488032199442387, 0.005055634304881096, -0.025060730054974556, -0.0920080691576004, 0.047987133264541626, -0.024700576439499855, -0.06666626036167145, 0.08705347031354904, -0.01357762049883604, 0.08577649295330048, 0.07820755988359451, -0.006921966560184956, 0.040258415043354034, 0.003330058651044965, 0.0440288782119751, -0.004512866493314505, -0.006077023223042488, -0.014300837181508541, -0.01920275017619133, 0.01623055338859558, -0.027927793562412262, -0.15478681027889252, -0.02169162780046463, 0.054616913199424744, 0.07858143001794815, 0.01461408194154501, -0.022820327430963516, 0.026774711906909943, 0.032452069222927094, -0.012101217173039913, -0.036260198801755905, -0.021344758570194244, -0.05363507196307182, -0.07136720418930054, -0.04872173070907593, 0.0019128278363496065, -0.04230925440788269, -0.008002098649740219, 0.03578043729066849, 0.043871235102415085, -0.06578505039215088, 0.029039716348052025, 0.0015289626317098737, 0.030125319957733154, -0.015423357486724854, 0.07270336896181107, -0.005846225656569004, 0.043496452271938324, -0.04651559516787529, -0.010530044324696064, 0.028587082400918007, 0.01787145622074604, 0.044218942523002625, 0.08502019941806793, 0.026735598221421242, 0.06364071369171143, -0.0169132798910141, 0.04372968152165413, 0.03327810391783714, -0.01937674917280674, 0.0487290658056736, 0.04573666304349899, 0.057377468794584274, 0.012718376703560352, -0.034975841641426086, -0.016293516382575035, 0.01470911968499422, -0.032731033861637115, 0.01312437653541565, -0.00237894244492054, 0.05446922406554222, 0.049058448523283005, -0.020385969430208206, 0.04925078898668289, -0.000626983237452805, -0.05857277661561966, 0.0027138390578329563, -0.014297585003077984, -0.020313400775194168, 0.009239187464118004, -0.02273155376315117, 0.05401952192187309, -0.03772382438182831, 0.03117881342768669, -0.05796804651618004, 0.052994176745414734, 0.006098552606999874, 0.03100498951971531, -0.048088595271110535, 0.011345380917191505, 0.042734481394290924, -0.02062876522541046, -0.07427911460399628, -0.07581276446580887, 0.06287138164043427, 0.04989919066429138, -0.04003271460533142, 0.012615728192031384, 0.11689704656600952, -0.03649887070059776, -0.02800684981048107, -0.03456063196063042, 0.039730701595544815, 0.0031850370578467846, -0.0021395545918494463, 0.06378674507141113, 0.04971953481435776, -0.021916547790169716, 0.009475770406425, -0.009709055535495281, -0.008240487426519394, 0.04028172791004181, 0.016675928607583046, -0.026860764250159264, -0.024693408980965614, -0.02842327393591404, 0.004071888048201799, -0.057642918080091476, 0.020215559750795364, -0.04696637764573097, -0.042467087507247925, 0.02672344632446766, 0.06540483981370926, -0.027185732498764992, -0.009903155267238617, -0.020727913826704025, 0.006756304297596216, 0.043184440582990646, 0.0191380325704813, 0.0750555694103241, 0.07532788068056107, -0.0045777843333780766, 0.05293968692421913, -0.03142468258738518, -0.041871629655361176, 0.0012392053613439202, 0.04801451414823532, 0.007481601554900408, -0.01721234619617462, -0.030473530292510986, 0.0159575454890728, -0.06596183031797409, 0.11855093389749527, 0.015722203999757767, 0.0038627800531685352, 0.04546547308564186, 0.018734673038125038, 0.06938007473945618, -0.003600608790293336, 0.07498645037412643, 0.12761585414409637, -0.0413753017783165, -0.0020979989785701036, -0.011657427996397018, -0.009732007049024105, 0.06475093215703964, 0.09760110080242157, -0.06398562341928482, 0.08828208595514297, -0.07490961253643036, -0.019192425534129143, -0.023995134979486465, -0.05744514986872673, 0.0815383642911911, -0.03662586212158203, -0.02099280059337616, 0.02841423824429512, -0.05061809718608856, 0.05691930651664734, -0.06345788389444351, 0.03614060580730438, -0.028130589053034782, -0.05625464767217636, 0.02249966375529766, -0.035654276609420776, -0.03791407123208046, 0.04303538054227829, 0.03970568999648094, 0.026010554283857346, 0.010505957528948784, 0.015355287119746208, -0.020035583525896072, 0.01807306334376335, 0.07017792016267776, 0.04081552103161812, -0.008279320783913136, -0.04142478108406067, 0.012985561043024063, -0.008338401094079018, 0.03883545100688934, -0.029466791078448296, -0.027590446174144745, 0.010113024152815342, -0.005053442902863026, -0.014435812830924988, 0.013460145331919193, -0.010937533341348171, 0.015101844444870949, 0.03997490927577019, 0.005383483599871397, 0.01428044680505991, -0.007078873924911022, -0.01849955879151821, -0.05182291567325592, -0.004757954739034176, 0.024416189640760422, -0.039448268711566925, -0.006079147104173899, 0.006783555261790752, -0.0464189350605011, -0.06487482786178589, -0.017216719686985016, 0.036194004118442535, 0.03207802772521973, 0.009598932228982449, 0.03006582148373127, -0.019169114530086517, -0.043743401765823364, -0.030406201258301735, 0.0068908557295799255, -0.008543751202523708, 0.019598204642534256, -0.014398658648133278, 0.014359449967741966, 0.011200787499547005, -0.04245317727327347, 0.05594288557767868, 0.008619413711130619, -0.03207023814320564, 0.04031844064593315, 0.015421896241605282, -0.00949773471802473, 0.007192208897322416, -0.015527219511568546, -0.027795426547527313, 0.021700913086533546, 0.02976854331791401, -0.03061891347169876, -0.10044031590223312, -0.022510359063744545, 0.00880980584770441, 0.03439765423536301, 0.02037927322089672, -0.0101265674456954, 0.03496456891298294, -0.04335470497608185, -0.030253734439611435, 0.0021672036964446306, -0.04388105124235153, -0.029780685901641846, 0.01910434290766716, -0.01281060092151165, 0.020760903134942055, -0.02051376737654209, -0.02204885147511959, 0.03903255984187126, 0.021682700142264366, -0.03349246829748154, -0.03835085406899452, 0.041602883487939835, 0.004748438484966755, -0.030336935073137283, 0.008424385450780392, -0.021115876734256744, 0.04016031324863434, 0.015377729199826717, 0.03068389743566513, -0.03894028440117836, 0.03675710782408714, -0.034404244273900986, -0.03797153756022453, 0.024218333885073662, -0.04336211085319519, -0.005313030444085598, -0.012187856249511242, -0.03340620920062065, 0.0063317581079900265, -0.03313394635915756, 0.005916154477745295, 0.023369627073407173, 0.018729031085968018, 0.011962889693677425, 0.0050698621198534966, -0.03607475385069847, -0.02872445434331894, -0.0019389771623536944, 0.06369352340698242, 0.0012502497993409634, -0.03856298327445984, 0.03996545448899269, 0.006265321280807257, 0.07194323092699051, -0.008989454247057438, -0.014928044751286507, 0.010813497938215733, 0.015688905492424965, 0.016053931787610054, 0.019538311287760735, -0.024389520287513733, 0.026355288922786713, -0.0063215093687176704, 0.015036939643323421, -0.04573666304349899, 0.028281260281801224, 0.005036648828536272, 0.008940476924180984, -0.013857121579349041, 0.00027027344913221896, -0.018049482256174088, 0.01659231446683407, 0.01625657081604004, 0.014686187729239464, -0.0010491762077435851, -0.03383869305253029, -0.055912844836711884, -0.016896123066544533, 0.07703103125095367, -0.011039447039365768, 0.034006860107183456, -0.02608523517847061, 0.01649608463048935, -0.04468921571969986, -0.00571354478597641, 0.03054111637175083, -0.011065446771681309, -0.05718037486076355, 0.004870275966823101, 0.007495965342968702, 0.006479991599917412, -0.019955145195126534, 0.018461104482412338, -0.011424073949456215, -0.025551356375217438, -0.018470456823706627, 0.0667702704668045, -0.015016273595392704, 0.042112477123737335, 0.01036202535033226, -0.020162073895335197, -0.05400582775473595, 0.026801681146025658, 0.022148678079247475, -0.014276874251663685, 0.03688620775938034, -0.019083503633737564, -0.015265188179910183, 0.005852367263287306, -0.0023046392016112804, -0.013200968503952026, 0.011296623386442661, -0.0063064186833798885, -0.013938107527792454, 0.002958592725917697, 0.05030885711312294, 0.002023248700425029, -0.03219589963555336, -0.031105726957321167, 0.042471159249544144, -0.05199532210826874, -0.05737019330263138, 0.026830065995454788, -0.002015438862144947, -0.028552381321787834, 0.007815186865627766, 0.03086143359541893, -0.01764679327607155, 0.03246667608618736, -0.018360285088419914, -0.040760837495326996, -0.047002747654914856, -0.0235456395894289, 0.0038531001191586256, 0.025649981573224068, 0.024880001321434975, 0.06269796937704086, -0.00959196500480175, 0.03535651043057442, -0.05858147144317627, 0.001576282549649477, -0.02083275280892849, -0.00011820141662610695, -0.06069127842783928, 0.024481985718011856, -0.006639648694545031, -0.03624835982918739, -0.008283663541078568, -0.04576960578560829, -0.011477372609078884, 0.03322451189160347, -0.06122817471623421, 0.004415937699377537, 0.01623600348830223, 0.012609809637069702, 0.008878897875547409, -0.0032002406660467386, 0.0158170685172081, 0.005923510994762182, 0.003911057021468878, 0.018029814586043358, -0.012207399122416973, -0.04277126491069794, 0.01021401584148407, -0.007226043380796909, -0.026075804606080055, 0.007515044417232275, -0.020916083827614784, -0.003685673698782921, 0.010242787189781666, -0.029173316434025764, 0.03129956126213074, -0.01591738872230053, -0.03004889003932476, -0.015356644056737423, 0.014347443357110023, -0.00598248653113842, 0.0063481577672064304, 0.026014719158411026, 0.056150104850530624, 0.04076778143644333, 0.011019062250852585, 0.04771876335144043, -0.010968291200697422, -0.01517011784017086, -0.04309121146798134, -0.008291847072541714, 0.015257691964507103, 0.03505459800362587, 0.003841129131615162, -0.014992624521255493, -0.03483223542571068, 0.023223817348480225, -0.04215479642152786, 0.03451213613152504, -0.056599028408527374, -0.04714687913656235, 0.005546082276850939, -0.0036042185965925455, -0.02530987188220024, -0.010443867184221745, -0.003475648583844304, -0.04368971660733223, 0.0028255407232791185, 0.02704440802335739, 0.0097369235008955, 0.013351119123399258, -0.052737217396497726, 0.03084925375878811, -0.006639551371335983, -0.0030892041977494955, -0.03279522433876991, 0.017145292833447456, -0.03872576355934143, 0.0035734414122998714, -0.019641190767288208, -0.010999537073075771, -0.04577331244945526, -0.0037410331424325705, 0.05238120257854462, 0.004408370703458786, 0.00643683597445488, -0.03673381730914116, 0.0036637065932154655, 0.028555290773510933, -0.0010589584708213806, 0.011376690119504929, 0.05515159294009209, -0.006391835864633322, 0.003398161381483078, 0.07517088204622269, 0.0206704530864954, 0.04694407805800438, -0.01115394663065672, -0.008867595344781876, 0.047503288835287094, -0.049763694405555725, -0.011818088591098785, 0.030366895720362663, -0.01494165975600481, -0.0064569078385829926, -0.023115158081054688, -0.052957020699977875, -0.006346798036247492, -0.029135316610336304, 0.006021563895046711, 0.07241061329841614, 0.0043347058817744255, -0.010051477700471878, -0.006773851811885834, 0.03703746572136879, -0.01614098809659481, 0.024575762450695038, -0.0035525530111044645, -0.0019632463809102774, 0.002017801161855459, 0.008487914688885212, 0.010896118357777596, 0.013516736216843128, -0.002038830891251564, 0.03785835951566696, -0.017050422728061676, -0.011167939752340317, 0.021440263837575912, 0.050036992877721786, 0.010631979443132877, -0.00483996095135808, -0.030482063069939613, -0.037844981998205185, 0.013027913868427277, -0.025704434141516685, 0.030909011140465736, 0.04356129840016365, -0.008734572678804398, 0.04288790747523308, -0.04093838855624199, -0.002006994793191552, 0.04471258074045181, 0.007401316426694393, 0.026164593175053596, 0.03307178616523743, 0.024769417941570282, -0.015014010481536388, -0.03329002484679222, -0.011213567107915878, -0.026025528088212013, 0.03068077564239502, 0.014218762516975403, 0.013175186701118946, 0.018310338258743286, -0.03409111499786377, -0.015971025452017784, -0.029813438653945923, -0.018565595149993896, -0.010087940841913223, 0.06171542778611183, 0.020157089456915855, -0.020728284493088722, -0.00616172980517149, -0.026909247040748596, 0.05917159095406532, 0.02984008565545082, 0.06361585855484009, -0.00852123275399208, 0.00994714256376028, 0.034694451838731766, 0.010393594391644001, -0.05866037681698799, 0.04116995260119438, -0.012220975942909718, -0.03257940709590912, 0.05525466054677963, 0.014188645407557487, 0.015582921914756298, 0.00917052011936903, 0.018364984542131424, 0.01575823314487934, 0.00009310922905569896, 0.001026947284117341, 0.03761795535683632, 0.02224189043045044, -0.038927920162677765, -0.02707110159099102, -0.03138137236237526, -0.02700384519994259, -0.02036910690367222, 0.01299616601318121, -0.02120009809732437, 0.006164546124637127, -0.006531888153403997, 0.04475995525717735, -0.004826094023883343, 0.021234389394521713, 0.027980729937553406, -0.012903433293104172, 0.0362660214304924, 0.06391482800245285, -0.00008922906999941915, -0.0056411451660096645, -0.022773411124944687, 0.002866782946512103, -0.018718915060162544, 0.01756810024380684, 0.007866725325584412, -0.011981746181845665, -0.010501686483621597, -0.010227479040622711, 0.025027969852089882, -0.018529344350099564, 0.009973572567105293, -0.0056702494621276855, 0.024174943566322327, -0.03700495511293411, 0.03987780958414078, -0.0706150159239769, -0.035133492201566696, 0.0017250807723030448, -0.009109084494411945, -0.007945019751787186, -0.03678633272647858, 0.02715027518570423, -0.03285393491387367, 0.0032735192216932774, -0.035305432975292206, -0.06138617545366287, 0.05796075612306595, 0.018692338839173317, -0.014360519126057625, 0.011221383698284626, -0.010253803804516792, -0.007909917272627354, 0.010429730638861656, 0.030292203649878502, 0.007544390391558409, 0.014123400673270226, -0.004446214530616999, 0.03131810575723648, 0.007737080100923777, -0.04009120538830757, 0.028334449976682663, 0.021128008142113686, 0.04706335812807083, 0.030502140522003174, 0.0328739657998085, 0.016634883359074593, -0.015463117510080338, 0.015748020261526108, -0.005422663409262896, 0.00738490978255868, -0.014774451963603497, -0.033540792763233185, -0.022078903391957283, -0.0018374890787526965, -0.007391795516014099, -0.00924465898424387, -0.010535500943660736, -0.05696243420243263, 0.0013290399219840765, -0.0027344825211912394, -0.02739538438618183, -0.027820797637104988, 0.007844462990760803, 0.020675448700785637, 0.019171927124261856, 0.02507670782506466, -0.02094033919274807, 0.026369718834757805, -0.006461412645876408, 0.0023430006112903357, 0.0005107024917379022, 0.012202855199575424, 0.04351323843002319, -0.024927588179707527, -0.04989933222532272, 0.037779442965984344, -0.024367479607462883, -0.038510385900735855, -0.0001469742855988443, -0.00718589685857296, 0.009250822477042675, -0.0393952801823616, 0.037366703152656555, 0.041352707892656326, -0.006910318974405527, 0.0037423628382384777, -0.017335327342152596, -0.03581755980849266, 0.015880877152085304, -0.00421881303191185, -0.03916918858885765, 0.018275467678904533, -0.004347984679043293, 0.016541844233870506, 0.060908641666173935, -0.025306252762675285, 0.014868495985865593, -0.016323493793606758, -0.041835103183984756, 0.017131350934505463, 0.02945638634264469, -0.022824494168162346, -0.013465817086398602, -0.038355063647031784, 0.056455496698617935, -0.05442328006029129, 0.013583894819021225, 0.004568543750792742, 0.010805326513946056, -0.01958267018198967, -0.013819304294884205, 0.022092146798968315, 0.01425406988710165, 0.017834117636084557, 0.05736646056175232, -0.000731398060452193, 0.05223609879612923, 0.0014299284666776657, -0.08905940502882004, -0.04386650025844574, 0.049231767654418945 ]
Gradio-Lite: Serverless Gradio Running Entirely in Your Browser
abidlabs
October 19, 2023
gradio-lite
gradio, open-source, serverless
https://huggingface.co/blog/gradio-lite
Multiple Files Adding multiple files within a @gradio/lite app is very straightforward: use the <gradio-file> tag. You can have as many <gradio-file> tags as you want, but each one needs to have a name attribute and the entry point to your Gradio app should have the entrypoint attribute. Here's an example: html <gradio-lite> <gradio-file name="app.py" entrypoint> import gradio as gr from utils import add demo = gr.Interface(fn=add, inputs=["number", "number"], outputs="number") demo.launch() </gradio-file> <gradio-file name="utils.py" > def add(a, b): return a + b </gradio-file> </gradio-lite>
[ 0.04325224459171295, 0.05207807570695877, 0.0006566072115674615, 0.02644241601228714, 0.1299358308315277, 0.09084425121545792, 0.05988973751664162, 0.033788442611694336, 0.035695429891347885, -0.04424097388982773, -0.09496282786130905, 0.0370640866458416, -0.014230024069547653, 0.054736047983169556, -0.014411987736821175, 0.03733881562948227, 0.012030708603560925, -0.025544526055455208, -0.03791156783699989, -0.0008796745678409934, -0.022683385759592056, -0.060289014130830765, 0.011685706675052643, 0.03272496536374092, -0.0089259659871459, -0.004556294996291399, -0.020651977509260178, 0.01856103539466858, -0.05638246610760689, 0.030201340094208717, -0.013605205342173576, -0.02823192998766899, -0.0035608597099781036, -0.03169320523738861, 0.036389295011758804, 0.054497767239809036, -0.027623668313026428, 0.08081313222646713, 0.01238697487860918, -0.11170115321874619, 0.019794385880231857, -0.03434765338897705, -0.1341966986656189, 0.0012781120603904128, 0.03167283535003662, 0.019681572914123535, -0.1791476607322693, -0.04141363501548767, 0.040235940366983414, 0.02356276474893093, -0.03917047753930092, 0.03393083065748215, -0.027408068999648094, -0.03788571432232857, -0.06590718775987625, 0.04864168167114258, -0.01954818144440651, -0.033466439694166183, 0.011495131067931652, 0.018986698240041733, 0.004195117857307196, 0.05362626910209656, -0.024095525965094566, 0.08399384468793869, 0.036363400518894196, 0.042836032807826996, -0.05198537930846214, 0.03517930582165718, -0.04373429715633392, 0.03939328342676163, 0.04353462904691696, 0.022792821750044823, -0.07503648847341537, -0.07229068130254745, 0.028476614505052567, -0.009603211656212807, -0.022289421409368515, -0.01034860871732235, -0.006493182387202978, 0.09828983247280121, 0.0784878209233284, 0.02171073667705059, 0.03184187784790993, -0.02148614078760147, 0.05126197263598442, -0.014967476017773151, -0.058635223656892776, -0.01417816337198019, -0.0044119334779679775, 0.0571124367415905, 0.013022035360336304, -0.18059159815311432, -0.0036396696232259274, 0.03586319461464882, 0.07168260961771011, -0.02576950378715992, -0.010553035885095596, 0.027100376784801483, 0.051883354783058167, 0.09517442435026169, 0.01986173540353775, -0.029976245015859604, -0.03977704793214798, -0.03423154354095459, -0.037473153322935104, 0.046862490475177765, -0.04664500057697296, -0.05101640895009041, -0.03229242190718651, 0.03099038265645504, -0.03872878476977348, -0.046761684119701385, -0.0015940835000947118, 0.03003762848675251, 0.01524067297577858, 0.058217257261276245, -0.015946097671985626, 0.031445059925317764, -0.062210563570261, -0.027171608060598373, 0.0002618120051920414, -0.02056564949452877, 0.030561745166778564, 0.10256195068359375, 0.04280654340982437, 0.05034436658024788, 0.050276271998882294, -0.035565972328186035, -0.02411123923957348, -0.04849637299776077, 0.02816437929868698, 0.06749899685382843, 0.04836798459291458, 0.018263008445501328, 0.04073495417833328, -0.08767131716012955, -0.010358444415032864, 0.015373321250081062, 0.07258885353803635, -0.026113057509064674, 0.02945995144546032, 0.06750326603651047, -0.03532049059867859, 0.020271647721529007, -0.01405229140073061, -0.04719987139105797, 0.011194070801138878, 0.008682194165885448, 0.0022769297938793898, 0.01163522433489561, -0.03734913095831871, 0.08567074686288834, -0.013598546385765076, 0.002745135687291622, -0.03991219401359558, 0.06750661879777908, 0.03373594582080841, 0.041739337146282196, -0.023388853296637535, 0.031023109331727028, 0.08881287276744843, 0.003875661874189973, -0.02443159744143486, -0.01632852293550968, 0.04775558039546013, 0.02366657927632332, -0.06770505011081696, 0.02365097589790821, 0.10310463607311249, -0.05955055356025696, -0.07196462154388428, -0.0057297139428555965, 0.004668048117309809, 0.023888347670435905, -0.021934300661087036, -0.010389376431703568, 0.054830070585012436, 0.029267415404319763, 0.03208459913730621, -0.02297065779566765, 0.0017686820356175303, 0.0005576902185566723, -0.04158862307667732, -0.01043729204684496, -0.008738342672586441, 0.015091968700289726, -0.00898177269846201, -0.10804959386587143, -0.011471427977085114, -0.010924802161753178, -0.012156658805906773, -0.02783447504043579, 0.034206364303827286, -0.018329529091715813, 0.057102035731077194, -0.012811776250600815, -0.005684359464794397, 0.02041923627257347, 0.05463029444217682, 0.007085585501044989, 0.029001912102103233, -0.01692562736570835, 0.026174722239375114, 0.08729514479637146, -0.019795233383774757, 0.02800588682293892, -0.013148087076842785, -0.038380302488803864, 0.00933851022273302, -0.007050288841128349, 0.02402675896883011, -0.005099134985357523, 0.0890398621559143, -0.023941993713378906, 0.046937745064496994, 0.019205378368496895, 0.09030269086360931, 0.012304418720304966, -0.00925513356924057, -0.013580852188169956, 0.095156230032444, -0.02986481413245201, -0.020522484555840492, 0.0026302644982934, -0.006597296334803104, 0.020317763090133667, 0.05719428509473801, -0.020695829764008522, 0.0470123365521431, -0.14583918452262878, 0.03006030060350895, -0.024145351722836494, -0.0662606805562973, 0.07254556566476822, -0.029636073857545853, -0.020193492993712425, 0.02551177330315113, 0.012157013639807701, 0.0016912415158003569, -0.057403918355703354, 0.009372558444738388, -0.027242716401815414, -0.07841544598340988, -0.018789643421769142, 0.026564061641693115, -0.02939150296151638, 0.07873804122209549, 0.030082842335104942, 0.04702841117978096, -0.06638344377279282, 0.017851075157523155, -0.026178814470767975, 0.033474840223789215, -0.0002658037992659956, -0.0033509174827486277, -0.013957767747342587, -0.00046582406503148377, -0.04537759721279144, -0.005274731665849686, 0.03612525016069412, -0.07324258238077164, 0.01689487136900425, 0.0034007348585873842, -0.02284166030585766, 0.015436121262609959, -0.017802638933062553, 0.011470799334347248, 0.01599017158150673, -0.0008662117179483175, -0.009388143196702003, 0.01716647483408451, -0.02153141051530838, -0.01590372622013092, -0.020248623564839363, 0.015988614410161972, 0.030716370791196823, -0.002408177126199007, -0.0014713387936353683, 0.015481739304959774, -0.01416395977139473, -0.028496239334344864, -0.01796794682741165, 0.020558999851346016, 0.002344544744119048, -0.00398891931399703, 0.00031358099658973515, -0.0056751021184027195, -0.026789793744683266, -0.008012089878320694, 0.02208062633872032, 0.00969135481864214, 0.013334326446056366, -0.0047281356528401375, -0.008113172836601734, -0.015917759388685226, -0.0005603026947937906, 0.025854093953967094, -0.02122994139790535, -0.003924930933862925, 0.020261814817786217, 0.0005350624560378492, 0.023397667333483696, -0.029589688405394554, -0.013612913899123669, -0.04502519965171814, 0.017507003620266914, 0.02644192799925804, -0.027481433004140854, -0.0993751659989357, -0.05645366013050079, -0.020672127604484558, 0.045144226402044296, -0.0018204959342256188, -0.01230952050536871, -0.007481142412871122, -0.05523477867245674, 0.014469301328063011, 0.01800229586660862, -0.038856636732816696, -0.005330157466232777, 0.01142183504998684, -0.01615896448493004, 0.028903014957904816, -0.020549187436699867, -0.007431607227772474, 0.07996245473623276, 0.03973995894193649, -0.024480769410729408, -0.03469112515449524, 0.020402662456035614, -0.014321564696729183, -0.011984680779278278, 0.004118276294320822, -0.021542012691497803, 0.01677716337144375, -0.008522247895598412, 0.018560590222477913, -0.030133597552776337, 0.02204159088432789, -0.017438488081097603, -0.06577187776565552, -0.03233882784843445, -0.04330624267458916, -0.04306017979979515, -0.0004042231885250658, -0.062288425862789154, 0.01574140414595604, -0.04743058606982231, 0.010216292925179005, 0.014790029264986515, 0.035179778933525085, -0.0015668527921661735, 0.002811637707054615, -0.023418495431542397, -0.01887255534529686, 0.002297971397638321, 0.07057095319032669, 0.021743256598711014, -0.01769244112074375, 0.044047240167856216, 0.03889351710677147, 0.04826808720827103, -0.037882886826992035, -0.06003357097506523, 0.02838098630309105, 0.03286568820476532, 0.04199186712503433, 0.02177157625555992, -0.020271040499210358, 0.0007656579255126417, -0.025522887706756592, -0.01344295684248209, -0.04628341272473335, 0.02041798084974289, -0.004379779100418091, 0.008825520984828472, 0.015713443979620934, 0.01312621496617794, -0.04071179777383804, -0.01408401783555746, 0.02273094654083252, 0.019381189718842506, -0.03240196034312248, -0.022476423531770706, -0.06799256801605225, -0.02408730797469616, 0.09918219596147537, -0.00552710285410285, 0.030699310824275017, -0.03509731963276863, -0.011488310061395168, -0.03104853816330433, -0.020517846569418907, 0.04947412386536598, -0.002262098016217351, -0.04796096310019493, 0.017922310158610344, 0.00885014608502388, -0.009688210673630238, -0.021518975496292114, 0.03673609346151352, 0.026982201263308525, -0.023174520581960678, -0.0033940416760742664, 0.010824865661561489, 0.010843848809599876, 0.03921595960855484, -0.0063612437807023525, 0.00750806275755167, -0.06862704455852509, 0.03188344091176987, 0.0031186265405267477, 0.027067111805081367, 0.0037159461062401533, -0.01582164131104946, -0.03808971866965294, 0.020315729081630707, -0.00492251617833972, -0.0018855315865948796, 0.012329508550465107, -0.03766303509473801, -0.01911611296236515, -0.01974697783589363, 0.02776210755109787, 0.009669938124716282, -0.05275007337331772, -0.003026221413165331, 0.04485278204083443, -0.035133782774209976, -0.04159150272607803, 0.010483402758836746, -0.03778097406029701, -0.015880193561315536, 0.01071579847484827, 0.08112508058547974, -0.049903351813554764, 0.01349569484591484, 0.013103816658258438, -0.026244783774018288, -0.034919582307338715, -0.035733290016651154, 0.010185150429606438, 0.015036585740745068, 0.021997962146997452, 0.01431196928024292, 0.018985629081726074, 0.054079167544841766, -0.06506039202213287, -0.031901683658361435, 0.021265707910060883, 0.020080920308828354, -0.054920803755521774, 0.02140556089580059, -0.015490337274968624, -0.044629618525505066, -0.0012959146406501532, -0.049543481320142746, -0.0012193958973512053, 0.018453292548656464, -0.04580863565206528, 0.015336590819060802, 0.03962593898177147, -0.009786180220544338, -0.02760816179215908, 0.006370858289301395, 0.007390304934233427, -0.0015431774081662297, 0.05158640444278717, -0.0016616760985925794, -0.02013593167066574, -0.022624367848038673, 0.0028670134488493204, 0.02390149049460888, -0.02891327068209648, -0.0010416582226753235, -0.06742457300424576, -0.01873892731964588, 0.011022061109542847, 0.00597392488270998, 0.01160504948347807, -0.00978719163686037, 0.0018747985595837235, 0.004749285988509655, -0.014288508333265781, -0.021334873512387276, 0.03406456485390663, 0.020934946835041046, 0.014712469652295113, -0.0013887453824281693, 0.004094978328794241, 0.0541364848613739, -0.024041714146733284, -0.03953910619020462, -0.01387977134436369, -0.01875404827296734, 0.0412251241505146, 0.036230556666851044, 0.008701032027602196, -0.021722981706261635, -0.016672736033797264, 0.02780509553849697, -0.028666796162724495, 0.030016984790563583, -0.028615456074476242, -0.029855402186512947, 0.0038824717048555613, -0.030828392133116722, -0.032899606972932816, -0.015014631673693657, 0.004888229537755251, -0.014022916555404663, 0.0005198649596422911, -0.023241683840751648, 0.027259979397058487, 0.005783215630799532, -0.048309750854969025, 0.028877180069684982, 0.01294014509767294, 0.014174436219036579, -0.04467710107564926, -0.024976251646876335, 0.02855061925947666, -0.012893401086330414, -0.01775405928492546, -0.02000724896788597, -0.007568833883851767, -0.02676599845290184, 0.04525453969836235, -0.054175619035959244, 0.008873644284904003, 0.03683513030409813, -0.011765965260565281, 0.0031837851274758577, 0.00855601392686367, 0.010037070140242577, 0.00966945942491293, 0.008840258233249187, 0.00900191254913807, 0.058444224298000336, -0.045222535729408264, 0.029394732788205147, -0.0027114141266793013, -0.013538772240281105, 0.025160273537039757, -0.04513780400156975, 0.03300711512565613, 0.023011617362499237, -0.03867071121931076, -0.025891579687595367, 0.027658430859446526, -0.05762554332613945, 0.008732007816433907, -0.004871642217040062, -0.044262804090976715, 0.06627863645553589, -0.007912025786936283, -0.03156556189060211, 0.027743924409151077, 0.0444154292345047, -0.0005161562585271895, 0.020427707582712173, -0.01767367124557495, -0.01376259047538042, 0.020727092400193214, 0.004163162317126989, -0.012572568841278553, 0.012110733427107334, 0.0013337837299332023, 0.06916458904743195, -0.005594993010163307, -0.03144044429063797, 0.011186148971319199, 0.04888013005256653, -0.06191611289978027, -0.04588845744729042, 0.012704236432909966, -0.030957171693444252, 0.021782582625746727, 0.009651280008256435, 0.07129393517971039, 0.05685359612107277, 0.015551315620541573, 0.03838910162448883, 0.003803475759923458, -0.02118786610662937, 0.010481651872396469, 0.012799841351807117, 0.044072434306144714, 0.046503569930791855, 0.008717140182852745, 0.008807558566331863, -0.026380019262433052, 0.02778441272675991, -0.011601920239627361, 0.04402551054954529, 0.04104452207684517, 0.012693120166659355, 0.011884000152349472, -0.00838204100728035, 0.01588064804673195, -0.006508208345621824, 0.009468602947890759, -0.0045529012568295, 0.05337774381041527, 0.018410662189126015, -0.011382526718080044, 0.005992662161588669, 0.009137130342423916, 0.04542577639222145, 0.010848755948245525, 0.021059071645140648, 0.0316915437579155, 0.031698815524578094, 0.05321214348077774, 0.007252189330756664, 0.0035358064342290163, 0.02216247469186783, -0.007138162851333618, -0.03522432595491409, 0.038642749190330505, 0.011481805704534054, -0.020936833694577217, 0.08164374530315399, 0.007614461705088615, 0.0351196825504303, -0.04263538494706154, 0.008283820003271103, 0.006899408996105194, 0.04473533108830452, -0.05500653758645058, -0.021039266139268875, -0.015001623891294003, -0.041875772178173065, 0.010412882082164288, -0.008279560133814812, 0.017378296703100204, -0.00538489269092679, -0.010752907954156399, 0.0095168836414814, -0.01886145770549774, 0.030135653913021088, -0.02353082224726677, -0.043425414711236954, 0.002928720088675618, 0.0637020617723465, 0.04619050770998001, -0.043198876082897186, -0.021149827167391777, 0.0023052184842526913, -0.00914932694286108, 0.022522274404764175, 0.029618285596370697, 0.021901777014136314, 0.0007440857007168233, -0.01423969492316246, -0.02895459160208702, 0.005300018936395645, 0.02453801780939102, -0.008432989940047264, 0.04964228346943855, -0.022335181012749672, 0.016589796170592308, -0.05290660634636879, -0.0393027737736702, 0.0017864425899460912, -0.0014457246288657188, 0.003684181021526456, -0.02229831926524639, 0.030368134379386902, -0.01228044182062149, -0.007326105609536171, -0.0019121092045679688, -0.04473327100276947, 0.049939386546611786, -0.012077019549906254, 0.01159796305000782, 0.022190570831298828, -0.005827882792800665, -0.04538406431674957, 0.023201994597911835, 0.00523304333910346, -0.003696901723742485, 0.014329320751130581, 0.0028259106911718845, 0.003410829696804285, 0.03673158213496208, -0.011793500743806362, 0.017465678974986076, 0.026020709425210953, 0.04035405442118645, 0.020617283880710602, 0.0009564416250213981, 0.03333500400185585, -0.029109423980116844, 0.051793213933706284, -0.009194081649184227, 0.04337453842163086, 0.011111650615930557, -0.024026328697800636, -0.014998973347246647, -0.004268580581992865, -0.02586127631366253, 0.006639629602432251, -0.0068973759189248085, -0.03161323070526123, 0.016089480370283127, -0.00014070245379116386, -0.016804734244942665, -0.06220944598317146, -0.012949815951287746, -0.03519802540540695, 0.0029837109614163637, 0.033105868846178055, -0.007911961525678635, 0.001740157837048173, 0.018729515373706818, 0.03238490968942642, 0.0026842718943953514, 0.0297609344124794, 0.020187795162200928, -0.030188044533133507, -0.015531506389379501, 0.023266293108463287, -0.042814865708351135, -0.012669513002038002, -0.014232234098017216, -0.002040049061179161, 0.003702862188220024, -0.02188601903617382, 0.016183078289031982, 0.048441771417856216, -0.013538619503378868, 0.0303431935608387, -0.005575188901275396, -0.04539387300610542, -0.004484213888645172, 0.01670081540942192, -0.023925306275486946, 0.018316222354769707, 0.0036384130362421274, -0.023518627509474754, -0.00212680222466588, -0.02152598462998867, 0.013775342144072056, -0.02089804783463478, -0.029185321182012558, 0.04260910302400589, -0.02323661372065544, -0.039175938814878464, -0.04680076241493225, -0.0587938129901886, 0.057484015822410583, -0.06282452493906021, 0.019141772761940956, -0.0081816166639328, 0.018768832087516785, -0.011325848288834095, 0.01540275290608406, 0.03297029808163643, -0.010503762401640415, -0.026946332305669785, 0.06552329659461975, -0.023387327790260315, 0.03982255607843399, -0.01605129987001419, -0.0299603883177042, -0.02481890842318535, 0.025339743122458458 ]
Gradio-Lite: Serverless Gradio Running Entirely in Your Browser
abidlabs
October 19, 2023
gradio-lite
gradio, open-source, serverless
https://huggingface.co/blog/gradio-lite
More Examples: Adding Additional Files and Requirements What if you want to create a Gradio app that spans multiple files? Or that has custom Python requirements? Both are possible with @gradio/lite!
[ 0.03781157732009888, 0.03426467254757881, 0.04916926100850105, 0.0661981999874115, 0.14751574397087097, 0.04987344145774841, 0.05987003818154335, 0.07227560877799988, -0.008879194967448711, -0.04517645761370659, -0.09648025035858154, 0.03876124694943428, -0.011148207820951939, 0.049985628575086594, 0.03725289925932884, 0.0334731824696064, 0.06510450690984726, -0.06853868812322617, -0.020298941060900688, -0.006256673019379377, -0.05151687189936638, -0.057533521205186844, 0.012404236011207104, 0.028664907440543175, -0.004687058739364147, -0.03879265859723091, -0.013830377720296383, 0.044682860374450684, -0.0830051600933075, 0.012921114452183247, -0.05207067355513573, -0.04795462265610695, -0.0019297481048852205, -0.08318304270505905, 0.0031893644481897354, 0.04381956160068512, -0.028721090406179428, 0.060788385570049286, 0.004666261374950409, -0.06975778192281723, 0.04092629253864288, -0.025110537186264992, -0.12968029081821442, 0.013476326130330563, 0.01674923487007618, 0.007227725349366665, -0.2314811795949936, 0.014955505728721619, -0.0028213842306286097, 0.01445872150361538, -0.05689461529254913, 0.08611199259757996, -0.029629487544298172, -0.030672190710902214, -0.012873944826424122, 0.035450536757707596, 0.012007550336420536, -0.0508488193154335, -0.0003184570523444563, 0.021366622298955917, -0.0002350680297240615, 0.010635040700435638, -0.026521679013967514, 0.03237953409552574, 0.03711038455367088, -0.00974348746240139, -0.07723060995340347, 0.02120150253176689, -0.046163786202669144, 0.011170013807713985, 0.006863913033157587, -0.018292009830474854, -0.0937853679060936, -0.05427449941635132, 0.006688195280730724, -0.047960881143808365, -0.031226973980665207, -0.02117476984858513, -0.004534462932497263, 0.10291551798582077, 0.05178536847233772, 0.02657158300280571, 0.07800344377756119, 0.010071325115859509, 0.013116913847625256, -0.03226592391729355, -0.010905541479587555, -0.03377359360456467, 0.007500689942389727, 0.04809463396668434, -0.006163489073514938, -0.14678464829921722, 0.00946891587227583, 0.01807415671646595, 0.06951741129159927, -0.044182803481817245, 0.0018242929363623261, 0.04129284247756004, 0.03332563862204552, 0.025619594380259514, -0.012306883931159973, -0.03020050935447216, -0.03929200395941734, -0.05656708404421806, -0.06213356927037239, 0.009616212919354439, -0.02204279415309429, -0.025398477911949158, -0.06908721476793289, 0.049895029515028, -0.008327633142471313, -0.023257378488779068, -0.009951709769666195, 0.055780962109565735, -0.003939719870686531, 0.06810124963521957, 0.004672915209084749, 0.002120921853929758, -0.05404689535498619, 0.004708398133516312, 0.004698270466178656, 0.03224543109536171, 0.09784146398305893, 0.10733543336391449, 0.04092283919453621, 0.08467631042003632, 0.007153723854571581, -0.02604931965470314, -0.04169910028576851, -0.12599751353263855, 0.021780826151371002, 0.04244169592857361, 0.05049607902765274, -0.017530303448438644, -0.015436886809766293, -0.07736847549676895, -0.03976822644472122, 0.0033840646501630545, 0.05142403766512871, -0.024594543501734734, 0.014667832292616367, 0.05973152443766594, -0.027726871892809868, 0.06301496922969818, -0.016612736508250237, -0.04636980593204498, 0.03295128792524338, 0.03875624015927315, -0.04103756323456764, 0.004430059343576431, -0.02650143764913082, 0.0855415090918541, -0.02415359765291214, -0.008070822805166245, -0.042613763362169266, 0.060460057109594345, -0.013410129584372044, -0.008230065926909447, -0.03305269405245781, -0.012378246523439884, 0.04945801571011543, -0.017665637657046318, -0.023054225370287895, -0.042323045432567596, 0.06917953491210938, 0.00908648781478405, -0.012189650908112526, 0.01883610524237156, 0.07776375859975815, -0.024635961279273033, -0.0611620731651783, -0.01482089702039957, -0.0021358197554945946, -0.013885431922972202, -0.03266455978155136, 0.04743950441479683, 0.07357063889503479, 0.04048314690589905, -0.016115840524435043, -0.0038853290025144815, 0.01235222164541483, -0.011067736893892288, -0.009080981835722923, 0.0026212187949568033, -0.01874849945306778, -0.032076146453619, -0.0055434019304811954, -0.07513929903507233, 0.02104855142533779, -0.011400106362998486, -0.04482118412852287, -0.028693977743387222, 0.05326477438211441, -0.02838006429374218, 0.04822254925966263, -0.038797177374362946, -0.002914954209700227, 0.09665930271148682, 0.05916204676032066, 0.06021150201559067, 0.05948929116129875, 0.0021712619345635176, 0.06063564494252205, 0.03881222754716873, -0.0025033524725586176, 0.05064279958605766, 0.023998985067009926, -0.054218024015426636, 0.02760550007224083, -0.022184249013662338, 0.033988986164331436, -0.028590453788638115, 0.08424226194620132, -0.07427528500556946, 0.015886280685663223, 0.048942435532808304, 0.03029245138168335, -0.013208669610321522, -0.018830368295311928, -0.04619501903653145, 0.1187608540058136, -0.007506067864596844, -0.026520615443587303, 0.0132095105946064, -0.01734071597456932, 0.04183865338563919, 0.06470159441232681, -0.011098094284534454, 0.09694385528564453, -0.10954897850751877, 0.0010009687393903732, -0.012483836151659489, -0.08091636002063751, 0.0753362625837326, -0.01370509434491396, 0.019203465431928635, 0.0018447157926857471, -0.021374117583036423, 0.05120081827044487, -0.040609389543533325, 0.027113547548651695, 0.004107361659407616, -0.03342900425195694, 0.02135086990892887, 0.0025377441197633743, -0.048211775720119476, 0.06567025929689407, -0.004793583415448666, -0.0029784466605633497, -0.014904147945344448, -0.014115354046225548, -0.01649976521730423, 0.04318075627088547, 0.02522428333759308, 0.07255757600069046, 0.004744887351989746, -0.023865289986133575, -0.040623873472213745, -0.02041677199304104, 0.017541076987981796, -0.017555754631757736, -0.0012102479813620448, 0.017923088744282722, -0.048723023384809494, 0.005397058557718992, -0.01667139120399952, 0.010295296087861061, 0.011509793810546398, -0.0018008348997682333, 0.011473698541522026, 0.004918527323752642, -0.010179877281188965, -0.005361372604966164, -0.028231503441929817, 0.016573254019021988, 0.023232262581586838, 0.014492138288915157, 0.029588142409920692, -0.0053047602996230125, -0.01566232554614544, -0.02067410945892334, -0.0320630818605423, 0.041447173804044724, 0.009898057207465172, 0.023736480623483658, -0.010106058791279793, 0.018586590886116028, -0.015405199490487576, -0.03634435683488846, 0.009112757630646229, -0.0052791740745306015, 0.018596835434436798, -0.022466883063316345, -0.023415805771946907, 0.04690622165799141, -0.013963901437819004, 0.01765294000506401, -0.0020958706736564636, -0.008775216527283192, 0.009774147532880306, 0.02150093950331211, 0.003720075823366642, -0.0031789031345397234, -0.0116275604814291, -0.054682258516550064, 0.04377378523349762, 0.05658569186925888, -0.02247317135334015, -0.1298401653766632, -0.05463559180498123, -0.0011437848443165421, 0.053557056933641434, -0.020265866070985794, 0.003067537909373641, 0.016873935237526894, -0.02851700596511364, 0.0005188054637983441, -0.00811915472149849, -0.04185027256608009, -0.019738931208848953, 0.04053362086415291, 0.006397358141839504, -0.002852272242307663, -0.014321038499474525, -0.003315421985462308, 0.05510362610220909, 0.03018057346343994, -0.004759229253977537, -0.043462302535772324, 0.0514964759349823, -0.003110569901764393, -0.019058197736740112, -0.011414958164095879, 0.006861316505819559, 0.023868901655077934, 0.019740702584385872, 0.031599052250385284, -0.015524267219007015, -0.013263028115034103, 0.01566866785287857, -0.06514507532119751, -0.026067592203617096, -0.02076934091746807, -0.012639893218874931, 0.016640447080135345, -0.012953550554811954, 0.021586701273918152, -0.012822226621210575, -0.009563799016177654, 0.012517773546278477, 0.027723411098122597, 0.006090590264648199, -0.009855691343545914, -0.03570181503891945, -0.0011760250199586153, -0.0021344730630517006, 0.07132074981927872, -0.0009125354699790478, -0.023544268682599068, 0.01598782278597355, 0.01966000720858574, 0.05431557446718216, -0.012682793661952019, -0.028172248974442482, 0.02036713808774948, 0.06210317090153694, 0.040917497128248215, -0.0151803158223629, -0.008795985952019691, 0.01814393699169159, -0.01671239361166954, -0.012162934057414532, -0.047796446830034256, 0.025363614782691002, 0.005720917135477066, 0.011838468722999096, -0.01481466181576252, -0.006629421375691891, -0.022411609068512917, -0.020170971751213074, 0.023759828880429268, 0.022899825125932693, -0.010261616669595242, 0.006099261809140444, -0.046955231577157974, -0.0149928517639637, 0.10771949589252472, 0.016662655398249626, 0.024975065141916275, -0.03418908640742302, 0.0025166200939565897, -0.011474442668259144, -0.03188043460249901, 0.03904037922620773, -0.012658517807722092, -0.026828810572624207, -0.020251769572496414, 0.037399958819150925, 0.016392042860388756, -0.018956469371914864, 0.03891286998987198, 0.008730234578251839, -0.021551843732595444, -0.008432998321950436, 0.06394331902265549, 0.0028781418222934008, 0.012607304379343987, -0.013106736354529858, 0.0024462861474603415, -0.02475823275744915, 0.014879869297146797, 0.03113420680165291, 0.025691505521535873, -0.008773977868258953, -0.03266729786992073, -0.029374688863754272, 0.02665158361196518, 0.016977649182081223, 0.027741001918911934, 0.0005040623946115375, -0.000673232483677566, -0.025194291025400162, 0.004925251938402653, 0.043925486505031586, -0.005722774658352137, -0.04558125510811806, -0.0227779783308506, 0.046273376792669296, -0.029824914410710335, -0.021322159096598625, 0.0019746217876672745, -0.02289600670337677, -0.02085372991859913, 0.0007793130935169756, 0.03888300433754921, -0.03549743443727493, 0.011772501282393932, 0.00401916541159153, -0.043713029474020004, -0.03376245126128197, -0.009924658574163914, 0.021605201065540314, 0.03002057410776615, 0.010494127869606018, 0.007530013099312782, 0.03762953728437424, 0.0220963004976511, -0.07700637727975845, -0.03571559488773346, -0.0015096220886334777, 0.042620815336704254, -0.022510850802063942, 0.0306093767285347, -0.03770098462700844, -0.05707136541604996, 0.020135968923568726, -0.05993017926812172, 0.010135947726666927, 0.013115639798343182, -0.035200584679841995, 0.007655326277017593, -0.012900877743959427, -0.011576327495276928, -0.006108525674790144, 0.009122062474489212, 0.02810724824666977, 0.019624795764684677, 0.061521224677562714, 0.026594014838337898, -0.038500312715768814, -0.04103594273328781, 0.006284622009843588, -0.0009757702937349677, 0.019263120368123055, -0.039947137236595154, -0.06935759633779526, -0.007948663085699081, -0.0004406014340929687, -0.005985959433019161, 0.041393257677555084, -0.0007445961236953735, -0.0066367764957249165, 0.014467800967395306, 0.0025574369356036186, 0.026926614344120026, 0.032384756952524185, 0.01051509939134121, 0.03245248645544052, 0.026276754215359688, -0.02324642241001129, 0.0239928737282753, -0.0013879442121833563, -0.025389809161424637, 0.007638587616384029, 0.021145867183804512, 0.029554421082139015, 0.02597844786942005, 0.03175543248653412, -0.030669057741761208, -0.02590264566242695, 0.010221423581242561, -0.029470957815647125, 0.03630339354276657, -0.03693239390850067, -0.025452997535467148, 0.010182171128690243, -0.01030142605304718, -0.03531874716281891, 0.016945183277130127, 0.012507990002632141, -0.013086020015180111, -0.025717291980981827, 0.02888151817023754, 0.02292802557349205, 0.00453892583027482, -0.0568862222135067, 0.04324068874120712, -0.007954740896821022, 0.004028830677270889, -0.017258957028388977, 0.005379884969443083, -0.0136969443410635, -0.0004090493603143841, -0.038836393505334854, -0.03444112837314606, -0.0077507151290774345, -0.015337590128183365, -0.005213998723775148, -0.022921603173017502, -0.018999535590410233, 0.010459056124091148, 0.0435635931789875, 0.0371888130903244, -0.008253821171820164, 0.005369015038013458, 0.029878055676817894, -0.033249497413635254, 0.034516315907239914, 0.0654241219162941, -0.020545633509755135, 0.01969296671450138, -0.0019223405979573727, -0.000649126130156219, 0.03623247146606445, -0.07279200106859207, 0.02847401052713394, 0.013635851442813873, -0.023407472297549248, -0.003294974332675338, 0.008076360449194908, -0.028915489092469215, 0.00328471208922565, -0.03246233984827995, -0.024003194645047188, 0.0640699490904808, 0.012348794378340244, -0.02656226046383381, -0.015170436352491379, 0.03749628737568855, -0.0026805601082742214, 0.025283006951212883, -0.011283167637884617, -0.0046950592659413815, 0.023500652983784676, 0.007233177311718464, 0.003950472455471754, 0.0329241007566452, -0.014424885623157024, 0.06679021567106247, -0.021753037348389626, -0.004369955509901047, 0.015653379261493683, 0.0036898027174174786, 0.0056453547440469265, -0.009015458635985851, -0.036659933626651764, -0.02923090197145939, 0.003142349189147353, -0.015502688474953175, 0.06402688473463058, 0.0627763569355011, 0.01399515476077795, 0.01183333620429039, -0.011963062919676304, 0.02260313183069229, 0.02864949032664299, 0.014598812907934189, 0.02607846073806286, 0.019983522593975067, 0.02942364104092121, -0.008413414470851421, 0.008921414613723755, -0.017915794625878334, 0.034658439457416534, 0.041842978447675705, 0.037739820778369904, 0.03102070838212967, -0.0027016636449843645, -0.009713809937238693, 0.020916219800710678, -0.030502289533615112, 0.021957268938422203, -0.0268557071685791, 0.027994953095912933, 0.021962059661746025, -0.006084058433771133, -0.006442460231482983, -0.006892539095133543, 0.06692177057266235, 0.03661700710654259, 0.03261491656303406, 0.03244481235742569, 0.0036469101905822754, 0.02238740399479866, -0.001832744455896318, 0.007568598259240389, 0.03708649054169655, -0.0018374096835032105, -0.0029712647665292025, 0.06937049329280853, 0.011475000530481339, 0.005031865555793047, 0.04885197803378105, -0.009199082851409912, 0.03581535816192627, -0.03180217370390892, 0.02496148645877838, -0.006520189810544252, 0.033028800040483475, -0.05549069121479988, -0.007780446670949459, -0.01671825721859932, -0.041034165769815445, 0.008802497759461403, -0.031256865710020065, 0.02856633812189102, 0.003118637017905712, -0.01329618226736784, 0.005062723532319069, 0.005474520847201347, 0.005049309227615595, -0.014129046350717545, -0.028364451602101326, 0.02775745838880539, 0.026942042633891106, 0.03665442764759064, -0.025721056386828423, -0.011720406822860241, -0.005775591358542442, -0.023066362366080284, -0.0054497793316841125, 0.021685665473341942, 0.00021027949696872383, -0.005587838124483824, -0.0051767220720648766, 0.0007258237455971539, -0.035300325602293015, 0.04203389585018158, -0.0020557844545692205, 0.033644627779722214, -0.028571508824825287, 0.04651335999369621, -0.06029422953724861, -0.06158649921417236, 0.004101966507732868, 0.0030911441426724195, 0.019918393343687057, -0.02220730483531952, 0.0076660350896418095, -0.0058760144747793674, 0.004555711057037115, -0.025729557499289513, -0.01312902569770813, 0.0016722397413104773, -0.017169790342450142, -0.010429288260638714, 0.02028067409992218, 0.0081559456884861, -0.01175204198807478, 0.001401245128363371, -0.007561040110886097, -0.004095310345292091, 0.0035927789285779, -0.031963106244802475, -0.0004611665790434927, 0.012208975851535797, -0.010207358747720718, 0.015349460765719414, 0.063484787940979, 0.0314519926905632, 0.020595001056790352, 0.01165429875254631, 0.048960376530885696, -0.015609517693519592, 0.008344966918230057, 0.005710002034902573, 0.03243060037493706, 0.022428173571825027, -0.041625093668699265, -0.040539585053920746, -0.03507212921977043, -0.025109808892011642, -0.0010507788974791765, -0.009711109101772308, -0.031222408637404442, 0.007802772335708141, -0.016139289364218712, -0.020876344293355942, -0.032306212931871414, -0.0340818352997303, -0.00861392356455326, 0.022216903045773506, 0.018920784816145897, -0.0390021987259388, 0.016660768538713455, -0.0027196938171982765, 0.02959141507744789, 0.018688922747969627, 0.032768841832876205, 0.028102396056056023, -0.030517080798745155, -0.013462498784065247, 0.02794639952480793, -0.05014163255691528, -0.03772178664803505, -0.012126363813877106, 0.010736013762652874, 0.022450556978583336, -0.030743762850761414, -0.0003529475361574441, 0.035004500299692154, 0.0013149634469300508, 0.024311618879437447, 0.024001555517315865, -0.04954221844673157, 0.014301561750471592, 0.020803306251764297, -0.04090815410017967, -0.0013104155659675598, -0.02374235913157463, -0.02125469222664833, 0.015376233495771885, -0.020568707957863808, -0.01996779441833496, -0.019729699939489365, -0.05290984734892845, 0.01988195814192295, -0.013673217967152596, -0.04151569679379463, -0.020178457722067833, -0.04024077579379082, 0.03944006934762001, -0.05239129811525345, -0.007833193987607956, 0.009777311235666275, 0.013781175017356873, -0.04583197087049484, 0.005151619203388691, 0.018064357340335846, -0.008908778429031372, 0.03222959116101265, 0.06882122159004211, -0.007694880478084087, 0.06758034229278564, 0.015257754363119602, -0.01792689971625805, -0.023358888924121857, 0.028518417850136757 ]
Gradio-Lite: Serverless Gradio Running Entirely in Your Browser
abidlabs
October 19, 2023
gradio-lite
gradio, open-source, serverless
https://huggingface.co/blog/gradio-lite
3. Privacy and Security Since all processing occurs within the user's browser, @gradio/lite enhances privacy and security. User data remains on their device, providing peace of mind regarding data handling.
[ 0.03641626983880997, 0.08376021683216095, 0.1336326152086258, 0.03859343007206917, 0.08244796842336655, 0.03128684684634209, 0.02437600865960121, 0.06655748188495636, -0.05058477446436882, -0.06682097911834717, -0.10512244701385498, -0.008199184201657772, -0.04653966426849365, -0.004758038558065891, -0.044420283287763596, 0.03786121681332588, 0.05890362337231636, -0.027391597628593445, -0.004323149565607309, -0.006460394244641066, -0.0022016894072294235, -0.07573658227920532, -0.012457425706088543, -0.004366030916571617, -0.0009466446936130524, -0.04972902312874794, -0.033414412289857864, -0.02482217364013195, -0.09923034906387329, 0.019472388550639153, -0.050908412784338, -0.03826712816953659, -0.025684626772999763, -0.06958106905221939, 0.04432440549135208, 0.005712330341339111, -0.005890629719942808, 0.057343631982803345, -0.016450168564915657, -0.04339979961514473, -0.04825436323881149, -0.11915561556816101, -0.11547407507896423, 0.050148818641901016, -0.04968675971031189, -0.04135291278362274, -0.21741965413093567, 0.05361935496330261, -0.018872246146202087, 0.00893502589315176, -0.10832788050174713, 0.0987846776843071, -0.05504654720425606, 0.04846116155385971, 0.013061829842627048, 0.019689323380589485, 0.0536026805639267, -0.005571221467107534, 0.04580608755350113, -0.06289588660001755, 0.03524329513311386, 0.008760573342442513, 0.03226987272500992, 0.03851395100355148, 0.029625549912452698, -0.050443898886442184, -0.013254177756607533, -0.029897546395659447, -0.009846897795796394, 0.006781044416129589, 0.017052462324500084, 0.043132536113262177, -0.034212615340948105, -0.06363868713378906, -0.04543402045965195, 0.030717061832547188, -0.0911175012588501, 0.01892205700278282, -0.004553388338536024, 0.04341450706124306, 0.055239856243133545, 0.003841375233605504, 0.09627339243888855, 0.007093842141330242, 0.029506545513868332, -0.012352892197668552, 0.029400857165455818, 0.022641899064183235, 0.00022035196889191866, -0.007773160934448242, 0.002152521861717105, -0.10322343558073044, 0.04202562943100929, 0.02804427780210972, 0.08349217474460602, 0.012699862942099571, -0.02119012363255024, 0.02042941376566887, 0.022076062858104706, 0.02862299419939518, 0.005450195167213678, -0.060124434530735016, -0.0469830259680748, -0.03516339138150215, -0.012970651499927044, 0.0008999255369417369, -0.07946569472551346, -0.05449217930436134, 0.008986846543848515, 0.10803885012865067, -0.021644970402121544, 0.008459034375846386, -0.039119940251111984, -0.016305532306432724, -0.029912235215306282, 0.07312124967575073, -0.0147663913667202, -0.01117081567645073, 0.0158691368997097, 0.023426374420523643, 0.05289565771818161, 0.05643348768353462, 0.04692692682147026, 0.08226433396339417, 0.04780293256044388, -0.014382435940206051, 0.019577758386731148, 0.011908811517059803, 0.01841163821518421, -0.04789484292268753, 0.01068397331982851, 0.04981847479939461, 0.02163827233016491, 0.021731138229370117, -0.02182447351515293, -0.005137250293046236, -0.03886410593986511, -0.06383366882801056, 0.023755332455039024, -0.06701012700796127, 0.023045437410473824, 0.03380401432514191, -0.042540621012449265, 0.002020961372181773, -0.012024563737213612, -0.07652667164802551, -0.010672959499061108, 0.040356118232011795, -0.01796645298600197, 0.03284423425793648, 0.017600785940885544, 0.03885626792907715, -0.02208373323082924, -0.08757884055376053, -0.01250507403165102, 0.021779518574476242, 0.0040933554992079735, -0.002482672454789281, -0.026399213820695877, 0.019269242882728577, -0.010137970559298992, -0.03209257498383522, -0.04344969242811203, -0.031474363058805466, 0.08754625171422958, 0.07712802290916443, -0.01016238983720541, -0.0077247945591807365, 0.07128932327032089, -0.053633321076631546, -0.08002705127000809, -0.03285699710249901, 0.0479566790163517, -0.043377213180065155, 0.010485098697245121, 0.13468807935714722, 0.02470417506992817, -0.007009365130215883, -0.004118356388062239, 0.006906044203788042, 0.0011996065732091665, -0.024654358625411987, -0.021908167749643326, -0.007996168918907642, -0.05351082235574722, -0.024850022047758102, 0.014543462544679642, -0.04338984563946724, -0.04064111411571503, -0.004865843337029219, -0.06826962530612946, 0.013818422332406044, 0.019497299566864967, -0.0759509727358818, 0.04463952034711838, -0.05404584854841232, 0.038538623601198196, 0.0644938051700592, 0.042710673063993454, 0.05187124386429787, 0.03202582150697708, -0.025166461244225502, 0.06805361062288284, -0.016508568078279495, -0.038630399852991104, 0.011117645539343357, 0.07785098999738693, 0.024358617141842842, 0.017365196719765663, 0.02836732752621174, -0.0451800599694252, -0.09557311236858368, 0.07657229155302048, -0.005582809913903475, 0.014851892367005348, 0.05399566888809204, 0.033660367131233215, 0.004974743817001581, -0.00552864745259285, -0.04286009818315506, 0.032533735036849976, -0.03617040067911148, 0.024457627907395363, 0.06604008376598358, -0.001607105485163629, 0.08069592714309692, 0.03429306298494339, -0.03631296381354332, 0.06989770382642746, -0.012633253820240498, -0.0004226146556902677, -0.023562736809253693, 0.011245748028159142, 0.012875711545348167, 0.04296526312828064, 0.05417303368449211, 0.01223156787455082, -0.02361326664686203, 0.06997400522232056, -0.0020514142233878374, 0.03661612793803215, -0.020141014829277992, 0.030937213450670242, 0.030884532257914543, 0.0028786836192011833, -0.0744650810956955, 0.01394900307059288, -0.017502835020422935, 0.024580733850598335, -0.023945245891809464, -0.007419740315526724, -0.0014537610113620758, 0.009759561158716679, 0.03418681025505066, 0.09892094135284424, -0.07373884320259094, 0.034135255962610245, -0.013639433309435844, -0.012842497788369656, 0.024702195078134537, 0.007477018982172012, -0.06404567509889603, 0.02584707736968994, -0.020439283922314644, 0.04158962145447731, -0.024242034181952477, 0.01222651731222868, 0.04524696245789528, 0.02245025895535946, 0.02568282000720501, 0.0032404717057943344, -0.033342014998197556, -0.009836912155151367, -0.010950963944196701, 0.02471115067601204, 0.017563773319125175, 0.019958840683102608, -0.0038938610814511776, 0.01765494979918003, -0.037916142493486404, -0.007935496978461742, -0.010679945349693298, 0.047660570591688156, 0.04194158688187599, 0.02925553359091282, -0.0015848748153075576, -0.00609769020229578, -0.023397374898195267, -0.09164319932460785, -0.0006793693173676729, -0.0178277138620615, -0.02964036911725998, -0.008007150143384933, 0.007164953742176294, 0.006236079148948193, -0.013790191151201725, 0.031188400462269783, 0.005050236359238625, -0.04360165446996689, -0.011303353123366833, 0.007761369924992323, -0.04177263006567955, 0.034642454236745834, -0.017501510679721832, -0.0168085228651762, 0.03462059795856476, 0.023063208907842636, -0.0029697611462324858, -0.12063545733690262, -0.010770176537334919, 0.0217744093388319, 0.039744190871715546, -0.015858227387070656, 0.03119247779250145, 0.03096066229045391, -0.030837835744023323, -0.0027707775589078665, -0.0005427984287962317, -0.014191884547472, -0.007583192549645901, 0.0219302736222744, -0.03031262755393982, -0.009668187238276005, 0.008940351195633411, 0.019974594935774803, 0.04997101053595543, 0.033229485154151917, -0.04755458980798721, 0.016504094004631042, 0.011639762669801712, -0.03350755572319031, -0.0451863668859005, -0.024961264804005623, -0.015146180056035519, 0.01664700172841549, 0.012119186110794544, 0.033356644213199615, 0.017336474731564522, 0.018145382404327393, -0.009726002812385559, -0.010476134717464447, 0.00023592628713231534, -0.043803971260786057, 0.00943730492144823, 0.02264472283422947, -0.017760369926691055, 0.006416382733732462, 0.0010781793389469385, 0.014539653435349464, 0.038794275373220444, 0.007548475172370672, 0.035133082419633865, 0.016390912234783173, -0.024751462042331696, 0.004679258447140455, 0.010670523159205914, 0.044153157621622086, -0.03979816287755966, -0.02168128825724125, 0.030125683173537254, -0.038876961916685104, 0.05484731122851372, 0.005103083327412605, -0.03353366255760193, -0.013076215982437134, 0.0232720784842968, -0.005756239406764507, -0.03429754450917244, -0.0149854039773345, 0.004558080807328224, 0.010714099742472172, -0.00044918895582668483, -0.06872504949569702, 0.025978032499551773, 0.028372595086693764, 0.02681046351790428, -0.026166951283812523, 0.013217383995652199, -0.01767897792160511, 0.02977065183222294, 0.028340965509414673, 0.013875260949134827, 0.01557301264256239, 0.0018767996225506067, -0.013197281397879124, 0.006493735127151012, 0.09152781963348389, -0.008968337439000607, 0.038703326135873795, -0.0061309076845645905, 0.02352123335003853, -0.01801871322095394, 0.003412430640310049, -0.008140555582940578, -0.02778449095785618, 0.040752947330474854, -0.0057770623825490475, 0.03552880138158798, 0.022692635655403137, -0.022341953590512276, 0.034620530903339386, -0.00876400712877512, -0.006972902454435825, 0.020373301580548286, 0.05240854248404503, -0.002713266294449568, -0.0022223517298698425, -0.03975999355316162, 0.008985876105725765, -0.04136570170521736, 0.0016430248506367207, -0.02922820672392845, -0.028885245323181152, 0.05009184405207634, -0.02156657725572586, 0.00048558879643678665, 0.00540820462629199, 0.022407524287700653, 0.018314773216843605, 0.04439214989542961, -0.0148337846621871, -0.01504659652709961, -0.005772328469902277, 0.020916812121868134, -0.006228663958609104, -0.043115533888339996, -0.010982735082507133, 0.009744568727910519, -0.024993378669023514, -0.032595906406641006, 0.008697504177689552, 0.014179827645421028, -0.022170834243297577, -0.004064345266669989, 0.01369494292885065, -0.0527699775993824, -0.004903630819171667, -0.029316380620002747, -0.01355550903826952, -0.02956220507621765, 0.026558635756373405, 0.016124766319990158, 0.06935743987560272, -0.012034817598760128, 0.030355483293533325, 0.041963353753089905, 0.027575213462114334, -0.05967545881867409, 0.0025251363404095173, 0.028511598706245422, 0.018232379108667374, -0.06013055518269539, 0.02487727254629135, 0.004197265952825546, -0.07590203732252121, 0.02002573572099209, -0.06207601726055145, 0.01969956047832966, 0.01853364147245884, -0.05378003418445587, 0.00911669060587883, 0.04032347723841667, 0.02154933102428913, 0.011335199698805809, -0.010450764559209347, 0.0073950570076704025, -0.030704237520694733, 0.024428240954875946, 0.011714537627995014, -0.021587572991847992, -0.03981004282832146, 0.03403488174080849, 0.019467312842607498, 0.002662735991179943, -0.02368731051683426, 0.02031257562339306, -0.019949307665228844, 0.004583182279020548, 0.000028678434318862855, 0.05022045597434044, -0.014571751467883587, 0.028154276311397552, 0.042385220527648926, 0.016833815723657608, -0.005248875357210636, 0.03733576834201813, 0.03709913417696953, 0.032561175525188446, 0.04126901924610138, 0.004720688797533512, 0.05012669786810875, 0.03353660926222801, 0.0008679816382937133, 0.0004318521823734045, 0.03306883946061134, 0.01775648258626461, 0.019170694053173065, 0.035469893366098404, -0.007273275870829821, -0.004395231604576111, 0.008014537394046783, -0.032537538558244705, 0.03646795079112053, -0.04842580109834671, 0.00603642500936985, 0.03525778651237488, -0.0073698293417692184, 0.005207458045333624, -0.005859053693711758, -0.008080490864813328, -0.021510325372219086, 0.03573119267821312, 0.00036093793460167944, 0.04780561104416847, 0.03785072639584541, -0.013814943842589855, 0.003857081988826394, 0.04909845069050789, -0.022871455177664757, 0.0024482926819473505, 0.022220181301236153, -0.012618299573659897, -0.015573855489492416, -0.04468851163983345, -0.06438720971345901, 0.007997548207640648, -0.026920290663838387, 0.03980199620127678, 0.008179359138011932, -0.0022322095464915037, -0.04643649235367775, 0.00861080177128315, 0.027552509680390358, 0.004629943519830704, 0.014257927425205708, 0.037547171115875244, -0.010320479050278664, 0.0373145267367363, 0.04257798194885254, 0.014582989737391472, 0.03151896595954895, -0.027443982660770416, -0.013346076011657715, 0.04792396351695061, -0.0654996782541275, -0.0007318022544495761, 0.001399966306053102, -0.036684803664684296, -0.011824126355350018, -0.02119992859661579, -0.04854397475719452, -0.002887031063437462, -0.03469395264983177, -0.017239199951291084, 0.06530208140611649, 0.028971213847398758, -0.008213473483920097, 0.03301745653152466, 0.04061450809240341, -0.021504411473870277, 0.03094259276986122, -0.016534550115466118, 0.039638012647628784, -0.002020372310653329, 0.012102056294679642, -0.0066905152052640915, 0.02596985548734665, -0.005909014027565718, -0.004992063622921705, 0.013513335026800632, -0.024744123220443726, 0.0343133881688118, 0.005162831395864487, 0.031767114996910095, 0.02880319580435753, -0.010950532741844654, -0.0018369184108451009, -0.0021372076589614153, -0.045579832047224045, 0.05279155820608139, 0.09399638324975967, -0.012077242136001587, 0.007326268590986729, -0.015325440093874931, 0.023962829262018204, 0.04798223823308945, 0.010540521703660488, 0.01268711220473051, 0.011964256875216961, 0.020552996546030045, 0.027720019221305847, -0.019252650439739227, 0.0014418013161048293, -0.043708983808755875, 0.009515652433037758, 0.01964462734758854, 0.02351398766040802, -0.027624431997537613, -0.029997676610946655, 0.019011877477169037, 0.008108198642730713, 0.006878948770463467, 0.008336628787219524, 0.006554776336997747, 0.0023984655272215605, -0.014218799769878387, 0.033020202070474625, -0.035380009561777115, 0.05084000900387764, 0.017584076151251793, 0.019326232373714447, 0.03657403588294983, -0.023903565481305122, -0.024562135338783264, 0.06233034282922745, 0.005207948386669159, 0.02420923113822937, -0.006376633420586586, -0.01489663403481245, 0.03285502269864082, 0.02381446771323681, 0.03089820221066475, 0.05011294037103653, -0.011859500780701637, 0.012728439643979073, 0.0024429657496511936, -0.004694728180766106, -0.01873510144650936, 0.03622056543827057, -0.0663263127207756, 0.012230310589075089, 0.014365465380251408, -0.025660641491413116, -0.006625520996749401, 0.031179925426840782, 0.024302935227751732, 0.014288641512393951, -0.012664505280554295, 0.02612476982176304, 0.0026417342014610767, -0.012889459729194641, 0.0163450725376606, -0.02687700092792511, -0.007971318438649178, 0.030733149498701096, 0.011814635246992111, -0.029019150882959366, -0.04734903573989868, -0.008560090325772762, -0.030771981924772263, 0.007350550964474678, 0.02455981820821762, -0.026751868426799774, 0.02864900603890419, -0.02953946590423584, 0.00872002076357603, -0.03411081060767174, -0.010112335905432701, -0.026385178789496422, 0.03285496309399605, -0.03141796588897705, 0.04001174867153168, -0.06161806359887123, -0.03159415349364281, -0.02597525343298912, 0.014508710242807865, -0.01148611307144165, -0.031345635652542114, 0.03650318831205368, -0.0034922929480671883, -0.0029640228021889925, -0.02469550631940365, -0.00018192079733125865, 0.004874892998486757, -0.016807792708277702, -0.002280675107613206, 0.0051978351548314095, 0.00940102618187666, 0.004040869418531656, 0.009742537513375282, 0.031093968078494072, 0.006153789348900318, -0.013150528073310852, 0.006920176558196545, 0.04743560403585434, 0.0032226634211838245, -0.029926737770438194, 0.0015695090405642986, 0.0638965293765068, 0.01123537216335535, 0.03714248165488243, 0.0009597368771210313, 0.017168572172522545, -0.06311721354722977, -0.03688381612300873, -0.0027602831833064556, 0.01779513619840145, 0.0009295521886087954, 0.022613665089011192, -0.005759458057582378, -0.007998828776180744, -0.04042629897594452, -0.010264049284160137, -0.011638381518423557, -0.004098785575479269, -0.0355687253177166, 0.009800916537642479, -0.019623305648565292, -0.057733308523893356, -0.0007352104876190424, -0.010253082029521465, -0.0011899118544533849, -0.018015313893556595, -0.0262061208486557, 0.00990468729287386, -0.03092213347554207, 0.01805635169148445, -0.018065569922327995, 0.03962716460227966, 0.00858159177005291, -0.020192384719848633, -0.03475099056959152, 0.031884219497442245, -0.04086146131157875, -0.03602132946252823, 0.018156304955482483, 0.027028517797589302, -0.021441128104925156, -0.0003175095480401069, 0.015898440033197403, 0.01998114213347435, 0.0008196546114049852, 0.030028073117136955, 0.006082904990762472, -0.03587311506271362, 0.008886261843144894, 0.00999388936907053, -0.021995890885591507, 0.01162189245223999, -0.008438939228653908, 0.04309268668293953, 0.01799117401242256, -0.024375123903155327, -0.006939152255654335, -0.04721586033701897, -0.027816690504550934, 0.039879247546195984, -0.029550569131970406, -0.03499269112944603, -0.02805474027991295, -0.03896632418036461, -0.006315360777080059, -0.03773152828216553, -0.04337843134999275, -0.004577768500894308, -0.06680582463741302, -0.02529594488441944, -0.009221356362104416, -0.01549744326621294, 0.005070764105767012, 0.07054894417524338, 0.018693141639232635, -0.044705282896757126, 0.038332462310791016, 0.009530211798846722, -0.013533122837543488, -0.02844286523759365, -0.004423116333782673 ]
Gradio-Lite: Serverless Gradio Running Entirely in Your Browser
abidlabs
October 19, 2023
gradio-lite
gradio, open-source, serverless
https://huggingface.co/blog/gradio-lite
Getting Started Let's build a "Hello World" Gradio app in @gradio/lite
[ 0.05653306469321251, 0.026305846869945526, 0.10981844365596771, 0.023413613438606262, 0.14294356107711792, 0.06217878684401512, 0.06256145238876343, 0.04676484689116478, -0.030261846259236336, -0.05408697947859764, -0.0858498215675354, 0.06503769755363464, -0.012301838956773281, 0.055601269006729126, 0.020868120715022087, 0.04407402500510216, 0.03240574151277542, -0.06789519637823105, -0.014186975546181202, -0.03998240455985069, -0.051934003829956055, -0.03683328628540039, 0.01099082175642252, 0.028113916516304016, 0.008275513537228107, -0.013766010291874409, -0.009375498630106449, 0.053042538464069366, -0.0971551463007927, 0.025325242429971695, -0.039545733481645584, -0.0393996387720108, 0.03114575706422329, -0.09506482630968094, -0.017701754346489906, 0.054764121770858765, -0.010497797280550003, 0.08566020429134369, 0.0032846599351614714, -0.0654791072010994, 0.013917267322540283, -0.04677747189998627, -0.05297752469778061, 0.039864081889390945, -0.016303056851029396, 0.00763776944950223, -0.27306070923805237, 0.02825031243264675, -0.02086430788040161, -0.0029364272486418486, -0.06656142324209213, 0.044823743402957916, -0.03348095715045929, -0.030047304928302765, -0.03596530854701996, 0.06751129776239395, 0.047912854701280594, -0.04595741257071495, 0.01396618690341711, -0.03667023032903671, 0.01970154605805874, 0.018562311306595802, -0.04861908778548241, 0.050549380481243134, 0.05511884763836861, -0.007277243304997683, -0.020404759794473648, 0.01973120868206024, -0.03636857494711876, 0.04439622908830643, -0.007280390709638596, -0.019307993352413177, -0.01646997779607773, -0.06273197382688522, 0.026297111064195633, -0.032904669642448425, -0.028732072561979294, 0.05098555609583855, 0.05084545537829399, 0.09212707728147507, 0.020552879199385643, -0.008608178235590458, 0.08838849514722824, 0.0008008616277948022, 0.03168448433279991, -0.011294497177004814, -0.0007558778161183, -0.0016934702871367335, -0.014967556111514568, 0.03284352645277977, -0.031168513000011444, -0.16615261137485504, -0.00848560594022274, 0.02599474973976612, 0.040469929575920105, -0.03889833390712738, -0.01018216460943222, 0.035716891288757324, 0.057054080069065094, 0.04497363418340683, 0.01102093793451786, 0.005791128147393465, -0.001289645559154451, -0.03603896498680115, 0.0004440949414856732, -0.021431850269436836, -0.025889232754707336, -0.056574735790491104, -0.026403162628412247, 0.04906933382153511, -0.017499905079603195, 0.005985823459923267, 0.028372934088110924, -0.0009677266934886575, -0.04168758541345596, 0.064040407538414, 0.013997494243085384, -0.006680427584797144, -0.031817249953746796, -0.0021951680537313223, 0.01649295724928379, 0.07723373174667358, 0.03823196515440941, 0.07034565508365631, 0.018709221854805946, 0.05671733617782593, -0.00013272846990730613, 0.00990960095077753, -0.0035528407897800207, -0.05735398456454277, 0.020904000848531723, 0.03315025195479393, 0.03200054541230202, -0.015546517446637154, -0.025373999029397964, -0.038439128547906876, 0.0019508461700752378, -0.02185530960559845, 0.020750101655721664, -0.019048750400543213, 0.027323173359036446, 0.0607733316719532, -0.018405258655548096, 0.0732141062617302, -0.002082694787532091, -0.05827396735548973, 0.03772629424929619, 0.015451735816895962, -0.02946506254374981, 0.009901887737214565, -0.014611253514885902, 0.039146751165390015, -0.02753876894712448, -0.00031641218811273575, -0.0509636290371418, 0.03831867873668671, -0.010605677962303162, 0.004343446809798479, -0.05839355289936066, 0.0027968892827630043, 0.013837574981153011, -0.03420696035027504, -0.04147656634449959, -0.02387608028948307, 0.08318151533603668, 0.038486067205667496, -0.0034780355636030436, 0.009871925227344036, 0.09189289808273315, -0.0724852979183197, -0.05068535730242729, -0.03109101764857769, 0.024259643629193306, -0.02114984020590782, -0.05623490735888481, 0.043547675013542175, 0.06803902238607407, 0.019327329471707344, -0.01716485060751438, 0.020093098282814026, -0.028406310826539993, 0.001066069584339857, -0.0017467308789491653, 0.008516819216310978, -0.022832490503787994, -0.03077419474720955, -0.02428656630218029, -0.06512916088104248, 0.0003476454003248364, -0.013937537558376789, -0.034018054604530334, -0.027106327936053276, 0.06918720155954361, -0.049117930233478546, 0.04047612473368645, -0.039497796446084976, 0.005235239397734404, 0.0662861168384552, 0.05778609216213226, 0.08529693633317947, 0.08916077017784119, -0.006374805234372616, 0.061109162867069244, 0.013235589489340782, -0.06167824938893318, 0.024165958166122437, 0.049491025507450104, 0.02809218503534794, 0.02727089636027813, 0.01490867417305708, -0.014344531111419201, -0.07294443994760513, 0.10915039479732513, -0.027311217039823532, 0.01162025984376669, 0.04224197193980217, 0.037250641733407974, 0.012554357759654522, 0.02024376019835472, -0.01904279924929142, 0.0957927256822586, -0.046106427907943726, -0.04751669615507126, 0.040412772446870804, -0.02952619642019272, 0.07482145726680756, 0.10837247222661972, -0.005997481290251017, 0.12009237706661224, -0.09682627022266388, 0.022155985236167908, -0.031214216724038124, -0.03479475900530815, 0.09105616807937622, -0.011527562513947487, 0.008929303847253323, 0.02584141306579113, -0.04849835857748985, 0.046044670045375824, -0.024259842932224274, 0.04111827537417412, -0.024772563949227333, -0.05297539383172989, -0.0017889778828248382, -0.004403669387102127, -0.03953675925731659, 0.051654454320669174, -0.00561857083812356, -0.017573028802871704, -0.03519284725189209, -0.015565074980258942, 0.0001395235740346834, 0.04337963089346886, 0.039682649075984955, 0.1017693281173706, -0.03452945128083229, -0.01639988273382187, -0.023465340957045555, -0.022329052910208702, 0.020340152084827423, -0.01753801852464676, -0.024762138724327087, 0.020081402733922005, -0.04497383534908295, 0.00912916287779808, -0.011927400715649128, 0.0016811436507850885, 0.04497280344367027, 0.010488697327673435, 0.019964415580034256, 0.0023881085216999054, -0.02578318677842617, -0.0023335523437708616, -0.03839430212974548, -0.0008771272841840982, 0.004939539823681116, -0.023188350722193718, 0.010099937207996845, 0.00997646152973175, -0.016950655728578568, -0.021440202370285988, -0.016898132860660553, 0.015348842367529869, 0.013533609919250011, 0.030789270997047424, -0.0009889682987704873, 0.02565315179526806, -0.030821826308965683, -0.03207589313387871, 0.018789125606417656, -0.02043982595205307, 0.0049518924206495285, -0.010881944559514523, -0.0158107690513134, 0.01771574839949608, -0.017685463652014732, 0.026937231421470642, 0.009012458845973015, -0.03928225114941597, -0.008325506001710892, 0.02032732032239437, -0.009557048790156841, -0.016482075676321983, -0.0018602755153551698, -0.06847995519638062, 0.03060714527964592, 0.0447438582777977, -0.0178391020745039, -0.1322828084230423, -0.03984580934047699, 0.022611282765865326, 0.032531946897506714, -0.014981407672166824, 0.0043141767382621765, 0.017519323155283928, -0.0331914983689785, 0.005804136395454407, 0.013530206866562366, -0.028354382142424583, -0.006871244870126247, 0.02697097323834896, -0.017612360417842865, 0.0028785753529518843, -0.013975965790450573, -0.015435106121003628, 0.03920639678835869, 0.01588408090174198, -0.02361876145005226, -0.02632514387369156, 0.04316474124789238, 0.017792344093322754, -0.019879722967743874, -0.013330109417438507, 0.01965242438018322, 0.02719794027507305, 0.01322737243026495, 0.04641655460000038, -0.02852625399827957, 0.007322982419282198, 0.029190218076109886, -0.033462829887866974, 0.026422392576932907, -0.046170078217983246, -0.025624055415391922, -0.004823671653866768, -0.029512125998735428, 0.013022635132074356, -0.011686441488564014, 0.010179087519645691, 0.0000905652268556878, 0.035617124289274216, -0.012697587721049786, -0.005247101653367281, -0.003250633832067251, -0.008990251459181309, 0.0008341454085893929, 0.06500561535358429, -0.012191182002425194, -0.028098301962018013, 0.04359443113207817, 0.022247130051255226, 0.05882246047258377, -0.010855527594685555, -0.03724202886223793, 0.008879509754478931, 0.043146830052137375, 0.04430176690220833, -0.014912361279129982, -0.023267341777682304, 0.014987429603934288, 0.0058655873872339725, -0.011050102300941944, -0.06973949074745178, 0.020393991842865944, 0.025970779359340668, 0.049329206347465515, -0.01924123801290989, 0.01096633542329073, -0.019771572202444077, 0.0005815726472064853, 0.009766165167093277, 0.029664449393749237, -0.01662234403192997, 0.027467461302876472, -0.03184888884425163, -0.0022463365457952023, 0.09604004770517349, 0.0015566019574180245, 0.02832193672657013, -0.03389720618724823, 0.008636332117021084, -0.04004066810011864, -0.020547252148389816, 0.024262383580207825, -0.01179208792746067, -0.021528001874685287, -0.02072160318493843, 0.04019271209836006, 0.02403343841433525, -0.026984142139554024, 0.03394832834601402, -0.012534517794847488, 0.005256286822259426, 0.003805245738476515, 0.07594070583581924, -0.013751606456935406, 0.034092292189598083, 0.004225291311740875, 0.008969740010797977, -0.04695335030555725, 0.01018490456044674, 0.023875702172517776, 0.024644901975989342, 0.03874842822551727, -0.03901486098766327, -0.05094791203737259, 0.00409514456987381, 0.03605002537369728, 0.009875433519482613, -0.014385158196091652, -0.01655142940580845, -0.02521377056837082, -0.01109014917165041, 0.004944137297570705, -0.02546868473291397, -0.0628569945693016, -0.027499856427311897, 0.021095281466841698, -0.036550845950841904, -0.016636498272418976, 0.015386467799544334, 0.0032937207724899054, -0.039785247296094894, -0.010416523553431034, 0.04318231716752052, -0.022458640858530998, 0.007894922979176044, -0.019429078325629234, -0.042194027453660965, -0.030017610639333725, 0.028062395751476288, -0.0025054009165614843, 0.035988472402095795, 0.024077998474240303, 0.022168776020407677, 0.008840559981763363, 0.028546946123242378, -0.07189461588859558, -0.006783490069210529, 0.004032176453620195, 0.026775479316711426, -0.04520847275853157, 0.03163241222500801, -0.012753430753946304, -0.04747844487428665, 0.003331258427351713, -0.01431946363300085, 0.0004049052076879889, 0.00877083744853735, -0.07061585038900375, -0.0004709912755060941, 0.0141504667699337, 0.0022632740437984467, -0.0000500962560181506, 0.018649160861968994, 0.010234322398900986, -0.018460378050804138, 0.026103124022483826, 0.014370042830705643, -0.03036455437541008, -0.044999103993177414, 0.025225453078746796, 0.002431482309475541, 0.00011234312842134386, -0.016476493328809738, -0.030536040663719177, -0.005749895703047514, -0.014227648265659809, -0.023059356957674026, 0.024534648284316063, -0.007407322525978088, -0.0301977451890707, 0.0003000995493493974, 0.00455468101426959, 0.0017631658120080829, 0.025718675926327705, 0.014349659904837608, 0.03936285525560379, 0.01819348707795143, -0.003620402654632926, 0.04046861454844475, -0.0059304386377334595, -0.018289154395461082, -0.02073710970580578, 0.015152260661125183, 0.022214390337467194, 0.01845107227563858, 0.031623147428035736, -0.017595132812857628, -0.014887283556163311, 0.04809184372425079, -0.008696955628693104, 0.03147391602396965, -0.049653030931949615, -0.023238612338900566, 0.010297725908458233, -0.032154716551303864, -0.04103878512978554, -0.007040319498628378, 0.0059653217904269695, -0.037669066339731216, -0.003508840687572956, 0.045025814324617386, 0.035151951014995575, 0.023972835391759872, -0.036746978759765625, 0.003683944698423147, -0.012705852277576923, 0.012887533754110336, -0.01253270823508501, -0.004326559603214264, -0.01581815630197525, -0.013571751303970814, -0.036576803773641586, -0.053334880620241165, 0.0005219968734309077, -0.006852115038782358, 0.01569874957203865, -0.0015560018364340067, -0.007093244697898626, 0.0011392070446163416, 0.006889015436172485, 0.04253775626420975, 0.009222560562193394, 0.022384218871593475, 0.02899625152349472, -0.042277391999959946, 0.04039252921938896, 0.052765898406505585, -0.011793138459324837, 0.023857882246375084, -0.01882748119533062, 0.022504732012748718, 0.03110363893210888, -0.053709764033555984, 0.024965429678559303, 0.031135475262999535, 0.012165184132754803, -0.006047174800187349, 0.00027388360467739403, -0.011101571843028069, -0.01796622760593891, -0.04527808725833893, -0.022574778646230698, 0.09657173603773117, 0.003929392900317907, -0.024764463305473328, 0.005422030109912157, 0.03386566415429115, 0.0029980516992509365, 0.027503812685608864, -0.010781053453683853, 0.03264427185058594, 0.03581640496850014, 0.0071403877809643745, 0.015742357820272446, -0.004719671327620745, -0.02336951158940792, 0.045563705265522, -0.011118202470242977, -0.007892600260674953, 0.02477926015853882, 0.013497606851160526, 0.00216211611405015, -0.016923224553465843, -0.02203647419810295, -0.011929658241569996, 0.013406598940491676, -0.023420119658112526, 0.04571450501680374, 0.04576659947633743, -0.0037245091516524553, 0.02378346398472786, -0.016074348241090775, 0.009541325271129608, 0.05828259885311127, -0.0048341574147343636, 0.029085086658596992, 0.026018967851996422, 0.029505420476198196, -0.0011863278923556209, 0.0010728932684287429, -0.012907232157886028, -0.012101947329938412, 0.04179580509662628, 0.026820611208677292, 0.02434883639216423, 0.013973517343401909, -0.00986911915242672, 0.0009198288316838443, -0.01116867270320654, 0.026068387553095818, -0.035669177770614624, 0.035236239433288574, 0.02117506042122841, -0.02573934569954872, 0.005376915913075209, -0.004711204208433628, 0.05501507967710495, 0.041387252509593964, 0.03011959418654442, -0.0001343336480204016, 0.017240772023797035, 0.02496226504445076, 0.026195233687758446, -0.0046012792736291885, 0.02265799231827259, -0.013077707961201668, -0.0018064475152641535, 0.058100856840610504, -0.006053383462131023, -0.0035173736978322268, 0.023995354771614075, -0.051223695278167725, 0.04278816282749176, -0.0042518810369074345, -0.004625427536666393, -0.0013900228077545762, 0.04204068332910538, -0.04910224303603172, -0.006634247489273548, -0.03063271939754486, -0.016049597412347794, -0.0320524126291275, 0.005384390242397785, 0.0017000794177874923, 0.01222629938274622, -0.029851950705051422, 0.018923651427030563, -0.012567291967570782, 0.008084110915660858, 0.009893438778817654, -0.05278044566512108, 0.02873685397207737, 0.03198868781328201, 0.013537290506064892, -0.005058693699538708, -0.03289094567298889, -0.011974601075053215, -0.028231261298060417, -0.025349097326397896, -0.009430553764104843, 0.00238056224770844, -0.008897692896425724, -0.008651314303278923, 0.0031411482486873865, -0.03522536903619766, 0.0227957870811224, -0.005781683139503002, 0.02364189177751541, -0.022694997489452362, 0.06863163411617279, -0.06212441995739937, -0.03909545764327049, -0.022124184295535088, 0.008075334131717682, -0.0011904644779860973, -0.02533101476728916, 0.013366728089749813, -0.02044088952243328, 0.016253799200057983, -0.053117185831069946, -0.046730056405067444, -0.0026736101135611534, -0.01226618979126215, -0.0037978561595082283, 0.023500533774495125, 0.0060369777493178844, -0.004448859486728907, 0.0063893795013427734, 0.015676308423280716, 0.02271270751953125, -0.00572162214666605, 0.005224374122917652, 0.0066320085898041725, -0.011039240285754204, -0.03667399287223816, 0.006915652193129063, 0.05532071739435196, 0.02208429016172886, 0.012482848018407822, 0.03597135469317436, 0.04376146197319031, -0.024911442771553993, -0.014510477893054485, -0.016445273533463478, 0.03211972862482071, 0.0024707696866244078, -0.04439768195152283, -0.05610247328877449, -0.0008623150642961264, -0.049683574587106705, 0.012544823810458183, -0.0019696864765137434, -0.04376457631587982, -0.02509346418082714, -0.03013138845562935, -0.01286222878843546, -0.05754886567592621, 0.01917055994272232, 0.02578025497496128, 0.018041541799902916, 0.03598996624350548, -0.03316926583647728, 0.023669419810175896, 0.001704417634755373, 0.02919836901128292, 0.003291469067335129, 0.03530017286539078, 0.03841160237789154, -0.008038311265408993, -0.04715822637081146, 0.034700457006692886, -0.029079757630825043, -0.012588132172822952, 0.00034207466524094343, 0.04245920479297638, -0.01634308509528637, -0.025514034554362297, 0.016476495191454887, 0.006868793163448572, -0.0033751248847693205, 0.021852504462003708, -0.0068297735415399075, -0.054151058197021484, 0.02578812465071678, -0.000995611771941185, -0.03943941369652748, 0.03294792026281357, -0.034358490258455276, 0.0006077534635551274, 0.02479616366326809, -0.02165321260690689, 0.010880942456424236, -0.017522944137454033, -0.059222735464572906, 0.023766396567225456, 0.0029283997137099504, -0.03736497834324837, -0.023309368640184402, -0.028157971799373627, 0.02928006462752819, -0.061611805111169815, -0.03821394219994545, 0.0034130068961530924, 0.00829570833593607, -0.019909391179680824, -0.015955748036503792, 0.005529494024813175, -0.010795725509524345, 0.040832724422216415, 0.036163121461868286, -0.018483595922589302, 0.05670925974845886, -0.0005566727486439049, -0.06156435236334801, -0.02740710973739624, 0.035837650299072266 ]
Gradio-Lite: Serverless Gradio Running Entirely in Your Browser
abidlabs
October 19, 2023
gradio-lite
gradio, open-source, serverless
https://huggingface.co/blog/gradio-lite
Limitations * Currently, the biggest limitation in using @gradio/lite is that your Gradio apps will generally take more time (usually 5-15 seconds) to load initially in the browser. This is because the browser needs to load the Pyodide runtime before it can render Python code. * Not every Python package is supported by Pyodide. While gradio and many other popular packages (including numpy, scikit-learn, and transformers-js) can be installed in Pyodide, if your app has many dependencies, its worth checking whether the dependencies are included in Pyodide, or can be installed with micropip.
[ 0.020991360768675804, 0.032707978039979935, 0.08183114230632782, 0.062008049339056015, 0.047877419739961624, 0.09247808903455734, 0.0656389594078064, 0.04921584203839302, 0.03160658851265907, -0.04405856505036354, -0.05031794309616089, 0.02027122862637043, -0.021266212686896324, 0.042347535490989685, 0.027214284986257553, 0.0313456691801548, 0.06608818471431732, -0.03997595235705376, -0.07179021090269089, -0.0004459676565602422, 0.005850799847394228, -0.06241517886519432, -0.033979449421167374, 0.015566407702863216, -0.053994402289390564, -0.0574614517390728, -0.04932752251625061, 0.032941851764917374, -0.09339260309934616, 0.0013445798540487885, -0.11738856136798859, -0.0587613470852375, 0.005863255821168423, -0.03634898364543915, 0.014986664056777954, 0.05380888655781746, -0.06625261157751083, 0.093797966837883, 0.053336769342422485, -0.032722700387239456, 0.008449462242424488, -0.045619744807481766, -0.09664234519004822, 0.04987603798508644, -0.022387215867638588, 0.006686090491712093, -0.1610783189535141, 0.0281227920204401, -0.014588872902095318, -0.028136594220995903, -0.09980262070894241, 0.04556690528988838, -0.025906173512339592, -0.020805496722459793, -0.036714620888233185, 0.032382696866989136, 0.028450869023799896, -0.01550394669175148, -0.0027888731565326452, -0.009713112376630306, -0.016703393310308456, -0.010840131901204586, -0.06166345998644829, 0.02822575531899929, -0.007352440617978573, 0.0053550368174910545, -0.05722900480031967, 0.019408632069826126, -0.03728852421045303, 0.01424848847091198, 0.015917956829071045, -0.016669517382979393, -0.05438332259654999, -0.058258648961782455, 0.040419742465019226, -0.04359867796301842, -0.05320216715335846, 0.09072839468717575, 0.040307849645614624, 0.047551825642585754, 0.06869148463010788, 0.028084632009267807, 0.05798696354031563, 0.004634222015738487, 0.05912104621529579, -0.0321253277361393, 0.01584530808031559, 0.02503320947289467, -0.04562588408589363, 0.027917563915252686, 0.026027554646134377, -0.06940075755119324, 0.00850746314972639, 0.020074443891644478, 0.04351137951016426, -0.02621198259294033, -0.02412622980773449, 0.06850538402795792, 0.03588899224996567, 0.05021892860531807, -0.018504410982131958, -0.059516407549381256, -0.0660775676369667, -0.013733301311731339, 0.005184936802834272, 0.008245470933616161, -0.08097649365663528, -0.007926851511001587, -0.019234875217080116, 0.07014789432287216, -0.08122629672288895, 0.027563562616705894, -0.006863923277705908, 0.027819309383630753, -0.021315930411219597, 0.004585297778248787, 0.01559335645288229, 0.047488823533058167, -0.03154205530881882, -0.0003341298142913729, -0.024087853729724884, 0.044841423630714417, 0.0010760970180854201, 0.06708186119794846, 0.042636264115571976, 0.11925536394119263, 0.03523039072751999, 0.016754193231463432, -0.002939269645139575, -0.049739986658096313, 0.054457202553749084, 0.022625280544161797, 0.033106185495853424, -0.011374707333743572, -0.0028562378138303757, -0.06609532237052917, -0.00948334950953722, -0.02552621439099312, -0.014553428627550602, -0.07139024883508682, -0.025246435776352882, 0.0702841654419899, -0.03804125264286995, 0.05182376131415367, 0.027109891176223755, -0.10966964811086655, 0.005686386488378048, 0.03909699246287346, -0.03655092790722847, -0.05140165612101555, -0.1083105280995369, 0.07869486510753632, -0.033149369060993195, 0.002793318824842572, -0.061400238424539566, 0.045511551201343536, -0.02407846599817276, 0.026059670373797417, -0.038663871586322784, -0.009457842446863651, 0.029185138642787933, -0.002223747782409191, -0.05212414637207985, -0.06280234456062317, 0.11761832237243652, 0.04454249516129494, -0.013661585748195648, -0.01690027490258217, 0.09664309024810791, -0.0020795988384634256, -0.05295342206954956, -0.008432791568338871, 0.03816807642579079, -0.01989784836769104, -0.004009683150798082, 0.05028542876243591, 0.0399942509829998, 0.021084805950522423, -0.011059054173529148, -0.0032374009024351835, 0.01134392898529768, 0.004649848211556673, 0.009466545656323433, 0.03949626162648201, -0.049843985587358475, -0.029419824481010437, 0.03424312174320221, -0.08833543211221695, -0.00038046471308916807, -0.044210657477378845, -0.03976829722523689, -0.012997778132557869, 0.007600964978337288, -0.06920652836561203, 0.06497544795274734, -0.023495227098464966, 0.05117544159293175, 0.061386317014694214, 0.022865381091833115, 0.05342869833111763, 0.04807676002383232, -0.0028244685381650925, 0.0844409316778183, -0.0009111249819397926, -0.04175131022930145, 0.032624904066324234, 0.013845553621649742, 0.018428480252623558, 0.02212943136692047, -0.016670556738972664, 0.015911763533949852, -0.1079447939991951, 0.06687197834253311, -0.02208302542567253, 0.0075736637227237225, 0.09561798721551895, 0.03266826272010803, -0.013363833539187908, -0.00970764085650444, -0.007838748395442963, 0.08119416981935501, -0.040351688861846924, -0.028704917058348656, 0.011097816750407219, -0.0460088811814785, 0.06203823909163475, 0.07664402574300766, -0.03252215310931206, 0.11542502790689468, -0.09532003104686737, 0.015146143734455109, -0.007466156501322985, -0.0154300881549716, 0.09630221128463745, -0.024118810892105103, -0.012556320056319237, -0.03390219435095787, -0.03208310529589653, 0.04659130796790123, 0.007598990574479103, 0.035008929669857025, -0.0013267234899103642, -0.011197086423635483, 0.03514787554740906, -0.026726970449090004, -0.05842413380742073, 0.038134120404720306, 0.023386677727103233, 0.02025246061384678, 0.0024897605180740356, -0.013127582147717476, -0.009813542477786541, 0.030327189713716507, 0.061015043407678604, 0.04704442620277405, 0.01637040078639984, -0.013988331891596317, -0.050262678414583206, -0.015341929160058498, 0.031451914459466934, 0.0051110414788126945, -0.015960698947310448, 0.02913692407310009, -0.003804711624979973, 0.009920328855514526, -0.01845957338809967, -0.013918785378336906, 0.0034044880885630846, 0.03772200271487236, -0.0013696514070034027, 0.006913961376994848, -0.03178158774971962, -0.015520618297159672, 0.00022031139815226197, 0.010662210173904896, 0.03527923300862312, -0.013856655918061733, -0.016904331743717194, -0.018373673781752586, -0.02104566991329193, -0.0159769169986248, -0.020127635449171066, 0.020160691812634468, 0.0020086851436644793, 0.0016751840012148023, -0.023153651505708694, -0.023965470492839813, -0.032566625624895096, -0.061395637691020966, 0.024409666657447815, -0.01732269674539566, 0.02581842429935932, -0.0076136807911098, -0.02361406199634075, 0.013334440067410469, -0.03702499344944954, 0.04896298795938492, -0.014141817577183247, -0.020606182515621185, -0.03395237401127815, -0.015429466031491756, 0.003123000031337142, 0.0010546811390668154, 0.019916923716664314, -0.05126176029443741, 0.01218874566257, 0.03927168622612953, -0.02342476323246956, -0.10978471487760544, -0.028025882318615913, 0.008535143919289112, 0.03532450273633003, 0.014020727016031742, 0.013690968975424767, 0.05165983736515045, -0.01612863317131996, 0.01958385296165943, 0.00227352068759501, -0.046270620077848434, -0.0119831757619977, 0.02445942722260952, 0.001008350751362741, 0.012019606307148933, -0.015905652195215225, 0.011277181096374989, 0.04636427015066147, 0.05443313717842102, -0.0012701317900791764, -0.009300092235207558, 0.06791915744543076, -0.017093045637011528, -0.03683578595519066, -0.059971749782562256, 0.04221570864319801, 0.02390398643910885, 0.011053604073822498, 0.014758591540157795, -0.04240948706865311, -0.0038506772834807634, -0.02895197458565235, -0.035161253064870834, 0.01642543449997902, -0.04585278034210205, -0.01920951157808304, -0.01880551688373089, 0.018073976039886475, 0.024394402280449867, 0.013027184642851353, -0.0017195212421938777, 0.007344760932028294, 0.022177377715706825, 0.008664552122354507, 0.009251588955521584, -0.006501819472759962, -0.025217760354280472, 0.0024106535129249096, 0.03597041219472885, -0.0073867067694664, -0.018543515354394913, 0.028134124353528023, 0.002140509197488427, 0.08542574197053909, 0.0008420326048508286, -0.014032327570021152, 0.03478732332587242, 0.054139137268066406, 0.03299316018819809, 0.0016460394253954291, -0.018228566274046898, 0.03177028149366379, 0.012304824776947498, 0.0027303944807499647, -0.03193163499236107, 0.015877684578299522, 0.029948847368359566, 0.030175624415278435, -0.001060809358023107, -0.04615821689367294, -0.021546222269535065, 0.027407921850681305, 0.038689401000738144, 0.018797580152750015, 0.033226002007722855, -0.013224157504737377, -0.001666698488406837, -0.024640638381242752, 0.06861533969640732, 0.028130415827035904, 0.047972049564123154, -0.01943245157599449, -0.009624498896300793, -0.04146614298224449, -0.03396302089095116, -0.005195022560656071, 0.010489679872989655, -0.04748539254069328, 0.015211357735097408, 0.05048352852463722, 0.02865665964782238, -0.028465671464800835, 0.03111470490694046, -0.02005605958402157, -0.007577318698167801, 0.00811504852026701, 0.07367196679115295, -0.017510974779725075, 0.009224372915923595, -0.014948341995477676, -0.02800437994301319, -0.04329369217157364, 0.0066681732423603535, -0.006576954387128353, -0.002071729628369212, 0.013841615058481693, -0.027253154665231705, -0.01028368715196848, 0.004634059965610504, -0.008768944069743156, 0.026433732360601425, 0.025696784257888794, -0.002680639736354351, -0.01254611648619175, 0.021384071558713913, 0.03480710834264755, 0.0037130266427993774, -0.04265739768743515, -0.03561094403266907, 0.048788972198963165, -0.005558330100029707, -0.006493671797215939, -0.004705086816102266, -0.006317828316241503, -0.007884465157985687, -0.014879637397825718, 0.00786517933011055, -0.008870520628988743, 0.04988381639122963, -0.0018368844175711274, -0.03524548560380936, -0.008060615509748459, -0.018003592267632484, 0.010859244503080845, 0.032403625547885895, -0.017918216064572334, 0.07018070667982101, 0.006818319205194712, 0.03459581360220909, -0.05879601463675499, -0.013256912119686604, 0.002804207382723689, -0.009567921049892902, -0.02677033841609955, 0.018557488918304443, 0.0037571873981505632, -0.05041578784584999, 0.02252165786921978, -0.07250094413757324, 0.031880732625722885, -0.009065593592822552, -0.05241992697119713, 0.007498153951019049, 0.03244940936565399, 0.017223162576556206, -0.022742984816432, -0.005028476007282734, 0.014584733173251152, -0.025287700816988945, 0.019732244312763214, 0.01485602930188179, -0.03389912471175194, -0.040157534182071686, 0.02292175032198429, 0.013535299338400364, -0.013123936019837856, 0.010925441980361938, -0.032915592193603516, 0.013870812952518463, -0.01473916694521904, -0.025104383006691933, 0.06370769441127777, -0.008171772584319115, 0.001271827844902873, 0.0052315122447907925, 0.01828705705702305, 0.00381840905174613, -0.007243895437568426, 0.020285049453377724, 0.021194618195295334, -0.004405107349157333, -0.04799883812665939, 0.07283981889486313, -0.01414363645017147, -0.031941305845975876, -0.011049997061491013, 0.013096585869789124, 0.027711201459169388, 0.020976712927222252, 0.02152121067047119, 0.006979526486247778, -0.026302844285964966, 0.024114150553941727, -0.030342817306518555, 0.03585045039653778, -0.035662535578012466, -0.03296901658177376, 0.03902863338589668, 0.02373623475432396, -0.05226900056004524, 0.02787967212498188, -0.012345509603619576, -0.004732054658234119, 0.01850801147520542, 0.020200734958052635, 0.037432510405778885, 0.0016508509870618582, -0.06422826647758484, 0.018551554530858994, -0.019870424643158913, 0.013577250763773918, -0.011173673905432224, -0.014040330424904823, 0.002173793502151966, -0.02488805167376995, -0.015528456307947636, -0.02946583367884159, 0.0014567234320566058, 0.016413528472185135, 0.044277071952819824, -0.04023997113108635, 0.0146766547113657, -0.007443068083375692, 0.030100565403699875, 0.049150656908750534, 0.028508048504590988, -0.006615667138248682, -0.0007337738061323762, -0.03810169920325279, 0.03230215609073639, 0.07181098312139511, -0.0028681138064712286, 0.014968118630349636, -0.008739953860640526, -0.013123641721904278, 0.028145702555775642, 0.000904542685020715, 0.0124050909653306, -0.0170148778706789, -0.012748359702527523, -0.024910304695367813, 0.0016363633330911398, -0.008744430728256702, 0.012142916209995747, -0.028462598100304604, -0.009177193976938725, 0.04789968952536583, -0.010690269991755486, -0.046005237847566605, 0.00264560105279088, 0.044086191803216934, -0.01952146366238594, 0.03958391025662422, -0.031079325824975967, 0.01691746897995472, 0.016337892040610313, 0.012205870822072029, 0.005148958880454302, 0.02926701307296753, 0.013612735085189342, 0.029985904693603516, -0.015125961042940617, 0.004931305069476366, 0.01839308626949787, 0.029860377311706543, -0.009958131238818169, -0.007551801390945911, -0.07433735579252243, -0.018645450472831726, 0.024115175008773804, -0.03120991960167885, 0.048826687037944794, 0.031259648501873016, 0.025965504348278046, 0.00005517989120562561, -0.047871485352516174, 0.020549826323986053, 0.04089069366455078, -0.002493757288902998, 0.008506707847118378, 0.05385985225439072, 0.025367211550474167, 0.0013821021420881152, -0.028255296871066093, -0.01594550907611847, -0.010286527685821056, 0.06938013434410095, 0.01778591237962246, 0.024184145033359528, 0.00354749895632267, -0.018883779644966125, 0.03719277307391167, -0.019617794081568718, 0.003630828345194459, -0.037188220769166946, 0.013918060809373856, 0.014540919102728367, -0.025196967646479607, 0.005025906953960657, 0.000059530502767302096, 0.04283535107970238, 0.032722216099500656, 0.033012036234140396, 0.025413626804947853, 0.016155291348695755, -0.001861761324107647, 0.027991848066449165, 0.01444698590785265, 0.0194842591881752, -0.02271554432809353, 0.00397994089871645, 0.06078748032450676, 0.03099534660577774, 0.01326772104948759, 0.041937511414289474, 0.006667884532362223, -0.004246877506375313, 0.024650173261761665, -0.010107495822012424, 0.03055870346724987, 0.04173547402024269, -0.026288606226444244, 0.0011406465200707316, -0.027959158644080162, -0.04075279086828232, -0.006534932181239128, 0.03617794066667557, 0.009482749737799168, 0.013660475611686707, -0.01628834940493107, 0.011618862859904766, -0.01176561787724495, -0.018997404724359512, 0.02237350307404995, 0.005249317269772291, 0.0068806372582912445, 0.0010878947796300054, 0.015146557241678238, -0.011394166387617588, -0.025474144145846367, 0.01087864302098751, -0.014373145066201687, -0.0008093894575722516, 0.03892524167895317, -0.03529488295316696, 0.006213922519236803, 0.0072431378066539764, -0.02981450781226158, -0.004954627715051174, 0.02928084321320057, -0.01988760568201542, 0.007651260122656822, -0.07808172702789307, 0.0623306967318058, -0.07936826348304749, -0.007834797725081444, 0.03629150986671448, -0.010767812840640545, -0.0065857842564582825, -0.0366826131939888, 0.04358894005417824, -0.011987466365098953, -0.01435483805835247, -0.02525494247674942, -0.04414056986570358, 0.018880609422922134, 0.0030329592991620302, -0.022115636616945267, 0.03567621856927872, -0.00965921487659216, 0.018020419403910637, -0.016590656712651253, 0.0010482958750799298, 0.05124742165207863, 0.037273358553647995, 0.0021046798210591078, 0.041755348443984985, 0.01758003421127796, -0.008029945194721222, -0.0055122654885053635, 0.05605678632855415, 0.032314952462911606, 0.0305375587195158, 0.006634256336838007, 0.013392149470746517, -0.03598698601126671, -0.02026830054819584, -0.017458511516451836, 0.03540932759642601, 0.009096735157072544, -0.04293341934680939, -0.041203293949365616, -0.03956479951739311, -0.00420183502137661, 0.008597705513238907, -0.04059051722288132, -0.05213255435228348, -0.024329712614417076, 0.019768154248595238, -0.03034389577805996, -0.002629471244290471, -0.0300274807959795, -0.01555707398802042, 0.059323400259017944, -0.0011095816735178232, -0.02335410565137863, 0.023776113986968994, 0.03561005741357803, -0.005942310206592083, -0.016953282058238983, 0.02186840958893299, 0.02093379944562912, -0.023615753278136253, -0.056299418210983276, 0.00423515634611249, -0.02099899761378765, -0.015246023423969746, -0.031565625220537186, -0.0039324406534433365, -0.021299567073583603, -0.027193058282136917, -0.021107623353600502, 0.04128308966755867, -0.011263270862400532, 0.02860691212117672, -0.0027945558540523052, -0.052354779094457626, 0.04155464097857475, 0.004162417259067297, -0.03446078673005104, 0.024042882025241852, -0.00001361520935461158, -0.024399448186159134, 0.028836805373430252, -0.0377793163061142, 0.01543472334742546, 0.0006744310376234353, -0.023420773446559906, 0.022691672667860985, -0.018522489815950394, -0.06093539670109749, -0.05209881439805031, -0.07826036214828491, 0.057456452399492264, -0.042020946741104126, -0.01763112097978592, 0.009890338405966759, -0.013966299593448639, -0.017451828345656395, 0.001565776183269918, 0.0018021108116954565, -0.0053655533120036125, 0.022835098206996918, 0.0657535195350647, -0.0243089459836483, 0.02134549617767334, 0.01677768863737583, -0.07040397822856903, -0.03593800589442253, 0.05212515965104103 ]
Gradio-Lite: Serverless Gradio Running Entirely in Your Browser
abidlabs
October 19, 2023
gradio-lite
gradio, open-source, serverless
https://huggingface.co/blog/gradio-lite
2. Create the <gradio-lite> tags Somewhere in the body of your HTML page (wherever you'd like the Gradio app to be rendered), create opening and closing <gradio-lite> tags. html <html> <head> <script type="module" crossorigin src="https://cdn.jsdelivr.net/npm/@gradio/lite/dist/lite.js"></script> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@gradio/lite/dist/lite.css" /> </head> <body> <gradio-lite> </gradio-lite> </body> </html> Note: you can add the theme attribute to the <gradio-lite> tag to force the theme to be dark or light (by default, it respects the system theme). E.g. html <gradio-lite theme="dark"> ... </gradio-lite>
[ 0.04295356571674347, 0.04742232710123062, 0.10377402603626251, -0.0012779596727341413, 0.1189575046300888, -0.0021165721118450165, 0.07161577045917511, 0.040020063519477844, 0.007165432441979647, -0.04165525734424591, -0.08447746187448502, 0.06926780194044113, -0.012865593656897545, 0.07244914025068283, 0.011049223132431507, 0.06820742785930634, 0.044551003724336624, -0.06648548692464828, -0.0332370325922966, -0.005544885061681271, -0.04029308259487152, -0.03058646060526371, -0.04591602459549904, 0.03517166152596474, 0.010174783878028393, -0.02958102338016033, -0.005635425914078951, 0.03208208829164505, -0.08109474182128906, 0.02669510990381241, -0.007822147570550442, -0.03739149495959282, -0.00254843826405704, -0.07682615518569946, 0.017737992107868195, 0.07821694761514664, -0.003421237925067544, 0.07473618537187576, 0.017897143959999084, -0.026315324008464813, -0.01236214954406023, -0.0711759403347969, -0.09121173620223999, 0.012442422099411488, -0.027156824246048927, -0.017705311998724937, -0.20751114189624786, 0.04038955643773079, -0.03379401937127113, 0.03155072033405304, -0.05267835408449173, 0.011257730424404144, -0.01970270276069641, -0.028944797813892365, -0.05206793546676636, 0.006240531802177429, 0.0054568820632994175, 0.02267017774283886, 0.00009671973384683952, -0.03361156955361366, 0.047906216233968735, 0.028691256418824196, -0.08525989204645157, 0.08317768573760986, 0.048440419137477875, 0.018196696415543556, -0.08005791157484055, 0.016082923859357834, -0.0053565651178359985, 0.007361300755292177, -0.006078912876546383, 0.021740714088082314, -0.013397788628935814, -0.11694807559251785, 0.03625773638486862, 0.01812814734876156, -0.05041435360908508, 0.04294716194272041, -0.001984682399779558, 0.07696445286273956, 0.06895065307617188, 0.03797677159309387, 0.0657954141497612, 0.03858006373047829, 0.010025877505540848, 0.0029927962459623814, 0.010072626173496246, 0.0235236007720232, 0.01202129852026701, 0.03491896390914917, 0.005663049407303333, -0.10508237779140472, -0.01226323563605547, 0.08022432029247284, 0.08879853785037994, -0.018009912222623825, 0.025006966665387154, 0.028322406113147736, 0.056018486618995667, 0.05116398259997368, 0.006669147871434689, -0.024084176868200302, -0.035750437527894974, -0.08502084016799927, -0.04844531789422035, -0.007965732365846634, -0.026704341173171997, -0.03521374613046646, 0.02424139529466629, 0.0507851243019104, -0.04782852157950401, -0.002898003440350294, 0.017935046926140785, 0.014841247349977493, -0.0068175033666193485, 0.0732254758477211, 0.024692483246326447, 0.005898843519389629, -0.02858397737145424, 0.010317583568394184, 0.016267642378807068, 0.06972979754209518, 0.01749490201473236, 0.09938175231218338, 0.024981334805488586, 0.04168357700109482, 0.015374919399619102, 0.020701229572296143, -0.0007147224387153983, -0.04685097932815552, 0.039924122393131256, 0.06328874081373215, -0.009754655882716179, -0.002918233862146735, 0.0029166957829147577, -0.0320814847946167, 0.01478506624698639, -0.015999509021639824, 0.052937719970941544, -0.035801101475954056, 0.00030407632584683597, 0.05196303874254227, -0.017329059541225433, 0.04985261708498001, 0.010928777977824211, -0.08064720779657364, 0.039581190794706345, 0.0038014338351786137, -0.026197558268904686, 0.025933926925063133, 0.04162460193037987, 0.07495371997356415, -0.051488474011421204, -0.020701345056295395, -0.07456496357917786, 0.05558100342750549, -0.029018910601735115, 0.016132552176713943, -0.05595729127526283, -0.016281310468912125, 0.029565736651420593, 0.04069165885448456, -0.022539274767041206, -0.022039363160729408, 0.05443452298641205, 0.046919845044612885, -0.04681466147303581, 0.02133750542998314, 0.11723975092172623, -0.05268574133515358, -0.07229211926460266, -0.013982906937599182, 0.024964679032564163, -0.019431553781032562, -0.006141223944723606, 0.054402317851781845, 0.07689134031534195, 0.01991715095937252, -0.029720593243837357, -0.0024873006623238325, -0.01623479835689068, 0.05284572392702103, 0.028041694313287735, -0.026336200535297394, -0.05948442220687866, -0.05561142414808273, -0.001368008553981781, -0.10397103428840637, -0.021347183734178543, -0.04397933930158615, -0.06423510611057281, -0.00392859848216176, 0.0043906900100409985, -0.06550467014312744, 0.00022805701883044094, 0.006549880839884281, 0.000037867052014917135, 0.044041574001312256, 0.03607561066746712, 0.09811275452375412, 0.05300811678171158, -0.022158833220601082, 0.07253357768058777, -0.007198382634669542, -0.06618534028530121, 0.0012856032699346542, 0.03510652482509613, -0.017365748062729836, 0.025107882916927338, -0.01295317243784666, -0.01643737033009529, -0.08676370233297348, 0.11343752592802048, -0.01105484738945961, 0.014623340219259262, 0.040875960141420364, 0.03932185471057892, 0.04094124585390091, -0.006836318410933018, 0.05350134149193764, 0.07703618705272675, 0.0012122695334255695, -0.027847742661833763, 0.04413487762212753, -0.014040989801287651, 0.03885449469089508, 0.07088840752840042, -0.06281854212284088, 0.132296621799469, -0.0487956702709198, -0.009815259836614132, -0.0010892371647059917, -0.03257650509476662, 0.07545610517263412, -0.023088784888386726, -0.008030866272747517, -0.001536020776256919, -0.02180834487080574, 0.046879325062036514, -0.050275735557079315, 0.03755677863955498, -0.05340689420700073, -0.045447301119565964, -0.023191353306174278, -0.00004215955414110795, -0.04239635542035103, 0.033534929156303406, 0.039120450615882874, 0.04436546191573143, -0.03840048983693123, 0.004057078156620264, -0.058631546795368195, 0.010466823354363441, 0.04143834486603737, 0.08367136120796204, -0.02007182128727436, -0.011353850364685059, 0.012404624372720718, -0.027477985247969627, 0.035146065056324005, -0.017686747014522552, -0.02508288249373436, 0.03653695061802864, 0.012560781091451645, -0.0032344565261155367, 0.005722234025597572, -0.018640493974089622, 0.02785477787256241, 0.011533195152878761, 0.01942085660994053, 0.023490186780691147, -0.006027461029589176, -0.028896324336528778, -0.04441210255026817, -0.014368151314556599, 0.014038353227078915, -0.005937847308814526, -0.018593765795230865, 0.011002463288605213, -0.015106397680938244, -0.022393034771084785, 0.010949329473078251, 0.009825277142226696, 0.028473172336816788, 0.001222913502715528, 0.017619531601667404, 0.0069563561119139194, -0.02438231371343136, -0.021924687549471855, 0.029084334149956703, -0.014550029300153255, 0.004570519085973501, 0.0023580638226121664, 0.024151554331183434, -0.007173243444412947, -0.04422629997134209, 0.03743492066860199, 0.003371014492586255, -0.042274657636880875, -0.0029587403405457735, 0.006397650111466646, -0.02157694660127163, 0.004956474062055349, -0.025937749072909355, -0.03610802814364433, 0.04114235192537308, 0.050956230610609055, -0.033406272530555725, -0.11175540089607239, -0.020726194605231285, 0.006038148887455463, 0.046842873096466064, -0.010016830638051033, -0.013877523131668568, 0.0001014780646073632, -0.05193842202425003, -0.008734436705708504, -0.017992116510868073, -0.03316556662321091, -0.005481770262122154, 0.009200237691402435, -0.0036795479245483875, -0.001970035256817937, -0.012316754087805748, -0.03427797183394432, 0.05969361588358879, 0.03394322469830513, -0.03974589332938194, -0.016918638721108437, 0.03433145210146904, 0.003912683576345444, -0.04074440523982048, -0.021921304985880852, 0.02588704042136669, 0.038132380694150925, 0.03310125321149826, 0.033854469656944275, -0.024425804615020752, 0.011147166602313519, -0.004368684254586697, -0.02537268027663231, 0.005206339061260223, -0.016500893980264664, 0.012389438226819038, 0.02387017011642456, -0.04218347743153572, 0.00520793441683054, -0.00024219918122980744, 0.012639927677810192, 0.050207480788230896, 0.021098490804433823, 0.026798950508236885, 0.026706639677286148, -0.032644372433423996, 0.0018710517324507236, -0.0060155573301017284, 0.06145073473453522, 0.006994750816375017, -0.02017778530716896, 0.02658531814813614, 0.018019599840044975, 0.047292642295360565, -0.02726213075220585, -0.05054141581058502, 0.029428482055664062, 0.04999447241425514, 0.04724409058690071, 0.015153282321989536, -0.013302150182425976, 0.00017254160775337368, -0.026674015447497368, -0.000026374265871709213, -0.0318894200026989, 0.020599277690052986, 0.019577311351895332, 0.03768828511238098, -0.01696053519845009, 0.018796086311340332, -0.000790408521424979, 0.0063621303997933865, 0.007706327363848686, 0.021027710288763046, -0.0066468860022723675, -0.022728407755494118, -0.039989497512578964, 0.012579803355038166, 0.0743522197008133, -0.00432190764695406, 0.058827321976423264, 0.00790981575846672, 0.008691894821822643, -0.043090373277664185, -0.00738915242254734, 0.02913251332938671, -0.008031425066292286, -0.006132807582616806, 0.00612662686035037, 0.002666888991370797, 0.02145932801067829, -0.03202454000711441, 0.026234062388539314, -0.021746907383203506, -0.011901875026524067, -0.023500928655266762, 0.06334630399942398, -0.03195677325129509, 0.021747570484876633, -0.022181043401360512, -0.0018546588253229856, -0.03476100414991379, 0.037077367305755615, 0.005474494770169258, 0.016284409910440445, 0.0392802394926548, -0.03013625368475914, -0.015471178106963634, 0.01202385500073433, 0.007568059954792261, 0.02066865563392639, 0.019746318459510803, -0.00372599926777184, -0.01438684482127428, -0.02686408907175064, 0.020815234631299973, -0.0015138217713683844, -0.02535800263285637, -0.006744921673089266, 0.038386743515729904, -0.04585861787199974, -0.035174284130334854, 0.03394273668527603, 0.007875089533627033, -0.016840863972902298, -0.008669680915772915, 0.03968893364071846, -0.02510029263794422, 0.018005354329943657, -0.018418367952108383, -0.03411922976374626, -0.04662831872701645, 0.014143026433885098, 0.0013254855293780565, 0.023087549954652786, 0.01631682552397251, 0.055307935923337936, 0.013010816648602486, 0.06613865494728088, -0.06591007113456726, -0.0013471200363710523, 0.0174800306558609, 0.017426488921046257, -0.05983779579401016, 0.029879366979002953, -0.007326060906052589, -0.06862544268369675, 0.0059618172235786915, -0.038505516946315765, -0.0056623127311468124, 0.01493039634078741, -0.017548145726323128, -0.0034324065782129765, 0.02575591951608658, -0.0043011619709432125, -0.02862001210451126, 0.003960618749260902, 0.0185699425637722, -0.002457079943269491, -0.014720099046826363, 0.006152607966214418, -0.029070913791656494, -0.04312458634376526, 0.03055397793650627, 0.009059250354766846, 0.016698041930794716, 0.0033108156640082598, -0.046614523977041245, -0.019078640267252922, 0.02068048156797886, -0.01944669336080551, 0.05862171947956085, -0.0369420200586319, -0.048760492354631424, -0.00543181924149394, -0.0027019961271435022, -0.008561363443732262, 0.012306532822549343, 0.023656846955418587, 0.006237491965293884, 0.03292009234428406, 0.021702218800783157, 0.02209969237446785, -0.014753704890608788, -0.04276123270392418, -0.021968301385641098, 0.0016897006426006556, 0.000626811059191823, 0.03420563414692879, 0.014918108470737934, -0.006116754841059446, -0.042031142860651016, 0.0369114950299263, -0.04097047448158264, 0.04327739402651787, -0.04829365760087967, -0.040615327656269073, 0.008887795731425285, 0.008159988559782505, -0.01878933049738407, 0.016071941703557968, 0.00427455548197031, -0.03268098458647728, 0.03047899156808853, -0.004301075357943773, 0.0016607142752036452, 0.0244496650993824, -0.04153251275420189, 0.005943098571151495, 0.023241061717271805, -0.00781765952706337, -0.02083118073642254, 0.002418280579149723, -0.022957462817430496, -0.009460436180233955, -0.02773309499025345, -0.05492202937602997, -0.03875643387436867, -0.010600038804113865, 0.052923645824193954, -0.0014004941331222653, 0.02003784291446209, -0.03141330927610397, 0.020322877913713455, 0.009939659386873245, 0.0016750136855989695, 0.014294642955064774, 0.013343136757612228, -0.032205842435359955, 0.02152150683104992, 0.062033891677856445, 0.003219706006348133, 0.036204706877470016, 0.015643058344721794, 0.002312146360054612, 0.05265980586409569, -0.038726259022951126, -0.0219267625361681, -0.0032600881531834602, -0.0046164593659341335, -0.014008798636496067, -0.010962561704218388, -0.053867243230342865, -0.03640596196055412, -0.028214285150170326, -0.020784758031368256, 0.0708204135298729, 0.02844046987593174, -0.03085937909781933, -0.0013084273086860776, 0.03467070311307907, -0.012693362310528755, 0.03282860666513443, -0.027077918872237206, -0.0035047344863414764, 0.014565561898052692, 0.01025464665144682, 0.0057892282493412495, 0.014898169785737991, -0.00942785944789648, 0.007451364770531654, -0.02459433116018772, -0.029897844418883324, 0.017286809161305428, 0.05232765153050423, 0.006276092026382685, -0.045180682092905045, -0.031020205467939377, -0.045647259801626205, 0.03649195283651352, -0.03343280777335167, 0.0698578953742981, 0.054030369967222214, -0.006351846735924482, 0.04787931591272354, -0.03392776846885681, -0.006395063828676939, 0.026510735973715782, 0.010980410501360893, 0.02072177827358246, 0.003211952280253172, -0.02178226225078106, 0.005929498001933098, -0.012562359683215618, -0.010812709107995033, -0.03228988125920296, 0.023472927510738373, 0.013393864966928959, 0.04621875286102295, 0.009781232103705406, -0.009429906494915485, -0.002802150323987007, 0.0033610775135457516, -0.0030459603294730186, -0.03708820044994354, 0.05006371811032295, 0.007696368265897036, 0.0004721985606011003, -0.015979569405317307, -0.034677933901548386, 0.053293827921152115, 0.005969807039946318, 0.034521013498306274, -0.009425975382328033, 0.009241025894880295, 0.021708905696868896, 0.03901556879281998, -0.008841673843562603, 0.025939006358385086, 0.01647106744349003, -0.030678002163767815, 0.06409575045108795, -0.0032173595391213894, 0.013887793757021427, 0.024212555959820747, 0.0014783155638724566, 0.030742911621928215, 0.01330224797129631, -0.0093696229159832, -0.018014289438724518, 0.027940591797232628, -0.07100538909435272, -0.02024877443909645, -0.03613201901316643, -0.038884494453668594, -0.006491178646683693, 0.0062547530978918076, 0.024466853588819504, 0.005152516067028046, -0.01773774065077305, 0.0031362976878881454, -0.027575092390179634, 0.00989907793700695, 0.01777663454413414, -0.026808079332113266, 0.018230661749839783, 0.024541793391108513, 0.011981175281107426, -0.022074425593018532, -0.053359296172857285, -0.003851963672786951, -0.03420842066407204, -0.015143556520342827, -0.007493743672966957, -0.02090008556842804, -0.0034344985615462065, -0.005715651903301477, 0.011507850140333176, -0.025021757930517197, 0.017760830000042915, -0.018453778699040413, 0.008791622705757618, -0.04586028680205345, 0.07109056413173676, -0.07446979731321335, -0.04556996747851372, 0.007828283123672009, -0.02539209835231304, 0.041936855763196945, -0.041671715676784515, 0.008851180784404278, -0.034938883036375046, -0.041735999286174774, -0.028946183621883392, -0.053283724933862686, 0.028857039287686348, 0.0044366042129695415, -0.003600457450374961, 0.00990795623511076, -0.016032686457037926, 0.0008043755660764873, 0.0030009043402969837, 0.02038661018013954, 0.018945841118693352, 0.03766900300979614, 0.04845494031906128, 0.036095030605793, 0.015264209359884262, -0.014762009494006634, 0.021325621753931046, 0.03721274808049202, 0.009272592142224312, 0.0252669770270586, 0.042668770998716354, 0.046594489365816116, -0.03484676778316498, 0.016581498086452484, 0.000054893189371796325, 0.027896558865904808, 0.019690029323101044, -0.00915575958788395, -0.016358952969312668, -0.02721339650452137, -0.050701893866062164, 0.003576768096536398, -0.009948424063622952, -0.03126632794737816, -0.022868558764457703, -0.025634389370679855, -0.02639482356607914, -0.04986627399921417, 0.026601634919643402, -0.015520954504609108, 0.012470059096813202, 0.016406551003456116, -0.03062473237514496, 0.009031318128108978, 0.017833050340414047, 0.013825795613229275, 0.0030016391538083553, 0.03078470006585121, 0.04306457191705704, -0.01198913250118494, -0.025995712727308273, 0.034912705421447754, -0.039526909589767456, -0.002413493115454912, -0.015695972368121147, 0.015293638221919537, -0.004232548177242279, -0.02929237298667431, 0.01337623130530119, 0.04569645971059799, -0.0028984411619603634, 0.017001455649733543, -0.031337201595306396, -0.03833191096782684, 0.035007279366254807, 0.006830418948084116, -0.03196672350168228, 0.014328920282423496, 0.0019089436391368508, 0.0131539236754179, 0.03805600851774216, -0.03794323652982712, -0.0015970413805916905, -0.03269259259104729, -0.055873241275548935, 0.011903319507837296, 0.01911419816315174, -0.03700224310159683, -0.03593912720680237, -0.055842187255620956, 0.015409032814204693, -0.06918872892856598, -0.023886142298579216, 0.006869996897876263, -0.020513668656349182, -0.039018597453832626, -0.02530847117304802, 0.026459064334630966, -0.034892551600933075, 0.027485709637403488, 0.05297306552529335, -0.009837040677666664, 0.015418720431625843, -0.015506298281252384, -0.04956171289086342, -0.030464986339211464, 0.02014906518161297 ]
Exploring simple optimizations for SDXL
sayakpaul
October 24, 2023
simple_sdxl_optimizations
diffusers, guide, sdxl
https://huggingface.co/blog/simple_sdxl_optimizations
Slicing In SDXL, a variational encoder (VAE) decodes the refined latents (predicted by the UNet) into realistic images. The memory requirement of this step scales with the number of images being predicted (the batch size). Depending on the image resolution and the available GPU VRAM, it can be quite memory-intensive. This is where โ€œslicingโ€ is useful. The input tensor to be decoded is split into slices and the computation to decode it is completed over several steps. This saves memory and allows larger batch sizes. python pipe = StableDiffusionXLPipeline.from_pretrained( "stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16, ).to("cuda") pipe.enable_vae_slicing() With sliced computations, we reduce the memory to 15.4GB. If we add sequential CPU offloading, it is further reduced to 11.45GB which lets you generate 4 images (1024x1024) per prompt. However, with sequential offloading, the inference latency also increases.
[ 0.09757538884878159, -0.03566190227866173, 0.010883000679314137, 0.06492101401090622, 0.016616983339190483, 0.04236898943781853, 0.01951001025736332, 0.010670462623238564, 0.004142465069890022, -0.09520499408245087, -0.07955601811408997, -0.04367643967270851, -0.015248425304889679, 0.017371028661727905, -0.0026630547363311052, -0.05567793920636177, 0.014683321118354797, -0.01193415280431509, -0.0010036216117441654, 0.04788489639759064, 0.032886601984500885, -0.09288866072893143, -0.013886465691030025, 0.03028533048927784, -0.10910824686288834, -0.027531912550330162, -0.056450121104717255, -0.006007992196828127, 0.009744490496814251, 0.005948222707957029, -0.14683814346790314, -0.01272983942180872, -0.0195306409150362, -0.016488688066601753, 0.005337554961442947, -0.0718175619840622, -0.04670856520533562, -0.0005296195158734918, 0.014214458875358105, 0.015537651255726814, -0.06041035056114197, 0.038426000624895096, -0.016642248257994652, 0.069638192653656, 0.06299670785665512, -0.04129676893353462, -0.027879657223820686, 0.034990113228559494, -0.10778208822011948, 0.035991862416267395, -0.027130069211125374, 0.007819763384759426, 0.005576079245656729, -0.007357219234108925, 0.01729070395231247, 0.013911078684031963, 0.06096778064966202, -0.006617369595915079, 0.024425465613603592, -0.002948472509160638, 0.0563197024166584, 0.009800836443901062, -0.04309723153710365, -0.005068862345069647, 0.024554124101996422, 0.00836713146418333, 0.0549369752407074, 0.04252154007554054, 0.009294360876083374, -0.11441587656736374, 0.01721780188381672, -0.029435642063617706, 0.008936458267271519, 0.04981113597750664, -0.028693202883005142, -0.07715978473424911, -0.031699515879154205, 0.008540991693735123, 0.023937810212373734, 0.02743479609489441, -0.03485223278403282, 0.0864310935139656, 0.057615600526332855, 0.012769320048391819, 0.0010261000134050846, -0.0170759167522192, 0.01932060346007347, -0.07730288803577423, -0.04134649783372879, -0.031514544039964676, -0.027666982263326645, -0.07162173092365265, 0.029845798388123512, -0.018059873953461647, 0.06409965455532074, 0.021978063508868217, 0.04572729021310806, 0.05200579762458801, 0.04124830663204193, -0.008209355175495148, 0.01671772450208664, -0.07668720185756683, -0.006202905438840389, -0.08517786115407944, -0.031793344765901566, 0.11464839428663254, -0.08942333608865738, -0.05143693462014198, -0.014278026297688484, -0.021740734577178955, 0.00011693618580466136, 0.09273218363523483, -0.03397281467914581, 0.03745453804731369, -0.09157173335552216, 0.010408204980194569, -0.05179925635457039, 0.022248029708862305, -0.03983842581510544, 0.006117294542491436, -0.028750523924827576, 0.0543949231505394, 0.09986826032400131, -0.037241626530885696, -0.08766741305589676, -0.014929857105016708, -0.0031845136545598507, 0.044863391667604446, 0.007785969413816929, 0.013940959237515926, -0.01627224311232567, -0.026107698678970337, 0.07139872759580612, -0.02694297581911087, 0.009046725928783417, -0.10322187840938568, -0.08210159838199615, -0.07104330509901047, -0.0012875276152044535, -0.046125415712594986, -0.003161058994010091, 0.0021879563573747873, 0.02594301663339138, -0.01078092772513628, 0.04243140295147896, -0.007971267215907574, 0.001188547001220286, 0.08125732839107513, -0.02658248320221901, 0.005752704106271267, -0.0711226537823677, 0.021164286881685257, -0.05842830240726471, -0.06593991816043854, -0.027600763365626335, 0.03686513006687164, -0.021591901779174805, 0.004194270819425583, -0.05262196063995361, 0.015031102113425732, 0.00458320789039135, -0.05506747215986252, -0.028057562187314034, 0.020164083689451218, 0.0074196020141243935, 0.014481846243143082, 0.04551266133785248, 0.0008557141409255564, 0.033754028379917145, 0.018398674204945564, 0.0009239879436790943, -0.016766967251896858, 0.01890695095062256, -0.03881734982132912, 0.03679191693663597, 0.03764921426773071, 0.06315818428993225, 0.08136311173439026, 0.017014365643262863, -0.11664178967475891, -0.027471287176012993, -0.02867499552667141, -0.010277497582137585, 0.05491284653544426, 0.01784510351717472, -0.1102982833981514, 0.07408981025218964, -0.04094086214900017, -0.05738922208547592, 0.09469392150640488, -0.01749647781252861, -0.002215775428339839, 0.031099295243620872, -0.004956954624503851, -0.011599168181419373, -0.03830756992101669, -0.027404136955738068, 0.09225156158208847, 0.0720556378364563, -0.016087664291262627, -0.01057925634086132, 0.04902035742998123, -0.012578248977661133, 0.01073971576988697, -0.002907019341364503, -0.029259826987981796, -0.001291142893023789, -0.025907693430781364, 0.09279599040746689, 0.08777355402708054, -0.017460742965340614, -0.0886925756931305, 0.009225004352629185, -0.0996924415230751, 0.00820513628423214, -0.0466855987906456, -0.03236787021160126, -0.015535621903836727, 0.018237492069602013, -0.07372332364320755, 0.04182549566030502, -0.01828126050531864, -0.02543303743004799, -0.03519038110971451, -0.04688140004873276, 0.0889158695936203, 0.017106512561440468, -0.009061543270945549, -0.001178594073280692, -0.10275578498840332, -0.038278814405202866, -0.06738849729299545, -0.020992346107959747, 0.006675157696008682, -0.005620921496301889, -0.05926539748907089, -0.032552190124988556, 0.07517398148775101, 0.03550850227475166, -0.04124551638960838, 0.07786872982978821, 0.06661783158779144, 0.017490176483988762, -0.019559890031814575, 0.04802683740854263, -0.01554317120462656, 0.021629400551319122, -0.014416306279599667, -0.02425309084355831, -0.007043421268463135, -0.015582311898469925, -0.01758764497935772, -0.06989453732967377, -0.009300989098846912, -0.017693085595965385, 0.04269616678357124, 0.022339552640914917, -0.05066433921456337, 0.0003668495628517121, 0.047991156578063965, 0.026240279898047447, -0.02164892852306366, -0.028641175478696823, -0.01583033800125122, 0.010456336662173271, 0.0210631862282753, 0.03161851316690445, -0.04123859480023384, 0.00013187466538511217, -0.0022470178082585335, -0.0029209102503955364, 0.013882721774280071, 0.0021754764020442963, 0.018635345622897148, 0.037926170974969864, 0.04316210374236107, 0.05019382759928703, 0.02423526905477047, -0.005606614984571934, -0.0221217330545187, 0.0009507870418019593, -0.032076768577098846, 0.04814550280570984, 0.062127213925123215, -0.006040722131729126, 0.003689959878101945, 0.04255087673664093, 0.023191405460238457, -0.01732586696743965, 0.03075002133846283, 0.04255760833621025, 0.06840316951274872, 0.026400506496429443, -0.006625473033636808, 0.010449535213410854, -0.00517893023788929, -0.01021462120115757, -0.08398554474115372, 0.004366863518953323, -0.018660034984350204, -0.018850432708859444, -0.01796666905283928, -0.0008832664461806417, -0.03321654722094536, -0.002738506533205509, 0.0065110526047647, -0.01726071909070015, 0.02014768123626709, -0.06297142058610916, -0.008575739338994026, -0.00888395681977272, -0.028192004188895226, -0.02602509595453739, -0.0025839891750365496, 0.0017358111217617989, -0.009103702381253242, 0.015362962149083614, 0.001878699054941535, 0.010982142761349678, 0.04799871891736984, 0.026772571727633476, 0.010320931673049927, 0.06632749736309052, -0.013716230168938637, 0.05943569540977478, 0.012738091871142387, -0.02972347103059292, -0.0428953692317009, -0.010636006481945515, 0.008742903359234333, -0.044455636292696, 0.04523812606930733, 0.006000007037073374, 0.008934695273637772, 0.02532324194908142, -0.056590139865875244, 0.0038154986687004566, -0.013791476376354694, -0.02719806134700775, -0.021545687690377235, -0.014275218360126019, 0.029089728370308876, -0.044477980583906174, 0.0014136674581095576, 0.004560736007988453, -0.008663147687911987, 0.040395338088274, -0.015303089283406734, 0.04438784345984459, -0.006464193109422922, 0.02196464128792286, 0.02125593088567257, 0.025411782786250114, 0.00012882266310043633, 0.05247180163860321, 0.018187275156378746, 0.008946031332015991, -0.027350597083568573, 0.00915519893169403, 0.01155316922813654, -0.017881974577903748, 0.0533202588558197, -0.005926959216594696, 0.003317037131637335, -0.020395319908857346, 0.020657334476709366, 0.03168532997369766, -0.039402689784765244, -0.040785737335681915, -0.020038222894072533, 0.028337853029370308, 0.03524915874004364, 0.019809432327747345, 0.052864715456962585, 0.027584845200181007, -0.01877041906118393, -0.022102955728769302, 0.036381714046001434, -0.0032743094488978386, 0.05512005090713501, 0.022489259019494057, -0.004709633532911539, -0.04943779483437538, 0.012834997847676277, 0.01842593401670456, 0.012036674655973911, 0.004189456347376108, 0.03777473419904709, -0.01909206062555313, -0.008985810913145542, -0.008814926259219646, 0.0005707810050807893, 0.0021778747905045748, 0.013021359220147133, -0.047585342079401016, -0.03969894349575043, 0.031484365463256836, 0.0073693315498530865, -0.003185400040820241, -0.004383009392768145, -0.006529970560222864, -0.016553113237023354, 0.011777754873037338, 0.011015472933650017, -0.0032925321720540524, 0.05452281981706619, 0.03426286205649376, -0.004035554826259613, 0.017360055819153786, -0.03337804228067398, -0.0045715197920799255, 0.005792637821286917, -0.030000077560544014, 0.020894408226013184, -0.03264632448554039, 0.00010549635044299066, 0.0026357281021773815, -0.00807966012507677, 0.010528210550546646, 0.0036941480357199907, 0.011817578226327896, 0.014467037282884121, 0.031939562410116196, 0.04763255640864372, 0.002056074095889926, -0.014126208610832691, -0.0022510881535708904, 0.009494408965110779, -0.002038138685747981, 0.0004603193374350667, 0.02930980548262596, -0.03281112760305405, 0.017060741782188416, 0.031438134610652924, -0.042436979711055756, 0.009191591292619705, 0.004597626626491547, -0.019519519060850143, -0.013019869104027748, 0.0031290638726204634, 0.04869633540511131, -0.029304292052984238, 0.012087641283869743, -0.013839956372976303, -0.03201482445001602, -0.0037477680016309023, -0.01941424049437046, -0.003030952764675021, -0.012355620972812176, -0.029594747349619865, 0.020683305338025093, -0.03357493504881859, 0.03439505770802498, 0.015570427291095257, 0.019673505797982216, 0.013371986337006092, -0.04955381155014038, 0.03174606338143349, 0.050248075276613235, -0.04988463968038559, -0.02119610644876957, -0.015962880104780197, -0.0014888228615745902, 0.0062915184535086155, 0.01354681234806776, 0.011062465608119965, 0.027920834720134735, 0.029193196445703506, 0.011917482130229473, 0.040841832756996155, -0.0211036317050457, 0.05879947170615196, -0.018177250400185585, -0.010292355902493, -0.03953928500413895, -0.03322814404964447, 0.019300803542137146, -0.021655546501278877, -0.019365111365914345, 0.028705939650535583, 0.014078909531235695, 0.019178280606865883, -0.00281512807123363, 0.0375642366707325, 0.03663510084152222, -0.004081335850059986, -0.035514507442712784, -0.002904015127569437, 0.0018172524869441986, -0.025899164378643036, 0.033952273428440094, -0.04181676357984543, -0.010748553089797497, 0.020048266276717186, 0.0072714658454060555, 0.0635523572564125, 0.0020808600820600986, 0.046911343932151794, -0.00883630570024252, 0.016824623569846153, 0.0014678856823593378, -0.005562047474086285, -0.0007510268478654325, 0.007797776255756617, 0.012448634020984173, 0.013781899586319923, -0.0046509429812431335, -0.020609427243471146, 0.02389659360051155, 0.005559136159718037, -0.01687486097216606, -0.057233501225709915, -0.021565226837992668, 0.017644735053181648, 0.021915042772889137, 0.02529173716902733, 0.030588200315833092, 0.007031331770122051, 0.010789516381919384, -0.0014388692798092961, -0.033095989376306534, 0.007033207453787327, -0.014024167321622372, 0.008475403301417828, -0.008880923502147198, 0.0060530975461006165, 0.017362171784043312, 0.022259581834077835, -0.008081748150289059, -0.01302647776901722, -0.0030956710688769817, 0.011890161782503128, 0.011762356385588646, -0.02621755190193653, 0.012383148074150085, -0.021081697195768356, 0.00701890978962183, 0.008441791869699955, 0.021555310115218163, 0.012923083268105984, -0.03299020230770111, 0.0008313143625855446, 0.010380953550338745, 0.046775635331869125, -0.00012034610699629411, 0.029731377959251404, 0.02577698975801468, -0.03467408940196037, 0.018185503780841827, -0.054571375250816345, -0.06966639310121536, 0.046364251524209976, 0.004725459031760693, 0.06086323410272598, 0.015486763790249825, -0.050196558237075806, 0.010770747438073158, 0.029869861900806427, 0.008440389297902584, -0.06340251863002777, -0.004620562307536602, -0.014359421096742153, 0.017391135916113853, 0.0235137902200222, 0.020461812615394592, -0.03948622941970825, 0.034415796399116516, 0.01972661167383194, -0.0148159796372056, -0.07995829731225967, 0.05989132449030876, -0.0024935330729931593, -0.01983613334596157, 0.011529115028679371, -0.019591381773352623, -0.017855782061815262, 0.007869730703532696, 0.04817882925271988, 0.00994289480149746, 0.0010810873936861753, -0.0029029264114797115, 0.02477768436074257, -0.01889919675886631, 0.01891346462070942, -0.006180593743920326, 0.01655009761452675, -0.05822227522730827, 0.005387861281633377, 0.0355963297188282, 0.021372344344854355, 0.04692899435758591, 0.009559886530041695, 0.028999757021665573, -0.01619497500360012, 0.04901641607284546, 0.014260821975767612, -0.060881756246089935, 0.021456126123666763, 0.042411983013153076, 0.0054974923841655254, 0.025932462885975838, -0.04448232799768448, -0.04082615673542023, 0.01096370443701744, 0.07859799265861511, -0.006884371861815453, 0.03122098371386528, -0.031454429030418396, 0.04498862475156784, 0.04803473502397537, 0.03467028588056564, 0.054125767201185226, -0.009062984958291054, -0.027782216668128967, -0.006120108533650637, 0.016339555382728577, 0.01111244410276413, 0.018116310238838196, 0.04166167601943016, -0.01661086454987526, -0.008436675183475018, -0.02810080349445343, 0.0637715682387352, 0.028322312980890274, 0.003682568669319153, -0.009705719538033009, -0.006165511906147003, -0.006627704948186874, -0.02182660810649395, -0.034273579716682434, -0.002929863752797246, -0.049060359597206116, -0.050338201224803925, 0.0069548641331493855, 0.019524971023201942, -0.03627689555287361, -0.004978745244443417, 0.020838547497987747, 0.022468827664852142, -0.02361144684255123, -0.009858242236077785, -0.02135900780558586, -0.030983921140432358, -0.00206550769507885, -0.009499793872237206, 0.03088350221514702, 0.020576871931552887, -0.022641794756054878, 0.03364603966474533, 0.029292993247509003, -0.0027743992395699024, 0.05019998922944069, -0.05047564208507538, 0.007419718895107508, -0.006948759779334068, -0.010151871480047703, 0.0001543354883324355, 0.030150558799505234, 0.00427308538928628, 0.03463909029960632, -0.027660544961690903, 0.05312588810920715, -0.002175471279770136, -0.042509425431489944, 0.02442070282995701, 0.036824874579906464, 0.01828453689813614, 0.033133916556835175, 0.06253058463335037, 0.046166904270648956, 0.03137828782200813, -0.0489053949713707, -0.0482904389500618, -0.024558711796998978, -0.04255327954888344, 0.014772038906812668, -0.00010641206608852372, -0.006534217391163111, 0.00023752535344101489, -0.00292639946565032, -0.03976549953222275, -0.007047540973871946, -0.029576649889349937, 0.007794617209583521, -0.009169839322566986, -0.0026086431462317705, -0.0026588840410113335, -0.05917281284928322, 0.06637519598007202, -0.035987213253974915, 0.012216899544000626, 0.027361124753952026, -0.00771728390827775, -0.010810037143528461, -0.03521481901407242, 0.026864761486649513, -0.011911817826330662, 0.001387908821925521, -0.04443753883242607, 0.012980257160961628, -0.03252832591533661, 0.04643690213561058, -0.016089294105768204, 0.014264412224292755, -0.016763295978307724, -0.04243991896510124, -0.0181454885751009, 0.02721380442380905, -0.0027554749976843596, -0.06743481755256653, 0.03877609223127365, 0.04913243651390076, -0.02669139951467514, 0.06531503796577454, -0.07214891910552979, -0.014720786362886429, 0.009993216022849083, 0.07798554003238678, 0.055101897567510605, 0.01791990175843239, -0.025828763842582703, -0.02588457055389881, -0.006781057454645634, 0.015437817201018333, -0.0297384075820446, -0.011102703399956226, 0.051638875156641006, -0.06028646603226662, 0.003720812266692519, 0.054243121296167374, 0.03030107356607914, 0.035686444491147995, 0.047945357859134674, 0.023514967411756516, 0.013044962659478188, 0.026253964751958847, -0.0005908034509047866, -0.05678077042102814, -0.024127330631017685, 0.016530362889170647, -0.004113394301384687, 0.015730058774352074, -0.022417863830924034, 0.013944361358880997, -0.022158678621053696, 0.02886233478784561, 0.010457879863679409, -0.00806259922683239, 0.0025856613647192717, 0.019364871084690094, -0.012472804635763168, 0.04925726726651192, 0.029723189771175385, -0.028048645704984665, -0.0424523651599884, -0.0009698336943984032, -0.003311183536425233, 0.01207710150629282, -0.021197667345404625, 0.012049717828631401, 0.016933245584368706, 0.004474675748497248, 0.004815064370632172, 0.059403467923402786, 0.04741181433200836, 0.047490596771240234, 0.0016973469173535705, -0.0033036735840141773 ]
Exploring simple optimizations for SDXL
sayakpaul
October 24, 2023
simple_sdxl_optimizations
diffusers, guide, sdxl
https://huggingface.co/blog/simple_sdxl_optimizations
Sequential CPU offloading Another type of offloading which can save you more memory at the expense of slower inference is sequential CPU offloading. Rather than offloading an entire model - like the UNet - model weights stored in different UNet submodules are offloaded to the CPU and only loaded onto the GPU right before the forward pass. Essentially, youโ€™re only loading parts of the model each time which allows you to save even more memory. The only downside is that it is significantly slower because youโ€™re loading and offloading submodules many times. python from diffusers import StableDiffusionXLPipeline pipe = StableDiffusionXLPipeline.from_pretrained( "stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16, ).to("cuda") pipe.enable_sequential_cpu_offload() Compared to the baseline, this takes 19.9GB of memory but the inference time increases to 67 seconds.
[ 0.032906424254179, 0.0031668043229728937, -0.026441531255841255, 0.009110867977142334, -0.02654862403869629, 0.04093952476978302, 0.014861728996038437, 0.017045915126800537, -0.02109815552830696, -0.043900106102228165, -0.021236775442957878, 0.0026145000010728836, -0.04066205397248268, 0.029012037441134453, -0.021580766886472702, -0.08217411488294601, 0.04898649826645851, -0.07250785082578659, -0.08018841594457626, 0.07788238674402237, 0.06830186396837234, -0.03198910877108574, 0.03552430868148804, -0.03737135976552963, -0.11945018172264099, -0.036677829921245575, -0.018756983801722527, -0.006963456515222788, 0.00839818175882101, -0.009973013773560524, -0.143808513879776, -0.003506883978843689, 0.052074652165174484, -0.0515141598880291, 0.05538760498166084, -0.04420866817235947, -0.05245143175125122, 0.05157499387860298, 0.09333301335573196, -0.025054220110177994, -0.021637044847011566, 0.032082587480545044, -0.07772848755121231, 0.024736063554883003, 0.04814441502094269, -0.008915417827665806, -0.110682912170887, 0.0059102545492351055, -0.08518689125776291, 0.0073980060406029224, -0.10195993632078171, 0.040311846882104874, -0.05624760314822197, 0.02455102652311325, 0.052362170070409775, 0.04188663139939308, 0.028921794146299362, 0.005597331561148167, 0.020933296531438828, 0.031764574348926544, 0.02442936599254608, 0.04763472452759743, -0.03566838055849075, 0.03085114061832428, 0.04229685664176941, 0.0003211968869436532, -0.018844591453671455, -0.027659954503178596, -0.06533464789390564, -0.062007833272218704, 0.03844524547457695, -0.052261486649513245, -0.012738541699945927, 0.040572382509708405, 0.0263522956520319, -0.009077394381165504, 0.007265911903232336, 0.005044626072049141, 0.027589168399572372, 0.07473684102296829, 0.022808946669101715, 0.02886173315346241, 0.005887349136173725, 0.031780485063791275, 0.028826409950852394, 0.021179137751460075, 0.04262353107333183, -0.05953307822346687, -0.009777777828276157, -0.04481971636414528, -0.005949522368609905, -0.005228354595601559, 0.06077330559492111, -0.003467705799266696, 0.0351126603782177, 0.022473976016044617, -0.021792789921164513, 0.02269909530878067, 0.038173794746398926, 0.01732565462589264, 0.030760016292333603, -0.10022644698619843, -0.010300955735147, -0.09029784798622131, -0.006067086476832628, 0.050736524164676666, -0.04715081304311752, -0.08723780512809753, -0.03611431270837784, 0.03572527691721916, -0.06724677979946136, 0.07932508736848831, -0.08664888888597488, 0.024756545200943947, -0.12207945436239243, 0.020603347569704056, -0.04652826115489006, -0.0047016567550599575, -0.011586140841245651, 0.022409064695239067, -0.008247497491538525, 0.052177347242832184, 0.06829466670751572, 0.01957695372402668, -0.001656947541050613, 0.05765755474567413, 0.0913522019982338, 0.020514369010925293, -0.008571093901991844, 0.03116046078503132, 0.02585694193840027, -0.011409815400838852, 0.048980712890625, -0.0356944240629673, 0.05865054205060005, -0.10632209479808807, -0.10724737495183945, -0.008555817417800426, 0.03141896799206734, 0.004975189920514822, -0.08137612044811249, -0.009750667959451675, 0.03323254734277725, -0.033032361418008804, 0.03087395802140236, -0.010862070135772228, -0.03046012483537197, -0.0005300022312439978, 0.023571636527776718, 0.02484499290585518, -0.13728559017181396, 0.050649479031562805, -0.07448627799749374, -0.08639413118362427, 0.017031388357281685, 0.037540730088949203, 0.013401685282588005, -0.040535591542720795, -0.06363693624734879, -0.00295015936717391, 0.002197204390540719, -0.05997195839881897, -0.015462568961083889, -0.01625213213264942, 0.02223646454513073, -0.012509625405073166, 0.03261090815067291, 0.01730324514210224, 0.04086960852146149, -0.013835623860359192, -0.011496911756694317, -0.040169697254896164, 0.06165691837668419, -0.0019205280113965273, 0.01648363284766674, 0.030372144654393196, -0.024733945727348328, 0.0879342257976532, 0.0034187929704785347, -0.041317153722047806, -0.04211324080824852, 0.017070772126317024, -0.011953410692512989, 0.06829220056533813, -0.005131614860147238, -0.0839870348572731, 0.03205103054642677, -0.09245985001325607, -0.020754879340529442, 0.04696181043982506, 0.0258001908659935, -0.0032957554794847965, 0.05689314007759094, -0.049240898340940475, 0.04560037702322006, -0.008679005317389965, -0.048823557794094086, 0.05015726760029793, 0.03787840157747269, 0.04006042703986168, -0.02424549125134945, 0.041422758251428604, -0.015072709880769253, 0.010746251791715622, -0.01630941964685917, -0.019657792523503304, -0.0020999223925173283, -0.07833333313465118, 0.014600152149796486, 0.017073852941393852, -0.016991600394248962, -0.06361690908670425, -0.047463737428188324, -0.061532534658908844, -0.011796729639172554, -0.022717280313372612, -0.01872898079454899, -0.024828990921378136, 0.0008508504834026098, -0.09486577659845352, 0.06192599982023239, -0.013146820478141308, -0.02114432491362095, 0.04047408327460289, -0.060235682874917984, 0.030607590451836586, 0.036198221147060394, -0.04993152245879173, 0.04587843641638756, -0.07705734670162201, -0.04905037209391594, -0.09895392507314682, -0.05310715362429619, 0.05412374064326286, 0.024933578446507454, -0.030920125544071198, -0.04153930023312569, 0.04885011911392212, 0.02196790836751461, -0.10138941556215286, -0.011066033504903316, 0.01702825166285038, -0.026478033512830734, 0.029484156519174576, 0.014032427221536636, -0.04047873616218567, 0.033579278737306595, -0.052367184311151505, -0.06135212630033493, -0.009710841812193394, 0.024959327653050423, -0.0016761015867814422, -0.022494414821267128, -0.01920313574373722, 0.021854359656572342, 0.01138276606798172, -0.022405920550227165, -0.002778036752715707, 0.022930197417736053, 0.05168891325592995, 0.002991201588883996, 0.008727040141820908, -0.029346102848649025, 0.0072623672895133495, 0.0076158978044986725, -0.015254789032042027, 0.014709405601024628, -0.027796586975455284, 0.03070448897778988, -0.035950273275375366, -0.008749090135097504, 0.016491351649165154, 0.008180422708392143, 0.014286157675087452, 0.02340158075094223, 0.04228437691926956, 0.059194255620241165, -0.0012979890452697873, -0.012774262577295303, -0.04297180846333504, -0.0034494560677558184, -0.03709040954709053, 0.018138566985726357, 0.00010830526298377663, -0.014269035309553146, 0.0016560133080929518, 0.03238334134221077, -0.018478935584425926, -0.03778358921408653, 0.03277088329195976, 0.01887480355799198, -0.007722922135144472, -0.0137732969596982, -0.055638425052165985, 0.0068351225927472115, 0.025372551754117012, -0.009827006608247757, -0.07348043471574783, 0.009906389750540257, 0.014790751039981842, -0.011852027848362923, -0.0020169252529740334, -0.026650870218873024, 0.011234487406909466, -0.04222795367240906, 0.05598283186554909, -0.012870162725448608, 0.02343016117811203, -0.08312435448169708, 0.007946456782519817, -0.024623718112707138, 0.004420337732881308, 0.008257527835667133, 0.0010178651427850127, -0.006233984604477882, 0.0007254868978634477, 0.040966566652059555, 0.05464740842580795, 0.038516394793987274, 0.01798032596707344, 0.028649423271417618, 0.016504742205142975, 0.003703592112287879, -0.011375374160706997, 0.10074197500944138, 0.031538721174001694, 0.0030208472162485123, -0.006650896277278662, 0.012066547758877277, 0.01974189095199108, -0.027079077437520027, 0.03252691403031349, -0.014048769138753414, 0.00009043219324667007, 0.023135429248213768, 0.02087375521659851, -0.031233711168169975, -0.031699758023023605, -0.022073915228247643, -0.026987945660948753, 0.02887215092778206, 0.01790809817612171, -0.03369208797812462, -0.012608113698661327, 0.024217398837208748, 0.011844257824122906, 0.04785780608654022, 0.019833974540233612, 0.050126656889915466, -0.014787200838327408, 0.04186221957206726, 0.005792337469756603, 0.005702813621610403, -0.012005341239273548, 0.04712354764342308, -0.008541581220924854, 0.010440371930599213, -0.01790446974337101, 0.026162372902035713, -0.004557545762509108, 0.028743112459778786, 0.03206562250852585, -0.03733902797102928, -0.008333547972142696, -0.0009297559736296535, 0.028575370088219643, 0.057769205421209335, 0.005906637292355299, -0.038505226373672485, 0.02392072044312954, 0.06249427795410156, -0.013908051885664463, -0.028554106131196022, 0.030024638399481773, 0.03304653614759445, 0.007477979641407728, -0.01049878355115652, -0.0015328876907005906, -0.015541352331638336, 0.045942630618810654, 0.016277136281132698, -0.0022858537267893553, -0.03946082293987274, -0.000494595558848232, -0.009318401105701923, -0.019504547119140625, 0.04431682452559471, 0.032495949417352676, -0.034938495606184006, -0.011368014849722385, -0.01608377695083618, -0.002032759366557002, 0.007525472901761532, 0.009884759783744812, -0.03702717274427414, -0.02246970310807228, 0.01393944676965475, 0.021072804927825928, -0.007229311391711235, -0.00944787822663784, 0.03673592954874039, 0.006700340658426285, 0.012647155672311783, 0.035538624972105026, 0.05133042857050896, 0.0485772006213665, 0.01545742154121399, -0.032574571669101715, 0.038117676973342896, -0.0445510670542717, 0.00027111044619232416, 0.008284695446491241, -0.011391988024115562, 0.0029503204859793186, 0.012414611876010895, -0.01911453902721405, 0.024491649121046066, -0.016343435272574425, 0.007296040654182434, -0.006507089827209711, 0.037355098873376846, 0.017628071829676628, 0.022608652710914612, 0.061171457171440125, -0.004201828967779875, 0.0137651227414608, 0.004784922581166029, 0.053499527275562286, -0.05089757218956947, 0.06056450307369232, 0.03714151307940483, -0.030434681102633476, 0.052945684641599655, 0.02889702469110489, -0.018932312726974487, -0.007661949377506971, 0.002898290753364563, -0.022174635902047157, -0.06201392039656639, 0.014853091910481453, 0.04532064124941826, 0.028055299073457718, -0.009065543301403522, -0.023797180503606796, -0.022452743723988533, 0.03435574471950531, 0.04076503962278366, -0.042360465973615646, -0.033264901489019394, -0.023171748965978622, -0.009439154528081417, -0.053910985589027405, -0.006829968653619289, 0.014478486962616444, -0.011083058081567287, 0.03365892171859741, -0.04824841022491455, 0.05104018747806549, 0.029021592810750008, 0.009042765013873577, -0.061424680054187775, 0.020320668816566467, 0.03701591491699219, 0.02402644045650959, -0.02931736223399639, -0.003530381480231881, -0.021207917481660843, 0.009937172755599022, -0.0216519795358181, 0.045138027518987656, 0.00045230492833070457, -0.019418228417634964, 0.002516268752515316, -0.010725606232881546, -0.010782217606902122, -0.0588143989443779, 0.013433386571705341, -0.04628186300396919, 0.022207526490092278, 0.05423035845160484, 0.005085438024252653, 0.009846064262092113, 0.0602324903011322, 0.004227524623274803, 0.010989585891366005, 0.011316470801830292, -0.02438877336680889, -0.004765835124999285, -0.01157084759324789, 0.008444525301456451, 0.03625578060746193, 0.0005035423091612756, 0.001338275265879929, 0.03354562819004059, 0.011302439495921135, 0.049803707748651505, 0.03201001510024071, 0.02877165377140045, 0.022602466866374016, 0.03151893988251686, -0.0053586275316774845, -0.028385305777192116, 0.06007600948214531, 0.005787058267742395, 0.00393132958561182, 0.03335723280906677, 0.010446175001561642, -0.02711557410657406, 0.0028888664674013853, 0.03301830589771271, -0.016209730878472328, -0.04942081868648529, -0.01784539967775345, 0.04296864569187164, 0.00876536313444376, -0.027765551581978798, 0.04711136221885681, 0.004951933398842812, 0.05573720484972, -0.02483762800693512, -0.017153635621070862, 0.01169943530112505, -0.010026400908827782, 0.01333776768296957, -0.03280658274888992, 0.027215678244829178, 0.025051072239875793, 0.028883520513772964, 0.024804813787341118, -0.007952678017318249, -0.025943461805582047, -0.05513136088848114, 0.028553353622555733, -0.04532263055443764, 0.006374040152877569, -0.04208127781748772, 0.006496048998087645, 0.03231174126267433, 0.014025074429810047, 0.015531179495155811, -0.01362431701272726, 0.0070162261836230755, 0.04386987164616585, 0.019183728843927383, 0.022049618884921074, 0.040780454874038696, 0.020014381036162376, -0.006691816728562117, -0.0324551947414875, -0.011423229239881039, -0.03607898950576782, -0.010275055654346943, -0.015610610134899616, 0.03456718474626541, 0.03332759067416191, -0.05461999773979187, -0.011380030773580074, 0.030915262177586555, 0.020183946937322617, -0.032309819012880325, 0.002712140791118145, -0.032732948660850525, -0.035633549094200134, -0.005616830196231604, 0.004850190132856369, -0.04639196768403053, 0.023212868720293045, -0.005632584448903799, 0.020960256457328796, -0.02074749767780304, 0.027584770694375038, -0.015506340190768242, -0.0016804933547973633, 0.0364135280251503, -0.002942560939118266, -0.026867466047406197, 0.02616148442029953, 0.016320431604981422, -0.015214049257338047, -0.0033961511217057705, -0.04040553420782089, 0.008622192777693272, -0.01908356323838234, 0.04036278277635574, 0.020680570974946022, 0.04055226221680641, -0.0330413319170475, 0.040038950741291046, 0.012152646668255329, 0.06035665422677994, 0.026370013132691383, 0.0017035495257005095, 0.0196080319583416, -0.0006557490560226142, 0.04969337582588196, 0.0062567139975726604, -0.025949664413928986, 0.015634965151548386, -0.02975396439433098, 0.006818087305873632, -0.008198600262403488, -0.03211328759789467, -0.03266846016049385, 0.02913045510649681, 0.025378085672855377, 0.008522247895598412, 0.015600722283124924, -0.034010957926511765, 0.03826487436890602, 0.023682883009314537, 0.03006015531718731, 0.01201874203979969, -0.01284010149538517, 0.003358595771715045, 0.02072017639875412, 0.020302634686231613, -0.01461152546107769, 0.015103905461728573, -0.01295454055070877, -0.017287177965044975, 0.01828313246369362, 0.03455260396003723, 0.08058316260576248, 0.0057440632954239845, 0.03129973262548447, -0.017462581396102905, 0.0166814886033535, 0.017384039238095284, -0.026962636038661003, 0.011372503824532032, 0.013062683865427971, -0.01551417913287878, -0.0331001952290535, 0.024674851447343826, -0.01309460960328579, -0.013963638804852962, -0.012198918499052525, 0.023607198148965836, -0.020069925114512444, -0.016398118808865547, 0.0338108129799366, -0.025566013529896736, -0.006957390811294317, -0.014082585461437702, 0.024059979245066643, 0.015227789990603924, -0.029770627617836, 0.00594719173386693, 0.027912452816963196, 0.04700583592057228, 0.04057342931628227, 0.0398714542388916, -0.006666865665465593, 0.004092132207006216, 0.05810917168855667, 0.004128702916204929, -0.00004875980084761977, 0.020179595798254013, -0.030048057436943054, 0.0559525191783905, 0.010876731015741825, 0.016288626939058304, -0.006623461376875639, -0.06483498960733414, 0.032938603311777115, 0.01717485301196575, -0.02528088353574276, 0.03823769837617874, 0.051998309791088104, 0.057029906660318375, -0.012899073772132397, -0.020471440628170967, -0.048103127628564835, -0.006072867661714554, -0.03523595631122589, -0.0092110401019454, -0.010753093287348747, -0.012442616745829582, -0.00529320165514946, -0.04156225547194481, -0.0011342589277774096, -0.0153807969763875, -0.02720092423260212, -0.031181523576378822, 0.03260952606797218, -0.015339592471718788, -0.024683019146323204, -0.008341006934642792, 0.06584832817316055, -0.03367448225617409, 0.013152205385267735, 0.035259127616882324, -0.017926212400197983, 0.00962857622653246, -0.01670808531343937, 0.0026476590428501368, -0.010308241471648216, 0.018574455752968788, -0.0203352402895689, 0.0013372069224715233, -0.0371088981628418, 0.014894398860633373, -0.04530511796474457, 0.017097827047109604, -0.0433206669986248, -0.026083389297127724, -0.018355192616581917, 0.022111408412456512, -0.006107836961746216, -0.004249915014952421, 0.04152045026421547, 0.06262459605932236, -0.00574098713696003, 0.0531698502600193, -0.05615781620144844, 0.0014539404073730111, -0.018124796450138092, 0.09721589088439941, 0.029453815892338753, 0.0238486435264349, 0.003110281191766262, -0.05073985457420349, -0.03634708374738693, 0.01634831167757511, -0.03700847923755646, -0.02340514585375786, -0.009326793253421783, -0.025226470082998276, -0.03140655905008316, 0.007993110455572605, 0.02490879036486149, 0.056198250502347946, 0.07866737991571426, 0.0024609577376395464, -0.013785192742943764, 0.026267580687999725, 0.0562337189912796, -0.04486978054046631, -0.010503362864255905, 0.005016637966036797, -0.015884041786193848, 0.018926896154880524, -0.00304370722733438, 0.04918285086750984, 0.0501917228102684, 0.01711651124060154, 0.020654894411563873, -0.005071507301181555, -0.0196878369897604, -0.04877503588795662, -0.01221425924450159, 0.033144693821668625, -0.012923543341457844, -0.04359203949570656, -0.041862983256578445, 0.014687268994748592, 0.021413547918200493, 0.0019151493906974792, -0.01454871241003275, 0.005306336097419262, 0.022192519158124924, -0.001486040186136961, -0.005379486363381147, 0.042809080332517624, 0.08557569235563278, 0.011995142325758934, -0.040981411933898926, -0.01413048803806305 ]
Exploring simple optimizations for SDXL
sayakpaul
October 24, 2023
simple_sdxl_optimizations
diffusers, guide, sdxl
https://huggingface.co/blog/simple_sdxl_optimizations
Inference speed Diffusion is a random process, so there's no guarantee you'll get an image youโ€™ll like. Often times, youโ€™ll need to run inference multiple times and iterate, and thatโ€™s why optimizing for speed is crucial. This section focuses on using lower precision weights and incorporating memory-efficient attention and torch.compile from PyTorch 2.0 to boost speed and reduce inference time.
[ 0.060197677463293076, -0.022494638338685036, 0.02910272404551506, 0.010044865310192108, 0.043348465114831924, 0.0296237301081419, -0.013456308282911777, 0.07778281718492508, -0.032338932156562805, -0.10130342841148376, -0.04218573868274689, -0.006898186169564724, -0.01614512875676155, 0.01488756574690342, 0.021094392985105515, -0.04343411698937416, 0.10749661177396774, 0.0038130362518131733, 0.0027518020942807198, 0.03256487101316452, 0.031376857310533524, -0.05659853294491768, 0.04626939818263054, -0.06475009769201279, -0.05660026893019676, -0.04552736133337021, -0.0498015359044075, -0.019628139212727547, -0.043006449937820435, -0.01488883513957262, -0.1677233874797821, 0.006242760457098484, 0.025111714377999306, -0.006672366056591272, 0.0325288362801075, -0.029060127213597298, -0.09594732522964478, 0.03528514504432678, 0.07595105469226837, -0.01703391782939434, 0.005512498319149017, 0.0006000646390020847, -0.11710799485445023, 0.014900369569659233, -0.0014219831209629774, -0.0029230492655187845, -0.1625015288591385, 0.06898632645606995, -0.06591332703828812, -0.03756087273359299, -0.08520057052373886, 0.013094904832541943, -0.09778985381126404, 0.04425736144185066, 0.004978620912879705, 0.029145870357751846, 0.012716243974864483, -0.025782333686947823, 0.0630900114774704, 0.0022269818000495434, 0.017437225207686424, -0.014209684915840626, 0.02418542467057705, 0.07173456251621246, 0.015394493006169796, 0.042486365884542465, 0.04111701250076294, 0.018163524568080902, -0.03355942666530609, -0.02894951030611992, 0.013522902503609657, -0.04268921911716461, 0.01002921350300312, 0.004848856944590807, 0.013814820908010006, 0.004838645923882723, -0.004670482594519854, 0.034320324659347534, 0.03446096181869507, 0.013211611658334732, 0.023336205631494522, -0.011363252997398376, 0.078229159116745, 0.06440120935440063, 0.04129252955317497, 0.02313106320798397, 0.009573429822921753, 0.01910952664911747, -0.023848576471209526, -0.002329904353246093, -0.002084539970383048, -0.09896963834762573, -0.009674987755715847, 0.027559496462345123, 0.012069929391145706, -0.0296758022159338, -0.008993305265903473, -0.001137233222834766, -0.011549178510904312, -0.004263116512447596, -0.00833397638052702, -0.09691125899553299, 0.028740564361214638, -0.015850268304347992, -0.04524588584899902, 0.07875017821788788, -0.042022038251161575, -0.07922013103961945, -0.08124960958957672, 0.07839366048574448, -0.0456518717110157, 0.061538662761449814, -0.034419309347867966, -0.009211167693138123, -0.10479943454265594, -0.06040414422750473, -0.014618118293583393, 0.05251660943031311, 0.007325540762394667, -0.007723651826381683, -0.031670402735471725, 0.10732511430978775, 0.06287054717540741, 0.02856525406241417, -0.025673914700746536, 0.0724044144153595, 0.053845807909965515, 0.07571534812450409, -0.03147675842046738, 0.010380101390182972, 0.02856731414794922, -0.041545551270246506, 0.00834723562002182, -0.04373281076550484, 0.024537699297070503, -0.07153504341840744, -0.030335992574691772, -0.016475452110171318, -0.028718477115035057, -0.02284318394958973, -0.016361327841877937, 0.016131624579429626, 0.05549314245581627, 0.032476816326379776, 0.019355200231075287, -0.041515596210956573, -0.03397189453244209, -0.014174627140164375, 0.03387721627950668, 0.052783336490392685, -0.10104761272668839, 0.1146254613995552, -0.04743252322077751, -0.07264196872711182, -0.04527706280350685, 0.06515491753816605, -0.03886295109987259, -0.05329258367419243, -0.022164080291986465, -0.03589934855699539, -0.024378882721066475, -0.05980227515101433, 0.055670976638793945, -0.000006513080734293908, 0.0638606995344162, -0.01907501369714737, 0.0402199923992157, 0.04814392700791359, 0.034085750579833984, -0.022364972159266472, 0.010922432877123356, -0.013511576689779758, 0.046263277530670166, -0.01975206471979618, 0.015503976494073868, 0.041236843913793564, -0.02155960351228714, 0.06797929853200912, 0.008437174372375011, -0.037839848548173904, -0.03116634674370289, 0.008799492381513119, -0.06458643823862076, 0.060435134917497635, 0.03491721674799919, -0.13716214895248413, 0.06038456782698631, -0.01595977135002613, -0.0004506962141022086, 0.025273704901337624, -0.04530822113156319, -0.017140507698059082, 0.053535569459199905, -0.05942358821630478, 0.0322403758764267, -0.08785466104745865, -0.06986096501350403, 0.08663075417280197, -0.004146994091570377, 0.046649422496557236, -0.012828385457396507, -0.04254622012376785, -0.020466037094593048, 0.004878862760961056, 0.00513297226279974, 0.006431899033486843, 0.020297367125749588, 0.005197923630475998, 0.01433761790394783, 0.01433003693819046, -0.03577756881713867, -0.1290035843849182, -0.013258960098028183, -0.060107287019491196, 0.0026500581298023462, 0.0058895074762403965, 0.009027565829455853, 0.016156919300556183, -0.00941993948072195, -0.05372847244143486, 0.159219428896904, -0.043301768600940704, 0.009574837051331997, 0.011442882940173149, -0.02981487847864628, 0.01782333105802536, 0.055834658443927765, -0.02042297087609768, 0.07703132182359695, -0.04561787098646164, -0.04964077100157738, -0.05172077938914299, 0.0042733182199299335, 0.03110431507229805, -0.009489734657108784, -0.01667267270386219, -0.007177881896495819, -0.0006174917798489332, 0.013315386138856411, -0.08905468881130219, 0.07049357146024704, 0.006042006425559521, -0.019405288621783257, 0.05670764669775963, 0.01569891907274723, -0.04717596620321274, 0.05459095537662506, 0.010403790511190891, -0.019200777634978294, 0.00258747860789299, -0.034530505537986755, 0.026961322873830795, 0.032049234956502914, -0.04728000983595848, 0.05998096615076065, -0.00038519329973496497, 0.004130273591727018, -0.02391866408288479, 0.010569781996309757, 0.02796703763306141, 0.022833602502942085, 0.01254784595221281, -0.005976255051791668, 0.004926710389554501, -0.03539483621716499, -0.06681044399738312, -0.005540547892451286, 0.02092817798256874, 0.011030367575585842, 0.03264930471777916, 0.033929839730262756, 0.024350089952349663, -0.0014781622448936105, -0.0035581288393586874, -0.010526619851589203, 0.028982259333133698, 0.07636548578739166, -0.03982291743159294, -0.004523718263953924, -0.03731212392449379, -0.04326574504375458, -0.016564274206757545, 0.0076749189756810665, 0.02352178283035755, 0.004558035638183355, 0.009166080504655838, 0.011822049506008625, -0.025917205959558487, -0.06873437762260437, 0.04202010855078697, 0.014817191287875175, -0.006775541231036186, -0.0003066375502385199, -0.016138210892677307, -0.0029880404472351074, 0.021157916635274887, -0.04664543271064758, -0.024682944640517235, -0.04352008178830147, -0.03775943070650101, -0.03238464891910553, -0.01784140057861805, -0.0011270063696429133, -0.003479357110336423, -0.02426278032362461, 0.039124615490436554, -0.009647983126342297, 0.021036319434642792, -0.10574698448181152, -0.027167366817593575, 0.029757890850305557, 0.024121474474668503, -0.024625422433018684, -0.05652320757508278, 0.025453180074691772, -0.006007931660860777, -0.003498433856293559, 0.011201680637896061, -0.013973373919725418, 0.03410590440034866, 0.02083689533174038, -0.00987924262881279, 0.0024078504648059607, 0.03278493508696556, 0.0325046181678772, 0.023513861000537872, -0.012592623010277748, 0.016242945566773415, -0.002278966596350074, 0.06399157643318176, -0.003699721535667777, 0.010882492177188396, -0.053250912576913834, 0.017804661765694618, 0.036188237369060516, 0.039368636906147, 0.008812200278043747, -0.010908219031989574, -0.04266330599784851, -0.024796869605779648, 0.0021894231904298067, 0.009011573158204556, -0.05442781001329422, 0.0351463258266449, -0.020703598856925964, -0.01794469729065895, 0.022743938490748405, 0.02401711419224739, -0.009808817878365517, 0.020153963938355446, 0.0004166235157754272, -0.014375440776348114, 0.02470620721578598, 0.008641334250569344, 0.006037917919456959, 0.0019967223051935434, 0.05392949655652046, -0.04164488986134529, -0.019024474546313286, -0.01107534859329462, 0.028501266613602638, 0.020310066640377045, 0.04853107035160065, 0.023492097854614258, -0.010194635018706322, 0.05462878942489624, 0.02843340113759041, -0.014561968855559826, -0.04204743355512619, 0.022182270884513855, 0.059417929500341415, -0.012561683543026447, -0.06393363326787949, 0.03853023052215576, 0.04499248042702675, 0.006949328351765871, -0.009999939240515232, -0.005036207847297192, 0.01613120548427105, 0.03594564273953438, 0.041348930448293686, -0.0022713704966008663, -0.006720405537635088, 0.04876774549484253, -0.029552564024925232, -0.007426623720675707, 0.07539345324039459, 0.027067257091403008, -0.006212229374796152, -0.024919331073760986, 0.020313560962677002, -0.015082946047186852, 0.013852362520992756, -0.010573477484285831, 0.006287824362516403, -0.03765282407402992, 0.020580077543854713, 0.020575005561113358, 0.0027365311980247498, 0.014048648066818714, 0.05256493762135506, -0.020067065954208374, 0.00514370808377862, 0.04511028155684471, 0.034004271030426025, 0.05117473751306534, 0.039117783308029175, 0.010061793029308319, 0.025353165343403816, -0.04374658316373825, -0.029835429042577744, 0.024657445028424263, -0.019073795527219772, -0.002615085570141673, -0.016745248809456825, 0.03899361565709114, 0.0068912566639482975, -0.008968837559223175, 0.018367644399404526, 0.026194319128990173, 0.014740338549017906, 0.02299443446099758, 0.03858876973390579, 0.028422880917787552, -0.020874926820397377, -0.037258174270391464, -0.014936346560716629, -0.0031871714163571596, -0.052169069647789, 0.04858783632516861, -0.015284436754882336, -0.019874313846230507, 0.04117612913250923, 0.025647319853305817, 0.017658742144703865, 0.018951591104269028, -0.02106364257633686, -0.029885578900575638, -0.031596336513757706, 0.00957090500742197, 0.01498878002166748, 0.01628231629729271, 0.031292546540498734, -0.004733311012387276, -0.014804765582084656, 0.022923452779650688, -0.008933738805353642, -0.04215546324849129, -0.023621918633580208, 0.03234608843922615, 0.03214496001601219, -0.016160905361175537, 0.005674955900758505, 0.013088755309581757, -0.037395406514406204, 0.019614147022366524, -0.06760168820619583, 0.023604897782206535, 0.05002281442284584, -0.007158730644732714, -0.04153161495923996, 0.0307172741740942, 0.040036510676145554, -0.004049174953252077, -0.045873597264289856, 0.0009794490179046988, 0.0294713843613863, 0.017568953335285187, 0.016374729573726654, 0.02739774063229561, -0.03229197487235069, -0.002104619750753045, -0.0043096477165818214, -0.03576342761516571, -0.007600299548357725, -0.05082853138446808, 0.005044815596193075, 0.02639712765812874, 0.004288824275135994, -0.005676827859133482, -0.006175749469548464, -0.03739496320486069, 0.03959003835916519, 0.02003539353609085, 0.009726893156766891, 0.018195051699876785, -0.00005809332287753932, 0.00018762887339107692, -0.013589944690465927, -0.020976997911930084, 0.04183202236890793, 0.008623382076621056, 0.0020270280074328184, 0.003184582805261016, 0.037291113287210464, 0.032195813953876495, 0.0005545999156311154, 0.012997071258723736, 0.014665591530501842, 0.020861992612481117, -0.00706518953666091, -0.0325566902756691, 0.05260670930147171, -0.009081223048269749, 0.006554288323968649, 0.026936108246445656, 0.0005602034507319331, 0.01592221111059189, 0.014257936738431454, 0.020858503878116608, 0.003299357369542122, -0.018808990716934204, 0.0023863499518483877, 0.006798866204917431, -0.0061169397085905075, -0.00785240437835455, 0.024513138458132744, -0.032130468636751175, 0.01493482943624258, -0.017631735652685165, -0.04118230566382408, -0.009274108335375786, -0.01668739877641201, -0.02344413846731186, -0.03857298195362091, 0.032103266566991806, 0.01950567401945591, 0.03877349942922592, -0.008455956354737282, -0.014025627635419369, -0.020532341673970222, 0.02468564361333847, 0.029923034831881523, -0.05141105130314827, -0.0033569636289030313, 0.01637174002826214, -0.03859937563538551, 0.04077134653925896, 0.015927068889141083, 0.01331054512411356, -0.014936237595975399, 0.01741035282611847, 0.012116764672100544, -0.00815226323902607, -0.015113362111151218, 0.05687643215060234, 0.026623137295246124, 0.009192676283419132, -0.008406491950154305, -0.018688736483454704, -0.04407903179526329, 0.020260263234376907, -0.030191004276275635, 0.0197158046066761, 0.05928249657154083, -0.020528221502900124, -0.012721406295895576, -0.00221686577424407, 0.011168665252625942, -0.027061639353632927, -0.004142484627664089, -0.02687748894095421, 0.003319408278912306, 0.013788620941340923, 0.02909138798713684, -0.03314606472849846, 0.025652386248111725, 0.022520188242197037, 0.022223014384508133, -0.019653158262372017, 0.03627048805356026, 0.0023870186414569616, -0.03314097970724106, 0.03091505356132984, 0.030654044821858406, -0.034665998071432114, 0.02416328713297844, 0.004618439823389053, 0.02220056764781475, 0.010002298280596733, 0.012988011352717876, 0.0121281323954463, -0.028586680069565773, 0.0270181093364954, -0.04116513207554817, 0.05485076457262039, -0.0069243465550243855, 0.023057011887431145, 0.006973575800657272, 0.04745660349726677, 0.021972477436065674, -0.029030151665210724, 0.015417275950312614, -0.01854793168604374, 0.0657249465584755, -0.017517101019620895, 0.013916168361902237, -0.020441554486751556, 0.01805436797440052, -0.03368214890360832, -0.012134487740695477, -0.011720973998308182, -0.02562769688665867, 0.027504878118634224, 0.044695667922496796, 0.01780863292515278, 0.003937466070055962, -0.01609564572572708, 0.03329082578420639, 0.018416350707411766, 0.08273087441921234, 0.0008988018380478024, -0.007721699308604002, 0.01662462390959263, 0.04798212647438049, 0.001380744157359004, 0.026238569989800453, 0.003209966467693448, 0.0022961979266256094, 0.01593981496989727, 0.008798107504844666, 0.012703795917332172, 0.0010366934584453702, -0.014355403371155262, 0.027946695685386658, -0.014455591328442097, 0.01442953571677208, -0.005975259002298117, 0.027299413457512856, 0.0059551154263317585, -0.027943575754761696, 0.010638016276061535, -0.06465338170528412, 0.013923950493335724, -0.009792381897568703, 0.029792077839374542, -0.021476678550243378, -0.023419559001922607, 0.012562429532408714, 0.029816551133990288, 0.005932262167334557, -0.028898464515805244, 0.0007461020722985268, 0.0004369851085357368, 0.02926204539835453, -0.018478170037269592, -0.04498922824859619, -0.029517577961087227, 0.0038254268001765013, 0.015965739265084267, 0.02370552346110344, 0.05135573446750641, -0.04328697547316551, 0.021920135244727135, 0.014192258007824421, 0.0016578511567786336, -0.019253043457865715, 0.01047197449952364, 0.004517419263720512, 0.014059139415621758, -0.033337339758872986, 0.015578674152493477, -0.007599430158734322, -0.03832374885678291, 0.01864074170589447, 0.030287334695458412, -0.05910734459757805, 0.011430869810283184, 0.06061246991157532, 0.0025199006777256727, -0.0032627894543111324, -0.02864401414990425, -0.03413928300142288, 0.011567216366529465, -0.05047040060162544, -0.0025098903570324183, -0.008910462260246277, 0.04601912200450897, -0.028475670143961906, 0.018227091059088707, -0.012033962644636631, -0.0038481864612549543, -0.02144160494208336, -0.0139284897595644, 0.0268029123544693, 0.006650340743362904, -0.030798444524407387, -0.00602805195376277, 0.05637526139616966, 0.02027357928454876, 0.027427559718489647, 0.03653177246451378, -0.005588017404079437, -0.03023732267320156, -0.03171209245920181, 0.013909396715462208, -0.040753792971372604, 0.03571363538503647, -0.02921929769217968, -0.01428894978016615, -0.007233494892716408, 0.03174597769975662, -0.015915250405669212, -0.005591551307588816, -0.029169511049985886, -0.013603616505861282, -0.01874476857483387, 0.021839004009962082, -0.022632472217082977, -0.02407272346317768, 0.06044865399599075, 0.04884059727191925, -0.01552924606949091, 0.0001504211249994114, -0.011625023558735847, -0.026224125176668167, -0.014034082181751728, 0.03439311310648918, 0.04523244872689247, -0.002915262011811137, -0.001407963689416647, -0.02172103151679039, 0.000429034378612414, -0.005526998545974493, -0.024022702127695084, 0.010256540961563587, 0.008635305799543858, -0.03550194948911667, -0.03569123521447182, -0.0011337843025103211, 0.030358366668224335, 0.010240491479635239, 0.05062786862254143, -0.01370664406567812, -0.03077755682170391, -0.015866560861468315, -0.01234049629420042, -0.06352204084396362, -0.0008157066185958683, 0.014445473439991474, -0.0012550638057291508, 0.028579866513609886, 0.01991809904575348, 0.04479952156543732, 0.0024023328442126513, 0.008307099342346191, 0.02022543177008629, -0.02314491756260395, -0.03756977990269661, -0.07876251637935638, 0.02787516824901104, 0.03232874348759651, -0.02448079362511635, -0.0193940456956625, -0.00021554615523200482, -0.005298953503370285, -0.000007356090918619884, 0.014350535348057747, 0.009976615197956562, 0.046788204461336136, 0.022340921685099602, 0.03816700726747513, -0.025136049836874008, 0.0696832537651062, 0.06395495682954788, 0.04379497468471527, 0.009582987055182457, -0.01926371082663536 ]
Exploring simple optimizations for SDXL
sayakpaul
October 24, 2023
simple_sdxl_optimizations
diffusers, guide, sdxl
https://huggingface.co/blog/simple_sdxl_optimizations
Memory-efficient attention The attention blocks used in transformers modules can be a huge bottleneck, because memory increases quadratically as input sequences get longer. This can quickly take up a ton of memory and leave you with an out-of-memory error message. ๐Ÿ˜ฌ Memory-efficient attention algorithms seek to reduce the memory burden of calculating attention, whether it is by exploiting sparsity or tiling. These optimized algorithms used to be mostly available as third-party libraries that needed to be installed separately. But starting with PyTorch 2.0, this is no longer the case. PyTorch 2 introduced scaled dot product attention (SDPA), which offers fused implementations of Flash Attention, memory-efficient attention (xFormers), and a PyTorch implementation in C++. SDPA is probably the easiest way to speed up inference: if youโ€™re using PyTorch โ‰ฅ 2.0 with ๐Ÿค—ย Diffusers, it is automatically enabled by default! python from diffusers import StableDiffusionXLPipeline pipe = StableDiffusionXLPipeline.from_pretrained( "stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16, ).to("cuda") Compared to a completely unoptimized SDXL pipeline, using fp16 and SDPA takes the same amount of memory and the inference time improves to 11.4 seconds. Letโ€™s use this as the new baseline weโ€™ll compare the other optimizations to.
[ 0.07527346909046173, 0.046933602541685104, 0.03657565638422966, 0.05359087884426117, -0.024073215201497078, -0.006871266756206751, 0.004446293227374554, 0.04268508031964302, 0.01170459296554327, -0.031368277966976166, -0.024289458990097046, 0.03898675739765167, -0.04370974376797676, 0.04406093806028366, 0.01332653034478426, -0.02171286940574646, 0.08190331608057022, -0.023222725838422775, -0.04957042261958122, 0.07309540361166, 0.037539634853601456, -0.05957801640033722, 0.04839073494076729, -0.027442656457424164, -0.02815893106162548, -0.00737051060423255, -0.037091854959726334, 0.001548677682876587, -0.016969773918390274, -0.028890596702694893, -0.1409483551979065, -0.00953708402812481, 0.061526332050561905, -0.06417325884103775, 0.02225188910961151, -0.013631965965032578, -0.09320531785488129, 0.047757286578416824, 0.015840737149119377, -0.02042648009955883, 0.009632770903408527, -0.03304004669189453, -0.10280569642782211, -0.005344159435480833, -0.030749313533306122, -0.0067862169817090034, -0.10768432915210724, 0.04994199052453041, -0.05448966473340988, -0.01753585785627365, -0.09014005959033966, 0.06993050128221512, -0.04925379529595375, 0.028852079063653946, 0.021171994507312775, 0.0348687469959259, -0.01938110962510109, -0.016995197162032127, 0.0452827624976635, -0.008616304025053978, 0.0117377620190382, 0.02417822740972042, -0.02492240071296692, 0.07586980611085892, 0.04990265145897865, -0.005915835965424776, 0.07358510792255402, 0.014430300332605839, -0.05819886177778244, -0.0421951599419117, 0.057648900896310806, -0.009559597820043564, -0.025131935253739357, 0.05465893819928169, -0.07578402012586594, -0.04847002029418945, 0.044874779880046844, 0.031128624454140663, 0.02472388930618763, 0.01201515644788742, 0.025050541386008263, 0.03334127366542816, 0.0873693898320198, 0.028149621561169624, 0.03183908015489578, 0.0005800601211376488, 0.047888197004795074, -0.06943097710609436, -0.03768042102456093, 0.01307195145636797, -0.003371700644493103, -0.05780619755387306, -0.005525113083422184, -0.027336252853274345, 0.0313824787735939, 0.00627800403162837, -0.030833914875984192, -0.025292670354247093, 0.013682379387319088, -0.012956207618117332, 0.014926226809620857, -0.09512262046337128, 0.025608066469430923, -0.05032655969262123, -0.033179786056280136, 0.020631246268749237, -0.021692484617233276, -0.059591565281152725, -0.0073745460249483585, 0.04516732692718506, -0.08018261939287186, 0.09011729806661606, -0.00034585720277391374, 0.024374479427933693, -0.05653354525566101, -0.023335875943303108, -0.053977761417627335, 0.09391317516565323, -0.024592628702521324, 0.060468241572380066, 0.0016329684294760227, 0.10088413208723068, 0.04619789123535156, -0.00333930435590446, -0.02966691367328167, 0.07074897736310959, 0.03455385938286781, 0.020015887916088104, -0.007003518752753735, 0.004664669279009104, 0.030288053676486015, -0.06371196359395981, 0.037366025149822235, -0.008467765524983406, 0.029948726296424866, -0.06215967610478401, -0.024423735216259956, -0.0341210775077343, -0.040564198046922684, -0.022357439622282982, -0.016601810231804848, 0.05514960736036301, 0.054848458617925644, -0.019086260348558426, 0.06868728250265121, -0.036396004259586334, -0.14746172726154327, 0.0627407431602478, 0.06875978410243988, -0.004358062520623207, -0.037721436470746994, 0.039734162390232086, -0.10672011971473694, -0.011281072162091732, -0.010945438407361507, 0.025682520121335983, -0.002477182075381279, -0.06216079741716385, -0.07593447715044022, 0.01296423003077507, -0.03071894869208336, -0.003090440295636654, 0.01392657682299614, 0.026653354987502098, 0.05644065886735916, -0.013071602210402489, 0.048325736075639725, 0.020709067583084106, 0.02599715255200863, 0.04736688360571861, 0.01572326384484768, 0.03138558194041252, 0.015356536954641342, -0.006233810447156429, -0.03276916965842247, 0.01394316740334034, 0.03369661420583725, 0.10069002956151962, -0.021022863686084747, -0.02818814478814602, -0.04818267002701759, 0.018681881949305534, -0.019675783812999725, 0.11457134038209915, 0.029461650177836418, -0.09818430244922638, 0.09165714681148529, -0.04481904208660126, -0.028879964724183083, -0.020986607298254967, -0.041964396834373474, 0.03561338409781456, 0.007130463141947985, -0.05051301792263985, 0.08215633779764175, -0.02773703821003437, -0.04593370109796524, 0.07150339335203171, 0.05583051219582558, 0.0423613004386425, -0.029079340398311615, 0.00439240038394928, -0.03025476075708866, 0.01747848652303219, 0.02097436599433422, -0.024712271988391876, -0.029043851420283318, -0.021186379715800285, 0.04962071403861046, -0.011201908811926842, 0.01704140566289425, -0.14893314242362976, 0.010533690452575684, -0.04812026768922806, -0.02991870418190956, -0.05344465374946594, 0.019010525196790695, 0.009429353289306164, 0.0280116256326437, -0.0033565659541636705, 0.0736047551035881, -0.04475807398557663, -0.08238356560468674, 0.0010289829224348068, -0.05614336207509041, 0.07180148363113403, 0.0343441441655159, -0.03928553685545921, 0.04547671973705292, -0.05713387578725815, -0.015001271851360798, -0.044544342905282974, -0.027912098914384842, 0.015516757033765316, -0.030034948140382767, -0.06662731617689133, -0.069811150431633, 0.09109970182180405, -0.002971560461446643, -0.04778959974646568, -0.0025682973209768534, 0.049432311207056046, 0.020541373640298843, 0.015353393740952015, 0.02778586745262146, -0.011445566080510616, 0.013625752180814743, -0.014178656041622162, -0.004823432769626379, 0.007280542980879545, -0.04219883307814598, 0.04237331449985504, -0.02166988141834736, -0.03651713579893112, 0.005533202551305294, 0.03163347393274307, 0.01007757056504488, -0.017160510644316673, 0.005801137071102858, 0.03241797536611557, 0.024605348706245422, 0.031191851943731308, 0.013951986096799374, -0.00668702507391572, -0.027355454862117767, -0.050250712782144547, 0.0382707454264164, 0.001516161486506462, 0.0032504263799637556, 0.004523040261119604, 0.007261569146066904, 0.017837926745414734, 0.01596827246248722, 0.005989023484289646, 0.0029319063760340214, 0.01916121505200863, 0.053106799721717834, -0.021237732842564583, -0.01055806502699852, -0.035422347486019135, 0.002486443379893899, 0.0036872001364827156, 0.030574114993214607, 0.02755161188542843, -0.0031290496699512005, 0.028142930939793587, 0.011761325411498547, 0.016119174659252167, -0.03136369585990906, 0.018955305218696594, -0.01148956548422575, -0.016218936070799828, 0.0020616943947970867, -0.04372400417923927, -0.011162237264215946, 0.006333221215754747, -0.05108720809221268, -0.05208441615104675, -0.03367755562067032, -0.034500185400247574, -0.012323590926826, 0.0006041728775016963, -0.006688357330858707, -0.007154906168580055, -0.028489770367741585, -0.00741150788962841, -0.0466768741607666, 0.012736797332763672, -0.08780214935541153, -0.015932610258460045, -0.012071612291038036, -0.01671757362782955, -0.004427931271493435, -0.029208868741989136, 0.003752501681447029, 0.04069513455033302, -0.0032170198392122984, 0.015519469976425171, -0.006748212967067957, 0.012215462513267994, -0.018917128443717957, 0.020488595589995384, 0.00033000935218296945, -0.0156499482691288, 0.05187102034687996, -0.006707518827170134, 0.06688474863767624, -0.00877496600151062, 0.0011528715258464217, 0.029971813783049583, 0.001401262590661645, -0.015864988788962364, 0.006624478846788406, 0.02774764969944954, -0.007748079020529985, 0.02237653359770775, 0.013921584002673626, 0.011706480756402016, -0.023132437840104103, -0.037769973278045654, 0.00972351711243391, 0.021721135824918747, -0.06839917600154877, 0.04150797054171562, 0.021154312416911125, -0.042638279497623444, 0.008156216703355312, 0.033575911074876785, 0.06587997823953629, -0.03550571948289871, 0.008506504818797112, -0.023903310298919678, 0.04871957376599312, -0.034401703625917435, -0.0047376202419400215, -0.053576480597257614, 0.01466479990631342, -0.04698574170470238, -0.008610697463154793, -0.002871998120099306, 0.028858274221420288, 0.050091009587049484, -0.0071501280181109905, 0.025272725149989128, 0.009269933216273785, 0.007709522265940905, 0.021858597174286842, 0.028777828440070152, -0.02592744491994381, 0.07376400381326675, 0.028110699728131294, -0.006702618673443794, -0.04727372154593468, 0.015478569082915783, 0.031245270743966103, -0.050787072628736496, -0.015738001093268394, 0.034030187875032425, -0.050355613231658936, 0.047270458191633224, 0.03793657571077347, 0.0030750150326639414, -0.030031491070985794, 0.057650238275527954, 0.0014652458485215902, 0.0035008499398827553, 0.03878238424658775, 0.005499138962477446, -0.015949681401252747, -0.02669869177043438, -0.030025793239474297, -0.007571876514703035, 0.04388746991753578, 0.030264295637607574, -0.012062384746968746, -0.019291481003165245, 0.022193748503923416, 0.00037561196950264275, -0.00023295822029467672, -0.010977407917380333, 0.007220717146992683, -0.05622042715549469, -0.001553039881400764, -0.003449313808232546, 0.01113332249224186, 0.018429283052682877, 0.0398687869310379, -0.01077566109597683, 0.03239082172513008, -0.0443117693066597, -0.005836490076035261, 0.016100941225886345, -0.05179174244403839, -0.016119742766022682, -0.03193829953670502, 0.01694127731025219, 0.014932514168322086, -0.017474371939897537, 0.03299065679311752, 0.009136014617979527, -0.022075362503528595, 0.016785524785518646, 0.024766935035586357, 0.04793843254446983, -0.0015015755780041218, -0.0006182993529364467, -0.039996806532144547, 0.034020356833934784, -0.08059301972389221, 0.0610719732940197, 0.019329970702528954, -0.02427128702402115, 0.06165485084056854, 0.02091480977833271, 0.01523534208536148, 0.029556145891547203, -0.00022133238962851465, -0.023628827184438705, -0.02145525813102722, 0.021885935217142105, 0.028637345880270004, 0.02290109172463417, 0.032697346061468124, -0.01664341613650322, -0.03928313031792641, 0.00842562410980463, 0.00008466016879538074, -0.029461655765771866, -0.0216476209461689, -0.02836904302239418, 0.05550738424062729, -0.06514040380716324, -0.009566542692482471, 0.00024758532526902854, -0.052020832896232605, 0.02900819294154644, -0.0699487254023552, 0.015105467289686203, 0.04691668599843979, -0.035620544105768204, -0.030644383281469345, 0.03674309700727463, 0.07982659339904785, -0.024702174589037895, -0.006144083105027676, -0.03560399264097214, 0.03790827468037605, 0.010742483660578728, -0.020877335220575333, 0.02468010224401951, -0.04589298740029335, 0.037117697298526764, 0.07403332740068436, -0.020074985921382904, 0.002947503235191107, -0.08100266009569168, 0.011210615746676922, -0.02696475014090538, -0.014256109483540058, 0.028316102921962738, -0.00708509748801589, 0.008525421842932701, 0.011092180386185646, 0.004449808970093727, 0.027443937957286835, 0.032836612313985825, -0.0018457797123119235, -0.008147329092025757, -0.006858524400740862, -0.026148447766900063, 0.030150018632411957, -0.0008154257084243, 0.01612487994134426, 0.03255521133542061, 0.0017661208985373378, 0.07368186116218567, -0.012423375621438026, 0.010732852853834629, 0.026610184460878372, 0.007462246809154749, -0.027196431532502174, -0.0020659512374550104, 0.04374901205301285, -0.026449523866176605, -0.030413921922445297, 0.04123956710100174, -0.0034196162596344948, 0.02433887869119644, 0.030722692608833313, 0.0024579521268606186, -0.028109002858400345, -0.03403876721858978, 0.0081612104550004, 0.026673104614019394, 0.009915284812450409, 0.004727894440293312, 0.0000945144856814295, -0.0453660823404789, 0.006960988510400057, -0.006235321052372456, -0.03981808200478554, -0.021813157945871353, -0.011207160539925098, -0.011248641647398472, -0.011981445364654064, 0.021281475201249123, 0.03376978263258934, 0.028684068471193314, 0.024363914504647255, -0.009874260984361172, 0.02520899474620819, 0.027594879269599915, 0.008094916120171547, -0.04867842048406601, -0.014252941124141216, 0.006298842839896679, -0.035050999373197556, 0.04423617199063301, 0.0221418384462595, 0.02768731862306595, -0.004560771863907576, 0.02768668346107006, -0.004503859207034111, -0.009336099959909916, -0.007056878879666328, 0.04438285157084465, 0.028144828975200653, 0.011252511292696, -0.023704275488853455, -0.013144562020897865, -0.03777340054512024, 0.05698251351714134, -0.041975997388362885, -0.00002652496550581418, 0.054093874990940094, -0.06281481683254242, -0.00648385239765048, -0.022611083462834358, 0.02756602130830288, -0.01286837738007307, -0.018004946410655975, 0.0018308217404410243, 0.007621533703058958, 0.008517925627529621, -0.00789488386362791, -0.03502278029918671, 0.054338015615940094, 0.023351840674877167, 0.037170544266700745, -0.02864580601453781, 0.025515584275126457, 0.013506554998457432, -0.022684277966618538, 0.014582275412976742, 0.010695898905396461, -0.04586032032966614, 0.011267967522144318, 0.04092962294816971, 0.005490835756063461, 0.020837748423218727, -0.001723006134852767, 0.0015646266983821988, -0.040950313210487366, -0.030244192108511925, -0.0005675365100614727, 0.008722006343305111, -0.03193668648600578, 0.05705786496400833, 0.06320249289274216, 0.04034014418721199, 0.015988439321517944, -0.018771035596728325, 0.029666787013411522, -0.00571682071313262, 0.057880837470293045, -0.003899418283253908, -0.03246764466166496, -0.01944558508694172, -0.03254655376076698, 0.024567263200879097, -0.0064322203397750854, -0.0048789395950734615, -0.05070411041378975, 0.00524030439555645, 0.04950642213225365, -0.0055999914184212685, 0.03422867879271507, -0.05027506500482559, 0.031199419870972633, 0.009053073823451996, 0.05038420110940933, -0.005796788260340691, 0.0019042895874008536, -0.009111500345170498, 0.024915363639593124, 0.013105949386954308, -0.014505055733025074, 0.018636776134371758, 0.004054809920489788, 0.005718547385185957, 0.014094935730099678, 0.027576282620429993, 0.012556380592286587, -0.038280289620161057, -0.0007214433280751109, -0.04643375054001808, -0.008281887508928776, 0.039671096950769424, 0.025268936529755592, -0.024365544319152832, 0.04017578437924385, -0.012908249162137508, -0.01748780906200409, 0.021520519629120827, 0.01744968630373478, -0.02798140048980713, -0.014249859377741814, -0.009833261370658875, 0.0039777751080691814, -0.016500279307365417, 0.010929422453045845, 0.001735773286782205, 0.01159584429115057, -0.004109914414584637, 0.06448139995336533, -0.0040191044099628925, -0.005119517911225557, -0.03968960419297218, 0.01084204763174057, 0.026383597403764725, -0.014157107099890709, 0.03952283784747124, -0.04609393700957298, -0.016577595844864845, 0.02631344273686409, -0.0524008683860302, -0.0294816754758358, 0.03192606568336487, 0.003156208200380206, 0.010942663066089153, -0.036093514412641525, 0.03981424495577812, -0.02446329966187477, -0.035444408655166626, 0.031453315168619156, 0.02616647258400917, 0.009448164142668247, 0.007734215352684259, 0.05017389729619026, 0.023837203159928322, 0.007762921042740345, -0.02085077203810215, -0.014084921218454838, -0.013318553566932678, -0.00876748375594616, -0.012830154970288277, 0.009502733126282692, 0.043765388429164886, 0.021270407363772392, 0.03325886279344559, -0.04311718791723251, -0.028000004589557648, 0.011422339826822281, 0.0037543675862252712, 0.04423084110021591, 0.027154844254255295, 0.00677500618621707, -0.04322380945086479, 0.07146154344081879, 0.008957576006650925, -0.007205666974186897, 0.05477926507592201, 0.011287807486951351, 0.030449017882347107, -0.034945640712976456, -0.030062781646847725, -0.038447268307209015, -0.015485873445868492, -0.022286860272288322, -0.028665591031312943, -0.012679066509008408, 0.07553134113550186, -0.0018516926793381572, 0.010344487614929676, -0.02314019203186035, -0.00808648020029068, -0.044319525361061096, 0.018188806250691414, -0.009264246560633183, 0.010866796597838402, 0.04687901586294174, 0.06824752688407898, 0.006694369483739138, -0.012343673035502434, -0.06855159252882004, -0.006371633615344763, -0.025756407529115677, 0.0032742307521402836, 0.04560500383377075, -0.018219521269202232, -0.02202421985566616, -0.06900732964277267, -0.05174487456679344, 0.010781332850456238, -0.014973041601479053, -0.01535819936543703, -0.003191059222444892, -0.03603687509894371, -0.016417181119322777, -0.008731730282306671, 0.01822783425450325, -0.006933602970093489, 0.044170379638671875, 0.0003206211549695581, -0.027436040341854095, 0.02766020968556404, 0.0011060722172260284, -0.02552284114062786, -0.010270597413182259, 0.02402249164879322, 0.017386259511113167, 0.03702590614557266, 0.01722443848848343, 0.030100718140602112, -0.016435613855719566, 0.02507873810827732, 0.018539266660809517, -0.014638739638030529, -0.04959674924612045, -0.05794738978147507, 0.04022262245416641, 0.03886144235730171, -0.008851239457726479, -0.034671101719141006, -0.009441464208066463, 0.0015030638314783573, 0.002710178028792143, 0.005954021587967873, -0.01786140725016594, 0.014739565551280975, 0.00007174390339059755, 0.013767988421022892, 0.009591853246092796, 0.035732414573431015, 0.027117833495140076, 0.020125310868024826, 0.0019964436069130898, -0.02504129149019718 ]
Exploring simple optimizations for SDXL
sayakpaul
October 24, 2023
simple_sdxl_optimizations
diffusers, guide, sdxl
https://huggingface.co/blog/simple_sdxl_optimizations
Model CPU offloading Model offloading saves memory by loading the UNet into the GPU memory while the other components of the diffusion model (text encoders, VAE) are loaded onto the CPU. This way, the UNet can run for multiple iterations on the GPU until it is no longer needed. python from diffusers import StableDiffusionXLPipeline pipe = StableDiffusionXLPipeline.from_pretrained( "stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16, ).to("cuda") pipe.enable_model_cpu_offload() Compared to the baseline, it now takes 20.2GB of memory which saves you 1.5GB of memory.
[ -0.0008800859795883298, 0.024162722751498222, -0.011363943107426167, -0.012957800179719925, -0.023488208651542664, 0.01355711929500103, -0.007676240988075733, 0.017908351495862007, -0.0048647052608430386, -0.04183206334710121, -0.05236491560935974, 0.023650122806429863, -0.010948270559310913, 0.020705822855234146, -0.011362627148628235, -0.05010920390486717, 0.044331539422273636, -0.06376263499259949, -0.06822491437196732, 0.08462480455636978, 0.04715845361351967, -0.05886361375451088, 0.004653507843613625, 0.0078897038474679, -0.110275998711586, -0.061432454735040665, -0.012817814946174622, 0.011859175749123096, 0.024140872061252594, 0.008584960363805294, -0.12492813169956207, 0.014200977981090546, 0.02342071384191513, -0.06210467219352722, 0.03746757656335831, -0.02375146932899952, -0.05017786845564842, 0.06201125308871269, 0.08586815744638443, -0.019755501300096512, -0.017255056649446487, 0.07654993236064911, -0.09013872593641281, 0.043206870555877686, 0.0419878251850605, -0.05295567214488983, -0.1020665243268013, 0.010193108581006527, -0.06281295418739319, -0.0009890440851449966, -0.10776453465223312, 0.03842281177639961, -0.041014235466718674, 0.009295796044170856, 0.009129592217504978, 0.06380731612443924, 0.037314578890800476, 0.0016060146735981107, 0.03342029079794884, -0.007444269489496946, 0.023230133578181267, 0.017499515786767006, -0.03576894477009773, 0.029998179525136948, 0.055612895637750626, -0.010956314392387867, -0.008994405157864094, -0.012296171858906746, -0.03034086339175701, -0.0761365070939064, 0.017755592241883278, -0.044930506497621536, 0.017280882224440575, -0.0131535604596138, -0.055890947580337524, -0.055688340216875076, 0.0728440210223198, 0.04908139258623123, 0.07348839193582535, 0.05752933770418167, 0.013433528132736683, 0.0687301754951477, 0.006040177308022976, -0.0026400561910122633, 0.038541801273822784, -0.019222255796194077, 0.03549494594335556, -0.05161677673459053, -0.0035349971149116755, -0.055913303047418594, -0.017177753150463104, -0.003643646603450179, 0.02527165226638317, -0.026681724935770035, 0.06467162072658539, 0.022037943825125694, -0.047376327216625214, 0.015433678403496742, 0.016516458243131638, 0.007282049860805273, 0.03531693294644356, -0.11923641711473465, -0.027058051899075508, -0.09537697583436966, -0.018722357228398323, 0.05872044712305069, -0.039016153663396835, -0.07537463307380676, -0.03529715538024902, 0.017466146498918533, -0.03460576385259628, 0.04124622419476509, -0.10740560293197632, -0.0017328133108094335, -0.12089863419532776, 0.02564297989010811, -0.02787555754184723, -0.0027000303380191326, 0.004590257070958614, 0.08313276618719101, 0.007086486089974642, 0.05796337127685547, 0.08601551502943039, -0.02265911176800728, -0.0317373052239418, 0.08965142071247101, 0.04290354624390602, -0.00008591524237999693, 0.005406903102993965, 0.028480159118771553, 0.04105502739548683, -0.031817276030778885, 0.09522121399641037, -0.053602803498506546, 0.05773713439702988, -0.08987696468830109, -0.08084235340356827, -0.028296004980802536, -0.001896918984130025, -0.005962258204817772, -0.07296106964349747, 0.022297604009509087, 0.035285379737615585, -0.004356172867119312, 0.0043992288410663605, 0.005190914962440729, -0.028238072991371155, 0.03561871126294136, 0.03104240819811821, 0.021140776574611664, -0.11441247910261154, 0.033996328711509705, -0.043350700289011, -0.05706493929028511, 0.02447190321981907, 0.05603541061282158, -0.006827187724411488, -0.0010980626102536917, -0.04307721182703972, 0.027391670271754265, -0.01721860095858574, -0.027699090540409088, -0.0328492745757103, 0.013933952897787094, 0.03030306287109852, 0.003625295590609312, 0.018805300816893578, 0.025617249310016632, 0.06478064507246017, -0.040792983025312424, 0.018828660249710083, -0.08929505944252014, 0.08839155733585358, -0.01163920946419239, 0.010958200320601463, 0.025865089148283005, 0.020456107333302498, 0.06216238811612129, 0.008102367632091045, -0.0724421814084053, -0.07981644570827484, 0.026851652190089226, 0.005691916216164827, 0.058504629880189896, 0.020818406715989113, -0.11569947749376297, 0.034968022257089615, -0.09407633543014526, -0.045322783291339874, 0.05728774145245552, 0.049858301877975464, 0.002039203653112054, 0.049015942960977554, -0.012907372787594795, 0.047958631068468094, -0.008038712665438652, -0.03831596300005913, 0.03501598909497261, 0.057993289083242416, 0.020710013806819916, -0.016524789854884148, 0.012909522280097008, -0.008351433090865612, -0.002040393650531769, -0.061605874449014664, -0.02275397814810276, 0.024282017722725868, -0.07559560239315033, 0.009367439895868301, 0.02633614093065262, -0.00898136105388403, -0.05827876552939415, -0.006102097220718861, -0.0687718614935875, -0.04038672894239426, -0.0653352364897728, -0.021028652787208557, -0.03513474762439728, 0.02988540381193161, -0.09020663797855377, 0.0823838859796524, 0.009088759310543537, -0.01697760447859764, -0.0015247628325596452, -0.06160278618335724, 0.062311768531799316, 0.03144927695393562, -0.011250817216932774, 0.02626027725636959, -0.09164785593748093, -0.05782238021492958, -0.07156834751367569, -0.07476910948753357, 0.03786347806453705, -0.004539268556982279, -0.016269775107502937, -0.013670720160007477, 0.09761451184749603, 0.04623595252633095, -0.06665724515914917, 0.015717599540948868, 0.008930398151278496, -0.03187917545437813, 0.01049408782273531, 0.029748644679784775, 0.015694301575422287, 0.02048531547188759, -0.016981694847345352, -0.06443274766206741, -0.019995519891381264, 0.040513984858989716, -0.025214023888111115, -0.0484328456223011, -0.032987333834171295, 0.0020178232807666063, 0.005610290914773941, 0.003921582363545895, -0.010673027485609055, -0.00032059557270258665, 0.05800794064998627, 0.004597266670316458, 0.00481677008792758, -0.04715776816010475, -0.004994196817278862, 0.0074616484344005585, -0.017092986032366753, 0.017327530309557915, -0.047493308782577515, 0.022038903087377548, -0.03523416444659233, 0.015934640541672707, 0.014455616474151611, 0.004657292738556862, 0.010375308804214, 0.02597280591726303, 0.06901532411575317, 0.03506305813789368, -0.03195640444755554, -0.021433888003230095, -0.05002056434750557, 0.005439790431410074, -0.034704599529504776, 0.002050706185400486, 0.012661087326705456, -0.018547656014561653, 0.041857440024614334, 0.030152441933751106, -0.022422892972826958, -0.031201135367155075, 0.013845743611454964, 0.0037170122377574444, 0.006440603639930487, 0.017555853351950645, -0.01768544502556324, 0.003974685911089182, 0.022351305931806564, -0.00940234586596489, -0.03334692493081093, 0.008162222802639008, -0.004038422368466854, -0.011104774661362171, -0.021004896610975266, -0.008461818099021912, 0.013683417811989784, -0.05651712045073509, 0.03218051418662071, 0.013545549474656582, 0.002434509340673685, -0.07203532755374908, 0.011386407539248466, -0.014565078541636467, 0.013871761038899422, 0.02240649238228798, 0.00276158656924963, -0.00551499892026186, 0.031701549887657166, 0.02979373186826706, 0.036208298057317734, 0.0014431661693379283, 0.022991079837083817, 0.029480870813131332, 0.05234936624765396, 0.033309318125247955, -0.007892864756286144, 0.085059754550457, 0.018525710329413414, -0.0037710508331656456, -0.011242681182920933, -0.012012911029160023, -0.007763891480863094, -0.00532793253660202, 0.025111159309744835, 0.0021497486159205437, 0.017998680472373962, 0.0020300925243645906, -0.0031886103097349405, -0.013969192281365395, -0.010683976113796234, -0.0112100625410676, -0.05789998546242714, 0.010693280957639217, 0.02018965594470501, -0.023274073377251625, 0.0030897401738911867, 0.017650606110692024, -0.0023701272439211607, 0.05056354030966759, 0.032384879887104034, 0.020050089806318283, -0.001840470707975328, 0.021850554272532463, 0.001120094326324761, 0.03467581421136856, -0.005115090403705835, 0.034385040402412415, 0.000568826450034976, 0.006968491245061159, -0.0022213044576346874, 0.010909022763371468, -0.00960307102650404, 0.024238310754299164, 0.041763003915548325, -0.022650811821222305, 0.001076829037629068, -0.01801820658147335, 0.03803424537181854, 0.04497356340289116, 0.016982249915599823, -0.05218350514769554, -0.014862898737192154, 0.05623217672109604, -0.010735481046140194, -0.01808767020702362, 0.03330036625266075, 0.02663540653884411, -0.005822077393531799, -0.015124401077628136, 0.026502637192606926, -0.03155820816755295, 0.034560635685920715, 0.02747398242354393, 0.008457664400339127, -0.060614507645368576, 0.024042487144470215, 0.007480054162442684, -0.00590524123981595, 0.028085982427001, 0.018784239888191223, -0.041178904473781586, -0.009248956106603146, 0.004058951511979103, -0.017734471708536148, -0.0030162474140524864, 0.0009755704086273909, -0.004918109159916639, -0.0057893372140824795, 0.01931791938841343, 0.030654873698949814, 0.013166554272174835, -0.03783509507775307, 0.016897402703762054, -0.006901904940605164, 0.03195462003350258, 0.022421611472964287, 0.013199612498283386, 0.049460094422101974, 0.019806046038866043, -0.02179870754480362, 0.006390556693077087, -0.047698330134153366, -0.004179149866104126, -0.008252767845988274, -0.012995314784348011, -0.0062848469242453575, -0.022534823045134544, -0.02603045478463173, 0.0326959602534771, 0.0009885580511763692, -0.001358680659905076, -0.01424496155232191, 0.01622585766017437, 0.03777477145195007, 0.02139996364712715, 0.05905741825699806, 0.005165893118828535, -0.026811741292476654, 0.02823670208454132, 0.044813595712184906, -0.040307480841875076, 0.04724874347448349, 0.04615847393870354, -0.04258190840482712, 0.015574673190712929, 0.051345422863960266, -0.013407173566520214, -0.021618817001581192, 0.005516794975847006, -0.02248683013021946, -0.0666743814945221, -0.0001049835846060887, 0.044016871601343155, 0.04620761796832085, -0.001604827819392085, -0.01807943731546402, -0.03889339417219162, 0.036890462040901184, 0.03247564658522606, -0.011289126239717007, -0.030920440331101418, -0.027522148564457893, 0.004401684273034334, -0.048776790499687195, 0.002412681467831135, 0.022727547213435173, -0.02158810943365097, 0.03812381252646446, -0.05029422789812088, 0.03778112307190895, 0.010756715200841427, 0.010122367180883884, -0.0579611100256443, 0.015039175748825073, 0.033470336347818375, 0.029170075431466103, -0.029630040749907494, -0.011820749379694462, -0.017162054777145386, 0.03633003681898117, -0.01750977709889412, 0.024748824536800385, -0.006514162756502628, 0.01598920114338398, -0.002753352513536811, -0.00998362060636282, -0.007080055773258209, -0.06967256963253021, 0.0033895873930305243, -0.02497846819460392, 0.010096428915858269, 0.030356071889400482, -0.008173162117600441, 0.006543417926877737, 0.03949982300400734, 0.010197518393397331, 0.03183223679661751, 0.0368514247238636, -0.02516215853393078, -0.01734977401793003, 0.013628155924379826, 0.00744210509583354, 0.0199270062148571, -0.01256493665277958, 0.008806783705949783, 0.05135098099708557, 0.03276781365275383, 0.05891485884785652, 0.009197410196065903, 0.02591761201620102, 0.02128271758556366, 0.018875904381275177, 0.001586557482369244, -0.003416211111471057, 0.01845475472509861, 0.006641041021794081, -0.012049583718180656, 0.028938334435224533, 0.008743885904550552, -0.04440348595380783, 0.022667789831757545, 0.05035146325826645, -0.025898730382323265, -0.01898731291294098, 0.0050504193641245365, 0.02539806254208088, 0.023762065917253494, -0.01350998692214489, 0.06603354215621948, 0.009304297156631947, 0.007022612728178501, -0.01876555196940899, -0.02779688499867916, 0.006760537624359131, 0.015081732533872128, 0.03798677399754524, -0.027406100183725357, 0.025388307869434357, 0.02543039247393608, 0.05032028630375862, 0.0235611479729414, -0.007997767999768257, -0.03641580790281296, -0.017539819702506065, 0.034994643181562424, -0.0484478622674942, 0.03164143115282059, -0.04347308352589607, -0.0003745613794308156, 0.0033399772364646196, 0.030361171811819077, 0.002710332628339529, 0.019714752212166786, 0.025842435657978058, 0.04308943450450897, -0.009823417291045189, 0.010592990554869175, 0.03674037754535675, 0.026987828314304352, 0.008312646299600601, -0.009770084172487259, -0.018444932997226715, -0.06193559989333153, 0.027802713215351105, -0.027445446699857712, 0.04302680119872093, 0.03348551690578461, -0.031027287244796753, 0.019902780652046204, 0.0030195326544344425, -0.014846294187009335, -0.008615567348897457, -0.013954132795333862, -0.029255591332912445, -0.025299618020653725, -0.00625451048836112, 0.005314289126545191, -0.05272279307246208, 0.03823535144329071, -0.014702079817652702, 0.00877419300377369, -0.013574174605309963, 0.029891587793827057, -0.007612713612616062, -0.014782249927520752, 0.03010881133377552, -0.00484820082783699, -0.026599755510687828, 0.015719419345259666, 0.018838556483387947, -0.010688412003219128, 0.006507541984319687, -0.055701564997434616, 0.010331526398658752, -0.016588130965828896, 0.018532326444983482, 0.037063661962747574, 0.03074323944747448, -0.06222197413444519, 0.06084635481238365, 0.015039307996630669, 0.052290093153715134, 0.025170905515551567, -0.012365957722067833, -0.0033916982356458902, 0.00090433080913499, 0.07321792840957642, 0.029169689863920212, -0.04297696053981781, 0.033581048250198364, -0.012269331142306328, -0.009523109532892704, -0.02034434862434864, -0.03657858446240425, -0.037609413266181946, 0.019637025892734528, 0.018445895984768867, 0.015001046471297741, 0.027759065851569176, -0.041108135133981705, 0.04161731153726578, 0.013071304187178612, 0.04925210773944855, 0.016533106565475464, 0.01767425611615181, -0.02209155634045601, 0.017765961587429047, 0.018817458301782608, -0.010665951296687126, 0.00971499178558588, 0.026634013280272484, -0.0029330544639378786, 0.013571220450103283, 0.03023729845881462, 0.07580922544002533, -0.029034381732344627, 0.0281449593603611, 0.0015508751384913921, -0.01776137575507164, -0.02424832247197628, -0.01570313051342964, -0.0403408408164978, -0.01287104096263647, 0.0058676921762526035, -0.059976086020469666, 0.04060578718781471, -0.021977925673127174, -0.03234069049358368, -0.012282907962799072, 0.013501028530299664, -0.01604735292494297, -0.03102237544953823, 0.04103175178170204, -0.012789162807166576, 0.002355660079047084, 0.004513584077358246, 0.004820947535336018, 0.03555034101009369, -0.035487011075019836, -0.022679753601551056, 0.0069643124006688595, 0.049495913088321686, 0.009637388400733471, 0.04577545076608658, -0.003132487880066037, -0.009814412333071232, 0.018692675977945328, -0.027829159051179886, 0.014175300486385822, 0.03199533745646477, -0.010334963910281658, 0.03860820084810257, -0.0031834158580750227, 0.003418274223804474, -0.008682923391461372, -0.06811794638633728, 0.006006224546581507, -0.0015005050227046013, -0.023257393389940262, 0.02793990820646286, 0.04553646221756935, 0.06377919018268585, 0.021774984896183014, 0.005860376637428999, -0.04419819638133049, -0.030698196962475777, -0.02896987646818161, -0.017881223931908607, -0.012861374765634537, -0.0050530266016721725, 0.009434716776013374, -0.016956979408860207, -0.024155259132385254, -0.020130038261413574, -0.02422068826854229, -0.04490382969379425, 0.01701950654387474, -0.03554047271609306, 0.02150711417198181, -0.017968373373150826, 0.058420293033123016, -0.026968812569975853, 0.018404962494969368, 0.050662215799093246, -0.0003393058432266116, -0.011490331962704659, -0.037434231489896774, 0.01775430142879486, -0.013874721713364124, 0.0013134465552866459, 0.02051229029893875, -0.013811632059514523, -0.014813954941928387, 0.02254818007349968, -0.029379982501268387, 0.02087257243692875, -0.015209442004561424, -0.030880426988005638, -0.036487508565187454, 0.013667026534676552, 0.01771489903330803, -0.0039213476702570915, 0.05603000521659851, 0.09434830397367477, 0.003427183721214533, 0.04529551789164543, -0.08341772854328156, 0.004095701966434717, -0.0018142972839996219, 0.07809967547655106, 0.04293596372008324, 0.018743708729743958, -0.051326971501111984, -0.03344893828034401, -0.027605220675468445, 0.012664347887039185, -0.06642842292785645, -0.020582541823387146, -0.003965532407164574, -0.019784236326813698, -0.02415650151669979, 0.0019063972868025303, 0.01064271293580532, 0.038065146654844284, 0.07377200573682785, 0.01902533881366253, -0.026283802464604378, 0.025413373485207558, 0.043670959770679474, -0.053242165595293045, -0.01712758280336857, -0.010919621214270592, -0.018006397411227226, 0.027173813432455063, 0.0021085336338728666, 0.04043419659137726, 0.032264940440654755, 0.0094916932284832, 0.0001861623750301078, -0.006872471421957016, -0.02280721627175808, -0.006597516126930714, -0.01919773407280445, 0.04968327656388283, 0.0037068838719278574, -0.03446302190423012, -0.03438330069184303, 0.019223112612962723, 0.022145459428429604, -0.023648319765925407, -0.011597737669944763, -0.0008972946088761091, 0.02568291872739792, -0.008976802229881287, -0.009410439059138298, 0.040974367409944534, 0.05404660105705261, -0.01898878626525402, -0.045782219618558884, 0.010050186887383461 ]
Exploring simple optimizations for SDXL
sayakpaul
October 24, 2023
simple_sdxl_optimizations
diffusers, guide, sdxl
https://huggingface.co/blog/simple_sdxl_optimizations
Caching computations Any text-conditioned image generation model typically uses a text encoder to compute embeddings from the input prompt. SDXL uses two text encoders! This contributes quite a bit to the inference latency. However, since these embeddings remain unchanged throughout the reverse diffusion process, we can precompute them and reuse them as we go. This way, after computing the text embeddings, we can remove the text encoders from memory. First, load the text encoders and their corresponding tokenizers and compute the embeddings from the input prompt: python tokenizers = [tokenizer, tokenizer_2] text_encoders = [text_encoder, text_encoder_2] ( prompt_embeds, negative_prompt_embeds, pooled_prompt_embeds, negative_pooled_prompt_embeds ) = encode_prompt(tokenizers, text_encoders, prompt) Next, flush the GPU memory to remove the text encoders: jsx del text_encoder, text_encoder_2, tokenizer, tokenizer_2 flush() Now the embeddings are good to go straight to the SDXL pipeline: python from diffusers import StableDiffusionXLPipeline pipe = StableDiffusionXLPipeline.from_pretrained( "stabilityai/stable-diffusion-xl-base-1.0", text_encoder=None, text_encoder_2=None, tokenizer=None, tokenizer_2=None, torch_dtype=torch.float16, ).to("cuda") call_args = dict( prompt_embeds=prompt_embeds, negative_prompt_embeds=negative_prompt_embeds, pooled_prompt_embeds=pooled_prompt_embeds, negative_pooled_prompt_embeds=negative_pooled_prompt_embeds, num_images_per_prompt=num_images_per_prompt, num_inference_steps=num_inference_steps, ) image = pipe(**call_args).images[0] Combined with SDPA and fp16, we can reduce the memory to 21.9GB. Other techniques discussed above for optimizing memory can also be used with cached computations.
[ -0.03306467458605766, 0.053347714245319366, -0.03855360671877861, 0.01704627461731434, 0.0004906108370050788, -0.0045678201131522655, -0.01979893259704113, -0.03179275989532471, 0.045309700071811676, -0.07591954618692398, -0.04131505638360977, 0.023362834006547928, -0.028816966339945793, -0.009793579578399658, -0.050405628979206085, -0.05517667531967163, 0.022632814943790436, -0.016259051859378815, -0.010904602706432343, 0.08641983568668365, 0.07651490718126297, -0.038745395839214325, -0.006185087841004133, 0.006837464869022369, -0.048411641269922256, -0.06975459307432175, -0.01182013750076294, -0.03501236066222191, -0.0380183644592762, -0.02489905245602131, -0.043743863701820374, 0.012857317924499512, 0.03250370919704437, 0.025544041767716408, 0.0719875916838646, -0.06431223452091217, -0.1536845862865448, 0.004958369303494692, 0.009301085025072098, 0.0003199068596586585, -0.07774461805820465, -0.006155326496809721, -0.02036215178668499, 0.06158946081995964, 0.041552796959877014, -0.01866276189684868, -0.09133677184581757, 0.05085599049925804, -0.1069648340344429, 0.01022452674806118, -0.08735596388578415, 0.00797206535935402, -0.06151602417230606, -0.001515788258984685, -0.01602203957736492, 0.03782753273844719, -0.008044324815273285, -0.033276692032814026, 0.07106029987335205, 0.006959548685699701, 0.015340565703809261, 0.001674169092439115, -0.013094140216708183, 0.09216787666082382, 0.06808460503816605, -0.004352663177996874, -0.02006836049258709, -0.015296658501029015, -0.031025392934679985, -0.0951806977391243, -0.004098648205399513, 0.0032215677201747894, -0.026379428803920746, 0.054940108209848404, -0.0040381187573075294, -0.048669908195734024, -0.025364110246300697, 0.05616934970021248, -0.0010587889701128006, 0.043606583029031754, -0.08508271723985672, 0.07291745394468307, 0.0665660947561264, 0.011287023313343525, -0.002614038297906518, 0.02284097671508789, 0.08207865804433823, -0.04397008940577507, -0.023475781083106995, -0.03635800629854202, -0.029334526509046555, -0.033695075660943985, -0.011590625159442425, 0.03052544966340065, -0.022434603422880173, 0.019110873341560364, -0.019271953031420708, 0.04978015273809433, -0.009829838760197163, -0.02931949868798256, -0.011902602389454842, -0.0959295853972435, -0.028208401054143906, -0.1111091673374176, -0.029044128954410553, 0.035563450306653976, -0.06889957934617996, -0.039971038699150085, -0.00032597011886537075, 0.0022557720076292753, 0.016879020258784294, 0.05918949469923973, -0.040320999920368195, 0.05742115154862404, -0.09151085466146469, -0.02869667112827301, -0.0070905233733356, 0.04625144600868225, -0.07994478195905685, 0.03636522591114044, 0.002403917023912072, 0.03341754525899887, 0.07763321697711945, -0.06110992655158043, -0.07912742346525192, 0.09212620556354523, 0.048474475741386414, 0.08781568706035614, -0.04802871495485306, 0.004801223054528236, -0.01752336509525776, -0.032183993607759476, 0.0637347549200058, -0.055355802178382874, 0.07242252677679062, -0.07406913489103317, -0.07506877928972244, -0.05916014313697815, -0.04404468834400177, 0.0162863340228796, -0.011667219921946526, 0.028138963505625725, 0.003479764563962817, 0.0018414836376905441, 0.043967436999082565, -0.010195818729698658, -0.031250208616256714, 0.05328429490327835, -0.03227817267179489, 0.030750300735235214, -0.05762968584895134, -0.018259061500430107, -0.05910163000226021, -0.06276989728212357, -0.024943532422184944, 0.08724945038557053, 0.008578905835747719, -0.015647808089852333, -0.0796140804886818, 0.041066721081733704, 0.023023175075650215, -0.025332385674118996, -0.03219414874911308, 0.0020616070833057165, 0.02166454866528511, -0.014366860501468182, 0.04851071536540985, -0.003916575573384762, 0.001907961443066597, 0.024031810462474823, 0.007229132577776909, -0.03551490604877472, 0.06305816769599915, -0.014889379031956196, 0.06334928423166275, 0.01526147685945034, 0.0159017164260149, 0.04221624881029129, -0.017184332013130188, -0.039814017713069916, -0.026133587583899498, 0.01881205290555954, -0.012241349555552006, 0.04633309692144394, 0.03177884593605995, -0.09762794524431229, 0.06420227140188217, -0.08907448500394821, -0.03659449890255928, 0.02658952586352825, -0.07832535356283188, 0.012549602426588535, -0.0037650340236723423, -0.005485416390001774, -0.000925507047213614, -0.061181552708148956, -0.018413865938782692, 0.06171058118343353, 0.04514938220381737, -0.004637203179299831, 0.010865027084946632, 0.02594514563679695, 0.0035244333557784557, -0.006991594564169645, -0.031512122601270676, -0.029405033215880394, 0.005564214661717415, -0.04710211977362633, 0.0070339529775083065, 0.07690256088972092, 0.009283962659537792, -0.086830273270607, 0.024131426587700844, -0.018901923671364784, -0.003023921512067318, -0.02302105352282524, -0.04955734312534332, -0.05517568439245224, 0.006820860784500837, -0.015001465566456318, 0.1426551640033722, -0.02578030340373516, 0.01789797469973564, -0.028342746198177338, -0.0150619400665164, 0.013909319415688515, 0.013305779546499252, -0.004408170469105244, 0.02387033775448799, -0.08053205907344818, -0.04184424877166748, -0.09262579679489136, -0.015938775613904, 0.016489747911691666, 0.009764358401298523, -0.05183915048837662, -0.004786794539541006, 0.006274196319282055, -0.016029875725507736, -0.00818716175854206, 0.052036505192518234, 0.04845597967505455, -0.017501499503850937, -0.037869665771722794, 0.004009893164038658, -0.018894340842962265, -0.010015887208282948, -0.015658212825655937, -0.10569204390048981, -0.023474063724279404, -0.060674071311950684, 0.007725713774561882, -0.07226958125829697, -0.06620441377162933, 0.018989969044923782, 0.03997230902314186, -0.010763055644929409, 0.0028296594973653555, -0.008868108503520489, 0.05066907778382301, 0.00721193291246891, -0.02001221664249897, -0.04276193305850029, -0.0322716198861599, 0.026080526411533356, -0.03433777764439583, -0.01572125405073166, -0.00654017087072134, 0.005930747836828232, 0.049325957894325256, 0.030458733439445496, -0.004456802736967802, 0.005261851940304041, 0.03613508492708206, 0.010666931979358196, 0.008704373612999916, 0.06169278174638748, -0.04965633153915405, -0.04531513899564743, -0.03969370201230049, 0.04287160560488701, -0.0287688709795475, 0.04852259159088135, 0.04172997921705246, -0.018549544736742973, 0.009663899429142475, 0.001576787093654275, 0.003023158758878708, -0.020395470783114433, 0.04778468981385231, 0.032720230519771576, 0.048431623727083206, 0.03720080852508545, 0.023421743884682655, -0.006446169223636389, 0.017091577872633934, 0.018676633015275, -0.059094756841659546, -0.027969559654593468, 0.005852493457496166, -0.039232950657606125, -0.03034762665629387, 0.030095329508185387, 0.011714915744960308, -0.02539755217730999, 0.0075518470257520676, -0.039248351007699966, 0.01945524848997593, -0.06822871416807175, 0.03433287888765335, -0.021358542144298553, -0.002364514861255884, 0.013894160278141499, -0.021834922954440117, 0.02005498856306076, -0.004521683324128389, 0.0014549519401043653, 0.049117907881736755, 0.011464684270322323, 0.0281217023730278, 0.007876531220972538, -0.013323929160833359, 0.019863203167915344, -0.012478741817176342, 0.05491148307919502, -0.02318519912660122, -0.0037070196121931076, 0.008559287525713444, 0.009120269678533077, 0.020151926204562187, 0.004805305041372776, 0.045406538993120193, -0.00024130164820235223, 0.015208503231406212, 0.04034050554037094, -0.01963992603123188, 0.0093887560069561, -0.03740468993782997, -0.019053341820836067, -0.05291508883237839, 0.029420603066682816, 0.004082079976797104, -0.06101502478122711, 0.03444366157054901, 0.005122964270412922, 0.017419299110770226, 0.010757758282124996, 0.01488548330962658, 0.042549144476652145, 0.03775792196393013, 0.0071667833253741264, -0.003445961745455861, 0.042801305651664734, -0.018041452392935753, 0.052430275827646255, -0.009839062578976154, 0.03571801260113716, -0.0015141463372856379, -0.007151274010539055, 0.0011709999525919557, -0.026588141918182373, 0.040711741894483566, 0.03585553169250488, 0.023174840956926346, 0.00029960914980620146, -0.003954010549932718, 0.059437841176986694, -0.037921443581581116, -0.027567164972424507, -0.010881874710321426, -0.009128476493060589, -0.012419727630913258, 0.008691022172570229, 0.03637810796499252, 0.01938796229660511, -0.04744775593280792, -0.04250447824597359, 0.01732592284679413, 0.0037465733475983143, 0.055532075464725494, 0.035913050174713135, 0.00492778979241848, -0.038105838000774384, 0.030544908717274666, -0.03310101479291916, -0.0662548616528511, 0.023513026535511017, -0.02562878467142582, -0.01134259719401598, -0.007219858467578888, -0.01356571912765503, 0.011740663088858128, 0.05422080680727959, -0.0004874338919762522, -0.027316216379404068, -0.02062922902405262, 0.054934147745370865, -0.00308651733212173, 0.0214897021651268, -0.005358124151825905, -0.020875491201877594, -0.010202108882367611, -0.014931615442037582, -0.03789503127336502, 0.03259221836924553, -0.004967672750353813, 0.011872886680066586, 0.027399521321058273, -0.001764261513017118, -0.07937995344400406, -0.0035015337634831667, -0.018009990453720093, -0.02469022572040558, -0.026295039802789688, -0.07161970436573029, 0.044753868132829666, 0.0027042871806770563, -0.018961098045110703, 0.00114232930354774, 0.0030666429083794355, -0.012325099669396877, -0.05395928770303726, 0.014141276478767395, 0.08739211410284042, 0.026291485875844955, -0.020995430648326874, -0.014855924993753433, -0.013156157918274403, -0.030817614868283272, 0.015935728326439857, 0.019926780834794044, -0.0490257553756237, 0.0432918407022953, 0.020517541095614433, -0.02835504524409771, 0.027881208807229996, 0.0025542904622852802, -0.03659025952219963, -0.04326259344816208, -0.006919162347912788, 0.05944625660777092, -0.00821919459849596, 0.01122465543448925, -0.04911075532436371, -0.03894110023975372, -0.04520338028669357, 0.00309992884285748, -0.03732958063483238, 0.005211574491113424, 0.02691049873828888, 0.03766297176480293, -0.018265357241034508, 0.023498905822634697, 0.0011936994269490242, -0.018597355112433434, 0.03780600428581238, -0.012167287059128284, 0.006358928047120571, 0.039593372493982315, -0.012298570945858955, -0.003541885409504175, -0.03273240849375725, 0.060176149010658264, -0.0004797375586349517, 0.017565462738275528, -0.022402355447411537, 0.012615358456969261, 0.029684754088521004, 0.007095614448189735, 0.011315244249999523, 0.011040623299777508, 0.0488252267241478, 0.029241301119327545, 0.004542449954897165, -0.03582313656806946, -0.020772913470864296, 0.0375138483941555, 0.012421488761901855, -0.015137357637286186, 0.026903726160526276, 0.015263350680470467, -0.017500611022114754, 0.04308285936713219, -0.002107656095176935, 0.07053530216217041, 0.03467415273189545, -0.025388894602656364, -0.02968696877360344, -0.03819945082068443, -0.025616033002734184, 0.05493337661027908, -0.01504517626017332, 0.019851982593536377, 0.007851860485970974, 0.04146341606974602, 0.024611439555883408, 0.034828800708055496, 0.02913421019911766, -0.013111697509884834, -0.00586968008428812, 0.013005809858441353, -0.02306610904633999, 0.005866398103535175, -0.007093850988894701, -0.011758639477193356, 0.022777479141950607, 0.010098274797201157, -0.012056343257427216, 0.0339888297021389, 0.022122181951999664, -0.010893622413277626, -0.015392007306218147, 0.004555560648441315, 0.007258688099682331, 0.01298548560589552, -0.003478657454252243, 0.03565262258052826, -0.005331560969352722, 0.01370758842676878, 0.03211565688252449, -0.0294606052339077, 0.018905598670244217, 0.04025322198867798, -0.03733598068356514, -0.02440866455435753, -0.01010718010365963, 0.039112068712711334, 0.040535829961299896, -0.012550863437354565, 0.002058275043964386, 0.01550857163965702, 0.01933666504919529, 0.05725157633423805, 0.0028423499315977097, 0.0021287656854838133, -0.031679458916187286, -0.01177952066063881, 0.01985064335167408, 0.01381993480026722, 0.013553468510508537, -0.037144120782613754, 0.05594392493367195, -0.0028182866517454386, 0.022221814841032028, 0.02196608856320381, 0.016636952757835388, 0.050680872052907944, 0.008401856757700443, 0.0066332630813121796, 0.012862468138337135, -0.036327578127384186, 0.029627900570631027, -0.011699900962412357, 0.08516490459442139, -0.0025828706566244364, -0.03544333204627037, 0.03087124601006508, 0.045766010880470276, 0.04735105484724045, 0.03356689214706421, -0.040213171392679214, -0.011032975278794765, 0.0067522041499614716, 0.027078963816165924, 0.04486465081572533, -0.01715840771794319, 0.0007688237819820642, -0.007739778142422438, 0.01564667373895645, -0.044918645173311234, 0.019830310717225075, 0.009771853685379028, -0.02558359131217003, 0.04360855743288994, 0.03584158048033714, -0.049903761595487595, 0.0240273866802454, 0.05047859624028206, 0.05320703238248825, -0.042693834751844406, -0.01748804934322834, -0.016400344669818878, -0.01249061618000269, -0.008797530084848404, -0.04152718931436539, 0.02188568189740181, -0.04149869456887245, 0.02741694450378418, 0.025451889261603355, 0.05374012514948845, 0.05861982703208923, -0.0007285991450771689, -0.009668366052210331, 0.01755646802484989, 0.05604406073689461, 0.0016356856795027852, -0.008227456361055374, 0.032390985637903214, 0.0040743169374763966, 0.034538403153419495, -0.03916487842798233, -0.027320723980665207, -0.020213527604937553, 0.03408607840538025, 0.015550456009805202, 0.02844151109457016, 0.024613071233034134, -0.05506828427314758, 0.04946891590952873, 0.05227997899055481, 0.02526707760989666, -0.003378249006345868, -0.005569010507315397, -0.025284145027399063, -0.019761575385928154, -0.0055321198888123035, 0.0012281781528145075, 0.0307325329631567, 0.013778220862150192, 0.001167737995274365, 0.023814810439944267, -0.016430100426077843, 0.0450679212808609, 0.01925145648419857, -0.01358105055987835, -0.013275814242661, -0.008189787156879902, -0.004282710608094931, -0.008694523945450783, -0.016709337010979652, 0.004908169154077768, -0.04937007278203964, -0.04498634487390518, -0.00015596966841258109, 0.0531139150261879, -0.004403396043926477, -0.0065452842973172665, 0.037431444972753525, -0.013763251714408398, -0.0127019714564085, -0.01873348467051983, -0.015752339735627174, 0.01808829978108406, 0.003124203532934189, 0.039993301033973694, 0.022821903228759766, -0.00041801194311119616, 0.018077846616506577, -0.007234624121338129, 0.049552466720342636, -0.008841311559081078, 0.02695384807884693, 0.012714642100036144, -0.0006491274107247591, 0.02456791326403618, -0.04904209449887276, 0.010211003012955189, -0.011928921565413475, -0.004720068536698818, 0.05394747853279114, -0.0009730920428410172, 0.013194120489060879, 0.001566935796290636, -0.07201971113681793, 0.022325482219457626, 0.002826444339007139, 0.017920635640621185, 0.004041348118335009, 0.06405376642942429, 0.07048224657773972, 0.0055275363847613335, -0.024100305512547493, -0.026938416063785553, -0.027175744995474815, 0.02175895869731903, 0.019853435456752777, 0.003491777228191495, 0.007756512612104416, -0.024528181180357933, 0.003263100516051054, -0.012959707528352737, -0.014187331311404705, 0.013436060398817062, -0.006740916520357132, 0.043193574994802475, -0.0011201262241229415, -0.026959285140037537, -0.004085042979568243, 0.09707549214363098, -0.01913624443113804, 0.005728874355554581, 0.0168236643075943, -0.009227694012224674, -0.010592791251838207, -0.03372703492641449, 0.020995106548070908, -0.001531564281322062, -0.01563909649848938, 0.005863279569894075, -0.010668366216123104, -0.006611569784581661, 0.0228041373193264, 0.004039714578539133, 0.037198107689619064, -0.01411493867635727, -0.03376979008316994, -0.022704405710101128, 0.0013435924192890525, 0.015308447182178497, -0.010837508365511894, 0.08311444520950317, 0.03596079349517822, -0.021742213517427444, 0.04701212793588638, -0.040969397872686386, 0.03161825239658356, -0.06298496574163437, 0.05520620197057724, 0.04981363192200661, 0.011684750206768513, -0.03648514673113823, -0.017199721187353134, 0.007327570114284754, 0.019116297364234924, -0.003879617666825652, 0.027467362582683563, 0.00553487753495574, -0.03440435230731964, 0.006143666338175535, 0.0001483066735090688, 0.05156181752681732, 0.007899676449596882, 0.011563514359295368, 0.028156118467450142, 0.019604038447141647, 0.029454398900270462, 0.047005441039800644, -0.06545090675354004, -0.023625798523426056, 0.03555021062493324, -0.009184270165860653, 0.03890205919742584, -0.01867377758026123, 0.06690780818462372, -0.04836827889084816, -0.0266454815864563, 0.003034425200894475, -0.005376484245061874, 0.0347251296043396, 0.006777375005185604, -0.023853428661823273, 0.016081808134913445, 0.01316513679921627, -0.009216579608619213, -0.004948134068399668, -0.0003837160475086421, 0.014827162027359009, 0.024887800216674805, -0.003927599173039198, 0.02512897364795208, 0.006650129333138466, -0.01406971924006939, 0.01905602402985096, 0.05367346480488777, 0.06324400007724762, -0.0385737419128418, -0.014780862256884575, 0.0013631383189931512 ]
Exploring simple optimizations for SDXL
sayakpaul
October 24, 2023
simple_sdxl_optimizations
diffusers, guide, sdxl
https://huggingface.co/blog/simple_sdxl_optimizations
Lower precision Model weights are stored at a certain precision which is expressed as a floating point data type. The standard floating point data type is float32 (fp32), which can accurately represent a wide range of floating numbers. For inference, you often donโ€™t need to be as precise so you should use float16 (fp16) which captures a narrower range of floating numbers. This means fp16 only takes half the amount of memory to store compared to fp32, and is twice as fast because it is easier to calculate. In addition, modern GPU cards have optimized hardware to run fp16 calculations, making it even faster. With ๐Ÿค—ย Diffusers, you can use fp16 for inference by specifying the torch.dtype parameter to convert the weights when the model is loaded: python from diffusers import StableDiffusionXLPipeline pipe = StableDiffusionXLPipeline.from_pretrained( "stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16, ).to("cuda") pipe.unet.set_default_attn_processor() Compared to a completely unoptimized SDXL pipeline, using fp16 takes 21.7GB of memory and only 14.8 seconds. Youโ€™re almost speeding up inference by a full minute!
[ 0.0003529108362272382, 0.028380075469613075, -0.026220830157399178, 0.04874347895383835, 0.04149840399622917, 0.03297871723771095, -0.03158138692378998, 0.036925382912158966, -0.008376083336770535, -0.035550523549318314, 0.017565099522471428, -0.040616780519485474, 0.017061160877346992, -0.029614470899105072, 0.01431108545511961, -0.0780024379491806, -0.0023470560554414988, -0.03569269925355911, -0.00035584805300459266, 0.0968853086233139, 0.0059570143930613995, -0.047134581953287125, -0.03389400243759155, -0.00930527038872242, -0.1177615076303482, -0.07287692278623581, -0.0010941720101982355, 0.005630237050354481, -0.0070487260818481445, -0.005916906986385584, -0.14016738533973694, 0.03158373013138771, 0.015244790352880955, -0.006509952247142792, 0.081451915204525, -0.033873897045850754, -0.06399574130773544, 0.08064385503530502, 0.04154326021671295, -0.023935221135616302, -0.0013598848599940538, 0.004286356270313263, -0.028377089649438858, 0.01825542375445366, 0.031007034704089165, -0.02026962675154209, -0.08980994671583176, 0.022159429267048836, -0.06865649670362473, -0.00997711531817913, -0.12685111165046692, 0.03379571810364723, -0.11150963604450226, 0.05397077277302742, 0.05677388980984688, -0.0057222903706133366, -0.0002586075570434332, 0.01607547327876091, 0.05076034367084503, 0.010593162849545479, 0.020319992676377296, -0.0038781717885285616, -0.003002785611897707, 0.003418935462832451, 0.08636627346277237, 0.009910010732710361, 0.05573128163814545, -0.004367319401353598, -0.014262308366596699, -0.017429698258638382, 0.027557125315070152, 0.01716965064406395, 0.004357340279966593, 0.00549823883920908, -0.05366149917244911, 0.007289092522114515, -0.031964678317308426, 0.008049407042562962, 0.05186675861477852, 0.08073433488607407, -0.015249216929078102, 0.031186258420348167, 0.035507652908563614, 0.06850730627775192, -0.005507684778422117, -0.0045039416290819645, 0.09219169616699219, -0.06261923164129257, 0.019701384007930756, -0.0098769161850214, -0.021204741671681404, -0.013486262410879135, 0.02960183285176754, 0.027966685593128204, 0.03609510883688927, 0.01660863310098648, -0.04813937470316887, 0.02216148190200329, 0.038011860102415085, 0.010200560092926025, 0.03198739141225815, -0.08458268642425537, 0.023588189855217934, -0.08733769506216049, -0.021202655509114265, 0.05236724764108658, -0.07862155884504318, -0.07036090642213821, -0.011779218912124634, -0.006645066663622856, -0.06628942489624023, 0.07784657180309296, -0.08554070442914963, 0.03453942760825157, -0.09428145736455917, -0.008217621594667435, 0.007945609278976917, 0.03266206383705139, 0.0016962634399533272, 0.0034661912359297276, -0.00397144490852952, 0.10426650941371918, 0.04034469276666641, 0.0034320668783038855, -0.03234880417585373, 0.12244019657373428, 0.06740523129701614, 0.10778536647558212, -0.019042735919356346, 0.038498640060424805, 0.05212211608886719, -0.04725710675120354, 0.05635766312479973, -0.08103246986865997, 0.029847361147403717, -0.085372194647789, -0.10059145092964172, -0.04569629579782486, 0.013672820292413235, 0.0029670782387256622, -0.022583458572626114, 0.01966698281466961, -0.016068143770098686, -0.004334363620728254, -0.007384585682302713, -0.012357348576188087, 0.008210552856326103, 0.015106018632650375, 0.009609303437173367, 0.033955205231904984, -0.08976045995950699, 0.07023796439170837, 0.0035323852207511663, -0.03957464545965195, 0.02067437581717968, 0.02648494578897953, -0.014830145984888077, -0.03577698394656181, -0.029903454706072807, -0.03005382791161537, -0.023134246468544006, -0.08482330292463303, -0.03098522126674652, -0.04540593549609184, 0.018750043585896492, 0.02520899288356304, 0.07960489392280579, 0.04230352118611336, 0.08532710373401642, 0.005067566875368357, 0.019841168075799942, 0.0017487042350694537, 0.07924512028694153, -0.023731255903840065, -0.030728260055184364, 0.018518878147006035, -0.011766834184527397, 0.05505266413092613, -0.010811717249453068, -0.08619356155395508, 0.006956787314265966, 0.06990522891283035, -0.020774176344275475, 0.0630999356508255, 0.023168224841356277, -0.06764592230319977, 0.03486762195825577, -0.07381637394428253, -0.0070957704447209835, 0.07349757850170135, 0.013112104497849941, 0.008407550863921642, 0.032755039632320404, -0.027950888499617577, 0.06448441743850708, -0.0897173210978508, -0.03926392272114754, 0.07074125856161118, 0.029635587707161903, -0.043129127472639084, 0.032338403165340424, -0.019999651238322258, 0.004078790545463562, -0.029450375586748123, -0.026842951774597168, -0.013165622018277645, 0.020789342001080513, -0.03431837260723114, -0.015298962593078613, 0.046162813901901245, 0.01060947123914957, -0.12121923267841339, 0.010288435034453869, -0.06671080738306046, -0.027385082095861435, -0.04708421602845192, -0.004744910169392824, -0.028595739975571632, 0.03498689830303192, -0.07871787995100021, 0.093147411942482, -0.002510952763259411, -0.02353360690176487, -0.018995918333530426, -0.10677206516265869, -0.005994174163788557, 0.046400122344493866, -0.023032844066619873, 0.0282578244805336, -0.07103677839040756, -0.06319070607423782, -0.08287593722343445, 0.00593144167214632, 0.05702350661158562, -0.01903446391224861, -0.046630799770355225, -0.02205614186823368, 0.03258185461163521, 0.008347968570888042, -0.05368490889668465, 0.040099725127220154, 0.03874536603689194, -0.040938735008239746, -0.03991219773888588, 0.014851733110845089, 0.007875983603298664, 0.060425031930208206, -0.014231224544346333, -0.044894974678754807, 0.01871875301003456, -0.002946068998426199, 0.017677584663033485, -0.04330442100763321, -0.0036039019469171762, -0.0003751761978492141, 0.03880085051059723, 0.020759211853146553, 0.01592624932527542, -0.007776440121233463, 0.03035709075629711, 0.009760214947164059, 0.02801448293030262, -0.03612363338470459, 0.01913413032889366, -0.0038323344197124243, -0.06579533219337463, -0.0035095675848424435, 0.00802063662558794, 0.0027038969565182924, 0.01549645233899355, 0.0284285768866539, 0.020681077614426613, 0.008829033002257347, 0.026946768164634705, 0.013847152702510357, 0.05276816338300705, 0.03593309223651886, -0.010576187632977962, -0.04376805201172829, -0.012846510857343674, 0.0018984690541401505, -0.020852813497185707, 0.04628708213567734, 0.017202993854880333, -0.01683388277888298, 0.006411596201360226, 0.03983324393630028, -0.007566717453300953, -0.04527174308896065, 0.01998875103890896, 0.019775262102484703, 0.014215463772416115, -0.009411252103745937, -0.023453300818800926, -0.007199924439191818, 0.054620161652565, -0.0282587930560112, -0.026787618175148964, -0.010039654560387135, 0.011367869563400745, -0.028843319043517113, -0.019979311153292656, -0.004835748579353094, -0.010614536702632904, -0.05084029957652092, 0.020504029467701912, -0.053000349551439285, 0.011722026392817497, -0.07347633689641953, 0.016209503635764122, -0.01078230794519186, -0.01059557031840086, -0.0032354218419641256, -0.020455094054341316, 0.01653621718287468, -0.004465705249458551, -0.015987439081072807, 0.034741487354040146, 0.02702845074236393, 0.03949068859219551, 0.004270241130143404, 0.04555315151810646, 0.012434735894203186, 0.020966749638319016, 0.047134291380643845, -0.003659201320260763, 0.003636470763012767, -0.01557016372680664, -0.019654925912618637, 0.01706598326563835, -0.01517891138792038, 0.015650851652026176, -0.04817245528101921, 0.015124943107366562, 0.0330081582069397, -0.005371947307139635, -0.03826678544282913, -0.013792097568511963, -0.048001259565353394, -0.034075282514095306, 0.003669696394354105, -0.020433658733963966, -0.037650663405656815, -0.013289708644151688, -0.03268221765756607, -0.010147271677851677, 0.027039194479584694, 0.002007934730499983, 0.007274833507835865, 0.0009403207222931087, -0.024217868223786354, -0.025273039937019348, 0.027965286746621132, 0.0048465244472026825, 0.04962371289730072, 0.001080712303519249, -0.010604476556181908, -0.03314897418022156, 0.007219305261969566, -0.003845878643915057, 0.008940746076405048, 0.027148617431521416, -0.009352391585707664, 0.03313683718442917, 0.001507856184616685, 0.04856202006340027, 0.025315899401903152, -0.0029215181712061167, -0.07493329793214798, 0.04970983788371086, 0.05195414647459984, 0.005470415577292442, -0.04944945126771927, 0.030410269275307655, 0.038858812302351, -0.01567845791578293, -0.019845861941576004, 0.01077303010970354, -0.03454357385635376, 0.05025172978639603, 0.05588504672050476, 0.005250799935311079, -0.010136744938790798, -0.02013579197227955, -0.00920169334858656, -0.016360711306333542, 0.036519430577754974, 0.021404551342129707, -0.024170005694031715, -0.006835473235696554, -0.00313015328720212, -0.010682646185159683, 0.0005293050198815763, 0.015115438029170036, -0.02443617954850197, -0.009761926718056202, 0.02851058356463909, 0.007265795487910509, 0.015105295926332474, 0.001295168767683208, 0.005765833426266909, -0.012193973176181316, 0.0020259858574718237, -0.004618425853550434, 0.03778736665844917, 0.04040486738085747, 0.001151404227130115, 0.007587677799165249, 0.032544348388910294, -0.05841038003563881, -0.026690416038036346, -0.0050359382294118404, 0.0018972983816638589, -0.01298608910292387, -0.02583097107708454, 0.01573215425014496, -0.0032400928903371096, 0.015051153488457203, 0.008740481920540333, 0.015679970383644104, 0.06118328124284744, 0.014878548681735992, 0.01585826836526394, 0.05225749686360359, 0.023832768201828003, -0.03562241420149803, -0.0210285447537899, 0.008905072696506977, -0.05770089477300644, 0.02803465910255909, 0.006696321535855532, -0.04517540708184242, 0.056970227509737015, 0.03679822012782097, -0.0017553971847519279, 0.029100624844431877, -0.0032653938978910446, -0.04721815139055252, -0.07161109149456024, 0.008879927918314934, 0.04137443006038666, 0.009642734192311764, 0.027606071904301643, -0.02987440675497055, 0.009225078858435154, 0.007396714296191931, 0.0268156286329031, -0.03166862204670906, -0.024045750498771667, 0.027480948716402054, 0.011344201862812042, -0.01754641905426979, 0.015590489841997623, -0.013334270566701889, 0.004375027026981115, 0.057984571903944016, -0.06641333550214767, 0.0025266269221901894, 0.043203338980674744, -0.00544247729703784, -0.02312329038977623, -0.04137064144015312, 0.03747594356536865, -0.009691307321190834, -0.007984506897628307, -0.026974646374583244, 0.0105662290006876, 0.012722204439342022, -0.019883809611201286, 0.0521564856171608, 0.010192743502557278, 0.0529857762157917, 0.01917731948196888, -0.018821632489562035, -0.018395204097032547, -0.01773272454738617, -0.0058034611865878105, -0.01695919968187809, -0.02771013416349888, 0.06086353212594986, -0.0008544321754015982, -0.038547176867723465, 0.028543168678879738, 0.05218144506216049, 0.003121662884950638, 0.045048102736473083, -0.03116273321211338, 0.0011736522428691387, -0.034272532910108566, -0.020380690693855286, 0.03618387505412102, -0.018181851133704185, -0.0035063379909843206, 0.02963949181139469, -0.0026231221854686737, 0.06610450148582458, 0.05043739825487137, 0.02397158555686474, 0.002118989359587431, 0.007300558965653181, 0.009164206683635712, -0.025281712412834167, 0.026252049952745438, -0.01530337706208229, 0.01470886915922165, 0.023291192948818207, 0.0029019280336797237, -0.02692931331694126, 0.021743593737483025, 0.0543212927877903, -0.027329714968800545, -0.039776720106601715, -0.017663998529314995, 0.018478883430361748, 0.03527792915701866, 0.012581256218254566, 0.028941955417394638, -0.01280103251338005, 0.01680096797645092, 0.005527207162231207, -0.015003373846411705, -0.0018110107630491257, 0.018826086074113846, -0.018728991970419884, -0.046492427587509155, 0.026330308988690376, 0.018771668896079063, 0.033072568476200104, 0.004597837571054697, -0.004623564891517162, -0.028203068301081657, -0.013499790802598, 0.06737051159143448, -0.048921965062618256, 0.012221245095133781, 0.00514554837718606, -0.012742931954562664, 0.023070214316248894, -0.015723206102848053, 0.01012623030692339, -0.006867099087685347, 0.023143978789448738, -0.001265518949367106, 0.011675534769892693, 0.004336903337389231, 0.0005058786482550204, 0.030224395915865898, 0.003001907840371132, -0.04090428352355957, -0.011217738501727581, -0.022746669128537178, 0.027702728286385536, -0.04347335919737816, 0.030797922983765602, 0.0032171409111469984, -0.060016270726919174, -0.0025900478940457106, 0.03180961310863495, 0.01930457539856434, -0.019590318202972412, -0.002450974192470312, -0.009165753610432148, -0.025071140378713608, -0.001322485157288611, 0.002675175666809082, -0.04763765260577202, 0.02649724669754505, 0.02244729734957218, 0.046256985515356064, -0.00920705683529377, 0.009399846196174622, 0.03445912152528763, 0.02569955587387085, 0.059418387711048126, -0.008006703108549118, -0.035196393728256226, 0.006423706654459238, 0.024871189147233963, -0.015085634775459766, 0.021524429321289062, -0.028800521045923233, -0.005501800682395697, -0.009020686149597168, -0.0015935676638036966, -0.006466777063906193, 0.0404210202395916, -0.046259477734565735, 0.01731881871819496, 0.037203554064035416, 0.05792256072163582, 0.02616705559194088, -0.013331840746104717, 0.01669125258922577, 0.007052021101117134, 0.059751030057668686, 0.01904340088367462, 0.007748060394078493, 0.017165036872029305, 0.008844363503158092, 0.04585365578532219, -0.04248126596212387, -0.046943824738264084, -0.04934006556868553, 0.02825739234685898, 0.04405336454510689, 0.0254114530980587, 0.021223563700914383, -0.04669731855392456, 0.013580421917140484, 0.032493382692337036, 0.07786598056554794, 0.025067590177059174, -0.0005632200045511127, -0.016940535977482796, 0.05720122903585434, -0.001812270493246615, 0.014952528290450573, 0.017771050333976746, 0.011812109500169754, 0.0015505512710660696, 0.010851896367967129, 0.04001487419009209, 0.04517009109258652, -0.026122121140360832, 0.014609882608056068, 0.03987003117799759, 0.018031716346740723, 0.023106714710593224, -0.016931142657995224, 0.006302663125097752, -0.0011094830697402358, -0.0077417572028934956, -0.05572672560811043, 0.0015114765847101808, -0.020321857184171677, -0.007422825787216425, 0.0034854039549827576, 0.04020621255040169, 0.01040312834084034, -0.02220931649208069, 0.027566082775592804, -0.04096756875514984, -0.03610917180776596, -0.014614123851060867, 0.007743689231574535, 0.019218306988477707, 0.017291847616434097, 0.016555897891521454, -0.006054107565432787, 0.009660318493843079, -0.006647505331784487, 0.03998183086514473, -0.030857879668474197, 0.023818140849471092, 0.008597995154559612, -0.034355584532022476, 0.04038878157734871, 0.03072962537407875, -0.013678614050149918, 0.02723623253405094, 0.010875716805458069, 0.02642456814646721, 0.011403116397559643, -0.04429158568382263, 0.01856137067079544, 0.029706183820962906, -0.019600754603743553, 0.04170115292072296, 0.020645208656787872, 0.030662279576063156, 0.0017440487863495946, -0.02167537622153759, -0.0816861093044281, 0.008702700957655907, -0.04704337194561958, -0.0111585957929492, -0.016957363113760948, 0.030154332518577576, -0.008892081677913666, 0.029871121048927307, -0.006984650623053312, 0.017173659056425095, -0.02458839677274227, 0.0015057191485539079, 0.0007901943754404783, -0.015294700860977173, 0.0009692885796539485, -0.028536586090922356, 0.048430562019348145, -0.041662734001874924, -0.02462426759302616, 0.0489034540951252, -0.0027108790818601847, -0.005786697845906019, 0.029872747138142586, 0.014781123958528042, -0.04741138592362404, 0.03314238041639328, 0.025251954793930054, 0.00008702486229594797, -0.012667672708630562, 0.027055496349930763, -0.027750657871365547, 0.00897029135376215, -0.02175470069050789, -0.02304704673588276, -0.03021197021007538, -0.03291059657931328, -0.013436667621135712, 0.0015218566404655576, 0.08073066174983978, 0.07016316056251526, -0.05728556588292122, 0.006276425439864397, -0.06454440951347351, 0.011853094212710857, -0.03177778422832489, 0.05106230452656746, 0.05426512658596039, 0.0010245260782539845, -0.00978099461644888, -0.04359801486134529, -0.010350167751312256, 0.010963869281113148, -0.02727038972079754, -0.027182677760720253, -0.008348607458174229, -0.020114004611968994, -0.08125151693820953, 0.0024722518865019083, 0.03610656410455704, 0.009078845381736755, 0.06332004070281982, -0.01016839500516653, -0.018558457493782043, 0.03447250649333, -0.02947116829454899, -0.07547169178724289, -0.007023354526609182, -0.024496547877788544, -0.021868448704481125, 0.018534833565354347, -0.019469495862722397, 0.04862042888998985, 0.014586011879146099, 0.0091931177303195, -0.04047637805342674, -0.016357600688934326, -0.032271068543195724, -0.032264161854982376, -0.013754979707300663, 0.032016873359680176, 0.0030899110715836287, -0.032345693558454514, -0.029878750443458557, 0.002381859812885523, 0.00954050850123167, -0.020571984350681305, -0.006010609213262796, 0.009784967638552189, 0.029019346460700035, -0.037643808871507645, -0.008083543740212917, 0.028619199991226196, 0.05051843822002411, -0.024507025256752968, -0.01103404350578785, -0.037520039826631546 ]
Exploring simple optimizations for SDXL
sayakpaul
October 24, 2023
simple_sdxl_optimizations
diffusers, guide, sdxl
https://huggingface.co/blog/simple_sdxl_optimizations
# Exploring simple optimizations for SDXL Stable Diffusion XL (SDXL) is the latest latent diffusion model by Stability AI for generating high-quality super realistic images. It overcomes challenges of previous Stable Diffusion models like getting hands and text right as well as spatially correct compositions. In addition, SDXL is also more context aware and requires fewer words in its prompt to generate better looking images. However, all of these improvements come at the expense of a significantly larger model. How much larger? The base SDXL model has 3.5B parameters (the UNet, in particular), which is approximately 3x larger than the previous Stable Diffusion model. To explore how we can optimize SDXL for inference speed and memory use, we ran some tests on an A100 GPU (40 GB). For each inference run, we generate 4 images and repeat it 3 times. While computing the inference latency, we only consider the final iteration out of the 3 iterations. So if you run SDXL out-of-the-box as is with full precision and use the default attention mechanism, itโ€™ll consume 28GB of memory and take 72.2 seconds! python from diffusers import StableDiffusionXLPipeline pipe = StableDiffusionXLPipeline.from_pretrained("stabilityai/stable-diffusion-xl-base-1.0").to("cuda") pipe.unet.set_default_attn_processor() This isnโ€™t very practical and can slow you down because youโ€™re often generating more than 4 images. And if you donโ€™t have a more powerful GPU, youโ€™ll run into that frustrating out-of-memory error message. So how can we optimize SDXL to increase inference speed and reduce its memory-usage? In ๐Ÿค—ย Diffusers, we have a bunch of optimization tricks and techniques to help you run memory-intensive models like SDXL and we'll show you how! The two things weโ€™ll focus on are inference speed and memory. ๐Ÿง  The techniques discussed in this post are applicable to all the pipelines.
[ 0.03163996711373329, 0.020259367302060127, 0.0008246537763625383, 0.038300298154354095, 0.05151711776852608, -0.017727943137288094, -0.042205750942230225, 0.0202788058668375, 0.027724772691726685, -0.09164881706237793, -0.02754564769566059, -0.05449001491069794, -0.029909983277320862, -0.017047332599759102, 0.010898532345890999, -0.055515386164188385, 0.03125996142625809, 0.0026357127353549004, -0.020429525524377823, 0.06010105088353157, 0.05261872336268425, -0.022924764081835747, -0.04425628110766411, -0.0050757708959281445, -0.060102175921201706, -0.04228010028600693, -0.005401718895882368, 0.002924861153587699, 0.0005513933720067143, -0.05362614989280701, -0.12274526804685593, -0.0011041047982871532, 0.002798064611852169, -0.03272112458944321, 0.08714964985847473, -0.05031866207718849, -0.06322130560874939, 0.019632665440440178, 0.02869425155222416, -0.03101283684372902, 0.01621820405125618, -0.008215262554585934, -0.05232252553105354, 0.018331468105316162, 0.040030285716056824, -0.058207906782627106, -0.1577155590057373, 0.04912763088941574, -0.10978692770004272, 0.040437642484903336, -0.05376080051064491, 0.02255825884640217, -0.03775780275464058, -0.016786670312285423, -0.008091160096228123, 0.04111279919743538, 0.02055967040359974, 0.005829170811921358, 0.039698317646980286, 0.022156553342938423, 0.03835863247513771, -0.021925881505012512, -0.020113928243517876, 0.026811998337507248, 0.029688110575079918, -0.012930896133184433, 0.0021642285864800215, -0.01994524896144867, -0.07661488652229309, -0.07532112300395966, 0.02896992303431034, -0.04868762567639351, -0.03321399539709091, 0.038847971707582474, 0.006830081343650818, -0.05810119956731796, -0.031131982803344727, 0.07647963613271713, 0.009911609813570976, 0.031077494844794273, -0.04263198748230934, 0.06044603884220123, 0.070240817964077, 0.017731815576553345, -0.0062108952552080154, 0.02106649801135063, 0.09526243805885315, -0.0013504642993211746, -0.04428357630968094, -0.020147835835814476, 0.021864162757992744, -0.08522523939609528, 0.00571530032902956, -0.02664528600871563, 0.012201034463942051, -0.02860148437321186, -0.025279205292463303, 0.02216668799519539, 0.053494688123464584, 0.030326498672366142, -0.02351565659046173, -0.09955881536006927, 0.022822167724370956, -0.11913581937551498, -0.07041209936141968, 0.05302279815077782, -0.03327809274196625, -0.05810653045773506, -0.0268799290060997, 0.022852998226881027, -0.022183896973729134, 0.0715847760438919, -0.05708945170044899, -0.017272546887397766, -0.1022886410355568, 0.05757234990596771, -0.047832708805799484, 0.038563504815101624, -0.055146243423223495, 0.034940335899591446, -0.05802244693040848, 0.07214628159999847, 0.07989825308322906, -0.02835334651172161, -0.06597262620925903, 0.10298725962638855, 0.0067555466666817665, 0.026880184188485146, -0.024349359795451164, 0.011582690291106701, 0.020362650975584984, -0.05248890072107315, 0.05666728690266609, -0.05486305430531502, 0.06572482734918594, -0.11526308953762054, -0.062474969774484634, -0.0438866913318634, 0.010027454234659672, -0.0019254900980740786, -0.012321146205067635, -0.009461919777095318, 0.08037781715393066, 0.0030167370568960905, 0.042650990188121796, 0.0045298561453819275, -0.017611008137464523, -0.014123871922492981, -0.02403377741575241, -0.02646755799651146, -0.04519820585846901, 0.024129802361130714, -0.08436927199363708, -0.10752075165510178, 0.028448503464460373, 0.07381080836057663, -0.044569842517375946, -0.06029290705919266, -0.06024526432156563, 0.026295531541109085, 0.015974469482898712, -0.017079023644328117, -0.05020982772111893, -0.004964893683791161, 0.03304542601108551, -0.012819983996450901, 0.06324639171361923, 0.017811257392168045, 0.0034589190036058426, 0.006149844732135534, 0.04279426857829094, 0.020586147904396057, 0.07625874876976013, 0.015209686942398548, 0.006959307007491589, 0.029367610812187195, 0.08107677102088928, 0.05594850704073906, -0.046187106519937515, -0.02816067822277546, -0.04179737716913223, 0.0616920180618763, -0.047043684870004654, 0.07516804337501526, 0.0549943782389164, -0.13695885241031647, 0.0736951157450676, -0.033822156488895416, -0.020102279260754585, -0.052586786448955536, 0.008861005306243896, 0.008232912980020046, 0.034785009920597076, -0.004266665317118168, -0.0021827290765941143, -0.055782902985811234, -0.04208886995911598, 0.058397892862558365, 0.02271786332130432, -0.004634030628949404, -0.01249298918992281, 0.013145241886377335, -0.002634297590702772, -0.01598045416176319, -0.04278692975640297, -0.02670186012983322, 0.03889889642596245, -0.029045935720205307, 0.003676733234897256, 0.019852351397275925, -0.012650919146835804, -0.14178010821342468, 0.021214324980974197, -0.02502758800983429, -0.017373187467455864, -0.04266934469342232, 0.02388169802725315, -0.031730905175209045, 0.0339779406785965, -0.049767088145017624, 0.10572029650211334, -0.03053668700158596, -0.04971187561750412, 0.06425335258245468, -0.06685575097799301, 0.0016343692550435662, 0.058722496032714844, -0.037125103175640106, -0.0020961167756468058, -0.09910696744918823, -0.04564748331904411, -0.06583259254693985, 0.009203685447573662, -0.0024193443823605776, 0.020676013082265854, -0.02337482199072838, -0.03166450187563896, 0.04569598287343979, 0.025826608762145042, -0.0462464764714241, 0.07343576103448868, -0.0007085911347530782, -0.020896250382065773, 0.02152719534933567, 0.0075287302024662495, 0.0005813714815303683, 0.05122508108615875, 0.016829075291752815, -0.05671784281730652, 0.020267240703105927, -0.05831918492913246, -0.00918611790984869, -0.048225849866867065, -0.023338941857218742, -0.00331994891166687, 0.041137345135211945, 0.008037780411541462, 0.009438329376280308, -0.012514520436525345, 0.04542826861143112, 0.003811440896242857, 0.01770244538784027, -0.02265753224492073, -0.01547810435295105, 0.035738274455070496, -0.011665750294923782, 0.021552665159106255, -0.017785631120204926, 0.002436952432617545, 0.028908513486385345, 0.0315357930958271, 0.010069696232676506, -0.0028759706765413284, 0.0009676728514023125, -0.015526373870670795, -0.0009822380961850286, 0.04479816183447838, -0.01589660346508026, -0.025839295238256454, -0.019917605444788933, 0.03028908558189869, 0.018096571788191795, 0.04614812880754471, -0.0018542455509305, 0.014562343247234821, 0.005748856347054243, 0.021493954584002495, 0.005168503150343895, -0.04880354180932045, 0.01614343374967575, 0.009879594668745995, 0.02133031189441681, 0.007801986765116453, -0.0289019588381052, 0.023568887263536453, 0.018597746267914772, 0.011041481979191303, -0.07007502764463425, -0.025975270196795464, -0.004827599506825209, 0.0074171931482851505, -0.04071323946118355, 0.008504915982484818, 0.00895056314766407, -0.011749730445444584, 0.060225989669561386, -0.0038942042738199234, -0.00420078681781888, -0.09353768825531006, -0.007449739146977663, -0.01557982712984085, -0.009963360615074635, -0.003678316017612815, -0.034635234624147415, 0.034338537603616714, -0.013514513149857521, -0.017350688576698303, 0.024128975346684456, -0.0070258332416415215, 0.06998222321271896, 0.02539062686264515, -0.01561711821705103, 0.040509358048439026, 0.022514529526233673, 0.05343092605471611, -0.016772104427218437, -0.00014501191617455333, -0.01029950100928545, -0.02086867205798626, 0.04426795244216919, 0.02782294526696205, 0.00775483762845397, 0.0119126932695508, 0.020147385075688362, 0.005283331964164972, -0.012311644852161407, 0.00885892566293478, -0.000836832623463124, -0.021801650524139404, -0.03491004556417465, 0.0011172180529683828, 0.0313941054046154, -0.061089057475328445, 0.029459888115525246, 0.010963554494082928, 0.032590050250291824, 0.04392097145318985, 0.02388734370470047, 0.06437975913286209, 0.0039802854880690575, 0.024616077542304993, 0.0014935748185962439, 0.022184692323207855, -0.0011479492532089353, 0.03524800390005112, -0.021941736340522766, 0.0018260147189721465, -0.01619970053434372, -0.014538942836225033, 0.03799469396471977, 0.01791802980005741, 0.044046174734830856, 0.020137127488851547, 0.02139880880713463, -0.012478014454245567, 0.02882486954331398, 0.047350142151117325, -0.01882883347570896, -0.04731336981058121, 0.003925689496099949, 0.023019688203930855, 0.03989715874195099, 0.0005656287539750338, 0.0267486535012722, 0.057409122586250305, -0.013533255085349083, -0.02806866727769375, 0.0515177845954895, -0.015792803838849068, 0.029690466821193695, 0.04532677307724953, 0.00550364563241601, -0.02896031364798546, -0.005718295928090811, -0.008828292600810528, -0.0037527745589613914, 0.009485687129199505, 0.02334432862699032, -0.047363463789224625, -0.03115054778754711, -0.0265753585845232, -0.02955864556133747, 0.022865988314151764, 0.023694641888141632, 0.03350944444537163, -0.043037619441747665, 0.024993659928441048, 0.004941465798765421, -0.013028999790549278, -0.0004824301868211478, 0.008643255569040775, -0.012864144518971443, 0.010090666823089123, -0.026369523257017136, 0.024345986545085907, -0.018193017691373825, 0.04547344520688057, 0.004660057369619608, 0.05971768870949745, -0.010032269172370434, -0.026889558881521225, 0.007778117898851633, -0.024764476343989372, -0.004231726750731468, -0.05074542015790939, 0.007342701777815819, 0.0017503447597846389, 0.011134904809296131, 0.03009141981601715, -0.0016586387064307928, -0.0024347766302525997, -0.0009839111007750034, 0.015230915509164333, 0.06444288790225983, 0.025587519630789757, 0.007137041073292494, -0.005808510351926088, 0.03518252074718475, -0.04295514523983002, 0.012545084580779076, 0.012826751917600632, -0.029190629720687866, 0.037152912467718124, 0.06072765216231346, -0.006818033289164305, 0.011637304909527302, -0.021795915439724922, -0.028602465987205505, -0.0442010760307312, -0.019259927794337273, 0.04397616535425186, -0.002117369556799531, 0.016914961859583855, -0.010047032497823238, -0.07661779969930649, 0.009098146110773087, -0.005961825139820576, -0.04061485081911087, -0.023230835795402527, 0.008335709571838379, 0.04529202729463577, -0.027805011719465256, 0.0017166320467367768, -0.0022688168101012707, -0.03309309110045433, -0.004335782025009394, -0.021059473976492882, 0.01719350926578045, 0.07047190517187119, 0.00009029782813740894, -0.02462719939649105, -0.009671940468251705, 0.02720656618475914, -0.030927462503314018, 0.0006613012519665062, -0.002414105460047722, 0.017937609925866127, 0.019267220050096512, -0.012238908559083939, 0.030838629230856895, 0.0065887561067938805, 0.04471293464303017, 0.021524842828512192, 0.020920341834425926, 0.0038699216675013304, -0.03709077462553978, 0.020541470497846603, -0.026023264974355698, -0.009814150631427765, 0.04103715345263481, 0.017286358401179314, -0.019616933539509773, 0.010344714857637882, 0.011811637319624424, 0.04181743413209915, 0.00021802494302392006, 0.011498775333166122, -0.019508592784404755, -0.06298567354679108, -0.00861024484038353, 0.00370142818428576, -0.035296060144901276, -0.0003787213354371488, 0.019355550408363342, 0.045648809522390366, 0.03105565719306469, 0.03286365047097206, 0.030639436095952988, 0.008345329202711582, -0.007467678748071194, -0.004800012800842524, -0.0015100960154086351, 0.0204602163285017, -0.01487891748547554, -0.0016336647095158696, 0.017395345494151115, -0.003864297876134515, 0.007585919927805662, 0.02677542343735695, -0.009099856950342655, -0.04078275337815285, -0.05050475150346756, -0.00013449581456370652, 0.03715774416923523, 0.0124457823112607, -0.00035333249252289534, 0.02692406065762043, 0.010530352592468262, 0.0147694768384099, -0.015840189531445503, -0.035886138677597046, -0.0029308090452104807, 0.004589061252772808, -0.006141068879514933, -0.01227638591080904, 0.023547857999801636, 0.02048485539853573, 0.017940862104296684, -0.00740059046074748, -0.01032909844070673, -0.02365182526409626, 0.0013118006754666567, 0.024916160851716995, -0.03372179716825485, 0.01875464618206024, -0.04463712126016617, -0.02614477090537548, 0.0362510159611702, 0.021738264709711075, 0.02072504162788391, 0.0074729654006659985, 0.03321051970124245, -0.0014670385280624032, 0.00030858267564326525, 0.005350416526198387, 0.03195732459425926, 0.04041873291134834, 0.0287520382553339, -0.0020908224396407604, -0.017685864120721817, -0.04741986095905304, 0.03713509067893028, -0.027197647839784622, 0.05825589597225189, -0.007253732066601515, -0.021740423515439034, -0.020354313775897026, 0.017142554745078087, 0.006979894824326038, -0.03504789248108864, 0.02565719373524189, -0.017538802698254585, 0.0038236177060753107, 0.05292932316660881, 0.04105021804571152, -0.04338819906115532, 0.02201267145574093, -0.0036288551054894924, -0.008976148441433907, -0.06640966236591339, 0.07059494405984879, 0.00476467190310359, -0.007509211078286171, 0.06099044531583786, 0.05220915749669075, -0.052497293800115585, 0.016300735995173454, 0.055817633867263794, 0.02088341861963272, 0.02337142452597618, -0.000006330249107122654, -0.015288010239601135, -0.046429894864559174, -0.003292947309091687, -0.015429414808750153, 0.06508292257785797, -0.05142686516046524, 0.03338431566953659, 0.0428883396089077, 0.03786814212799072, 0.0792122334241867, -0.024427169933915138, 0.00865138415247202, 0.02658965066075325, 0.04044284671545029, 0.004334429744631052, 0.004222513642162085, 0.012455636635422707, -0.020042402669787407, -0.008360691368579865, -0.009434187784790993, -0.0173557810485363, -0.05585803836584091, 0.019610680639743805, 0.03737793490290642, 0.005643446464091539, -0.0005206012865528464, -0.046361520886421204, 0.04952423647046089, 0.05316803604364395, 0.06731095165014267, 0.0046892324462533, -0.000745924364309758, -0.035001907497644424, -0.005751958116889, 0.007672994863241911, 0.01252150721848011, 0.020909367129206657, 0.028696564957499504, 0.017281869426369667, -0.0038447363767772913, 0.008883925154805183, 0.04871582239866257, 0.04889215528964996, 0.024391109123826027, 0.002967260079458356, -0.011728871613740921, -0.015104042366147041, 0.0018374832579866052, -0.03911887854337692, -0.0006203289376571774, 0.004953957628458738, -0.07105576992034912, 0.010272374376654625, -0.0017551608616486192, -0.01604241319000721, 0.006701980717480183, 0.00900272000581026, 0.024876121431589127, -0.012414390221238136, 0.00584243843331933, -0.024348760023713112, -0.01177219394594431, 0.020078785717487335, 0.020840782672166824, 0.011821366846561432, 0.0049810330383479595, -0.043067194521427155, -0.001214386778883636, 0.036869145929813385, -0.03278180956840515, 0.05601127818226814, -0.03893706947565079, -0.010558429174125195, -0.0000214434494409943, -0.026035364717245102, 0.013745324686169624, 0.014079567976295948, 0.012554516084492207, 0.026581592857837677, -0.02023865282535553, 0.037491410970687866, 0.022975793108344078, -0.06207852065563202, 0.022509882226586342, 0.012872747145593166, 0.024868324398994446, -0.007976381108164787, 0.07731760293245316, 0.054634787142276764, -0.006152724381536245, -0.013214961625635624, -0.011457634158432484, 0.0017826176481321454, -0.028667181730270386, 0.016263071447610855, -0.03143174201250076, 0.009084376506507397, -0.024025941267609596, 0.0012815503869205713, -0.014285018667578697, -0.0035741140600293875, -0.015515206381678581, 0.00898774340748787, 0.0348091721534729, 0.009561236947774887, -0.009656617417931557, -0.00633211387321353, 0.038334865123033524, -0.01634063571691513, 0.008454635739326477, 0.04065202549099922, 0.0033952228259295225, -0.008636564016342163, -0.02142910473048687, 0.013738740235567093, -0.004287853837013245, 0.00947815552353859, -0.03515983745455742, -0.012548799626529217, 0.0011600073194131255, 0.01683608442544937, -0.007913177832961082, 0.015137206763029099, 0.001155162462964654, -0.033943843096494675, -0.011264693923294544, -0.001902220188640058, -0.01307754684239626, -0.03462744504213333, 0.05001629516482353, 0.03282608091831207, -0.013136020861566067, 0.026563508436083794, -0.06579739600419998, -0.006947887130081654, -0.05116542801260948, 0.032708704471588135, 0.05314509943127632, -0.002000504871830344, -0.04781195521354675, -0.02993873506784439, 0.01486038975417614, 0.008914422243833542, -0.04054215922951698, -0.006979566533118486, 0.03047528862953186, -0.04815439507365227, -0.027490034699440002, 0.016508180648088455, 0.003797725308686495, 0.025793446227908134, 0.09166193008422852, -0.00048663714551366866, -0.02611945942044258, 0.061218149960041046, 0.0009601402562111616, -0.02228829823434353, 0.0005069443723186851, 0.041481032967567444, 0.011116285808384418, 0.006861401721835136, 0.0020035887137055397, 0.03921116888523102, 0.0016430343966931105, 0.02308644726872444, 0.020345008000731468, 0.006412857677787542, -0.008589616976678371, -0.034881725907325745, 0.013403872027993202, 0.03333285450935364, -0.016759803518652916, -0.0009281666134484112, -0.03345778211951256, 0.015270263887941837, 0.0393526554107666, -0.02300432324409485, 0.05505163595080376, 0.025110017508268356, 0.0161807369440794, 0.029416093602776527, -0.0012344802962616086, 0.07329575717449188, 0.05491284653544426, 0.009267284534871578, 0.002118605189025402, -0.02521943859755993 ]
Exploring simple optimizations for SDXL
sayakpaul
October 24, 2023
simple_sdxl_optimizations
diffusers, guide, sdxl
https://huggingface.co/blog/simple_sdxl_optimizations
Model memory footprint Models today are growing larger and larger, making it a challenge to fit them into memory. This section focuses on how you can reduce the memory footprint of these enormous models so you can run them on consumer GPUs. These techniques include CPU offloading, decoding latents into images over several steps rather than all at once, and using a distilled version of the autoencoder.
[ 0.05564626306295395, 0.02637721784412861, 0.0048039560206234455, 0.02594004012644291, 0.07013855874538422, 0.009076478891074657, -0.029659442603588104, -0.024215560406446457, -0.023342708125710487, -0.04918075352907181, -0.03791649267077446, 0.007264987099915743, -0.03393011912703514, 0.09101489186286926, 0.05336816981434822, -0.029219547286629677, 0.03164452314376831, -0.031768396496772766, -0.03205403313040733, 0.05242425948381424, 0.041155021637678146, -0.05688658356666565, 0.05836936831474304, 0.02569744363427162, -0.05998939275741577, 0.011012065224349499, 0.037498410791158676, -0.010560424998402596, -0.02560184895992279, -0.01721150241792202, -0.11018787324428558, 0.022608080878853798, -0.011241406202316284, -0.056289613246917725, 0.015654100105166435, -0.01133507676422596, -0.08036497980356216, 0.07034154236316681, 0.029329629614949226, -0.01904001645743847, -0.01963980123400688, 0.04220114275813103, -0.06254401057958603, 0.04736293852329254, 0.03605245053768158, 0.0078111328184604645, -0.10993712395429611, 0.061351168900728226, -0.031442079693078995, -0.05122175067663193, -0.04782832786440849, 0.10804320126771927, -0.03401951864361763, 0.01736541837453842, 0.03148649260401726, 0.04762568324804306, 0.04446868225932121, -0.03890228644013405, 0.011969469487667084, -0.0066019999794662, 0.07933492213487625, 0.0218217596411705, -0.029691487550735474, 0.04252711683511734, 0.008801965974271297, -0.01573179103434086, 0.041628867387771606, -0.05077362060546875, -0.0631597563624382, -0.027983620762825012, -0.012816217727959156, -0.0404210165143013, -0.005559041164815426, -0.0828397125005722, -0.05824245512485504, -0.025367887690663338, 0.07542161643505096, 0.05428975075483322, 0.05340774357318878, 0.004904576111584902, 0.04620837792754173, 0.05928027257323265, 0.07371752709150314, 0.037836793810129166, 0.026338214054703712, -0.03188851475715637, -0.010970480740070343, -0.050643566995859146, -0.015215819701552391, 0.06072063744068146, -0.00531370984390378, -0.09900379180908203, 0.04994716867804527, 0.03468228131532669, 0.034053999930620193, 0.002462653210386634, -0.013772445730865002, -0.010633714497089386, 0.014913908205926418, -0.003430332988500595, -0.017259446904063225, -0.049109816551208496, 0.034253861755132675, -0.022099992260336876, -0.04202291741967201, 0.0035191690549254417, -0.005518226884305477, -0.061428893357515335, -0.0006867112824693322, -0.010283988900482655, -0.02932133898139, 0.055731505155563354, -0.005383312702178955, 0.041336964815855026, -0.09120985120534897, 0.03042582981288433, 0.017172664403915405, -0.021385977044701576, 0.018720606341958046, 0.08465249091386795, 0.008560695685446262, 0.10870471596717834, 0.07128152996301651, -0.06899671256542206, -0.028721701353788376, 0.022677283734083176, 0.08103328198194504, -0.02067742869257927, -0.01876155659556389, -0.041289836168289185, 0.05197773873806, 0.0037020782474428415, 0.02811545692384243, 0.003103615017607808, 0.09284590929746628, -0.08560195565223694, -0.026263214647769928, -0.020320022478699684, 0.019347690045833588, -0.004579732194542885, -0.08474280685186386, -0.03148898482322693, 0.07037036865949631, -0.013012128882110119, 0.06419254839420319, -0.0060114189982414246, -0.0937238335609436, 0.07942743599414825, 0.024476129561662674, 0.05328734219074249, -0.0747164785861969, 0.04003174230456352, -0.014099699445068836, -0.08463679254055023, 0.06910844147205353, 0.04730689525604248, -0.06865792721509933, 0.03349565342068672, -0.06945448368787766, 0.005601671524345875, -0.051759183406829834, -0.04720471799373627, -0.019149407744407654, 0.023748068138957024, 0.06419883668422699, -0.01053366344422102, 0.02463712729513645, 0.04983406886458397, 0.04325345158576965, -0.008677851408720016, -0.018031587824225426, -0.03425728902220726, 0.08179345726966858, -0.038734693080186844, 0.022255495190620422, 0.05691754072904587, 0.054450128227472305, 0.10979534685611725, -0.024498073384165764, -0.030994240194559097, -0.03393641486763954, -0.021225901320576668, -0.03135255351662636, 0.03299686685204506, 0.017873045057058334, -0.1301734745502472, 0.011092470027506351, -0.09181840717792511, -0.060159433633089066, -0.0582151785492897, -0.023179618641734123, -0.015427306294441223, 0.04097265377640724, -0.012894827872514725, 0.0018189202528446913, 0.012807919643819332, -0.05138223618268967, 0.08043288439512253, 0.056168850511312485, 0.07675907760858536, -0.02061414159834385, 0.041345275938510895, -0.0009319250821135938, -0.011550512164831161, -0.018333526328206062, -0.01933986507356167, 0.026459960266947746, -0.03510478138923645, 0.010642429813742638, 0.02575242705643177, 0.041944198310375214, -0.15264573693275452, 0.030948949977755547, -0.0538322888314724, -0.053798604756593704, -0.06849788129329681, -0.006037432234734297, -0.016046622768044472, -0.04361097887158394, -0.039632927626371384, 0.09863416105508804, 0.017197011038661003, -0.06762727349996567, 0.010645910166203976, -0.07394583523273468, 0.06355814635753632, 0.038718946278095245, -0.056571416556835175, 0.06002717465162277, -0.07916060835123062, 0.0416061095893383, -0.04238725081086159, 0.025782104581594467, 0.011485890485346317, 0.027714803814888, -0.002771301195025444, -0.013683251105248928, 0.04691033810377121, 0.008479662239551544, -0.04309084638953209, -0.017230307683348656, -0.0010633403435349464, -0.018005963414907455, -0.0203628521412611, 0.052378099411726, -0.0200165007263422, 0.0041309320367872715, -0.021390441805124283, -0.04345356673002243, -0.026827095076441765, -0.00026648788480088115, 0.02818080224096775, -0.02370055764913559, -0.008084405213594437, 0.04298936203122139, -0.016173087060451508, -0.0019185118144378066, -0.010068745352327824, -0.026525745168328285, 0.027862021699547768, -0.008727922104299068, -0.012731174007058144, -0.002577574225142598, -0.02624276466667652, -0.017020780593156815, -0.010472998954355717, 0.04560790956020355, -0.02297273837029934, 0.008703053928911686, -0.028695346787571907, -0.01353001780807972, -0.01836264878511429, -0.0325021892786026, 0.005193726159632206, 0.034286610782146454, 0.0022516045719385147, 0.020095720887184143, -0.0565011203289032, 0.00791946705430746, -0.010821709409356117, 0.00413603475317359, -0.00011725547665264457, 0.04899120330810547, 0.0071578118950128555, -0.00939613301306963, 0.018040409311652184, 0.014627905562520027, 0.011364581063389778, -0.023649360984563828, 0.05156852677464485, 0.013271699659526348, 0.017312228679656982, -0.0008759234333410859, 0.00016216837684623897, 0.03377848118543625, 0.013912239111959934, 0.022230418398976326, -0.021473478525877, -0.016577955335378647, -0.012809577398002148, -0.02650557830929756, 0.004353056196123362, -0.0066904532723128796, -0.012735294178128242, -0.04223346337676048, 0.05704467371106148, 0.017828049138188362, 0.03869054466485977, -0.10123344510793686, -0.02138727344572544, -0.021234311163425446, 0.0019146944396197796, -0.003397126914933324, -0.026617158204317093, 0.008311685174703598, 0.022449370473623276, 0.021760614588856697, 0.06465453654527664, 0.0024725552648305893, 0.030891552567481995, 0.015461702831089497, 0.058215655386447906, -0.0027034105733036995, 0.03417700529098511, 0.05403870344161987, -0.009223662316799164, 0.024081315845251083, -0.013191535137593746, 0.015412287786602974, 0.03500254079699516, -0.011550530791282654, 0.037922631949186325, -0.005366955418139696, -0.007784400135278702, 0.010641033761203289, 0.03923062980175018, -0.001442024833522737, 0.01713511534035206, -0.005587475374341011, -0.03351021558046341, -0.016668930649757385, -0.004027485381811857, -0.04633048549294472, 0.05292193964123726, -0.01447176281362772, 0.01588808372616768, 0.0043854438699781895, 0.029329374432563782, 0.03846060484647751, 0.008018112741410732, 0.04133963957428932, 0.004458794370293617, 0.02323695831000805, -0.0113418810069561, -0.015592546202242374, 0.011268604546785355, 0.006650691851973534, -0.031913310289382935, -0.006527181249111891, -0.01277168095111847, 0.08183133602142334, 0.034685879945755005, -0.02709309011697769, -0.011743028648197651, 0.0010901889763772488, 0.037593696266412735, 0.02998696081340313, -0.007261825259774923, -0.06570470333099365, 0.015888025984168053, 0.03887896612286568, 0.02751973457634449, -0.02338491939008236, 0.038534171879291534, 0.028042012825608253, -0.029995575547218323, -0.011605240404605865, 0.03263922035694122, -0.04228760674595833, 0.02756628766655922, -0.024789413437247276, -0.0011793444864451885, -0.023048004135489464, 0.04436678811907768, -0.011225641705095768, 0.0062845018692314625, 0.06505738943815231, 0.058624349534511566, -0.0015088374493643641, -0.01837281882762909, -0.03766307234764099, -0.0054228538647294044, 0.003929919563233852, -0.014325802214443684, -0.02286851964890957, 0.055040717124938965, -0.017383476719260216, 0.03489973023533821, 0.029046155512332916, -0.03571188449859619, 0.023660650476813316, -0.010543029755353928, 0.05424903705716133, -0.015965042635798454, 0.028711646795272827, 0.02164119854569435, 0.0319305956363678, -0.04043015465140343, 0.012748622335493565, -0.04441007599234581, 0.011036996729671955, -0.012351512908935547, -0.03565370291471481, 0.015808338299393654, -0.006177132483571768, -0.026755036786198616, 0.023634931072592735, 0.0025735662784427404, -0.0030984242912381887, -0.01952439174056053, -0.010144684463739395, -0.023494726046919823, 0.014388328418135643, -0.012140936218202114, -0.013117142021656036, 0.012016577646136284, 0.02778109349310398, 0.03986784815788269, -0.023725338280200958, 0.05841054394841194, -0.03286363556981087, -0.03552555292844772, 0.03393169492483139, 0.009870694950222969, -0.0004339795559644699, 0.012772645801305771, -0.012523175217211246, -0.027469057589769363, -0.02933141030371189, 0.00500083714723587, 0.03900057077407837, 0.03099825046956539, 0.034055840224027634, -0.034734103828668594, -0.08300771564245224, 0.038154032081365585, -0.0076980674639344215, -0.03168053552508354, -0.006897103041410446, -0.044309623539447784, 0.020479897037148476, -0.07062342762947083, 0.04731041565537453, -0.02302161045372486, -0.04319830611348152, 0.03544357419013977, -0.0315747894346714, 0.04240803420543671, 0.042275574058294296, -0.017784614115953445, -0.057295508682727814, 0.026501627638936043, 0.011501486413180828, -0.009159951470792294, -0.0029335389845073223, -0.002623985754325986, -0.022726787254214287, 0.005002410151064396, -0.03405764698982239, 0.0038454902824014425, -0.044868383556604385, 0.024023914709687233, 0.007840782403945923, 0.01583430916070938, 0.036779992282390594, -0.058922458440065384, -0.008949939161539078, 0.01675771363079548, -0.024573922157287598, -0.010278577916324139, -0.015803003683686256, -0.01067350059747696, 0.031191281974315643, 0.0074168662540614605, 0.022072456777095795, 0.0044605121947824955, -0.025149842724204063, -0.014377862215042114, -0.01489486638456583, 0.03213769197463989, 0.01936209574341774, -0.02879098802804947, 0.007266520522534847, 0.019100269302725792, 0.058360129594802856, 0.09469184279441833, -0.027567259967327118, -0.0014372821897268295, 0.06440510600805283, 0.023252125829458237, 0.01877586543560028, -0.02318607270717621, 0.03732550889253616, 0.03597976267337799, 0.024150017648935318, 0.005071280524134636, -0.01343882828950882, 0.019419891759753227, 0.032068222761154175, 0.02476971410214901, -0.04040611907839775, -0.018355699256062508, 0.019878217950463295, -0.008661617524921894, 0.014911566860973835, -0.026441553607583046, 0.05858585983514786, -0.015522628091275692, 0.0009281723177991807, 0.023670827969908714, -0.03968328237533569, 0.00018247312982566655, -0.020241912454366684, 0.011805855669081211, -0.05860332027077675, 0.02814667671918869, 0.026850935071706772, 0.02812359295785427, -0.015192302875220776, 0.009620487689971924, -0.015474343672394753, 0.010682780295610428, -0.004794446285814047, 0.007612946443259716, -0.01643040031194687, 0.022565165534615517, -0.03439606353640556, 0.01949349045753479, 0.01819518208503723, 0.013779566623270512, 0.001686550909653306, 0.02836638130247593, 0.03214622661471367, 0.019790947437286377, -0.015995213761925697, 0.05098063871264458, 0.028443560004234314, -0.01740248315036297, -0.017325224354863167, -0.0617145299911499, -0.03914835304021835, 0.019552920013666153, -0.036740291863679886, -0.021031158044934273, 0.04408464580774307, -0.019835446029901505, -0.027213871479034424, 0.028778422623872757, 0.0503913089632988, -0.05583677440881729, 0.04941219091415405, 0.014347726479172707, 0.011185660026967525, 0.0005272708949632943, 0.035294461995363235, -0.0018442717846482992, 0.003452823730185628, -0.017863841727375984, 0.02446286752820015, -0.05741792544722557, 0.014643379487097263, 0.014567702077329159, -0.004180416464805603, 0.020917609333992004, -0.004075844306498766, -0.03345312178134918, -0.014085376635193825, 0.016550278291106224, 0.03268320485949516, 0.01991349458694458, -0.011912127956748009, 0.02550097368657589, -0.029041361063718796, 0.023084726184606552, 0.04096338152885437, 0.03264857456088066, -0.013695407658815384, 0.027511242777109146, 0.0019164725672453642, 0.06290457397699356, 0.04013900086283684, -0.011911609210073948, -0.029841981828212738, 0.04312713071703911, 0.03665235638618469, 0.009282919578254223, -0.015357441268861294, 0.0000019804895146080526, 0.01644403114914894, -0.025655407458543777, 0.01918605901300907, -0.009276765398681164, -0.051411405205726624, 0.020174218341708183, -0.016546310856938362, -0.032319068908691406, 0.0024966134224087, -0.045902155339717865, 0.058121684938669205, 0.04472257196903229, -0.014815359376370907, 0.0010422465857118368, 0.0048921615816652775, -0.017371423542499542, 0.02307443507015705, 0.035181690007448196, -0.0005109767662361264, 0.006161589175462723, 0.02303856797516346, 0.01604856736958027, 0.001488103880546987, 0.02884315513074398, 0.0558912493288517, 0.03299609571695328, 0.020894689485430717, -0.01755705662071705, -0.035739947110414505, -0.016934501007199287, -0.01608581654727459, -0.021429993212223053, 0.030207909643650055, -0.039467521011829376, -0.05026719719171524, 0.020984819158911705, -0.0036563335452228785, -0.033015623688697815, -0.012274762615561485, -0.0044724419713020325, -0.03107663057744503, -0.026615232229232788, 0.0110104288905859, 0.004060029052197933, -0.009549450129270554, 0.01844330132007599, 0.001269074622541666, -0.004985393490642309, -0.04128566384315491, -0.04298989102244377, -0.013473695144057274, 0.02125537022948265, -0.0037698473315685987, 0.024503808468580246, 0.005158404354006052, -0.0010939715430140495, 0.034218475222587585, -0.007688173092901707, -0.020109938457608223, -0.009561763145029545, -0.02519531548023224, -0.01329068373888731, -0.027328941971063614, 0.026129746809601784, -0.02132444642484188, -0.06390096992254257, -0.006092657335102558, 0.0005786895053461194, -0.015825912356376648, -0.008452261798083782, 0.03417897969484329, 0.020545165985822678, -0.006006328389048576, 0.002414400689303875, 0.006930316798388958, -0.04984920844435692, -0.03003154695034027, 0.00016770426009315997, 0.03374847024679184, -0.0025023575872182846, 0.03296440839767456, 0.011397161521017551, -0.01675993576645851, 0.010335979983210564, -0.0381862074136734, -0.000724725890904665, 0.0494435653090477, -0.005156264174729586, -0.043837256729602814, -0.026134023442864418, 0.04728366434574127, -0.03407057374715805, 0.027747677639126778, 0.023300424218177795, 0.044648513197898865, 0.014751528389751911, -0.03577375411987305, 0.016044065356254578, -0.011457392945885658, 0.025091828778386116, -0.050249308347702026, -0.03368411585688591, -0.019851813092827797, -0.018755614757537842, -0.01275109127163887, -0.008890659548342228, -0.0320274792611599, 0.0031229406595230103, -0.03954293951392174, 0.024683522060513496, -0.016141027212142944, 0.006917700637131929, 0.04006734862923622, 0.041108619421720505, 0.0011949389008805156, 0.02745838835835457, -0.023471951484680176, -0.011130050756037235, -0.03036647103726864, 0.08397174626588821, 0.020432235673069954, -0.013509816490113735, -0.037172067910432816, -0.04438037425279617, -0.014350049197673798, 0.020934680476784706, -0.047468818724155426, 0.0075392150320112705, 0.022393716499209404, -0.025578182190656662, 0.0002889552270062268, 0.005577122326940298, 0.008199721574783325, 0.01946233958005905, 0.05110780894756317, 0.001147870672866702, -0.05546526238322258, 0.020288990810513496, 0.05669406056404114, -0.05455410107970238, -0.026991160586476326, -0.013380653224885464, 0.00043011142406612635, 0.04271656274795532, 0.010691165924072266, 0.004000160843133926, 0.03710832819342613, -0.014352187514305115, 0.0113729452714324, 0.005111780017614365, -0.005368024576455355, -0.029991870746016502, -0.008020640350878239, 0.038010623306035995, -0.02250799536705017, -0.042987000197172165, -0.016630064696073532, -0.035604920238256454, 0.012925069779157639, 0.0016280132113024592, -0.012463447637856007, 0.01575028896331787, 0.014131773263216019, -0.010086449794471264, -0.0527506023645401, 0.02234138362109661, 0.06270742416381836, -0.012578124180436134, -0.025291208177804947, -0.031199654564261436 ]
Exploring simple optimizations for SDXL
sayakpaul
October 24, 2023
simple_sdxl_optimizations
diffusers, guide, sdxl
https://huggingface.co/blog/simple_sdxl_optimizations
torch.compile PyTorch 2.0 also introduced the torch.compile API for just-in-time (JIT) compilation of your PyTorch code into more optimized kernels for inference. Unlike other compiler solutions, torch.compile requires minimal changes to your existing code and it is as easy as wrapping your model with the function. With the mode parameter, you can optimize for memory overhead or inference speed during compilation, which gives you way more flexibility. python from diffusers import StableDiffusionXLPipeline pipe = StableDiffusionXLPipeline.from_pretrained( "stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16, ).to("cuda") pipe.unet = torch.compile(pipe.unet, mode="reduce-overhead", fullgraph=True) Compared to the previous baseline (fp16 + SDPA), wrapping the UNet with torch.compile improves inference time to 10.2 seconds. โš ๏ธ The first time you compile a model is slower, but once the model is compiled, all subsequent calls to it are much faster!
[ 0.02779107540845871, 0.012233024463057518, 0.005128048826009035, 0.013498838059604168, 0.007685879245400429, -0.009266427718102932, -0.0020278936717659235, 0.02762485109269619, -0.019657477736473083, -0.017690345644950867, -0.030597247183322906, -0.008861434645950794, -0.029454519972205162, 0.006249023601412773, 0.028836267068982124, -0.07366520911455154, 0.04137502983212471, -0.010171006433665752, -0.029999107122421265, 0.06692294031381607, 0.012858043424785137, -0.039279378950595856, -0.006995942443609238, -0.01485521998256445, -0.08531909435987473, -0.08472547680139542, -0.012066466733813286, -0.011665217578411102, -0.03206595405936241, -0.01516714133322239, -0.1405806839466095, -0.00795313622802496, 0.015335587784647942, -0.030841419473290443, 0.007344647776335478, -0.007092381361871958, -0.06094108521938324, 0.04614698886871338, 0.09225135296583176, -0.04064237326383591, 0.06074477732181549, 0.004175493028014898, -0.07752597332000732, 0.0395658053457737, -0.011334567330777645, 0.02646050602197647, -0.11423783749341965, 0.08443178981542587, -0.01587711088359356, 0.005532515235245228, -0.08526495099067688, 0.03528791666030884, -0.09137049317359924, 0.0454569011926651, 0.004516869317740202, 0.038943953812122345, 0.022510241717100143, 0.03730595484375954, -0.009791282936930656, -0.03698698431253433, 0.0031465934589505196, 0.008859539404511452, 0.0003927505458705127, 0.010641874745488167, 0.026501042768359184, 0.02712509036064148, -0.03284858912229538, -0.010171138681471348, -0.12393318861722946, -0.054636694490909576, 0.042402349412441254, -0.01563532091677189, -0.004764311481267214, 0.00209623365662992, -0.017466770485043526, -0.031809110194444656, -0.021121883764863014, 0.011177846230566502, 0.07830813527107239, 0.09805840998888016, 0.008849713020026684, 0.019457612186670303, -0.004984425846487284, 0.03768178075551987, 0.030747970566153526, 0.016462499275803566, 0.03372636064887047, -0.04539771005511284, -0.015307256020605564, -0.014224790968000889, -0.04047759622335434, -0.04127474129199982, -0.0031589039135724306, 0.0027625616639852524, -0.019981203600764275, 0.04453728348016739, -0.050866395235061646, 0.033016402274370193, 0.02705835923552513, -0.018485059961676598, 0.04017426446080208, -0.10944996774196625, 0.00925514753907919, -0.05172990262508392, -0.057457081973552704, 0.06779392808675766, -0.05031124874949455, -0.07949835807085037, -0.07634937763214111, 0.018428554758429527, -0.025525616481900215, 0.08066093921661377, -0.04605720937252045, 0.017036013305187225, -0.07865249365568161, -0.02819783054292202, -0.028115898370742798, 0.005087654106318951, -0.04320311173796654, 0.0027737838681787252, -0.03321630507707596, 0.08282274752855301, 0.08270852267742157, 0.029343411326408386, 0.01146862842142582, 0.1275862604379654, 0.04876559227705002, 0.11807328462600708, 0.0012556520523503423, -0.01633373461663723, 0.03307032212615013, -0.04201674833893776, 0.0506909005343914, -0.05355693772435188, 0.05524156242609024, -0.07741277664899826, -0.04313800483942032, -0.07948598265647888, -0.0430302619934082, 0.01474755723029375, -0.01671385020017624, 0.027497882023453712, 0.005077583249658346, 0.024620043113827705, -0.030020790174603462, -0.014947126619517803, -0.009997223503887653, 0.0037700312677770853, 0.016028743237257004, 0.03643210232257843, -0.07253392785787582, 0.05606245622038841, -0.07505499571561813, -0.025256667286157608, -0.035734809935092926, 0.09192712604999542, -0.005403701215982437, -0.01915973424911499, -0.04478875547647476, 0.005613255314528942, 0.0069311861880123615, -0.029527738690376282, 0.022997770458459854, -0.05470750853419304, 0.02463386580348015, -0.0027558589354157448, 0.040182508528232574, 0.016344735398888588, 0.061161428689956665, 0.007827662862837315, 0.034182701259851456, -0.02411065250635147, 0.0999428853392601, -0.03385293856263161, 0.000612459029071033, 0.05385709926486015, 0.024932444095611572, 0.0899520069360733, -0.0213956106454134, -0.02962534874677658, -0.051799509674310684, 0.09772690385580063, -0.052109938114881516, 0.04462786391377449, 0.0343143455684185, -0.08563005179166794, 0.04627380520105362, -0.10199463367462158, -0.02036789059638977, 0.022494999691843987, -0.00014043727423995733, -0.01679835468530655, 0.023063480854034424, -0.05065850168466568, 0.06290639191865921, -0.04238355532288551, -0.02641414850950241, 0.08999978005886078, -0.013316633179783821, 0.01754843257367611, 0.0034442110918462276, -0.02593102492392063, -0.00993338506668806, -0.010432865470647812, -0.0009080413146875799, 0.005378284491598606, 0.014807944186031818, -0.027754513546824455, 0.016297554597258568, -0.004755592904984951, 0.030761877074837685, -0.11190487444400787, 0.010380697436630726, -0.06282240897417068, 0.01407436840236187, -0.03916875645518303, -0.02633356861770153, 0.03415737673640251, 0.04958394169807434, -0.03356276825070381, 0.1321791708469391, -0.059737905859947205, -0.03678548336029053, -0.04560432583093643, -0.059509776532649994, 0.04203515127301216, 0.05570000782608986, -0.009148430079221725, 0.053826555609703064, -0.09134361892938614, -0.036529913544654846, -0.11164785176515579, -0.027409933507442474, 0.0766223818063736, -0.016155125573277473, -0.025029972195625305, -0.021995067596435547, 0.039443302899599075, 0.011056644842028618, -0.058278556913137436, 0.06413782387971878, 0.0021415373776108027, 0.02795039303600788, 0.005899724084883928, 0.01755412667989731, -0.004971962887793779, 0.018465586006641388, -0.05820963904261589, 0.030826618894934654, 0.006029936950653791, -0.0017492404440417886, -0.020088115707039833, 0.025439990684390068, -0.014183759689331055, 0.05909787863492966, 0.059360321611166, -0.019936371594667435, 0.01515057124197483, 0.003476483514532447, 0.054149989038705826, 0.0112838726490736, -0.0005618022405542433, -0.021167069673538208, -0.00870461668819189, -0.015459560789167881, -0.07690896838903427, -0.028425252065062523, 0.021126901730895042, 0.009605123661458492, 0.013465492986142635, 0.033938903361558914, 0.015270824544131756, -0.026116937398910522, 0.00927924457937479, 0.026815742254257202, 0.05970241129398346, 0.030942615121603012, -0.0018384240102022886, -0.041522882878780365, -0.06460537016391754, -0.01844768598675728, -0.024202551692724228, -0.005427037365734577, 0.023916561156511307, -0.010103147476911545, 0.019273074343800545, -0.011018224060535431, -0.019625680521130562, -0.06394598633050919, 0.04217182844877243, -0.011236312799155712, 0.024713121354579926, 0.001776411198079586, -0.06932152062654495, 0.0009003438171930611, 0.036313630640506744, -0.011364580132067204, -0.038271430879831314, 0.0006014825194142759, 0.0067192567512393, -0.034029118716716766, -0.02679618075489998, -0.011838910169899464, -0.009719423949718475, -0.03461339697241783, 0.02418818324804306, 0.014872102066874504, 0.008626735769212246, -0.08603913336992264, 0.011349883861839771, 0.010272132232785225, -0.028119264170527458, 0.002540202811360359, -0.025247648358345032, -0.003215065225958824, 0.0045951008796691895, 0.018850550055503845, 0.02920449711382389, 0.027056369930505753, 0.008281797170639038, 0.006251737475395203, 0.027328602969646454, -0.014797192998230457, -0.010111471638083458, 0.022805867716670036, 0.02570660226047039, 0.009415950626134872, -0.037469085305929184, -0.019515985623002052, 0.034332025796175, -0.01135285198688507, -0.01727369986474514, -0.0437639094889164, 0.016874700784683228, 0.028111586347222328, 0.019961846992373466, -0.015270496718585491, -0.012109942734241486, -0.03436611592769623, -0.02490241453051567, 0.03147827088832855, -0.012403824366629124, -0.050557542592287064, 0.0014727405505254865, -0.022670671343803406, 0.020389748737215996, 0.016783541068434715, 0.036811713129282, -0.002751629799604416, -0.017172792926430702, -0.004848048556596041, -0.01782502792775631, 0.006974682677537203, -0.02390131726861, 0.012652667239308357, 0.0036872129421681166, -0.007534342352300882, -0.030522625893354416, -0.03211402893066406, 0.01796160452067852, 0.021042730659246445, 0.04308789595961571, 0.010528145357966423, -0.007185637950897217, -0.031620610505342484, 0.03221908584237099, 0.0646112784743309, -0.005475807469338179, -0.04493480920791626, 0.04009580984711647, 0.041890617460012436, -0.021257134154438972, -0.031168196350336075, 0.0038502002134919167, 0.026488566771149635, -0.006713009439408779, -0.010024013929069042, 0.03163105621933937, -0.009197584353387356, 0.04203105345368385, -0.012666565366089344, 0.014148551970720291, -0.032503221184015274, 0.05798066407442093, -0.03431857377290726, -0.012985109351575375, 0.0414590984582901, 0.02037835493683815, -0.02379058487713337, -0.05360516160726547, 0.03745781257748604, -0.021145937964320183, -0.009712167084217072, 0.01921086572110653, 0.021288268268108368, -0.04250659793615341, -0.0057152071967720985, -0.014981326647102833, -0.005015275906771421, 0.012865299358963966, 0.046040404587984085, -0.0062787034548819065, -0.01125340722501278, -0.014976922422647476, 0.06664377450942993, 0.025827229022979736, 0.021333271637558937, -0.0034882877953350544, 0.03053770400583744, -0.05195216089487076, -0.009440265595912933, -0.023278621956706047, -0.007670493796467781, 0.0009941954631358385, -0.07009851932525635, 0.016955090686678886, 0.020361393690109253, -0.00004624199209501967, 0.0004935323959216475, -0.015509294345974922, 0.012749169953167439, 0.0034427589271217585, 0.03155016899108887, 0.026630250737071037, 0.04008621722459793, -0.04137180745601654, -0.011506399139761925, 0.038365688174963, -0.02409912645816803, 0.07705434411764145, 0.018899332731962204, -0.030910445377230644, 0.04028184339404106, 0.027847854420542717, 0.017947956919670105, 0.05756361037492752, -0.003253857372328639, 0.012414892204105854, -0.04601230472326279, 0.03614534065127373, 0.017178956419229507, 0.016317570582032204, 0.011825005523860455, -0.015872646123170853, 0.024334589019417763, 0.025399217382073402, 0.02205115184187889, -0.017927560955286026, -0.04332789033651352, 0.0015100834425538778, 0.0062309494242072105, -0.01919163018465042, 0.00005599669020739384, 0.023051131516695023, -0.05086434632539749, 0.03684234246611595, -0.0815320685505867, 0.028147270902991295, 0.0288351159542799, -0.004347762558609247, -0.017803644761443138, -0.008876487612724304, 0.008898735977709293, 0.020368847995996475, 0.006765055004507303, -0.00018583321070764214, 0.025374596938490868, 0.020733807235956192, -0.04902486875653267, 0.05513307452201843, 0.008546356111764908, -0.004623010288923979, 0.0495651476085186, 0.008447150699794292, -0.0022086899261921644, -0.041906941682100296, 0.014954953454434872, -0.034087058156728745, -0.040126461535692215, 0.04193982854485512, -0.008284172043204308, -0.040373414754867554, 0.043642908334732056, 0.019402988255023956, 0.03273915499448776, 0.017355099320411682, 0.02286442369222641, -0.01203045342117548, 0.008614374324679375, -0.01217497419565916, 0.046574126929044724, 0.0005202299798838794, 0.013445005752146244, 0.02155594527721405, -0.02846652641892433, 0.03667617216706276, 0.034194547683000565, 0.027220234274864197, -0.0013671501073986292, -0.01942915841937065, 0.0004910668358206749, -0.003303753910586238, 0.03362461179494858, -0.029110876843333244, -0.032586172223091125, 0.0077138543128967285, 0.02763814851641655, -0.013133052736520767, 0.01304846815764904, 0.006550651043653488, -0.040261950343847275, -0.07760277390480042, 0.014140607789158821, 0.054608214646577835, 0.014315680600702763, -0.006246309727430344, 0.03992572799324989, -0.025506339967250824, 0.02531236782670021, -0.022660506889224052, 0.008885350078344345, 0.011912343092262745, -0.000003756294290724327, -0.01977064646780491, -0.025085721164941788, 0.02207949571311474, 0.023593910038471222, 0.014422575011849403, -0.020040884613990784, -0.048896417021751404, -0.013506290502846241, -0.01863291673362255, 0.02996785193681717, -0.03993230685591698, -0.03190614655613899, 0.008445302955806255, -0.013916713185608387, 0.057461533695459366, 0.016146542504429817, 0.0034745868761092424, -0.04213082045316696, 0.028544189408421516, 0.05156225711107254, 0.001815898111090064, -0.013320484198629856, 0.01655067503452301, 0.011558491736650467, 0.0019319666316732764, -0.030444489791989326, -0.029229294508695602, -0.037236232310533524, 0.02871457301080227, -0.015549303963780403, 0.03468739613890648, 0.03820384666323662, -0.04765720292925835, 0.014941171742975712, 0.0049825869500637054, 0.04283502697944641, -0.017342034727334976, 0.004671287257224321, -0.04820014536380768, 0.0020415429025888443, -0.013006528839468956, 0.032532017678022385, -0.02784198336303234, 0.047129951417446136, 0.011539044789969921, 0.04941617324948311, -0.03715105727314949, -0.0037649713922291994, 0.0012648889096453786, -0.017498081550002098, 0.033707473427057266, 0.01595701277256012, -0.04758164659142494, -0.011950822547078133, -0.000914263422600925, -0.0011172255035489798, 0.026802459731698036, -0.013608616776764393, 0.02153416909277439, -0.00558465113863349, -0.02524404600262642, -0.020399902015924454, 0.08165735006332397, -0.037447739392519, 0.0509854294359684, 0.03994525969028473, 0.05468584597110748, 0.025786830112338066, -0.014558622613549232, 0.007297180593013763, 0.04239445924758911, 0.07123472541570663, 0.042486224323511124, 0.0007923772791400552, 0.02921883389353752, -0.010427922941744328, 0.014062562957406044, -0.02084149606525898, -0.005027409177273512, -0.03705936297774315, 0.007200819905847311, 0.031092843040823936, 0.026276234537363052, -0.0021218617912381887, -0.04904751852154732, 0.06089076027274132, 0.045733869075775146, 0.05635024234652519, 0.022245200350880623, 0.01816907525062561, -0.0007393837440758944, 0.04600101709365845, -0.0316605307161808, 0.014877990819513798, -0.000732738000806421, 0.012713748030364513, 0.004329327028244734, 0.0009357942035421729, 0.012533435598015785, -0.006064192391932011, 0.011776515282690525, 0.023917948827147484, 0.003620799630880356, -0.0019253961509093642, 0.006738197058439255, -0.00378416758030653, -0.03083254024386406, -0.01039531547576189, 0.023968534544110298, -0.058342985808849335, 0.03816971927881241, -0.007371150888502598, -0.017000092193484306, -0.020281551405787468, -0.0005754424491897225, -0.004633523523807526, -0.0012696082703769207, 0.022966057062149048, -0.0033752061426639557, -0.010576185770332813, 0.014139071106910706, 0.024110158905386925, 0.01202473510056734, -0.003734579775482416, 0.025683730840682983, 0.0064206188544631, 0.02878958359360695, -0.00975467823445797, 0.0029984316788613796, -0.048759281635284424, 0.012709551490843296, -0.028443582355976105, -0.026681814342737198, -0.00916778203099966, 0.020605038851499557, 0.004318729508668184, 0.04000793769955635, -0.018589219078421593, 0.014070400968194008, 0.012846582569181919, -0.061201032251119614, 0.044137679040431976, 0.022825967520475388, -0.02256259135901928, 0.021343501284718513, 0.045014239847660065, 0.02979312837123871, -0.0015256977640092373, -0.015044367872178555, -0.07447420060634613, 0.01014467142522335, 0.002914555137977004, 0.00678332569077611, -0.009450605139136314, 0.04592394456267357, 0.007999475114047527, 0.028431149199604988, -0.046925537288188934, 0.0039477418176829815, -0.017468728125095367, 0.007700454909354448, 0.03627574071288109, 0.010887186042964458, -0.022259976714849472, -0.014955428428947926, 0.05109764635562897, 0.00010488887346582487, -0.0036424840800464153, 0.028592262417078018, 0.005039039067924023, -0.014234142377972603, -0.014047769829630852, 0.014260207302868366, -0.059512246400117874, 0.026933949440717697, -0.004257477354258299, 0.004411011468619108, 0.0016144150868058205, 0.06399054080247879, -0.005678183864802122, -0.00849223043769598, -0.0326252356171608, -0.02372691035270691, -0.0010585419367998838, 0.014070467092096806, -0.009219291619956493, 0.012184162624180317, 0.06917605549097061, 0.07647686451673508, -0.013662188313901424, 0.011063684709370136, -0.058140553534030914, 0.027250783517956734, -0.0019434965215623379, 0.05646917596459389, 0.057121679186820984, -0.013537989929318428, -0.02920229732990265, -0.04116358608007431, -0.00951688177883625, 0.0010379583109170198, -0.018440693616867065, -0.019403016194701195, -0.026130611076951027, -0.030926087871193886, -0.05020086467266083, 0.02295633777976036, 0.044317614287137985, 0.024378027766942978, 0.06235050410032272, -0.012528752908110619, -0.01870899274945259, 0.017324529588222504, -0.012364937923848629, -0.03896736726164818, 0.016390228644013405, -0.004586723167449236, -0.02208789251744747, 0.035811975598335266, 0.01413937658071518, 0.03215448558330536, 0.026124879717826843, 0.041768573224544525, -0.0024747769348323345, 0.007393894717097282, -0.06256452202796936, -0.07015959173440933, -0.012870288453996181, 0.04858000949025154, -0.0129485372453928, -0.009165478870272636, -0.013046135194599628, -0.0015045162290334702, -0.0035966879222542048, 0.0075182304717600346, 0.02599579095840454, 0.022700315341353416, 0.027009962126612663, -0.016018472611904144, -0.02049480937421322, 0.03624347224831581, 0.03385080769658089, 0.002912019845098257, -0.010372382588684559, -0.02550582028925419 ]
Exploring simple optimizations for SDXL
sayakpaul
October 24, 2023
simple_sdxl_optimizations
diffusers, guide, sdxl
https://huggingface.co/blog/simple_sdxl_optimizations
Tiny Autoencoder As previously mentioned, a VAE decodes latents into images. Naturally, this step is directly bottlenecked by the size of the VAE. So, letโ€™s just use a smaller autoencoder! The Tiny Autoencoder by madebyollin, available the Hub is just 10MB and it is distilled from the original VAE used by SDXL. python from diffusers import AutoencoderTiny pipe = StableDiffusionXLPipeline.from_pretrained( "stabilityai/stable-diffusion-xl-base-1.0", torch_dtype=torch.float16, ) pipe.vae = AutoencoderTiny.from_pretrained("madebyollin/taesdxl", torch_dtype=torch.float16) pipe.to("cuda") With this setup, we reduce the memory requirement to 15.6GB while reducing the inference latency at the same time. โš ๏ธ The Tiny Autoencoder can omit some of the more fine-grained details from images, which is why the Tiny AutoEncoder is more appropriate for image previews.
[ 0.03678038716316223, 0.0077850730158388615, 0.07231158763170242, 0.03306266665458679, 0.025694431737065315, 0.001821305719204247, -0.006969009526073933, 0.02188684418797493, 0.00019856404105667025, -0.061091043055057526, -0.018358450382947922, -0.005932572763413191, -0.020988188683986664, 0.022465119138360023, 0.04658273607492447, -0.035084981471300125, 0.023664897307753563, -0.02479231171309948, -0.03667937591671944, 0.05068318545818329, -0.008153454400599003, -0.08445851504802704, -0.003695328254252672, 0.043533485382795334, -0.12149667739868164, -0.0415356419980526, -0.028461983427405357, 0.01835874281823635, -0.06445547938346863, -0.04567998647689819, -0.14349065721035004, -0.013934534974396229, 0.018034443259239197, -0.05176461488008499, 0.03525744006037712, -0.06273471564054489, -0.04804026335477829, 0.03428163006901741, 0.04381883516907692, 0.033233240246772766, -0.057991448789834976, 0.02948712930083275, -0.04056061804294586, 0.05845485255122185, 0.05802219733595848, -0.02804776467382908, -0.0915369838476181, 0.07351469993591309, -0.05405980721116066, 0.05050571635365486, -0.01967564970254898, 0.011348070576786995, -0.02252964861690998, -0.026100119575858116, 0.026476120576262474, 0.035896964371204376, 0.03620931878685951, -0.035744477063417435, 0.0326496846973896, -0.004830682184547186, 0.05709468945860863, 0.014265025034546852, -0.029678959399461746, 0.08066549152135849, 0.03562153875827789, -0.0002850503951776773, 0.016961459070444107, 0.045470669865608215, 0.016265831887722015, -0.09373660385608673, -0.0005866665742360055, -0.041958294808864594, -0.009577743709087372, -0.035526011139154434, -0.04532052204012871, 0.0170004703104496, -0.019804581999778748, 0.04201054573059082, 0.0694541484117508, 0.040931060910224915, 0.0009257755591534078, 0.039188869297504425, 0.007789363153278828, 0.07034958899021149, -0.050286952406167984, 0.014053885824978352, 0.008584857918322086, -0.03847506642341614, -0.0583818145096302, 0.012029426172375679, -0.03433610871434212, -0.10036324709653854, 0.008976507000625134, 0.006908196955919266, 0.015770407393574715, 0.02184583805501461, 0.04120440036058426, 0.04740285873413086, 0.06756776571273804, 0.02899193949997425, -0.0016497306060045958, -0.06339191645383835, 0.002379821380600333, -0.10512737929821014, -0.059256404638290405, 0.09212755411863327, -0.0534592941403389, -0.030962087213993073, 0.028219332918524742, 0.005045610945671797, 0.013386008329689503, 0.08325956761837006, -0.054872144013643265, 0.05410681292414665, -0.12584733963012695, 0.01974095031619072, -0.035345856100320816, 0.04328949749469757, -0.0006102859042584896, 0.033255066722631454, -0.019074546173214912, 0.08431589603424072, 0.06422528624534607, -0.03941938653588295, -0.028798559680581093, 0.04785451665520668, -0.009147273376584053, 0.046398699283599854, -0.012180634774267673, 0.08037074655294418, 0.00550540816038847, -0.026259208098053932, 0.11603420972824097, -0.0696033462882042, 0.03273618221282959, -0.04777592048048973, -0.06633643060922623, -0.0789530798792839, -0.010914458893239498, -0.018908130005002022, -0.032633908092975616, 0.05208899453282356, 0.02772800251841545, -0.005303311161696911, 0.0017439862713217735, 0.033555302768945694, -0.06680876016616821, 0.06002777814865112, -0.017056461423635483, 0.005402225535362959, -0.08072067052125931, 0.03363194689154625, -0.00819595716893673, -0.0209706649184227, -0.016787031665444374, 0.061617977917194366, -0.03472532331943512, -0.015457216650247574, 0.010441789403557777, -0.00669069541618228, -0.0016820853343233466, -0.025507871061563492, -0.03203392028808594, 0.03657481074333191, 0.021759338676929474, -0.03463040292263031, 0.03566434234380722, 0.020113784819841385, 0.040839698165655136, -0.003625833196565509, 0.04853900149464607, -0.0101579325273633, 0.07618685066699982, -0.045282308012247086, 0.02153032086789608, 0.04900548979640007, 0.05841564014554024, 0.10502444952726364, 0.0015871789073571563, -0.09112027287483215, 0.0013438743771985173, 0.0646481066942215, -0.019840789958834648, 0.03131500259041786, 0.0538017638027668, -0.08112651109695435, 0.07325281202793121, -0.039403438568115234, -0.0551711805164814, -0.024794669821858406, 0.01967669650912285, 0.004321382846683264, 0.012761268764734268, 0.04536355659365654, 0.04516558721661568, -0.029565254226326942, -0.010045421309769154, 0.0933069959282875, 0.08681918680667877, 0.003060847520828247, -0.00017043505795300007, -0.012195033952593803, 0.011186519637703896, -0.022180994972586632, -0.04525582119822502, 0.012490002438426018, 0.021573275327682495, -0.02840605564415455, 0.07066844403743744, 0.009498286992311478, 0.00976112112402916, -0.12853823602199554, 0.012172121554613113, -0.0474502258002758, 0.010993989184498787, -0.002253643935546279, 0.004131178371608257, -0.05880267545580864, -0.03719392046332359, -0.01764252409338951, 0.10672058910131454, -0.028638353571295738, -0.0259879007935524, 0.009786216542124748, -0.0315328873693943, 0.08779878914356232, 0.08909931033849716, -0.07360520213842392, 0.057740356773138046, -0.07989943772554398, -0.06755968183279037, -0.05471397191286087, -0.04066084697842598, -0.018669547513127327, -0.00880356039851904, -0.0362316332757473, -0.010420994833111763, 0.07410189509391785, 0.04234946146607399, -0.015949124470353127, 0.07907711714506149, 0.027378814294934273, -0.026271075010299683, 0.011702212505042553, -0.017887786030769348, 0.01255218405276537, 0.09026038646697998, -0.01830110512673855, -0.035902347415685654, 0.019710643216967583, 0.017829379066824913, 0.014909276738762856, -0.0658271387219429, -0.03427301347255707, 0.010073339566588402, 0.045709699392318726, -0.023482082411646843, -0.04067892208695412, 0.007536816410720348, 0.028535446152091026, -0.006511702202260494, 0.02437681332230568, -0.004519386682659388, -0.017978176474571228, 0.005723167676478624, 0.008911985903978348, 0.014496104791760445, -0.012740658596158028, -0.015815051272511482, 0.00848935917019844, -0.012872097082436085, 0.035325758159160614, -0.0023975332733243704, 0.00958289299160242, 0.01658790186047554, 0.036618854850530624, 0.035253316164016724, -0.020105775445699692, -0.0051702228374779224, -0.037956248968839645, 0.006550824735313654, -0.012322191148996353, 0.04249164089560509, 0.0483001284301281, 0.05197025090456009, 0.019040651619434357, -0.01876377873122692, 0.0056975525803864, -0.02747955545783043, 0.017692429944872856, 0.020597023889422417, 0.027197256684303284, 0.024196280166506767, 0.020624378696084023, 0.027399202808737755, 0.0035003498196601868, 0.02052474208176136, -0.04672761633992195, 0.02012498676776886, 0.009453480131924152, -0.016705553978681564, 0.00636312598362565, 0.003543973434716463, -0.0053421794436872005, -0.04753401502966881, 0.013886173255741596, -0.028638558462262154, -0.0036417627707123756, -0.08480942994356155, 0.0005776266916655004, -0.004256573971360922, -0.008324549533426762, -0.019483987241983414, -0.05744580179452896, 0.015817979350686073, 0.003077917266637087, -0.014315498061478138, 0.0012527513317763805, 0.010559937916696072, 0.029481226578354836, 0.027266236022114754, -0.0007173398043960333, 0.03678881749510765, 0.0033321683295071125, 0.019462361931800842, 0.027633769437670708, 0.02140050008893013, -0.039462339133024216, -0.04869924485683441, 0.02206033281981945, -0.0003214760508853942, 0.030719371512532234, 0.012105859816074371, 0.005010146647691727, 0.035435207188129425, -0.0255963783711195, 0.0035679489374160767, 0.024957405403256416, -0.01979711279273033, -0.022194137796759605, -0.025843961164355278, 0.0025851104874163866, -0.08247483521699905, 0.02281961776316166, -0.009315426461398602, -0.03678533062338829, 0.03035096637904644, 0.032252777367830276, 0.024998294189572334, -0.002825365401804447, 0.016164537519216537, 0.017468342557549477, 0.015886850655078888, -0.04183311387896538, 0.013274227268993855, -0.023440854623913765, -0.013448544777929783, -0.05644090473651886, -0.0435171015560627, 0.00363621162250638, -0.01769382879137993, 0.065534308552742, 0.022228678688406944, 0.018776630982756615, -0.012770058587193489, 0.04296818748116493, 0.0335020050406456, -0.018097205087542534, -0.08586707711219788, 0.007620745338499546, 0.010413652285933495, 0.027753690257668495, -0.01625339314341545, 0.059029530733823776, 0.011191698722541332, 0.014870495535433292, -0.01433277502655983, 0.024523112922906876, -0.03574857488274574, 0.054287977516651154, 0.01916533149778843, 0.006621248088777065, -0.019403187558054924, 0.02140670455992222, 0.004925429355353117, -0.024180617183446884, 0.004492561332881451, 0.04042087867856026, -0.01364077441394329, 0.0034366759937256575, 0.003911065403372049, -0.018053455278277397, 0.013833833858370781, -0.00652509368956089, -0.02802371419966221, -0.030604133382439613, 0.03075731173157692, -0.0084252143278718, -0.0031857627909630537, 0.003076330292969942, 0.04878385737538338, -0.04103996604681015, 0.029319223016500473, 0.007647017017006874, -0.004638007842004299, 0.03778044506907463, 0.033316269516944885, 0.03159671276807785, 0.04103757441043854, -0.04700769856572151, -0.057044122368097305, -0.0014608055353164673, -0.042727064341306686, 0.0258089117705822, -0.0344669483602047, 0.004931102506816387, 0.033625613898038864, 0.026309644803404808, 0.0273056011646986, -0.0041736760176718235, 0.018376996740698814, 0.008329186588525772, 0.05487920343875885, -0.00047665208694525063, 0.05392216891050339, -0.037879426032304764, -0.016907373443245888, 0.013050530105829239, -0.013986999168992043, 0.021540073677897453, 0.005374878644943237, -0.057539891451597214, 0.024699963629245758, 0.031324975192546844, -0.024448100477457047, 0.004875785671174526, -0.03671015799045563, -0.030039368197321892, -0.03741922974586487, -0.00859516579657793, 0.014776940457522869, -0.00975650455802679, 0.0026750382967293262, -0.04101891815662384, -0.007363664917647839, 0.0076200091280043125, -0.00626819534227252, -0.014154857955873013, -0.04253199324011803, -0.006844388321042061, 0.005407979246228933, -0.03428240865468979, 0.024478349834680557, -0.0028990621212869883, -0.0017310443799942732, 0.03172420337796211, -0.0211112592369318, 0.002903460059314966, 0.04571118578314781, -0.04436912015080452, -0.039163656532764435, -0.0018670978024601936, 0.015653017908334732, -0.018777888268232346, -0.020625989884138107, 0.01632874459028244, 0.015235844068229198, -0.0063604749739170074, -0.008359055034816265, 0.030171968042850494, -0.03051188588142395, 0.029305318370461464, -0.024354755878448486, 0.0017811066936701536, 0.009304424747824669, -0.06634575873613358, -0.015723563730716705, 0.014972984790802002, -0.028697986155748367, 0.043778058141469955, -0.03135916590690613, 0.0239932332187891, -0.015755608677864075, 0.024076014757156372, 0.020025918260216713, 0.006727602332830429, -0.030196567997336388, -0.02347252517938614, 0.022792933508753777, 0.002451203763484955, 0.05750345066189766, -0.030918357893824577, -0.023758351802825928, 0.012039216235280037, 0.032389745116233826, 0.061405427753925323, 0.012464645318686962, 0.04888629913330078, 0.01568632386624813, -0.007965982891619205, -0.027762940153479576, 0.005157523322850466, 0.01221520360559225, -0.03775852173566818, 0.038078781217336655, -0.011300750076770782, 0.00915195606648922, -0.022056711837649345, 0.05089375749230385, 0.015200718306005001, -0.020335927605628967, -0.031211258843541145, 0.006930861622095108, 0.002744639292359352, 0.028025653213262558, 0.004457694943994284, 0.019528362900018692, 0.004083394538611174, 0.035179488360881805, -0.00443547498434782, -0.0046722544357180595, 0.01392829604446888, 0.0008409006986767054, 0.0052272966131567955, -0.030176766216754913, 0.017025969922542572, 0.03426816686987877, 0.012893350794911385, -0.02404848299920559, -0.020296301692724228, -0.007764521054923534, -0.0011775343446061015, 0.027705874294042587, -0.03032471053302288, 0.020754799246788025, 0.013903560116887093, -0.015092618763446808, 0.018533801659941673, 0.025992533192038536, 0.008961153216660023, -0.055845022201538086, 0.013221658766269684, -0.007061533164232969, 0.012749874033033848, 0.02103602886199951, 0.062312640249729156, 0.010568472556769848, 0.014741058461368084, 0.010468048974871635, -0.02194841392338276, -0.062326427549123764, 0.0662052109837532, -0.05060158297419548, 0.038120582699775696, 0.01040029339492321, -0.038034021854400635, 0.01620575413107872, 0.018619602546095848, 0.04922310635447502, -0.05433032289147377, -0.04238760843873024, -0.04081789776682854, 0.03438538312911987, 0.008873137645423412, 0.020241938531398773, -0.023908691480755806, 0.03960129991173744, 0.010646244511008263, 0.018818968906998634, -0.07835623621940613, 0.07591210305690765, 0.010911128483712673, -0.020922789350152016, 0.011586467735469341, 0.01722017489373684, -0.06070755049586296, -0.012457631528377533, 0.018064308911561966, 0.045065850019454956, 0.026826029643416405, -0.03052367828786373, 0.014699515886604786, -0.03484361246228218, 0.0006532628904096782, 0.028458932414650917, 0.027446947991847992, -0.041555993258953094, 0.036576151847839355, 0.03854290768504143, 0.02155155874788761, 0.06367835402488708, -0.0408991202712059, 0.0005271094269119203, -0.023629963397979736, 0.03545078635215759, 0.04311493784189224, -0.009368696250021458, 0.015601254999637604, 0.0007491306751035154, 0.011116139590740204, -0.001617172034457326, -0.02351171150803566, -0.03333669900894165, 0.024830598384141922, 0.032012637704610825, 0.012474831193685532, 0.018753254786133766, -0.06171446293592453, 0.026094751432538033, 0.05554317682981491, 0.037813376635313034, -0.005930055398494005, 0.00352873164229095, -0.019905034452676773, -0.004016137681901455, -0.0016663111746311188, 0.03343253955245018, -0.0026049886364489794, 0.0377817265689373, 0.022213401272892952, 0.021432479843497276, 0.00095654051983729, 0.018804237246513367, -0.009641949087381363, 0.02008187584578991, 0.003476280253380537, -0.055647432804107666, -0.045973848551511765, -0.025997282937169075, -0.06616181880235672, -0.013066079467535019, -0.022423477843403816, -0.050940386950969696, 0.015656886622309685, 0.007408956531435251, -0.048131074756383896, -0.026741769164800644, 0.03386630117893219, 0.03981984406709671, 0.01457037404179573, -0.01624537631869316, -0.017088497057557106, -0.014848954044282436, 0.004848654847592115, -0.006013961974531412, 0.03400721028447151, 0.0016484033549204469, -0.05262988060712814, 0.020773904398083687, 0.029322132468223572, -0.038262221962213516, 0.04972528666257858, -0.049167927354574203, -0.019610336050391197, 0.0006762701086699963, 0.0030173952691257, 0.027907242998480797, -0.01654268056154251, 0.0036794464103877544, 0.02654256485402584, -0.03134389966726303, 0.0061184861697256565, -0.018098922446370125, -0.06241704151034355, -0.0033070845529437065, 0.00492309033870697, 0.029938101768493652, 0.00009212135773850605, 0.019568422809243202, 0.03969046473503113, 0.009969701990485191, -0.02151346579194069, -0.04710705205798149, 0.00883585773408413, -0.02732069231569767, -0.0020650920923799276, 0.0164339616894722, -0.00013480865163728595, 0.0035279528237879276, 0.011520189233124256, -0.041308775544166565, -0.00868061650544405, -0.025526702404022217, -0.013446074910461903, 0.012930954806506634, -0.00282833119854331, -0.02821969985961914, 0.0035701682791113853, 0.020027684047818184, 0.00988916214555502, 0.018391065299510956, 0.0442427359521389, -0.004792077001184225, 0.021749744191765785, -0.017241492867469788, 0.025298360735177994, -0.024845721200108528, -0.010128203779459, -0.01122911088168621, -0.028576016426086426, 0.012156578712165356, 0.035205915570259094, -0.06013370677828789, -0.011460471898317337, -0.015573855489492416, -0.048837438225746155, -0.06276758760213852, 0.030631177127361298, -0.012927821837365627, -0.015391649678349495, 0.04517752304673195, 0.04876520112156868, -0.017741013318300247, 0.03768008202314377, -0.10022760927677155, -0.014826318249106407, -0.002992521272972226, 0.04970763251185417, 0.03819103538990021, 0.01961357519030571, -0.049677774310112, -0.034696243703365326, -0.03256848827004433, -0.00030586798675358295, -0.022206051275134087, -0.011020098812878132, -0.006952726747840643, -0.054764438420534134, -0.02796831913292408, 0.009838749654591084, 0.04660797119140625, 0.015513665974140167, 0.03246914967894554, 0.03468514606356621, -0.05217974632978439, 0.05159933492541313, -0.02039146237075329, -0.04691070318222046, 0.005426503252238035, 0.024082716554403305, 0.019312290474772453, -0.00044913560850545764, -0.009102840907871723, 0.01336967945098877, -0.013282262720167637, 0.015684546902775764, -0.006952696479856968, 0.02387118712067604, -0.03819841146469116, -0.03160172700881958, -0.003875753376632929, 0.05908941850066185, 0.011580628342926502, -0.015093020163476467, -0.013968304730951786, -0.005565997678786516, -0.0016208552988246083, -0.0250809658318758, -0.0032548110466450453, 0.009456897154450417, -0.00373279582709074, 0.006319276988506317, 0.0019425202626734972, 0.029410073533654213, 0.0410272441804409, -0.017315570265054703, -0.03231437876820564, -0.0006971979746595025 ]
Exploring simple optimizations for SDXL
sayakpaul
October 24, 2023
simple_sdxl_optimizations
diffusers, guide, sdxl
https://huggingface.co/blog/simple_sdxl_optimizations
Conclusion To conclude and summarize the savings from our optimizations: โš ๏ธ While profiling GPUs to measure the trade-off between inference latency and memory requirements, it is important to be aware of the hardware being used. The above findings may not translate equally from hardware to hardware. For example, torch.compile only seems to benefit modern GPUs, at least for SDXL. | Technique | Memory (GB) | Inference latency (ms) | | --- | --- | --- | | unoptimized pipeline | 28.09 | 72200.5 | | fp16 | 21.72 | 14800.9 | | fp16 + SDPA (default) | 21.72 | 11413.0 | | default + torch.compile | 21.73 | 10296.7 | | default + model CPU offload | 20.21 | 16082.2 | | default + sequential CPU offload | 19.91 | 67034.0 | | default + VAE slicing | 15.40 | 11232.2 | | default + VAE slicing + sequential CPU offload | 11.47 | 66869.2 | | default + precomputed text embeddings | 21.85 | 11909.0 | | default + Tiny Autoencoder | 15.48 | 10449.7 | We hope these optimizations make it a breeze to run your favorite pipelines. Try these techniques out and share your images with us! ๐Ÿค— --- Acknowledgements: Thank you to Pedro Cuenca for his helpful reviews on the draft.
[ 0.05024155229330063, 0.031630948185920715, -0.0008665368659421802, 0.0884585976600647, 0.009504824876785278, -0.026525670662522316, 0.057825151830911636, 0.04010077938437462, -0.009816141799092293, -0.07244735211133957, 0.0047729662619531155, 0.0501837283372879, -0.013434121385216713, -0.004620263818651438, 0.012530677020549774, -0.050866611301898956, 0.04019968956708908, -0.010738584212958813, 0.0028656378854066133, 0.06405656039714813, 0.036818042397499084, -0.02763143740594387, 0.05387594550848007, 0.02768871746957302, -0.07652417570352554, -0.05627816915512085, -0.01867896318435669, -0.039316996932029724, -0.09559458494186401, 0.0021955317351967096, -0.08506938070058823, -0.012038921006023884, 0.004946859087795019, -0.058562349528074265, 0.028900038450956345, -0.07893630862236023, -0.08680060505867004, 0.05959579721093178, 0.04378586262464523, 0.0017911104951053858, 0.006407956592738628, -0.032468896359205246, -0.04403737932443619, 0.05006010830402374, 0.008249896578490734, 0.034030746668577194, -0.08903294801712036, 0.08167865872383118, -0.08460746705532074, 0.02127382904291153, -0.01371507253497839, 0.04360790550708771, -0.026116900146007538, 0.024082031100988388, 0.007396789733320475, 0.05704345926642418, 0.009976884350180626, -0.0027905097231268883, 0.05539292097091675, 0.01734013296663761, 0.005329331383109093, 0.004560069181025028, 0.026734784245491028, 0.009147885255515575, 0.04814355447888374, -0.04314565286040306, 0.01338137686252594, -0.002569092670455575, -0.07798996567726135, -0.010185371153056622, 0.007068567909300327, -0.024135252460837364, 0.005381835158914328, 0.012661616317927837, -0.0276055708527565, -0.012398523278534412, -0.0012084546033293009, -0.029999632388353348, 0.0340527705848217, 0.03080352395772934, -0.01618354767560959, 0.022767603397369385, 0.052859120070934296, 0.052035607397556305, 0.0006017058622092009, 0.03160608559846878, 0.07204661518335342, -0.05634245276451111, -0.007928618229925632, -0.01645226962864399, -0.011237259022891521, -0.05617794394493103, 0.05982120335102081, 0.03221966698765755, 0.006567305885255337, -0.0008523850119672716, 0.012175296433269978, 0.03565945476293564, 0.006920224521309137, -0.037565190345048904, 0.03355976566672325, -0.04462280124425888, 0.002251984551548958, -0.07040424644947052, -0.0195048525929451, 0.04595039412379265, -0.061685383319854736, -0.04804932698607445, -0.03332509100437164, 0.07846081256866455, -0.03599319979548454, 0.07304558157920837, 0.017107004299759865, 0.04660765826702118, -0.07688842713832855, -0.0035692378878593445, -0.027799727395176888, 0.05321671813726425, -0.025437742471694946, 0.024814855307340622, -0.021974297240376472, 0.0775771364569664, 0.09351950883865356, -0.007332141045480967, -0.05324173346161842, 0.05092458426952362, 0.06588538736104965, 0.10773152112960815, 0.014708169735968113, -0.014336641877889633, 0.017770644277334213, -0.059262461960315704, 0.024909622967243195, -0.03289882466197014, -0.01421631220728159, -0.05569108575582504, -0.05728313326835632, -0.08580850064754486, -0.0587533600628376, -0.02337382547557354, -0.10181029886007309, -0.010795257985591888, 0.0507342703640461, 0.010072145611047745, 0.05969448760151863, -0.043429017066955566, -0.02758076786994934, 0.0464736633002758, -0.015094641596078873, 0.04197597876191139, -0.08730242401361465, 0.04497867450118065, -0.0722455084323883, -0.023055415600538254, -0.003893183311447501, 0.07455595582723618, 0.0009561358019709587, -0.013921924866735935, -0.06519009917974472, -0.04120388627052307, -0.037406887859106064, -0.07587698847055435, 0.012806715443730354, -0.014482091180980206, -0.008015856146812439, 0.040995027869939804, 0.051825881004333496, -0.021076377481222153, 0.0025638549122959375, 0.025855442509055138, 0.010643583722412586, -0.017633210867643356, 0.09874208271503448, -0.05812716484069824, -0.0024907346814870834, 0.05343432351946831, 0.054429586976766586, 0.05535610392689705, -0.017236683517694473, -0.02777613140642643, -0.03924406319856644, -0.0005996139370836318, 0.003132421290501952, 0.08162609487771988, 0.0015264200046658516, -0.13769924640655518, 0.05946215242147446, -0.09259577095508575, -0.0934005081653595, -0.013068696483969688, -0.06264768540859222, -0.040325406938791275, 0.02704540826380253, -0.07520478218793869, 0.006429196335375309, -0.02355150692164898, -0.03315173462033272, 0.09328901022672653, 0.061557844281196594, 0.030058851465582848, 0.019124692305922508, 0.03785836324095726, 0.0036140268202871084, 0.03793485462665558, -0.04732733964920044, -0.05462998151779175, 0.002697182120755315, -0.025347040966153145, -0.017824841663241386, 0.034331221133470535, 0.02251545898616314, -0.1315864771604538, -0.00679108127951622, -0.02534404955804348, -0.02486357092857361, -0.024072764441370964, 0.00979615468531847, 0.023089870810508728, 0.08391240984201431, -0.08331812918186188, 0.10176315903663635, -0.05443400517106056, -0.014417069964110851, -0.006407488603144884, -0.07631795108318329, 0.013072124682366848, 0.048066843301057816, -0.01590591110289097, 0.022662851959466934, -0.055726636201143265, -0.045066677033901215, -0.08222728222608566, -0.058077845722436905, 0.07299373298883438, 0.006070179399102926, -0.03221084550023079, -0.062254033982753754, 0.04280933365225792, 0.02912496030330658, -0.018228594213724136, 0.017677465453743935, 0.042282141745090485, 0.0696868821978569, 0.008760960772633553, 0.020763324573636055, -0.03174220025539398, 0.02359185367822647, -0.03944149985909462, -0.039086997509002686, -0.008549037389457226, -0.014168232679367065, -0.010808438062667847, -0.055254071950912476, -0.044127386063337326, 0.04645124077796936, 0.0370623953640461, -0.015085543505847454, -0.031005533412098885, -0.033057864755392075, 0.040365975350141525, -0.00566038629040122, -0.04017600044608116, 0.006910749711096287, -0.03081294149160385, 0.033012185245752335, -0.04089939966797829, 0.04162135720252991, -0.0046892003156244755, 0.01100624818354845, 0.015132731758058071, 0.008268537931144238, 0.02088148146867752, 0.013502770103514194, 0.0023357488680630922, 0.038868941366672516, 0.043187789618968964, 0.0707908347249031, -0.014062193222343922, -0.01638510450720787, -0.0373937264084816, -0.017549708485603333, -0.05350020155310631, 0.030463973060250282, 0.013172991573810577, -0.035416144877672195, -0.00851435586810112, -0.003661945927888155, -0.012017159722745419, -0.03479372337460518, 0.030058633536100388, 0.01514553464949131, 0.015169184654951096, 0.023330021649599075, -0.031068919226527214, 0.018336689099669456, 0.0031212596222758293, -0.0074768406338989735, -0.04705668240785599, -0.028256263583898544, -0.010437632910907269, -0.07358753681182861, -0.010476396419107914, -0.026545632630586624, -0.005520895589143038, 0.0015515675768256187, 0.0281290952116251, 0.011865686625242233, 0.03117290884256363, -0.09433557838201523, 0.025505762547254562, 0.014700877480208874, 0.010706846602261066, -0.002492704661563039, -0.03719529137015343, 0.013612848706543446, -0.002717561088502407, -0.01324567012488842, 0.00969601795077324, 0.004242056980729103, -0.010328061878681183, -0.004941331688314676, 0.014767030254006386, 0.04168469458818436, 0.022688385099172592, 0.04756499454379082, 0.017560582607984543, -0.0066945962607860565, -0.03130292892456055, 0.025751952081918716, 0.019008642062544823, -0.028670085594058037, 0.00830892100930214, -0.007614600472152233, 0.032596442848443985, 0.03399338200688362, -0.02024821564555168, 0.031530287116765976, 0.003385501680895686, -0.0008612880483269691, -0.0075357831083238125, -0.016949573531746864, 0.01665499620139599, -0.025028090924024582, 0.01425117813050747, -0.008122413419187069, 0.014382372610270977, 0.0018783879932016134, 0.030773067846894264, 0.057763490825891495, -0.01115830522030592, 0.03781240060925484, 0.007824432104825974, 0.04624836519360542, -0.0064602140337228775, 0.07797297835350037, -0.030913934111595154, 0.04248160868883133, -0.034225549548864365, -0.018407482653856277, 0.015414578840136528, 0.01874639466404915, 0.03546610474586487, -0.005522856023162603, -0.0067482297308743, -0.017283519729971886, 0.00034379190765321255, 0.06208816170692444, -0.035308778285980225, -0.07588590681552887, 0.012703674845397472, 0.05754195526242256, 0.03937616944313049, -0.007901569828391075, 0.02281513623893261, 0.01907367631793022, -0.018459679558873177, -0.04539791867136955, 0.0040907543152570724, -0.030931368470191956, 0.09615360200405121, -0.002564359689131379, -0.0010377668077126145, -0.029263116419315338, 0.021298212930560112, -0.00686049647629261, -0.04679623618721962, 0.06146979331970215, 0.05670446902513504, -0.017489487305283546, -0.059873905032873154, -0.034836944192647934, -0.012440627440810204, -0.015687355771660805, 0.017099756747484207, -0.020603595301508904, 0.015328893437981606, -0.014563614502549171, 0.02426198311150074, 0.012403556145727634, -0.013282896019518375, 0.04606680944561958, 0.006513840984553099, 0.0024140921887010336, 0.00425646360963583, 0.045560941100120544, 0.02211068756878376, 0.02395288646221161, 0.021768540143966675, 0.017896901816129684, -0.017750266939401627, 0.018665427342057228, 0.014150835573673248, -0.03211770951747894, 0.030781418085098267, -0.020903782919049263, 0.010935519821941853, -0.003794878488406539, 0.02492406964302063, 0.043743085116147995, -0.014740356244146824, 0.03999985381960869, 0.0048642754554748535, 0.03962785750627518, 0.020357420668005943, 0.029111051931977272, 0.007917634211480618, -0.027918318286538124, 0.010095197707414627, -0.03839888796210289, 0.01204855926334858, -0.017563708126544952, -0.017985006794333458, 0.07036902755498886, 0.006517221685498953, -0.05268070846796036, 0.04685869440436363, -0.006362367421388626, -0.03426669165492058, -0.06516159325838089, 0.021496150642633438, 0.031698912382125854, 0.03542044758796692, 0.03647144138813019, -0.011573399417102337, -0.05972854793071747, -0.021046815440058708, -0.024321923032402992, -0.018326302990317345, -0.0023658580612391233, -0.009302598424255848, -0.004560320172458887, -0.06684853881597519, 0.012169867753982544, 0.018275687471032143, -0.026362773030996323, 0.04630190506577492, -0.04677615687251091, 0.0519777275621891, 0.04654618352651596, -0.04160916805267334, -0.00983469933271408, -0.005369633436203003, 0.0173087939620018, 0.004940510261803865, -0.010360526852309704, 0.009916911832988262, -0.010528544895350933, 0.0070089492946863174, -0.002420357894152403, 0.03913590684533119, -0.01788618043065071, 0.034401506185531616, 0.01793021149933338, -0.005939958617091179, -0.02224545180797577, -0.028069062158465385, -0.007147026713937521, -0.009362652897834778, 0.001600349904038012, 0.03725220263004303, 0.00443650409579277, 0.00875767134130001, 0.06754349172115326, -0.010967477224767208, 0.009931966662406921, 0.019227202981710434, 0.010753177106380463, -0.01499021053314209, 0.02016676776111126, -0.05391497164964676, 0.030280496925115585, -0.0005185971385799348, 0.02432444505393505, 0.013578981161117554, 0.04020411893725395, 0.06669192016124725, -0.01375378668308258, 0.038331542164087296, 0.03280166909098625, 0.0022846758365631104, 0.007729532662779093, -0.061040885746479034, 0.03797853738069534, -0.04624035581946373, 0.052881497889757156, 0.010011778213083744, 0.05627637356519699, 0.014171166345477104, 0.03471928834915161, 0.00040033215191215277, -0.021799853071570396, -0.026635458692908287, -0.0012325787683948874, 0.03590890020132065, 0.023741906508803368, -0.025947807356715202, 0.010916189290583134, -0.023489953950047493, 0.011965814046561718, -0.0037595571484416723, -0.02604050002992153, 0.03734011575579643, 0.03535037487745285, -0.023381948471069336, -0.03828150033950806, 0.02907135896384716, 0.04708302021026611, 0.03954416513442993, -0.005189347546547651, -0.017351510003209114, -0.029823068529367447, 0.018240367993712425, 0.04900278151035309, -0.039082854986190796, 0.01795143634080887, -0.0132755720987916, -0.04609282687306404, 0.01337483525276184, -0.023835303261876106, 0.02256745845079422, -0.02502046711742878, 0.04212087765336037, 0.037205975502729416, 0.009720009751617908, 0.009519790299236774, 0.008283398114144802, 0.019000710919499397, -0.025228096172213554, -0.027887750416994095, -0.018795568495988846, -0.05347704142332077, 0.02075694501399994, -0.021487098187208176, 0.05062935873866081, 0.05882139131426811, -0.0332905612885952, -0.04671504348516464, 0.0189035777002573, 0.0057534109801054, -0.005603359546512365, 0.00941587146371603, 0.004346312955021858, 0.03710702806711197, -0.0011066051665693521, -0.0010205061407759786, 0.0013916599564254284, 0.01577010191977024, 0.03702164441347122, 0.019316544756293297, -0.0608665756881237, 0.03294949606060982, 0.013044779188930988, -0.06075044721364975, 0.02950276806950569, 0.012786425650119781, -0.046149540692567825, 0.038309890776872635, 0.023971369490027428, -0.014438576065003872, -0.01820564456284046, -0.0003815032832790166, 0.020564045757055283, -0.026377102360129356, -0.01882048323750496, -0.021219659596681595, 0.049919769167900085, -0.023388270288705826, 0.0006424861494451761, 0.02212965302169323, 0.04473594203591347, 0.0373176708817482, 0.01688353717327118, -0.03432890400290489, 0.018856650218367577, 0.06805477291345596, -0.02651170641183853, 0.009586155414581299, 0.014921112917363644, -0.01704384572803974, -0.0031580983195453882, 0.03298703208565712, -0.03687656298279762, -0.04092232882976532, -0.010827221907675266, 0.02146059088408947, -0.0004285352770239115, -0.014533516950905323, -0.0394388884305954, 0.04934879392385483, -0.0025506699457764626, -0.017867183312773705, -0.00700285704806447, 0.003688739612698555, -0.03762051463127136, 0.02213604561984539, -0.009554370306432247, 0.00963892787694931, 0.009004687890410423, -0.00958644412457943, 0.0006431789370253682, 0.026642009615898132, 0.019437940791249275, 0.03511287271976471, 0.018752941861748695, -0.001872831373475492, -0.0010740580037236214, 0.010533108375966549, 0.017887581139802933, -0.00825472641736269, -0.016771411523222923, -0.0024819611571729183, -0.02673049084842205, -0.06259644776582718, 0.00716143986210227, -0.02419147826731205, -0.018151823431253433, -0.0012515702983364463, 0.029803592711687088, -0.0025654970668256283, 0.016411857679486275, 0.00805756263434887, -0.02069259062409401, 0.002917373552918434, -0.009168539196252823, -0.01698724739253521, 0.022381853312253952, -0.005558499600738287, 0.04171615466475487, 0.028874065726995468, 0.04653290659189224, -0.01490840595215559, 0.029312534257769585, -0.052734196186065674, -0.009333089925348759, 0.01705602928996086, -0.04206611216068268, -0.010076710022985935, -0.004409806802868843, -0.015100314281880856, -0.014329246245324612, -0.009041995741426945, 0.04362187534570694, -0.02802993543446064, -0.06261169910430908, 0.058617498725652695, 0.02418927103281021, 0.01585673913359642, -0.0031129855196923018, 0.0381389781832695, 0.03498333692550659, 0.004894094541668892, -0.02076958306133747, -0.016490308567881584, -0.030410705134272575, -0.03143705427646637, -0.009095054119825363, 0.005258202087134123, -0.021985765546560287, -0.03301982581615448, 0.012318559922277927, -0.021189898252487183, -0.00795026309788227, -0.015831297263503075, -0.011745068244636059, 0.02639336697757244, -0.018001552671194077, -0.011904356069862843, -0.03815772756934166, 0.06290528923273087, -0.0336272269487381, 0.023079872131347656, 0.04330816492438316, -0.030198900029063225, 0.00878833793103695, -0.006815989036113024, 0.003630793420597911, -0.017524966970086098, 0.019917499274015427, -0.02779415063560009, -0.01294773630797863, -0.01810433901846409, 0.0397857129573822, -0.027324428781867027, 0.0037009860388934612, -0.0339050330221653, -0.04626373574137688, -0.011535301804542542, -0.01820206269621849, 0.017663070932030678, -0.04006475210189819, 0.035309236496686935, 0.017842480912804604, -0.02749793231487274, 0.03373139351606369, -0.03612330183386803, 0.022917913272976875, -0.004704596940428019, 0.06608567386865616, 0.03914584591984749, 0.024096369743347168, -0.03343117982149124, -0.07722535729408264, 0.016219856217503548, 0.011564739048480988, 0.006563169416040182, 0.0030952829401940107, 0.04490645229816437, -0.007268828805536032, 0.017392851412296295, 0.038197726011276245, 0.04254883900284767, 0.01824524626135826, 0.037631724029779434, 0.024829182773828506, -0.016705919057130814, 0.04155292734503746, -0.004613829310983419, -0.05016143620014191, -0.024783028289675713, 0.049841489642858505, 0.01520240493118763, 0.011187956668436527, 0.0173729807138443, 0.033377863466739655, -0.0027867727912962437, 0.017014112323522568, -0.01982305385172367, -0.01724797487258911, -0.02393946424126625, -0.017065275460481644, -0.02484624832868576, 0.013834121637046337, -0.01594611257314682, -0.03390934690833092, -0.008629771880805492, -0.019008813425898552, 0.017356788739562035, 0.021944459527730942, -0.027005277574062347, -0.013343343511223793, 0.039953503757715225, 0.0016251043416559696, 0.026764798909425735, 0.03861347213387489, 0.052557263523340225, 0.022080913186073303, 0.00793361198157072, -0.02837999537587166 ]
The N Implementation Details of RLHF with PPO
vwxyzjn
October 24, 2023
the_n_implementation_details_of_rlhf_with_ppo
research, rl, rlhf
https://huggingface.co/blog/the_n_implementation_details_of_rlhf_with_ppo
# The N Implementation Details of RLHF with PPO RLHF / ChatGPT has been a popular research topic these days. In our quest to research more on RLHF, this blog post attempts to do a reproduction of OpenAIโ€™s 2019 original RLHF codebase at openai/lm-human-preferences. Despite its โ€œtensorflow-1.x-ness,โ€ OpenAIโ€™s original codebase is very well-evaluated and benchmarked, making it a good place to study RLHF implementation engineering details. We aim to: 1. reproduce OAIโ€™s results in stylistic tasks and match the learning curves of openai/lm-human-preferences. 2. present a checklist of implementation details, similar to the spirit of The 37 Implementation Details of Proximal Policy Optimization; Debugging RL, Without the Agonizing Pain. 3. provide a simple-to-read and minimal reference implementation of RLHF; This work is just for educational / learning purposes. For advanced users requiring more features, such as running larger models with PEFT, huggingface/trl would be a great choice. - In Matching Learning Curves, we show our main contribution: creating a codebase that can reproduce OAIโ€™s results in the stylistic tasks and matching learning curves very closely with openai/lm-human-preferences. - We then take a technical deep dive into the implementation details that are relevant to reproducing OAIโ€™s work. In General Implementation Details, we talk about basic details, such as how rewards/values are generated and how responses are generated. In Reward Model Implementation Details, we talk about details such as reward normalization. In Policy Training Implementation Details, we discuss details such as rejection sampling and reward โ€œwhiteningโ€. - In PyTorch Adam optimizer numerical issues w.r.t RLHF, we highlight a very interesting implementation difference in Adam between TensorFlow and PyTorch, which causes an aggressive update in the model training. - Next, we examine the effect of training different base models (e.g., gpt2-xl, falcon-1b,) given that the reward labels are produced with gpt2-large. - Finally, we conclude our work with limitations and discussions. Here are the important links: - ๐Ÿ’พย Our reproduction codebase https://github.com/vwxyzjn/lm-human-preference-details - ๐Ÿค—ย Demo of RLHF model comparison: https://huggingface.co/spaces/lm-human-preference-details/rlhf-demo - ๐Ÿย All w&b training logs https://wandb.ai/openrlbenchmark/lm_human_preference_details # Matching Learning Curves Our main contribution is to reproduce OAIโ€™s results in stylistic tasks, such as sentiment and descriptiveness. As shown in the figure below, our codebase (orange curves) can produce nearly identical learning curves as OAIโ€™s codebase (blue curves).
[ 0.009366794489324093, -0.027384156361222267, -0.0521557591855526, 0.007939177565276623, -0.023411406204104424, 0.06839963048696518, 0.014418823644518852, 0.07222125679254532, 0.008138679899275303, -0.06493829190731049, -0.1085301861166954, 0.03042631782591343, 0.01591300033032894, -0.035297997295856476, -0.05669879540801048, 0.0424899198114872, 0.02737591415643692, -0.02639390528202057, 0.012577353045344353, 0.028281666338443756, 0.01543212030082941, 0.061869099736213684, 0.013661821372807026, 0.0048643359914422035, -0.010479635559022427, -0.05717338249087334, 0.015220897272229195, 0.011990929022431374, 0.016399167478084564, 0.03664415329694748, -0.0776267796754837, -0.07698750495910645, -0.031397514045238495, -0.04704698920249939, 0.02972681075334549, -0.04850289970636368, -0.0974782258272171, -0.04645195230841637, 0.10053283721208572, -0.04326774179935455, 0.06008264422416687, -0.05703457444906235, -0.10391400009393692, 0.06635329127311707, 0.02340446598827839, -0.022821402177214622, -0.06903743743896484, 0.06506418436765671, -0.016637317836284637, 0.025174226611852646, -0.10332661867141724, 0.06817538291215897, -0.06943473219871521, -0.024711623787879944, 0.005702807568013668, -0.003445805050432682, -0.03125577047467232, -0.049447089433670044, -0.003911116626113653, 0.010110790841281414, 0.013828287832438946, 0.031524475663900375, 0.0569876991212368, 0.024347398430109024, 0.0954088643193245, -0.047858826816082, -0.02065899223089218, 0.046097319573163986, 0.022403201088309288, -0.017866097390651703, -0.002322593005374074, -0.030590951442718506, -0.016465075314044952, 0.004161001183092594, -0.016922198235988617, -0.042388465255498886, -0.05384603142738342, 0.05311735346913338, 0.058946382254362106, 0.03557833656668663, -0.0282254908233881, 0.008351237513124943, -0.021552350372076035, 0.02234061248600483, 0.007972805760800838, 0.037464212626218796, 0.054255641996860504, -0.048326924443244934, -0.01480689737945795, 0.017903953790664673, -0.055268846452236176, -0.07574547827243805, -0.009837457910180092, -0.0011661810567602515, 0.08919177949428558, -0.06917008012533188, -0.015336735174059868, 0.00993933342397213, -0.032915569841861725, -0.05473422259092331, -0.03739174082875252, -0.09990644454956055, -0.004277706146240234, -0.051030486822128296, -0.032450463622808456, 0.0304411668330431, -0.03939153254032135, -0.03253748640418053, -0.04149019718170166, 0.010148260742425919, -0.007587139960378408, -0.012135326862335205, -0.06743691861629486, 0.05740909278392792, -0.10726846754550934, 0.02217244915664196, -0.03265523165464401, -0.04310685023665428, -0.018441542983055115, 0.03877582028508186, -0.03123363107442856, 0.06107744574546814, 0.0059016975574195385, -0.022142630070447922, 0.044523756951093674, 0.1304890215396881, -0.05320967361330986, 0.0725894346833229, -0.02197955921292305, -0.0633373111486435, 0.0637921690940857, 0.01147550716996193, -0.01986793428659439, -0.0026477123610675335, 0.02518537826836109, -0.03219788521528244, -0.008823373354971409, -0.021748539060354233, 0.024164775386452675, -0.03949115797877312, -0.03678211197257042, 0.0464618057012558, 0.04817676544189453, -0.029430117458105087, -0.0056424690410494804, -0.005656048189848661, -0.012761768884956837, -0.0036040716804564, 0.012025394476950169, -0.07919678837060928, -0.09698417782783508, 0.05330950394272804, 0.020546112209558487, -0.08673514425754547, 0.056671492755413055, 0.013271410949528217, -0.04329146444797516, -0.06758515536785126, -0.03141465783119202, -0.011198407970368862, 0.00759911397472024, 0.017114881426095963, -0.059517402201890945, 0.030251631513237953, 0.06203874573111534, 0.06046712398529053, 0.036481402814388275, 0.011154625564813614, -0.02218032069504261, 0.06578462570905685, 0.015003511682152748, -0.016436316072940826, 0.09051426500082016, 0.017147356644272804, 0.0020504333078861237, 0.049445658922195435, 0.03772355243563652, 0.005901982542127371, -0.004406793974339962, -0.010511054657399654, -0.05396992340683937, 0.02100933901965618, -0.004989595618098974, 0.004864893853664398, 0.017596052959561348, -0.13875699043273926, 0.010098489001393318, -0.017142917960882187, 0.05798364803195, 0.044093016535043716, -0.023449983447790146, 0.05113455653190613, 0.07443564385175705, -0.01167310494929552, 0.011657671071588993, -0.06442058086395264, -0.02322939783334732, 0.10206692665815353, 0.05131073296070099, 0.06935305893421173, 0.03766678273677826, -0.021076250821352005, 0.061940453946590424, -0.04836747795343399, -0.026356307789683342, -0.03860427439212799, 0.013112845830619335, -0.07750062644481659, -0.012942319735884666, 0.014250582084059715, 0.05812469497323036, -0.05957252159714699, 0.03954096883535385, -0.032257553189992905, 0.08197931945323944, -0.015470700338482857, 0.030191224068403244, 0.02450265735387802, 0.008755018003284931, -0.03503430634737015, 0.12219008803367615, -0.05261584743857384, 0.02597196400165558, 0.03921528533101082, -0.010442530736327171, 0.03598380833864212, 0.04532628878951073, 0.034740570932626724, 0.041253287345170975, 0.0003581431519705802, -0.044003926217556, -0.10077747702598572, 0.036500051617622375, 0.037206344306468964, 0.00011352826550137252, 0.005407820455729961, 0.01932692341506481, 0.004841925110667944, 0.0019441943150013685, 0.004380224738270044, 0.03201182559132576, 0.0288569163531065, 0.002477896399796009, 0.04742184653878212, -0.027481677010655403, -0.0490834079682827, 0.02263576351106167, 0.06814112514257431, 0.00021800796093884856, -0.022389082238078117, -0.1035441979765892, 0.04246717318892479, -0.02758946642279625, 0.021010400727391243, -0.016331413760781288, 0.04750586673617363, 0.023408297449350357, 0.004140397999435663, -0.03509239852428436, 0.012738979421555996, -0.014177129603922367, 0.04255320131778717, -0.06622559577226639, 0.025392914190888405, 0.0227190088480711, -0.06240781024098396, 0.01781519688665867, 0.0183835681527853, -0.022741500288248062, 0.020486826077103615, -0.013604770414531231, 0.002271755365654826, -0.015186898410320282, -0.008028392679989338, -0.009670732542872429, -0.003869662992656231, -0.005962099879980087, -0.014472278766334057, -0.07941602170467377, -0.039513301104307175, 0.026874473318457603, 0.0011171743972226977, 0.04108200594782829, 0.04794730246067047, 0.015872914344072342, 0.008287361823022366, -0.018379053100943565, 0.014340739697217941, -0.051109835505485535, 0.057849444448947906, -0.01002785749733448, 0.029163550585508347, 0.01373797282576561, -0.02473318949341774, 0.01952897198498249, 0.002799761015921831, -0.02832522802054882, -0.015994757413864136, 0.00908645149320364, 0.02113916724920273, 0.012840118259191513, -0.021539796143770218, 0.03306028991937637, -0.012194737792015076, 0.020197145640850067, 0.05718040466308594, 0.06692609935998917, 0.03639691695570946, -0.08625804632902145, -0.008787116035819054, -0.006339729763567448, -0.005742762703448534, -0.022512463852763176, -0.0019399808952584863, 0.004104937426745892, 0.0019540630746632814, -0.03645411878824234, 0.02568570151925087, 0.009196583181619644, 0.02589809149503708, 0.054029181599617004, 0.03347909823060036, 0.0013455846346914768, 0.044323068112134933, -0.0071795242838561535, 0.013666295446455479, 0.02481112815439701, 0.01787145994603634, -0.055954381823539734, 0.008473198860883713, -0.035225845873355865, -0.009396523237228394, 0.007793571799993515, 0.003034257097169757, 0.048364438116550446, 0.0014485078863799572, 0.014059696346521378, -0.03137330338358879, -0.023531297221779823, -0.03525598719716072, -0.01753331907093525, 0.0012716861674562097, -0.020890124142169952, -0.021574854850769043, -0.00554438354447484, 0.008103342726826668, 0.014515440911054611, 0.06153814122080803, -0.05216452106833458, 0.019207287579774857, 0.008177461102604866, -0.034748587757349014, 0.017348844558000565, -0.00016537086048629135, 0.0020515895448625088, 0.038876838982105255, 0.006696089170873165, -0.044709231704473495, -0.013611314818263054, 0.03975434601306915, -0.02970097027719021, 0.03756837174296379, 0.0005903560086153448, 0.004671855363994837, -0.024249998852610588, 0.005694332532584667, 0.01932154968380928, -0.025943273678421974, -0.048898592591285706, 0.008584422059357166, -0.010922122746706009, -0.030691634863615036, -0.004391036462038755, 0.03015192411839962, 0.05329098552465439, -0.05192739516496658, -0.05130000412464142, 0.02370230108499527, -0.02166013792157173, 0.001708716037683189, 0.03655616566538811, 0.002499747322872281, -0.0037347509060055017, -0.04381563141942024, 0.0034063586499542, -0.02131556160748005, 0.02852252684533596, 0.02464751899242401, -0.06379596889019012, -0.032300520688295364, -0.047634612768888474, -0.0058252522721886635, 0.03534550219774246, -0.004055857192724943, 0.02657073549926281, -0.005820692982524633, 0.021653389558196068, 0.020331839099526405, 0.0070992023684084415, 0.0105962622910738, -0.018454939126968384, 0.030533121898770332, -0.021200070157647133, -0.014280476607382298, 0.00751747190952301, -0.010424891486763954, -0.040528468787670135, 0.010917047038674355, -0.008017435669898987, -0.02132103033363819, 0.036479540169239044, -0.01019155140966177, -0.007504231296479702, -0.021804656833410263, -0.04470871761441231, -0.013626479543745518, 0.008121545426547527, 0.021557655185461044, 0.0032867509871721268, -0.007488804403692484, 0.004154673311859369, -0.01866617612540722, 0.05146288126707077, 0.057972438633441925, -0.02478758431971073, -0.018047889694571495, -0.03810529783368111, 0.036914076656103134, 0.0061958469450473785, -0.040825869888067245, -0.006167032290250063, -0.014219230972230434, 0.03490913659334183, 0.022311566397547722, 0.0071990881115198135, -0.024710161611437798, 0.01074250042438507, 0.01102625485509634, -0.04248329624533653, -0.018752260133624077, 0.01392003521323204, -0.014596482738852501, -0.0027237609028816223, 0.024995774030685425, 0.0092534851282835, -0.005135651212185621, 0.008319098502397537, -0.0316280797123909, 0.011033949442207813, -0.003522645914927125, 0.04280489683151245, -0.02252795919775963, 0.0432184562087059, 0.04162682592868805, 0.019956184551119804, -0.018587181344628334, -0.019391680136322975, 0.06431664526462555, 0.07661254703998566, -0.010602927766740322, -0.0212080217897892, -0.015460087917745113, 0.10090187937021255, 0.024706296622753143, -0.021327823400497437, 0.05962749943137169, -0.01774514652788639, 0.03753562271595001, 0.003183200256898999, -0.004555670544505119, -0.04315297678112984, 0.021379739046096802, 0.04359005019068718, 0.012056166306138039, -0.01620350405573845, 0.00031054968712851405, -0.009207948110997677, -0.02334619127213955, -0.03772297874093056, 0.004696343094110489, 0.020105281844735146, -0.029548196122050285, 0.022243978455662727, 0.007640019059181213, 0.06567849963903427, 0.02921452932059765, -0.009932102635502815, 0.052297770977020264, -0.05244283750653267, 0.016307227313518524, 0.006583850365132093, -0.00396053958684206, 0.006602717097848654, 0.04333023354411125, 0.05880265310406685, 0.05932315066456795, 0.011625299230217934, 0.0176200270652771, 0.0024383091367781162, -0.005195118952542543, 0.012143787927925587, -0.007515255827456713, -0.019944744184613228, 0.032112881541252136, -0.010600246489048004, 0.009495791979134083, -0.01329775433987379, 0.005684578325599432, 0.03092866577208042, 0.03483075648546219, -0.004224562551826239, -0.006224227137863636, 0.043919455260038376, -0.003573544090613723, 0.04282484948635101, -0.009193293750286102, 0.01615324430167675, 0.012080094777047634, 0.016836585476994514, -0.03003002516925335, -0.026799071580171585, -0.04182938486337662, -0.006664359476417303, -0.04221261292695999, -0.06689446419477463, 0.03860390931367874, -0.027686191722750664, 0.0498235858976841, -0.04144887253642082, 0.011400466784834862, -0.036768052726984024, -0.01994210109114647, 0.016431042924523354, -0.08435987681150436, -0.03397630527615547, -0.02736116573214531, 0.018264394253492355, -0.008148501627147198, 0.06331029534339905, -0.01608394645154476, 0.02986074984073639, 0.003690199926495552, -0.02869628742337227, -0.03629840910434723, -0.011092407628893852, 0.024783505126833916, 0.011840440332889557, -0.055403102189302444, 0.0031347444746643305, -0.02063465677201748, -0.005730701610445976, -0.023921338841319084, -0.03998929634690285, 0.07108305394649506, 0.046277038753032684, -0.017007503658533096, 0.024901455268263817, -0.003393897321075201, 0.030255001038312912, 0.007043468300253153, -0.006481126416474581, -0.025891490280628204, -0.012512113898992538, 0.04428491368889809, 0.031039750203490257, -0.012619792483747005, 0.00008758430340094492, 0.015909893438220024, 0.0006305204005911946, -0.04634987190365791, 0.0003195767931174487, -0.003039623610675335, -0.0396672859787941, -0.005036847200244665, 0.03346527740359306, -0.039995525032281876, -0.0177155788987875, 0.023440707474946976, 0.019096722826361656, 0.040179066359996796, -0.010880340822041035, 0.020777013152837753, -0.011039866134524345, -0.027564045041799545, 0.012045240961015224, 0.04874306544661522, -0.041116565465927124, 0.011249798350036144, 0.012471524998545647, -0.0031147238332778215, 0.03628305345773697, -0.0033172147814184427, 0.019293561577796936, 0.05218261480331421, 0.05508788675069809, 0.00015530815289821476, 0.04206275939941406, 0.027536936104297638, -0.007090619299560785, 0.013237091712653637, -0.062227748334407806, -0.012789054773747921, -0.002721426310017705, 0.013219762593507767, 0.013785185292363167, 0.0019766902551054955, 0.06229621544480324, -0.03123265504837036, 0.031398624181747437, 0.04262955114245415, 0.0470702089369297, 0.012352696619927883, -0.0049610924907028675, -0.002167840488255024, -0.009904399514198303, 0.013665690086781979, 0.023413384333252907, -0.002043366665020585, 0.052189454436302185, 0.053116414695978165, 0.01652909815311432, 0.019504636526107788, 0.006508697289973497, 0.06999388337135315, 0.001793043571524322, 0.006434856913983822, -0.005016312934458256, 0.000297059363219887, -0.02960897982120514, 0.03579505905508995, 0.007639894727617502, -0.0210056584328413, -0.011765509843826294, 0.007174577098339796, -0.05446904897689819, -0.004270101897418499, 0.053273506462574005, -0.019404388964176178, 0.02240893431007862, 0.03259335830807686, -0.0306855458766222, -0.05226457864046097, -0.004542551469057798, 0.02153707668185234, -0.0077895186841487885, -0.0001746224006637931, -0.026637688279151917, -0.01732700690627098, 0.003361910581588745, 0.03084447607398033, -0.026815999299287796, -0.0029577193781733513, 0.024703599512577057, -0.011076965369284153, 0.011483302339911461, 0.016275104135274887, 0.008625407703220844, 0.005460232961922884, -0.01748541183769703, 0.003560046199709177, -0.01713438704609871, 0.0075619034469127655, 0.0021304849069565535, -0.04699300602078438, 0.019188208505511284, 0.012572563253343105, -0.022893721237778664, -0.020208925008773804, 0.04364914819598198, -0.002076277043670416, 0.03539097309112549, -0.012004395946860313, -0.06951505690813065, -0.028299467638134956, 0.03498801961541176, -0.037099823355674744, -0.021385690197348595, 0.03406261280179024, 0.007065522950142622, 0.0006111704860813916, 0.008853727020323277, -0.010000372305512428, -0.028674151748418808, 0.006380452774465084, 0.01793752796947956, 0.0018791112815961242, -0.0306604765355587, 0.049775075167417526, 0.06880921870470047, 0.015386611223220825, 0.05859782546758652, 0.02902412787079811, -0.028327701613307, -0.017295552417635918, -0.052871134132146835, -0.014530588872730732, -0.025339771062135696, -0.012168684042990208, 0.025374650955200195, -0.032074909657239914, -0.030736800283193588, 0.04927074536681175, 0.027729641646146774, 0.014981868676841259, -0.04493577778339386, 0.022491322830319405, -0.0029407250694930553, 0.0023638035636395216, 0.016299836337566376, -0.01596726104617119, 0.05851434916257858, -0.015063362196087837, 0.0023095090873539448, -0.011203250847756863, 0.017862003296613693, -0.032565467059612274, -0.020977644249796867, -0.030183909460902214, 0.049654267728328705, 0.04484512284398079, -0.008342902176082134, -0.018603086471557617, -0.03634263575077057, 0.0009221993968822062, -0.01283619087189436, 0.04140092059969902, 0.005253218114376068, -0.03951512649655342, -0.04052506014704704, -0.024347689002752304, 0.010872977785766125, -0.0025835977867245674, 0.01611325703561306, -0.0401935838162899, -0.008600055240094662, 0.03221999108791351, -0.012563185766339302, 0.0017497639637440443, -0.030263934284448624, -0.01621026173233986, 0.01573239453136921, -0.048816945403814316, -0.01389020960777998, 0.0317951999604702, 0.0012829550541937351, -0.015247099101543427, -0.0045102243311703205, 0.05161099135875702, -0.03626052662730217, -0.04085485264658928, 0.0019940820056945086, 0.017047666013240814, -0.04902618005871773, -0.038831084966659546, 0.0285155288875103, -0.004004592541605234, 0.016183936968445778, 0.00855419971048832, -0.017735302448272705, 0.03933577612042427, 0.023568950593471527, 0.003328914986923337, 0.044841740280389786, 0.06045505031943321, 0.008766930550336838, -0.04375024512410164, -0.03494485095143318, -0.0013357870047912002 ]
The N Implementation Details of RLHF with PPO
vwxyzjn
October 24, 2023
the_n_implementation_details_of_rlhf_with_ppo
research, rl, rlhf
https://huggingface.co/blog/the_n_implementation_details_of_rlhf_with_ppo
A note on running openai/lm-human-preferences To make a direct comparison, we ran the original RLHF code at openai/lm-human-preferences, which will offer valuable metrics to help validate and diagnose our reproduction. We were able to set the original TensorFlow 1.x code up, but it requires a hyper-specific setup: - OAIโ€™s dataset was partially corrupted/lost (so we replaced them with similar HF datasets, which may or may not cause a performance difference) - Specifically, its book dataset was lost during OpenAIโ€™s GCP - Azure migration (https://github.com/openai/lm-human-preferences/issues/17#issuecomment-1044051496). I replaced the book dataset with Hugging Faceโ€™s bookcorpus dataset, which is, in principle, what OAI used. - It canโ€™t run on 1 V100 because it doesnโ€™t implement gradient accumulation. Instead, it uses a large batch size and splits the batch across 8 GPUs, and will OOM on just 1 GPU. - It canโ€™t run on 8x A100 because it uses TensorFlow 1.x, which is incompatible with Cuda 8+ - It canโ€™t run on 8x V100 (16GB) because it will OOM - It can only run on 8x V100 (32GB), which is only offered by AWS as the p3dn.24xlarge instance. # General Implementation Details We now take a technical deep dive into the implementation details that are relevant to reproducing OAIโ€™s work. In this section, we talk about basic details, such as how rewards/values are generated and how responses are generated. Here are these details in no particular order: 1. The reward model and policyโ€™s value head take input as the concatenation of query and response 1. The reward model and policyโ€™s value head do not only look at the response. Instead, it concatenates the query and response together as query_response (lm_human_preferences/rewards.py#L105-L107). 2. So, for example, if query = "he was quiet for a minute, his eyes unreadable"., and the response = "He looked at his left hand, which held the arm that held his arm out in front of him.", then the reward model and policyโ€™s value do a forward pass on query_response = "he was quiet for a minute, his eyes unreadable. He looked at his left hand, which held the arm that held his arm out in front of him." and produced rewards and values of shape (B, T, 1), where B is the batch size, T is the sequence length, and 1 is the reward head dimension of 1 (lm_human_preferences/rewards.py#L105-L107, lm_human_preferences/policy.py#L111). 3. The T means that each token has a reward associated with it and its previous context. For example, the eyes token would have a reward corresponding to he was quiet for a minute, his eyes. 2. Pad with a special padding token and truncate inputs. 1. OAI sets a fixed input length for query query_length; it pads sequences that are too short with pad_token (lm_human_preferences/language/datasets.py#L66-L67) and truncates sequences that are too long (lm_human_preferences/language/datasets.py#L57). See here for a general introduction to the concept). When padding the inputs, OAI uses a token beyond the vocabulary (lm_human_preferences/language/encodings.py#L56). 1. Note on HFโ€™s transformers โ€” padding token. According to (transformers#2630#issuecomment-578159876), padding tokens were not used during the pre-training of GPT and GPT-2; therefore transformerโ€™s gpt2 models have no official padding token associated with its tokenizer. A common practice is to set tokenizer.pad_token = tokenizer.eos_token, but in this work, we shall distinguish these two special tokens to match OAIโ€™s original setting, so we will use tokenizer.add_special_tokens({"pad_token": "[PAD]"}). Note that having no padding token is a default setting for decoder models, since they train with โ€œpackingโ€ during pretraining, which means that many sequences are concatenated and separated by the EOS token and chunks of this sequence that always have the max length are fed to the model during pretraining. 2. When putting everything together, here is an example python import transformers tokenizer = transformers.AutoTokenizer.from_pretrained("gpt2", padding_side="right") tokenizer.add_special_tokens({"pad_token": "[PAD]"}) query_length = 5 texts = [ "usually, he would", "she thought about it", ] tokens = [] for text in texts: tokens.append(tokenizer.encode(text)[:query_length]) print("tokens", tokens) inputs = tokenizer.pad( {"input_ids": tokens}, padding="max_length", max_length=query_length, return_tensors="pt", return_attention_mask=True, ) print("inputs", inputs) """prints are tokens [[23073, 11, 339, 561], [7091, 1807, 546, 340]] inputs {'input_ids': tensor([[23073, 11, 339, 561, 50257], [ 7091, 1807, 546, 340, 50257]]), 'attention_mask': tensor([[1, 1, 1, 1, 0], [1, 1, 1, 1, 0]])} """ 3. Adjust position indices correspondingly for padding tokens 1. When calculating the logits, OAIโ€™s code works by masking out padding tokens properly. This is achieved by finding out the token indices corresponding to the padding tokens (lm_human_preferences/language/model.py#L296-L297), followed by adjusting their position indices correspondingly (lm_human_preferences/language/model.py#L320). 2. For example, if the query=[23073, 50259, 50259] and response=[11, 339, 561], where (50259 is OAIโ€™s padding token), it then creates position indices as [[0 1 1 1 2 3]] and logits as follows. Note how the logits corresponding to the padding tokens remain the same as before! This is the effect we should be aiming for in our reproduction. python all_logits [[[ -35.28693 -34.2875 -38.16074 ... -41.595802 -41.082108 -35.36577 ] [ -35.28693 -34.2875 -38.16074 ... -41.595802 -41.082108 -35.36577 ] [ -35.28693 -34.2875 -38.16074 ... -41.595802 -41.082108 -35.36577 ] [-111.303955 -110.94471 -112.90624 ... -113.13064 -113.7788 -109.17345 ] [-111.51512 -109.61077 -114.90231 ... -118.43514 -111.56671 -112.12478 ] [-122.69775 -121.84468 -128.27417 ... -132.28055 -130.39604 -125.707756]]] (1, 6, 50257) 3. Note on HFโ€™s transformers โ€” position_ids and padding_side. We can replicate the exact logits using Hugging Faceโ€™s transformer with 1) left padding and 2) pass in the appropriate position_ids: python import torch import transformers tokenizer = transformers.AutoTokenizer.from_pretrained("gpt2", padding_side="right") tokenizer.add_special_tokens({"pad_token": "[PAD]"}) pad_id = tokenizer.pad_token_id query = torch.tensor([ [pad_id, pad_id, 23073], ]) response = torch.tensor([ [11, 339, 561], ]) temperature = 1.0 query = torch.tensor(query) response = torch.tensor(response).long() context_length = query.shape[1] query_response = torch.cat((query, response), 1) pretrained_model = transformers.AutoModelForCausalLM.from_pretrained("gpt2") def forward(policy, query_responses, tokenizer): attention_mask = query_responses != tokenizer.pad_token_id position_ids = attention_mask.cumsum(1) - attention_mask.long() # exclusive cumsum input_ids = query_responses.clone() input_ids[~attention_mask] = 0 return policy( input_ids=input_ids, attention_mask=attention_mask, position_ids=position_ids, return_dict=True, output_hidden_states=True, ) output = forward(pretrained_model, query_response, tokenizer) logits = output.logits logits /= temperature print(logits) """ tensor([[[ -26.9395, -26.4709, -30.0456, ..., -33.2208, -33.2884, -27.4360], [ -27.1677, -26.7330, -30.2386, ..., -33.6813, -33.6931, -27.5928], [ -35.2869, -34.2875, -38.1608, ..., -41.5958, -41.0821, -35.3658], [-111.3040, -110.9447, -112.9062, ..., -113.1306, -113.7788, -109.1734], [-111.5152, -109.6108, -114.9024, ..., -118.4352, -111.5668, -112.1248], [-122.6978, -121.8447, -128.2742, ..., -132.2805, -130.3961, -125.7078]]], grad_fn=<DivBackward0>) """ 4. Note on HFโ€™s transformers โ€” position_ids during generate: during generate we should not pass in position_ids because the position_ids are already adjusted in transformers (see huggingface/transformers#/7552. Usually, we almost never pass position_ids in transformers. All the masking and shifting logic are already implemented e.g. in the generate function (need permanent code link). 4. Response generation samples a fixed-length response without padding. 1. During response generation, OAI uses top_k=0, top_p=1.0 and just do categorical samples across the vocabulary (lm_human_preferences/language/sample.py#L43) and the code would keep sampling until a fixed-length response is generated (lm_human_preferences/policy.py#L103). Notably, even if it encounters EOS (end-of-sequence) tokens, it will keep sampling. 2. Note on HFโ€™s transformers โ€” sampling could stop at eos_token: in transformers, the generation could stop at eos_token (src/transformers/generation/utils.py#L2248-L2256), which is not the same as OAIโ€™s setting. To align the setting, we need to do set pretrained_model.generation_config.eos_token_id = None, pretrained_model.generation_config.pad_token_id = None. Note that transformers.GenerationConfig(eos_token_id=None, pad_token_id=None, ...) does not work because pretrained_model.generation_config would override and set a eos_token. python import torch import transformers tokenizer = transformers.AutoTokenizer.from_pretrained("gpt2", padding_side="right") tokenizer.add_special_tokens({"pad_token": "[PAD]"}) pad_id = tokenizer.pad_token_id query = torch.tensor([ [pad_id, pad_id, 23073], ]) response = torch.tensor([ [11, 339, 561], ]) response_length = 4 temperature = 0.7 pretrained_model = transformers.AutoModelForCausalLM.from_pretrained("gpt2") pretrained_model.generation_config.eos_token_id = None # disable `pad_token_id` and `eos_token_id` because we just want to pretrained_model.generation_config.pad_token_id = None # generate tokens without truncation / padding generation_config = transformers.GenerationConfig( max_new_tokens=response_length, min_new_tokens=response_length, temperature=temperature, top_k=0.0, top_p=1.0, do_sample=True, ) context_length = query.shape[1] attention_mask = query != tokenizer.pad_token_id input_ids = query.clone() input_ids[~attention_mask] = 0 # set padding tokens to 0 output = pretrained_model.generate( input_ids=input_ids, attention_mask=attention_mask, # position_ids=attention_mask.cumsum(1) - attention_mask.long(), # generation collapsed if this was turned on. generation_config=generation_config, return_dict_in_generate=True, ) print(output.sequences) """ tensor([[ 0, 0, 23073, 16851, 11, 475, 991]]) """ 3. Note that in a more recent codebase https://github.com/openai/summarize-from-feedback, OAI does stop sampling when encountering EOS token (summarize_from_feedback/utils/experiment_helpers.py#L19). However in this work we aim to do a 1:1 replication, so we align the setting that could keep sampling even eos_token is encountered 5. Learning rate annealing for reward model and policy training. 1. As Ziegler et al. (2019) suggested, the reward model is trained for a single epoch to avoid overfitting the limited amount of human annotation data (e.g., the descriptiveness task only had about 5000 labels). During this single epoch, the learning rate is annealed to zero (lm_human_preferences/train_reward.py#L249). 2. Similar to reward model training, the learning rate is annealed to zero (lm_human_preferences/train_policy.py#L172-L173). 6. Use different seeds for different processes 1. When spawning 8 GPU processes to do data parallelism, OAI sets a different random seed per process (lm_human_preferences/utils/core.py#L108-L111). Implementation-wise, this is done via local_seed = args.seed + process_rank * 100003. The seed is going to make the model produce different responses and get different scores, for example. 1. Note: I believe the dataset shuffling has a bug โ€” the dataset is shuffled using the same seed for some reason (lm_human_preferences/lm_tasks.py#L94-L97). # Reward Model Implementation Details In this section, we discuss reward-model-specific implementation details. We talk about details such as reward normalization and layer initialization. Here are these details in no particular order: 1. The reward model only outputs the value at the last token. 1. Notice that the rewards obtained after the forward pass on the concatenation of query and response will have the shape (B, T, 1), where B is the batch size, T is the sequence length (which is always the same; it is query_length + response_length = 64 + 24 = 88 in OAIโ€™s setting for stylistic tasks, see launch.py#L9-L11), and 1 is the reward head dimension of 1. For RLHF purposes, the original codebase extracts the reward of the last token (lm_human_preferences/rewards.py#L132), so that the rewards will only have shape (B, 1). 2. Note that in a more recent codebase openai/summarize-from-feedback, OAI stops sampling when encountering EOS token (summarize_from_feedback/utils/experiment_helpers.py#L19). When extracting rewards, it is going to identify the last_response_index, the index before the EOS token (#L11-L13), and extract the reward at that index (summarize_from_feedback/reward_model.py#L59). However in this work we just stick with the original setting. 2. Reward head layer initialization 1. The weight of the reward head is initialized according to \( \mathcal{N}\left(0,1 /\left(\sqrt{d_{\text {model }}+1}\right)\right) \) (lm_human_preferences/language/model.py#L368, lm_human_preferences/language/model.py#L251-L252). This aligns with the settings in Stiennon et al., 2020 (summarize_from_feedback/query_response_model.py#L106-L107) (P.S., Stiennon et al., 2020 had a typo on page 17 saying the distribution is \( \mathcal{N}\left(0,1 /\left(d_{\text {model }}+1\right)\right) \) without the square root) 2. The bias of the reward head is set to 0 (lm_human_preferences/language/model.py#L254). 3. Reward model normalization before and after 1. In the paper, Ziegler el al. (2019) mentioned that "to keep the scale of the reward model consistent across training, we normalize it so that it has mean 0 and variance 1 for \( x \sim \mathcal{D}, y \sim \rho(ยท|x) \).โ€ To perform the normalization process, the code first creates a reward_gain and reward_bias, such that the reward can be calculated by reward = reward * reward_gain + reward_bias (lm_human_preferences/rewards.py#L50-L51). 2. When performing the normalization process, the code first sets reward_gain=1, reward_bias=0 (lm_human_preferences/train_reward.py#L211), followed by collecting sampled queries from the target dataset (e.g., bookcorpus, tldr, cnndm), completed responses, and evaluated rewards. It then gets the empirical mean and std of the evaluated reward (lm_human_preferences/train_reward.py#L162-L167) and tries to compute what the reward_gain and reward_bias should be. 3. Let us use \( \mu_{\mathcal{D}} \) to denote the empirical mean, \( \sigma_{\mathcal{D}} \) the empirical std, \(g\) the reward_gain, \(b\) reward_bias, \( \mu_{\mathcal{T}} = 0\) target mean and \( \sigma_{\mathcal{T}}=1\) target std. Then we have the following formula. $$\begin{aligned}g\mathcal{N}(\mu_{\mathcal{D}}, \sigma_{\mathcal{D}}) + b &= \mathcal{N}(g\mu_{\mathcal{D}}, g\sigma_{\mathcal{D}}) + b\&= \mathcal{N}(g\mu_{\mathcal{D}} + b, g\sigma_{\mathcal{D}}) \&= \mathcal{N}(\mu_{\mathcal{T}}, \sigma_{\mathcal{T}}) \g &= \frac{\sigma_{\mathcal{T}}}{\sigma_{\mathcal{D}}} \b &= \mu_{\mathcal{T}} - g\mu_{\mathcal{D}}\end{aligned}$$ 4. The normalization process is then applied before and after reward model training (lm_human_preferences/train_reward.py#L232-L234, lm_human_preferences/train_reward.py#L252-L254). 5. Note that responses \( y \sim \rho(ยท|x) \) we generated for the normalization purpose are from the pre-trained language model \(\rho \). The model \(\rho \) is fixed as a reference and is not updated in reward learning (lm_human_preferences/train_reward.py#L286C1-L286C31). # Policy Training Implementation Details In this section, we will delve into details, such as layer initialization, data post-processing, and dropout settings. We will also explore techniques, such as of rejection sampling and reward "whitening", and adaptive KL. Here are these details in no particular order: 1. Scale the logits by sampling temperature. 1. When calculating the log probability of responses, the model first outputs the logits of the tokens in the responses, followed by dividing the logits with the sampling temperature (lm_human_preferences/policy.py#L121). I.e., logits /= self.temperature 2. In an informal test, we found that without this scaling, the KL would rise faster than expected, and performance would deteriorate. 2. Value head layer initialization 1. The weight of the value head is initialized according to \(\mathcal{N}\left(0,0\right)\) (lm_human_preferences/language/model.py#L368, lm_human_preferences/language/model.py#L251-L252). This is 2. The bias of the reward head is set to 0 (lm_human_preferences/language/model.py#L254). 3. Select query texts that start and end with a period 1. This is done as part of the data preprocessing; 1. Tries to select text only after start_text="." (lm_human_preferences/language/datasets.py#L51) 2. Tries select text just before end_text="." (lm_human_preferences/language/datasets.py#L61) 3. Then pad the text (lm_human_preferences/language/datasets.py#L66-L67) 2. When running openai/lm-human-preferences, OAIโ€™s datasets were partially corrupted/lost (openai/lm-human-preferences/issues/17#issuecomment-104405149), so we had to replace them with similar HF datasets, which may or may not cause a performance difference) 3. For the book dataset, we used https://huggingface.co/datasets/bookcorpus, which we find not necessary to extract sentences that start and end with periods because the dataset ) is already pre-processed this way (e.g., "usually , he would be tearing around the living room , playing with his toys .") To this end, we set start_text=None, end_text=None for the sentiment and descriptiveness tasks. 4. Disable dropout 1. Ziegler et al. (2019) suggested, โ€œWe do not use dropout for policy training.โ€ This is also done in the code (lm_human_preferences/policy.py#L48). 5. Rejection sampling 1. Ziegler et al. (2019) suggested, โ€œWe use rejection sampling to ensure there is a period between tokens 16 and 24 and then truncate at that period (This is a crude approximation for โ€˜end of sentence.โ€™ We chose it because it is easy to integrate into the RL loop, and even a crude approximation is sufficient for the intended purpose of making the human evaluation task somewhat easier). During the RL finetuning, we penalize continuations that donโ€™t have such a period by giving them a fixed reward of โˆ’1.โ€ 2. Specifically, this is achieved with the following steps: 1. Token truncation: We want to truncate at the first occurrence of truncate_token that appears at or after position truncate_after in the responses (lm_human_preferences/train_policy.py#L378) 1. Code comment: โ€œcentral example: replace all tokens after truncate_token with padding_tokenโ€ 2. Run reward model on truncated response: After the response has been truncated by the token truncation process, the code then runs the reward model on the truncated response. 3. Rejection sampling: if there is not a period between tokens 16 and 24, then replace the score of the response with a fixed low value (such as -1)(lm_human_preferences/train_policy.py#L384, lm_human_preferences/train_policy.py#L384-L402) 1. Code comment: โ€œcentral example: ensure that the sample contains truncate_token" 2. Code comment: โ€œonly query humans on responses that pass that functionโ€œ 4. To give some examples in descriptiveness: Samples extracted from our reproduction https://wandb.ai/openrlbenchmark/lm_human_preference_details/runs/djf8yymv/logs. Notice the 1st and 3rd example has too many tokens after the period, so its score was replaced by -1. 6. Discount factor = 1 1. The discount parameter \(\gamma\) is set to 1 (lm_human_preferences/train_policy.py#L56), which means that future rewards are given the same weight as immediate rewards. 7. Terminology of the training loop: batches and minibatches in PPO 1. OAI uses the following training loop (lm_human_preferences/train_policy.py#L184-L192). Note: we additionally added the micro_batch_size to help deal with the case in gradient accumulation. At each epoch, it shuffles the batch indices. python import numpy as np batch_size = 8 nminibatches = 2 gradient_accumulation_steps = 2 mini_batch_size = batch_size // nminibatches micro_batch_size = mini_batch_size // gradient_accumulation_steps data = np.arange(batch_size).astype(np.float32) print("data:", data) print("batch_size:", batch_size) print("mini_batch_size:", mini_batch_size) print("micro_batch_size:", micro_batch_size) for epoch in range(4): batch_inds = np.random.permutation(batch_size) print("epoch:", epoch, "batch_inds:", batch_inds) for mini_batch_start in range(0, batch_size, mini_batch_size): mini_batch_end = mini_batch_start + mini_batch_size mini_batch_inds = batch_inds[mini_batch_start:mini_batch_end] # `optimizer.zero_grad()` set optimizer to zero for gradient accumulation for micro_batch_start in range(0, mini_batch_size, micro_batch_size): micro_batch_end = micro_batch_start + micro_batch_size micro_batch_inds = mini_batch_inds[micro_batch_start:micro_batch_end] print("____โฉ a forward pass on", data[micro_batch_inds]) # `optimizer.step()` print("โช a backward pass on", data[mini_batch_inds]) # data: [0. 1. 2. 3. 4. 5. 6. 7.] # batch_size: 8 # mini_batch_size: 4 # micro_batch_size: 2 # epoch: 0 batch_inds: [6 4 0 7 3 5 1 2] # ____โฉ a forward pass on [6. 4.] # ____โฉ a forward pass on [0. 7.] # โช a backward pass on [6. 4. 0. 7.] # ____โฉ a forward pass on [3. 5.] # ____โฉ a forward pass on [1. 2.] # โช a backward pass on [3. 5. 1. 2.] # epoch: 1 batch_inds: [6 7 3 2 0 4 5 1] # ____โฉ a forward pass on [6. 7.] # ____โฉ a forward pass on [3. 2.] # โช a backward pass on [6. 7. 3. 2.] # ____โฉ a forward pass on [0. 4.] # ____โฉ a forward pass on [5. 1.] # โช a backward pass on [0. 4. 5. 1.] # epoch: 2 batch_inds: [1 4 5 6 0 7 3 2] # ____โฉ a forward pass on [1. 4.] # ____โฉ a forward pass on [5. 6.] # โช a backward pass on [1. 4. 5. 6.] # ____โฉ a forward pass on [0. 7.] # ____โฉ a forward pass on [3. 2.] # โช a backward pass on [0. 7. 3. 2.] # epoch: 3 batch_inds: [7 2 4 1 3 0 6 5] # ____โฉ a forward pass on [7. 2.] # ____โฉ a forward pass on [4. 1.] # โช a backward pass on [7. 2. 4. 1.] # ____โฉ a forward pass on [3. 0.] # ____โฉ a forward pass on [6. 5.] # โช a backward pass on [3. 0. 6. 5.] 8. Per-token KL penalty - The code adds a per-token KL penalty (lm_human_preferences/train_policy.py#L150-L153) to the rewards, in order to discourage the policy to be very different from the originalย policy. - Using the "usually, he would" as an example, it gets tokenized to [23073, 11, 339, 561]. Say we use [23073] as the query and [11, 339, 561] as the response. Then under the default gpt2 parameters, the response tokens will have log probabilities of the reference policy logprobs=[-3.3213, -4.9980, -3.8690] . - During the first PPO update epoch and minibatch update, so the active policy will have the same log probabilities new_logprobs=[-3.3213, -4.9980, -3.8690]. , so the per-token KL penalty would be kl = new_logprobs - logprobs = [0., 0., 0.,] - However, after the first gradient backward pass, we could have new_logprob=[3.3213, -4.9980, -3.8690] , so the per-token KL penalty becomes kl = new_logprobs - logprobs = [-0.3315, -0.0426, 0.6351] - Then the non_score_reward = beta * kl , where beta is the KL penalty coefficient \(\beta\), and itโ€™s added to the score obtained from the reward model to create the rewards used for training. The score is only given at the end of episode; it could look like [0.4,] , and we have rewards = [beta * -0.3315, beta * -0.0426, beta * 0.6351 + 0.4]. 9. Per-minibatch reward and advantage whitening, with optional mean shifting 1. OAI implements a whiten function that looks like below, basically normalizing the values by subtracting its mean followed by dividing by its standard deviation. Optionally, whiten can shift back the mean of the whitened values with shift_mean=True. python def whiten(values, shift_mean=True): mean, var = torch.mean(values), torch.var(values, unbiased=False) whitened = (values - mean) * torch.rsqrt(var + 1e-8) if not shift_mean: whitened += mean return whitened 1. In each minibatch, OAI then whitens the reward whiten(rewards, shift_mean=False) without shifting the mean (lm_human_preferences/train_policy.py#L325) and whitens the advantages whiten(advantages) with the shifted mean (lm_human_preferences/train_policy.py#L338). 2. Optimization note: if the number of minibatches is one (which is the case in this reproduction) we only need to whiten rewards, calculate and whiten advantages once since their values wonโ€™t change. 3. TensorFlow vs PyTorch note: Different behavior of tf.moments vs torch.var: The behavior of whitening is different in torch vs tf because the variance calculation is different: jsx import numpy as np import tensorflow as tf import torch def whiten_tf(values, shift_mean=True): mean, var = tf.nn.moments(values, axes=list(range(values.shape.rank))) mean = tf.Print(mean, [mean], 'mean', summarize=100) var = tf.Print(var, [var], 'var', summarize=100) whitened = (values - mean) * tf.rsqrt(var + 1e-8) if not shift_mean: whitened += mean return whitened def whiten_pt(values, shift_mean=True, unbiased=True): mean, var = torch.mean(values), torch.var(values, unbiased=unbiased) print("mean", mean) print("var", var) whitened = (values - mean) * torch.rsqrt(var + 1e-8) if not shift_mean: whitened += mean return whitened rewards = np.array([ [1.2, 1.3, 1.4], [1.5, 1.6, 1.7], [1.8, 1.9, 2.0], ]) with tf.Session() as sess: print(sess.run(whiten_tf(tf.constant(rewards, dtype=tf.float32), shift_mean=False))) print(whiten_pt(torch.tensor(rewards), shift_mean=False, unbiased=True)) print(whiten_pt(torch.tensor(rewards), shift_mean=False, unbiased=False)) jsx mean[1.5999999] var[0.0666666627] [[0.05080712 0.4381051 0.8254035 ] [1.2127019 1.6000004 1.9872988 ] [2.3745968 2.7618952 3.1491938 ]] mean tensor(1.6000, dtype=torch.float64) var tensor(0.0750, dtype=torch.float64) tensor([[0.1394, 0.5046, 0.8697], [1.2349, 1.6000, 1.9651], [2.3303, 2.6954, 3.0606]], dtype=torch.float64) mean tensor(1.6000, dtype=torch.float64) var tensor(0.0667, dtype=torch.float64) tensor([[0.0508, 0.4381, 0.8254], [1.2127, 1.6000, 1.9873], [2.3746, 2.7619, 3.1492]], dtype=torch.float64) 10. Clipped value function 1. As done in the original PPO (baselines/ppo2/model.py#L68-L75), the value function is clipped (lm_human_preferences/train_policy.py#L343-L348) in a similar fashion as the policy objective. 11. Adaptive KL - The KL divergence penalty coefficient \(\beta\) is modified adaptively based on the KL divergence between the current policy and the previous policy. If the KL divergence is outside a predefined target range, the penalty coefficient is adjusted to bring it closer to the target range (lm_human_preferences/train_policy.py#L115-L124). Itโ€™s implemented as follows: python class AdaptiveKLController: def __init__(self, init_kl_coef, hparams): self.value = init_kl_coef self.hparams = hparams def update(self, current, n_steps): target = self.hparams.target proportional_error = np.clip(current / target - 1, -0.2, 0.2) mult = 1 + proportional_error * n_steps / self.hparams.horizon self.value *= mult - For the sentiment and descriptiveness tasks examined in this work, we have init_kl_coef=0.15, hparams.target=6, hparams.horizon=10000.
[ 0.001898104790598154, -0.020540129393339157, -0.030264558270573616, 0.003369711572304368, -0.02812260203063488, 0.050801705569028854, 0.019177395850419998, 0.02436191216111183, 0.025207890197634697, -0.022296469658613205, -0.06754396110773087, 0.0027891765348613262, -0.020044639706611633, 0.008175898343324661, -0.011143459007143974, -0.011276718229055405, 0.006105987820774317, -0.022290419787168503, 0.03086802549660206, 0.015458216890692711, 0.039771050214767456, 0.04466821253299713, 0.04256786033511162, -0.0066770813427865505, -0.05420375615358353, -0.041968077421188354, 0.015557900071144104, -0.028632862493395805, -0.026587054133415222, 0.0029736864380538464, -0.11119338870048523, -0.027177078649401665, -0.03980886563658714, 0.011205799877643585, 0.03279392048716545, 0.02139177732169628, -0.12656189501285553, -0.019651465117931366, 0.09061817824840546, -0.013215146958827972, 0.07676219195127487, -0.028134822845458984, -0.12494193762540817, 0.08827704191207886, 0.005557151976972818, -0.03977053612470627, -0.11786936968564987, 0.0008836268098093569, -0.035357601940631866, 0.0784507691860199, -0.07144450396299362, 0.042367253452539444, 0.011322944425046444, -0.035392969846725464, 0.008442992344498634, 0.02206890471279621, 0.0005178174469619989, -0.04742288962006569, -0.01749313250184059, 0.026183627545833588, 0.0291668102145195, 0.01557902805507183, -0.004511912818998098, 0.05082165077328682, 0.09567584842443466, -0.022971514612436295, -0.0013515438186004758, -0.012190716341137886, 0.007581415586173534, -0.03212130814790726, 0.025390097871422768, -0.02370043471455574, 0.027934225276112556, -0.0032948979642242193, -0.0442170612514019, -0.00267048180103302, -0.004384234547615051, 0.013753996230661869, 0.04091114178299904, 0.0067755370400846004, -0.0597611665725708, 0.022618794813752174, 0.004468184895813465, 0.036650754511356354, -0.005903482902795076, 0.049813706427812576, 0.03965350612998009, -0.0565456822514534, 0.008185316808521748, 0.0782131776213646, -0.0355251170694828, -0.07156305760145187, 0.009497527964413166, 0.010684944689273834, 0.026964005082845688, -0.06292173266410828, 0.02876763977110386, -0.028488023206591606, -0.03833400830626488, 0.01095016859471798, -0.04330919310450554, -0.07220786064863205, 0.006758230272680521, -0.08493691682815552, -0.06073921173810959, 0.01309160701930523, -0.04888878017663956, -0.05931319296360016, -0.015398813411593437, 0.008062980137765408, -0.013097521848976612, 0.03821106255054474, -0.019000273197889328, 0.03600624203681946, -0.10010683536529541, -0.02094467356801033, 0.0034293741919100285, -0.003960459027439356, 0.01964550092816353, 0.031921323388814926, -0.013896881602704525, 0.14365923404693604, 0.03670366108417511, -0.0594363696873188, 0.02357785589993, 0.10181659460067749, -0.038648899644613266, 0.026639411225914955, 0.018577180802822113, -0.041463542729616165, 0.05488980561494827, -0.004994717426598072, 0.00813556183129549, 0.005679490976035595, 0.030798550695180893, -0.025485364720225334, 0.011491314508020878, -0.049189064651727676, 0.07694046944379807, -0.02996727079153061, -0.03999945521354675, 0.008537343703210354, 0.0030685518868267536, -0.0038688802160322666, 0.07567387819290161, 0.06354949623346329, -0.0020130702760070562, 0.03388489410281181, 0.03041941486299038, -0.053551238030195236, -0.06901367008686066, 0.07546933740377426, -0.0019145435653626919, -0.0959252342581749, 0.0610988512635231, 0.022217903286218643, -0.08738874644041061, -0.05633305013179779, -0.003010206390172243, -0.011333351023495197, -0.03907786309719086, 0.06244164705276489, -0.14219412207603455, -0.0023932713083922863, 0.05786370858550072, 0.012646597810089588, 0.014314712956547737, 0.008138713426887989, -0.047163788229227066, -0.007555519696325064, 0.043386396020650864, -0.0313238687813282, 0.11833860725164413, -0.01922495849430561, 0.018632980063557625, 0.06259042769670486, 0.05072861164808273, 0.060032378882169724, 0.02658218704164028, -0.05201731249690056, -0.057218316942453384, 0.025682125240564346, -0.025305014103651047, 0.06534750759601593, 0.023897452279925346, -0.06442727893590927, 0.04136078059673309, -0.044475145637989044, 0.032446686178445816, 0.027299176901578903, -0.04963444173336029, 0.011921866796910763, 0.07065693289041519, -0.005433892831206322, 0.04100172594189644, -0.05669878050684929, -0.043799277395009995, 0.11823563277721405, 0.05404035747051239, 0.05033222958445549, 0.031242502853274345, 0.0177776999771595, 0.0589962862432003, -0.009295931085944176, -0.04357389360666275, 0.013292714022099972, 0.002634387230500579, -0.13347993791103363, 0.0038411205168813467, 0.004207793157547712, 0.018456531688570976, -0.08020058274269104, 0.03762408345937729, -0.029540441930294037, 0.0408233217895031, -0.025818483904004097, 0.033132076263427734, 0.010123331099748611, 0.02548489160835743, -0.05720673128962517, 0.13150997459888458, -0.006612785626202822, 0.009175927378237247, -0.0056856232695281506, -0.022334644570946693, 0.004409647546708584, 0.08158423006534576, 0.0631871223449707, 0.002305357251316309, -0.03062666393816471, -0.04433796927332878, -0.06466709077358246, -0.029457326978445053, 0.07130876928567886, -0.01763792708516121, -0.0024494014214724302, 0.05614866316318512, -0.024092579260468483, -0.019623223692178726, -0.005420263856649399, 0.036987774074077606, 0.0029327739030122757, -0.028284016996622086, 0.06959559768438339, -0.010118220001459122, -0.03328511491417885, 0.0074217417277395725, 0.09479926526546478, -0.01317873690277338, -0.03380313515663147, -0.09025644510984421, 0.025387320667505264, -0.03867265582084656, 0.03494706004858017, -0.03999397158622742, 0.007541239261627197, 0.03549932315945625, 0.011025567539036274, -0.047062378376722336, 0.03166528791189194, -0.022495804354548454, 0.038992758840322495, -0.023380620405077934, 0.007992920465767384, -0.010044049471616745, -0.03911169245839119, 0.00026923618861474097, -0.012180136516690254, 0.0030141479801386595, 0.020410852506756783, -0.0012441802537068725, 0.011577174067497253, 0.010248884558677673, 0.026573147624731064, 0.016276676207780838, 0.013538369908928871, 0.04048284888267517, -0.049390826374292374, -0.03474828228354454, -0.028989706188440323, 0.05423973128199577, -0.03304686397314072, 0.03880861774086952, 0.04116040840744972, 0.003847987623885274, -0.01817162148654461, -0.002356099197641015, -0.054476961493492126, -0.0391802042722702, 0.04368209466338158, 0.038059987127780914, 0.021630439907312393, 0.023460375145077705, -0.038936253637075424, 0.010044987313449383, -0.03977677971124649, -0.03703930228948593, -0.012073631398379803, -0.00021784272394143045, 0.03174154460430145, -0.02237872965633869, 0.0027485103346407413, -0.009137825109064579, 0.010111060924828053, 0.009624676778912544, 0.05739198625087738, 0.04342528060078621, -0.002870868658646941, -0.09186755120754242, -0.005457371938973665, -0.011236249469220638, 0.02174300141632557, -0.03205074369907379, -0.029331957921385765, 0.05016626417636871, 0.019157305359840393, -0.008285898715257645, 0.0138849513605237, -0.008284788578748703, 0.007755751255899668, 0.060279909521341324, 0.01293278206139803, 0.00497048906981945, 0.011420231312513351, -0.00610422994941473, -0.016822779551148415, 0.03265741840004921, 0.0036918004043400288, -0.04395480453968048, 0.032245468348264694, -0.028101155534386635, 0.009416358545422554, 0.017259318381547928, 0.0338442400097847, 0.01467587985098362, 0.027318937703967094, -0.0166968684643507, -0.0519956611096859, -0.02234473079442978, -0.056378498673439026, 0.01147953886538744, 0.00013569578004535288, -0.024303307756781578, -0.01935034990310669, -0.01314290426671505, 0.02749878540635109, 0.0016022627241909504, 0.05710270255804062, -0.03718357905745506, -0.013218024745583534, 0.026101507246494293, -0.01591014303267002, 0.004424904473125935, 0.01695694401860237, -0.049722861498594284, 0.0017218556022271514, 0.008279889822006226, -0.0689782053232193, -0.036924317479133606, 0.0048135570250451565, -0.004038956947624683, 0.03407088667154312, -0.024507949128746986, 0.013196460902690887, 0.005548720248043537, 0.017909785732626915, 0.008369945921003819, -0.023120630532503128, -0.04882606863975525, -0.006726768333464861, -0.02929779328405857, -0.0011941030388697982, -0.010432213544845581, 0.010871551930904388, 0.04133867472410202, -0.011499756015837193, -0.07199908047914505, 0.04918915778398514, -0.04018326476216316, 0.012856395915150642, 0.04174358397722244, -0.000009235777724825311, 0.009780977852642536, -0.03484898433089256, -0.008289005607366562, 0.005084077827632427, 0.004945035092532635, 0.04340951517224312, -0.0494609959423542, -0.011898540891706944, -0.058072660118341446, -0.0028350648935884237, 0.015022551640868187, -0.03613368421792984, 0.03554818406701088, 0.000009747430340212304, 0.01371123269200325, 0.043831467628479004, 0.005923369899392128, -0.046001505106687546, -0.0029306146316230297, -0.017825983464717865, -0.0333368293941021, -0.050152476876974106, 0.04419739544391632, 0.019981207326054573, 0.03011348657310009, 0.03601409122347832, -0.002863699570298195, 0.011663270182907581, 0.044886354357004166, 0.01669149659574032, 0.013796902261674404, -0.02611565589904785, -0.009573414921760559, -0.023471061140298843, 0.025308649986982346, -0.0014083489077165723, 0.0060120876878499985, -0.029103795066475868, 0.035861432552337646, 0.005925948731601238, 0.043467696756124496, 0.06468012928962708, -0.028959471732378006, 0.002436836017295718, -0.02158353105187416, 0.02181522361934185, -0.03326055034995079, -0.0034530225675553083, -0.02547091245651245, -0.0407869927585125, 0.04548495262861252, 0.035325322300195694, -0.02969921939074993, -0.02457941137254238, 0.02197186090052128, 0.0015359538374468684, -0.053691912442445755, -0.0149789247661829, 0.049135804176330566, -0.004059862811118364, -0.02018607407808304, -0.014367909170687199, -0.0032439797651022673, -0.018328875303268433, -0.03150105103850365, -0.031177112832665443, 0.006536735687404871, -0.026122208684682846, 0.02468239516019821, -0.021471086889505386, 0.027429506182670593, 0.024124782532453537, -0.010262989439070225, -0.0003180828643962741, -0.013210165314376354, 0.028115537017583847, 0.04320941120386124, -0.017982425168156624, -0.046878889203071594, 0.0007329885847866535, 0.060238100588321686, 0.009400786831974983, -0.04505915567278862, 0.0229133740067482, -0.0022337455302476883, 0.03660839796066284, -0.02232942171394825, -0.0036807178985327482, -0.02454628050327301, 0.027779271826148033, 0.031092653051018715, 0.017763298004865646, 0.02497945912182331, -0.03662288561463356, 0.00225290865637362, 0.005951015278697014, -0.03045455925166607, -0.02099435403943062, 0.041698381304740906, -0.03154165670275688, 0.020098991692066193, 0.004619811661541462, 0.06712579727172852, 0.01658281311392784, -0.004732457455247641, 0.039457350969314575, -0.027952441945672035, 0.004508417099714279, -0.006501083727926016, -0.01575915701687336, 0.019391179084777832, 0.03320405259728432, 0.053607940673828125, 0.05455857142806053, 0.04636221006512642, 0.024842673912644386, -0.0005078758695162833, 0.004730212036520243, 0.035922009497880936, -0.002429922576993704, -0.015695227310061455, 0.05333290621638298, 0.03301238641142845, -0.0005173556273803115, -0.02845495007932186, -0.004895071033388376, 0.06432373821735382, 0.045295268297195435, -0.004160662647336721, -0.027888722717761993, 0.027634359896183014, -0.03550289571285248, -0.001626502606086433, -0.008419628255069256, -0.012638569809496403, -0.008701348677277565, -0.024660691618919373, -0.03412587195634842, -0.0238579623401165, -0.004047268535941839, 0.03787125647068024, -0.020105985924601555, -0.048707880079746246, 0.05848798155784607, -0.002917447593063116, 0.04489158093929291, -0.01281838957220316, -0.015234687365591526, -0.02362523414194584, -0.02094331383705139, 0.012727522291243076, -0.07999151945114136, -0.020085101947188377, -0.014406067319214344, 0.04113457724452019, 0.03748242184519768, 0.06220465153455734, -0.001396930543705821, 0.01736501418054104, 0.023666683584451675, 0.013760793022811413, -0.012640777975320816, 0.009744210168719292, 0.027433985844254494, 0.048602648079395294, -0.0416899137198925, -0.022927094250917435, 0.003077675588428974, -0.046302296221256256, -0.026463214308023453, -0.038941189646720886, 0.08445322513580322, -0.007497241720557213, -0.023713568225502968, -0.0026208017952740192, -0.013803997077047825, 0.009272638708353043, -0.00012384964793454856, 0.03779027611017227, 0.006245746742933989, 0.005671502090990543, 0.004206507932394743, 0.034080445766448975, 0.03741903603076935, -0.019404331222176552, 0.023202771320939064, -0.003581018652766943, -0.05040828138589859, -0.002757120644673705, 0.056938134133815765, -0.008846355602145195, 0.04865737631917, 0.001360223046503961, -0.018832562491297722, 0.01827806793153286, 0.013273484073579311, 0.021765558049082756, 0.043639231473207474, -0.03388684615492821, -0.011273542419075966, 0.007020642515271902, 0.009589863009750843, -0.0060931723564863205, 0.048209454864263535, -0.014703004620969296, -0.01158486120402813, -0.007054649759083986, 0.019799036905169487, 0.04025700315833092, 0.00005895132926525548, 0.0002332367148483172, -0.04689747095108032, 0.0734465941786766, 0.01765313744544983, 0.05070625618100166, 0.03807323798537254, -0.04175318405032158, 0.01043588388711214, -0.058756325393915176, -0.03511800244450569, -0.021858373656868935, 0.015758125111460686, 0.0036267831455916166, 0.018140772357583046, 0.03046512044966221, -0.034097954630851746, 0.06933122128248215, 0.026294395327568054, 0.03461606428027153, 0.007440319284796715, 0.0018687464762479067, 0.006823287345468998, -0.006668242625892162, -0.012069135904312134, 0.019318928942084312, 0.004508427809923887, 0.04783213883638382, 0.02780645713210106, -0.006929626688361168, 0.03372544050216675, 0.014348961412906647, 0.01927218772470951, -0.010864654555916786, 0.0045966170728206635, -0.003918463829904795, -0.006477076094597578, -0.0622413232922554, 0.0636621043086052, 0.005440728738903999, 0.026766838505864143, 0.005264632403850555, -0.009605648927390575, -0.01906273141503334, 0.00933079794049263, 0.006485603284090757, -0.010319775901734829, -0.021197674795985222, 0.021993162110447884, -0.01880972646176815, -0.010812824591994286, 0.014929421246051788, -0.015166861936450005, 0.00988712441176176, -0.006907980423420668, -0.043500106781721115, -0.052553147077560425, -0.036618463695049286, 0.004429741762578487, -0.016187094151973724, 0.04212464019656181, -0.0009364211582578719, 0.0015795876970514655, 0.030949044972658157, 0.06185069680213928, 0.0016925371019169688, 0.018350929021835327, -0.0037877431605011225, 0.008955859579145908, -0.00028244720306247473, -0.0165698304772377, 0.02165943570435047, -0.03991667181253433, 0.03672194480895996, -0.011882981285452843, 0.0038547455333173275, -0.004754357039928436, 0.0231940895318985, 0.0011508691823109984, 0.008440891280770302, 0.0017508420860394835, -0.009872300550341606, -0.02052203007042408, 0.04065196216106415, -0.022540681064128876, -0.0023339809849858284, 0.006604449823498726, 0.00148816779255867, -0.033488303422927856, 0.008493361994624138, -0.03670366480946541, 0.007813873700797558, -0.0065223295241594315, 0.040730323642492294, 0.008618845604360104, -0.024192549288272858, 0.014541011303663254, 0.053192779421806335, 0.0027328678406774998, 0.05772622674703598, 0.014605349861085415, -0.006904204376041889, -0.009207051247358322, -0.02404531091451645, 0.01985953561961651, -0.011975164525210857, 0.00616158451884985, 0.01825341023504734, -0.07199536263942719, -0.02853204682469368, 0.02220916748046875, -0.011846762150526047, -0.010100753977894783, -0.028410185128450394, 0.0008039446547627449, -0.04044799506664276, -0.011663620360195637, -0.024359624832868576, -0.044358991086483, 0.037994928658008575, 0.03692450374364853, -0.005703853443264961, -0.001982901245355606, -0.009771189652383327, -0.0013470218982547522, -0.018720503896474838, 0.014140495099127293, 0.035286884754896164, 0.014009903185069561, -0.012466417625546455, -0.042376480996608734, -0.012120097875595093, 0.01048965286463499, -0.03269517049193382, 0.004898462910205126, 0.0011713537387549877, 0.0036680835764855146, -0.05712389200925827, -0.010728868655860424, 0.03556849807500839, 0.005128632765263319, 0.05262826755642891, -0.04236588254570961, 0.00019278096442576498, 0.01577419601380825, 0.03916913643479347, -0.033181414008140564, -0.024115052074193954, -0.0030255429446697235, -0.014082600362598896, -0.027622371912002563, -0.008350721560418606, -0.0031351663637906313, -0.018714094534516335, -0.03906964883208275, -0.0239675622433424, 0.01632646843791008, -0.05469982698559761, 0.0026153980288654566, -0.04752069339156151, 0.03408556431531906, -0.024719126522541046, -0.05385769531130791, 0.02851305715739727, 0.0008899929816834629, 0.009696939028799534, 0.005528989713639021, -0.01805657334625721, 0.034142252057790756, -0.0019724888261407614, 0.011881155893206596, 0.012414079159498215, 0.05588879436254501, 0.04249154403805733, -0.028563424944877625, 0.002546908799558878, 0.018955165520310402 ]
The N Implementation Details of RLHF with PPO
vwxyzjn
October 24, 2023
the_n_implementation_details_of_rlhf_with_ppo
research, rl, rlhf
https://huggingface.co/blog/the_n_implementation_details_of_rlhf_with_ppo
tensorflow adam implementation: lr_t = lr * _dispatch_sqrt((1 - beta2 ** step)) / (1 - beta1 ** step) denom = exp_avg_sq.sqrt().add_(eps) param.addcdiv_(exp_avg, denom, value=-lr_t) - Letโ€™s compare the update equations of pytorch-style and tensorflow-style adam. Following the notation of the adam paper (Kingma and Ba, 2014), we have the gradient update rules for pytorch adam (Algorithm 1 of Kingma and Baโ€™s paper) and tensorflow-style adam (the formulation just before Section 2.1 of Kingma and Baโ€™s paper) as below: $$\begin{aligned}\text{pytorch adam :}\quad \theta_t & =\theta_{t-1}-\alpha \cdot \hat{m}t /\left(\sqrt{\hat{v}_t}+\varepsilon\right) \& =\theta{t-1}- \alpha \underbrace{\left[m_t /\left(1-\beta_1^t\right)\right]}{=\hat{m}_t} /\left[\sqrt{\underbrace{v_t /\left(1-\beta_2^t\right)}{=\hat{v}t} }+\varepsilon\right]\& =\theta{t-1}- \alpha\left[m_t /\left(1-\beta_1^t\right)\right]\frac{\sqrt{1-\beta_2^t}}{\sqrt{v_t}+\color{green}{\varepsilon \sqrt{1-\beta_2^t}}}\end{aligned}$$ $$\begin{aligned}\text{tensorflow adam:}\quad \theta_t & =\theta_{t-1}-\alpha_t m_t /\left(\sqrt{v_t}+\hat{\varepsilon}\right) \& =\theta_{t-1}-\underbrace{\left[\alpha \sqrt{1-\beta_2^t} /\left(1-\beta_1^t\right)\right]}{=\alpha_t} m_t /\left(\sqrt{v_t}+\hat{\varepsilon}\right) \& =\theta{t-1}- \alpha\left[m_t /\left(1-\beta_1^t\right)\right] \frac{\sqrt{1-\beta_2^t}}{\sqrt{v_t}+\color{green}{\hat{\varepsilon}}} \end{aligned}$$ - The equations above highlight that the distinction between pytorch and tensorflow implementation is their normalization terms, \(\color{green}{\varepsilon \sqrt{1-\beta_2^t}}\) and \(\color{green}{\hat{\varepsilon}}\). The two versions are equivalent if we set \(\hat{\varepsilon} =\varepsilon \sqrt{1-\beta_2^t}\) . However, in the pytorch and tensorflow APIs, we can only set \(\varepsilon\) (pytorch) and \(\hat{\varepsilon}\) (tensorflow) via the eps argument, causing differences in their update equations. What if we set \(\varepsilon\) and \(\hat{\varepsilon}\) to the same value, say, 1e-5? Then for tensorflow adam, the normalization term \(\hat{\varepsilon} = \text{1e-5}\) is just a constant. But for pytorch adam, the normalization term \({\varepsilon \sqrt{1-\beta_2^t}}\) changes over time. Importantly, initially much smaller than 1e-5 when the timestep \(t\) is small, the term \({\varepsilon \sqrt{1-\beta_2^t}}\) gradually approaches to 1e-5 as timesteps increase. The plot below compares these two normalization terms over timesteps: - The above figure shows that, if we set the same eps in pytorch adam and tensorflow adam, then pytorch-adam uses a much smaller normalization term than tensorflow-adam in the early phase of training. In other words, pytorch adam goes for more aggressive gradient updates early in the training. Our experiments support this finding, as we will demonstrate below. - How does this impact reproducibility and performance? To align settings, we record the original query, response, and rewards from https://github.com/openai/lm-human-preferences and save them in https://huggingface.co/datasets/vwxyzjn/lm-human-preferences-debug/tree/main. I also record the metrics of the first two epochs of training with TF1โ€™s AdamOptimizer optimizer as the ground truth. Below are some key metrics: | | OAIโ€™s TF1 Adam | PyTorchโ€™s Adam | Our custom Tensorflow-style Adam | | --- | --- | --- | --- | | policy/approxkl | 0.00037167023 | 0.0023672834504395723 | 0.000374998344341293 | | policy/clipfrac | 0.0045572915 | 0.02018229104578495 | 0.0052083334885537624 | | ratio_mean | 1.0051285 | 1.0105520486831665 | 1.0044583082199097 | | ratio_var | 0.0007716546 | 0.005374275613576174 | 0.0007942612282931805 | | ratio_max | 1.227216 | 1.8121057748794556 | 1.250215768814087 | | ratio_min | 0.7400441 | 0.4011387825012207 | 0.7299948930740356 | | logprob_diff_mean | 0.0047487603 | 0.008101251907646656 | 0.004073789343237877 | | logprob_diff_var | 0.0007207897 | 0.004668936599045992 | 0.0007334011606872082 | | logprob_diff_max | 0.20474821 | 0.594489574432373 | 0.22331619262695312 | | logprob_diff_min | -0.30104542 | -0.9134478569030762 | -0.31471776962280273 | - PyTorchโ€™s Adam produces a more aggressive update for some reason. Here are some evidence: - PyTorchโ€™s Adam's logprob_diff_var is 6x higher. Here logprobs_diff = new_logprobs - logprobs is the difference between the log probability of tokens between the initial and current policy after two epochs of training. Having a larger logprob_diff_var means the scale of the log probability changes is larger than that in OAIโ€™s TF1 Adam. - PyTorchโ€™s Adam presents a more extreme ratio max and min. Here ratio = torch.exp(logprobs_diff). Having a ratio_max=1.8121057748794556 means that for some token, the probability of sampling that token is 1.8x more likely under the current policy, as opposed to only 1.2x with OAIโ€™s TF1 Adam. - Larger policy/approxkl policy/clipfrac. Because of the aggressive update, the ratio gets clipped 4.4x more often, and the approximate KL divergence is 6x larger. - The aggressive update is likely gonna cause further issues. E.g.,ย ย logprob_diff_meanย is 1.7x larger in PyTorchโ€™sย Adam, which would correspond to 1.7x larger KL penalty in the next reward calculation; this could get compounded. In fact, this might be related to the famous KL divergence issue โ€” KL penalty is much larger than it should be and the model could pay more attention and optimizes for it more instead, therefore causing negative KL divergence. - Larger models get affected more. We conducted experiments comparing PyTorchโ€™s Adam (codename pt_adam) and our custom TensorFlow-style (codename tf_adam) with gpt2 and gpt2-xl. We found that the performance are roughly similar under gpt2; however with gpt2-xl, we observed a more aggressive updates, meaning that larger models get affected by this issue more. - When the initial policy updates are more aggressive in gpt2-xl, the training dynamics get affected. For example, we see a much larger objective/kl and objective/scores spikes with pt_adam, especially with sentiment โ€” the biggest KL was as large as 17.5 in one of the random seeds, suggesting an undesirable over-optimization. - Furthermore, because of the larger KL, many other training metrics are affected as well. For example, we see a much larger clipfrac (the fraction of time the ratio gets clipped by PPOโ€™s objective clip coefficient 0.2) and approxkl. # Limitations Noticed this work does not try to reproduce the summarization work in CNN DM or TL;DR. This was because we found the training to be time-consuming and brittle. The particular training run we had showed poor GPU utilization (around 30%), so it takes almost 4 days to perform a training run, which is highly expensive (only AWS sells p3dn.24xlarge, and it costs $31.212 per hour) Additionally, training was brittle. While the reward goes up, we find it difficult to reproduce the โ€œsmart copierโ€ behavior reported by Ziegler et al. (2019). Below are some sample outputs โ€” clearly, the agent overfits somehow. See https://wandb.ai/openrlbenchmark/lm-human-preferences/runs/1ab47rqi/logs for more complete logs. # Conclusion In this work, we took a deep dive into OAIโ€™s original RLHF codebase and compiled a list of its implementation details. We also created a minimal base which reproduces the same learning curves as OAIโ€™s original RLHF codebase, when the dataset and hyperparameters are controlled. Furthermore, we identify surprising implementation details such as the adam optimizerโ€™s setting which causes aggressive updates in early RLHF training. # Acknowledgement This work is supported by Hugging Faceโ€™s Big Science cluster ๐Ÿค—. We also thank the helpful discussion with @lewtun and @natolambert. # Bibtex bibtex @article{Huang2023implementation, author = {Huang, Shengyi and Liu, Tianlin and von Werra, Leandro}, title = {The N Implementation Details of RLHF with PPO}, journal = {Hugging Face Blog}, year = {2023}, note = {https://huggingface.co/blog/the_n_implementation_details_of_rlhf_with_ppo}, }
[ 0.018773669376969337, -0.04828953370451927, 0.004623721819370985, 0.04144378378987312, -0.029770666733384132, 0.0054234969429671764, 0.05264829099178314, -0.013589545153081417, -0.036579251289367676, -0.03675733879208565, -0.060264334082603455, 0.03921465948224068, -0.022348644211888313, 0.03318572789430618, -0.01944761537015438, 0.0900174155831337, -0.036256343126297, -0.03082490712404251, 0.03067990206182003, 0.047926466912031174, 0.00029283028561621904, -0.02037418633699417, 0.013888262212276459, 0.003085693111643195, -0.036470621824264526, -0.05459832400083542, -0.04139614850282669, 0.028394481167197227, -0.050335947424173355, 0.0715460330247879, -0.05137085169553757, 0.00971684604883194, -0.011405577883124352, -0.04029020667076111, 0.0214044451713562, -0.02607128955423832, -0.06984439492225647, -0.02852603793144226, 0.06527086347341537, -0.044700127094984055, 0.06661973893642426, -0.017132779583334923, -0.09190919250249863, 0.006101643666625023, -0.025042511522769928, -0.047809865325689316, -0.07843438535928726, -0.021824728697538376, -0.027802813798189163, -0.011838329024612904, -0.06008675694465637, 0.023131119087338448, -0.08521807938814163, 0.008558175526559353, -0.046431951224803925, 0.032140281051397324, -0.004815802443772554, 0.03308063745498657, 0.04030190780758858, -0.037704452872276306, 0.019411439076066017, 0.010839082300662994, 0.006785440258681774, 0.016007158905267715, 0.07757293432950974, -0.01769246719777584, 0.016184229403734207, 0.012071856297552586, -0.08240950852632523, 0.014148859307169914, 0.018133757635951042, 0.03545166179537773, -0.01764480397105217, -0.0009064520127139986, -0.06603861600160599, -0.039106592535972595, 0.019381582736968994, -0.01614556647837162, 0.02527356520295143, 0.01398861687630415, -0.021167458966374397, -0.04152526706457138, 0.08140823245048523, 0.05283547565340996, 0.02760854922235012, 0.055803485214710236, -0.032314226031303406, 0.002156090922653675, 0.035411637276411057, 0.04476259648799896, -0.06665436178445816, 0.0013559075305238366, 0.018571460619568825, -0.031261637806892395, 0.03737081587314606, -0.028670040890574455, -0.05782833322882652, -0.06698309630155563, -0.03501196205615997, -0.014884350821375847, 0.04439215362071991, -0.03660878911614418, -0.009066829457879066, -0.06044236198067665, 0.007740460801869631, 0.023768775165081024, -0.06460759043693542, -0.09811259806156158, -0.04330906271934509, 0.009793294593691826, -0.04598632827401161, 0.1012459471821785, 0.059140440076589584, 0.03226626664400101, -0.0928230732679367, -0.003966795280575752, -0.034160830080509186, 0.014492414891719818, -0.05099325254559517, -0.047405462712049484, -0.004876859486103058, 0.14045080542564392, 0.11460863798856735, -0.04391215741634369, -0.022806357592344284, 0.04427463188767433, 0.01402517780661583, 0.027689317241311073, -0.04176748916506767, -0.043101754039525986, 0.05638805404305458, -0.017713412642478943, 0.020104099065065384, -0.034373726695775986, -0.0533180832862854, -0.058889470994472504, 0.01982794515788555, -0.026496848091483116, -0.022944645956158638, 0.009295779280364513, -0.022132838144898415, 0.08221185952425003, -0.015455327928066254, 0.024481521919369698, 0.0257533248513937, -0.0785597637295723, -0.03485061973333359, 0.02285156585276127, 0.10021185129880905, 0.018544012680649757, -0.023507950827479362, 0.0030755698680877686, 0.007143071386963129, -0.05585735663771629, 0.04709910601377487, 0.050413455814123154, -0.029981287196278572, -0.010432115755975246, -0.06277826428413391, 0.0173720121383667, 0.0478711873292923, -0.007261423859745264, -0.04372116178274155, -0.05048851668834686, 0.09729383140802383, -0.037836186587810516, 0.04989176616072655, -0.056449972093105316, -0.043815188109874725, -0.034687589854002, 0.025849485769867897, -0.020209014415740967, 0.03456278517842293, 0.04554038494825363, 0.04279075562953949, 0.043959639966487885, -0.016831718385219574, 0.07182631641626358, -0.014869690872728825, 0.02375890500843525, -0.0021908835042268038, 0.0702337995171547, 0.010722342878580093, -0.017039502039551735, -0.026824193075299263, -0.09474240243434906, 0.06572318822145462, -0.03918883949518204, 0.06591203808784485, 0.007622061762958765, -0.016554512083530426, 0.04716723412275314, 0.07450015842914581, -0.03202378377318382, 0.038791730999946594, -0.08172181993722916, 0.019846705719828606, 0.0430787019431591, 0.08809906244277954, 0.0309258121997118, 0.05097566917538643, -0.06916412711143494, 0.004229044076055288, 0.015580175444483757, 0.02201477810740471, 0.07438412308692932, -0.008016375824809074, -0.09226825088262558, 0.059343721717596054, 0.03359202295541763, -0.006752870511263609, -0.06494779884815216, 0.010239837691187859, -0.08771497756242752, 0.006105444394052029, 0.04191682115197182, -0.021348336711525917, 0.019896987825632095, 0.05382123216986656, 0.051095135509967804, 0.1111878827214241, -0.03258607164025307, -0.059079740196466446, -0.03779575601220131, -0.07361513376235962, 0.034564778208732605, 0.07100017368793488, 0.0008771403809078038, 0.022753838449716568, -0.033340178430080414, -0.04396951198577881, -0.07188864052295685, 0.010392147116363049, 0.08531538397073746, 0.06852265447378159, -0.02982182800769806, -0.04074600711464882, -0.04919172450900078, 0.033157892525196075, -0.08188983052968979, 0.08695440739393234, 0.07636158913373947, -0.02794044464826584, 0.000556179613340646, -0.01336731854826212, -0.05985530465841293, 0.06626059859991074, 0.007437901571393013, 0.02378644049167633, 0.06878379732370377, -0.02332725189626217, 0.003474601311609149, 0.07121699303388596, -0.041987501084804535, 0.004820879083126783, 0.06477168202400208, -0.00744229182600975, -0.002904159715399146, -0.023852815851569176, 0.020732305943965912, 0.026766715571284294, 0.04197685793042183, -0.0892510861158371, -0.040424421429634094, -0.03419385105371475, -0.01861821673810482, 0.021689333021640778, 0.01759098283946514, 0.0004895210731774569, 0.03116000071167946, 0.06028721481561661, -0.01006304007023573, 0.012581441551446915, 0.00572040444239974, -0.012598722241818905, -0.02299407497048378, 0.051906172186136246, -0.014914467930793762, -0.02998620830476284, -0.0767025277018547, 0.01651759259402752, 0.0030836923979222775, 0.07671251147985458, 0.039005767554044724, -0.0059555908665061, -0.006609906442463398, -0.021432962268590927, 0.029504310339689255, -0.022488033398985863, -0.02008717693388462, -0.01694437675178051, 0.03897792845964432, 0.016779955476522446, 0.006752385757863522, -0.033294714987277985, 0.07093613594770432, -0.0572766438126564, -0.0343017503619194, -0.03406006842851639, 0.02792389877140522, 0.01637248322367668, 0.0053299288265407085, 0.03876397758722305, -0.049052685499191284, 0.009575325064361095, 0.012609142810106277, 0.02016899548470974, 0.03878745064139366, -0.08485964685678482, -0.02550133876502514, -0.007424989249557257, 0.05464276298880577, -0.027124058455228806, -0.0019674121867865324, 0.02597854472696781, 0.02400839887559414, -0.03017774038016796, -0.025582248345017433, -0.014694849960505962, 0.011099196039140224, 0.006434868089854717, 0.033366892486810684, 0.047525376081466675, -0.04371053725481033, -0.01787637174129486, 0.002039765240624547, 0.010006059892475605, -0.01115297432988882, -0.026865392923355103, 0.03918566182255745, -0.009330607019364834, -0.02670283243060112, -0.007497538812458515, 0.0296410471200943, 0.020711073651909828, 0.004151333589106798, 0.00001981056630029343, -0.034550782293081284, 0.0006596254534088075, -0.04328267648816109, -0.019948367029428482, 0.0001784906053217128, -0.006195252761244774, -0.00829982291907072, -0.03308741748332977, -0.04361233860254288, 0.020017724484205246, 0.044570207595825195, 0.00365466414950788, 0.010136022232472897, 0.015225537121295929, -0.02538515254855156, 0.0052645946852862835, -0.0250525064766407, -0.03468034043908119, 0.012704163789749146, 0.010532279498875141, -0.04236283898353577, 0.007282337639480829, -0.005356401205062866, 0.021512456238269806, 0.009328830987215042, 0.008711021393537521, 0.006577278487384319, 0.01226449478417635, 0.04248123615980148, 0.05776858329772949, 0.023839294910430908, -0.010086921975016594, 0.02187141589820385, 0.026989655569195747, -0.04919929429888725, 0.023331189528107643, 0.03942275792360306, 0.039376769214868546, -0.005028660874813795, -0.0425938256084919, 0.07447098195552826, -0.056858789175748825, 0.003478372935205698, 0.008895797654986382, 0.002764360513538122, -0.02703271061182022, 0.006109393667429686, -0.033176489174366, 0.019841209053993225, 0.06405920535326004, 0.024185121059417725, -0.031166626140475273, -0.03961561620235443, 0.0460592545568943, -0.008623091503977776, -0.008752972818911076, 0.014195211231708527, 0.013461471535265446, -0.03012683056294918, 0.056114282459020615, 0.0036202396731823683, 0.005360630806535482, 0.008888465352356434, 0.00113808480091393, 0.0018674706807360053, -0.0645468682050705, 0.005870915949344635, 0.023217415437102318, 0.0040923901833593845, 0.01727980747818947, 0.04480374604463577, -0.02068786695599556, -0.022869540378451347, 0.028088552877306938, -0.03127829730510712, -0.006900360342115164, 0.04975181445479393, 0.030485734343528748, 0.018674341961741447, 0.015125678852200508, -0.026129454374313354, 0.007951449602842331, -0.0260984655469656, 0.02712837979197502, -0.042752787470817566, 0.021719561889767647, 0.06461213529109955, -0.0702212005853653, -0.02028520591557026, -0.006437129341065884, 0.05791589990258217, -0.046346865594387054, 0.005356702487915754, -0.0009839778067544103, -0.02108609862625599, 0.0269889198243618, 0.022858861833810806, -0.015675107017159462, 0.04855141043663025, 0.016139496117830276, -0.029491357505321503, -0.06845494359731674, -0.026591168716549873, 0.02526247873902321, 0.026391683146357536, 0.007538525387644768, 0.005506788846105337, 0.01753178983926773, 0.025061603635549545, 0.024030229076743126, -0.034076202660799026, 0.016982877627015114, 0.05026591196656227, 0.045665815472602844, -0.05797211080789566, 0.0137355150654912, 0.034546446055173874, -0.018974201753735542, -0.014754806645214558, -0.005491294898092747, 0.009543019346892834, 0.0338374562561512, 0.02036067470908165, -0.013449766673147678, -0.0465192012488842, 0.017046483233571053, 0.0399162583053112, 0.009390236809849739, -0.020722350105643272, -0.012748409062623978, 0.013507690280675888, -0.029376398772001266, -0.006871864665299654, -0.04393830895423889, 0.008039403706789017, 0.017252199351787567, 0.006732019130140543, -0.015878884121775627, -0.03589445725083351, 0.004533593542873859, -0.027894215658307076, -0.07737234979867935, -0.002823667833581567, 0.015607663430273533, -0.02607640251517296, 0.01994762197136879, 0.010499834083020687, 0.029499476775527, -0.0023489762097597122, 0.029003648087382317, -0.021839642897248268, -0.0037435723934322596, -0.010936427861452103, -0.008405989035964012, 0.02100406214594841, 0.015436145476996899, 0.02145148254930973, -0.028854811564087868, 0.015384853817522526, -0.024460557848215103, 0.05908544361591339, 0.016907423734664917, 0.0432882159948349, 0.009147134609520435, -0.006925599183887243, 0.021482469514012337, 0.03020714782178402, -0.03703147545456886, 0.006926708854734898, -0.022222653031349182, -0.011061158031225204, 0.002077181823551655, 0.013257590122520924, 0.05353517830371857, -0.03148476779460907, 0.01655568927526474, 0.025232529267668724, -0.008452409878373146, 0.000327243993524462, -0.007981195114552975, -0.015047378838062286, -0.014093957841396332, 0.016512984409928322, 0.0062732878141105175, -0.028898699209094048, 0.05298921838402748, -0.017410825937986374, 0.008689429610967636, 0.02152259647846222, -0.02708050049841404, 0.018275145441293716, -0.002799412002786994, 0.00780673511326313, -0.03423798456788063, -0.0052972943522036076, -0.0029568138998001814, -0.04664935544133186, 0.012077651917934418, 0.03567598760128021, -0.022732898592948914, 0.02859930507838726, -0.002766082063317299, -0.023671401664614677, -0.03177965432405472, -0.013728849589824677, 0.005671404767781496, -0.01027349941432476, 0.0012375389924272895, 0.027029192075133324, 0.041911397129297256, -0.016431408002972603, -0.021694151684641838, -0.013032287359237671, -0.007147676777094603, -0.01659095473587513, -0.014405726455152035, 0.039406318217515945, 0.055519070476293564, -0.021342014893889427, 0.057337529957294464, -0.011760035529732704, 0.027013758197426796, 0.0006312202895060182, -0.01446233969181776, 0.011817742139101028, 0.025597402825951576, 0.02011936530470848, 0.016764234751462936, -0.016416003927588463, 0.03288949653506279, 0.014514945447444916, 0.026236772537231445, -0.010847961530089378, 0.02773061767220497, 0.02944302000105381, -0.04204990714788437, 0.02379828691482544, 0.0027204572688788176, -0.017109563574194908, -0.01522577740252018, -0.022806551307439804, -0.0012370389886200428, 0.034085966646671295, 0.010985163040459156, 0.019499875605106354, 0.024674484506249428, 0.021074874326586723, -0.03895385190844536, 0.026098916307091713, -0.014302406460046768, 0.022438732907176018, 0.0010135876946151257, 0.02839413844048977, 0.028066618368029594, 0.01816784404218197, -0.021828897297382355, 0.02020304650068283, 0.059091828763484955, -0.004807814955711365, 0.04438765347003937, 0.030859079211950302, -0.037042610347270966, 0.022125359624624252, -0.0498935803771019, -0.03043125756084919, -0.04212954640388489, -0.01343586202710867, 0.03975655883550644, -0.009697207249701023, 0.011881936341524124, -0.03199664503335953, 0.050676170736551285, 0.026320096105337143, 0.060300312936306, 0.027986152097582817, -0.03746922314167023, -0.00750312115997076, 0.0353490374982357, -0.045564182102680206, 0.01680113933980465, -0.06941817700862885, 0.01680210418999195, 0.04162042215466499, -0.04857366159558296, 0.03824857994914055, -0.010946427471935749, -0.05538535490632057, 0.040448423475027084, 0.010080794803798199, -0.019191501662135124, -0.031927067786455154, 0.054273031651973724, 0.0300915390253067, -0.002213114406913519, 0.0028778095729649067, -0.029524806886911392, 0.025659427046775818, -0.01631000265479088, -0.00565725052729249, 0.00008921603148337454, 0.01698494330048561, 0.019040217623114586, -0.013592952862381935, -0.0468842051923275, 0.06466779112815857, -0.0033168422523885965, -0.013449735939502716, 0.02829311229288578, -0.00530589371919632, -0.01440270897001028, 0.025959789752960205, -0.021505216136574745, -0.007704945281147957, 0.009139018133282661, 0.019786830991506577, 0.005709873046725988, -0.049265287816524506, 0.013587267138063908, -0.011778930202126503, -0.03369904309511185, 0.024793360382318497, 0.0029975997749716043, -0.012522557750344276, -0.042407698929309845, -0.03588161990046501, -0.013635335490107536, 0.02716882899403572, 0.034170325845479965, 0.04473050683736801, -0.023498406633734703, 0.02701617032289505, 0.04075336083769798, -0.01830362156033516, 0.023827118799090385, -0.04974692687392235, -0.06368821114301682, 0.010109967552125454, -0.01786339096724987, -0.006606916896998882, -0.06385456025600433, 0.02055511437356472, 0.026006467640399933, 0.007820880971848965, 0.007240804843604565, -0.013444613665342331, 0.010468767024576664, -0.006768910679966211, 0.016583550721406937, 0.02487499639391899, 0.004328342154622078, -0.001013397704809904, 0.013057347387075424, -0.026092413812875748, -0.001582553843036294, 0.06511074304580688, 0.006301286164671183, 0.03285887464880943, -0.003946909215301275, -0.042943719774484634, -0.011227250099182129, 0.006392815615981817, -0.02359486185014248, -0.039943594485521317, 0.002074918244034052, 0.029983211308717728, 0.002549561206251383, 0.02316669374704361, -0.019486166536808014, -0.007845696061849594, 0.0037906214129179716, -0.02914697304368019, -0.009912947192788124, -0.024219892919063568, 0.05376886576414108, 0.057300299406051636, 0.022867528721690178, -0.014031829312443733, -0.03210537135601044, 0.006245606578886509, -0.021985342726111412, -0.007999840192496777, 0.023742295801639557, 0.034929417073726654, -0.015928547829389572, 0.035180650651454926, 0.03672649338841438, -0.017062073573470116, 0.00010235459922114387, -0.054287102073431015, -0.006653651129454374, -0.07077527046203613, -0.019488699734210968, -0.02493145503103733, -0.02896326594054699, 0.021986158564686775, 0.04070446640253067, 0.007477005943655968, -0.012486115097999573, -0.03941795602440834, -0.019750794395804405, -0.030875304713845253, 0.02732660621404648, -0.009163327515125275, -0.004438063129782677, -0.008274038322269917, -0.031074581667780876, 0.03283366188406944, -0.02760264091193676, 0.005892395041882992, -0.052448857575654984, 0.03460055962204933, 0.007007703650742769, 0.021564899012446404, 0.023917272686958313, 0.05776367709040642, -0.03044731542468071, -0.03422807157039642, -0.030772272497415543, -0.013645648956298828, 0.006395202130079269, -0.023667816072702408, -0.028329912573099136, 0.0020640362054109573, -0.01438840664923191, -0.0036250362172722816, -0.010373824276030064, -0.010685592889785767, -0.007777519524097443, 0.009089630097150803, 0.008523333817720413, 0.03561241179704666 ]
The N Implementation Details of RLHF with PPO
vwxyzjn
October 24, 2023
the_n_implementation_details_of_rlhf_with_ppo
research, rl, rlhf
https://huggingface.co/blog/the_n_implementation_details_of_rlhf_with_ppo
PyTorch Adam optimizer numerical issues w.r.t RLHF - This implementation detail is so interesting that it deserves a full section. - PyTorch Adam optimizer (torch.optim.Adam.html) has a different implementation compared to TensorFlowโ€™s Adam optimizer (TF1 Adam at tensorflow/v1.15.2/adam.py, TF2 Adam at keras/adam.py#L26-L220). In particular, PyTorch follows Algorithm 1 of the Kingma and Baโ€™s Adam paper (arxiv/1412.6980), but TensorFlow uses the formulation just before Section 2.1 of the paper and its epsilon referred to here is epsilon hat in the paper. In a pseudocode comparison, we have the following python
[ 0.014166394248604774, 0.0059432717971503735, -0.0011850175214931369, 0.016355952247977257, -0.03707138076424599, 0.054313063621520996, 0.02234809100627899, 0.0018766137072816491, -0.039595771580934525, -0.051400572061538696, -0.053539618849754333, -0.001264842925593257, 0.00029068824369460344, 0.024432577192783356, -0.03168860822916031, 0.06833381205797195, -0.0009806734742596745, -0.02768458053469658, 0.028198236599564552, 0.05133158713579178, -0.029167519882321358, -0.010257263667881489, 0.00580092566087842, -0.0024104828480631113, -0.05448469519615173, -0.07220965623855591, -0.0975247249007225, 0.023392749950289726, -0.04527583718299866, 0.06293836981058121, -0.12273651361465454, -0.01692393608391285, 0.05286049470305443, -0.05947599932551384, 0.0028344762977212667, -0.04286591336131096, -0.14247679710388184, 0.005399114917963743, 0.07552717626094818, -0.029044419527053833, 0.02206064760684967, -0.04859326034784317, -0.08892064541578293, 0.02477729506790638, -0.006406164262443781, -0.01975218765437603, -0.1291271150112152, 0.04407871514558792, -0.004449845757335424, 0.00019070951384492218, -0.08664305508136749, 0.011082138866186142, -0.059174053370952606, 0.000021297260900610127, -0.05759425461292267, 0.01943136192858219, -0.026059946045279503, 0.04823431372642517, 0.0600048266351223, -0.013657554052770138, 0.07127754390239716, 0.016643308103084564, 0.022715626284480095, 0.051250211894512177, 0.0614154189825058, 0.03522488474845886, -0.022591950371861458, 0.03155943751335144, -0.07371431589126587, 0.019298814237117767, 0.030882544815540314, 0.005598157178610563, -0.0216158926486969, 0.005814407952129841, -0.07889126986265182, -0.03478836268186569, -0.027411002665758133, 0.028837688267230988, 0.06071612238883972, 0.03476530313491821, -0.03301389515399933, 0.00843440555036068, 0.05358373746275902, 0.06714878976345062, 0.04858352988958359, 0.0128144770860672, -0.02698337286710739, 0.027616817504167557, 0.0159816462546587, 0.1036260575056076, -0.035960860550403595, -0.0606263130903244, -0.005873498506844044, -0.03154236078262329, 0.039888348430395126, -0.046756573021411896, -0.059563182294368744, 0.009758532047271729, 0.010317373089492321, -0.010596951469779015, 0.017460022121667862, -0.08336304873228073, 0.00796787440776825, 0.010943792760372162, -0.047836802899837494, 0.056293752044439316, -0.04793510213494301, -0.06026996299624443, 0.013859094120562077, 0.04387916624546051, -0.0657983049750328, 0.04237852245569229, 0.05340355262160301, -0.00099144596606493, -0.07897832989692688, 0.004555080085992813, -0.026774991303682327, -0.013787602074444294, 0.016088370233774185, 0.008481854572892189, -0.020058777183294296, 0.13712428510189056, 0.031637392938137054, 0.03623207286000252, 0.02914515882730484, 0.11971072107553482, 0.010923665948212147, 0.01732061058282852, -0.052527010440826416, -0.013456212356686592, 0.05671697482466698, -0.007703042589128017, 0.05004618316888809, -0.029768437147140503, -0.016114389523863792, -0.0627085417509079, 0.015448213554918766, -0.0372457429766655, -0.060933683067560196, -0.016822077333927155, -0.08978968113660812, 0.03624863550066948, 0.008984237909317017, 0.054408881813287735, 0.0011743878712877631, -0.07158157974481583, 0.03339686617255211, 0.05845724791288376, 0.08397994190454483, -0.010500325821340084, -0.06434818357229233, 0.03536159172654152, -0.035732951015233994, -0.05418308824300766, 0.015273788012564182, 0.060568660497665405, -0.020640041679143906, -0.029550163075327873, -0.10130905359983444, -0.038764338940382004, 0.004945531487464905, 0.04815534129738808, -0.019473887979984283, -0.04786304384469986, 0.06078595295548439, 0.009678665548563004, 0.06289064139127731, 0.011988628655672073, -0.016527803614735603, 0.012731705792248249, 0.018637806177139282, 0.007972854189574718, 0.08617100864648819, 0.02622462995350361, -0.024662507697939873, 0.0295840036123991, 0.03894614800810814, 0.02040356770157814, -0.01904504932463169, -0.008238403126597404, -0.054911524057388306, 0.04909682273864746, 0.0076014515943825245, 0.06284897774457932, 0.028102116659283638, -0.08866006135940552, 0.018098754808306694, -0.00028393237153068185, 0.0026608894113451242, 0.036710482090711594, -0.06769951432943344, 0.021265028044581413, 0.040669288486242294, -0.07466088235378265, 0.0017762749921530485, -0.08949492871761322, -0.01199870090931654, 0.07139633595943451, 0.05829301476478577, 0.023023130372166634, 0.04764333367347717, -0.006971914786845446, -0.0025460298638790846, 0.014592223800718784, 0.020852232351899147, -0.002638175617903471, -0.00400286540389061, -0.07463659346103668, 0.013654408045113087, 0.04077209532260895, 0.018472284078598022, -0.07862091809511185, -0.001388933160342276, -0.08183613419532776, 0.00920040812343359, 0.03015744313597679, 0.022824686020612717, 0.033280353993177414, 0.017049511894583702, -0.014097421430051327, 0.15494713187217712, -0.02443082258105278, -0.010546193458139896, -0.022569062188267708, -0.08041080087423325, 0.06482232362031937, 0.04222533851861954, 0.00010280680726282299, 0.0717381164431572, -0.05542696639895439, -0.017425261437892914, -0.058074336498975754, 0.011184045113623142, 0.09552853554487228, 0.052593082189559937, -0.06422687321901321, -0.050596293061971664, 0.014953394420444965, 0.05989920347929001, -0.03152894601225853, 0.05412958189845085, 0.03964362293481827, -0.01362139917910099, 0.02650454454123974, -0.06160837411880493, 0.0009435671381652355, 0.05330612510442734, 0.023337451741099358, 0.0016341815935447812, 0.015101511031389236, -0.041833892464637756, -0.0007185707800090313, 0.001663318951614201, -0.03874892741441727, 0.0008858969085849822, 0.08962903916835785, 0.002906205365434289, -0.030042825266718864, -0.0012651663273572922, 0.028217611834406853, -0.006436718627810478, 0.02021656557917595, -0.040622103959321976, -0.01679672859609127, -0.02789861336350441, -0.06070799380540848, 0.01687450148165226, 0.028692632913589478, -0.008219840005040169, 0.036091454327106476, 0.014470303431153297, -0.014588180929422379, -0.003593173110857606, 0.007122501730918884, 0.01257066335529089, 0.010182042606174946, 0.07756151258945465, -0.06718295067548752, -0.06854778528213501, -0.01892183907330036, -0.007727134041488171, 0.0021308260038495064, 0.04100765287876129, -0.015067044645547867, -0.0025304898153990507, -0.011917873285710812, 0.024401700124144554, 0.037963319569826126, -0.03604765236377716, 0.03790266439318657, -0.02863384783267975, 0.03117852658033371, 0.008754563517868519, 0.010096053592860699, 0.0005494391079992056, 0.036340098828077316, -0.034365564584732056, -0.022719256579875946, -0.03065948374569416, 0.014228339307010174, -0.01949743740260601, 0.00962747447192669, 0.03914541378617287, -0.023575054481625557, -0.0052941120229661465, 0.020942194387316704, 0.053778115659952164, 0.07674189656972885, -0.10596177726984024, 0.00717621436342597, 0.018505766987800598, 0.03356152027845383, -0.04049373418092728, 0.0015555720310658216, 0.043552935123443604, 0.02342890202999115, -0.007713795639574528, -0.029236294329166412, 0.032166093587875366, 0.011354709975421429, 0.027608728036284447, 0.027450598776340485, 0.006778908893465996, -0.014734575524926186, 0.019672296941280365, 0.028677769005298615, 0.03618888556957245, 0.020607031881809235, -0.06284493207931519, 0.04941926151514053, -0.028233934193849564, -0.03425870090723038, -0.04944048449397087, 0.04428716003894806, 0.03580893948674202, -0.0005688267992809415, -0.0008448659791611135, -0.05112607404589653, -0.03799143433570862, -0.026067623868584633, -0.010265621356666088, 0.018656844273209572, 0.005138810258358717, 0.0009323073900304735, -0.002394256182014942, -0.040857646614313126, 0.04204927757382393, 0.04158477112650871, -0.014656422659754753, 0.020791154354810715, -0.0015750415623188019, -0.00901332963258028, 0.004311871249228716, -0.019868498668074608, -0.027277907356619835, 0.0007751616649329662, 0.05824223905801773, -0.07263772189617157, -0.025304971262812614, -0.014394247904419899, 0.01933709904551506, 0.03974849358201027, -0.000020474517441471107, -0.014032440260052681, -0.02530531771481037, 0.023443147540092468, 0.0709139034152031, 0.026157960295677185, -0.03385360911488533, 0.022207168862223625, 0.04166683554649353, -0.009117933921515942, -0.022589581087231636, -0.004182023461908102, 0.05791972950100899, -0.012055106461048126, -0.037490177899599075, 0.0670732706785202, -0.03524864464998245, 0.014974205754697323, -0.005917504895478487, 0.014211847446858883, -0.0293587613850832, 0.02714518830180168, -0.011737321503460407, 0.022053923457860947, 0.0525924414396286, 0.05043894425034523, -0.05591809004545212, -0.038529641926288605, 0.0014588373014703393, -0.0031295232474803925, -0.012882787734270096, 0.0018346441211178899, 0.01618099771440029, -0.03929422050714493, 0.03933951258659363, 0.03340606763958931, 0.018115822225809097, 0.005006664898246527, 0.032125797122716904, -0.022851290181279182, -0.028873318806290627, -0.020412921905517578, -0.0032605223823338747, -0.01803179457783699, 0.005879617296159267, 0.036674924194812775, 0.008545977994799614, -0.01902981847524643, -0.02143937535583973, -0.02044776640832424, 0.01711241900920868, 0.028439180925488472, -0.01454075425863266, -0.015574127435684204, -0.010678870603442192, 0.03838786482810974, 0.020502958446741104, -0.029837360605597496, 0.01944214105606079, -0.02973710000514984, 0.02133050747215748, 0.03622452914714813, -0.011750026606023312, -0.02828642725944519, -0.04764879494905472, 0.040385425090789795, -0.034733548760414124, 0.0015802689595147967, 0.0020636064000427723, -0.004949457477778196, 0.019484471529722214, -0.006476955488324165, 0.04046481102705002, 0.020037924870848656, 0.06325903534889221, 0.005103475414216518, -0.05078044906258583, 0.00352997868321836, -0.011461715213954449, 0.000302554719382897, -0.0030329024884849787, 0.03543570265173912, -0.011109510436654091, 0.01965128444135189, 0.028684183955192566, -0.061444755643606186, -0.0012000862043350935, 0.02037467435002327, 0.009131776168942451, -0.06246888265013695, 0.045218102633953094, 0.046475958079099655, -0.009192056953907013, -0.023325776681303978, -0.02960367500782013, 0.03435217961668968, 0.08032706379890442, 0.000946004583965987, 0.019105087965726852, 0.0007841272745281458, 0.023008229210972786, 0.011484025046229362, -0.014490814879536629, 0.018719075247645378, 0.015499047935009003, 0.03622971847653389, -0.003841889789327979, -0.00754766957834363, -0.04404560104012489, 0.0459444634616375, 0.009177959524095058, -0.013528632000088692, 0.015882721170783043, -0.07206005603075027, 0.017885353416204453, -0.010575944557785988, -0.03629627823829651, -0.02046062983572483, 0.0011014529736712575, -0.031373344361782074, 0.054323550313711166, 0.019567124545574188, 0.01964447647333145, 0.0063647981733083725, -0.011735883541405201, 0.024074900895357132, 0.02407928928732872, -0.003159492975100875, 0.017135603353381157, -0.006842824164777994, -0.003846024861559272, -0.011871393769979477, -0.008939886465668678, 0.04238732531666756, 0.0189924705773592, 0.03247961774468422, 0.017854124307632446, -0.0212502833455801, -0.009384951554238796, -0.01503156777471304, 0.005225788801908493, -0.0008285045623779297, -0.02968588098883629, 0.026729848235845566, -0.027214812114834785, -0.02641216292977333, 0.03442368656396866, 0.0359579473733902, -0.011742696166038513, -0.014783864840865135, 0.005002281162887812, 0.017157865688204765, 0.01083395816385746, -0.034775689244270325, 0.034011758863925934, -0.045180290937423706, 0.010125423781573772, -0.045190438628196716, 0.009127073921263218, -0.020483730360865593, -0.011470391415059566, -0.014242405071854591, -0.03340332210063934, 0.016322728246450424, 0.012554522603750229, 0.06612032651901245, 0.0019840060267597437, -0.014534170739352703, 0.011396181769669056, 0.029085177928209305, -0.0069877891801297665, -0.04904361441731453, 0.01298579666763544, -0.00918072834610939, -0.02243073843419552, 0.025408515706658363, 0.03711486607789993, 0.03239273652434349, 0.016467085108160973, 0.018598396331071854, 0.0327812135219574, -0.021138083189725876, 0.026372401043772697, 0.03667786344885826, -0.00008140047430060804, -0.02629704959690571, -0.004956752061843872, -0.03201821446418762, 0.01642640493810177, 0.014784402213990688, -0.007027665618807077, 0.014086933806538582, 0.04943958297371864, -0.029231922701001167, 0.02973405085504055, -0.008962009102106094, 0.05829917639493942, -0.008294782601296902, -0.02566090039908886, -0.0020550277549773455, 0.017806323245167732, 0.007393768522888422, 0.007808397524058819, -0.018004950135946274, 0.007166029419749975, 0.02146480418741703, 0.008343728259205818, -0.03803900256752968, 0.03709689527750015, 0.03792005404829979, -0.04462066665291786, -0.0026335283182561398, -0.0008395866025239229, -0.039891939610242844, 0.002508694538846612, -0.03338239714503288, -0.020688215270638466, 0.04407093673944473, 0.010017543099820614, 0.024055898189544678, -0.03479556739330292, -0.015302046202123165, -0.02695879526436329, 0.056971028447151184, -0.004470744635909796, 0.039404164999723434, 0.022309521213173866, -0.0027115046977996826, 0.04094916954636574, 0.02937418781220913, -0.005897138733416796, 0.022862810641527176, 0.049725160002708435, -0.018471278250217438, 0.017850767821073532, 0.0014698999002575874, -0.031215837225317955, 0.036747828125953674, -0.06102259084582329, -0.04045233502984047, -0.05482133850455284, 0.009830267168581486, 0.04885535687208176, -0.01518099382519722, 0.0365070141851902, -0.0263140220195055, 0.050831861793994904, 0.019483499228954315, 0.04442427679896355, 0.01802072487771511, 0.00012366178270895034, -0.009517778642475605, 0.03003491833806038, -0.03127538785338402, 0.035152748227119446, -0.03779268264770508, 0.021631592884659767, 0.03543434664607048, -0.018336692824959755, 0.022694893181324005, -0.008689467795193195, -0.00009974658314604312, 0.04526625573635101, -0.0010972833260893822, -0.02734074555337429, -0.014625826850533485, 0.05076657980680466, -0.02517666481435299, 0.009209434501826763, -0.0035386395175009966, -0.045741643756628036, 0.017430000007152557, -0.02042960189282894, -0.011083349585533142, -0.008827487006783485, 0.006999386474490166, -0.04307422414422035, 0.019300296902656555, -0.0409671775996685, -0.008950335904955864, 0.006080956663936377, -0.003785902401432395, -0.01703859120607376, 0.025760425254702568, -0.028413206338882446, -0.011598104611039162, -0.006428004242479801, 0.029465554282069206, -0.00658351881429553, -0.031546223908662796, -0.011993899941444397, -0.006493964698165655, -0.012433788739144802, -0.005194738041609526, -0.040261659771203995, 0.009039761498570442, 0.02263052389025688, -0.002161922864615917, -0.024647610262036324, -0.020790042355656624, 0.006903977133333683, -0.0034784292802214622, 0.03622246906161308, 0.008373505435883999, -0.04893398657441139, 0.006538009736686945, 0.04215553030371666, -0.02207483910024166, 0.0002621069143060595, -0.008846094831824303, -0.062034972012043, -0.02763254940509796, -0.012891647405922413, -0.03223691135644913, -0.04199372977018356, 0.06783004850149155, 0.012651064433157444, -0.0035612492356449366, 0.004174374043941498, -0.01604381948709488, -0.01076130848377943, 0.005058890674263239, 0.050546590238809586, -0.023970281705260277, 0.004217381589114666, -0.013916363939642906, 0.04734331741929054, -0.00867406465113163, -0.00012280326336622238, 0.0614030584692955, -0.02203458361327648, -0.006573646795004606, -0.026023218408226967, -0.01683383248746395, -0.022718509659171104, 0.007396352477371693, 0.002382925245910883, -0.017437972128391266, 0.022083217278122902, 0.02308971993625164, 0.01172636542469263, -0.007790971081703901, -0.0452955923974514, 0.00020603707525879145, -0.002801277907565236, -0.033990439027547836, -0.03781544417142868, -0.036075565963983536, 0.046493593603372574, 0.05826100334525108, 0.016588816419243813, -0.0009088931838050485, -0.023449013009667397, 0.0049779475666582584, -0.021604707464575768, -0.02506392076611519, 0.04142221435904503, -0.0038924396503716707, -0.010678953491151333, -0.026263393461704254, 0.004782858770340681, -0.015113101340830326, 0.00877541396766901, 0.0035817278549075127, -0.004830460995435715, -0.03180643916130066, -0.04889780655503273, -0.0323144793510437, -0.012575574219226837, 0.01605081371963024, 0.06886088103055954, -0.020858533680438995, -0.003579388838261366, 0.020423416048288345, -0.0065107326954603195, -0.01850322261452675, 0.023799708113074303, 0.002249103505164385, -0.02387210540473461, -0.019866066053509712, 0.007069522049278021, 0.04925594851374626, -0.006462681572884321, 0.0238278079777956, -0.012082070112228394, 0.007225118111819029, -0.01478109136223793, -0.04530679062008858, -0.013083458878099918, 0.043310873210430145, -0.03962652385234833, -0.043440040200948715, 0.010954177938401699, 0.023342370986938477, 0.01773066818714142, -0.018311170861124992, 0.026069430634379387, 0.000045686170778935775, -0.005950658116489649, 0.012394433841109276, 0.004190237261354923, 0.02558308281004429, -0.005540851037949324, -0.025815485045313835, 0.043227534741163254, 0.016939252614974976 ]
The N Implementation Details of RLHF with PPO
vwxyzjn
October 24, 2023
the_n_implementation_details_of_rlhf_with_ppo
research, rl, rlhf
https://huggingface.co/blog/the_n_implementation_details_of_rlhf_with_ppo
pytorch adam implementation: bias_correction1 = 1 - beta1 ** step bias_correction2 = 1 - beta2 ** step step_size = lr / bias_correction1 bias_correction2_sqrt = _dispatch_sqrt(bias_correction2) denom = (exp_avg_sq.sqrt() / bias_correction2_sqrt).add_(eps) param.addcdiv_(exp_avg, denom, value=-step_size)
[ 0.008191918954253197, -0.0008736946037970483, 0.005309595260769129, 0.013132579624652863, 0.017407067120075226, 0.04277271777391434, 0.06034305691719055, -0.05455629527568817, -0.006224350072443485, -0.08658464252948761, -0.058510929346084595, -0.0015204239170998335, -0.015276758931577206, -0.0000987101811915636, -0.03960895538330078, 0.039495594799518585, 0.031598880887031555, -0.052119914442300797, 0.03756825998425484, 0.01688455231487751, 0.01616920344531536, -0.029767148196697235, 0.036576610058546066, 0.006898141000419855, 0.000799589091911912, -0.07218887656927109, -0.015667472034692764, -0.002592782024294138, -0.02298632822930813, 0.0780176892876625, -0.020537452772259712, 0.003766479901969433, -0.025927456095814705, -0.05508339777588844, 0.046153198927640915, 0.04277169704437256, -0.08926142007112503, 0.025610879063606262, 0.04441281780600548, -0.0645238384604454, 0.015299749560654163, -0.0049379547126591206, -0.09110437333583832, 0.019635213539004326, -0.01518296916037798, -0.07960119843482971, -0.10162658989429474, 0.008883976377546787, -0.02850867249071598, -0.017119422554969788, -0.028937887400388718, 0.03091723844408989, -0.09552434831857681, 0.00496827345341444, -0.03370923176407814, 0.02139967679977417, 0.0007292463560588658, 0.035435549914836884, 0.03270823135972023, -0.029509447515010834, 0.009121007286012173, 0.030455902218818665, 0.023480093106627464, 0.04757098853588104, 0.09343411028385162, 0.0018311550375074148, -0.0068597812205553055, 0.03406042233109474, -0.07747874408960342, 0.025391623377799988, 0.031084243208169937, -0.01697612553834915, -0.021340206265449524, -0.02380264364182949, -0.04056069999933243, -0.09936641156673431, 0.03245703876018524, -0.048404619097709656, 0.03896865248680115, 0.02114797569811344, 0.012976514175534248, -0.04045674949884415, 0.07663049548864365, 0.03180728480219841, 0.009679769165813923, 0.09352037310600281, -0.062287211418151855, 0.007078190799802542, 0.038032326847314835, 0.0784507691860199, -0.07522235810756683, -0.01054209005087614, -0.0030098368879407644, -0.03759320080280304, 0.03313774988055229, -0.006652297917753458, -0.024463454261422157, -0.04156426712870598, -0.008032628335058689, 0.023335155099630356, 0.03449154272675514, -0.03227873891592026, 0.006522827781736851, -0.01642942801117897, 0.025568315759301186, 0.07206092774868011, -0.04715121537446976, -0.13117453455924988, -0.11419486999511719, 0.04204930365085602, -0.04526839777827263, 0.09474927932024002, 0.04779689386487007, 0.08692608028650284, -0.10851630568504333, -0.035512570291757584, -0.0428471639752388, 0.03819238021969795, -0.028545355424284935, -0.0343133807182312, -0.05820059776306152, 0.1407468318939209, 0.06585314869880676, 0.0504051111638546, -0.03888489678502083, 0.05110175907611847, 0.058435969054698944, 0.022006962448358536, -0.01861863024532795, -0.01272966805845499, 0.010032753460109234, -0.01468089409172535, 0.027048975229263306, -0.06246991083025932, -0.01788594387471676, -0.1228795126080513, 0.032442301511764526, -0.01437397487461567, -0.053239163011312485, 0.02136540226638317, -0.022765222936868668, 0.03864226117730141, -0.021385280415415764, 0.024579446762800217, -0.0008467912557534873, -0.03207660838961601, -0.05429123342037201, 0.07718884199857712, 0.004663629923015833, 0.023030197247862816, -0.04082529619336128, 0.019651716575026512, 0.0016716879326850176, -0.08306299895048141, -0.015411722473800182, 0.03394025191664696, -0.0207879189401865, -0.028071211650967598, -0.07924681901931763, -0.0009359767427667975, 0.05466355383396149, -0.009119312278926373, -0.07341962307691574, -0.035812947899103165, 0.022996511310338974, 0.022660518065094948, 0.03052152693271637, -0.011508706025779247, -0.04786314070224762, -0.03794684633612633, -0.014437875710427761, -0.0299087967723608, 0.015986522659659386, 0.020119518041610718, -0.013974925503134727, -0.004074361640959978, -0.03007834032177925, 0.09078767895698547, -0.04031757265329361, 0.02138369157910347, -0.000782534945756197, 0.04163017123937607, -0.0007544066174887121, -0.012530948966741562, -0.006651456002146006, -0.10535956919193268, 0.04003795608878136, -0.048023346811532974, 0.06994368880987167, 0.011765215545892715, -0.04330655187368393, 0.03758733347058296, 0.059975773096084595, -0.03567236289381981, 0.06962980329990387, -0.09401824325323105, -0.011410933919250965, -0.012183639220893383, 0.028906425461173058, 0.0021712901070713997, 0.0017420781077817082, -0.049028925597667694, 0.0791509672999382, 0.022181974723935127, 0.06401662528514862, 0.04466035217046738, 0.03186769038438797, -0.051982536911964417, 0.07814957201480865, 0.023791953921318054, -0.0064832186326384544, -0.06912755966186523, -0.0025092223659157753, -0.047351643443107605, -0.05367868393659592, 0.05758700519800186, 0.026739081367850304, -0.008438360877335072, 0.02678009867668152, 0.05097349360585213, 0.1037895455956459, -0.017290377989411354, -0.04759201779961586, -0.045183755457401276, -0.0562283918261528, 0.02717231586575508, 0.07792280614376068, 0.03169751539826393, 0.024522511288523674, -0.07370360195636749, -0.029640715569257736, -0.03889354318380356, -0.008041556924581528, 0.09987747669219971, 0.05844629928469658, -0.03895806148648262, -0.027099348604679108, 0.004875408951193094, 0.03662325069308281, -0.06527207791805267, 0.05939902737736702, 0.06753767281770706, -0.061750609427690506, 0.0035044148098677397, 0.02642063982784748, -0.0412927009165287, 0.061702243983745575, 0.025310931727290154, 0.012305144220590591, 0.07978846877813339, 0.0027842908166348934, 0.0007288007764145732, 0.07620486617088318, -0.05693865939974785, 0.002678647870197892, 0.05065179988741875, -0.004554667044430971, -0.045617666095495224, -0.024044768884778023, 0.029121095314621925, 0.04461973160505295, 0.03388078883290291, -0.04280643165111542, -0.02615625225007534, -0.0240153931081295, -0.02670837938785553, 0.029353130608797073, 0.04002036899328232, -0.01883985474705696, 0.01085642259567976, 0.032569464296102524, -0.03294087201356888, 0.04032972455024719, 0.0026543212588876486, 0.01984948292374611, -0.034728191792964935, 0.0731155052781105, -0.002858975436538458, -0.02532196417450905, -0.05957313999533653, 0.008501103147864342, -0.015653980895876884, 0.03952917456626892, 0.038689061999320984, 0.01421148981899023, -0.0063412729650735855, -0.017820851877331734, 0.01710141822695732, 0.010496143251657486, 0.015988647937774658, 0.0030160285532474518, 0.023431481793522835, 0.04538096860051155, -0.0033924239687621593, -0.012597511522471905, 0.05181485414505005, -0.03374987840652466, -0.03753413259983063, -0.014210148714482784, -0.01861775852739811, -0.005077050998806953, 0.010524424724280834, 0.04082231596112251, 0.005326176527887583, -0.007960102520883083, -0.0024586294312030077, 0.01811816729605198, 0.04474790766835213, -0.08590342849493027, 0.0010395010467618704, 0.015565292909741402, 0.0414607897400856, 0.004313583020120859, -0.012840785086154938, 0.02241145446896553, -0.005108670797199011, -0.016970118507742882, -0.0017645624466240406, -0.03023993968963623, -0.004117680247873068, -0.015763532370328903, 0.02317957766354084, 0.04845575615763664, -0.02092784270644188, -0.011315525509417057, 0.02530192956328392, 0.008524911478161812, -0.0205870158970356, -0.01620013453066349, 0.03152316063642502, 0.005710580386221409, -0.009340846911072731, -0.024521654471755028, 0.014306220225989819, 0.024145204573869705, 0.005009513348340988, 0.019309915602207184, -0.03374210000038147, 0.015225288458168507, -0.029518576338887215, -0.02128755673766136, -0.00475248834118247, -0.007621646858751774, -0.009234691970050335, -0.02249784953892231, -0.007220125757157803, -0.004111168906092644, 0.022876814007759094, 0.0057355063036084175, 0.019692571833729744, 0.024374017491936684, -0.012292318046092987, 0.012366189621388912, -0.01596934162080288, -0.04343422129750252, 0.025252968072891235, 0.023878244683146477, -0.023592103272676468, 0.0046959538012743, -0.012604043819010258, 0.012024047784507275, 0.03337642550468445, -0.021047383546829224, -0.028510453179478645, -0.011240844614803791, 0.0796470046043396, 0.08536514639854431, 0.06282192468643188, -0.01965690590441227, 0.015129399485886097, 0.006197731010615826, -0.04829254001379013, 0.031375572085380554, 0.025184769183397293, 0.043255824595689774, -0.0006366251618601382, -0.025711186230182648, 0.049845822155475616, -0.044990722090005875, 0.015247522853314877, -0.008293586783111095, 0.01369023323059082, -0.032136220484972, 0.02850736863911152, -0.022768553346395493, 0.010731019079685211, 0.0303124338388443, 0.0086661446839571, 0.014974875375628471, -0.0002709076798055321, 0.02358315698802471, -0.031017381697893143, 0.018115414306521416, 0.01705208048224449, -0.017810344696044922, -0.05446561425924301, 0.04771072790026665, 0.0378318689763546, -0.01831185445189476, -0.006616238504648209, -0.00211592810228467, 0.025466328486800194, -0.027104459702968597, 0.005563631188124418, 0.011639617383480072, 0.009102702140808105, 0.008315457962453365, 0.014461582526564598, -0.02404693327844143, -0.032193657010793686, -0.0036677683237940073, -0.004698300268501043, -0.017998162657022476, 0.029677169397473335, 0.02811300754547119, 0.006357299629598856, 0.0228855162858963, -0.014931696467101574, -0.0059740664437413216, -0.039569560438394547, 0.011558867990970612, -0.015567815862596035, 0.04991018772125244, 0.06728547811508179, -0.03695332631468773, -0.013818226754665375, 0.011706030927598476, 0.020622089505195618, -0.041828323155641556, 0.012766392901539803, -0.008492435328662395, -0.050698425620794296, 0.01997903734445572, 0.0064598917961120605, 0.011129690334200859, 0.03406257927417755, 0.004674749914556742, -0.06376724690198898, -0.05026771128177643, -0.01834471896290779, -0.0011192131787538528, 0.007658352144062519, 0.025187449529767036, -0.001398452091962099, -0.0190291590988636, 0.040062930434942245, 0.02192341536283493, -0.05515478551387787, -0.02430534176528454, 0.02466430887579918, 0.03476288542151451, -0.044186800718307495, 0.004752747714519501, 0.023195669054985046, -0.055521056056022644, -0.048152003437280655, -0.02072669193148613, 0.017933472990989685, 0.022279895842075348, -0.007311180233955383, -0.019780438393354416, -0.03012491762638092, 0.02628466859459877, 0.005040816497057676, 0.001590604311786592, -0.008878215216100216, -0.02471977472305298, 0.033830419182777405, -0.01834951713681221, -0.04763595014810562, -0.059835877269506454, 0.008842159062623978, 0.012493420392274857, -0.0026240821462124586, -0.014748726040124893, -0.015816325321793556, -0.013387836515903473, -0.002937436569482088, -0.047728050500154495, -0.004887986928224564, 0.01676211692392826, -0.0688055083155632, 0.05120410397648811, 0.03281019628047943, -0.004285501781851053, -0.018308226019144058, 0.023862218484282494, -0.0384221225976944, -0.019639281556010246, -0.016068223863840103, 0.02559538744390011, 0.03242082521319389, -0.003959380555897951, 0.03679685667157173, -0.014058743603527546, 0.0011636605486273766, -0.01241906639188528, 0.02759879268705845, 0.029123572632670403, 0.03384251892566681, 0.02259054034948349, -0.0250184815376997, 0.031224720180034637, 0.00478370999917388, -0.05698682367801666, 0.013328200206160545, -0.012279331684112549, -0.040678124874830246, 0.0093464907258749, 0.0027652375865727663, 0.05155322700738907, -0.0017290604300796986, 0.017260991036891937, 0.006961492355912924, -0.014923611655831337, 0.014546609483659267, 0.002606377238407731, -0.028255950659513474, -0.01977979950606823, -0.02767082303762436, -0.017177047207951546, -0.011417852714657784, 0.021929526701569557, 0.008380119688808918, 0.003632291918620467, -0.008729211986064911, -0.02267962321639061, 0.03294479474425316, -0.01545844879001379, -0.01335728820413351, -0.037746861577034, 0.008932786993682384, 0.024104923009872437, -0.03204704076051712, 0.01936434954404831, 0.037763580679893494, -0.0010476254392415285, 0.020860251039266586, 0.005495479330420494, 0.020675230771303177, -0.002227527555078268, 0.010470064356923103, 0.007701376918703318, -0.01695343665778637, -0.030234551057219505, 0.06213194504380226, 0.027627751231193542, 0.0047963764518499374, -0.009526096284389496, 0.005044954363256693, -0.017210179939866066, 0.010960380546748638, -0.011939281597733498, -0.01995275728404522, 0.04911453649401665, 0.008061151020228863, 0.06199179217219353, -0.0013829151866957545, 0.02886916883289814, -0.0026611443608999252, 0.004731243476271629, 0.023603036999702454, 0.02367578260600567, 0.0772794559597969, -0.010213286615908146, -0.033205002546310425, 0.023279957473278046, 0.006559526547789574, 0.058169107884168625, -0.03555787354707718, -0.01693233661353588, 0.005315874237567186, -0.03442753478884697, 0.003314077388495207, -0.03270924836397171, -0.026777392253279686, 0.001842054771259427, -0.023791003972291946, 0.014545471407473087, 0.059473976492881775, 0.026999445632100105, 0.034981418401002884, 0.005899176932871342, 0.019473960623145103, -0.036185674369335175, 0.048441555351018906, 0.0018167527159675956, 0.0041194804944098, 0.0018848138861358166, 0.019172869622707367, 0.037451379001140594, 0.0060198032297194, -0.03153138607740402, 0.008756524883210659, 0.07950613647699356, 0.008407225832343102, 0.0037607483100146055, 0.025637300685048103, -0.008723841980099678, 0.0001173807613668032, -0.012786559760570526, -0.035385169088840485, -0.045240677893161774, 0.01711704395711422, 0.050758395344018936, -0.019732194021344185, 0.022640498355031013, -0.04641337692737579, 0.03332265093922615, -0.002336818492040038, 0.06287474185228348, 0.018492763862013817, -0.035316094756126404, 0.04078191518783569, 0.023058263584971428, -0.046424005180597305, 0.019266735762357712, -0.04527052864432335, 0.022091137245297432, 0.04754938930273056, -0.05923003330826759, -0.002565294736996293, -0.0013447899837046862, -0.063979871571064, 0.04967302083969116, -0.014212814159691334, -0.016906822100281715, -0.021324822679162025, 0.05257207527756691, 0.01823658123612404, 0.00776813505217433, 0.01392657496035099, -0.04689038544893265, 0.012849765829741955, 0.006995954550802708, 0.03298367187380791, -0.02763800136744976, 0.014251264743506908, 0.0026141193229705095, -0.011079174466431141, -0.011447511613368988, 0.043535247445106506, 0.002482462441548705, -0.03529883548617363, 0.01314364094287157, 0.02205495722591877, -0.031931400299072266, 0.007279264274984598, -0.04648655280470848, 0.001508162822574377, 0.0014724365901201963, 0.01696051098406315, -0.008597653359174728, 0.022073637694120407, 0.021097354590892792, -0.02664411999285221, -0.026877420023083687, 0.011902537196874619, 0.02772074192762375, -0.012991291470825672, -0.05284028500318527, -0.03578276187181473, -0.011692210100591183, 0.01890677399933338, 0.05339237302541733, 0.048408716917037964, 0.007274047937244177, 0.058304257690906525, 0.03133409470319748, 0.014756627380847931, 0.019116686657071114, -0.05043379217386246, -0.05481717362999916, -0.004273333586752415, -0.00759807787835598, 0.021595941856503487, -0.04314255341887474, 0.039912838488817215, -0.017596036195755005, -0.01565033383667469, -0.025302769616246223, 0.010405565612018108, 0.02173672616481781, -0.02601657621562481, 0.00004692410220741294, 0.0006179523770697415, -0.007109065540134907, -0.01598132960498333, 0.016882427036762238, -0.015522235073149204, -0.01987619511783123, 0.05877430737018585, -0.00791892595589161, 0.0456448495388031, 0.015734348446130753, -0.05785633996129036, 0.0026114780921489, 0.0347617007791996, -0.01799580827355385, -0.024423081427812576, 0.016500866040587425, 0.03415544331073761, 0.0036980651784688234, 0.017455805093050003, -0.016279440373182297, 0.0018944363109767437, 0.010549872182309628, -0.02351800724864006, -0.028461148962378502, -0.012772668153047562, 0.04365802928805351, 0.03275563567876816, 0.031636640429496765, 0.04135481268167496, -0.031158670783042908, 0.01574067771434784, -0.025316385552287102, -0.016895301640033722, 0.04954875633120537, 0.029865311458706856, -0.02935035526752472, -0.0073294807225465775, 0.04183122515678406, 0.032386261969804764, -0.018294736742973328, -0.04805176705121994, 0.0026588363107293844, -0.051428839564323425, -0.016317198053002357, -0.0035763438791036606, -0.009288779459893703, 0.019287554547190666, 0.04421340674161911, -0.0035462842788547277, 0.0039395056664943695, -0.05811360850930214, -0.024706125259399414, -0.013191690668463707, 0.04811742156744003, -0.009965003468096256, -0.036751117557287216, 0.01252130325883627, -0.02288643829524517, 0.04304598644375801, 0.004851111210882664, -0.005083825904875994, -0.06421817094087601, 0.0007453180733136833, -0.026507915928959846, -0.005486133974045515, -0.014139063656330109, 0.09016117453575134, -0.019777577370405197, -0.02106560952961445, -0.05789264664053917, -0.0147675396874547, 0.013785106129944324, -0.00019064531079493463, -0.015266455709934235, 0.005514186341315508, 0.008973926305770874, 0.010985201224684715, -0.0006639768835157156, 0.017392363399267197, 0.02113231271505356, 0.00734095461666584, -0.016651738435029984, 0.021994756534695625 ]
Deploy Embedding Models with Hugging Face Inference Endpoints
philschmid
October 24, 2023
inference-endpoints-embeddings
guide, llm, apps, inference
https://huggingface.co/blog/inference-endpoints-embeddings
2. What is Text Embeddings Inference? Text Embeddings Inference (TEI) is a purpose built solution for deploying and serving open source text embeddings models. TEI is build for high-performance extraction supporting the most popular models. TEI supports all top 10 models of the Massive Text Embedding Benchmark (MTEB) Leaderboard, including FlagEmbedding, Ember, GTE and E5. TEI currently implements the following performance optimizing features: - No model graph compilation step - Small docker images and fast boot times. Get ready for true serverless! - Token based dynamic batching - Optimized transformers code for inference usingย Flash Attention,ย Candleย andย cuBLASLt - Safetensorsย weight loading - Production ready (distributed tracing with Open Telemetry, Prometheus metrics) Those feature enabled industry-leading performance on throughput and cost. In a benchmark forย BAAI/bge-base-en-v1.5ย on an Nvidia A10G Inference Endpoint with a sequence length of 512 tokens and a batch size of 32, we achieved a throughput of 450+ req/sec resulting into a cost of 0.00156$ / 1M tokens or 0.00000156$ / 1k tokens. That is 64x cheaper than OpenAI Embeddings ($0.0001 / 1K tokens).
[ 0.008762732148170471, 0.01802779547870159, 0.028050197288393974, 0.01988215744495392, 0.028442680835723877, 0.05693085864186287, 0.022669827565550804, 0.06444966793060303, 0.0024563027545809746, -0.06136235594749451, -0.06368355453014374, 0.03220664709806442, 0.025486016646027565, 0.0325588621199131, -0.03277665004134178, -0.008303791284561157, 0.03036215901374817, -0.056179482489824295, -0.05891838297247887, -0.03965737298130989, 0.020587919279932976, -0.004794290289282799, 0.038692522794008255, 0.008828523568809032, -0.04221777245402336, 0.007082996889948845, 0.0013945522950962186, -0.008717958815395832, -0.04286278411746025, 0.020798170939087868, -0.045560095459222794, -0.01652684435248375, -0.04765178635716438, -0.01582697033882141, -0.02506687305867672, -0.00004957906639901921, -0.1238071620464325, 0.03182331100106239, -0.004352605901658535, 0.026587998494505882, 0.004684130661189556, -0.03402668982744217, -0.04483106732368469, -0.002991634886711836, 0.017605198547244072, -0.02156868763267994, -0.11541187763214111, 0.05740509554743767, -0.0385594479739666, 0.047811705619096756, -0.06881806254386902, 0.034497376531362534, -0.039188385009765625, 0.008639873005449772, 0.052085790783166885, -0.00562327541410923, 0.039891961961984634, -0.14683398604393005, 0.08451439440250397, -0.04638853296637535, 0.04003201425075531, 0.008023446425795555, 0.02933366969227791, 0.0060723996721208096, 0.02916792407631874, -0.020160086452960968, -0.04662761092185974, 0.011877018958330154, 0.02171197347342968, 0.007240689359605312, 0.04685965180397034, 0.03419295698404312, -0.030930066481232643, -0.025013772770762444, 0.02594253048300743, -0.004818303510546684, 0.010127482935786247, 0.06316287070512772, 0.027538634836673737, -0.03542596474289894, -0.05453949421644211, 0.031788039952516556, -0.03418811038136482, -0.0631902813911438, -0.023335041478276253, 0.07031358033418655, 0.02666383795440197, -0.01847832463681698, -0.08037135750055313, 0.04194246232509613, -0.009047739207744598, -0.13081899285316467, -0.04649617522954941, 0.0348379872739315, -0.03449226915836334, 0.047274358570575714, 0.026457402855157852, 0.03054431825876236, -0.007563232909888029, -0.006432767957448959, 0.027292754501104355, -0.04538525640964508, 0.021870503202080727, -0.06319103389978409, -0.08954732865095139, 0.06858702749013901, -0.025767294690012932, -0.05796649679541588, -0.017735939472913742, 0.0012093766126781702, -0.011168822646141052, -0.04441284015774727, 0.015115824528038502, 0.061374831944704056, -0.08889897167682648, 0.028123822063207626, -0.03858555480837822, 0.022969430312514305, -0.02058441936969757, 0.032305002212524414, 0.0008796410984359682, 0.06108470261096954, 0.08080326020717621, -0.04356178641319275, -0.029617009684443474, 0.08922848850488663, 0.041458550840616226, 0.050981536507606506, -0.03872523084282875, 0.03170241415500641, 0.06825673580169678, 0.0017531251069158316, 0.008585603907704353, -0.05954857915639877, -0.044077761471271515, -0.05251168832182884, -0.01412153709679842, -0.07208799570798874, -0.009698387235403061, -0.0062877340242266655, -0.10159154236316681, -0.016386715695261955, -0.017096148803830147, -0.05459916219115257, 0.050072215497493744, 0.01776445098221302, -0.0378725528717041, 0.01827782206237316, -0.000297083257464692, 0.01164095476269722, -0.1394665241241455, 0.05164216458797455, -0.024563919752836227, 0.03532709926366806, 0.02062736637890339, 0.03617997467517853, 0.04072800278663635, 0.006142705678939819, -0.04631510004401207, -0.005069561768323183, -0.019343676045536995, -0.12077599763870239, -0.01387865375727415, 0.014199295081198215, 0.02439977414906025, -0.027783680707216263, 0.027711328119039536, 0.02112247236073017, 0.022938771173357964, -0.0023040343075990677, 0.02685912884771824, -0.02094109356403351, 0.06081339716911316, 0.01636858657002449, 0.027044612914323807, 0.014210783876478672, -0.018687190487980843, 0.0555618554353714, 0.013074188493192196, 0.010942096821963787, -0.024788426235318184, 0.06040241941809654, 0.04461904987692833, 0.08031260222196579, -0.03393827751278877, -0.12058281153440475, 0.025129981338977814, -0.10002894699573517, 0.042616840451955795, -0.054262157529592514, -0.059596456587314606, -0.012693265452980995, 0.09185249358415604, -0.006796020083129406, -0.010560533031821251, -0.07252329587936401, 0.0016945968382060528, 0.0705474391579628, 0.03630566969513893, 0.03635866567492485, 0.002938985824584961, 0.04345596209168434, -0.01012409944087267, -0.05954553559422493, -0.04117230325937271, -0.04313907027244568, 0.03740910440683365, 0.030794387683272362, -0.0273943729698658, -0.03132101893424988, -0.04290447384119034, -0.06966879218816757, 0.027034549042582512, -0.007441287860274315, 0.008952971547842026, -0.09877090901136398, -0.010521347634494305, -0.005911864340305328, 0.023093612864613533, -0.043821174651384354, 0.13989955186843872, 0.006657834630459547, -0.00030788389267399907, -0.041468776762485504, -0.012048863805830479, -0.0030724862590432167, 0.05673269182443619, -0.048942554742097855, 0.056858740746974945, -0.012282534502446651, 0.01568865031003952, 0.01966913230717182, 0.011282192543148994, 0.03124455362558365, 0.01588652841746807, 0.0013437297893688083, 0.007875227369368076, -0.0027470486238598824, 0.08986496925354004, -0.0265313982963562, 0.07626906037330627, 0.03451079502701759, 0.015754923224449158, 0.007711282931268215, 0.04900067672133446, -0.0316733755171299, 0.01661713607609272, 0.01824791543185711, -0.052547309547662735, -0.060072001069784164, -0.03090672753751278, 0.001653600949794054, -0.034198418259620667, -0.0444951094686985, 0.03171105682849884, -0.03515909984707832, -0.03423686698079109, -0.025917107239365578, 0.018847931176424026, 0.023801283910870552, -0.014982003718614578, -0.03401836380362511, 0.0211186446249485, -0.010625812225043774, 0.01772760972380638, -0.022448286414146423, -0.05345411226153374, 0.025142578408122063, -0.0442911833524704, 0.011221951805055141, 0.0015859865816310048, 0.018485698848962784, -0.023317856714129448, -0.030269846320152283, 0.007940778508782387, 0.022548770532011986, 0.025295153260231018, -0.022320810705423355, -0.015645114704966545, -0.014054089784622192, -0.006156435236334801, -0.022821050137281418, 0.003111387835815549, 0.057797547429800034, 0.011869018897414207, 0.011599675752222538, -0.011528163217008114, -0.004381067119538784, -0.004543637856841087, 0.03525495529174805, -0.00949014164507389, -0.016726519912481308, -0.0038950869347900152, -0.002088528126478195, 0.021241948008537292, 0.046669747680425644, -0.014706338755786419, -0.025000084191560745, -0.03485759720206261, -0.016352558508515358, 0.0033043150324374437, -0.0050467331893742085, -0.015996277332305908, 0.03458854928612709, -0.036701470613479614, 0.061207666993141174, -0.051223285496234894, 0.04989056661725044, -0.08236458152532578, -0.022820569574832916, 0.018382517620921135, 0.004739381838589907, -0.01486010942608118, 0.020197518169879913, 0.04350318759679794, -0.0328102745115757, 0.0360889658331871, 0.010638291947543621, 0.052952930331230164, 0.006505374331027269, 0.0475536584854126, -0.02856142818927765, 0.02686113491654396, -0.02874058112502098, 0.016523897647857666, -0.023105090484023094, 0.03803599998354912, -0.03670710697770119, -0.02980327233672142, 0.021615775302052498, -0.005923872347921133, 0.0201517753303051, -0.003045168239623308, 0.007046415936201811, 0.03356559947133064, -0.001847907085902989, 0.047883763909339905, -0.027705755084753036, 0.013458345085382462, 0.008063995279371738, -0.02748633362352848, 0.03026513196527958, -0.04209427908062935, 0.03879997134208679, -0.016751782968640327, -0.001533804344944656, -0.0010871669510379434, 0.003554787253960967, 0.03094577044248581, -0.029316162690520287, 0.0060260300524532795, -0.0445382222533226, 0.052029021084308624, -0.020018210634589195, 0.05109894275665283, 0.042384903877973557, 0.03219681233167648, -0.017898909747600555, 0.008489752188324928, -0.024770911782979965, 0.0043710460886359215, 0.05605538561940193, 0.02393230050802231, 0.033972736448049545, -0.029570335522294044, 0.0064881895668804646, 0.02161256968975067, 0.03890194743871689, -0.0501188188791275, 0.046930912882089615, -0.04141382500529289, -0.016274400055408478, -0.017486564815044403, 0.0403565987944603, 0.015396523289382458, 0.011275287717580795, -0.0029069867450743914, 0.020037036389112473, 0.0008383848471567035, 0.07818535715341568, 0.0033097881823778152, -0.005569668021053076, -0.019574573263525963, -0.016190167516469955, -0.02018655836582184, -0.0360112302005291, 0.004985162988305092, 0.021320274099707603, 0.008114702999591827, -0.02865963615477085, -0.015916425734758377, -0.00456673139706254, 0.05533122271299362, -0.015970198437571526, -0.03243647888302803, -0.05962227284908295, 0.042359597980976105, 0.00990314967930317, 0.028477458283305168, 0.020205238834023476, 0.003936238121241331, 0.051751039922237396, 0.0019398679723963141, 0.0051811267621815205, 0.02652847021818161, 0.026624329388141632, 0.025384502485394478, -0.013421579264104366, 0.04237198084592819, -0.02497563511133194, 0.037470392882823944, 0.03411944955587387, -0.04864416643977165, 0.016644533723592758, 0.016567248851060867, 0.04344455152750015, 0.05277154594659805, 0.025053242221474648, 0.01922527141869068, 0.006867591291666031, -0.04764296114444733, 0.03643745929002762, -0.01733674667775631, 0.045578230172395706, -0.02264162339270115, -0.0014723112108185887, -0.010231269523501396, 0.014985712245106697, 0.03464565798640251, -0.00332324649207294, 0.019167160615324974, -0.037308551371097565, 0.02505330741405487, 0.019747590646147728, 0.011703160591423512, -0.02092120610177517, 0.007578728720545769, -0.022697078064084053, -0.051527634263038635, -0.011617723852396011, 0.06169246509671211, 0.03249537572264671, 0.033112481236457825, -0.013116196729242802, -0.026481008157134056, -0.03434902802109718, 0.007348943036049604, 0.0018389326287433505, -0.014128427952528, 0.00006727473373757675, -0.006831162143498659, -0.025761613622307777, 0.02661987580358982, 0.025795085355639458, -0.026463959366083145, 0.009881784208118916, -0.04476206377148628, 0.025896860286593437, 0.03558744117617607, -0.034082408994436264, 0.0343339741230011, 0.009736331179738045, 0.05539825186133385, 0.007301348261535168, 0.0038260756991803646, -0.035315290093421936, 0.034294500946998596, 0.03126224875450134, 0.034918323159217834, 0.043032456189394, -0.013393725268542767, 0.0030234260484576225, 0.029363567009568214, -0.02718108333647251, 0.05233544856309891, 0.013847394846379757, -0.03865326941013336, -0.011801873333752155, -0.029169190675020218, 0.025540798902511597, -0.006100212689489126, 0.0209629088640213, 0.007115765940397978, 0.01684342324733734, -0.015666238963603973, 0.014054790139198303, 0.014414823614060879, 0.012893103994429111, -0.025100622326135635, -0.048151567578315735, 0.04331808164715767, -0.0019571329466998577, -0.03012089617550373, 0.04384588450193405, 0.05314619839191437, 0.05304180458188057, -0.01575630158185959, 0.016332633793354034, 0.026865193620324135, -0.01971748098731041, 0.07181137055158615, -0.028251778334379196, 0.008443047292530537, -0.03963235020637512, 0.01996915228664875, 0.02793058566749096, 0.009073890745639801, -0.0032006099354475737, 0.0058616758324205875, 0.06058412790298462, -0.06820503622293472, -0.0015312646282836795, 0.02981768548488617, 0.001517059514299035, -0.0029415995813906193, -0.04296158254146576, 0.030332054942846298, -0.005966727621853352, -0.009942656382918358, -0.04615132883191109, -0.011506715789437294, 0.06348540633916855, -0.0002222832408733666, -0.04288609325885773, 0.006837818305939436, -0.01124405674636364, 0.00025847245706245303, 0.05616777017712593, -0.03531445562839508, -0.052104659378528595, -0.01633155159652233, -0.02532787248492241, 0.038739610463380814, -0.03971464931964874, -0.01775754615664482, -0.018838439136743546, -0.03474414721131325, -0.0010512596927583218, -0.00203148415312171, 0.003767167218029499, -0.04296804964542389, 0.05400921404361725, 0.022798465564846992, 0.07185641676187515, 0.0023644152097404003, 0.02091258019208908, 0.07698656618595123, -0.0020037589129060507, -0.017605716362595558, -0.05540446192026138, -0.04482569172978401, 0.010725638829171658, -0.02955480106174946, 0.02750171720981598, 0.037283606827259064, -0.0467742383480072, -0.05191337689757347, 0.02844514511525631, 0.040273383259773254, -0.02053772658109665, -0.02836674079298973, 0.01730962097644806, 0.0045129419304430485, -0.004448477178812027, 0.056911878287792206, -0.00005425533527159132, -0.024592671543359756, 0.02355332486331463, 0.0049233329482376575, -0.0087343230843544, 0.029715225100517273, 0.03228440880775452, -0.056328896433115005, -0.009429629892110825, 0.005188866052776575, -0.03854527696967125, 0.04686381667852402, 0.01794380135834217, -0.01288951188325882, -0.025444520637392998, 0.004088657442480326, 0.004305640701204538, -0.007527390494942665, 0.03778109326958656, 0.018654145300388336, 0.07226813584566116, -0.022080935537815094, 0.008573086932301521, 0.037783630192279816, 0.06978757679462433, 0.0477307066321373, -0.02018927037715912, -0.014209960587322712, 0.01240517571568489, 0.07315632700920105, 0.0012444969033822417, 0.029066771268844604, -0.02892223559319973, -0.02227243036031723, -0.006078513339161873, 0.028800304979085922, -0.003451091470196843, -0.050176553428173065, 0.026503300294280052, -0.0038909451104700565, -0.0005967847537249327, 0.01618926227092743, -0.01165165938436985, 0.022952472791075706, -0.007235566154122353, 0.03107813559472561, 0.0038988988380879164, -0.014506322331726551, 0.0018799140816554427, 0.01623796857893467, -0.0007887877873145044, 0.01793587952852249, 0.06408284604549408, -0.022319596260786057, 0.020048070698976517, -0.005275731906294823, 0.041126079857349396, 0.02233188785612583, -0.008146030828356743, -0.030895330011844635, 0.004990831948816776, -0.015538176521658897, -0.010340757668018341, -0.0020527944434434175, 0.0026290365494787693, 0.013502559624612331, 0.003874923102557659, -0.027595356106758118, -0.01059696264564991, 0.04172214865684509, 0.008057508617639542, 0.013491339981555939, -0.0015202219365164638, 0.01720043644309044, 0.01856687292456627, 0.020013969391584396, -0.016657663509249687, -0.023670295253396034, -0.017225777730345726, 0.01708524115383625, 0.03975526988506317, -0.017558839172124863, -0.03155606985092163, -0.025288335978984833, 0.011828256770968437, 0.0044091022573411465, -0.01162799447774887, 0.0018220823258161545, -0.01944238319993019, -0.022793864831328392, 0.034054286777973175, 0.01772633008658886, -0.0005262093036435544, 0.001491805538535118, -0.015874642878770828, -0.0023207140620797873, -0.029640480875968933, -0.015603587031364441, -0.061653561890125275, -0.03956083208322525, 0.021365046501159668, -0.012692227959632874, -0.025477351620793343, -0.0004768952785525471, 0.05983544886112213, 0.0787561684846878, -0.038523219525814056, -0.04709750786423683, 0.0618000403046608, 0.0074325609020888805, -0.018757538869976997, 0.053521253168582916, 0.001323180040344596, -0.026470299810171127, -0.04065228998661041, -0.0066871028393507, 0.00838204100728035, -0.004706938751041889, -0.01040138490498066, 0.04837217926979065, -0.044840067625045776, -0.03942062333226204, -0.05534008517861366, 0.04816748946905136, 0.042729105800390244, 0.07878542691469193, 0.03877468407154083, 0.0045876409858465195, -0.042327094823122025, 0.01215160172432661, -0.02753756381571293, -0.05753781646490097, 0.022252479568123817, 0.007069415412843227, -0.025794751942157745, -0.06723631918430328, 0.04654785990715027, -0.021395038813352585, 0.03480247035622597, -0.047150831669569016, 0.01989918388426304, -0.01410637702792883, -0.013029144145548344, -0.008082561194896698, -0.0021846138406544924, 0.027101939544081688, -0.008687454275786877, -0.008604710921645164, -0.008807854726910591, -0.00919410865753889, 0.021468481048941612, -0.03067146986722946, -0.0237471554428339, 0.04983166605234146, -0.012866861186921597, -0.002642638050019741, -0.05322269722819328, -0.015048257075250149, -0.017355693504214287, -0.01584022492170334, 0.06172933056950569, 0.05256916955113411, -0.013599772937595844, -0.030842410400509834, 0.05270979180932045, 0.03570081666111946, 0.016457926481962204, -0.006846735253930092, 0.008762773126363754, 0.010146713815629482, -0.0269780270755291, -0.0016601718962192535, -0.040947966277599335, -0.02216307260096073, 0.018238959833979607, 0.022415928542613983, 0.0211150124669075, -0.03088071383535862, 0.029362812638282776, -0.04715346544981003, -0.004263404756784439, 0.028362233191728592, 0.006554957013577223, -0.05388651043176651, -0.04254857450723648, 0.029893048107624054, 0.039053138345479965, -0.045758217573165894, -0.01687624864280224, 0.02093644067645073, -0.005251456517726183, -0.01993233896791935, 0.030313514173030853, -0.009361430071294308, -0.004915386438369751, -0.027527673169970512, 0.0026826802641153336, 0.02604183927178383, -0.001006790087558329, 0.067522794008255, 0.0047328113578259945, 0.008225693367421627, -0.03010793961584568 ]
Deploy Embedding Models with Hugging Face Inference Endpoints
philschmid
October 24, 2023
inference-endpoints-embeddings
guide, llm, apps, inference
https://huggingface.co/blog/inference-endpoints-embeddings
# Deploy Embedding Models with Hugging Face Inference Endpoints The rise of Generative AI and LLMs like ChatGPT has increased the interest and importance of embedding models for a variety of tasks especially for retrievel augemented generation, like search or chat with your data. Embeddings are helpful since they represent sentences, images, words, etc. as numeric vector representations, which allows us to map semantically related items and retrieve helpful information. This helps us to provide relevant context for our prompt to improve the quality and specificity of generation. Compared to LLMs are Embedding Models smaller in size and faster for inference. That is very important since you need to recreate your embeddings after you changed your model or improved your model fine-tuning. Additionally, is it important that the whole retrieval augmentation process is as fast as possible to provide a good user experience. In this blog post, we will show you how to deploy open-source Embedding Models toย Hugging Face Inference Endpoints using Text Embedding Inference, our managed SaaS solution that makes it easy to deploy models. Additionally, we will teach you how to run large scale batch requests. 1. What is Hugging Face Inference Endpoints 2. What is Text Embedding Inference 3. Deploy Embedding Model as Inference Endpoint 4. Send request to endpoint and create embeddings Before we start, let's refresh our knowledge about Inference Endpoints.
[ -0.010942213237285614, -0.011627322062849998, 0.04505880922079086, 0.00126407272182405, 0.051348425447940826, 0.0782097727060318, -0.0014347723918035626, 0.0274212583899498, -0.015423212200403214, -0.006162513513118029, -0.11123282462358475, -0.02366488240659237, 0.02333761565387249, 0.024768179282546043, 0.011756324209272861, -0.07767415046691895, 0.02005363442003727, 0.003640006063506007, -0.02399589493870735, -0.007113177329301834, 0.020421791821718216, -0.040067896246910095, 0.006881264969706535, -0.017372138798236847, -0.003545251674950123, -0.0688861533999443, 0.027588650584220886, -0.0009321757243014872, 0.045893341302871704, 0.041730258613824844, -0.09475777298212051, -0.011289743706583977, -0.0039227185770869255, -0.020393582060933113, 0.025559963658452034, 0.03380531072616577, -0.18122947216033936, 0.05026476830244064, 0.007125583477318287, -0.001559751806780696, 0.01594327762722969, -0.03837940841913223, -0.058496635407209396, 0.0011942716082558036, 0.041259605437517166, -0.06678648293018341, -0.12228727340698242, 0.028391219675540924, 0.014259920455515385, -0.02491159550845623, -0.08191704750061035, 0.05990643799304962, -0.03119829297065735, -0.03858417272567749, -0.005628838203847408, 0.009548308327794075, -0.015652883797883987, -0.18107196688652039, 0.029032275080680847, 0.03509760648012161, -0.026441171765327454, -0.0012844734592363238, 0.03245916962623596, 0.041194748133420944, 0.04113002121448517, 0.07181452214717865, -0.021503884345293045, -0.025240369141101837, -0.029777662828564644, 0.019100118428468704, 0.02551191858947277, 0.025110851973295212, 0.006698983255773783, -0.04627532139420509, 0.013765369541943073, -0.023692302405834198, -0.002442179247736931, 0.08158846199512482, 0.08607259392738342, -0.014825540594756603, -0.04361317679286003, -0.004096421878784895, 0.015641359612345695, -0.006002554204314947, 0.013231840915977955, 0.10182993859052658, 0.002160816453397274, -0.02302876114845276, -0.05590816214680672, 0.02458752505481243, 0.000039354934415314347, -0.12436853349208832, -0.03846646100282669, 0.04042679816484451, 0.03417840600013733, 0.03142617642879486, 0.032589469105005264, 0.01974598318338394, -0.0012229920830577612, -0.037996068596839905, -0.016341615468263626, -0.05157238617539406, 0.006226534489542246, -0.03463296964764595, -0.022148581221699715, 0.07477787882089615, 0.0016841287724673748, -0.05538256838917732, -0.0403878279030323, -0.0004208386817481369, -0.029382631182670593, -0.028753019869327545, -0.007678753696382046, 0.08226852118968964, -0.09778056293725967, 0.006423278246074915, -0.0020530587062239647, 0.004356492776423693, 0.013899756595492363, 0.012075022794306278, 0.03841875120997429, 0.05365214869379997, 0.05319463834166527, -0.02185090444982052, 0.0250832699239254, 0.1109987273812294, 0.04631301760673523, 0.00765147153288126, -0.023861628025770187, 0.01679552160203457, 0.01098308153450489, -0.019377443939447403, 0.011850915849208832, -0.006955740507692099, 0.01753806322813034, -0.08302538096904755, 0.028467480093240738, -0.11031791567802429, 0.059502117335796356, 0.0073369089514017105, -0.014624979346990585, 0.03216220811009407, 0.03766123950481415, -0.002424698555842042, 0.0812145248055458, 0.0017768958350643516, -0.09050002694129944, -0.03564627468585968, -0.02771259844303131, 0.034669384360313416, -0.10327908396720886, 0.04430808126926422, 0.014005635865032673, -0.07103511691093445, 0.01686171069741249, 0.06953933835029602, -0.013141601346433163, 0.042719174176454544, -0.04289374500513077, -0.033097658306360245, -0.027220480144023895, -0.04110730439424515, -0.021283641457557678, 0.017355918884277344, 0.01899741403758526, 0.007464901078492403, -0.005860533099621534, 0.005480722989886999, 0.011371670290827751, 0.03437931463122368, -0.03890012204647064, -0.012931233271956444, 0.04988336190581322, -0.0372244156897068, 0.09845598042011261, 0.02637597732245922, 0.018568839877843857, 0.054470423609018326, -0.010735447518527508, 0.006957801524549723, -0.035484857857227325, 0.06340375542640686, 0.008893259800970554, 0.0199049711227417, 0.037463534623384476, -0.11394725739955902, -0.005019938573241234, -0.05324932932853699, 0.009108256548643112, -0.06438732147216797, -0.058395612984895706, 0.021651478484272957, 0.01881628856062889, -0.004029576666653156, 0.03744259849190712, 0.0006069958908483386, -0.024097807705402374, 0.1582360565662384, 0.022800371050834656, 0.061091694980859756, 0.03477561101317406, 0.010884149931371212, 0.023725315928459167, -0.02578858844935894, -0.015889262780547142, 0.01426484901458025, -0.030947823077440262, -0.02925562858581543, -0.00893249548971653, 0.08148214966058731, 0.0036886041052639484, -0.10313699394464493, 0.058069873601198196, -0.07682890444993973, 0.007467629387974739, -0.05641009658575058, -0.011290500871837139, -0.03508596494793892, -0.021999016404151917, 0.01217066589742899, 0.15709760785102844, -0.027962464839220047, 0.018363486975431442, -0.06815619021654129, 0.008725193329155445, -0.014117412269115448, 0.06173084303736687, 0.049166757613420486, 0.07517828792333603, -0.04990909993648529, -0.010647174902260303, -0.07105888426303864, 0.0014647624921053648, 0.02115762233734131, 0.02770843543112278, 0.01877339370548725, 0.03046361356973648, -0.024909792467951775, 0.02886761911213398, -0.03058677725493908, 0.086237333714962, 0.005869697313755751, 0.022954609245061874, 0.012347484938800335, 0.02685919590294361, -0.03282724693417549, 0.05804196745157242, 0.015573901124298573, -0.04484257474541664, -0.03978252410888672, -0.0933862254023552, 0.0231168232858181, -0.01472413819283247, -0.010378433391451836, 0.03663695231080055, -0.017962602898478508, -0.01158270612359047, 0.0008477299124933779, -0.0399191714823246, 0.04105937108397484, 0.027273746207356453, -0.004137969575822353, 0.014871332794427872, -0.008766152895987034, 0.0089999008923769, -0.016448887065052986, -0.06508399546146393, 0.010363765060901642, 0.0018783044070005417, 0.0024607088416814804, 0.02064414508640766, -0.04335762560367584, 0.018037965521216393, 0.017702605575323105, 0.01770132966339588, 0.025149384513497353, 0.038937702775001526, -0.025230295956134796, -0.01993551105260849, -0.007720263674855232, 0.0015377993695437908, -0.020856494084000587, 0.0027399284299463034, 0.06498876959085464, 0.015870561823248863, -0.017357144504785538, -0.014774395152926445, -0.03356337919831276, -0.0624614916741848, 0.011429375037550926, 0.03408954665064812, 0.007643010467290878, 0.007192450575530529, 0.0030675597954541445, 0.01354250218719244, 0.0009923592442646623, -0.000933946983423084, -0.022774962708353996, 0.0017831299919635057, 0.03065587766468525, -0.008183612488210201, -0.01685994677245617, 0.014692310243844986, 0.004849269986152649, -0.03425649181008339, 0.045648615807294846, 0.01541756559163332, 0.022248350083827972, -0.09218307584524155, -0.03371243178844452, -0.022607678547501564, -0.007642456330358982, -0.006834276486188173, 0.007606174796819687, 0.050744570791721344, -0.026509704068303108, -0.00046325745643116534, 0.037357982248067856, -0.010445469059050083, 0.03577042743563652, 0.022896738722920418, -0.010887386277318, 0.010747723281383514, -0.002731841988861561, 0.013873249292373657, -0.04638615623116493, 0.04277874156832695, 0.016328239813447, -0.04791838303208351, 0.038134001195430756, 0.026457717642188072, 0.008958997204899788, 0.027535967528820038, -0.024816518649458885, 0.03495726361870766, -0.020796995609998703, 0.024223238229751587, -0.0380595326423645, -0.004296950530260801, -0.0328218899667263, -0.04157521203160286, -0.024435458704829216, -0.0949353277683258, 0.0032203064765781164, 0.018843891099095345, 0.004424955230206251, 0.026707138866186142, 0.009164422750473022, 0.0020558354444801807, 0.0027892482466995716, -0.027712954208254814, -0.007278330158442259, 0.004340095911175013, 0.004367195535451174, 0.03193055838346481, 0.05811476334929466, 0.028142644092440605, -0.026814037933945656, 0.018157344311475754, 0.013500149361789227, 0.015918299555778503, 0.025766773149371147, 0.010799835436046124, 0.042945243418216705, 0.012226821854710579, 0.02200263738632202, 0.024053040891885757, 0.0029674088582396507, -0.07064887136220932, 0.010994404554367065, -0.023861113935709, -0.058985915035009384, -0.010843970812857151, 0.07800866663455963, -0.01376372016966343, -0.01806936413049698, 0.023995129391551018, 0.04442835971713066, -0.003914425149559975, 0.06755691766738892, -0.0010527604026719928, 0.014604838564991951, -0.035171784460544586, -0.0009882546728476882, 0.00279882550239563, -0.07408656179904938, 0.03212646394968033, 0.011071051470935345, 0.009627074934542179, -0.009192044846713543, -0.03551114723086357, 0.01695181056857109, 0.02007930912077427, -0.029527856037020683, 0.037109117954969406, -0.037310052663087845, 0.006003971677273512, 0.016189640387892723, -0.011364283040165901, -0.033902302384376526, -0.0045767733827233315, 0.024295585229992867, 0.0011161499423906207, 0.0066218203864991665, 0.01562977395951748, 0.024900903925299644, 0.01641125977039337, -0.015802238136529922, 0.013840658590197563, -0.03706219419836998, -0.019985241815447807, -0.004621252883225679, -0.0631355494260788, 0.019761191681027412, -0.023150190711021423, 0.00017556585953570902, 0.019272034987807274, -0.015591014176607132, -0.016931405290961266, 0.009461093693971634, -0.03309947997331619, -0.017241209745407104, 0.014960491098463535, 0.012062226422131062, -0.015762770548462868, -0.0018620392074808478, -0.029660461470484734, 0.011148226447403431, -0.03820960968732834, 0.03179647773504257, 0.022781014442443848, -0.033345047384500504, 0.03550601378083229, 0.018985696136951447, 0.013567275367677212, 0.0038688641507178545, -0.0221027210354805, -0.011360236443579197, -0.010535793378949165, 0.016005298122763634, 0.06249327212572098, 0.0006595844170078635, 0.01082026306539774, -0.010596103966236115, -0.01816747896373272, 0.018199769780039787, -0.0011138562113046646, 0.021965615451335907, -0.005766736809164286, -0.0022045355290174484, 0.00144474720582366, 0.0004464429512154311, 0.010148207657039165, -0.0014669689116999507, -0.05527346208691597, -0.014094536192715168, -0.03394876420497894, 0.03853274881839752, 0.007848329842090607, 0.007678426336497068, -0.021456407383084297, 0.02400866337120533, 0.0636892169713974, -0.001382273156195879, -0.012015724554657936, 0.001636191620491445, 0.01812765561044216, 0.03620658442378044, 0.011448308825492859, 0.014861265197396278, -0.016446640715003014, -0.011698627844452858, 0.0164688378572464, 0.0006143854698166251, -0.015644920989871025, -0.039895519614219666, -0.027214964851737022, 0.017742272466421127, -0.04272010922431946, 0.006928844843059778, 0.05236007273197174, -0.02837863750755787, -0.004452613648027182, 0.02572152391076088, 0.08219975233078003, 0.03365541622042656, 0.0005758155602961779, 0.019997576251626015, -0.04178149253129959, -0.020021356642246246, 0.02907317318022251, -0.01898345910012722, 0.00023954724019858986, 0.011800918728113174, 0.07627373188734055, 0.061620984226465225, -0.0029471691232174635, -0.023142844438552856, -0.02329447492957115, -0.0021705233957618475, 0.03700912743806839, -0.03157803788781166, -0.000711006869096309, -0.017789412289857864, -0.015884168446063995, -0.012430718168616295, -0.005281221587210894, 0.004756374284625053, 0.004101405385881662, 0.061780404299497604, -0.044694047421216965, 0.003814763156697154, 0.03142968937754631, -0.008512054570019245, 0.009394858032464981, -0.036816999316215515, 0.04328795149922371, -0.0033572774846106768, -0.013231199234724045, -0.013840045779943466, -0.013307797722518444, 0.025291986763477325, 0.03061106987297535, -0.026452435180544853, -0.03638322651386261, 0.00913887470960617, 0.013570046052336693, 0.07007932662963867, -0.027194565162062645, -0.02010124921798706, -0.013841090723872185, -0.016056234017014503, 0.02966388687491417, -0.022451097145676613, -0.018754851073026657, 0.03874610736966133, -0.0056604319252073765, 0.007365975063294172, -0.007710673846304417, -0.04408162832260132, 0.029815779998898506, 0.03193992003798485, 0.016998011618852615, 0.025466185063123703, -0.026531651616096497, 0.04522838070988655, 0.059231117367744446, 0.010308261029422283, -0.000555371050722897, -0.03533655032515526, -0.04606982693076134, 0.00902386661618948, -0.030823104083538055, 0.057472001761198044, 0.037771109491586685, -0.041968122124671936, -0.034823108464479446, 0.02865692786872387, 0.008897130377590656, 0.0010167020373046398, -0.018325744196772575, 0.007083437405526638, 0.03658900409936905, 0.019252803176641464, 0.025173181667923927, 0.010520691983401775, -0.032122597098350525, 0.013176113367080688, 0.0338948592543602, -0.04457804560661316, 0.014044102281332016, 0.011701253242790699, -0.05265366658568382, 0.032229870557785034, -0.015498875640332699, -0.021194305270910263, 0.019182195886969566, 0.01610003225505352, 0.015313426032662392, 0.017835697159171104, -0.008600940927863121, -0.0026572863571345806, 0.008436127565801144, 0.011435716412961483, 0.03725298494100571, 0.052758682519197464, -0.03679334744811058, 0.023991286754608154, 0.014290738850831985, 0.045716747641563416, 0.040929682552814484, -0.016885261982679367, 0.024086352437734604, 0.011635973118245602, 0.09886585921049118, 0.02427196502685547, 0.02160653844475746, 0.011478117667138577, -0.008644125424325466, 0.03476269543170929, 0.016191598027944565, -0.02465599961578846, -0.012346104718744755, 0.010625364258885384, 0.013423633761703968, -0.009835917502641678, 0.04819052666425705, -0.004711971152573824, 0.0389939546585083, 0.0017500316025689244, 0.04517558589577675, -0.017946094274520874, 0.011379717849195004, 0.02244434505701065, 0.02068590559065342, 0.004808980505913496, 0.04498901218175888, 0.031682927161455154, -0.04461602121591568, 0.035960134118795395, 0.02858608216047287, 0.02949093095958233, -0.020825417712330818, 0.031665362417697906, -0.017879726365208626, -0.01737130805850029, -0.030446063727140427, 0.013827670365571976, 0.019524507224559784, -0.003106061602011323, -0.03321562707424164, 0.023982839658856392, -0.015722056850790977, 0.013741634786128998, -0.016742847859859467, 0.012703818269073963, 0.009624277241528034, -0.023430945351719856, -0.019816089421510696, 0.049601420760154724, 0.017054229974746704, -0.031076937913894653, 0.0199662484228611, -0.02005523256957531, -0.008392428047955036, -0.009084506891667843, -0.017230911180377007, -0.01564062014222145, -0.021688923239707947, -0.01691843383014202, 0.0030502742156386375, 0.013898935168981552, -0.012794620357453823, -0.011812600307166576, 0.03823069483041763, 0.03095456212759018, 0.0035186668392270803, 0.007009758148342371, -0.003829963505268097, 0.019837848842144012, -0.043029677122831345, -0.006073091644793749, -0.0023956794757395983, -0.008608926087617874, -0.03323626518249512, -0.02664599008858204, -0.050073277205228806, -0.03087572753429413, 0.034514911472797394, 0.03482102230191231, 0.07159948348999023, -0.023440081626176834, -0.02813952974975109, 0.04218262806534767, 0.0041373916901648045, -0.01688859611749649, 0.025277497246861458, -0.013215946033596992, 0.019604606553912163, 0.010466005653142929, 0.01574220508337021, -0.009816335514187813, -0.011807622388005257, 0.0014896504580974579, 0.05222100391983986, 0.004076714161783457, -0.05166216939687729, -0.029485663399100304, 0.040584441274404526, 0.006817716173827648, 0.06012304499745369, 0.030308471992611885, -0.002673298353329301, 0.00420193187892437, -0.017790595069527626, -0.011594233103096485, -0.04740983992815018, 0.011725615710020065, -0.02912800945341587, -0.05633926019072533, -0.04307820647954941, 0.020063897594809532, 0.002530893078073859, 0.03784357011318207, -0.013439018279314041, 0.004456252790987492, -0.017514167353510857, -0.014708190225064754, -0.020220737904310226, 0.0014825004618614912, 0.07195853441953659, 0.02794811688363552, 0.018418731167912483, -0.008663213811814785, -0.004628067370504141, 0.017974814400076866, -0.021844321861863136, 0.033603962510824203, 0.02532743290066719, -0.01548092719167471, -0.01345644798129797, -0.021956073120236397, 0.0083163408562541, 0.004918522667139769, -0.036462172865867615, 0.04407580941915512, 0.020436879247426987, -0.046518005430698395, -0.03501708433032036, 0.017320837825536728, 0.059594545513391495, -0.015395667403936386, 0.0007209140458144248, -0.05877595394849777, -0.015745699405670166, -0.010159525088965893, 0.00427152868360281, -0.03883878514170647, -0.01618088036775589, -0.03830335661768913, -0.020552270114421844, 0.013795065693557262, -0.014733518473803997, 0.046949468553066254, -0.06743261218070984, 0.010198093950748444, 0.03086259216070175, -0.017393052577972412, -0.07700738310813904, -0.04702113941311836, -0.006660911254584789, 0.04647205397486687, -0.038302842527627945, -0.02671685814857483, -0.005267380736768246, -0.01731300912797451, -0.0076427338644862175, 0.00870402343571186, 0.007449003402143717, -0.0044747935608029366, -0.0104167265817523, -0.011389173567295074, -0.011206526309251785, 0.04606280475854874, 0.03461247310042381, -0.012645556591451168, -0.05919669568538666, -0.010890801437199116 ]
Deploy Embedding Models with Hugging Face Inference Endpoints
philschmid
October 24, 2023
inference-endpoints-embeddings
guide, llm, apps, inference
https://huggingface.co/blog/inference-endpoints-embeddings
4. Send request to endpoint and create embeddings The Endpoint overview provides access to the Inference Widget, which can be used to manually send requests. This allows you to quickly test your Endpoint with different inputs and share it with team members. Note: TEI is currently is not automatically truncating the input. You can enable this by setting truncate: true in your request. In addition to the widget the overview provides an code snippet for cURL, Python and Javascript, which you can use to send request to the model. The code snippet shows you how to send a single request, but TEI also supports batch requests, which allows you to send multiple document at the same to increase utilization of your endpoint. Below is an example on how to send a batch request with truncation set to true. python import requests API_URL = "https://l2skjfwp9punv393.us-east-1.aws.endpoints.huggingface.cloud" headers = { "Authorization": "Bearer YOUR TOKEN", "Content-Type": "application/json" } def query(payload): response = requests.post(API_URL, headers=headers, json=payload) return response.json() output = query({ "inputs": ["sentence 1", "sentence 2", "sentence 3"], "truncate": True }) # output [[0.334, ...], [-0.234, ...]]
[ 0.07659999281167984, -0.006090616807341576, -0.005435030907392502, -0.007648227736353874, 0.019818024709820747, 0.06191962957382202, 0.04624595120549202, 0.05127916857600212, 0.020353926345705986, -0.07097306847572327, -0.1328490525484085, -0.047895826399326324, 0.054467178881168365, 0.03948524594306946, -0.03772091493010521, 0.006108874920755625, 0.022310590371489525, -0.012169038876891136, -0.05752115696668625, 0.036604274064302444, 0.00204135337844491, -0.06489153206348419, -0.002702989149838686, 0.046001557260751724, 0.004770321771502495, -0.07069679349660873, -0.02658187970519066, 0.010190846398472786, 0.007926855236291885, 0.06118454039096832, -0.042109791189432144, -0.048109132796525955, -0.0649905875325203, 0.02406291291117668, 0.0014347273390740156, 0.01790294609963894, -0.1123114749789238, 0.07604072242975235, -0.0023812472354620695, -0.007061215117573738, 0.005359943490475416, -0.021723411977291107, -0.05297311767935753, 0.007199171930551529, 0.03197198361158371, -0.0184144526720047, -0.11358623206615448, 0.021496566012501717, -0.02384096011519432, 0.004167567938566208, -0.09675107151269913, 0.10905323922634125, 0.013215526938438416, -0.034600988030433655, 0.056701239198446274, -0.04254307970404625, 0.013367627747356892, -0.1501981019973755, 0.022739846259355545, -0.005812152288854122, -0.016341617330908775, 0.0275708194822073, -0.002417454496026039, 0.03304099291563034, 0.005256887059658766, 0.035066135227680206, -0.04511457309126854, 0.007552166003733873, 0.008809621445834637, -0.013940584845840931, 0.056973665952682495, 0.026293771341443062, -0.01947057619690895, 0.007393913343548775, 0.017687665298581123, -0.04844922572374344, -0.004549120552837849, 0.03491528704762459, 0.06540609151124954, 0.05775540694594383, 0.011052816174924374, 0.03777970373630524, -0.028807947412133217, -0.03800692409276962, 0.02386295422911644, 0.008402648381888866, 0.023273859173059464, -0.008713236078619957, -0.05795510858297348, 0.03109823167324066, 0.009505857713520527, -0.08997614681720734, -0.002361077582463622, 0.026897775009274483, 0.0038136676885187626, 0.04018813371658325, 0.018421798944473267, 0.008167307823896408, 0.002477293834090233, -0.0398496650159359, 0.03924376145005226, -0.04952724650502205, -0.024335864931344986, -0.012691590003669262, -0.06793996691703796, 0.10463017225265503, -0.010552922263741493, -0.10055668652057648, -0.018235430121421814, -0.02340465784072876, -0.01719760149717331, -0.024484721943736076, -0.004890673793852329, 0.08825065940618515, -0.1199265792965889, -0.008007284253835678, -0.05028701573610306, 0.025270521640777588, -0.041630279272794724, 0.024356909096240997, 0.04249850660562515, 0.07349374145269394, 0.06982547044754028, -0.023117439821362495, 0.027024762704968452, 0.02127043344080448, 0.03176617994904518, -0.014392895624041557, 0.03135862573981285, -0.028133993968367577, 0.03982923924922943, 0.026950668543577194, 0.14348015189170837, -0.006613831501454115, -0.004673844203352928, -0.034975502640008926, 0.0090055912733078, -0.06259007751941681, 0.087137371301651, 0.021488673985004425, 0.02303926646709442, 0.029240427538752556, -0.05372169241309166, -0.041425615549087524, -0.009437196888029575, 0.03757309541106224, -0.040994755923748016, 0.021978817880153656, 0.05023537576198578, 0.029863793402910233, -0.11066395789384842, 0.08784813433885574, 0.0249068234115839, 0.04788591340184212, -0.025034261867403984, 0.06136304512619972, -0.015998682007193565, 0.06848986446857452, 0.0199857447296381, -0.03547023981809616, 0.021607162430882454, -0.02435743622481823, -0.05595479533076286, -0.026781681925058365, 0.03449922800064087, 0.04459667205810547, -0.003000206546857953, 0.017498895525932312, 0.021348845213651657, -0.028595786541700363, -0.043225809931755066, -0.001447685295715928, 0.04674901068210602, 0.015768613666296005, 0.02203100174665451, 0.051735326647758484, 0.019522584974765778, -0.00004924539098283276, 0.005326177459210157, 0.001317583373747766, -0.016364065930247307, 0.10624884068965912, -0.03379898890852928, 0.03732344135642052, 0.004583960864692926, -0.10312790423631668, 0.041582148522138596, 0.04611817002296448, -0.007973788306117058, -0.05594583600759506, -0.006088617257773876, -0.014130078256130219, 0.055639371275901794, 0.023973854258656502, 0.0031512128189206123, -0.03601400926709175, -0.0346837192773819, 0.07236213237047195, -0.02118631824851036, 0.014681980013847351, -0.008713130839169025, 0.06920865923166275, 0.020072201266884804, -0.05012955144047737, -0.014385631307959557, -0.0027151384856551886, 0.020443055778741837, -0.057721346616744995, -0.03165299817919731, 0.003581245429813862, 0.001842612400650978, -0.01408479642122984, 0.017966998741030693, -0.05724693834781647, -0.03653789684176445, -0.09018024057149887, -0.017905989661812782, -0.02279958315193653, 0.007667433936148882, 0.023226112127304077, 0.11583509296178818, 0.02915918081998825, 0.030077319592237473, -0.05522504821419716, 0.013914469629526138, 0.03246885910630226, 0.05426686257123947, 0.055254243314266205, 0.01947813667356968, 0.02843770571053028, -0.003554773749783635, -0.011667029932141304, -0.05076593533158302, 0.07320097088813782, -0.01601336896419525, -0.03214983642101288, 0.013375169597566128, -0.04825778678059578, 0.03426281735301018, -0.04969082400202751, 0.06625396013259888, 0.06104850023984909, 0.04691162332892418, 0.011697265319526196, 0.03365907445549965, -0.017603792250156403, 0.08630044013261795, 0.032854530960321426, -0.04715626314282417, -0.004210696555674076, -0.08587852120399475, 0.048318371176719666, -0.031363774091005325, -0.0475226454436779, 0.04113885015249252, -0.02712123654782772, -0.004244923125952482, 0.009890229441225529, -0.018898019567131996, 0.07299510389566422, 0.017358703538775444, 0.021302828565239906, 0.0031173466704785824, -0.023678075522184372, -0.010098465718328953, -0.00011348893167451024, -0.0552927702665329, -0.06263475120067596, 0.001238413853570819, -0.007381353061646223, 0.006781155243515968, -0.0027054452802985907, 0.012598744593560696, 0.02378237247467041, 0.004040157422423363, 0.02248634397983551, 0.0029531579930335283, 0.02688213437795639, -0.012470892630517483, -0.011331690475344658, -0.02427535317838192, -0.039140425622463226, 0.045385878533124924, 0.04259504750370979, 0.04251931980252266, 0.021915782243013382, -0.005492272786796093, -0.0756593719124794, -0.035326916724443436, 0.0015550194075331092, 0.032584886997938156, 0.031665947288274765, -0.007562048267573118, 0.013744482770562172, -0.034825120121240616, 0.022936997935175896, 0.006920813582837582, -0.028285065665841103, 0.00804674532264471, -0.0029910190496593714, -0.0423123873770237, 0.003940668422728777, -0.012375875376164913, 0.024401245638728142, -0.042319610714912415, -0.034472350031137466, 0.004149534739553928, 0.027061842381954193, -0.07321921736001968, -0.051465973258018494, 0.00832536444067955, 0.0061095599085092545, 0.009658112190663815, 0.013527680188417435, 0.029732659459114075, -0.023970860987901688, 0.006450326647609472, 0.010207545012235641, -0.025131959468126297, 0.00018814252689480782, 0.02700483798980713, -0.010478854179382324, -0.016390670090913773, 0.013744067400693893, -0.001919260248541832, 0.000051148741476936266, 0.04886245355010033, -0.013291503302752972, -0.033552613109350204, 0.010638547129929066, 0.04238361865282059, -0.023754119873046875, 0.030275749042630196, -0.04875858500599861, 0.02475452423095703, 0.008456903509795666, 0.04326455667614937, -0.0412834957242012, 0.01601521484553814, -0.023428620770573616, -0.030070286244153976, 0.027302419766783714, -0.03850181773304939, -0.008529105223715305, -0.026075834408402443, -0.006876669358462095, -0.001961454516276717, 0.022699326276779175, -0.02171621471643448, -0.024030668660998344, 0.009650100022554398, -0.02878692001104355, 0.01915758289396763, 0.012456867843866348, 0.06347077339887619, 0.009296896867454052, 0.05414393171668053, -0.008369993418455124, -0.009396374225616455, 0.020665854215621948, -0.00964590348303318, 0.040474120527505875, -0.014054871164262295, -0.00393690774217248, -0.03376986086368561, 0.03594550862908363, 0.013442425057291985, 0.038270726799964905, -0.024473391473293304, -0.029045935720205307, -0.0069335028529167175, -0.010633936151862144, -0.016574854031205177, 0.06295621395111084, -0.023154854774475098, -0.022056370973587036, -0.012719392776489258, 0.020861791446805, -0.014049574732780457, 0.016244636848568916, 0.004992098081856966, 0.00014969171024858952, -0.04112004488706589, -0.03410590440034866, -0.01551470160484314, -0.02213245816528797, 0.006954223848879337, 0.026212342083454132, -0.01381985004991293, 0.005581457167863846, -0.04332280904054642, 0.02500282973051071, 0.04614553228020668, 0.005328967235982418, -0.0036078663542866707, -0.050550006330013275, 0.02715669758617878, 0.013201233930885792, -0.019854184240102768, -0.03891228511929512, -0.006087282672524452, -0.021776271983981133, -0.04263109713792801, 0.007650173734873533, 0.0023474835325032473, 0.042109113186597824, 0.008112683892250061, -0.02676415629684925, -0.0004214317596051842, -0.04074115678668022, -0.0054662469774484634, 0.02664354257285595, -0.03743147477507591, 0.000818289234302938, -0.008665227331221104, 0.021464845165610313, 0.04513168707489967, 0.027705665677785873, -0.04234684631228447, 0.001550015527755022, -0.05103081837296486, -0.004863705486059189, 0.0008255524444393814, 0.08699388056993484, -0.021095803007483482, 0.007272363640367985, -0.05333157256245613, -0.006129810586571693, -0.029953863471746445, -0.00962845329195261, 0.03917915001511574, -0.07039454579353333, 0.00729071581736207, 0.008908689022064209, -0.03738223761320114, -0.003048541024327278, -0.001179112703539431, -0.020838575437664986, -0.029328133910894394, -0.010141231119632721, 0.07369185984134674, 0.013500792905688286, -0.001020887983031571, 0.041187454015016556, 0.0034764136653393507, -0.016759879887104034, 0.017566341906785965, 0.0038422008510679007, -0.0205573458224535, -0.002804484451189637, -0.002147464081645012, -0.044851139187812805, 0.00533358845859766, 0.009587591513991356, -0.03743482008576393, -0.030433334410190582, -0.03830350190401077, 0.015227777883410454, 0.019627010449767113, 0.016094287857413292, -0.027239389717578888, -0.006726385094225407, 0.03578623756766319, 0.025277236476540565, 0.01121602114289999, -0.013158973306417465, 0.04803226888179779, 0.05337654426693916, -0.02363215573132038, 0.005278628319501877, -0.017347220331430435, 0.031659744679927826, 0.00958390161395073, -0.0018844630103558302, -0.025690961629152298, -0.03105183131992817, -0.033801671117544174, 0.0007977376226335764, -0.019685201346874237, -0.021584121510386467, 0.034693244844675064, -0.005996991414576769, 0.018753865733742714, 0.04573481157422066, -0.022685561329126358, 0.01638798974454403, -0.039861150085926056, 0.045661866664886475, -0.015226130373775959, -0.0340338870882988, 0.05382045730948448, -0.0598803386092186, -0.005417305510491133, 0.031146559864282608, 0.04726548120379448, 0.05071057751774788, 0.0506812259554863, 0.045763976871967316, -0.04401726648211479, -0.0033691388089209795, 0.009437523782253265, -0.00943226832896471, 0.00982371810823679, -0.04066535830497742, 0.006331619340926409, 0.020730437710881233, 0.004507929086685181, 0.038711417466402054, 0.026615340262651443, 0.08347877115011215, -0.032323576509952545, 0.018031705170869827, 0.05699814483523369, 0.006105115171521902, -0.001362339942716062, -0.011883599683642387, 0.008688386529684067, -0.03279440104961395, -0.008801008574664593, -0.04897396266460419, 0.011883136816322803, 0.03676919639110565, 0.011785715818405151, -0.0045430902391672134, -0.01744937151670456, -0.0172266885638237, 0.01363322138786316, 0.03540193289518356, -0.014963502064347267, -0.035374537110328674, 0.008280311711132526, 0.008978606201708317, 0.030078724026679993, -0.009843154810369015, -0.015943266451358795, 0.006293165497481823, -0.02628948725759983, 0.005460246931761503, 0.03959536552429199, 0.0067931911908090115, -0.015034058131277561, -0.003594814334064722, 0.0008810015860944986, 0.07017058879137039, -0.02255001664161682, 0.012236231938004494, 0.013041659258306026, -0.026627812534570694, 0.0035103794652968645, -0.07410766929388046, -0.04727430269122124, -0.0012183887884020805, -0.04180742800235748, 0.04790825396776199, 0.044922202825546265, -0.021915551275014877, -0.041298434138298035, 0.015584143809974194, 0.019693424925208092, -0.0036628416273742914, -0.04252398759126663, 0.0023787168320268393, -0.018260912969708443, -0.002901288913562894, 0.029277022927999496, 0.020052962005138397, -0.005348371807485819, -0.005626788828521967, 0.024913908913731575, -0.05231746286153793, -0.0037100734189152718, 0.02520684525370598, -0.025117577984929085, -0.014319783076643944, -0.0016944778617471457, -0.024937551468610764, 0.027882961556315422, -0.03528308868408203, 0.00043601603829301894, 0.018115904182195663, 0.01143462210893631, -0.011959963478147984, 0.007133631967008114, 0.057403627783060074, 0.04340367391705513, 0.044514402747154236, -0.017335718497633934, 0.017084570601582527, 0.04356536269187927, 0.05980644002556801, 0.02623625658452511, -0.027917083352804184, 0.032603248953819275, -0.0061770542524755, 0.09247180819511414, 0.04146689921617508, 0.016752861440181732, -0.01705787144601345, -0.0007993721519596875, 0.01894780993461609, 0.019629178568720818, -0.0471450500190258, -0.029403816908597946, -0.019930481910705566, 0.045005980879068375, -0.008474405854940414, 0.0072725391946733, -0.03095814771950245, 0.025211162865161896, 0.011926814913749695, 0.0007453741854988039, -0.0034672978799790144, -0.01600112020969391, 0.04360288754105568, 0.008159295655786991, 0.0019396113930270076, 0.03545298054814339, 0.03737933933734894, -0.052537254989147186, 0.04956362769007683, -0.01760067231953144, 0.00021560171444434673, 0.011333047412335873, 0.017819423228502274, -0.02474544197320938, -0.06316626816987991, -0.01385596115142107, 0.02591581456363201, 0.024013858288526535, -0.011919996701180935, -0.007906109094619751, 0.02245866134762764, -0.04238678514957428, 0.012276722118258476, 0.03344151750206947, -0.013590645045042038, 0.016187580302357674, -0.009673076681792736, 0.03537501394748688, 0.009007788263261318, 0.013232629746198654, -0.054875556379556656, 0.045755550265312195, 0.022863414138555527, 0.0533667728304863, 0.0177924782037735, -0.02825993113219738, 0.006687080953270197, -0.0024034155067056417, -0.038978543132543564, 0.02238515578210354, 0.05147319659590721, -0.005048149265348911, -0.0003934392298106104, -0.03314901515841484, 0.06797973811626434, 0.008059910498559475, 0.033868588507175446, 0.021558547392487526, 0.04280198737978935, 0.02378694713115692, -0.03924138844013214, -0.014413798227906227, -0.037245940417051315, -0.01800263300538063, 0.01803985983133316, -0.03273840993642807, -0.014832701534032822, 0.023419391363859177, 0.009572558104991913, 0.025143517181277275, -0.02393718808889389, 0.0039051163475960493, 0.04537985846400261, 0.006573778111487627, -0.06839403510093689, 0.036635622382164, -0.0034541694913059473, -0.02316948212683201, -0.0009141183109022677, -0.0030064221937209368, -0.008409328758716583, -0.01679852418601513, -0.026029342785477638, 0.030100906267762184, 0.017860284075140953, -0.03700396418571472, -0.020894629880785942, 0.031200096011161804, 0.037199605256319046, 0.06079820916056633, 0.00199267384596169, -0.04409879446029663, -0.0370897576212883, 0.029113514348864555, 0.009531361050903797, -0.05018112063407898, 0.007739630062133074, -0.01999993622303009, -0.020901845768094063, -0.030240895226597786, 0.00006842994480393827, -0.05185636505484581, 0.03197424113750458, -0.04190923646092415, 0.00034865489578805864, -0.005194561090320349, -0.07162932306528091, -0.022444982081651688, 0.01634185202419758, 0.03985726088285446, 0.057178035378456116, 0.009559154510498047, 0.019771790131926537, -0.0626077800989151, -0.004530813079327345, -0.01606827601790428, -0.023068442940711975, 0.07302873581647873, -0.0012021722504869103, -0.028580525889992714, -0.019767455756664276, 0.020748136565089226, 0.01680539734661579, -0.06697626411914825, 0.030922941863536835, 0.008477727882564068, -0.0029387902468442917, -0.05777359753847122, 0.013152441941201687, 0.05239400640130043, -0.0015991897089406848, -0.007046348415315151, -0.006463652942329645, -0.018557390198111534, -0.05896563082933426, 0.03450537845492363, -0.037094596773386, -0.022198297083377838, -0.03037359192967415, 0.01709207333624363, 0.027070116251707077, -0.02833510935306549, 0.018322553485631943, -0.05992571637034416, 0.02304057404398918, 0.013233277946710587, -0.0063929776661098, -0.028523661196231842, -0.008686777204275131, 0.016430824995040894, 0.0300443172454834, -0.04552854225039482, 0.009543241932988167, 0.0125954020768404, -0.007871180772781372, -0.02194938436150551, -0.011328456923365593, -0.0474773608148098, -0.01110481284558773, -0.04046785458922386, -0.02899456024169922, -0.01864774338901043, 0.002930146176367998, 0.06894633173942566, -0.03883708268404007, -0.05147011950612068, 0.014467520639300346 ]
Deploy Embedding Models with Hugging Face Inference Endpoints
philschmid
October 24, 2023
inference-endpoints-embeddings
guide, llm, apps, inference
https://huggingface.co/blog/inference-endpoints-embeddings
Conclusion TEI on Hugging Face Inference Endpoints enables blazing fast and ultra cost-efficient deployment of state-of-the-art embeddings models. With industry-leading throughput of 450+ requests per second and costs as low as $0.00000156 / 1k tokens, Inference Endpoints delivers 64x cost savings compared to OpenAI Embeddings. For developers and companies leveraging text embeddings to enable semantic search, chatbots, recommendations, and more, Hugging Face Inference Endpoints eliminates infrastructure overhead and delivers high throughput at lowest cost streamlining the process from research to production. --- Thanks for reading! If you have any questions, feel free to contact me onย Twitterย orย LinkedIn.
[ 0.022384662181138992, 0.058113470673561096, 0.01210232637822628, 0.01319305133074522, -0.027392972260713577, 0.05846380442380905, 0.04803759977221489, 0.05349442735314369, 0.0428365096449852, -0.04619436338543892, -0.06857778131961823, 0.019353562965989113, 0.03350527212023735, 0.05572707951068878, -0.0018860141281038523, -0.06930243968963623, -0.015174174681305885, -0.019279539585113525, -0.024120327085256577, -0.0054350052960217, -0.008396750316023827, -0.01054420042783022, 0.007047624327242374, 0.030167218297719955, -0.07716954499483109, -0.04212075471878052, -0.07646513730287552, -0.06117929890751839, 0.011511729098856449, 0.04514980688691139, -0.08111248165369034, -0.050184216350317, -0.06330399215221405, -0.030850550159811974, 0.05132675543427467, -0.00022865479695610702, -0.13274209201335907, 0.059404730796813965, -0.01643560640513897, 0.049075182527303696, 0.01054411381483078, -0.02804730460047722, -0.08336631208658218, 0.021342581138014793, -0.007951512932777405, -0.04834617301821709, -0.08655750751495361, 0.03433136269450188, -0.007983245886862278, 0.01771348901093006, -0.06096591427922249, 0.08018427342176437, -0.0023936377838253975, 0.020471585914492607, 0.004586491733789444, 0.0018365067662671208, -0.024518366903066635, -0.12721174955368042, 0.03555673733353615, -0.01889529451727867, -0.052609242498874664, -0.02212313935160637, 0.07052604109048843, 0.021473005414009094, 0.02382565662264824, 0.05074366554617882, 0.007968253456056118, -0.022472459822893143, 0.010854379273951054, 0.007556162774562836, 0.07691366225481033, 0.05206846445798874, -0.018580760806798935, 0.0279083289206028, 0.03460584953427315, -0.01864357851445675, -0.0013061410281807184, 0.032552774995565414, 0.0766768753528595, -0.015125145204365253, -0.07317017018795013, 0.01438953261822462, -0.01684306561946869, -0.06126795709133148, 0.036739010363817215, 0.10625436156988144, 0.01925474777817726, -0.04470095783472061, -0.09153440594673157, 0.016235923394560814, 0.0014756117016077042, -0.06498432904481888, -0.049302347004413605, -0.008459698408842087, 0.026961402967572212, 0.06517831981182098, 0.050766002386808395, 0.019108738750219345, -0.017675558105111122, -0.04408511891961098, 0.02755175158381462, -0.0314764641225338, -0.011077404022216797, -0.053306784480810165, -0.06286359578371048, 0.07792294025421143, -0.044730294495821, -0.10082845389842987, -0.00957022700458765, 0.018165891990065575, -0.04222920909523964, -0.029308071359992027, 0.022445200011134148, 0.04827766492962837, -0.12380128353834152, 0.048222821205854416, -0.07425598055124283, -0.001153295859694481, -0.010147870518267155, 0.035684965550899506, 0.0587942972779274, 0.03030451573431492, 0.05218076333403587, -0.06178492307662964, 0.005857638083398342, 0.08760073781013489, 0.008310528472065926, 0.053619783371686935, 0.003138243220746517, 0.04399773105978966, 0.029682330787181854, -0.026687612757086754, 0.0008532165666110814, -0.021490687504410744, -0.006169737316668034, -0.06844524294137955, 0.003064503660425544, -0.057823292911052704, 0.0052271559834480286, -0.002665700623765588, -0.06586774438619614, 0.03377072140574455, 0.023724719882011414, -0.09168726950883865, 0.05782591551542282, 0.0009843570878729224, -0.07772915810346603, 0.02004348486661911, 0.01126212440431118, 0.008534848690032959, -0.13546162843704224, 0.029293902218341827, -0.0016570320585742593, 0.029508842155337334, -0.0009714813786558807, 0.03343328833580017, 0.05479336157441139, -0.012990827672183514, -0.0023017844650894403, -0.05352649837732315, -0.002996150404214859, -0.10275258123874664, -0.0084476787596941, -0.025623073801398277, 0.04071519896388054, 0.007694709580391645, -0.0021956656128168106, -0.0019032814307138324, -0.02395467646420002, 0.02330167405307293, 0.0039971983060240746, -0.03665657714009285, 0.05728031322360039, -0.013278922997415066, 0.044974520802497864, 0.0017324798973277211, -0.007212026510387659, 0.10266567766666412, -0.023638136684894562, 0.04304489493370056, -0.013165567070245743, 0.08634552359580994, 0.0417337641119957, 0.039712436497211456, 0.02531735599040985, -0.14177966117858887, -0.004389230161905289, 0.019894609227776527, 0.013082011602818966, -0.05053199082612991, -0.01992170698940754, -0.016117693856358528, 0.07087215781211853, -0.03443017974495888, 0.03949211910367012, -0.01291672233492136, -0.001460774801671505, 0.07293075323104858, 0.02389180287718773, 0.0146707221865654, 0.0033365569543093443, 0.04419022053480148, 0.026529332622885704, -0.04836662858724594, -0.044038139283657074, -0.05008366331458092, -0.04357503354549408, -0.01098847296088934, -0.045135498046875, 0.03476915881037712, -0.02165829762816429, -0.08671166747808456, -0.010716715827584267, -0.028514821082353592, -0.019402794539928436, -0.09009632468223572, 0.007256864104419947, 0.0160339567810297, 0.04585738852620125, -0.010282937437295914, 0.11863624304533005, -0.03999298810958862, -0.0012017580447718501, -0.07021478563547134, -0.00770581467077136, -0.046079475432634354, 0.022521596401929855, -0.0018206166569143534, 0.06940224766731262, 0.01575058326125145, -0.043331779539585114, -0.062198150902986526, -0.03409912809729576, 0.03831659257411957, 0.04343939945101738, 0.043167028576135635, 0.03539552167057991, -0.07035055011510849, 0.07432780414819717, 0.02056305669248104, 0.029538175091147423, 0.0514451265335083, 0.054539892822504044, 0.022235248237848282, 0.04079201817512512, -0.058285247534513474, 0.036133550107479095, 0.024598494172096252, -0.03579649329185486, -0.03365644812583923, -0.053427692502737045, 0.020872017368674278, -0.007057399954646826, -0.030803121626377106, 0.006812947802245617, -0.013235178776085377, -0.013377740047872066, -0.012496440671384335, 0.004575697705149651, 0.07080258429050446, 0.0156360175460577, -0.018330136314034462, 0.0031457056757062674, 0.002271227305755019, 0.032472558319568634, -0.026319365948438644, -0.04204729571938515, -0.0076370337046682835, -0.025813676416873932, -0.0032969475723803043, 0.04989001527428627, 0.017030777409672737, 0.007135608699172735, 0.019550450146198273, 0.02164689637720585, 0.006742620375007391, 0.035297900438308716, 0.0005192086100578308, -0.015084896236658096, -0.010244684293866158, 0.006940243765711784, -0.03944738209247589, 0.009958505630493164, 0.04735114052891731, 0.024125730618834496, -0.005250086076557636, -0.009634310379624367, -0.021530291065573692, -0.01934855431318283, -0.01651044748723507, 0.02660123072564602, -0.04435007646679878, -0.003998476080596447, -0.0008289014804176986, -0.03331435099244118, -0.003678996581584215, -0.02748306840658188, -0.012715647928416729, -0.005684640724211931, 0.010233886539936066, -0.025617042556405067, -0.0021973848342895508, 0.0009593401337042451, -0.0032289845403283834, -0.008903785608708858, 0.019395889714360237, 0.005662644747644663, 0.03756781294941902, -0.06865940243005753, -0.029928836971521378, -0.02036176435649395, -0.004312111530452967, -0.020824303850531578, -0.0035558980889618397, 0.03036409430205822, -0.022271068766713142, 0.025199532508850098, -0.01029565092176199, 0.020999357104301453, 0.04552925378084183, 0.0451752133667469, -0.014993691816926003, 0.009609919972717762, -0.01617272011935711, 0.03782711550593376, -0.003938022069633007, 0.05062469467520714, 0.005386975593864918, -0.04803548380732536, -0.0006295553757809103, 0.011952929198741913, -0.007455812767148018, 0.014789183624088764, -0.018589338287711143, 0.01900286227464676, -0.04858618602156639, 0.050315581262111664, -0.08613324165344238, 0.036692630499601364, -0.021675433963537216, -0.022857267409563065, -0.008269790560007095, -0.04142647236585617, -0.005556716583669186, -0.02128213457763195, 0.00008371045259991661, 0.0024080192670226097, -0.004946000874042511, 0.01414905209094286, -0.030598217621445656, 0.032772742211818695, -0.04593315348029137, 0.03734801337122917, -0.003121008398011327, 0.0397261418402195, 0.045381687581539154, 0.050893038511276245, -0.0191111508756876, 0.00423966720700264, 0.025309910997748375, 0.014837176539003849, 0.05344335362315178, 0.024958107620477676, 0.02700316347181797, -0.04240124300122261, -0.011363301426172256, 0.007327103056013584, 0.047560300678014755, -0.09421443194150925, 0.023210126906633377, -0.019077477976679802, -0.0479714497923851, -0.019706815481185913, 0.05039440840482712, -0.0016384305199608207, -0.02480553835630417, 0.014233770780265331, 0.006901465356349945, -0.0046343691647052765, 0.03855110704898834, -0.006996997632086277, 0.0003462995227891952, -0.01926809549331665, -0.02244086004793644, -0.009961584582924843, -0.04810825362801552, -0.0000546258052054327, 0.007808513939380646, -0.003883510362356901, -0.010865939781069756, -0.007639529649168253, 0.046311281621456146, 0.025154275819659233, 0.007187567185610533, -0.020499689504504204, -0.036443017423152924, 0.004169739317148924, 0.020125681534409523, -0.027167702093720436, 0.006787491030991077, 0.008829443715512753, 0.0030391511972993612, -0.01339676883071661, -0.0030080389697104692, 0.032725099474191666, 0.07274185121059418, 0.019570844247937202, -0.04910954460501671, 0.007289281580597162, -0.023181729018688202, 0.003530165646225214, 0.013728017918765545, -0.07420051097869873, 0.025047704577445984, 0.048907116055488586, 0.02312234789133072, 0.0399986170232296, 0.03345688432455063, -0.0001104311304516159, 0.018531566485762596, -0.0387420579791069, 0.00951551366597414, 0.029785720631480217, 0.03698646277189255, -0.022368229925632477, 0.01084010861814022, -0.034715715795755386, 0.014974681660532951, 0.01578330434858799, -0.008106633089482784, -0.009322484023869038, -0.035501834005117416, 0.048925530165433884, 0.010152697563171387, -0.02682623453438282, 0.006708934903144836, 0.017257412895560265, -0.011762375012040138, -0.05682135373353958, -0.02128634974360466, 0.06575272232294083, 0.03984206169843674, 0.0200678501278162, -0.0006231347215361893, -0.03450099006295204, -0.017773225903511047, -0.011918892152607441, 0.021463874727487564, 0.009063581004738808, 0.03944474458694458, -0.009490794502198696, -0.015444793738424778, -0.012401116080582142, 0.046951774507761, -0.0539688840508461, -0.007262364029884338, -0.023301992565393448, 0.019595429301261902, 0.010685892775654793, -0.03986232355237007, 0.005462927743792534, -0.006827759090811014, 0.06757301092147827, 0.0011138904374092817, -0.02646593376994133, -0.03144998475909233, 0.018992267549037933, 0.0017850323347374797, 0.024168046191334724, 0.037883009761571884, -0.006622541230171919, -0.010490726679563522, 0.04297269135713577, -0.03529537469148636, 0.0050300974398851395, -0.01898423582315445, -0.05666687339544296, -0.016218189150094986, 0.002171602565795183, 0.021648360416293144, 0.02770758979022503, 0.009621388278901577, -0.006271732039749622, 0.03456410393118858, 0.009616853669285774, 0.013235395774245262, -0.019418081268668175, 0.03739691153168678, -0.016757076606154442, -0.048160139471292496, 0.05585009977221489, -0.009884867817163467, 0.026192491874098778, -0.00624499749392271, 0.04274507239460945, 0.057412389665842056, -0.0007647612947039306, 0.03718806058168411, 0.007823371328413486, -0.0027084732428193092, 0.032045673578977585, -0.031164992600679398, 0.0023969323374330997, -0.04641502723097801, 0.024070240557193756, 0.03461939096450806, 0.02016184851527214, 0.007789673283696175, -0.022679701447486877, 0.05490456148982048, -0.051552772521972656, -0.014676131308078766, 0.0239697378128767, -0.015720440074801445, 0.0018629375845193863, -0.02578798308968544, 0.025238068774342537, 0.005223111715167761, 0.0025717411190271378, -0.035472556948661804, -0.014410625211894512, 0.041695352643728256, 0.03213699907064438, -0.007542180363088846, -0.026585916057229042, 0.009095422923564911, 0.01071490254253149, 0.08906497806310654, -0.015984466299414635, -0.04842830076813698, -0.007765170652419329, -0.05297185853123665, 0.02561013400554657, -0.016731111332774162, -0.033945705741643906, -0.0036632067058235407, -0.038837067782878876, 0.010444369167089462, -0.025008494034409523, -0.013355392962694168, 0.013435234315693378, 0.019190223887562752, 0.029803356155753136, 0.05479757487773895, -0.010266522876918316, 0.044276077300310135, 0.04358012229204178, -0.01867804303765297, -0.0333525724709034, -0.030138399451971054, -0.03826834633946419, 0.008442928083240986, -0.03212551772594452, 0.06964448094367981, 0.034853991121053696, -0.031096387654542923, -0.00762009434401989, 0.02532953955233097, 0.0044118124060332775, 0.022792117670178413, -0.04120494797825813, 0.00556146027520299, 0.03097480908036232, -0.01912434957921505, 0.045549165457487106, -0.0014320245245471597, 0.00016028729442041367, 0.008529727347195148, 0.018625449389219284, -0.013388420455157757, 0.01065331045538187, 0.04436057060956955, -0.04403458535671234, 0.0025778980925679207, -0.02041410468518734, -0.036674629896879196, 0.03562770411372185, 0.005336208734661341, -0.018042869865894318, -0.01581079512834549, -0.018608229234814644, 0.01215415634214878, -0.014211068861186504, 0.0057745641097426414, 0.028948655351996422, 0.06297241151332855, -0.023769835010170937, 0.00809456966817379, 0.03303011879324913, 0.04360948130488396, 0.04040363058447838, 0.01521382387727499, -0.006668006535619497, 0.004011284094303846, 0.07109346985816956, 0.0003825926105491817, 0.05970574915409088, 0.009731179103255272, -0.03726358339190483, 0.009943641722202301, 0.01840762235224247, 0.011778309941291809, -0.033623095601797104, -0.022579384967684746, 0.022983942180871964, -0.014512808062136173, 0.02819366194307804, -0.024058127775788307, -0.000984960119239986, -0.03162718936800957, 0.02894427441060543, -0.0035060441587120295, 0.01736241951584816, -0.011232912540435791, 0.035509198904037476, 0.0007579357479698956, -0.006391966715455055, 0.026681607589125633, -0.015937047079205513, 0.033730510622262955, 0.0033060661517083645, 0.04854520037770271, 0.0033594577107578516, -0.01056061964482069, -0.02340032160282135, -0.03573707118630409, -0.013135702349245548, 0.011539324186742306, -0.003467388916760683, 0.006802610121667385, 0.015332646667957306, 0.04138730838894844, -0.004977703560143709, 0.026155008003115654, 0.008732320740818977, 0.010881185531616211, 0.020168021321296692, -0.01063068863004446, 0.033212412148714066, 0.04316854104399681, 0.013903718441724777, -0.030085334554314613, 0.03157678246498108, -0.032695699483156204, -0.004637383855879307, -0.002364605199545622, -0.039503585547208786, -0.008403058163821697, 0.01474769227206707, 0.01577667146921158, -0.008474299684166908, -0.0029942297842353582, -0.013764886185526848, 0.015886230394244194, -0.00527966720983386, 0.037343282252550125, 0.03867710754275322, 0.00732358219102025, -0.0013663581339642406, 0.027833620086312294, -0.025505809113383293, -0.01731177046895027, 0.029271278530359268, -0.04449254274368286, -0.012300755828619003, -0.011242357082664967, -0.03015255741775036, 0.015077256597578526, 0.022345954552292824, 0.02365679293870926, 0.07674776762723923, -0.016764717176556587, -0.025312965735793114, 0.03593522310256958, -0.0024508105125278234, -0.051992882043123245, 0.06401880085468292, 0.004226347431540489, 0.0010274298256263137, -0.022922376170754433, 0.00824012141674757, 0.007398190442472696, -0.011745515279471874, -0.03972446545958519, 0.07897267490625381, -0.03929489850997925, -0.01803460717201233, -0.022047143429517746, 0.017006801441311836, 0.027400054037570953, 0.05478368699550629, 0.04696296155452728, -0.014813976362347603, -0.009023627266287804, -0.03285878896713257, -0.0201745443046093, -0.03801223263144493, -0.011983046308159828, -0.009762415662407875, -0.012610995210707188, -0.04957040771842003, 0.023788586258888245, 0.0037913459818810225, 0.004651693161576986, -0.03526895493268967, 0.0067070904187858105, -0.009505563415586948, -0.0023987870663404465, 0.00285524083301425, 0.04551911726593971, 0.04313817247748375, 0.02930588275194168, 0.022637858986854553, 0.012402263469994068, -0.0157304760068655, -0.003108263248577714, 0.006372091826051474, -0.013457825407385826, 0.03487333282828331, -0.015397856943309307, -0.021760227158665657, -0.020131489261984825, -0.024716569110751152, 0.0497254952788353, -0.024180684238672256, 0.05748762562870979, 0.02979375794529915, -0.01874864473938942, -0.026274774223566055, 0.024308521300554276, 0.051561616361141205, -0.015505661256611347, 0.021212846040725708, -0.03511102870106697, 0.0007819313323125243, -0.02170264534652233, 0.04779776558279991, -0.025701286271214485, -0.01004500687122345, 0.022116869688034058, 0.033681321889162064, 0.029988223686814308, -0.013888522051274776, 0.04265661910176277, -0.06770382076501846, 0.00426814891397953, 0.018767381086945534, -0.03272601217031479, -0.0835164338350296, -0.03555450960993767, 0.01636834628880024, 0.040736015886068344, -0.0354047454893589, -0.011660446412861347, 0.0028993841260671616, -0.029538394883275032, 0.014601416885852814, 0.012363503687083721, -0.06010056287050247, -0.013929992914199829, -0.051105886697769165, -0.00689904298633337, 0.0200822576880455, 0.020079081878066063, 0.09093406051397324, -0.0021964749321341515, -0.032052114605903625, 0.006270316429436207 ]
Deploy Embedding Models with Hugging Face Inference Endpoints
philschmid
October 24, 2023
inference-endpoints-embeddings
guide, llm, apps, inference
https://huggingface.co/blog/inference-endpoints-embeddings
3. Deploy Embedding Model as Inference Endpoint To get started, you need to be logged in with a User or Organization account with a payment method on file (you can add oneย here), then access Inference Endpoints atย https://ui.endpoints.huggingface.co Then, click on โ€œNew endpointโ€. Select the repository, the cloud, and the region, adjust the instance and security settings, and deploy in our caseย BAAI/bge-base-en-v1.5. Inference Endpoints suggest an instance type based on the model size, which should be big enough to run the model. Hereย Intel Ice Lake 2 vCPU. To get the performance for the benchmark we ran you, change the instance toย 1x Nvidia A10G. Note: If the instance type cannot be selected, you need toย contact usย and request an instance quota. You can then deploy your model with a click on โ€œCreate Endpointโ€. After 1-3 minutes, the Endpoint should be online and available to serve requests.
[ 0.008940870873630047, -0.013576218858361244, 0.0168426726013422, 0.022396914660930634, 0.00455378508195281, 0.06714020669460297, 0.045307938009500504, 0.030657539144158363, -0.020365983247756958, -0.05046875402331352, -0.029194749891757965, -0.01562870666384697, -0.01194798294454813, 0.06886850297451019, 0.05728617683053017, -0.08151479065418243, 0.03052886389195919, -0.03625396266579628, -0.03580095246434212, -0.018610484898090363, 0.007245594169944525, -0.044110942631959915, -0.007072648499161005, 0.02901855669915676, -0.05751587823033333, -0.06733754277229309, 0.017599139362573624, 0.05214995890855789, 0.04909571632742882, 0.031344808638095856, -0.05842927098274231, -0.03756865859031677, -0.015956256538629532, -0.035746753215789795, 0.03253447264432907, 0.05000697448849678, -0.1514994502067566, 0.010887269861996174, 0.006191783584654331, 0.02392878755927086, 0.030450085178017616, -0.024443861097097397, -0.033587317913770676, 0.08037789165973663, 0.050272151827812195, -0.06431414186954498, -0.09570527821779251, 0.0540199913084507, 0.0003721974790096283, 0.010198461823165417, -0.043963123112916946, 0.05781721696257591, -0.01910792849957943, -0.02627650462090969, 0.021026451140642166, 0.015363188460469246, -0.030547235161066055, -0.13024428486824036, 0.01727282628417015, -0.028977707028388977, 0.045224204659461975, 0.022079188376665115, 0.028198711574077606, 0.017113668844103813, 0.03362012654542923, 0.03197542205452919, -0.05692664161324501, -0.035641949623823166, -0.018756771460175514, -0.035634055733680725, -0.01389909815043211, -0.009754879400134087, 0.05257997661828995, -0.017884306609630585, -0.004451722837984562, -0.03138916194438934, 0.03476171940565109, 0.06296592205762863, 0.12119772285223007, 0.05031343176960945, -0.020301207900047302, 0.011034904979169369, -0.009537803009152412, -0.0389692597091198, -0.0015597615856677294, 0.05144507437944412, -0.009118585847318172, 0.01056643109768629, -0.04997825622558594, 0.01243301760405302, 0.0009697615751065314, -0.09846329689025879, -0.010878372937440872, 0.04106723517179489, 0.0033597524743527174, 0.012514299713075161, 0.07103084772825241, 0.015071081928908825, 0.05119238793849945, -0.06679633259773254, 0.004838453605771065, -0.04843243211507797, -0.02138189785182476, -0.02359110116958618, -0.0068323505111038685, 0.0972699373960495, 0.013867773115634918, -0.065902478992939, -0.052029553800821304, -0.028453318402171135, -0.03348180651664734, -0.0647432953119278, -0.019820572808384895, 0.08136553317308426, -0.13324928283691406, 0.00931613240391016, -0.04972803592681885, -0.017475131899118423, 0.021247420459985733, 0.02909824252128601, 0.08959496766328812, 0.1042613834142685, -0.010475846007466316, 0.02235962077975273, 0.005388922058045864, 0.0637996643781662, 0.020488858222961426, 0.013293239288032055, -0.015762152150273323, 0.0018252269364893436, 0.08412595093250275, -0.05988919734954834, 0.06120746210217476, -0.03393128886818886, 0.03965089097619057, -0.062164802104234695, 0.010929672978818417, -0.11505146324634552, 0.014852996915578842, 0.018778489902615547, 0.00031849657534621656, 0.021194513887166977, 0.02638116106390953, -0.02271844446659088, 0.06792040169239044, 0.026494573801755905, -0.05345107242465019, -0.03834064304828644, 0.03623039647936821, 0.047961022704839706, -0.10927983373403549, 0.07522634416818619, -0.02949625439941883, 0.00850015226751566, 0.017554957419633865, 0.03940609097480774, -0.0348445400595665, 0.035934850573539734, -0.058439284563064575, -0.008385990746319294, -0.001219055731780827, -0.043488483875989914, -0.0796513631939888, 0.006796000991016626, 0.02775692008435726, 0.026312243193387985, 0.01872256211936474, -0.007144923787564039, -0.004978593438863754, 0.01044466719031334, 0.002602339955046773, -0.055717457085847855, 0.08328710496425629, 0.032052669674158096, 0.08284282684326172, 0.029324103146791458, 0.01851174421608448, 0.0488651767373085, 0.01596071571111679, -0.006649314425885677, 0.013224385678768158, 0.10161913186311722, 0.0115723991766572, 0.04579048231244087, 0.021217962726950645, -0.10221033543348312, 0.018751593306660652, -0.02892560139298439, 0.02389828860759735, -0.038497332483530045, 0.003529129084199667, -0.02681993879377842, 0.06923314183950424, 0.0011606840416789055, -0.007404676638543606, -0.0053810058161616325, -0.017010074108839035, 0.07985147088766098, -0.018710536882281303, 0.018533838912844658, 0.032631438225507736, 0.04056326672434807, 0.06139925867319107, -0.01916837878525257, -0.05685044080018997, 0.021008335053920746, -0.025786789134144783, -0.03297511860728264, 0.007744500879198313, 0.06591786444187164, -0.029491642490029335, -0.09467756003141403, 0.0668732225894928, -0.041211165487766266, 0.006012732163071632, -0.054128360003232956, -0.03616413101553917, -0.0029240897856652737, 0.008972140960395336, -0.029436098411679268, 0.16087375581264496, -0.025921784341335297, 0.01165606826543808, -0.038837917149066925, -0.007381797302514315, -0.017281102016568184, 0.06256188452243805, 0.05290937051177025, 0.07560271769762039, -0.03881531581282616, 0.0216880701482296, -0.04877127334475517, -0.03014427423477173, 0.034214358776807785, 0.04631681740283966, 0.002640019403770566, 0.003276529023423791, -0.07287326455116272, 0.012981566600501537, -0.013961547054350376, 0.03735033795237541, -0.014891788363456726, -0.0020495306234806776, -0.01483178324997425, 0.06805942207574844, -0.005299927666783333, 0.05446605011820793, 0.04049389436841011, -0.02250269614160061, -0.0705752894282341, -0.06751058250665665, -0.0014219260774552822, -0.02178233675658703, 0.018029257655143738, 0.04906199872493744, -0.04817535728216171, -0.03035012073814869, 0.0028338388074189425, -0.054174698889255524, 0.06961336731910706, 0.02259429357945919, 0.009503979235887527, -0.004594814497977495, -0.017172766849398613, 0.03588985279202461, 0.0016985178226605058, -0.0954052284359932, -0.01779099926352501, 0.004921814892441034, -0.033701341599226, 0.010411654599010944, -0.003500305349007249, 0.005044019315391779, 0.024241838604211807, 0.015615615993738174, 0.041697803884744644, 0.009348557330667973, -0.016589850187301636, -0.03617490828037262, -0.01649666577577591, 0.010284739546477795, -0.04298801347613335, -0.007051418535411358, 0.04650949686765671, 0.013614052906632423, -0.03262054920196533, -0.007078350055962801, -0.0666738972067833, -0.051956500858068466, 0.010615420527756214, 0.00921185314655304, 0.027471056208014488, 0.03338506445288658, 0.008816639892756939, -0.0036418414674699306, 0.015104619786143303, 0.010482202284038067, 0.0032928804866969585, 0.014154751785099506, 0.008381866849958897, -0.005426336545497179, -0.01724589429795742, 0.030090633779764175, -0.015474088490009308, -0.04476568102836609, 0.03552176058292389, -0.004246218595653772, -0.029344934970140457, -0.08248073607683182, -0.047051429748535156, -0.017675349488854408, 0.015730775892734528, -0.016000669449567795, -0.00835761334747076, 0.03935185447335243, -0.002098703058436513, -0.0004830039688386023, 0.0354229100048542, -0.0006259968504309654, 0.021195100620388985, 0.023215845227241516, -0.00511630205437541, -0.01305511873215437, 0.01734955981373787, 0.04965979978442192, -0.014347841031849384, 0.0039746505208313465, 0.0007866117521189153, -0.054998770356178284, 0.020514382049441338, 0.012453741393983364, 0.0019789438229054213, 0.055894557386636734, -0.011938272975385189, 0.031223690137267113, 0.01983696036040783, 0.038505442440509796, -0.052075792104005814, -0.010726651176810265, -0.05749383941292763, -0.005606966093182564, -0.019971240311861038, -0.06059398129582405, -0.006676321849226952, -0.0047743795439600945, 0.01630420796573162, 0.011982311494648457, 0.011093828827142715, -0.004330403171479702, -0.03021208569407463, 0.01928837224841118, 0.0010117216734215617, 0.015543918125331402, 0.006671546027064323, 0.05715988576412201, 0.04858162999153137, 0.04231657087802887, -0.006234771106392145, 0.012929552234709263, 0.029311910271644592, 0.03481794521212578, 0.026474419981241226, -0.0036989187356084585, 0.04758243262767792, -0.01239633560180664, 0.04298912733793259, 0.026546306908130646, 0.005936054512858391, -0.06332410126924515, -0.019883429631590843, 0.011380394920706749, -0.028010405600070953, -0.0201280377805233, 0.030054112896323204, 0.019349463284015656, -0.004051251336932182, -0.006360671017318964, 0.026705073192715645, -0.02097240649163723, 0.07001613825559616, -0.0006782598211430013, 0.00801797118037939, -0.034059230238199234, -0.016827581450343132, -0.018565403297543526, -0.05385018512606621, 0.04995772987604141, 0.06326829642057419, -0.002314551267772913, -0.010046321898698807, -0.03473690524697304, 0.0007217308157123625, 0.023045066744089127, 0.011279693804681301, 0.028508685529232025, -0.059465330094099045, -0.0035004133824259043, 0.029254820197820663, -0.010989558883011341, -0.015586244873702526, -0.0007026277598924935, -0.016004391014575958, 0.008171306923031807, -0.020423609763383865, 0.00126059225294739, 0.01947763003408909, 0.006413659546524286, 0.002730516716837883, 0.022171523422002792, -0.035915400832891464, -0.002243748167529702, 0.03689592704176903, -0.01112058013677597, -0.017397407442331314, -0.000005189866442378843, 0.00014960512635298073, 0.0039010324981063604, -0.0283148605376482, -0.012283395044505596, 0.012293306179344654, -0.013530361466109753, -0.024440592154860497, 0.01941678114235401, 0.009898461401462555, -0.01697564870119095, 0.021237649023532867, -0.006949722301214933, 0.014686939306557178, -0.009541086852550507, 0.016535013914108276, 0.027732588350772858, -0.06724770367145538, 0.026991020888090134, 0.050763070583343506, -0.012560192495584488, 0.05185913294553757, 0.016260119155049324, -0.0035515623167157173, -0.03189504146575928, 0.017699526622891426, 0.042295217514038086, 0.01768695004284382, 0.007850468158721924, -0.014481714926660061, -0.03130805492401123, -0.00026983744464814663, 0.022477054968476295, 0.048541828989982605, 0.02126350998878479, -0.0024060902651399374, 0.017598852515220642, -0.03639949485659599, 0.012135645374655724, 0.050236452370882034, -0.03423803299665451, -0.00364823080599308, -0.047421716153621674, 0.04905816912651062, -0.003105976153165102, 0.0010651907650753856, -0.007752610370516777, 0.017887217923998833, 0.05497008562088013, 0.012800193391740322, -0.0014489409513771534, -0.01517585851252079, 0.012184248305857182, 0.04137783125042915, -0.0011180398287251592, 0.033013965934515, 0.01117593515664339, 0.010828202590346336, 0.012973335571587086, 0.040842290967702866, -0.0166361965239048, -0.06371628493070602, -0.059246402233839035, 0.018596991896629333, -0.026693720370531082, 0.026653913781046867, 0.02155541628599167, -0.031091690063476562, -0.00864375103265047, 0.05461189150810242, 0.044996000826358795, 0.00004677713877754286, -0.023273270577192307, 0.05193251371383667, 0.0005268926033750176, -0.014619901776313782, 0.012350504286587238, -0.034545980393886566, 0.012698076665401459, -0.0004398921155370772, 0.06784266978502274, 0.05779782310128212, 0.03638199344277382, 0.00008188570791389793, -0.006909338291734457, -0.004588575568050146, 0.03097566030919552, 0.00010753077367553487, -0.017672879621386528, -0.05141559615731239, 0.004858520347625017, -0.006969114765524864, -0.0066103641875088215, -0.032542284578084946, 0.006761283613741398, 0.06514926254749298, -0.029146583750844002, -0.02171723172068596, 0.022581322118639946, 0.01846907287836075, 0.025651628151535988, -0.012301196344196796, 0.06081704422831535, 0.020182421430945396, -0.008146891370415688, -0.013136138208210468, -0.010115976445376873, 0.022250952199101448, 0.0318622924387455, -0.027349062263965607, -0.045865945518016815, 0.02499939687550068, 0.026829876005649567, 0.0783112570643425, -0.04845167323946953, -0.014191769994795322, -0.014788850210607052, -0.01689555123448372, -0.025073204189538956, -0.013160977512598038, -0.015174861997365952, 0.009673615917563438, -0.06924521923065186, 0.010333618149161339, -0.05941063538193703, -0.02902679704129696, 0.012164216488599777, 0.01364932581782341, 0.025187119841575623, 0.039999041706323624, -0.01154953334480524, 0.013916886411607265, 0.07907560467720032, 0.0022238416131585836, -0.011618407443165779, -0.05692251771688461, -0.02252894826233387, -0.004021631553769112, -0.04725904017686844, 0.04961735010147095, 0.04078442603349686, -0.011847344227135181, -0.021422935649752617, 0.01504550501704216, 0.000987680396065116, 0.002047636779025197, 0.0019161023665219545, -0.0202066320925951, -0.013223025016486645, -0.003253190079703927, -0.005897921044379473, 0.04200344160199165, -0.02090594545006752, 0.040877293795347214, 0.013545617461204529, -0.051998451352119446, 0.010506775230169296, 0.006131327711045742, -0.04274377599358559, 0.009656136855483055, -0.04143286496400833, -0.05342865735292435, -0.002120738383382559, 0.008763913996517658, 0.021582739427685738, -0.014771212823688984, -0.00591045618057251, -0.025585319846868515, 0.008680914528667927, 0.007047060411423445, 0.029549159109592438, 0.04447805508971214, -0.031525880098342896, 0.001619077636860311, 0.011654757894575596, 0.05057084560394287, 0.030232258141040802, -0.02088348940014839, 0.01999012939631939, 0.014025842770934105, 0.08396466821432114, 0.040461257100105286, 0.031121494248509407, 0.0035973915364593267, 0.004387219902127981, 0.01533899363130331, 0.03329046070575714, -0.013987148180603981, -0.029190806671977043, -0.007353038061410189, 0.004064733162522316, -0.021012255921959877, 0.05075044557452202, -0.007297466043382883, 0.027406523004174232, 0.013867576606571674, 0.02506159245967865, -0.04138115793466568, -0.0013242543209344149, 0.02001880668103695, 0.005544082727283239, -0.025094138458371162, 0.02040511555969715, 0.0268421471118927, -0.03859793767333031, 0.038635097444057465, -0.02293230965733528, -0.0091630220413208, -0.024447252973914146, 0.03672663867473602, -0.02984868548810482, -0.01657102257013321, -0.058157797902822495, -0.02516607753932476, 0.008353345096111298, 0.01551350113004446, -0.003418623236939311, 0.03755956515669823, -0.036978621035814285, 0.013696204870939255, -0.03797338530421257, -0.019871028140187263, -0.01818585768342018, -0.006330125965178013, 0.0018175714649260044, 0.013332637958228588, 0.020917672663927078, -0.022877855226397514, 0.0045324345119297504, 0.031728386878967285, -0.004212487023323774, -0.030459286645054817, -0.04635526239871979, -0.001075349748134613, -0.017857573926448822, -0.015283443033695221, 0.022831635549664497, 0.004482211545109749, -0.03330457955598831, 0.009749451652169228, 0.013357380405068398, 0.059484921395778656, 0.014548338018357754, 0.007590619847178459, 0.023238159716129303, 0.025345802307128906, -0.03930838778614998, -0.010039913468062878, 0.013833828270435333, -0.025257214903831482, -0.025821130722761154, -0.022017402574419975, -0.018241973593831062, -0.038167472928762436, 0.030605798587203026, 0.010260888375341892, 0.049166787415742874, -0.03210941329598427, -0.02866886369884014, 0.021135643124580383, 0.010029097087681293, -0.04229434207081795, 0.058595187962055206, -0.017767179757356644, 0.01568419113755226, -0.014780782163143158, 0.042049676179885864, 0.019367381930351257, -0.00833902694284916, -0.02675035409629345, 0.03494013100862503, -0.048100538551807404, -0.06329464167356491, -0.02898438461124897, 0.021311022341251373, -0.010366642847657204, 0.03435717895627022, 0.023922571912407875, 0.012705095112323761, -0.0183380376547575, -0.007111181039363146, -0.0148096838966012, -0.05576057359576225, 0.026713291183114052, -0.05654406175017357, -0.0430714376270771, -0.0484989695250988, 0.0029656882397830486, -0.0044212727807462215, 0.012083458714187145, -0.020457318052649498, -0.03830237314105034, -0.02483593486249447, -0.018277764320373535, -0.0015795726794749498, -0.01715991273522377, 0.02743251994252205, 0.05750567838549614, 0.03444313257932663, -0.012094068340957165, -0.0330975241959095, 0.0382634736597538, -0.03431536629796028, -0.012947737239301205, 0.05624581128358841, 0.01489853486418724, -0.017165759578347206, -0.011477131396532059, -0.008010807447135448, 0.04414769262075424, -0.028855662792921066, 0.055265460163354874, -0.002809265162795782, -0.02827262319624424, -0.03975082188844681, 0.0034751039929687977, 0.0282683577388525, 0.012967068701982498, 0.038165487349033356, -0.05672376602888107, -0.013083373196423054, -0.006450925022363663, -0.015412353910505772, -0.043187204748392105, -0.026837805286049843, -0.030317997559905052, -0.02050984464585781, 0.03190043941140175, -0.004180702846497297, 0.014905110001564026, -0.024239081889390945, -0.013438526540994644, 0.02252267859876156, -0.00009084359044209123, -0.06878192722797394, -0.023056427016854286, 0.005077108275145292, 0.056807998567819595, -0.015836240723729134, -0.023912090808153152, -0.011780635453760624, -0.025066113099455833, 0.0008208799408748746, 0.003408815711736679, -0.0236076507717371, 0.01073914673179388, -0.0006441827863454819, -0.012305156327784061, -0.052375733852386475, 0.024517342448234558, 0.041233718395233154, -0.01742667891085148, -0.04660980775952339, -0.006700478959828615 ]
Deploy Embedding Models with Hugging Face Inference Endpoints
philschmid
October 24, 2023
inference-endpoints-embeddings
guide, llm, apps, inference
https://huggingface.co/blog/inference-endpoints-embeddings
1. What is Hugging Face Inference Endpoints? Hugging Face Inference Endpointsย offers an easy and secure way to deploy Machine Learning models for use in production. Inference Endpoints empower developers and data scientists to create Generative AI applications without managing infrastructure: simplifying the deployment process to a few clicks, including handling large volumes of requests with autoscaling, reducing infrastructure costs with scale-to-zero, and offering advanced security. Here are some of the most important features: 1. Easy Deployment: Deploy models as production-ready APIs with just a few clicks, eliminating the need to handle infrastructure or MLOps. 2. Cost Efficiency: Benefit from automatic scale to zero capability, reducing costs by scaling down the infrastructure when the endpoint is not in use, while paying based on the uptime of the endpoint, ensuring cost-effectiveness. 3. Enterprise Security: Deploy models in secure offline endpoints accessible only through direct VPC connections, backed by SOC2 Type 2 certification, and offering BAA and GDPR data processing agreements for enhanced data security and compliance. 4. LLM Optimization: Optimized for LLMs, enabling high throughput with Paged Attention and low latency through custom transformers code and Flash Attention power by Text Generation Inference 5. Comprehensive Task Support: Out of the box support for ๐Ÿค— Transformers, Sentence-Transformers, and Diffusers tasks and models, and easy customization to enable advanced tasks like speaker diarization or any Machine Learning task and library. You can get started with Inference Endpoints at:ย https://ui.endpoints.huggingface.co/
[ 0.03546779975295067, -0.000662049395032227, 0.07819999009370804, -0.004462013021111488, 0.05813762545585632, 0.06632847338914871, 0.049598827958106995, 0.08173102885484695, -0.013109099119901657, -0.026597805321216583, -0.0877823531627655, 0.015066566877067089, -0.023686932399868965, 0.0612507127225399, 0.021419625729322433, -0.08251991868019104, 0.008735109120607376, 0.008010250516235828, -0.04296762868762016, 0.030848117545247078, 0.017682617530226707, -0.06267230957746506, -0.003789698239415884, -0.0014761951752007008, -0.03165575489401817, -0.06080435961484909, -0.024661371484398842, -0.0316716805100441, -0.022007443010807037, 0.03283748775720596, -0.0897563174366951, -0.046782948076725006, 0.0056687272153794765, -0.01780400425195694, 0.04238545522093773, -0.001243474893271923, -0.17013323307037354, 0.030367005616426468, 0.024243732914328575, 0.017081843689084053, 0.0037669872399419546, -0.0394635908305645, -0.10597114264965057, 0.029619811102747917, -0.013516388833522797, -0.05453864112496376, -0.14280462265014648, 0.07582659274339676, -0.034342456609010696, 0.010517412796616554, -0.09552198648452759, 0.10496830940246582, -0.007325255312025547, 0.005804967135190964, 0.033857159316539764, -0.01097031682729721, -0.04327620193362236, -0.10669725388288498, 0.04520215839147568, -0.02584231272339821, -0.01735764741897583, -0.03387570381164551, 0.017950162291526794, 0.011513409204781055, 0.034190285950899124, 0.02422870136797428, -0.005378171801567078, -0.018520163372159004, -0.05129021406173706, -0.022446859627962112, 0.00963854230940342, -0.005859490018337965, 0.006729307118803263, -0.008345694281160831, -0.004018194507807493, -0.027553699910640717, -0.00997842289507389, 0.03134496882557869, 0.06373762339353561, 0.007863081060349941, -0.0027056592516601086, 0.013464681804180145, 0.032180920243263245, -0.008172220550477505, 0.024587145075201988, 0.04432268440723419, 0.0122976154088974, -0.02292117103934288, -0.04288419708609581, 0.024460960179567337, 0.011609465815126896, -0.10813602060079575, -0.02017746865749359, 0.021087970584630966, 0.027331961318850517, 0.010675331577658653, 0.04089251905679703, 0.03780556842684746, 0.00107191049028188, -0.04268233850598335, -0.014011131599545479, -0.031246371567249298, -0.026549188420176506, -0.01745970919728279, -0.04163489118218422, 0.06875758618116379, 0.01499573141336441, -0.06726633757352829, -0.03919166326522827, 0.019445057958364487, -0.017333051189780235, -0.03991415724158287, 0.023292304947972298, 0.07654132694005966, -0.10067188739776611, 0.06243147701025009, -0.060935355722904205, 0.001794452196918428, 0.0377381406724453, 0.005808512680232525, 0.08823318034410477, 0.05023760348558426, 0.007723661605268717, 0.002365035004913807, -0.024923458695411682, 0.04655514284968376, -0.007312745787203312, 0.031148917973041534, 0.008645797148346901, -0.0020473406184464693, 0.009502798318862915, -0.05692154914140701, 0.013722045347094536, -0.024146167561411858, 0.009245935827493668, -0.07832343876361847, -0.0046457042917609215, -0.08950014412403107, 0.07073985040187836, -0.01694200560450554, -0.027612822130322456, 0.05235159397125244, 0.04377934709191322, 0.0033638363238424063, 0.08772627264261246, -0.0036752731539309025, -0.08301062881946564, -0.006723112426698208, -0.004547906573861837, 0.06638224422931671, -0.053437668830156326, 0.05402149260044098, -0.03407744690775871, -0.04605774208903313, -0.023577561601996422, 0.036461979150772095, 0.00989644043147564, -0.01299652922898531, -0.04140513762831688, -0.06408966332674026, -0.025611821562051773, -0.04894338548183441, -0.0286480151116848, 0.008519541472196579, 0.04404439404606819, 0.04622618854045868, -0.008545592427253723, 0.007924653589725494, -0.016393298283219337, 0.015803780406713486, -0.014512411318719387, -0.05220285430550575, 0.06109612435102463, -0.02526923269033432, 0.028789235278964043, 0.03780830278992653, 0.027452431619167328, 0.05833956599235535, -0.0013879218604415655, 0.030077291652560234, -0.034540895372629166, 0.09185285866260529, 0.018379289656877518, 0.017045101150870323, 0.06497973203659058, -0.06780974566936493, 0.019187310710549355, -0.026917165145277977, -0.029338225722312927, -0.027502084150910378, -0.02850339375436306, -0.003969824407249689, 0.051974792033433914, -0.04115370288491249, 0.01901932992041111, -0.057567909359931946, -0.047103654593229294, 0.1718602329492569, -0.005094737280160189, 0.05180899053812027, 0.0333634614944458, 0.023561794310808182, 0.059058915823698044, -0.04953109100461006, -0.062343087047338486, 0.04402341693639755, 0.006619611289352179, -0.0472525916993618, 0.003429577685892582, 0.05346013978123665, -0.0026869908906519413, -0.14678235352039337, 0.0023390420246869326, -0.04583847150206566, -0.015313614159822464, -0.05625269562005997, -0.047681283205747604, -0.028399545699357986, 0.04529673978686333, -0.005167635157704353, 0.16383947432041168, -0.07757211476564407, 0.0032288155052810907, -0.026678146794438362, -0.019349537789821625, 0.014703435823321342, 0.05881573259830475, 0.06434556096792221, 0.09459752589464188, -0.005987643729895353, -0.03533485531806946, -0.08513698726892471, -0.04002814367413521, 0.02730761468410492, 0.03650660440325737, 0.03083129972219467, 0.021738246083259583, -0.03368362784385681, 0.02840779908001423, -0.03394458442926407, 0.02562696300446987, -0.0022632814943790436, 0.04456476867198944, 0.023611070588231087, 0.018831705674529076, -0.05807508900761604, 0.08679252862930298, 0.033844172954559326, -0.04610283300280571, -0.03790922835469246, -0.06508015096187592, 0.03037230111658573, 0.011942176148295403, -0.019018633291125298, 0.08300931751728058, -0.0078075360506772995, -0.01900426857173443, 0.026029275730252266, -0.03073413297533989, 0.047540564090013504, 0.017589647322893143, -0.05620194971561432, 0.027851685881614685, -0.025989526882767677, 0.01601450890302658, -0.022605761885643005, -0.04586082324385643, 0.013186250813305378, 0.004153062589466572, 0.016727657988667488, 0.047720253467559814, -0.008132451213896275, 0.024264952167868614, 0.03450636565685272, 0.025458574295043945, 0.026878902688622475, 0.0620659738779068, -0.00006234190368559211, -0.007065700367093086, -0.04088800027966499, 0.01431483868509531, -0.02777177281677723, 0.010895933024585247, 0.08253172039985657, 0.041344910860061646, -0.029278215020895004, -0.0073511493392288685, -0.02794136479496956, -0.052835866808891296, -0.0055307806469500065, 0.019664548337459564, 0.0007133532199077308, -0.014444365166127682, -0.018753523007035255, -0.028867708519101143, 0.006169761531054974, -0.00012186683306936175, -0.012132706120610237, -0.0010344183538109064, 0.02704477496445179, 0.00836867280304432, -0.027601804584264755, 0.011892498470842838, -0.017910897731781006, -0.030109047889709473, 0.04586446285247803, 0.01574419066309929, 0.005121311638504267, -0.10526349395513535, -0.03722911328077316, -0.021190814673900604, -0.004711817018687725, -0.030025562271475792, -0.027659673243761063, 0.04800848662853241, -0.011242326349020004, -0.010852760635316372, 0.022596241906285286, -0.0045107328332960606, 0.016070635989308357, 0.043282877653837204, -0.016538185998797417, -0.021049747243523598, -0.003855668706819415, 0.021977324038743973, -0.02312816120684147, 0.02948598377406597, 0.014229278080165386, -0.02469588816165924, 0.013628675602376461, 0.03319406136870384, -0.015180224552750587, 0.028172114863991737, -0.016514427959918976, 0.03751258924603462, 0.015233328565955162, 0.017250165343284607, -0.04524979740381241, -0.0049324845895171165, -0.016260743141174316, -0.014662649482488632, 0.0007402764749713242, -0.05631009489297867, 0.003393792314454913, 0.016978444531559944, 0.010541088879108429, 0.020957717671990395, 0.021422991529107094, 0.01828935369849205, -0.010711234994232655, 0.008144480176270008, 0.003612467320635915, 0.027504120022058487, 0.0023816567845642567, 0.021277520805597305, -0.004719833843410015, 0.06469877064228058, -0.006702410988509655, -0.010473293252289295, 0.010985281318426132, 0.025287548080086708, 0.06112605705857277, 0.018102049827575684, 0.00552592845633626, -0.016258006915450096, 0.014109565876424313, 0.030814656987786293, 0.02230444923043251, -0.08239524066448212, 0.01996712200343609, -0.00419072387740016, -0.044711966067552567, -0.04003457725048065, 0.06157248467206955, 0.009239472448825836, -0.04048525169491768, 0.01166987232863903, 0.022701194509863853, 0.0014166414039209485, 0.07982756197452545, -0.0036150915548205376, 0.006810743361711502, -0.02133066952228546, 0.003398523200303316, -0.024654509499669075, -0.04393047094345093, 0.06840578466653824, 0.027780139818787575, -0.010744753293693066, 0.003999717999249697, -0.010787071660161018, -0.005767693743109703, 0.03353338688611984, 0.014119754545390606, 0.03586225211620331, -0.0058867172338068485, -0.011853770352900028, 0.053394924849271774, -0.02019776962697506, -0.041507214307785034, 0.04276614263653755, -0.02760167047381401, 0.00351606123149395, -0.0037957511376589537, 0.02369285747408867, 0.01674194633960724, 0.0036773437168449163, -0.013049290515482426, 0.010316084139049053, -0.04100270941853523, -0.022766651585698128, 0.01684051752090454, -0.03359903395175934, 0.024959422647953033, -0.004723741672933102, 0.0004723483871202916, 0.0031317858956754208, -0.02687905728816986, 0.03192974999547005, 0.028269143775105476, 0.00966218113899231, -0.02189568430185318, 0.04619739577174187, 0.03168981522321701, 0.0003197781916242093, 0.0008863731054589152, -0.03378302603960037, 0.014853221364319324, -0.028237422928214073, 0.0323074571788311, 0.007756585720926523, -0.028095977380871773, 0.023414283990859985, 0.027413932606577873, 0.0035010420251637697, 0.013259419240057468, -0.002610944677144289, -0.019220372661948204, -0.028404206037521362, 0.013707254081964493, 0.05609193444252014, -0.008889354765415192, 0.01503827329725027, -0.0031194635666906834, -0.03265460580587387, 0.012265139259397984, -0.0019853373523801565, 0.026000753045082092, -0.0025624472182244062, -0.014148104004561901, 0.01329832710325718, -0.012433474883437157, 0.010330586694180965, 0.013723942451179028, -0.0481448695063591, -0.012296506203711033, -0.034736547619104385, 0.01940387859940529, 0.0077595761977136135, -0.0027042641304433346, -0.021869391202926636, 0.011179598979651928, 0.048744238913059235, -0.016331974416971207, -0.02047012932598591, -0.016113560646772385, 0.02469172142446041, 0.027661394327878952, -0.006760530173778534, 0.013217215426266193, -0.01321819331496954, 0.003049097955226898, 0.03103582002222538, 0.015530173666775227, -0.01885204203426838, -0.04195845499634743, -0.026782333850860596, -0.006858013570308685, -0.029868226498365402, 0.012483090162277222, 0.028811439871788025, -0.03325747698545456, 0.0010354589903727174, 0.04171913117170334, 0.02638648822903633, 0.02473641186952591, 0.00007511843432439491, 0.023279933258891106, -0.00541023351252079, -0.007527126464992762, 0.04549422487616539, -0.009967016987502575, 0.018610181286931038, 0.00854652188718319, 0.07532624155282974, 0.0803452730178833, 0.03117228113114834, 0.022155888378620148, -0.015374444425106049, -0.02091178484261036, 0.017687682062387466, -0.03583596646785736, 0.004010771866887808, -0.032731182873249054, 0.010814256966114044, 0.03175724670290947, -0.008244150318205357, 0.0008050431497395039, -0.015423554927110672, 0.07177133113145828, -0.03167502209544182, -0.0041952538304030895, 0.03417450189590454, 0.014242241159081459, 0.03309992700815201, 0.001590496744029224, 0.0234022568911314, -0.00860137864947319, 0.021053997799754143, -0.01286918856203556, -0.013422711752355099, 0.01452838908880949, 0.01580357924103737, -0.025652041658759117, -0.06177779659628868, 0.020470747724175453, 0.05370751768350601, 0.05664028227329254, -0.009001160971820354, -0.028737211599946022, -0.022238556295633316, -0.012787890620529652, 0.03403867408633232, -0.019860992208123207, -0.02407999150454998, 0.019360503181815147, -0.0038310931995511055, 0.0032060903031378984, -0.00440705893561244, -0.012608804740011692, 0.01979159004986286, 0.006250567268580198, 0.014638418331742287, 0.020713578909635544, -0.039806585758924484, 0.04381486400961876, 0.05430825799703598, 0.010409210808575153, -0.024008391425013542, -0.010987251065671444, -0.015268565155565739, -0.01871352642774582, -0.032870132476091385, 0.04993376135826111, 0.04138178005814552, -0.0396893136203289, -0.028839856386184692, -0.010628803633153439, 0.011341051198542118, 0.014965405687689781, 0.009043787606060505, -0.03261636570096016, 0.011097678914666176, -0.00556310685351491, 0.018825789913535118, 0.0140672093257308, 0.014392774552106857, -0.012600675225257874, 0.01252346858382225, -0.05308210104703903, 0.021614274010062218, 0.004892717115581036, -0.0589677169919014, 0.03101339563727379, -0.026153594255447388, -0.031102817505598068, 0.03930169716477394, 0.012158658355474472, -0.0033065215684473515, 0.013899538666009903, 0.028504200279712677, -0.010974898003041744, -0.013949315063655376, -0.021154770627617836, 0.03215736523270607, 0.05359412729740143, -0.034909095615148544, 0.010261725634336472, 0.009290535002946854, 0.04979749023914337, 0.04967117682099342, -0.006620726082473993, 0.05138397961854935, -0.019495271146297455, 0.09036539494991302, 0.012719088234007359, 0.06023648753762245, 0.009226585738360882, -0.017438236624002457, 0.027970798313617706, 0.026864124462008476, 0.005409231875091791, -0.04729760065674782, -0.030881443992257118, 0.03383399918675423, -0.01288660429418087, 0.05168035626411438, -0.0032180841080844402, 0.0205795057117939, 0.00917259231209755, 0.028590768575668335, -0.014782262034714222, -0.0002524120209272951, 0.02740759775042534, 0.027751537039875984, 0.012473746202886105, 0.03842232748866081, 0.024286892265081406, -0.016541341319680214, 0.05952947959303856, 0.02207375317811966, 0.03268317133188248, -0.010501964949071407, -0.004289612639695406, -0.005409013479948044, -0.047662947326898575, -0.023154860362410545, -0.00015701979282312095, 0.012873000465333462, -0.011257394216954708, -0.015640882775187492, 0.025105498731136322, -0.00635460065677762, 0.024781212210655212, -0.008920812979340553, 0.004232096020132303, 0.0036868632305413485, -0.007350996136665344, 0.01718824729323387, 0.04779977723956108, 0.025884198024868965, -0.04006580635905266, -0.010786891914904118, -0.013456101529300213, 0.016630226746201515, -0.02022666297852993, -0.03569609299302101, -0.052599165588617325, -0.004100198391824961, -0.01764613762497902, 0.014965168200433254, 0.021549835801124573, -0.014620732516050339, 0.014778593555092812, 0.007847932167351246, 0.03901132196187973, 0.024118853732943535, -0.00011738038301700726, 0.03908318653702736, 0.011260608211159706, -0.03499407693743706, 0.0015317554352805018, 0.004436385817825794, -0.00510884914547205, -0.03088361956179142, -0.021294184029102325, -0.02617417275905609, -0.05125213414430618, 0.01626126654446125, 0.004552788101136684, 0.05120139196515083, -0.01859162375330925, -0.022701438516378403, 0.009021256119012833, -0.009972842410206795, -0.012292549014091492, 0.03664732351899147, -0.01550170499831438, 0.0009215495665557683, -0.01871182583272457, 0.011301953345537186, -0.019789250567555428, -0.015205026604235172, -0.02018745429813862, 0.06509553641080856, -0.008796743117272854, -0.0421324297785759, -0.017923319712281227, 0.04323398694396019, 0.02701987698674202, 0.06738352030515671, 0.04365401715040207, 0.004468041937798262, -0.009747681207954884, -0.04730362072587013, -0.00562271336093545, -0.06541942805051804, 0.0066062817350029945, -0.030801912769675255, -0.03454874828457832, -0.03290465474128723, 0.004684542305767536, -0.001475274097174406, -0.01748599484562874, -0.006077670492231846, -0.035065241158008575, -0.02942456491291523, -0.03988334536552429, -0.016384275630116463, 0.014190779067575932, 0.055782921612262726, 0.04492252320051193, 0.009097759611904621, 0.011323506943881512, -0.008735532872378826, 0.0015882434090599418, -0.00012953505211044103, 0.01948266662657261, 0.04212326928973198, -0.011880690231919289, -0.013700728304684162, -0.03901971876621246, -0.003866699291393161, 0.024298202246427536, -0.04119682312011719, 0.02881411649286747, 0.004046490881592035, -0.011428087949752808, -0.004437955096364021, 0.008836607448756695, 0.029811352491378784, -0.014237884432077408, 0.035291966050863266, -0.04287001118063927, 0.006631012074649334, -0.0030138271395117044, -0.012748955748975277, -0.04761167988181114, -0.019781509414315224, -0.006206492893397808, 0.013142591342329979, 0.057211533188819885, 0.008952234871685505, 0.00014118157560005784, -0.05592895299196243, 0.006045615300536156, 0.016824793070554733, -0.0341305248439312, -0.07477550953626633, -0.03810560703277588, 0.01120282243937254, 0.014420967549085617, -0.017139457166194916, -0.027830494567751884, -0.01247020997107029, -0.030084403231739998, 0.005523581523448229, 0.0027388690505176783, -0.03143221139907837, -0.0008063861750997603, -0.02452399767935276, 0.007388148456811905, -0.010322174988687038, 0.04722054675221443, 0.055815570056438446, 0.00635132659226656, -0.05370445176959038, -0.01916513405740261 ]
Interactively explore your Huggingface dataset with one line of code
sps44
October 25, 2023
scalable-data-inspection
open-source-collab, visualization, data inspection
https://huggingface.co/blog/scalable-data-inspection
Leveraging model results for data inspection Exploring raw unstructured datasets often yield little insights. Leveraging model results such as predictions or embeddings can help to uncover critical data samples and clusters. Spotlight has several visualization options (e.g. similarity map, confusion matrix) that specifically make use of model results. We recommend storing your prediction results directly in a Hugging Face dataset. This not only allows you to take advantage of the batch processing capabilities of the datasets library, but also keeps label mappings. We can use the transformers library to compute embeddings and predictions on the CIFAR-100 image classification problem. We install the libraries via pip: bash pip install renumics-spotlight datasets transformers[torch] Now we can compute the enrichment: python import torch import transformers device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") model_name = "Ahmed9275/Vit-Cifar100" processor = transformers.ViTImageProcessor.from_pretrained(model_name) cls_model = transformers.ViTForImageClassification.from_pretrained(model_name).to(device) fe_model = transformers.ViTModel.from_pretrained(model_name).to(device) def infer(batch): images = [image.convert("RGB") for image in batch] inputs = processor(images=images, return_tensors="pt").to(device) with torch.no_grad(): outputs = cls_model(**inputs) probs = torch.nn.functional.softmax(outputs.logits, dim=-1).cpu().numpy() embeddings = fe_model(**inputs).last_hidden_state[:, 0].cpu().numpy() preds = probs.argmax(axis=-1) return {"prediction": preds, "embedding": embeddings} features = datasets.Features({**ds.features, "prediction": ds.features["fine_label"], "embedding": datasets.Sequence(feature=datasets.Value("float32"), length=768)}) ds_enriched = ds.map(infer, input_columns="img", batched=True, batch_size=2, features=features) If you donโ€™t want to perform the full inference run, you can alternatively download pre-computed model results for CIFAR-100 to follow this tutorial: python ds_results = datasets.load_dataset('renumics/spotlight-cifar100-enrichment', split='test') ds_enriched = datasets.concatenate_datasets([ds, ds_results], axis=1) We can now use the results to interactively explore relevant data samples and clusters in Spotlight: python layout = spotlight.layouts.debug_classification(label='fine_label', embedding='embedding', inspect={'img': spotlight.dtypes.image_dtype}) spotlight.show(ds_enriched, dtype={'embedding': spotlight.Embedding}, layout=layout)
[ -0.012946582399308681, -0.04651875048875809, -0.006633911281824112, -0.005530891474336386, -0.0007705488824285567, 0.08415857702493668, -0.0017236352432519197, 0.020810000598430634, -0.10550877451896667, -0.047412317246198654, -0.07560624182224274, 0.03599470108747482, 0.06697553396224976, 0.0628315731883049, 0.002663963008671999, -0.08051417022943497, 0.056529104709625244, 0.0376419723033905, 0.03874295949935913, 0.09160102903842926, 0.04394478350877762, -0.08904923498630524, -0.0033581771422177553, 0.020145298913121223, -0.03336748853325844, -0.054857585579156876, 0.06787697225809097, -0.018994798883795738, -0.03661349415779114, 0.05159202963113785, -0.1849994957447052, -0.008387619629502296, -0.03348125144839287, 0.008006581105291843, -0.02761787362396717, 0.05283130705356598, -0.10425359755754471, 0.045941390097141266, 0.05078703537583351, -0.030119407922029495, 0.02559792250394821, -0.047453440725803375, -0.06505169719457626, 0.04671446606516838, 0.03665294498205185, -0.041489265859127045, -0.13571180403232574, 0.027746150270104408, -0.01340077817440033, -0.03660218417644501, -0.06134125217795372, 0.07425154000520706, 0.0029565240256488323, -0.018500180914998055, 0.009603177197277546, 0.030593648552894592, 0.027380624786019325, -0.10761342197656631, 0.022555766627192497, 0.028195034712553024, -0.03045286051928997, 0.039358898997306824, 0.0008031612378545105, 0.047160014510154724, -0.0010197133524343371, 0.00961130578070879, 0.03245101496577263, -0.006529686506837606, -0.037394843995571136, -0.021242426708340645, 0.040317025035619736, 0.01811079867184162, -0.02657497487962246, -0.03262265399098396, -0.01538938283920288, -0.026228221133351326, -0.001204593339934945, 0.04534347727894783, 0.04439079388976097, -0.018562577664852142, -0.04162966459989548, -0.03257898986339569, -0.027819417417049408, 0.013969547115266323, 0.01973814144730568, 0.027040138840675354, 0.00206752005033195, -0.04142238572239876, -0.06633125245571136, 0.08035577833652496, -0.011242699809372425, -0.06410805881023407, -0.011749842204153538, 0.08105137199163437, -0.011719539761543274, -0.031811442226171494, 0.028340907767415047, -0.01974569261074066, -0.03132377192378044, -0.024990437552332878, -0.046215105801820755, -0.026346050202846527, -0.008307411335408688, -0.03582051023840904, -0.06402376294136047, 0.005266652908176184, -0.05752960219979286, -0.0704464539885521, -0.07202570140361786, -0.010647173970937729, -0.018351290374994278, -0.04605330526828766, -0.0521024689078331, 0.06279575824737549, -0.05968209356069565, -0.011007961817085743, 0.0008655653800815344, 0.03998807817697525, -0.010288974270224571, 0.01681664027273655, -0.02350962534546852, 0.08285731077194214, 0.028674785047769547, 0.023592248558998108, 0.017765207216143608, 0.11121375113725662, 0.000761127274017781, 0.05753910169005394, 0.054133400321006775, 0.039562199264764786, -0.035439301282167435, -0.014742852188646793, 0.007340277079492807, 0.029921459034085274, -0.007490864023566246, -0.042173225432634354, 0.005964560434222221, -0.0542590469121933, 0.0029343306086957455, -0.012657323852181435, -0.03370092064142227, 0.013201705180108547, -0.01982790417969227, -0.004387096967548132, 0.006366446148604155, 0.006211552768945694, -0.03813058137893677, 0.08294853568077087, -0.007008895743638277, 0.07231637090444565, -0.07039730250835419, 0.023682234808802605, -0.009162312373518944, -0.037335872650146484, -0.028353901579976082, 0.045023005455732346, -0.004315124358981848, -0.0016840466996654868, -0.05169856175780296, -0.01624995470046997, -0.03323649242520332, 0.03164215758442879, -0.00374444923363626, -0.019269919022917747, 0.040902283042669296, -0.02481076866388321, 0.005242112558335066, -0.03458927199244499, 0.04925049468874931, 0.10937073826789856, 0.01007872261106968, -0.04259711876511574, 0.049221985042095184, -0.046050459146499634, -0.009200132451951504, 0.0899231806397438, 0.026323333382606506, 0.0028645202983170748, -0.04581516236066818, -0.03343009576201439, -0.03743967041373253, 0.027705205604434013, -0.022836977615952492, 0.03860890492796898, 0.011210678145289421, -0.08354370296001434, 0.038660503923892975, -0.033705513924360275, 0.011399289593100548, 0.038975898176431656, -0.08422670513391495, 0.019723812118172646, 0.0769670233130455, -0.04654435068368912, 0.05810089409351349, -0.022321319207549095, -0.02401793748140335, 0.05589868500828743, -0.0012876581167802215, -0.024066034704446793, -0.006766212172806263, -0.020123109221458435, 0.011046738363802433, -0.05038584768772125, 0.004668594337999821, -0.033683791756629944, 0.04529906064271927, -0.047499071806669235, -0.02333875559270382, -0.009537208825349808, 0.015454549342393875, -0.13003037869930267, 0.0287258829921484, -0.04539049044251442, -0.005165292881429195, 0.01655629090964794, -0.06008720397949219, 0.02695636637508869, -0.04838176816701889, 0.044943444430828094, 0.1375538557767868, 0.04257731884717941, 0.03043682686984539, -0.05731824040412903, -0.022652555257081985, 0.03070475347340107, 0.04262508824467659, 0.10473945736885071, 0.0673278346657753, -0.05830637365579605, -0.0541854090988636, -0.03425777703523636, -0.009368622675538063, 0.017790330573916435, -0.05193212255835533, -0.01150784082710743, 0.06160247325897217, 0.11235079914331436, 0.04587332159280777, 0.002870311262086034, 0.0051701911725103855, -0.01643959805369377, -0.028260253369808197, 0.05699143186211586, 0.06547839194536209, -0.04284181818366051, 0.05880168825387955, 0.0013345713960006833, -0.020293405279517174, -0.0011683549964800477, -0.026827966794371605, 0.07866748422384262, -0.013137131929397583, -0.022667812183499336, -0.0014238122384995222, -0.005605454556643963, 0.007740242872387171, 0.005437363870441914, -0.03459988906979561, 0.057707346975803375, -0.01665435917675495, -0.04569801315665245, -0.04707442596554756, -0.03446178138256073, 0.02132636308670044, -0.03282541409134865, 0.0069420053623616695, -0.010249937884509563, 0.0020595977548509836, 0.019348887726664543, 0.011187762022018433, -0.05865424498915672, 0.03862157091498375, 0.022223670035600662, 0.05909999832510948, 0.04860207065939903, 0.03197864070534706, -0.031976502388715744, 0.01449864637106657, -0.007131366990506649, -0.032133594155311584, 0.011739642359316349, 0.05116470903158188, 0.03651310130953789, 0.003912086598575115, 0.011292376555502415, -0.036931369453668594, 0.009275766089558601, -0.007705484051257372, 0.049913834780454636, -0.004831611178815365, 0.05030332878232002, 0.040027786046266556, -0.03575541451573372, -0.019640713930130005, 0.04271162301301956, -0.034958358854055405, 0.024202756583690643, -0.052303556352853775, 0.02361416257917881, -0.04521073400974274, -0.006649368442595005, -0.0029471085872501135, -0.004414430819451809, -0.006982959341257811, 0.025616664439439774, 0.007386360317468643, 0.020564451813697815, -0.08663424104452133, 0.014943050220608711, 0.036656249314546585, -0.01109504047781229, 0.003518965793773532, -0.023750655353069305, 0.03762584552168846, 0.04483617842197418, -0.001583835226483643, -0.014108188450336456, 0.013303120620548725, 0.01248321682214737, -0.007532612420618534, 0.051250483840703964, 0.01778787188231945, 0.039826542139053345, 0.017912661656737328, -0.023423604667186737, 0.0376647412776947, 0.02485857717692852, -0.017628898844122887, 0.02574053406715393, 0.00904810894280672, 0.01719501242041588, -0.05855466052889824, -0.026614071801304817, 0.04924680292606354, -0.02662353590130806, -0.01305218692868948, -0.03331940248608589, -0.032226428389549255, -0.027884962037205696, -0.015070503577589989, 0.01773269660770893, -0.045782383531332016, 0.015535523183643818, 0.024508466944098473, 0.006159432232379913, 0.023455306887626648, 0.03589000552892685, 0.0008899630047380924, 0.023598136380314827, 0.011429461650550365, 0.00787160824984312, 0.03722592815756798, -0.020732451230287552, 0.008542189374566078, -0.01779048889875412, -0.013909623958170414, -0.02591891586780548, -0.04928726330399513, 0.005447416100651026, -0.018384847790002823, 0.0700361430644989, -0.009266193024814129, 0.031697917729616165, 0.014843998476862907, 0.01024636160582304, -0.029831230640411377, 0.001667470089159906, -0.045453716069459915, 0.015417780727148056, -0.05020542070269585, -0.037952493876218796, -0.010595105588436127, 0.011835313402116299, 0.014622984454035759, 0.015670256689190865, -0.029320128262043, 0.011643996462225914, 0.05084078386425972, 0.043752871453762054, -0.015513655729591846, -0.003240627236664295, -0.022402336820960045, -0.011789586395025253, 0.005559922661632299, -0.03547423705458641, 0.02400306984782219, 0.036614689975976944, -0.024631965905427933, -0.03063373453915119, -0.0077150133438408375, -0.008910711854696274, 0.03962162509560585, -0.0013187823351472616, -0.008396591059863567, -0.045798540115356445, 0.018457455560564995, 0.01423676498234272, 0.029510457068681717, -0.01112297736108303, 0.01809109002351761, 0.001316862995736301, 0.00171859678812325, 0.04581260308623314, -0.005129372701048851, 0.01856917515397072, -0.007543273735791445, -0.02228599414229393, 0.01946800760924816, -0.021854661405086517, 0.052382007241249084, -0.030479369685053825, 0.012027325108647346, 0.03437003493309021, -0.0521472804248333, -0.010071929544210434, 0.025878794491291046, -0.0626777932047844, -0.029895635321736336, -0.005837044212967157, 0.006600920110940933, -0.0005689010722562671, 0.051242586225271225, 0.04647905379533768, 0.01068792212754488, -0.018140774220228195, -0.0027072601951658726, 0.04777268320322037, -0.03369923681020737, -0.005317980423569679, -0.022901447489857674, -0.03516048565506935, 0.053779538720846176, 0.009399973787367344, 0.01339922659099102, 0.007085050456225872, -0.012064481154084206, -0.008380177430808544, -0.01576593890786171, -0.018948588520288467, 0.0422089658677578, 0.030078839510679245, 0.02703125774860382, -0.014977398328483105, -0.014947851188480854, 0.003470269264653325, -0.02084220200777054, -0.01304277777671814, -0.0011835171608254313, -0.020656486973166466, -0.028753960505127907, -0.01263914443552494, -0.01587340608239174, -0.0362633615732193, -0.03459145873785019, -0.0037937466986477375, -0.056695930659770966, 0.010789106599986553, 0.010280695743858814, 0.02784956619143486, -0.004936526529490948, 0.028299828991293907, 0.06905589997768402, -0.009926124475896358, -0.008753607049584389, 0.03128251060843468, -0.015002083033323288, 0.02122519537806511, 0.0037413144018501043, 0.03802561014890671, -0.020687343552708626, -0.00749975023791194, 0.009919090196490288, -0.00513286842033267, 0.0008574212552048266, -0.05835658684372902, 0.006400844547897577, 0.029389014467597008, -0.025519590824842453, 0.004824389703571796, 0.045382060110569, -0.04663323983550072, -0.015422634780406952, 0.07301124185323715, 0.02603115700185299, 0.013534131459891796, 0.005011082161217928, 0.03817236050963402, -0.021774502471089363, -0.022353578358888626, 0.05371492728590965, 0.025594577193260193, 0.004953471478074789, 0.043943341821432114, 0.0002441883843857795, 0.04459010437130928, 0.019849810749292374, -0.03999718278646469, 0.0059590525925159454, -0.044551998376846313, 0.017861258238554, -0.010585850104689598, 0.02363668568432331, -0.02707700803875923, 0.009161378256976604, 0.008666160516440868, -0.01805422641336918, 0.0008559169946238399, -0.002778280759230256, 0.05912153422832489, 0.010952385142445564, 0.00007258381810970604, 0.06562976539134979, -0.004503366071730852, -0.01657373458147049, 0.03379853069782257, 0.03767234459519386, -0.06610498577356339, 0.00826769508421421, -0.020349496975541115, 0.018154572695493698, 0.0314001590013504, 0.016605518758296967, -0.025278160348534584, 0.002041819505393505, 0.002547338604927063, 0.008387771435081959, 0.03910457715392113, -0.024277454242110252, -0.02640504203736782, -0.0006939970189705491, -0.013917341828346252, 0.027710532769560814, -0.030234962701797485, 0.003866274142637849, 0.01955724135041237, 0.00895489752292633, 0.035448405891656876, 0.033963099122047424, 0.000805894669611007, 0.012642384506762028, 0.04481382295489311, 0.009102354757487774, 0.001834253198467195, -0.04413708299398422, 0.06064772233366966, 0.05627278983592987, -0.0514850914478302, -0.009714785031974316, 0.010942717082798481, -0.05505300685763359, 0.009884404949843884, -0.0347309336066246, 0.048395849764347076, 0.018454067409038544, 0.00482985470443964, -0.01637992262840271, 0.022775787860155106, -0.002127397572621703, 0.03668355941772461, -0.006534183397889137, 0.0015746437711641192, 0.03122004121541977, -0.020405301824212074, -0.0022208166774362326, -0.00007123425166355446, 0.0049577816389501095, 0.010933502577245235, 0.02615540288388729, -0.04785339906811714, 0.01504038367420435, 0.06127689406275749, -0.04768136516213417, -0.020522812381386757, -0.026018310338258743, 0.0023704299237579107, -0.0038104846607893705, -0.023587234318256378, 0.0261682141572237, 0.012707789428532124, 0.02433423139154911, 0.003647754667326808, -0.028816109523177147, 0.012724779546260834, -0.010497012175619602, 0.05756896734237671, -0.04146881029009819, -0.003692703088745475, 0.02536872588098049, 0.028684278950095177, 0.05468126758933067, 0.017928455024957657, -0.018937384709715843, -0.021907145157456398, 0.049024105072021484, 0.04354436695575714, -0.013827407732605934, 0.014890417456626892, 0.009331927634775639, -0.02852245792746544, -0.019168326631188393, -0.057331349700689316, -0.010810079984366894, 0.03772737458348274, 0.009988305158913136, -0.03004899062216282, -0.01421741396188736, -0.006551820319145918, 0.04726274311542511, 0.034348636865615845, 0.03275349363684654, -0.03801608458161354, 0.0491788424551487, 0.03022732585668564, 0.037663936614990234, 0.01232722494751215, 0.004654827062040567, -0.0033458771649748087, 0.011686972342431545, 0.04169512912631035, 0.022223779931664467, 0.02572828158736229, 0.03092903271317482, 0.01552749052643776, 0.024964068084955215, -0.028404053300619125, 0.00195423630066216, 0.01357471663504839, -0.015237818472087383, -0.011762324720621109, -0.03433853015303612, 0.051761504262685776, -0.06125856935977936, 0.014070423319935799, -0.03969467058777809, -0.008124496787786484, -0.015774354338645935, 0.02332378178834915, -0.030488271266222, 0.06978776305913925, -0.002477870089933276, -0.019619403406977654, 0.011109122075140476, -0.009516817517578602, 0.05197254568338394, 0.03585075959563255, 0.023905208334326744, -0.05827329307794571, -0.02505555935204029, -0.023777106776833534, 0.013023575767874718, 0.04630984738469124, -0.02304781600832939, -0.007295146584510803, -0.028578773140907288, 0.0208920668810606, 0.012450180947780609, 0.017893988639116287, -0.03897480666637421, -0.027509480714797974, -0.04878978803753853, 0.034081365913152695, -0.02482861466705799, -0.029632169753313065, -0.011399930343031883, -0.028353655710816383, -0.021449364721775055, -0.012543560937047005, 0.016141220927238464, 0.04031500220298767, 0.03411327674984932, -0.01220788899809122, -0.01254171784967184, 0.02056126296520233, -0.007003809791058302, 0.010721384547650814, 0.01593349315226078, -0.014498431235551834, 0.0022691015619784594, 0.03143922612071037, -0.011862958781421185, -0.011615486815571785, 0.013714308850467205, 0.005821838043630123, 0.05125342682003975, -0.014768325723707676, -0.025571070611476898, -0.02115710638463497, 0.0509912483394146, 0.0252462700009346, 0.018734561279416084, 0.008484557271003723, 0.02586032822728157, 0.06562113761901855, -0.0028797390405088663, 0.023320157080888748, -0.033697012811899185, 0.049214787781238556, -0.014077350497245789, -0.03672230988740921, -0.03450978919863701, 0.00656444625928998, -0.0346488356590271, 0.007111954502761364, -0.03128701448440552, 0.002453864086419344, 0.031051617115736008, 0.028568552806973457, -0.030054643750190735, 0.015483350493013859, 0.07462764531373978, 0.04020603746175766, 0.020896341651678085, -0.007388964761048555, -0.039382509887218475, 0.002569027943536639, -0.06795185804367065, 0.029460668563842773, 0.01225743442773819, -0.040921103209257126, -0.006193629931658506, 0.004490944091230631, 0.0034179394133388996, 0.030740836635231972, -0.035309575498104095, 0.024505481123924255, 0.042513251304626465, 0.010833384469151497, -0.0426241010427475, -0.005728813353925943, 0.04309304431080818, -0.017944946885108948, 0.018614182248711586, -0.04291246458888054, -0.03227856755256653, 0.01755821332335472, 0.03896702453494072, -0.05570195987820625, 0.0010460792109370232, -0.025030797347426414, -0.0016816516872495413, 0.017766499891877174, -0.0062037003226578236, 0.01632346585392952, -0.021360043436288834, 0.0005341963842511177, -0.016762979328632355, -0.030993277207016945, -0.050998710095882416, -0.059570856392383575, -0.03290795907378197, 0.021151592954993248, -0.0049246386624872684, -0.010942481458187103, 0.03819691389799118, 0.004095116164535284, -0.04611458256840706, -0.012946764007210732, 0.014954990707337856, 0.047377802431583405, 0.007188102696090937, -0.02982877939939499, -0.0006820429698564112, 0.037831854075193405, 0.006647137925028801, -0.016188113018870354, -0.04076364263892174, -0.018135517835617065 ]
Interactively explore your Huggingface dataset with one line of code
sps44
October 25, 2023
scalable-data-inspection
open-source-collab, visualization, data inspection
https://huggingface.co/blog/scalable-data-inspection
Customizing data inspection workflows Visualization layouts can be interactively changed, saved and loaded in the GUI: You can select different widget types and configurations. The Inspector widget allows to represent multimodal data samples including text, image, audio, video and time series data. You can also define layouts through the Python API. This option is especially useful for building custom data inspection and curation workflows including EDA, model debugging and model monitoring tasks. In combination with the data issues widget, the Python API offers a great way to integrate the results of existing scripts (e.g. data quality checks or model monitoring) into a scalable data inspection workflow.
[ 0.032588452100753784, -0.04542693868279457, -0.03958681970834732, -0.010935871861875057, 0.07998105138540268, 0.07558241486549377, -0.05044722929596901, -0.012197727337479591, -0.028218520805239677, -0.09864417463541031, -0.08324369043111801, -0.0015484183095395565, 0.05020524561405182, 0.04245307296514511, 0.05626727268099785, -0.030543966218829155, 0.06155059486627579, -0.014987503178417683, -0.01533311977982521, 0.028625937178730965, 0.017937229946255684, -0.09875030815601349, -0.00339026958681643, 0.048157792538404465, -0.09084555506706238, -0.07064594328403473, -0.005525731481611729, 0.017621124163269997, -0.021776283159852028, 0.0005045435391366482, -0.10728473961353302, -0.04261080548167229, -0.07746174931526184, -0.007386400830000639, -0.02675468660891056, 0.06404905021190643, -0.12544740736484528, 0.004439480137079954, -0.015965675935149193, -0.0038140537217259407, 0.009581892751157284, -0.057941704988479614, -0.06236555427312851, 0.023543009534478188, 0.002886370290070772, -0.059530287981033325, -0.08414976298809052, -0.003464024979621172, -0.026960106566548347, 0.04599282518029213, -0.11508461087942123, 0.10136386007070541, 0.008174865506589413, -0.031897567212581635, 0.052114907652139664, -0.015782704576849937, 0.05175122618675232, -0.02251293696463108, -0.012120840139687061, 0.06721488386392593, 0.019410161301493645, 0.002908367197960615, -0.012819456867873669, -0.04012636840343475, 0.042010530829429626, -0.009720893576741219, -0.06655651330947876, 0.07568643987178802, 0.045385804027318954, -0.0026621101424098015, -0.050239160656929016, 0.07977040857076645, 0.02712496556341648, -0.027141671627759933, 0.03798123449087143, -0.05766571685671806, -0.07944966107606888, 0.0364348329603672, -0.030065245926380157, -0.04858696460723877, 0.0488511361181736, -0.018566995859146118, 0.0023747640661895275, -0.0075008156709373, -0.024304812774062157, -0.02650928869843483, -0.012103918008506298, -0.05125772953033447, -0.014403327368199825, 0.07772576808929443, -0.00007722127338638529, -0.09398531913757324, -0.0055483425967395306, 0.006357814650982618, 0.019700828939676285, 0.056666430085897446, 0.013814459554851055, 0.017324035987257957, 0.015345720574259758, 0.030423030257225037, -0.030720125883817673, -0.002192569663748145, -0.001126894960179925, -0.05775107070803642, -0.038382820785045624, 0.0026006081607192755, -0.05281383544206619, -0.042142368853092194, -0.046640146523714066, 0.10172700881958008, -0.04811996594071388, -0.04059842228889465, 0.0019007925875484943, 0.1258600652217865, -0.0316106379032135, 0.0017840138170868158, 0.007331891916692257, 0.030793674290180206, -0.0711783841252327, -0.010413553565740585, 0.03964215889573097, -0.004268309101462364, 0.007584612350910902, 0.04335055127739906, -0.027434278279542923, 0.050622593611478806, 0.02434954233467579, 0.04824800789356232, 0.05300494283437729, -0.055680014193058014, -0.03265528380870819, 0.012531961314380169, 0.0442270003259182, -0.054588593542575836, 0.00932231917977333, -0.013639403507113457, -0.011741867288947105, -0.010835684835910797, 0.037708211690187454, 0.00503126485273242, 0.05592886358499527, 0.02515213005244732, -0.03565075993537903, -0.028283657506108284, -0.06996873766183853, -0.003557804273441434, -0.031908899545669556, 0.04789109155535698, -0.02934081479907036, 0.02879546955227852, -0.11318717151880264, 0.03627847135066986, 0.003924570512026548, 0.02049419656395912, -0.01607324555516243, 0.0493025965988636, -0.026547571644186974, 0.00859085563570261, -0.08880273997783661, -0.007082532625645399, 0.0013637307565659285, 0.05716156214475632, -0.00035720434971153736, 0.014571092091500759, -0.04176078364253044, -0.03695264831185341, 0.007566782645881176, -0.037007059901952744, 0.04865647107362747, 0.020743444561958313, 0.013707357458770275, -0.00826681312173605, 0.03158094733953476, 0.04772386699914932, 0.01968216337263584, 0.010960036888718605, 0.027831710875034332, -0.044733308255672455, -0.024556348100304604, -0.008024422451853752, 0.0027223932556807995, 0.01596597209572792, -0.054466038942337036, 0.05713735893368721, 0.024808315560221672, -0.01587025448679924, 0.014183311723172665, -0.051105789840221405, -0.03396502882242203, -0.07615397870540619, -0.0538572333753109, -0.030994126573204994, 0.0742994025349617, -0.004435764625668526, 0.04002732038497925, -0.011128075420856476, -0.03056521527469158, 0.041213661432266235, 0.09532435238361359, 0.033128198236227036, -0.005638133734464645, 0.023427864536643028, 0.03220512717962265, -0.06955181807279587, 0.08213227987289429, 0.01691270060837269, 0.11656447499990463, -0.03171737492084503, 0.03482099622488022, 0.009698083624243736, -0.009505005553364754, -0.060961056500673294, 0.08130080252885818, 0.00993262231349945, 0.07304780185222626, 0.032351016998291016, -0.03931162878870964, 0.05761188641190529, -0.06847259402275085, -0.021982913836836815, 0.1252453625202179, 0.04439093545079231, -0.02345721609890461, -0.0007965251570567489, -0.047161929309368134, 0.030485831201076508, 0.0752098560333252, 0.11711696535348892, 0.052836786955595016, -0.09282754361629486, 0.017844829708337784, 0.039739400148391724, -0.03486333414912224, -0.025116650387644768, 0.02693958394229412, 0.006145751569420099, 0.05338607728481293, 0.018946288153529167, 0.08537551760673523, -0.04889973625540733, 0.035144515335559845, 0.029424263164401054, -0.0733024924993515, -0.009604163467884064, 0.044028475880622864, -0.0006537268054671586, 0.027694176882505417, 0.0025947357062250376, -0.02360261045396328, -0.0019585841801017523, 0.02766335941851139, 0.03342454880475998, 0.027538534253835678, -0.035803355276584625, 0.0029615340754389763, -0.04242553934454918, -0.01844940520823002, -0.05159097537398338, 0.004873264580965042, 0.03957672044634819, -0.009565460495650768, -0.0029216113034635782, -0.011379711329936981, -0.05213626101613045, 0.00912123080343008, -0.03788561001420021, 0.012765198014676571, -0.024921812117099762, 0.004200943745672703, -0.04280877485871315, -0.017019614577293396, 0.025022126734256744, -0.02138504944741726, 0.01226180512458086, 0.07500942051410675, 0.017452523112297058, 0.03726894035935402, 0.025583915412425995, -0.015491271391510963, -0.0019150334410369396, -0.0037162317894399166, -0.026009364053606987, 0.008870262652635574, 0.06265249848365784, 0.03092651069164276, 0.0008474999922327697, -0.009001961909234524, 0.02681472897529602, -0.03602110594511032, 0.01113268081098795, 0.01020396500825882, 0.012731648050248623, 0.009975812397897243, -0.022708291187882423, 0.045259881764650345, 0.025634154677391052, 0.004346864297986031, 0.013638013042509556, -0.017897222191095352, 0.0009938982548192143, -0.004004425834864378, 0.02327733486890793, 0.006627208087593317, 0.05255090072751045, -0.05113706737756729, 0.011597936041653156, -0.014813309535384178, -0.0024281421210616827, -0.07389473170042038, -0.010500891134142876, 0.0009492152603343129, -0.017208954319357872, -0.03672706335783005, -0.020854560658335686, 0.02118810825049877, 0.03701728954911232, 0.029091905802488327, 0.016313033178448677, 0.009023899212479591, -0.005131444428116083, 0.018716076388955116, 0.011367648839950562, 0.05879390612244606, 0.012145181186497211, -0.038783811032772064, 0.028890710324048996, 0.035969678312540054, 0.028132334351539612, -0.025339772924780846, 0.0205759946256876, -0.00388126983307302, 0.024126699194312096, -0.020702380686998367, -0.02218460664153099, 0.057672202587127686, 0.03222804144024849, -0.009007900021970272, -0.028829962015151978, 0.0056235636584460735, -0.02231677807867527, -0.035069894045591354, 0.02409772016108036, 0.012543909251689911, 0.017323704436421394, 0.017774727195501328, 0.0009419281268492341, 0.03610778599977493, -0.00652101868763566, -0.005324617959558964, 0.0662197694182396, 0.006458390969783068, 0.03397972136735916, 0.030704090371727943, -0.018017560243606567, -0.03471480309963226, 0.003166771261021495, -0.008692641742527485, -0.020598111674189568, -0.024158179759979248, -0.004867334384471178, -0.018750380724668503, 0.04601455479860306, -0.03411630913615227, 0.04204528406262398, 0.05248327925801277, 0.013780925422906876, -0.003071131883189082, -0.013579958118498325, -0.02230573445558548, 0.017613133415579796, -0.02585340104997158, -0.028898073360323906, -0.04257521033287048, -0.0325486958026886, 0.008189785294234753, -0.04258372262120247, -0.013069107197225094, 0.03893185034394264, 0.03327801823616028, 0.056201182305812836, -0.009770061820745468, 0.0008283255156129599, -0.008877989836037159, -0.032652754336595535, 0.02876938506960869, -0.060043543577194214, 0.024504119530320168, 0.056834228336811066, 0.055333513766527176, -0.03367854282259941, 0.005892421118915081, -0.015231876634061337, 0.06848516315221786, 0.008437114767730236, -0.012048428878188133, -0.0716383084654808, 0.004298526328057051, 0.004899769555777311, 0.030887681990861893, -0.023480886593461037, -0.01656130887567997, -0.012078125029802322, -0.019910426810383797, -0.0205024853348732, -0.013461632654070854, 0.008794637396931648, -0.008169286884367466, 0.0012535096611827612, 0.015620551072061062, -0.04834873229265213, -0.023757020011544228, 0.020779572427272797, -0.012241893447935581, -0.012654624879360199, -0.019241344183683395, -0.04051685705780983, 0.0366508811712265, -0.00762492511421442, -0.00911142397671938, -0.00881874654442072, 0.016163429245352745, 0.006491020787507296, 0.03596492484211922, 0.02457837387919426, 0.03587980940937996, 0.010326391085982323, -0.016759218648076057, -0.010691888630390167, 0.03275288641452789, -0.013729504309594631, 0.004039681516587734, -0.0366947315633297, 0.015282025560736656, 0.010452214628458023, 0.025089751929044724, -0.05641128495335579, 0.033971354365348816, -0.014081347733736038, 0.014784520491957664, 0.03311820700764656, -0.00634464668110013, 0.0371793657541275, 0.016405632719397545, -0.031011708080768585, -0.009566512890160084, -0.012814240530133247, 0.016177309677004814, -0.0070028966292738914, 0.01617041416466236, -0.01947876065969467, -0.02095699869096279, -0.004746520426124334, -0.021702231839299202, -0.03796825930476189, -0.021936947479844093, 0.003583797486498952, -0.005008092615753412, -0.00030303344829007983, -0.029380323365330696, 0.013706053607165813, -0.023164210841059685, 0.010017002001404762, 0.021985836327075958, 0.012380567379295826, 0.01287456601858139, -0.005635032895952463, 0.0008641264284960926, 0.051850102841854095, 0.03720621392130852, -0.01668526791036129, -0.0335564985871315, -0.01822672039270401, 0.007135642692446709, 0.020679863169789314, -0.009057176299393177, -0.04253055527806282, 0.03168907389044762, 0.005940274801105261, -0.04685085639357567, 0.05870233103632927, 0.029201414436101913, -0.04565504938364029, 0.024733494967222214, 0.05124731361865997, 0.02202787809073925, 0.014530224725604057, 0.015957260504364967, 0.0010345671325922012, -0.004156621638685465, -0.01508723571896553, 0.027850879356265068, -0.022503051906824112, -0.0021009021438658237, 0.042318880558013916, 0.024211470037698746, 0.03946654126048088, 0.056683484464883804, 0.014619969762861729, -0.010174663737416267, 0.012919869273900986, -0.017838142812252045, -0.044881608337163925, 0.022587792947888374, -0.00009515092096989974, 0.057809632271528244, -0.004657886456698179, -0.011607463471591473, -0.07455531507730484, 0.00556401489302516, 0.02978145331144333, -0.02283904328942299, 0.027944965288043022, 0.0018347862642258406, -0.007483888417482376, -0.008440663106739521, -0.03300229460000992, 0.015857843682169914, -0.047191087156534195, -0.007121225353330374, -0.021844064816832542, -0.0001488946727477014, -0.03687407821416855, -0.02695135399699211, -0.04720374941825867, 0.033057890832424164, -0.0595773383975029, -0.013947554863989353, 0.03732399269938469, -0.054860182106494904, -0.023312373086810112, 0.004539613611996174, 0.020069628953933716, -0.004745949525386095, -0.0512671172618866, 0.02249286137521267, -0.03583890572190285, 0.005614450667053461, 0.020604563876986504, 0.06483516097068787, -0.005620431620627642, 0.016764117404818535, 0.04766394570469856, 0.015761319547891617, -0.02022974193096161, -0.09050960838794708, 0.03571220859885216, 0.04608054831624031, -0.030479803681373596, -0.011160890571773052, -0.029087932780385017, 0.0009831646457314491, 0.03445830196142197, -0.031650297343730927, -0.010239598341286182, 0.014112559147179127, -0.015458980575203896, 0.023611336946487427, 0.030359778553247452, 0.026171064004302025, 0.007966995239257812, -0.0017524977447465062, -0.022151747718453407, 0.02661258913576603, -0.00404187198728323, 0.03412288799881935, -0.05659172683954239, 0.012217635288834572, -0.04744374752044678, -0.02386024221777916, -0.05824064090847969, 0.024231072515249252, 0.0017628698842599988, -0.005677015520632267, -0.03316045179963112, 0.017178239300847054, -0.006846170406788588, 0.00438577588647604, -0.05317208170890808, -0.01325157843530178, 0.03142306208610535, 0.03188648447394371, 0.032530393451452255, 0.005099475849419832, -0.03469611331820488, 0.01333114318549633, 0.039251476526260376, 0.028673801571130753, 0.003068450838327408, 0.045140355825424194, 0.053297337144613266, 0.036069996654987335, 0.03366422653198242, -0.023526335135102272, 0.017840100452303886, 0.039489712566137314, -0.00656174635514617, -0.0406259186565876, -0.021859480068087578, 0.0011676852591335773, -0.01810121349990368, -0.026369763538241386, -0.01609066128730774, -0.012843407690525055, 0.04295556619763374, 0.002561818342655897, -0.018703503534197807, -0.04997702315449715, -0.026749402284622192, 0.10877010971307755, 0.009693121537566185, 0.009539084509015083, 0.0014620012370869517, -0.02994954213500023, 0.041128721088171005, 0.004111635498702526, -0.021806856617331505, 0.011785006150603294, 0.015322321094572544, -0.005270224064588547, 0.05429346114397049, 0.02634102664887905, 0.024521103128790855, 0.0017496768850833178, 0.03675566986203194, 0.011156055144965649, -0.03901761770248413, 0.017907392233610153, 0.025359021499753, -0.0017717471346259117, -0.03938063606619835, -0.04558891803026199, -0.03167381510138512, -0.03442898020148277, -0.053078196942806244, 0.0031541232019662857, 0.014520911499857903, 0.04937727749347687, -0.0019607716239988804, -0.011671467684209347, 0.027303090319037437, -0.00008775883907219395, -0.03326995298266411, -0.04344476759433746, 0.004698679782450199, 0.005254668649286032, 0.02030566893517971, 0.006123960949480534, -0.026794280856847763, -0.03766059875488281, 0.0111162094399333, 0.04049306735396385, 0.07414113730192184, 0.01078683603554964, 0.004357558209449053, -0.02410946600139141, -0.005397416651248932, -0.0278482623398304, 0.03237518295645714, -0.021849051117897034, -0.008613958023488522, -0.060582369565963745, 0.0010580269154161215, -0.046417947858572006, -0.02673233486711979, -0.0005867587751708925, 0.01522959303110838, 0.011966785416007042, -0.014646721072494984, -0.007493882440030575, -0.011489623226225376, 0.013470499776303768, -0.011381799355149269, 0.009597765281796455, 0.022649917751550674, -0.032271817326545715, -0.014708871953189373, 0.03261058032512665, 0.0045577785931527615, 0.00508376769721508, 0.0464986115694046, -0.08019751310348511, -0.0015411045169457793, -0.000602521700784564, -0.03194289281964302, 0.03982077166438103, -0.005272718146443367, -0.014541862532496452, 0.01297847367823124, 0.01788112334907055, 0.046992041170597076, 0.018619630485773087, -0.0337773896753788, 0.018357504159212112, 0.0030004498548805714, 0.00763176241889596, -0.0066708954982459545, -0.002114759525284171, 0.05276695638895035, -0.03225983679294586, -0.04636708274483681, 0.021676143631339073, 0.005152551457285881, -0.04437478259205818, -0.03822368010878563, -0.0034431840758770704, 0.036835845559835434, 0.0240431260317564, -0.019367855042219162, -0.019335051998496056, 0.044421322643756866, 0.030695956200361252, -0.0023556374944746494, 0.022592991590499878, 0.040562089532613754, -0.0016673916252329946, 0.010889170691370964, -0.009087085723876953, -0.045472435653209686, 0.000374171941075474, 0.020165517926216125, -0.007733690552413464, -0.01995050720870495, 0.030774502083659172, 0.02307586371898651, -0.020987095311284065, 0.02112550288438797, 0.034668609499931335, 0.007551753893494606, -0.03564569726586342, -0.04574790969491005, 0.06310314685106277, 0.020311973989009857, 0.026403481140732765, 0.01862635463476181, 0.01914386823773384, 0.03212321177124977, -0.017052358016371727, -0.03565391153097153, 0.006436497438699007, -0.006559334229677916, -0.027246329933404922, -0.018962813541293144, -0.09731496870517731, 0.014166063629090786, 0.011524638161063194, 0.014345021918416023, 0.07596782594919205, -0.0038853948935866356, -0.0139222526922822, -0.00282906461507082, 0.008290339261293411, 0.06571783125400543, 0.01954522915184498, 0.0002747274993453175, -0.01479716133326292, 0.024843186140060425, -0.025657527148723602, -0.005874117836356163, -0.014828657731413841, -0.017765842378139496, -0.016079658642411232, 0.03296880051493645, -0.01680905930697918, 0.0042986017651855946, 0.029095200821757317, 0.02518623322248459, -0.02293347753584385, 0.0026331560220569372 ]
Interactively explore your Huggingface dataset with one line of code
sps44
October 25, 2023
scalable-data-inspection
open-source-collab, visualization, data inspection
https://huggingface.co/blog/scalable-data-inspection
Whatโ€™s next? With Spotlight you can create interactive visualizations and leverage data enrichments to identify critical clusters in your Hugging Face datasets. In this blog, we have seen both an audio ML and a computer vision example. You can use Spotlight directly to explore and curate your NLP, audio, CV or multimodal dataset: - Install Spotlight: pip install renumics-spotlight - Check out the documentation or open an issue on Github - Join the Spotlight community on Discord - Follow us on Twitter and LinkedIn
[ 0.005236081779003143, -0.02982444129884243, 0.059731218963861465, -0.040692638605833054, 0.016755199059844017, 0.06025116518139839, -0.0012939440784975886, 0.04152638837695122, -0.10461115837097168, -0.056806083768606186, -0.08289084583520889, 0.07463830709457397, 0.046033699065446854, 0.067360058426857, 0.03632105514407158, -0.09410987794399261, -0.00891073141247034, 0.004717767704278231, -0.005460795946419239, 0.07259669154882431, -0.03352377936244011, -0.04138435423374176, 0.014484571292996407, 0.0242648683488369, -0.018086519092321396, -0.09939268976449966, 0.034287989139556885, 0.02355392836034298, 0.016853954643011093, 0.018730025738477707, -0.17222218215465546, 0.05907105654478073, -0.009260257706046104, -0.010010454803705215, 0.014820979908108711, 0.09034376591444016, -0.1325078010559082, 0.023764897137880325, 0.07068444788455963, -0.03036201372742653, -0.04377390816807747, -0.09487631916999817, -0.09006007015705109, 0.06222608685493469, 0.024238891899585724, -0.033528029918670654, -0.14969506859779358, 0.048599015921354294, -0.07661764323711395, -0.007624926045536995, -0.09957712143659592, 0.05870025232434273, -0.006908738985657692, -0.028570830821990967, -0.0010450987610965967, -0.019806087017059326, 0.031800851225852966, -0.10311960428953171, 0.009798391722142696, 0.03969792649149895, -0.016251089051365852, -0.004496175330132246, -0.015854239463806152, 0.026792876422405243, 0.03629549965262413, 0.0013728071935474873, 0.015214754268527031, 0.012683343142271042, -0.06962967664003372, -0.05063462629914284, 0.0631357878446579, 0.030840003862977028, -0.07154326885938644, -0.04812994971871376, -0.00836519617587328, -0.003714188700541854, 0.015739044174551964, 0.018440069630742073, -0.004923880100250244, 0.014534344896674156, -0.013262440450489521, -0.05657351762056351, 0.011805687099695206, 0.046100202947854996, -0.0016397826839238405, 0.016653720289468765, 0.031844835728406906, -0.005240168422460556, -0.09993388503789902, 0.05229075998067856, -0.039856139570474625, -0.0978710800409317, 0.030435951426625252, 0.08448460698127747, 0.055899303406476974, -0.013544137589633465, 0.012735070660710335, -0.01877167448401451, -0.0017255919519811869, -0.02406388148665428, -0.035949334502220154, -0.012728900648653507, -0.001567397266626358, -0.03414888307452202, -0.04405307397246361, 0.06209590658545494, -0.05713008716702461, -0.013685046695172787, -0.08363620191812515, 0.053993046283721924, -0.003941523842513561, -0.06001652032136917, -0.0161961168050766, 0.07215534895658493, -0.01978345587849617, 0.04226551949977875, 0.021946288645267487, 0.013753430917859077, -0.013704138807952404, 0.050032779574394226, 0.028277302160859108, 0.09032877534627914, 0.0025616048369556665, 0.036766525357961655, 0.015015825629234314, 0.0683274194598198, -0.046332474797964096, 0.01943236216902733, 0.06525645405054092, -0.03403131291270256, -0.019298655912280083, -0.015401847660541534, -0.0007669737096875906, 0.016466116532683372, 0.025451095774769783, -0.04698386415839195, 0.03478285297751427, -0.04473128542304039, 0.054406363517045975, 0.044536933302879333, 0.03292782977223396, 0.035370826721191406, 0.0029854655731469393, -0.004787009209394455, 0.02571115270256996, 0.025747453793883324, -0.08372478187084198, 0.06586532294750214, -0.029592683538794518, 0.05267845094203949, -0.06799107044935226, 0.02952433191239834, -0.0010140041122213006, 0.00018229492707177997, -0.009425689466297626, 0.10620041936635971, 0.0410190150141716, -0.027981068938970566, -0.007882675155997276, -0.0028282376006245613, 0.016768204048275948, -0.019312812015414238, -0.05302570015192032, -0.005289867520332336, 0.018320303410291672, -0.006302144844084978, -0.018682949244976044, -0.029295947402715683, -0.01249221246689558, 0.05431939288973808, -0.003682590089738369, 0.004372267983853817, 0.013648920692503452, -0.00620782608166337, -0.0011561171850189567, 0.06411890685558319, 0.07051973789930344, 0.03648372367024422, -0.06738192588090897, -0.0057962494902312756, -0.04952012747526169, 0.008917002007365227, -0.029117431491613388, 0.016439154744148254, -0.020286381244659424, -0.05957258492708206, 0.053653836250305176, -0.0036797169595956802, 0.023082565516233444, -0.04043293371796608, -0.0212387852370739, -0.033403221517801285, 0.021291114389896393, -0.019116226583719254, 0.04117855429649353, -0.019853437319397926, -0.014609233476221561, 0.11788389086723328, 0.0033719283528625965, 0.017229413613677025, -0.020108547061681747, 0.03357238322496414, 0.051001619547605515, -0.08418460190296173, -0.041449449956417084, 0.002028669463470578, 0.03110976703464985, -0.09009899199008942, 0.007216509897261858, -0.030175907537341118, 0.000611893308814615, -0.12212705612182617, 0.01705639809370041, 0.022280041128396988, 0.03770611435174942, 0.0013886529486626387, -0.02722885087132454, 0.07348211109638214, -0.062223631888628006, 0.029934071004390717, 0.12611253559589386, 0.0036048588808625937, 0.024852514266967773, -0.038792070001363754, -0.03001055307686329, 0.027402812615036964, 0.07415175437927246, 0.05522266402840614, 0.0859103724360466, -0.005938964895904064, -0.03186652064323425, 0.00594133697450161, -0.07641249895095825, 0.02871936932206154, -0.03070489689707756, -0.029386796057224274, 0.07374600321054459, 0.03494536876678467, 0.06401138007640839, 0.006494312547147274, -0.014815307222306728, -0.05765145272016525, -0.0384320467710495, 0.006465563550591469, 0.04856064170598984, -0.02156832255423069, 0.014474181458353996, -0.00920823309570551, -0.014728994108736515, 0.059658803045749664, -0.033974599093198776, 0.03256028890609741, -0.025779709219932556, -0.008167997002601624, 0.014085633680224419, 0.06255122274160385, -0.017120283097028732, -0.028392307460308075, -0.06072116643190384, 0.02965005859732628, 0.032626088708639145, -0.009600668214261532, -0.0208880715072155, -0.018847569823265076, -0.003376113483682275, -0.045043207705020905, 0.0008147974149324, -0.016005894169211388, 0.03169930726289749, 0.026563579216599464, 0.013049050234258175, -0.009916415438055992, 0.04566405341029167, 0.018119823187589645, 0.005579239223152399, 0.0169643834233284, 0.03318129852414131, -0.05918436497449875, 0.007982639595866203, -0.03743410110473633, -0.008995698764920235, -0.015596684999763966, 0.037056270986795425, 0.08108233660459518, 0.013275539502501488, 0.01785479672253132, -0.04798242822289467, -0.018598537892103195, -0.01216491125524044, 0.043519314378499985, 0.008817596361041069, 0.03770797327160835, 0.02522432431578636, 0.0006552156410180032, 0.02149342931807041, -0.015968380495905876, -0.006991508416831493, 0.015708986669778824, -0.05115412548184395, 0.05435676872730255, -0.030956845730543137, 0.013264947570860386, -0.012738661840558052, -0.02700367011129856, 0.0035451436415314674, 0.02945561334490776, 0.02702382579445839, 0.007247203961014748, -0.08737488836050034, -0.01126824039965868, -0.01450065616518259, -0.000009309522283729166, 0.009646432474255562, -0.031864434480667114, 0.03156323730945587, 0.007374895736575127, 0.019919494166970253, 0.002414206974208355, -0.0004688811313826591, 0.01436622440814972, -0.00576968165114522, 0.049546562135219574, -0.01147079560905695, 0.04970363900065422, -0.02939723990857601, -0.0037031485699117184, 0.04902384802699089, 0.04629402235150337, -0.03902595117688179, 0.0414021760225296, 0.030285319313406944, -0.036306705325841904, -0.05147802084684372, -0.03781959414482117, 0.04488084465265274, 0.01590188406407833, 0.01581430248916149, -0.023736244067549706, -0.0072130197659134865, -0.020987842231988907, -0.00403405399993062, -0.015547588467597961, 0.010389313101768494, 0.01205160841345787, 0.012359007261693478, 0.01252850703895092, 0.03406069800257683, 0.0060009462758898735, 0.013721881434321404, 0.0014066415606066585, 0.036635104566812515, -0.0023182500153779984, 0.016711443662643433, -0.03979221731424332, 0.0024497227277606726, -0.007029908709228039, -0.019243456423282623, -0.026270508766174316, -0.0389111191034317, -0.019335800781846046, -0.031985893845558167, 0.03844625502824783, -0.006001834291964769, 0.05793602764606476, 0.010656222701072693, -0.004819064401090145, 0.012211538851261139, -0.0081273652613163, -0.03850242495536804, 0.0121390912681818, -0.03175763785839081, -0.026860442012548447, 0.008847569115459919, 0.003786022076383233, 0.0039185695350170135, 0.012182634323835373, 0.003578471252694726, 0.03600481525063515, 0.048935260623693466, 0.0252363383769989, -0.0299324132502079, 0.013218610547482967, -0.010443883016705513, -0.009693078696727753, -0.0000040478130358678754, -0.03589266538619995, 0.03799213096499443, 0.020442435517907143, -0.019410032778978348, -0.006436442025005817, -0.0043383147567510605, -0.02415427193045616, 0.02018154412508011, 0.00018051289953291416, -0.014165320433676243, -0.036941047757864, -0.004032700788229704, 0.017806461080908775, -0.010925956070423126, -0.01500912755727768, 0.033882662653923035, -0.03129006177186966, -0.0008918566745705903, -0.004227163270115852, 0.01598205976188183, 0.010553195141255856, -0.006691293325275183, -0.018787147477269173, -0.032402414828538895, -0.04595339298248291, 0.0066411797888576984, 0.0056185307912528515, 0.006385285407304764, 0.03724164888262749, -0.03272877633571625, -0.062436722218990326, 0.0371612049639225, -0.0513681098818779, -0.011454065330326557, -0.0020981996785849333, -0.016325920820236206, -0.0034149603452533484, 0.039294879883527756, 0.029575152322649956, 0.01324718352407217, 0.008937559090554714, 0.004285111557692289, 0.05139937624335289, 0.009541874751448631, -0.001209603506140411, -0.019589083269238472, 0.005854596383869648, 0.048103827983140945, 0.022458139806985855, 0.0013513558078557253, -0.013597017154097557, -0.03084021992981434, -0.01921033300459385, -0.005780020263046026, -0.04235517606139183, 0.0508149228990078, 0.04704451933503151, 0.03859129175543785, -0.019989922642707825, -0.0246872715651989, 0.014315449632704258, -0.021555311977863312, 0.006249088793992996, 0.004884902387857437, -0.0342676155269146, 0.024004250764846802, -0.007554769050329924, -0.03543195500969887, -0.029947547242045403, -0.04391065239906311, 0.016305984929203987, -0.03153020516037941, -0.008470777422189713, 0.0028155988547950983, 0.03331741690635681, -0.010050049982964993, 0.027266409248113632, 0.07611875981092453, -0.010976674035191536, 0.011375200934708118, 0.008320304565131664, -0.012992207892239094, 0.02871486358344555, 0.013358556665480137, 0.030839160084724426, -0.02344657853245735, 0.005665148608386517, -0.030751505866646767, -0.021431032568216324, -0.02085067890584469, -0.03671841323375702, 0.02587301656603813, 0.04929420351982117, -0.026704778894782066, 0.04343850538134575, 0.002924124477431178, -0.02855750359594822, -0.0005201708409003913, 0.03025488555431366, 0.05283695086836815, 0.017757287248969078, -0.011635398492217064, 0.038137372583150864, -0.043636664748191833, -0.0025309689808636904, 0.005183031782507896, 0.012535784393548965, -0.008330401964485645, 0.025863807648420334, 0.015060276724398136, 0.03889211267232895, 0.01654207520186901, -0.013984009623527527, -0.005462472792714834, -0.03055053949356079, 0.004917661193758249, -0.03699121251702309, 0.013979454524815083, -0.02923455648124218, -0.026838423684239388, -0.010731910355389118, 0.002489679027348757, -0.03476471081376076, 0.024346724152565002, 0.0544227696955204, 0.00045594063703902066, -0.018472332507371902, 0.067162424325943, -0.030301280319690704, -0.00097808544524014, -0.014892022125422955, -0.005982780829071999, -0.07322245091199875, -0.03734077885746956, -0.025698332116007805, 0.008227336220443249, -0.040725789964199066, 0.0022811575327068567, -0.054729290306568146, -0.017027223482728004, -0.020918944850564003, 0.025204624980688095, 0.028682727366685867, -0.039698753505945206, -0.019818110391497612, 0.005630935076624155, 0.006477089133113623, 0.0003365925804246217, -0.02697899378836155, 0.0019050720147788525, 0.010171880945563316, 0.038288239389657974, -0.0025062800850719213, 0.048489127308130264, 0.016772793605923653, 0.027654634788632393, 0.055433645844459534, -0.021406957879662514, 0.03671355918049812, -0.04441047087311745, 0.0560007207095623, 0.012748424895107746, -0.015981417149305344, 0.002157537965103984, 0.017410390079021454, -0.04732050374150276, -0.015090865083038807, -0.036973800510168076, 0.040903884917497635, 0.0652092769742012, 0.027743952348828316, 0.007386686280369759, -0.001056848675943911, 0.0322941392660141, 0.027173686772584915, -0.03058532252907753, 0.01087450422346592, 0.019439173862338066, 0.00504272012040019, 0.010061893612146378, -0.024416029453277588, 0.0034598184283822775, -0.0037345117889344692, 0.008599531836807728, -0.0728970617055893, 0.06989913433790207, 0.021317005157470703, -0.04744010046124458, 0.004030677955597639, -0.023597098886966705, -0.002274672267958522, -0.023929517716169357, 0.010989867150783539, 0.01779160089790821, 0.011291013099253178, 0.005759873427450657, -0.006726222112774849, -0.0360359326004982, -0.012203502468764782, 0.013752954080700874, 0.04448533058166504, -0.04428543150424957, 0.010967588983476162, 0.010039514862000942, 0.02545875683426857, 0.04255356267094612, 0.02298830635845661, -0.005512523930519819, 0.018221741542220116, 0.05549514666199684, 0.044072385877370834, 0.024189215153455734, -0.027289776131510735, -0.03757653012871742, -0.01825050823390484, -0.02515310049057007, -0.020234782248735428, 0.00503161083906889, 0.02729988656938076, 0.03312711790204048, -0.006371453404426575, -0.025631297379732132, -0.026368269696831703, 0.049589503556489944, 0.04841993749141693, 0.08384248614311218, -0.02922312542796135, 0.022007940337061882, 0.03761174902319908, 0.00708867609500885, -0.011762366630136967, 0.03601008653640747, 0.029539747163653374, 0.015028253197669983, 0.03989297151565552, 0.07879046350717545, 0.06292662769556046, 0.030015017837285995, 0.010887997224926949, 0.007699701935052872, -0.020970556885004044, 0.05814213305711746, 0.0024316690396517515, -0.024983864277601242, -0.056655269116163254, -0.04145264998078346, 0.01948273740708828, -0.035993270576000214, -0.01469794288277626, 0.034352779388427734, 0.02785143442451954, 0.003933316096663475, -0.01597920060157776, 0.014459501951932907, 0.04478653520345688, -0.008561802096664906, 0.013327487744390965, 0.003116814186796546, -0.008673710748553276, 0.022811857983469963, -0.0005771914729848504, -0.013857501558959484, -0.0638638287782669, -0.046292372047901154, -0.007438740227371454, 0.04232563078403473, 0.034184765070676804, -0.027913151308894157, -0.006092280615121126, 0.014252157881855965, 0.028004895895719528, 0.03081163577735424, 0.019456135109066963, 0.009967896156013012, 0.01905115880072117, -0.041030094027519226, 0.03878531605005264, -0.01168788317590952, -0.022691069170832634, 0.022522270679473877, -0.025660118088126183, 0.03872612863779068, -0.03679680824279785, 0.03685726597905159, 0.03183954209089279, 0.004223741125315428, -0.02414330467581749, -0.02798890508711338, -0.01895398087799549, 0.023372825235128403, -0.006112257484346628, 0.014149431139230728, -0.0439186729490757, -0.00568466866388917, 0.034631308168172836, -0.02594468556344509, -0.0018008146435022354, -0.0033859761897474527, 0.017262358218431473, 0.011043116450309753, 0.0065479576587677, -0.043226972222328186, 0.012793558649718761, 0.01687825657427311, 0.0037929678801447153, 0.012626305222511292, 0.009059878997504711, 0.004895505495369434, 0.030698614194989204, -0.010005065239965916, 0.009212317876517773, -0.02699168212711811, 0.04655468836426735, -0.02349552884697914, -0.027464445680379868, -0.02361227199435234, -0.015036637894809246, -0.02601977251470089, 0.005846563261002302, -0.03590962663292885, 0.005210090894252062, 0.01341688260436058, -0.00026461141533218324, -0.015749000012874603, 0.0071235280483961105, 0.03828050568699837, 0.045194342732429504, 0.0118733374401927, -0.012711909599602222, -0.021055663004517555, -0.003650783095508814, -0.025103455409407616, 0.019841238856315613, 0.031839028000831604, -0.004231528379023075, -0.007207714021205902, -0.018200090155005455, 0.011244568973779678, 0.03933286294341087, -0.06325177103281021, 0.032254721969366074, 0.012474372051656246, 0.0036619866732507944, -0.045647069811820984, -0.024650711566209793, 0.045959386974573135, -0.019386446103453636, 0.02809145674109459, -0.023179415613412857, -0.019973378628492355, 0.00010046967508969828, 0.005160992965102196, -0.027694715186953545, 0.014254078269004822, -0.0027829520404338837, -0.0022251459304243326, 0.04217589646577835, -0.014633102342486382, -0.010073217563331127, 0.0066721756011247635, -0.011460921727120876, -0.008356316015124321, -0.008765901438891888, -0.03982836380600929, -0.05278899520635605, -0.034472472965717316, 0.005300676450133324, -0.027660248801112175, -0.018206845968961716, 0.03951910883188248, -0.007302064914256334, -0.05112926661968231, -0.02486986108124256, -0.001957189990207553, -0.025013141334056854, 0.02709866128861904, 0.033120837062597275, 0.0022377516143023968, 0.058715805411338806, 0.0085051991045475, -0.00984704028815031, -0.03795593976974487, -0.007735119666904211 ]
Interactively explore your Huggingface dataset with one line of code
sps44
October 25, 2023
scalable-data-inspection
open-source-collab, visualization, data inspection
https://huggingface.co/blog/scalable-data-inspection
# Interactively explore your Huggingface dataset with one line ofย code The Hugging Face datasets library not only provides access to more than 70k publicly available datasets, but also offers very convenient data preparation pipelines for custom datasets. Renumics Spotlight allows you to create interactive visualizations to identify critical clusters in your data. Because Spotlight understands the data semantics within Hugging Face datasets, you can get started with just one line of code: python import datasets from renumics import spotlight ds = datasets.load_dataset('speech_commands', 'v0.01', split='validation') spotlight.show(ds) Spotlight allows to leverage model results such as predictions and embeddings to gain a deeper understanding in data segments and model failure modes: python ds_results = datasets.load_dataset('renumics/speech_commands-ast-finetuned-results', 'v0.01', split='validation') ds = datasets.concatenate_datasets([ds, ds_results], axis=1) spotlight.show(ds, dtype={'embedding': spotlight.Embedding}, layout=spotlight.layouts.debug_classification(embedding='embedding', inspect={'audio': spotlight.dtypes.audio_dtype})) Data inspection is a very important task in almost all ML development stages, but it can also be very time consuming. > โ€œManual inspection of data has probably the highest value-to-prestige ratio of any activity in machine learning.โ€โ€Šโ€”โ€ŠGreg Brockman > Spotlight helps you to make data inspection more scalable along two dimensions: Setting up and maintaining custom data inspection workflows and finding relevant data samples and clusters to inspect. In the following sections we show some examples based on Hugging Face datasets.
[ -0.004180813208222389, -0.021136919036507607, 0.04480935260653496, -0.029963459819555283, 0.008255586959421635, 0.0860939472913742, 0.031178656965494156, -0.017892543226480484, -0.11207083612680435, -0.0410454161465168, -0.08971390873193741, 0.0524674728512764, 0.04599777236580849, 0.05893006548285484, 0.030511675402522087, -0.11537229269742966, 0.007691854611039162, -0.01820087432861328, -0.0156986266374588, 0.046315960586071014, -0.014101875014603138, -0.06488315016031265, -0.00653299642726779, 0.03701222315430641, -0.039730921387672424, -0.05953003838658333, 0.054278258234262466, 0.008233223110437393, 0.02075027860701084, 0.02211003378033638, -0.20199419558048248, 0.0299528781324625, -0.009041416458785534, -0.004220759030431509, -0.003933357074856758, 0.09062494337558746, -0.09826420992612839, 0.04427776485681534, 0.0765523836016655, -0.034558143466711044, 0.006707937456667423, -0.08218907564878464, -0.09584584087133408, 0.06013503298163414, 0.03029007464647293, -0.014737158082425594, -0.12884214520454407, 0.03803236410021782, -0.04950892925262451, -0.025775820016860962, -0.09683189541101456, 0.06186475232243538, -0.008731608279049397, -0.05570624768733978, 0.005164518021047115, -0.03928671404719353, 0.018069475889205933, -0.08631081879138947, -0.002296922728419304, 0.031044837087392807, 0.0010042920475825667, 0.019730210304260254, 0.021538229659199715, 0.044997166842222214, 0.05358423292636871, -0.00444299029186368, -0.0063024950213730335, 0.051626723259687424, -0.03469571843743324, -0.0444168746471405, 0.07310865819454193, 0.013538054190576077, -0.046205900609493256, -0.03378362953662872, 0.030012844130396843, -0.027665885165333748, -0.003675388405099511, 0.01567257009446621, 0.024751823395490646, 0.02493242546916008, -0.005135724786669016, -0.02021767944097519, -0.025437820702791214, 0.0354020819067955, 0.03314115107059479, 0.03792109340429306, 0.026051266118884087, -0.017793748527765274, -0.12105121463537216, 0.05208573117852211, -0.03185509145259857, -0.08851704746484756, 0.02537800930440426, 0.059576183557510376, 0.035349875688552856, -0.00207113241776824, 0.03132827579975128, 0.035103317350149155, -0.0020500938408076763, -0.030624056234955788, -0.049741480499506, -0.0177308339625597, 0.03246822953224182, -0.040477290749549866, -0.0414891242980957, 0.0313543975353241, -0.05616059899330139, -0.018813790753483772, -0.07250837981700897, 0.04240693524479866, -0.004402993246912956, -0.08778266608715057, -0.031360287219285965, 0.07159904390573502, -0.06958059221506119, 0.008309319615364075, 0.018054867163300514, 0.031584903597831726, -0.06434350460767746, 0.017478715628385544, 0.009110122919082642, 0.06260965764522552, 0.029546255245804787, 0.0322408489882946, 0.01632988452911377, 0.07884367555379868, -0.02404865436255932, 0.03230440989136696, 0.09803541749715805, -0.005064333323389292, -0.040928225964307785, -0.013359159231185913, 0.022753169760107994, 0.02688581682741642, 0.005664518103003502, -0.07050112634897232, 0.011077950708568096, -0.005930985324084759, 0.06415346264839172, 0.034034546464681625, 0.01975797861814499, 0.03928368538618088, -0.028697948902845383, -0.00453758193179965, 0.01702689751982689, 0.0442335419356823, -0.09168282151222229, 0.05726059898734093, -0.03339012339711189, 0.0478547029197216, -0.08014891296625137, 0.032252050936222076, 0.01845465414226055, 0.02130926214158535, -0.009192190133035183, 0.052286773920059204, -0.03009197674691677, -0.01898951828479767, -0.05207105353474617, 0.03679388388991356, 0.008602260611951351, -0.004880847409367561, -0.029866818338632584, -0.024255311116576195, 0.037053193897008896, -0.01589079014956951, -0.009075576439499855, -0.041454799473285675, -0.002330079907551408, 0.04265175387263298, -0.02629404515028, -0.004595579579472542, 0.00922814104706049, -0.008777475915849209, -0.021543089300394058, 0.0374702550470829, 0.05441631004214287, 0.0012981347972527146, -0.016818150877952576, -0.012332943268120289, -0.03539072722196579, 0.0036087885964661837, -0.0046850331127643585, 0.02850407175719738, 0.014413722790777683, -0.04170893877744675, 0.037116631865501404, 0.008336670696735382, 0.02060595341026783, -0.0016441931948065758, -0.05806872621178627, -0.005669041071087122, 0.05914921686053276, -0.044130124151706696, 0.04292213171720505, -0.014128917828202248, 0.003978579770773649, 0.07205075025558472, 0.010935994796454906, 0.004187384620308876, 0.0027571525424718857, 0.02858937345445156, 0.06450202316045761, -0.10828676074743271, -0.016226675361394882, -0.05683854967355728, 0.021087931469082832, -0.08628541231155396, 0.013048709370195866, -0.05423266068100929, 0.042009301483631134, -0.11685125529766083, 0.03733993321657181, -0.002096066251397133, 0.031946275383234024, -0.013215569779276848, -0.06856081634759903, 0.0730382427573204, 0.0024077394045889378, 0.06288375705480576, 0.14346711337566376, 0.015148569829761982, -0.010797260329127312, -0.04234778508543968, -0.04142797738313675, 0.014514999464154243, 0.10427504032850266, 0.07447560876607895, 0.0750812292098999, -0.05135447531938553, -0.04528243467211723, -0.006557885091751814, -0.044384341686964035, 0.008885055780410767, -0.01286329049617052, -0.03993195295333862, 0.0758686289191246, 0.003790666349232197, 0.07024630904197693, -0.019455986097455025, -0.010853655636310577, -0.018358202651143074, 0.007922579534351826, 0.009626735001802444, 0.05879473686218262, -0.056579213589429855, 0.010717799887061119, -0.017426615580916405, -0.0013800362357869744, 0.025011597201228142, -0.029720837250351906, 0.04367314651608467, -0.018658524379134178, -0.020886003971099854, 0.007266656495630741, 0.021327879279851913, -0.014762194827198982, -0.01231187954545021, -0.049396924674510956, 0.05178794264793396, 0.010640477761626244, -0.007442403119057417, -0.049550026655197144, -0.04155726358294487, 0.003087736200541258, -0.03445598855614662, -0.013325519859790802, -0.011040998622775078, 0.05844477564096451, -0.007668226025998592, 0.0020175969693809748, -0.009246018715202808, 0.04389314725995064, -0.006100253667682409, 0.011491168290376663, 0.004298231564462185, 0.04514356702566147, -0.03783981129527092, -0.0017611375078558922, -0.028383180499076843, -0.02443775348365307, -0.016235534101724625, 0.029218249022960663, 0.048755303025245667, 0.02687392197549343, 0.025080159306526184, -0.02762981690466404, -0.006065943278372288, 0.006969294045120478, 0.045917391777038574, 0.009347954764962196, 0.0458049513399601, 0.0344877652823925, -0.039583802223205566, 0.013643351383507252, -0.02547193132340908, -0.02048429660499096, -0.0033046207390725613, -0.010678485035896301, 0.057961732149124146, -0.0312991589307785, 0.02489575371146202, -0.04701723903417587, 0.009599403478205204, -0.01385895349085331, 0.023305682465434074, 0.038214877247810364, 0.0018994943238794804, -0.08446258306503296, 0.016837261617183685, -0.03823687881231308, -0.05006279796361923, 0.015858588740229607, -0.037406452000141144, 0.03600990027189255, 0.008236738853156567, 0.0005269222892820835, -0.011672706343233585, 0.015973811969161034, 0.006615092512220144, 0.025523213669657707, 0.0429081954061985, 0.02203064225614071, 0.03330754116177559, -0.016644783318042755, 0.011759825050830841, 0.05029923841357231, 0.013667604885995388, -0.024185728281736374, 0.023849325254559517, 0.0018410298507660627, -0.004266660660505295, -0.03619099408388138, -0.05561269447207451, 0.08092767000198364, -0.0006395516684278846, -0.02497195266187191, -0.05243579298257828, 0.009328901767730713, -0.03296825289726257, -0.013953219167888165, 0.010954800993204117, -0.004305179230868816, 0.0050872694700956345, 0.006763113662600517, 0.009817329235374928, 0.02731601521372795, 0.017835790291428566, 0.03134581074118614, -0.013493111357092857, 0.031472448259592056, -0.003444946138188243, 0.04517555236816406, -0.03206996992230415, -0.0037570500280708075, 0.00023813148436602205, -0.029971828684210777, -0.02591155469417572, -0.01046021655201912, -0.011654517613351345, -0.03017224371433258, 0.03997166082262993, 0.0019360942533239722, 0.05306791514158249, 0.018846405670046806, -0.022275153547525406, -0.010473704896867275, -0.0032016681507229805, -0.027627047151327133, 0.012283730320632458, -0.0362677276134491, -0.02035726048052311, 0.00628203060477972, -0.010683264583349228, 0.004604831337928772, -0.006847540382295847, -0.020967869088053703, 0.06265021860599518, 0.0171365924179554, 0.024093912914395332, -0.03121313452720642, -0.002326446818187833, -0.010500379838049412, -0.019960930570960045, -0.000808709126431495, -0.05938839912414551, 0.04261822625994682, 0.051398865878582, -0.02749885432422161, -0.015137693844735622, -0.006710243411362171, -0.006035840138792992, 0.028572572395205498, 0.0006630367715843022, -0.044122397899627686, -0.031806495040655136, 0.015167947858572006, 0.0050152139738202095, -0.008748757652938366, -0.007342965342104435, 0.016788773238658905, -0.008441690355539322, 0.006375519093126059, -0.002374545205384493, 0.024072453379631042, 0.03569117933511734, -0.004471008665859699, -0.01620464213192463, -0.0020390073768794537, -0.04673438146710396, 0.015420665964484215, -0.007689354475587606, -0.02109312079846859, 0.036432765424251556, -0.05740037187933922, -0.052085742354393005, 0.03855343908071518, -0.04599573835730553, -0.01939849928021431, -0.019880002364516258, -0.039761364459991455, -0.012695739977061749, 0.04205809533596039, 0.04271091893315315, 0.02124345302581787, -0.0006475560367107391, -0.012432015500962734, 0.044826850295066833, 0.0035786486696451902, 0.0004755263216793537, -0.016092071309685707, 0.0024656725581735373, 0.03377744182944298, 0.00651570362970233, 0.0025292180944234133, -0.022194497287273407, -0.01927882619202137, -0.019753649830818176, 0.008015317842364311, -0.03623209521174431, 0.021839885041117668, 0.017087839543819427, 0.017071479931473732, -0.002954342868179083, -0.011574981734156609, 0.00016127967683132738, -0.01626792550086975, 0.0034201329108327627, -0.01480281911790371, -0.020972708240151405, -0.021159764379262924, 0.013325018808245659, -0.03779096528887749, -0.006964097730815411, -0.04337826371192932, -0.027445470914244652, -0.04936533421278, 0.003184629138559103, -0.00483500212430954, 0.028151284903287888, -0.030027465894818306, 0.050165463238954544, 0.05055621266365051, -0.0197843536734581, 0.014615816064178944, -0.0025781537406146526, -0.0012717266799882054, 0.0006802358548156917, -0.019623039290308952, 0.006165158469229937, -0.023836854845285416, 0.016942216083407402, -0.027621811255812645, -0.02236188016831875, -0.01726558804512024, -0.027272820472717285, 0.027886154130101204, 0.025586863979697227, -0.03803134337067604, 0.022404532879590988, 0.031099744141101837, -0.015448730438947678, -0.013563630171120167, 0.08262288570404053, 0.032315079122781754, 0.036237262189388275, 0.024624425917863846, 0.026938704773783684, -0.05557059124112129, -0.02366895042359829, 0.006659833714365959, 0.01118810847401619, 0.005272329784929752, 0.037557076662778854, 0.00009920657612383366, 0.05673275887966156, 0.035883884876966476, -0.017604166641831398, -0.016316531226038933, -0.03877360001206398, -0.004180172458291054, -0.013291697949171066, 0.003882325952872634, -0.03350833058357239, 0.0019687116146087646, 0.001424688845872879, 0.0025590425357222557, -0.04779601842164993, 0.011869041249155998, 0.02842753194272518, -0.01881996914744377, -0.01611039601266384, 0.07808295637369156, -0.01604890078306198, -0.0018108526710420847, -0.01141213160008192, 0.026717625558376312, -0.08975816518068314, -0.025101609528064728, -0.0506478026509285, 0.004133908078074455, -0.013401051051914692, 0.020006995648145676, -0.03332144021987915, 0.002240140689536929, -0.0426819808781147, 0.04252224788069725, 0.03769972547888756, -0.031733978539705276, -0.02847225032746792, -0.006040705367922783, 0.003075285814702511, 0.01563349924981594, -0.04078076779842377, 0.022111112251877785, 0.005905612837523222, 0.03347314894199371, 0.012601211667060852, 0.041326649487018585, 0.007465481758117676, 0.015627387911081314, 0.05177001282572746, -0.01362561620771885, 0.02507924661040306, -0.044273968786001205, 0.04188188537955284, 0.032049138098955154, -0.015375443734228611, -0.0051492974162101746, -0.0019732394721359015, -0.03041316568851471, 0.03339351713657379, -0.023284338414669037, 0.048086486756801605, 0.07530824095010757, 0.006088483612984419, 0.017435798421502113, 0.008025240153074265, 0.0262534711509943, 0.025930922478437424, -0.016598567366600037, -0.0217079296708107, 0.03949056938290596, 0.017228461802005768, 0.015557019039988518, -0.01720966212451458, 0.02587331458926201, 0.011926328763365746, 0.02645191363990307, -0.08592049032449722, 0.05511641129851341, 0.03289775922894478, -0.04941951856017113, 0.014324625954031944, -0.016427746042609215, -0.009867029264569283, 0.0011930310865864158, -0.0035722139291465282, 0.013693460263311863, 0.023279625922441483, 0.01761799119412899, -0.001793866278603673, -0.029083136469125748, -0.008509769104421139, 0.00295152491889894, 0.0783635601401329, -0.017719481140375137, 0.011093133129179478, 0.02725936844944954, 0.04234510287642479, 0.04128619655966759, 0.033635616302490234, 0.009144525043666363, 0.005226338282227516, 0.046156302094459534, 0.0637703463435173, 0.009647911414504051, 0.0400787815451622, -0.009695981629192829, -0.028197703883051872, -0.026903189718723297, -0.040969572961330414, -0.00014235971320886165, 0.045381754636764526, 0.03564576804637909, -0.040174540132284164, 0.011644482612609863, -0.014203738421201706, 0.062047820538282394, 0.053537748754024506, 0.028161557391285896, -0.023093976080417633, 0.06053534150123596, 0.019803063943982124, 0.03327498584985733, -0.009277057833969593, 0.016052721068263054, 0.008264772593975067, 0.0009127088123932481, 0.03907410427927971, 0.06285608559846878, 0.07063449174165726, 0.014512370340526104, 0.03084360435605049, -0.0017768468242138624, -0.05153151601552963, 0.016589926555752754, 0.017450034618377686, -0.03192733973264694, -0.03379639983177185, -0.02591569535434246, 0.02849915809929371, -0.03600026294589043, -0.008215458132326603, 0.02519131265580654, 0.017732953652739525, -0.006126391235738993, -0.008043716661632061, 0.003015682799741626, 0.03363732621073723, -0.02735929563641548, 0.007576932664960623, -0.018190154805779457, -0.004562721122056246, 0.008632958866655827, 0.003939795773476362, 0.010414445772767067, -0.02945599891245365, -0.05064835399389267, -0.041704919189214706, 0.03518926724791527, 0.04601576179265976, -0.016535097733139992, -0.022961881011724472, -0.01980431191623211, 0.04446886479854584, 0.0339246541261673, 0.023049796000123024, 0.0006994217401370406, 0.025472864508628845, -0.040542345494031906, 0.05473409593105316, -0.005417263600975275, -0.00880050752311945, 0.021161509677767754, -0.05039101839065552, 0.02100720815360546, -0.02308596484363079, 0.01989240199327469, 0.026945021003484726, 0.0116689158603549, -0.015085670165717602, -0.03788258507847786, 0.013790814206004143, 0.02287393808364868, -0.019469784572720528, 0.030959703028202057, -0.025737516582012177, -0.019369255751371384, 0.024716056883335114, 0.00915692187845707, 0.0005581372533924878, 0.0023476805072277784, -0.009269428439438343, 0.015690496191382408, -0.007869459688663483, -0.040920477360486984, 0.016568252816796303, 0.023310409858822823, 0.04953854903578758, 0.008034449070692062, -0.004955872427672148, 0.012939807027578354, 0.024683484807610512, -0.023866700008511543, -0.0009401149582117796, -0.02927745133638382, 0.03647485002875328, -0.028515225276350975, -0.03128679469227791, -0.03361076861619949, -0.0032666244078427553, -0.026942819356918335, 0.00024405951262451708, -0.04213399440050125, 0.00819619745016098, 0.03798492252826691, -0.010458569042384624, -0.02876306138932705, 0.002870584838092327, 0.03873361647129059, 0.027659432962536812, 0.016007954254746437, 0.009356720373034477, -0.009775240905582905, 0.03503615781664848, -0.04815524443984032, -0.003232815768569708, 0.021802086383104324, -0.0021135478746145964, 0.00021592645498458296, -0.02372441627085209, 0.014797809533774853, 0.019889911636710167, -0.04368598759174347, 0.0029370763804763556, 0.01938215270638466, 0.020627988502383232, -0.0564986877143383, -0.021905498579144478, 0.052825383841991425, -0.009601525031030178, 0.022045889869332314, -0.032623693346977234, 0.004572561476379633, -0.0009092528489418328, 0.013495340012013912, -0.0219167061150074, 0.013686113059520721, -0.00914695393294096, -0.01031017117202282, 0.03997107222676277, -0.02828270196914673, 0.028147147968411446, 0.015227663330733776, 0.003588209394365549, -0.01734749786555767, 0.006628486793488264, -0.016115255653858185, -0.03613690286874771, -0.028214527294039726, 0.03355872631072998, -0.02342449501156807, -0.004102276172488928, 0.034036602824926376, 0.0075207962654531, -0.03994212672114372, -0.0062927305698394775, 0.0002248488599434495, 0.008491485379636288, 0.022700510919094086, 0.009102661162614822, 0.001053235144354403, 0.053179554641246796, 0.024323515594005585, -0.01776987873017788, -0.06578368693590164, 0.00048208096995949745 ]
Interactively explore your Huggingface dataset with one line of code
sps44
October 25, 2023
scalable-data-inspection
open-source-collab, visualization, data inspection
https://huggingface.co/blog/scalable-data-inspection
Using Spotlight on the Hugging Face hub You can use Spotlight directly on your local NLP, audio, CV or multimodal dataset. If you would like to showcase your dataset or model results on the Hugging Face hub, you can use Hugging Face spaces to launch a Spotlight visualization for it. We have already prepared example spaces for many popular NLP, audio and CV datasets on the hub. You can simply duplicate one of these spaces and specify your dataset in the HF_DATASET variable. You can optionally choose a dataset that contains model results and other configuration options such as splits, subsets or dataset revisions.
[ -0.02510260045528412, -0.014310996048152447, 0.009828232228755951, -0.057145360857248306, 0.00444367527961731, 0.01603720895946026, -0.009259099140763283, 0.05625388026237488, -0.10185703635215759, -0.025347594171762466, -0.1008879765868187, 0.07652604579925537, 0.04983965680003166, 0.03214036673307419, 0.001703042071312666, -0.11894247680902481, 0.012625318951904774, -0.009031811729073524, 0.027545660734176636, 0.10222935676574707, 0.00023673281248193234, -0.021815313026309013, 0.04428877308964729, 0.054681871086359024, -0.047742825001478195, -0.047676995396614075, 0.07756195217370987, 0.053387150168418884, 0.02487264573574066, 0.05331486091017723, -0.11982579529285431, 0.037397030740976334, 0.020601755008101463, -0.001998353283852339, 0.05172016844153404, 0.06572730839252472, -0.11965392529964447, 0.04369623214006424, 0.07712139934301376, -0.025376414880156517, -0.024381719529628754, -0.08126967400312424, -0.05443616956472397, 0.05078941583633423, 0.04391419142484665, -0.034681133925914764, -0.12515783309936523, 0.034452635794878006, -0.003478085855022073, -0.019468102604150772, -0.07873492687940598, 0.09575596451759338, 0.022530799731612206, -0.04806845635175705, 0.05946433171629906, 0.013632701709866524, 0.020536012947559357, -0.10415303707122803, 0.02266821078956127, 0.0665820762515068, -0.005038866773247719, -0.0324004665017128, -0.019285941496491432, 0.07480784505605698, 0.034701988101005554, 0.004218012560158968, -0.009688186459243298, -0.013616735115647316, -0.03524838760495186, -0.016276460140943527, 0.023887159302830696, 0.04259060323238373, -0.007525128778070211, -0.0257534459233284, 0.02260436676442623, 0.009870314039289951, 0.0229429230093956, 0.028380701318383217, 0.02354632504284382, -0.01102150697261095, 0.011306690983474255, -0.05714966729283333, -0.0017348964465782046, 0.029970472678542137, -0.005216412246227264, 0.03062569908797741, -0.006812052335590124, -0.01905197650194168, -0.08917904645204544, 0.0664873942732811, -0.018794801086187363, -0.11317978799343109, 0.003734947880730033, 0.08611870557069778, 0.06458211690187454, 0.03841628506779671, 0.018738623708486557, -0.004094977863132954, -0.006855974905192852, -0.011871935799717903, -0.03844928741455078, -0.017037097364664078, 0.004425817169249058, -0.06958471983671188, -0.031613148748874664, 0.010607466101646423, -0.057913560420274734, -0.062183160334825516, -0.04244823753833771, 0.02607467584311962, 0.012448781169950962, -0.11346730589866638, -0.005512140691280365, 0.07181272655725479, -0.0284727755934, 0.008340931497514248, 0.05922357365489006, 0.01866917684674263, 0.012143976055085659, 0.03113703615963459, 0.03791949898004532, 0.10086745768785477, 0.009313947521150112, 0.07350533455610275, -0.0028451152611523867, 0.05124777927994728, -0.050874579697847366, 0.009470352903008461, 0.05957431718707085, -0.04937506839632988, -0.01722126454114914, -0.043837614357471466, 0.07375262677669525, 0.011995348148047924, 0.042763084173202515, -0.03513355180621147, 0.03669539839029312, -0.05390606075525284, 0.03988965228199959, -0.0012110895477235317, 0.02900252304971218, 0.07281951606273651, 0.024738842621445656, -0.05194409191608429, 0.027299245819449425, 0.060176994651556015, -0.0334143303334713, 0.0436040461063385, 0.0037348915357142687, 0.02870023250579834, -0.0439860001206398, 0.06119885668158531, 0.05183689668774605, -0.03466648608446121, -0.015998635441064835, 0.05736839026212692, -0.011398619040846825, -0.02134024351835251, -0.03961776942014694, 0.020780950784683228, 0.017249416559934616, 0.02314029447734356, -0.0927005335688591, 0.021789714694023132, 0.0011918130330741405, 0.000470612634671852, -0.04814787209033966, -0.05833322927355766, -0.0011916857911273837, 0.022453604266047478, -0.0031664862763136625, -0.0074555352330207825, 0.033165253698825836, -0.016250185668468475, 0.020396068692207336, 0.05183678865432739, 0.07333199679851532, 0.0828748568892479, -0.0399971529841423, 0.021258026361465454, -0.032395727932453156, 0.06756214797496796, -0.010673530399799347, 0.026347432285547256, 0.017601408064365387, -0.08864307403564453, 0.05705680698156357, 0.033741168677806854, 0.016469169408082962, -0.029780833050608635, -0.029469884932041168, -0.03557150810956955, 0.02879602275788784, -0.013004141859710217, 0.013516337610781193, -0.021248986944556236, -0.01714806631207466, 0.09938301146030426, 0.03719225153326988, 0.032759372144937515, 0.0001541667152196169, 0.03056304156780243, 0.024081844836473465, -0.07041607797145844, -0.008307045325636864, 0.023796699941158295, -0.004740292206406593, -0.06598906964063644, 0.016705790534615517, -0.012919016182422638, 0.03589306026697159, -0.10819331556558609, 0.06395193189382553, 0.005204611457884312, 0.008199839852750301, -0.04728204011917114, 0.00011855674529215321, 0.06572626531124115, -0.0507856123149395, 0.04958244413137436, 0.1374114751815796, 0.057513535022735596, 0.03982379660010338, -0.038747794926166534, -0.0178971029818058, 0.04082978889346123, 0.05780881270766258, 0.09303154051303864, 0.06888661533594131, -0.03537127748131752, -0.04715190455317497, -0.02671148255467415, -0.05018797144293785, 0.0054458146914839745, -0.05613378435373306, -0.025322968140244484, 0.08734862506389618, 0.04303371161222458, 0.03131388500332832, 0.012179937213659286, -0.00941380113363266, -0.03742584213614464, -0.02584947645664215, -0.004392153117805719, 0.056417882442474365, 0.012309717945754528, 0.026467321440577507, -0.03680095076560974, 0.01648808643221855, 0.037457261234521866, -0.05839792639017105, 0.03350747376680374, -0.01194556150585413, -0.017564410343766212, -0.029403669759631157, 0.05088222771883011, 0.0024997559376060963, -0.026780089363455772, -0.07875439524650574, 0.011361942626535892, 0.007797119673341513, -0.006213415879756212, -0.050656743347644806, -0.039795540273189545, -0.02581586129963398, -0.03024820238351822, 0.026029394939541817, -0.008561555296182632, 0.005445255897939205, -0.03468439728021622, -0.014974070712924004, 0.013104434125125408, 0.04065043479204178, 0.01697384938597679, 0.008300291374325752, 0.0030989216174930334, 0.0065663778223097324, -0.04112366586923599, -0.012757561169564724, -0.000578269362449646, -0.008507123216986656, -0.0275699645280838, 0.017435122281312943, 0.053893815726041794, 0.00386118795722723, 0.01318505872040987, -0.051703982055187225, -0.02974991872906685, -0.045092251151800156, 0.018966373056173325, 0.015865033492445946, 0.043480392545461655, 0.04208589345216751, 0.01826375722885132, 0.013276709243655205, -0.008371454663574696, 0.014975345693528652, 0.004842319525778294, -0.05740990862250328, 0.037649933248758316, 0.010331407189369202, 0.014874016866087914, -0.007630091160535812, -0.021558329463005066, 0.005987587384879589, 0.022677913308143616, 0.02364775538444519, -0.01294105313718319, -0.07951623201370239, -0.011429657228291035, -0.03428706154227257, -0.005362814292311668, 0.005839497782289982, -0.0215593408793211, 0.01942228525876999, -0.021241795271635056, 0.022419774904847145, 0.011229410767555237, -0.014730927534401417, -0.005292888265103102, -0.0038338666781783104, 0.017078066244721413, 0.007549550849944353, 0.03977489471435547, -0.03828664496541023, -0.0033463393338024616, 0.06215468794107437, 0.06700710952281952, -0.050043750554323196, 0.0022839531302452087, 0.040681373327970505, -0.023980364203453064, -0.03663289174437523, -0.04689658805727959, 0.04844468832015991, -0.03989271819591522, 0.01527379360049963, -0.032426219433546066, 0.020311806350946426, -0.022164762020111084, -0.028325030580163002, 0.005420098081231117, -0.04016713425517082, 0.00449453666806221, 0.011270263232290745, 0.007684327196329832, 0.05258968845009804, 0.014546671882271767, 0.008635747246444225, 0.009189925156533718, 0.01805267482995987, 0.011847051791846752, 0.039293013513088226, -0.014115886762738228, -0.008211880922317505, 0.006012653931975365, -0.005730816628783941, -0.046991776674985886, -0.040129244327545166, -0.01893867924809456, -0.004372580908238888, 0.03669741749763489, -0.01631869189441204, 0.029552994295954704, 0.024100374430418015, 0.014462067745625973, -0.0014234123518690467, -0.0474495105445385, -0.07566840201616287, 0.007546252105385065, -0.04794022813439369, -0.036397941410541534, -0.004668946377933025, -0.012884596362709999, -0.016830792650580406, 0.029230965301394463, 0.004691931419074535, 0.02587667666375637, 0.03617548570036888, 0.005234418902546167, 0.015799539163708687, 0.00994245707988739, -0.021378815174102783, -0.01609543152153492, 0.0022131791338324547, -0.04967544972896576, 0.04402129352092743, 0.017168356105685234, -0.0025559302885085344, 0.017818007618188858, 0.0037340677808970213, -0.004368950612843037, 0.008941938169300556, -0.010219043120741844, 0.007377937436103821, -0.01886877417564392, 0.025558970868587494, -0.004978974349796772, 0.005427647847682238, -0.025942064821720123, 0.007429955992847681, -0.04101257771253586, -0.031137993559241295, -0.0324053093791008, -0.013608502224087715, 0.01642359420657158, -0.0017446469282731414, -0.0402049794793129, -0.028653349727392197, -0.034217189997434616, 0.0096898153424263, -0.006098167039453983, 0.0252462737262249, 0.04609400033950806, -0.01875600405037403, -0.06284593045711517, 0.030186939984560013, -0.05976558476686478, -0.00595482811331749, -0.014448395930230618, 0.008753828704357147, -0.007686196826398373, 0.043476659804582596, 0.018631020560860634, -0.0034856596030294895, 0.006103463005274534, -0.027590882033109665, 0.04221808537840843, 0.015712784603238106, 0.02214658632874489, -0.037586793303489685, -0.04081326350569725, 0.019537026062607765, 0.03297543153166771, 0.008532240055501461, -0.018447253853082657, -0.0026278214063495398, 0.0021585680078715086, -0.016912488266825676, -0.01227477565407753, 0.028499169275164604, 0.0335657000541687, 0.010891824029386044, -0.019262021407485008, -0.02303876355290413, 0.0076413522474467754, -0.00521955918520689, 0.01417922880500555, 0.005937109235674143, -0.014392772689461708, 0.03258465230464935, -0.01100606843829155, -0.0020241911988705397, 0.007328455336391926, -0.051820266991853714, -0.008850712329149246, -0.05616309866309166, -0.005592989735305309, 0.021114617586135864, 0.04492221027612686, -0.035563208162784576, 0.03537549823522568, 0.06331528723239899, -0.03120916336774826, -0.011136970482766628, -0.011614102870225906, -0.010904562659561634, 0.017570987343788147, -0.00003745011781575158, 0.012922282330691814, -0.016402559354901314, -0.019102608785033226, -0.011281686834990978, 0.016419269144535065, -0.012283860705792904, -0.0430632047355175, 0.01710364781320095, 0.013918100856244564, -0.03945382311940193, 0.013897489756345749, 0.01729498617351055, -0.04460679739713669, -0.018913978710770607, 0.05956270918250084, 0.08536916226148605, 0.007809411734342575, 0.018397346138954163, 0.027001729235053062, -0.03564290702342987, -0.008986728265881538, -0.013461558148264885, 0.002382030477747321, 0.022881297394633293, 0.0314895398914814, 0.020847264677286148, 0.07930390536785126, 0.013740742579102516, -0.009488634765148163, 0.0042550815269351006, -0.04268452897667885, -0.01524224691092968, -0.06565649062395096, -0.020497214049100876, -0.014115276746451855, 0.00894819013774395, -0.0261850543320179, -0.018606362864375114, -0.023343609645962715, 0.018385712057352066, 0.043305184692144394, -0.014749118126928806, -0.029581939801573753, 0.017322136089205742, -0.043892476707696915, -0.01022817101329565, 0.005057049449533224, -0.006788616068661213, -0.05647150054574013, -0.036847326904535294, -0.016269979998469353, 0.010859155096113682, -0.012555028311908245, -0.005233675241470337, -0.01910742186009884, -0.017477966845035553, -0.016221001744270325, -0.004278405569493771, 0.0374164916574955, -0.031957484781742096, -0.02175923064351082, 0.01737973466515541, -0.00968676432967186, -0.022680453956127167, -0.03820914030075073, 0.004692982882261276, 0.015929607674479485, 0.018304429948329926, 0.012506851926445961, 0.014855708926916122, 0.009236838668584824, 0.04548244550824165, 0.04058293625712395, 0.002647376386448741, 0.04160567373037338, -0.06088951975107193, 0.0379161462187767, 0.004808460827916861, -0.03217229247093201, 0.0072838375344872475, 0.01010100357234478, -0.026725437492132187, 0.009473113343119621, -0.04800635203719139, 0.03381004557013512, 0.05948323756456375, 0.03162980079650879, 0.0007396820583380759, 0.0015680380165576935, -0.006916036829352379, 0.01176502276211977, -0.01931990683078766, 0.012516398914158344, 0.02007022500038147, 0.011588150635361671, 0.02586856670677662, -0.003467366099357605, 0.022671964019536972, 0.02899685874581337, 0.0035600359551608562, -0.06715153902769089, 0.05624654144048691, 0.01933513768017292, -0.02687893621623516, -0.008101748302578926, -0.024156013503670692, -0.010702935978770256, -0.026184581220149994, 0.013272256590425968, 0.012088291347026825, 0.0027326273266226053, -0.013228764757514, -0.015232183039188385, -0.03477514162659645, 0.008244593627750874, -0.0021652579307556152, 0.039389416575431824, -0.007901225239038467, 0.0010689162882044911, 0.02204732783138752, 0.03629835695028305, 0.03890726715326309, 0.015155822969973087, -0.01743861474096775, 0.03612004965543747, 0.030099721625447273, 0.040178485214710236, 0.025195643305778503, -0.011536436155438423, -0.006279587280005217, -0.03839565068483353, -0.04070513695478439, -0.02030482143163681, 0.005985990632325411, 0.03343679755926132, 0.025799276307225227, -0.019070928916335106, -0.015186783857643604, -0.04976935312151909, 0.0500076524913311, 0.052011020481586456, 0.01634424552321434, -0.0338168665766716, -0.004627865739166737, 0.024129334837198257, 0.018616581335663795, 0.012585237622261047, 0.0164639949798584, 0.021356213837862015, 0.002365649677813053, 0.03158245235681534, 0.041606198996305466, 0.032347261905670166, -0.020782317966222763, 0.04057179391384125, -0.0005952341016381979, -0.033313244581222534, 0.010398686863481998, 0.01323501393198967, -0.023712756112217903, -0.05762159079313278, -0.04973766207695007, 0.024257991462945938, -0.03156724199652672, -0.007084324490278959, -0.00952808279544115, 0.01452826987951994, -0.006576021667569876, -0.0010329054202884436, -0.0037471987307071686, 0.04083659127354622, 0.002532706595957279, -0.011995322071015835, 0.00562016386538744, 0.011472671292722225, 0.04581563174724579, 0.002827197080478072, 0.0013173033948987722, -0.07000274211168289, -0.041980285197496414, -0.03632422164082527, 0.02001834101974964, 0.03749518841505051, 0.027255089953541756, -0.036555275321006775, -0.009877117350697517, 0.05941258743405342, 0.019757980480790138, 0.02712131477892399, -0.011630503460764885, 0.04094470292329788, -0.07573532313108444, 0.004043104592710733, -0.033306244760751724, -0.024750158190727234, 0.03607457876205444, -0.01789258047938347, 0.03721405938267708, -0.007536912802606821, 0.01948569156229496, 0.040532708168029785, 0.02945995144546032, -0.012829887680709362, -0.04272524267435074, -0.02019573003053665, 0.025890452787280083, -0.03055613301694393, 0.06420750170946121, -0.035118576139211655, 0.0021273139864206314, 0.04956570640206337, -0.028049306944012642, 0.0008824947872199118, 0.006151317618787289, 0.015896888449788094, 0.06718536466360092, -0.002013233955949545, -0.03686995431780815, 0.013668048195540905, 0.011175875551998615, 0.004700436256825924, 0.0023153582587838173, -0.0026311350520700216, 0.003329430939629674, 0.06266798079013824, -0.03742311894893646, 0.02379756234586239, -0.013102976605296135, 0.00581982359290123, -0.024282876402139664, -0.045420777052640915, -0.04169371351599693, -0.01171951275318861, -0.036851152777671814, 0.00019592855824157596, -0.020335543900728226, -0.009565269574522972, 0.012574145570397377, 0.014138183556497097, -0.03118893690407276, 0.0008537343819625676, 0.025317348539829254, 0.0597400888800621, 0.02452305518090725, -0.02345644123852253, -0.031244123354554176, -0.0055512054823338985, -0.014082459732890129, 0.0200403593480587, 0.03482340648770332, -0.0028944588266313076, -0.03308362513780594, -0.027777066454291344, -0.004736826289445162, 0.015985332429409027, -0.06562149524688721, 0.04393208026885986, 0.007783898152410984, 0.002960537327453494, -0.05114205926656723, -0.021969472989439964, 0.04136214032769203, -0.008848178200423717, 0.029392221942543983, -0.02303730510175228, -0.022616272792220116, -0.0003034754772670567, -0.007796014659106731, -0.01966697722673416, 0.007580089382827282, -0.025497976690530777, -0.02168259583413601, 0.020983852446079254, -0.019171496853232384, 0.01640927605330944, -0.0008389202412217855, -0.007335795555263758, 0.015948163345456123, -0.021699633449316025, -0.031191084533929825, -0.04270246624946594, -0.017112934961915016, 0.03915099799633026, -0.02219480276107788, -0.016890499740839005, 0.0434335358440876, -0.018093179911375046, -0.05276688560843468, -0.029373060911893845, 0.03560951352119446, -0.03976741433143616, 0.02347048744559288, 0.018306981772184372, -0.001548263942822814, 0.05044609308242798, -0.0015148358652368188, -0.005618715658783913, -0.061099808663129807, -0.016887400299310684 ]
Interactively explore your Huggingface dataset with one line of code
sps44
October 25, 2023
scalable-data-inspection
open-source-collab, visualization, data inspection
https://huggingface.co/blog/scalable-data-inspection
Spotlight ๐Ÿค Hugging Face datasets The datasets library has several features that makes it an ideal tool for working with ML datasets: It stores tabular data (e.g. metadata, labels) along with unstructured data (e.g. images, audio) in a common Arrows table. Datasets also describes important data semantics through features (e.g. images, audio) and additional task-specific metadata. Spotlight directly works on top of the datasets library. This means that there is no need to copy or pre-process the dataset for data visualization and inspection. Spotlight loads the tabular data into memory to allow for efficient, client-side data analytics. Memory-intensive unstructured data samples (e.g. audio, images, video) are loaded lazily on demand. In most cases, data types and label mappings are inferred directly from the dataset. Here, we visualize the CIFAR-100 dataset with one line of code: python ds = datasets.load_dataset('cifar100', split='test') spotlight.show(ds) In cases where the data types are ambiguous or not specified, the Spotlight API allows to manually assign them: python label_mapping = dict(zip(ds.features['fine_label'].names, range(len(ds.features['fine_label'].names)))) spotlight.show(ds, dtype={'img': spotlight.Image, 'fine_label': spotlight.dtypes.CategoryDType(categories=label_mapping)})
[ -0.060463424772024155, 0.0052923462353646755, -0.0016605060081928968, 0.015631766989827156, -0.026886222884058952, 0.05310160666704178, -0.023835960775613785, 0.012787765823304653, -0.10165372490882874, 0.0193615835160017, -0.07398770749568939, 0.0855669230222702, 0.010549556463956833, 0.03691969811916351, 0.02212335169315338, -0.10487158596515656, 0.01944095268845558, 0.023874923586845398, 0.006950711365789175, 0.10590632259845734, 0.0166583601385355, -0.09606795758008957, 0.03706210106611252, -0.025825757533311844, -0.0667145624756813, -0.050124458968639374, 0.04779790714383125, -0.019874652847647667, -0.004759565461426973, 0.037683334201574326, -0.15689587593078613, 0.010048034600913525, 0.0003669207217171788, 0.014025107026100159, -0.0002819813380483538, 0.024552756920456886, -0.08378780633211136, 0.04452213644981384, 0.03940476104617119, -0.08168093860149384, 0.007135407533496618, -0.06098603829741478, -0.08686774969100952, 0.08486124873161316, 0.019730353727936745, -0.00895656831562519, -0.1354331076145172, 0.03314381465315819, -0.040695562958717346, 0.00043410598300397396, -0.0990995541214943, 0.03537951409816742, 0.036481983959674835, -0.024832602590322495, 0.017416641116142273, 0.007092502433806658, 0.006868728902190924, -0.0694081261754036, -0.003921260591596365, 0.07621746510267258, -0.03934883698821068, 0.016556188464164734, 0.014650066383183002, 0.0017574920784682035, 0.047256819903850555, -0.034804586321115494, 0.022530818358063698, 0.04174088314175606, -0.0004170751490164548, -0.04865148290991783, 0.06658346951007843, 0.05853283032774925, -0.01078102644532919, -0.04253474995493889, -0.007752272766083479, 0.015778886154294014, -0.014680291526019573, 0.0016721627907827497, 0.026618963107466698, -0.017154613509774208, -0.002223578281700611, -0.01437949575483799, 0.02261972613632679, 0.062095195055007935, 0.011316115036606789, 0.028110794723033905, 0.003531205467879772, -0.0678170844912529, -0.12242532521486282, 0.03772275894880295, -0.0026883964892476797, -0.1242583841085434, 0.004062035121023655, 0.051172539591789246, 0.021898826584219933, -0.029472393915057182, 0.0240689255297184, -0.005739365238696337, 0.03398944437503815, -0.00025798179558478296, -0.05085984617471695, 0.008584448136389256, 0.024068444967269897, -0.05278337746858597, -0.026821453124284744, 0.013321232981979847, -0.08270765841007233, -0.043822381645441055, -0.05630248785018921, 0.010010440833866596, -0.02764352224767208, -0.07631909847259521, -0.04707082733511925, 0.04191622883081436, -0.05887925997376442, -0.021871108561754227, 0.026411937549710274, 0.05386635288596153, -0.03334622085094452, 0.0521799772977829, 0.004857900086790323, 0.06183350831270218, 0.0069615705870091915, 0.009578053839504719, -0.007826452143490314, 0.06016959622502327, -0.05217337608337402, 0.06835690885782242, 0.10442876815795898, -0.003621493000537157, -0.045037515461444855, -0.02314741350710392, 0.041983380913734436, 0.008647684007883072, -0.024024343118071556, -0.03226175904273987, 0.0023986503947526217, -0.026960287243127823, 0.04093092307448387, 0.009422722272574902, 0.008679022081196308, 0.0715249627828598, 0.015156016685068607, -0.011155116371810436, 0.045067206025123596, 0.015626192092895508, -0.042234670370817184, 0.05093676596879959, -0.005231859162449837, 0.027406448498368263, -0.031263045966625214, 0.03628447279334068, 0.08023717254400253, 0.04727114364504814, -0.012415675446391106, 0.017952699214220047, -0.020599013194441795, -0.010603918693959713, -0.07605934888124466, -0.010329491458833218, -0.012020293623209, 0.019946929067373276, -0.05466314032673836, 0.015598749741911888, 0.014164448715746403, 0.004319902043789625, -0.013507225550711155, -0.014192700386047363, -0.015439093112945557, 0.01676664501428604, 0.002404301194474101, -0.05162990838289261, -0.013460447080433369, 0.004622661042958498, -0.009751289151608944, 0.03739992901682854, 0.05029771476984024, 0.010385156609117985, -0.06044342741370201, -0.023158742114901543, -0.01442234218120575, 0.005544037092477083, -0.020961711183190346, 0.011117750778794289, -0.0004503857926465571, -0.057750821113586426, 0.08930107206106186, -0.00899885781109333, 0.014000587165355682, -0.030503347516059875, -0.05384408310055733, -0.007955828681588173, 0.04566353186964989, -0.025820275768637657, 0.06913785636425018, -0.06251300126314163, -0.008429691195487976, 0.1002802699804306, 0.0043692560866475105, -0.009959484450519085, -0.026534881442785263, -0.009020253084599972, 0.016230275854468346, -0.06260260194540024, -0.000037879748560953885, -0.000569630996324122, 0.013458282686769962, -0.08948322385549545, 0.03182891011238098, -0.060493580996990204, 0.020768506452441216, -0.12710018455982208, 0.04511522874236107, -0.012194477953016758, 0.00022868470114190131, -0.04363599419593811, -0.0023176514077931643, 0.015485633164644241, -0.00787260290235281, 0.02977290190756321, 0.1287773698568344, 0.04096576198935509, 0.0187354926019907, -0.07659735530614853, -0.024806426838040352, 0.01975368708372116, 0.115386962890625, 0.06056628376245499, 0.07788381725549698, -0.07362304627895355, -0.009526785463094711, -0.029768548905849457, -0.02395254373550415, -0.02775627188384533, -0.07456611096858978, -0.0343463271856308, 0.04882875084877014, 0.02402011677622795, 0.061910904943943024, 0.025353122502565384, 0.009310916997492313, -0.018429378047585487, -0.03314613178372383, -0.023719195276498795, 0.03822086378931999, -0.035601288080215454, 0.04792635142803192, -0.04627592861652374, -0.007584543898701668, 0.03553887829184532, -0.021960727870464325, 0.03557617589831352, 0.012566059827804565, 0.0008385967812500894, -0.010340405628085136, 0.05968334525823593, -0.012533013708889484, -0.0049021318554878235, -0.014628066681325436, 0.07051018625497818, -0.0051993075758218765, -0.023464087396860123, -0.054317351430654526, -0.023173319175839424, -0.03712927922606468, -0.02740566059947014, 0.012562720105051994, 0.01758410967886448, 0.053505007177591324, -0.0009541233885101974, 0.01298975944519043, -0.0036661934573203325, 0.04991825670003891, 0.04256105795502663, 0.005453807767480612, 0.03877321258187294, 0.023237064480781555, -0.07153288275003433, -0.01383363176137209, -0.022900491952896118, -0.003992339596152306, -0.0036906867753714323, 0.06240091100335121, 0.042895298451185226, 0.005783914588391781, 0.03079211711883545, -0.007016203366219997, -0.055793654173612595, -0.003598166164010763, 0.018520668148994446, 0.02592531032860279, 0.04962262883782387, 0.022249490022659302, -0.008209970779716969, 0.008328232914209366, 0.008759168907999992, -0.01655782014131546, 0.021982405334711075, -0.029134470969438553, 0.06493843346834183, -0.00639518303796649, 0.028436020016670227, 0.003027624450623989, 0.004883602261543274, 0.0076412116177380085, 0.013556677848100662, 0.012295601889491081, -0.003304530633613467, -0.07617513835430145, 0.01104659866541624, -0.0370931476354599, -0.02864733338356018, -0.008632282726466656, -0.05875006318092346, 0.06362643837928772, 0.028385989367961884, 0.03451596945524216, 0.030422350391745567, 0.03801378235220909, 0.027314353734254837, 0.0008856748463585973, 0.03535662591457367, 0.0446147546172142, 0.03917320445179939, -0.05565003678202629, -0.0025859754532575607, 0.06354514509439468, 0.0376415029168129, -0.029553992673754692, 0.0015193666331470013, 0.024936435744166374, 0.02924691140651703, -0.04782167449593544, -0.028017107397317886, 0.04758486524224281, -0.004220680799335241, 0.0016235595103353262, -0.01745646446943283, 0.003606918966397643, -0.008784581907093525, 0.016804754734039307, -0.0370902344584465, -0.00921723898500204, 0.027071315795183182, 0.015070107765495777, -0.0047960118390619755, 0.02662707306444645, 0.026686251163482666, -0.007608071900904179, 0.00751484464854002, 0.03307085484266281, -0.014648489654064178, 0.05860225483775139, -0.03467106074094772, -0.02794067934155464, -0.022142773494124413, 0.009329890832304955, -0.04796756058931351, 0.004199039191007614, -0.013703075237572193, -0.015349683351814747, 0.05639414116740227, 0.011465511284768581, 0.06190053001046181, 0.034835733473300934, -0.04483550414443016, -0.03327910602092743, -0.0025336346589028835, -0.03641892969608307, 0.046302784234285355, -0.06531024724245071, -0.02046164683997631, 0.007822328247129917, 0.007498234044760466, -0.019194915890693665, 0.03633369877934456, -0.018710829317569733, 0.04036819934844971, -0.005067822523415089, -0.003995673730969429, -0.004420808050781488, 0.0030748911667615175, -0.002780565759167075, -0.01999145746231079, 0.010422291234135628, -0.03416529670357704, 0.01880071312189102, 0.05922551825642586, -0.01496155746281147, -0.017107240855693817, 0.00496278190985322, -0.024162478744983673, 0.005068428348749876, -0.007521051447838545, -0.01890128292143345, -0.05639100819826126, -0.006344796624034643, -0.016694864258170128, -0.002118710894137621, -0.020733298733830452, 0.011240094900131226, -0.06391654163599014, -0.03125908225774765, 0.011046654544770718, 0.03750872239470482, 0.00003614794331951998, 0.003853430273011327, -0.03171578422188759, -0.02018403820693493, -0.019557327032089233, 0.018796974793076515, 0.0065177734941244125, 0.0026242812164127827, 0.01651807315647602, -0.06073329597711563, -0.05580214411020279, 0.014055401086807251, -0.04362519085407257, -0.017177008092403412, -0.032665614038705826, 0.03283631429076195, -0.03509247303009033, 0.054681554436683655, 0.0352594256401062, 0.006088642403483391, -0.011359764263033867, -0.00006468701030826196, 0.04689940810203552, -0.020458057522773743, 0.002267832402139902, -0.049951303750276566, -0.02926383726298809, 0.004021305590867996, 0.00691971555352211, -0.021061714738607407, -0.005997254978865385, 0.0033350514713674784, -0.032499898225069046, -0.013341085985302925, -0.04095432907342911, 0.029088858515024185, 0.03514418751001358, 0.015962980687618256, -0.012523275800049305, -0.011212597601115704, -0.013388259336352348, -0.03279059752821922, -0.0003763567074202001, -0.0003287894942332059, -0.008275551721453667, 0.024771418422460556, -0.0024027887266129255, 0.0037274884525686502, 0.0020112814381718636, -0.0345514714717865, 0.04476847127079964, -0.02162828855216503, -0.0597618967294693, -0.013027113862335682, 0.0463804192841053, -0.009234815835952759, 0.016139790415763855, 0.06287402659654617, -0.014135323464870453, -0.006217631045728922, 0.00010783783363876864, 0.02083776704967022, -0.015091801062226295, -0.030096059665083885, 0.014834576286375523, -0.04217175766825676, -0.02487422525882721, -0.017936166375875473, 0.006571774836629629, 0.031759846955537796, -0.024829039350152016, -0.006419958081096411, 0.019198091700673103, -0.03381270542740822, 0.04820866137742996, 0.021005185320973396, -0.0222205501049757, -0.010073518380522728, 0.054959215223789215, 0.039860162883996964, 0.025276362895965576, -0.008059225976467133, 0.03701213002204895, -0.0371125303208828, -0.019180819392204285, 0.013796056620776653, 0.03102099895477295, 0.01319609023630619, 0.044281963258981705, -0.007141390815377235, 0.08145473897457123, 0.004958809819072485, -0.00046384791494347155, -0.00368023500777781, -0.030979592353105545, -0.0037202865350991488, -0.026966776698827744, -0.010644734837114811, -0.017882300540804863, 0.011476176790893078, -0.014527731575071812, 0.0028538478072732687, 0.002508837264031172, -0.0063032349571585655, 0.06601740419864655, -0.021840326488018036, -0.01582699827849865, 0.018658028915524483, -0.005342339631170034, -0.01797804981470108, 0.020597800612449646, -0.019041890278458595, -0.0592985637485981, 0.005860286299139261, -0.06761858612298965, 0.031577397137880325, 0.015224133618175983, 0.01254765223711729, -0.00708831287920475, -0.017686141654849052, -0.012747830711305141, 0.036086197942495346, 0.03767772018909454, -0.03363698348402977, 0.009226231835782528, -0.001799643156118691, -0.0006876866100355983, 0.026501711457967758, -0.05060046166181564, -0.027779385447502136, 0.0005653168773278594, 0.02842017635703087, 0.042656492441892624, 0.026833567768335342, 0.013064836151897907, 0.020563669502735138, 0.04499922692775726, -0.03001968376338482, 0.024947362020611763, -0.03177398443222046, 0.01934881880879402, 0.04381855949759483, -0.020842311903834343, -0.033247631043195724, 0.05103113502264023, -0.027522576972842216, 0.010333348996937275, -0.03424285352230072, 0.053782571107149124, 0.06294459104537964, -0.001317684887908399, 0.004344400018453598, -0.008503942750394344, -0.02452194318175316, 0.025782138109207153, 0.007452515419572592, 0.023466113954782486, 0.03248815983533859, 0.011523125693202019, 0.011247949674725533, 0.012271562591195107, 0.024104353040456772, 0.023743920028209686, 0.02835751697421074, -0.02207999862730503, 0.07144130766391754, 0.05042345076799393, -0.0513494573533535, 0.006550231017172337, 0.010227673687040806, -0.026246894150972366, 0.02423262596130371, 0.01186076458543539, 0.006012053228914738, 0.021385755389928818, 0.006187650840729475, -0.036678049713373184, -0.041486598551273346, 0.028640087693929672, -0.042487114667892456, 0.04314659908413887, -0.03649976849555969, 0.013384009711444378, 0.027207480743527412, 0.056312114000320435, 0.07165007293224335, 0.018114818260073662, 0.0033898779656738043, -0.01103903166949749, 0.05514337867498398, 0.035207830369472504, 0.012661200948059559, 0.012487462721765041, -0.0024219586048275232, -0.002349984599277377, -0.041986942291259766, 0.02214502915740013, 0.00461069168522954, 0.00729338126257062, 0.03167855367064476, -0.009286362677812576, -0.024098442867398262, -0.025828201323747635, 0.04658111184835434, 0.053690843284130096, 0.038856569677591324, -0.01810268871486187, 0.039431825280189514, 0.03440554440021515, 0.011800833977758884, -0.021029092371463776, -0.005622423719614744, 0.008942701853811741, -0.012192751280963421, 0.032747965306043625, 0.047177061438560486, 0.036954160779714584, 0.02698333002626896, 0.028502468019723892, 0.02248900942504406, -0.028720639646053314, 0.018172243610024452, 0.03376340866088867, -0.014539532363414764, -0.006970365531742573, -0.03640763834118843, 0.043245378881692886, -0.031329333782196045, 0.00716979056596756, -0.0033673462457954884, 0.015734443441033363, -0.033441707491874695, 0.006700744386762381, 0.0190326739102602, 0.03593596816062927, -0.015250295400619507, 0.002352483570575714, -0.02234773337841034, -0.029373958706855774, 0.0021216347813606262, 0.027663687244057655, 0.03854402154684067, -0.05001483112573624, -0.04300788789987564, -0.041463736444711685, 0.03230908513069153, 0.061250947415828705, -0.021717935800552368, -0.014323721639811993, -0.008569727651774883, 0.00262037618085742, 0.04620231315493584, 0.02610170654952526, -0.010581710375845432, 0.0313555933535099, -0.038951579481363297, 0.03860730677843094, -0.03741908818483353, -0.03352208808064461, -0.006296034902334213, -0.014988983049988747, 0.017373066395521164, -0.024134766310453415, 0.006930618546903133, 0.04853540658950806, 0.013043324463069439, -0.040027011185884476, -0.028423048555850983, 0.005495285149663687, 0.005520232953131199, -0.02195761911571026, 0.03192416951060295, -0.025127559900283813, -0.020096028223633766, 0.05082818493247032, -0.04353376105427742, 0.020984193310141563, 0.001137402607128024, 0.017217187210917473, 0.046475477516651154, -0.026303797960281372, -0.010677991434931755, -0.003609960898756981, 0.03990161791443825, 0.028653670102357864, -0.00853578932583332, 0.012858525849878788, 0.008230376988649368, 0.05887022987008095, -0.0057473741471767426, 0.07474634796380997, -0.018626989796757698, 0.011248449794948101, -0.009696276858448982, -0.030807966366410255, -0.03906092420220375, -0.0211105365306139, -0.015981614589691162, 0.0052431495860219, -0.027599597349762917, 0.022975964471697807, 0.028561780229210854, -0.00930425338447094, -0.04753484949469566, -0.005467523820698261, 0.0660150870680809, 0.04772346094250679, 0.017418112605810165, 0.028989121317863464, -0.03645716980099678, 0.019621148705482483, -0.034667517989873886, 0.010482200421392918, 0.023448612540960312, -0.02845647931098938, -0.018098898231983185, -0.02960612066090107, 0.02582048997282982, 0.025090036913752556, -0.044863730669021606, 0.05053578317165375, -0.004255776759237051, 0.047607794404029846, -0.02616420015692711, -0.023900317028164864, 0.028207682073116302, -0.01635880209505558, 0.009943883866071701, -0.0488089881837368, -0.018730679526925087, 0.017671873793005943, 0.0020862093660980463, -0.05627957731485367, 0.02809063158929348, -0.03316708281636238, -0.003078919369727373, -0.005229419097304344, -0.019622286781668663, 0.005493021570146084, -0.02080000936985016, 0.01660085655748844, -0.0030351036693900824, -0.008528572507202625, -0.0334426648914814, -0.011129576712846756, -0.008151170797646046, 0.025433320552110672, 0.0035855805035680532, -0.008122870698571205, 0.0478716604411602, 0.009560808539390564, -0.05920828506350517, -0.04166043549776077, -0.0037055935245007277, -0.009472261182963848, 0.0043107266537845135, -0.018080363050103188, -0.019312381744384766, 0.03969797119498253, 0.006638455670326948, -0.014761125668883324, -0.051731571555137634, -0.01381764654070139 ]
Personal Copilot: Train Your Own Coding Assistant
smangrul
October 27, 2023
personal-copilot
bigcode, llm, nlp, inference, guide
https://huggingface.co/blog/personal-copilot
Data Collection Workflow Our desired dataset is conceptually simple, we structured it like so: | | | | |---|---|---| | Repository Name | Filepath in the Repository | File Contents | |---|---|---| |---|---|---| Scraping code contents from GitHub is straightforward with the Python GitHub API. However, depending on the number of repositories and the number of code files within a repository, one might easily run into API rate-limiting issues. To prevent such problems, we decided to clone all the public repositories locally and extract the contents from them instead of through the API. We used the multiprocessing module from Python to download all repos in parallel, as shown in this download script. A repository can often contain non-code files such as images, presentations and other assets. Weโ€™re not interested in scraping them. We created a list of extensions to filter them out. To parse code files other than Jupyter Notebooks, we simply used the "utf-8" encoding. For notebooks, we only considered the code cells. We also excluded all file paths that were not directly related to code. These include: .git, __pycache__, and xcodeproj. To keep the serialization of this content relatively memory-friendly, we used chunking and the feather format. Refer to this script for the full implementation. The final dataset is available on the Hub, and it looks like this: For this blog, we considered the top 10 Hugging Face public repositories, based on stargazers. They are the following: > ['transformers', 'pytorch-image-models', 'datasets', 'diffusers', 'peft', 'tokenizers', 'accelerate', 'text-generation-inference', 'chat-ui', 'deep-rl-class'] This is the code we used to generate this dataset, and this is the dataset in the Hub. Here is a snapshot of what it looks like: To reduce the project complexity, we didnโ€™t consider deduplication of the dataset. If you are interested in applying deduplication techniques for a production application, this blog post is an excellent resource about the topic in the context of code LLMs.
[ 0.023337915539741516, -0.005640815477818251, -0.02873912639915943, 0.05295456945896149, 0.04772425442934036, 0.03951173275709152, 0.0030060780700296164, 0.02767985872924328, 0.011159257963299751, -0.04587053507566452, -0.08793222904205322, 0.07526479661464691, -0.014986315742135048, 0.04536643251776695, 0.037048712372779846, -0.03125927597284317, 0.05447132885456085, 0.0066243745386600494, 0.03101641871035099, 0.03921302407979965, 0.023956255987286568, -0.06462360918521881, 0.015433135442435741, -0.0018634047592058778, -0.05562717467546463, -0.06277378648519516, 0.0029327943921089172, 0.010390523821115494, -0.038105275481939316, 0.038696929812431335, -0.14699536561965942, 0.04313616454601288, 0.030619926750659943, -0.040360432118177414, -0.003987873904407024, 0.01078125275671482, -0.12189927697181702, 0.039463117718696594, 0.10613346099853516, -0.06910056620836258, -0.007195443846285343, -0.05598626658320427, -0.08007438480854034, 0.046187978237867355, 0.01626170426607132, 0.004109288100153208, -0.17541249096393585, 0.09532424807548523, -0.04459517449140549, 0.015769537538290024, -0.08650662004947662, 0.06734316796064377, -0.010760362260043621, -0.024774368852376938, -0.018917089328169823, 0.009344199672341347, 0.0076494477689266205, -0.07908559590578079, 0.0021556001156568527, 0.07050583511590958, 0.015984175726771355, -0.014031858183443546, 0.027187880128622055, 0.05444225296378136, 0.02383248880505562, 0.004531713668256998, 0.006049046758562326, 0.0827249214053154, -0.05475929379463196, -0.02374545857310295, 0.043864019215106964, -0.007378766778856516, -0.02252635546028614, -0.016255954280495644, -0.03758891671895981, -0.051333412528038025, -0.023810720071196556, 0.04736325889825821, 0.05527503043413162, 0.014722534455358982, -0.00922888983041048, 0.06836692988872528, 0.028995245695114136, 0.04107685387134552, 0.0937875360250473, 0.02575824409723282, -0.004053275100886822, 0.00181295454967767, -0.06334751099348068, 0.04884013533592224, 0.009987663477659225, -0.09018303453922272, 0.0084486473351717, 0.031711313873529434, 0.03804844990372658, -0.03062482737004757, 0.020641328766942024, -0.0006887170602567494, 0.0008286318625323474, 0.011228381656110287, -0.0385635681450367, -0.001073288731276989, -0.028447506949305534, -0.08775880187749863, -0.04901216924190521, 0.03877105191349983, -0.05970175191760063, -0.04348457232117653, -0.024092230945825577, -0.02642294391989708, 0.04184887558221817, 0.024384133517742157, -0.05168762430548668, 0.11299111694097519, -0.05937838926911354, 0.03166421130299568, -0.023011688143014908, -0.046894725412130356, -0.05959223583340645, 0.01197697315365076, -0.003398821223527193, 0.06855711340904236, 0.02073061466217041, 0.015054288320243359, 0.029218578711152077, 0.061453208327293396, -0.018802471458911896, 0.03714710474014282, -0.013124099001288414, -0.05273093283176422, 0.009755181148648262, 0.010643967427313328, 0.05373423174023628, -0.0368514209985733, 0.006694050971418619, -0.003175838850438595, -0.018733765929937363, -0.0024604075588285923, 0.059187401086091995, 0.022233109921216965, -0.006892571225762367, 0.058641087263822556, -0.028339678421616554, 0.07389367371797562, -0.026451408863067627, 0.0075742341578006744, -0.08585520088672638, 0.0004842169291805476, 0.006245987024158239, -0.012787924148142338, -0.0748680979013443, 0.06723295897245407, -0.03090699203312397, -0.02890249341726303, -0.030288511887192726, 0.013147056102752686, 0.021153192967176437, -0.030889511108398438, -0.05939609184861183, 0.030781498178839684, -0.016176607459783554, 0.06071081757545471, -0.040465522557497025, -0.0004536916094366461, -0.03452322259545326, 0.010267224162817001, 0.011082983575761318, -0.03696393966674805, -0.018132545053958893, 0.002155935624614358, -0.0695410668849945, -0.014162363484501839, 0.029284080490469933, -0.004057165700942278, 0.05755724757909775, -0.011335187591612339, 0.07742083072662354, -0.01962392032146454, -0.016823042184114456, -0.008218142203986645, -0.013830650597810745, 0.004732280503958464, -0.01566319540143013, 0.03607090190052986, 0.051752153784036636, -0.07305248081684113, 0.06113014742732048, -0.008675480261445045, -0.019027331843972206, 0.002328211907297373, -0.053087830543518066, -0.07184301316738129, 0.0867009162902832, -0.004071394447237253, 0.014421898871660233, -0.06203722581267357, 0.03587723523378372, 0.09985220432281494, 0.05082792788743973, 0.05927788466215134, -0.01263978611677885, -0.008864734321832657, 0.012248480692505836, -0.06679260730743408, 0.0019015721045434475, -0.019135698676109314, -0.00417752843350172, -0.042187176644802094, 0.07758251577615738, -0.0496952086687088, -0.03285521641373634, -0.060712043195962906, 0.07726717740297318, -0.06657511740922928, -0.02531084232032299, 0.015257781371474266, -0.05193651467561722, 0.050575703382492065, 0.024936921894550323, -0.02838943526148796, 0.17307350039482117, -0.047104064375162125, 0.05088144540786743, 0.07149872928857803, -0.02575402520596981, 0.031105242669582367, 0.05618496984243393, 0.05472156032919884, 0.1098639965057373, -0.047988638281822205, -0.04605162516236305, -0.03121122159063816, -0.02712888829410076, 0.025472674518823624, -0.005189815536141396, -0.07099880278110504, -0.019888781011104584, 0.011521430686116219, 0.010205554775893688, 0.0041623725555837154, 0.04436400532722473, -0.020901096984744072, 0.04781019687652588, 0.008207028731703758, 0.04189639165997505, -0.07077603042125702, 0.06086341291666031, 0.021265700459480286, -0.01903335005044937, -0.04675467684864998, 0.0071837762370705605, 0.005853772629052401, -0.047363560646772385, 0.02109208144247532, 0.035068660974502563, 0.010313918814063072, 0.0034530023112893105, -0.044526200741529465, -0.03466716781258583, 0.06102127954363823, 0.0000670023582642898, -0.030571959912776947, -0.03943055495619774, -0.05264916643500328, -0.0012563173659145832, -0.01827823556959629, 0.019486945122480392, -0.005952439270913601, 0.031616173684597015, -0.008065520785748959, -0.0019549401476979256, 0.023284168913960457, -0.006661274004727602, 0.028022030368447304, 0.015948761254549026, 0.04925461858510971, 0.004541030619293451, -0.02335391379892826, -0.023781754076480865, -0.019641801714897156, 0.01627706177532673, -0.05974225327372551, 0.0033828900195658207, 0.027295587584376335, 0.06217777729034424, 0.0076900022104382515, 0.05727268382906914, 0.001959070563316345, -0.02779632806777954, 0.046475037932395935, 0.013933728449046612, 0.013062327168881893, 0.002612906042486429, -0.024370690807700157, 0.00912498403340578, -0.009680770337581635, -0.019148072227835655, 0.008265350945293903, -0.03118116781115532, 0.027593035250902176, -0.07205524295568466, -0.014323578216135502, -0.009373512119054794, -0.00892603024840355, -0.03760172054171562, 0.051395729184150696, 0.027291543781757355, 0.005746650509536266, -0.10736062377691269, -0.005089697428047657, -0.007453322410583496, -0.014155878685414791, 0.007566525135189295, -0.01706821098923683, 0.019328786060214043, 0.00428263982757926, -0.020489394664764404, 0.010267039760947227, -0.03208962827920914, -0.005010895896703005, 0.04049549624323845, 0.006130747031420469, 0.015680229291319847, -0.0034351246431469917, -0.03355776518583298, 0.04263005033135414, 0.03800983354449272, 0.036538444459438324, -0.05549807846546173, 0.018753575161099434, -0.011431090533733368, -0.0011633650865405798, -0.02519046701490879, 0.008830994367599487, 0.060924965888261795, 0.017018916085362434, 0.024275029078125954, -0.01763753965497017, -0.00927281379699707, -0.019361523911356926, -0.007177757099270821, 0.00407440448179841, -0.036157965660095215, 0.0014173963572829962, 0.030437292531132698, 0.01042132917791605, 0.01593930833041668, 0.05722316727042198, 0.02568073756992817, 0.000490102858748287, 0.03565772995352745, -0.017911117523908615, 0.05079211667180061, 0.0003189841518178582, -0.020523615181446075, -0.0017856378108263016, 0.026318389922380447, -0.047884710133075714, -0.012267889454960823, 0.00003346411540405825, -0.0013077682815492153, 0.05681883543729782, 0.009572918526828289, 0.015545876696705818, 0.0027101095765829086, 0.028655171394348145, 0.02942575514316559, -0.0009761587716639042, -0.02271237038075924, 0.031240219250321388, 0.007288489490747452, -0.040660466998815536, -0.008550968952476978, 0.011352869682013988, -0.0044621252454817295, -0.012356373481452465, -0.025063015520572662, 0.035876110196113586, 0.00010901844507316127, 0.014528515748679638, 0.018952971324324608, 0.0017834919271990657, -0.061747580766677856, 0.018739474937319756, -0.014198390766978264, -0.0031626997515559196, 0.066463902592659, 0.03800147399306297, -0.01849127933382988, -0.026149125769734383, -0.01111774891614914, -0.007329968269914389, 0.026948226615786552, -0.002269162330776453, 0.0025199889205396175, -0.07867083698511124, 0.02758212201297283, 0.01509101316332817, -0.04312591627240181, -0.036905646324157715, -0.0007067467668093741, -0.013407285325229168, -0.004870481789112091, -0.000970228691585362, 0.02842123992741108, 0.014171220362186432, -0.012787952087819576, 0.031297359615564346, 0.016860798001289368, -0.031847771257162094, -0.022395240142941475, 0.015059670433402061, 0.027598528191447258, -0.0005252539413049817, -0.042571816593408585, -0.020210590213537216, 0.012599983252584934, 0.021204395219683647, 0.04008341580629349, -0.005386624485254288, -0.01826588250696659, -0.025483956560492516, 0.002188611775636673, 0.03889717534184456, 0.01810123771429062, -0.03129246085882187, -0.018418682739138603, 0.03260406479239464, -0.04354694485664368, -0.017759714275598526, -0.012285946868360043, -0.004705667961388826, -0.00016114315076265484, 0.007610540837049484, 0.03813591226935387, -0.0037986282259225845, -0.005332905799150467, -0.0166343841701746, -0.0000912490431801416, -0.033749110996723175, -0.03241899237036705, -0.00819181464612484, 0.021108154207468033, 0.005648658145219088, 0.011468683369457722, -0.029245877638459206, -0.033750925213098526, -0.049534980207681656, -0.04471006616950035, 0.012244009412825108, 0.010728003457188606, 0.006044619716703892, -0.007336804643273354, 0.026425303891301155, -0.031168367713689804, -0.044922586530447006, -0.02929977886378765, -0.05357983335852623, -0.0219472236931324, 0.012890144251286983, -0.018351364880800247, 0.04569009691476822, 0.03787917271256447, 0.0027105442713946104, -0.017020326107740402, 0.02873426117002964, 0.006435784511268139, 0.04072709009051323, -0.021286243572831154, -0.024559466168284416, -0.00394059345126152, 0.01694207824766636, -0.00811633188277483, -0.008327094838023186, 0.0037892775144428015, -0.02302088961005211, 0.0026182716246694326, 0.008784577250480652, -0.028826793655753136, 0.029329635202884674, 0.016440771520137787, -0.02499946765601635, 0.011187175288796425, 0.06843079626560211, 0.06251611560583115, 0.05049951747059822, -0.0003686341515276581, -0.005539138801395893, -0.05665755644440651, -0.018423359841108322, 0.0373392216861248, 0.006763209588825703, 0.009202944114804268, 0.0011697437148541212, 0.050819676369428635, 0.05802638456225395, -0.018251629546284676, 0.044129904359579086, -0.06625150144100189, -0.03224523738026619, 0.0021838212851434946, -0.0412171334028244, 0.01924033649265766, -0.01942269690334797, -0.007514391094446182, -0.015486393123865128, 0.012868068180978298, -0.02713366597890854, 0.010457823053002357, 0.06528135389089584, -0.008310273289680481, -0.008468728512525558, 0.01732626184821129, 0.010190324857831001, 0.009470164775848389, -0.014070234261453152, 0.012213330715894699, -0.016079530119895935, 0.017106186598539352, -0.04067755863070488, -0.048546213656663895, -0.012315504252910614, -0.012883619405329227, -0.0575784370303154, -0.0058342707343399525, -0.009449017234146595, -0.029322516173124313, 0.05520855635404587, -0.023405952379107475, -0.0016186939319595695, 0.020507628098130226, 0.05396878719329834, 0.037954069674015045, -0.06435822695493698, -0.0003456938429735601, 0.014449318870902061, 0.008604343049228191, 0.005085578188300133, 0.024859918281435966, 0.009265003725886345, 0.011818437837064266, 0.024582019075751305, -0.0033139698207378387, -0.01178702712059021, 0.0026158697437494993, 0.03220363333821297, 0.024153312668204308, -0.0031729412730783224, -0.022286459803581238, -0.057869911193847656, -0.03583343327045441, -0.013638824224472046, -0.04613683372735977, 0.026831338182091713, 0.03472178801894188, 0.03258233889937401, 0.03982056304812431, 0.01323282066732645, 0.02019243687391281, 0.007849795743823051, -0.0018065592739731073, -0.025198448449373245, -0.007502174470573664, 0.02966410480439663, 0.045581310987472534, -0.0241453368216753, 0.03272069990634918, -0.01642150990664959, -0.002410454675555229, -0.06944651156663895, 0.016663650050759315, 0.025860650464892387, -0.03482623025774956, 0.003255944699048996, -0.005080720409750938, -0.03276247903704643, -0.015406278893351555, -0.0205540731549263, 0.051041968166828156, 0.042115844786167145, 0.003090588841587305, -0.01493766251951456, -0.023670202121138573, -0.04276265576481819, -0.009051038883626461, 0.07092403620481491, -0.018268946558237076, 0.06206495314836502, 0.009906234219670296, 0.029028117656707764, 0.04546351358294487, 0.027146052569150925, 0.014351236633956432, 0.01777668111026287, 0.029197311028838158, 0.006555038038641214, 0.048441868275403976, 0.018491661176085472, -0.016959112137556076, 0.010622349567711353, -0.05726319178938866, 0.012637229636311531, -0.01259802095592022, 0.02249126508831978, 0.04784411936998367, -0.048640839755535126, 0.03433554992079735, -0.046470802277326584, 0.05103708803653717, 0.03467463329434395, 0.01529818307608366, 0.028602344915270805, -0.004645438864827156, 0.03290292248129845, -0.009576060809195042, 0.035710934549570084, 0.03115464188158512, 0.036157745867967606, -0.017056094482541084, 0.06866564601659775, 0.03605689853429794, 0.045809876173734665, 0.007478244602680206, -0.01712416671216488, -0.011656803078949451, -0.009889663197100163, -0.0007436947780661285, 0.041983988136053085, 0.005187916103750467, -0.03330380842089653, -0.05534214898943901, -0.0230563897639513, -0.02590813674032688, -0.0007538558566011488, -0.017363259568810463, -0.02055324986577034, -0.04182131588459015, -0.03581814467906952, -0.006227781530469656, 0.041755933314561844, -0.011173635721206665, -0.007950309664011002, 0.022316506132483482, 0.007912366650998592, 0.0006669648573733866, 0.018775248900055885, 0.0024911032523959875, -0.008055048063397408, -0.005511743947863579, 0.03232915699481964, 0.0090484032407403, 0.0138075090944767, -0.037070803344249725, -0.030317464843392372, 0.006748829502612352, -0.019505174830555916, -0.01613599993288517, 0.03393711894750595, 0.012694786302745342, 0.04639539495110512, -0.0266538318246603, 0.041710205376148224, -0.010904477909207344, -0.015033511444926262, 0.029904289171099663, 0.04896083474159241, 0.012388096190989017, -0.03056478314101696, 0.025388672947883606, 0.011604935862123966, -0.009101636707782745, 0.01363502349704504, -0.04146812483668327, -0.0043917554430663586, 0.00768260145559907, -0.027587134391069412, 0.043141841888427734, -0.030586877837777138, -0.00385125819593668, 0.04097643494606018, -0.018744518980383873, 0.025584664195775986, -0.004539902787655592, -0.03680886700749397, 0.05347108468413353, -0.021391039714217186, -0.01691860519349575, 0.02731238305568695, 0.034458111971616745, 0.04334654286503792, 0.032993245869874954, 0.007426001597195864, 0.013840748928487301, 0.029237978160381317, -0.026490554213523865, 0.03476732596755028, -0.030207239091396332, 0.016530435532331467, -0.05619879439473152, -0.04162993282079697, -0.025831885635852814, 0.008199485950171947, -0.02818966470658779, 0.007904569618403912, -0.03861212730407715, -0.016716448590159416, 0.020582497119903564, -0.004603231325745583, -0.018337862566113472, -0.027554547414183617, 0.007449204567819834, 0.01835818961262703, -0.03108794242143631, 0.042982034385204315, -0.047745831310749054, 0.001079142210073769, -0.006289740093052387, 0.025362612679600716, 0.031896624714136124, 0.04272258281707764, -0.010440942831337452, 0.0029538357630372047, 0.011616064235568047, -0.02381870709359646, -0.021659767255187035, -0.0058100176975131035, 0.026023870334029198, -0.0064818901009857655, -0.00011595130490604788, 0.015647416934370995, 0.07343294471502304, 0.013691423460841179, 0.023416470736265182, -0.031934209167957306, -0.008891282603144646, 0.06227921321988106, 0.005523290950804949, -0.051773667335510254, -0.020126668736338615, -0.012281710281968117, -0.003995010629296303, 0.021415410563349724, -0.0042176200076937675, 0.023957861587405205, 0.005276121664792299, -0.0001696617982815951, -0.005228080321103334, -0.0036092756781727076, -0.049580737948417664, -0.039126843214035034, -0.009933668188750744, 0.02922268956899643, -0.040924157947301865, -0.04174603521823883, 0.06298375874757767, 0.005316740833222866, -0.0335625559091568, 0.0177293848246336, -0.018068166449666023, 0.016761936247348785, -0.018284590914845467, 0.05905339866876602, -0.02596757933497429, 0.02741018310189247, 0.0015691184671595693, 0.004859627224504948, -0.014272816479206085, -0.020908040925860405 ]
Personal Copilot: Train Your Own Coding Assistant
smangrul
October 27, 2023
personal-copilot
bigcode, llm, nlp, inference, guide
https://huggingface.co/blog/personal-copilot
PEFT We will look at how to use QLoRA for fine-tuning bigcode/starcoder (15B params) on a single A100 40GB GPU using ๐Ÿค— PEFT. For more information on QLoRA and PEFT methods, please refer to Making LLMs even more accessible with bitsandbytes, 4-bit quantization and QLoRA and ๐Ÿค— PEFT: Parameter-Efficient Fine-Tuning of Billion-Scale Models on Low-Resource Hardware. Resources 1. Codebase: link. It uses the recently added Flash Attention V2 support in Transformers. 2. Colab notebook: link. Make sure to choose A100 GPU with High RAM setting. 3. Model: bigcode/stacoder 4. Dataset: smangrul/hf-stack-v1 5. QLoRA Fine-tuned Model: smangrul/peft-lora-starcoder15B-v2-personal-copilot-A100-40GB-colab The command to launch training is given at run_peft.sh. The total training time was 12.5 Hours. Taking the cost of $1.10 / hr based on lambdalabs, the total cost would be $13.75. That's pretty good ๐Ÿš€! In terms of cost, it's 7.8X lower than the cost for full fine-tuning.
[ 0.04602733999490738, 0.002803550334647298, -0.018177688121795654, 0.08115988224744797, 0.06951448321342468, 0.005971958860754967, -0.003123338334262371, 0.08254646509885788, 0.05603741481900215, 0.0044363318011164665, -0.013649766333401203, 0.02861197106540203, -0.0780612900853157, -0.04094396531581879, 0.043384257704019547, -0.036461688578128815, 0.04221029207110405, -0.047105904668569565, -0.01249874010682106, 0.008957852609455585, 0.031032292172312737, 0.02896597422659397, 0.051737990230321884, 0.06291332840919495, -0.0301339253783226, -0.0022179619409143925, 0.05928459018468857, 0.03622031211853027, -0.01781478337943554, 0.0693427100777626, -0.028819609433412552, 0.031098712235689163, -0.013011747039854527, -0.011280044913291931, 0.009001257829368114, -0.02208794467151165, -0.005308421794325113, 0.05783022567629814, -0.023072151467204094, -0.03151139244437218, -0.03969668224453926, -0.019610267132520676, -0.02481325902044773, 0.05664338544011116, 0.0013836730504408479, 0.02602515183389187, -0.04814284294843674, 0.049353454262018204, -0.021809764206409454, -0.037040092051029205, -0.024708598852157593, 0.011845594272017479, 0.07154149562120438, -0.04653394594788551, 0.1360054761171341, 0.033291056752204895, 0.009708931669592857, -0.008596684783697128, -0.06478913873434067, -0.012048165313899517, 0.06214543431997299, -0.04513617604970932, 0.023049937561154366, 0.02546495757997036, 0.040667008608579636, 0.02390742488205433, 0.008876617066562176, 0.02262013778090477, -0.025560472160577774, -0.08830529451370239, 0.058555420488119125, 0.018880704417824745, 0.03655123710632324, -0.0019769223872572184, -0.03899458795785904, -0.03621092811226845, -0.022754620760679245, 0.05534512922167778, 0.05438488721847534, 0.020876353606581688, 0.0004188837774563581, 0.011198525317013264, -0.00030315644107759, -0.017775576561689377, 0.023710908368229866, 0.003685439471155405, -0.013719209469854832, 0.0009465377661399543, -0.05840455740690231, -0.03150290250778198, -0.05394798517227173, -0.12433458864688873, -0.0444009006023407, 0.050972163677215576, 0.04070194438099861, 0.030844781547784805, -0.03454330191016197, -0.02467198483645916, 0.017272887751460075, -0.06522999703884125, -0.0253909919410944, -0.033820558339357376, -0.01505593117326498, -0.06320121884346008, -0.04463833570480347, 0.03511146828532219, 0.01942955143749714, -0.0632411539554596, -0.02818942815065384, 0.02480114996433258, -0.01807975023984909, 0.02557242475450039, -0.03073808178305626, 0.05394159257411957, -0.10491149872541428, 0.02525140345096588, 0.03166290000081062, -0.022155767306685448, -0.03172742575407028, 0.029308484867215157, -0.01793380081653595, 0.08035919070243835, 0.07652232050895691, -0.040057938545942307, -0.029758092015981674, 0.052116844803094864, -0.04908067360520363, -0.014998461119830608, -0.03178125619888306, 0.015045873820781708, 0.07583977282047272, -0.04866920784115791, -0.017721788957715034, -0.036307208240032196, 0.03329364210367203, -0.006840473506599665, -0.03479520604014397, -0.059427350759506226, -0.04432974383234978, 0.06400582194328308, -0.029758930206298828, 0.06224454939365387, 0.047878824174404144, -0.06473828107118607, 0.03204710781574249, 0.016185978427529335, 0.0037199959624558687, 0.045189399272203445, 0.0002796822227537632, 0.007721099071204662, -0.1117655485868454, 0.052031055092811584, 0.0039462316781282425, -0.014355599880218506, 0.06482253968715668, 0.07422726601362228, -0.03544231876730919, -0.04138188809156418, -0.07711615413427353, 0.04542660713195801, -0.01631435751914978, -0.023902853950858116, -0.07645280659198761, -0.006504444405436516, 0.007516892161220312, -0.01292735431343317, 0.017161639407277107, -0.0065682739950716496, 0.0027272680308669806, 0.016421141102910042, 0.07694823294878006, 0.026867788285017014, 0.07877890020608902, 0.043296780437231064, -0.06022118777036667, -0.012524177320301533, 0.03719712421298027, 0.04654759168624878, -0.037657853215932846, 0.00892359483987093, -0.047663021832704544, 0.046191781759262085, -0.0051081920973956585, 0.07506148517131805, -0.022364875301718712, -0.12862512469291687, 0.056731175631284714, -0.09818520396947861, -0.015828082337975502, -0.025066936388611794, -0.018595436587929726, 0.03774194046854973, 0.09866849333047867, -0.014989789575338364, 0.05174003168940544, -0.052002448588609695, 0.0030396534129977226, 0.04595005139708519, 0.10161809623241425, 0.026989219710230827, 0.008721470832824707, 0.09087955206632614, 0.04254510626196861, -0.023446515202522278, -0.04899457469582558, 0.03079075738787651, -0.03700987249612808, -0.002113011432811618, 0.044158563017845154, 0.007307075429707766, 0.026259738951921463, -0.06668844074010849, -0.03394164517521858, -0.03990740701556206, 0.11824679374694824, -0.0011463401606306434, 0.04040154442191124, 0.004696315620094538, 0.008474144153296947, 0.018012376502156258, 0.11573069542646408, -0.04938070476055145, -0.02891414985060692, -0.022091440856456757, -0.017266105860471725, -0.010674100369215012, 0.07083653658628464, -0.005202718079090118, -0.01989058405160904, -0.04149676486849785, -0.07055553048849106, -0.079867884516716, -0.07413358241319656, 0.08589385449886322, -0.025978559628129005, -0.0550214946269989, -0.09937197715044022, -0.025573354214429855, 0.07742081582546234, 0.00986283179372549, -0.00873965211212635, 0.04741024225950241, -0.01066996343433857, -0.011609640903770924, -0.02952650748193264, -0.03959448263049126, 0.0195155031979084, 0.021273275837302208, 0.02426057681441307, -0.007924150675535202, -0.0992966890335083, -0.020979275926947594, -0.03704598918557167, 0.008755216374993324, 0.00864807516336441, -0.019423717632889748, -0.055192481726408005, -0.026745250448584557, -0.03295011818408966, -0.016934795305132866, -0.02993243746459484, 0.04786359518766403, -0.007345692720264196, 0.0008230177918449044, -0.015377488918602467, -0.019808202981948853, -0.03151071071624756, 0.037388287484645844, -0.06860630959272385, -0.003131682053208351, -0.00033472548238933086, 0.002592302393168211, 0.002427157247439027, -0.031402770429849625, 0.01958499848842621, 0.02118483930826187, 0.04406929388642311, -0.03642861545085907, -0.04476400837302208, -0.03354228660464287, 0.03830653429031372, -0.029722999781370163, -0.009087784215807915, 0.01611429639160633, 0.017486413940787315, 0.021491294726729393, -0.048074252903461456, 0.010593562386929989, -0.022407060489058495, 0.010103153064846992, 0.022258389741182327, 0.006822671741247177, -0.013495865277945995, -0.01891990751028061, -0.013559936545789242, -0.056661900132894516, 0.030603783205151558, 0.0023480055388063192, -0.009486697614192963, -0.01008707843720913, -0.01767616905272007, -0.013756143860518932, -0.004548336379230022, -0.01571766659617424, 0.006911049596965313, 0.02122197300195694, 0.03393448144197464, 0.04474542662501335, -0.06368055194616318, 0.0037849980872124434, -0.03556949645280838, 0.07074759155511856, -0.01859750598669052, -0.013170597143471241, 0.04667866230010986, -0.03794312849640846, 0.007897451519966125, 0.008781896904110909, -0.01732685975730419, -0.005031357519328594, -0.0021866841707378626, -0.005591925233602524, 0.010686218738555908, -0.020303085446357727, 0.007607715204358101, -0.005090964958071709, 0.016930175945162773, -0.013061481527984142, -0.015702202916145325, 0.020775064826011658, -0.034345392137765884, 0.015782583504915237, -0.0018794368952512741, -0.003181718522682786, -0.05576808750629425, -0.030003907158970833, 0.03109593130648136, -0.008820869959890842, 0.019202908501029015, -0.02482152171432972, -0.023735525086522102, 0.049723029136657715, -0.036697883158922195, -0.0200872253626585, -0.014041534624993801, -0.03161889314651489, -0.01873929239809513, 0.0133231645449996, 0.05057276412844658, -0.01396643090993166, 0.053379226475954056, -0.017062528058886528, 0.04743136465549469, -0.0006756302900612354, -0.004435619339346886, 0.016590913757681847, 0.022812414914369583, -0.008614258840680122, -0.028275303542613983, 0.045632895082235336, 0.00282961199991405, 0.026328349485993385, -0.02621161751449108, 0.01228448748588562, -0.001559921307489276, 0.029706934466958046, 0.02983003854751587, 0.0003086440556216985, -0.06699258834123611, 0.03391370549798012, 0.01880887895822525, -0.021158574149012566, 0.012523138895630836, -0.016734080389142036, 0.01229159813374281, -0.03380875289440155, -0.057131536304950714, -0.005852104164659977, -0.02320171892642975, 0.028424648568034172, 0.007369834464043379, -0.012292921543121338, -0.0050871651619672775, -0.043574199080467224, -0.052919358015060425, -0.00984400138258934, 0.008247718214988708, 0.03183368593454361, 0.011127271689474583, -0.048988163471221924, -0.048285312950611115, -0.01705058291554451, -0.00047132966574281454, 0.016770249232649803, -0.009695052169263363, -0.10376832634210587, 0.010672669857740402, -0.014158281497657299, 0.03351667523384094, 0.009326383471488953, -0.0037834958638995886, -0.03137575462460518, 0.012936389073729515, -0.04324520379304886, 0.025405816733837128, -0.0077406009659171104, 0.008338499814271927, 0.022561129182577133, 0.03558220714330673, -0.01692233607172966, 0.031604643911123276, 0.03558966889977455, -0.044681254774332047, 0.01741812750697136, -0.04859600216150284, -0.01052900217473507, 0.0013774525141343474, 0.046464864164590836, 0.033540863543748856, -0.014223085716366768, 0.021555492654442787, -0.005677466746419668, 0.030161643400788307, 0.03175467252731323, -0.01022646389901638, -0.009319744072854519, -0.03124934434890747, 0.017165657132864, -0.03346848487854004, -0.0412762425839901, 0.003932944964617491, -0.0405140221118927, 0.0034561955835670233, 0.017178719863295555, 0.034639615565538406, 0.020434800535440445, 0.027934428304433823, -0.0012640979839488864, -0.043156832456588745, -0.04683760181069374, -0.036712925881147385, -0.022487761452794075, -0.014830585569143295, 0.010230991058051586, -0.04142117127776146, -0.032138340175151825, 0.038436807692050934, 0.006741872522979975, 0.019151870161294937, 0.002779203001409769, -0.0009400103008374572, -0.02786984294652939, 0.04735146090388298, 0.015768839046359062, -0.0040803831070661545, -0.008102808147668839, -0.012277819216251373, 0.008029570803046227, -0.008401737548410892, -0.047772765159606934, -0.04079616814851761, 0.023052550852298737, 0.0010509896092116833, -0.02403976209461689, 0.02476212941110134, -0.005868018139153719, -0.01683928444981575, 0.03117171861231327, 0.03421754017472267, 0.04992067813873291, -0.06666205078363419, 0.019589433446526527, 0.054842401295900345, 0.0282340906560421, 0.012369130738079548, -0.03721148893237114, -0.03170131891965866, -0.05565137043595314, -0.045633889734745026, -0.029549650847911835, 0.006537891924381256, 0.020563552156090736, 0.013143828138709068, 0.0020802177023142576, -0.008942103013396263, -0.04870184138417244, -0.007743896916508675, 0.017116829752922058, -0.04105420783162117, -0.020947450771927834, 0.03051460161805153, 0.027870498597621918, 0.020794838666915894, 0.02240222692489624, 0.046729136258363724, 0.009818026795983315, -0.01873013749718666, -0.013810449279844761, 0.011176923289895058, 0.014802995137870312, -0.01876811869442463, -0.008574369363486767, -0.0179413091391325, 0.025494031608104706, -0.016038864850997925, 0.05660301074385643, -0.030433233827352524, -0.004125104285776615, 0.01648630015552044, 0.0352577343583107, -0.040028881281614304, -0.0176862683147192, 0.03579384833574295, -0.002201983705163002, -0.015904393047094345, 0.032530900090932846, -0.0010726130567491055, -0.012651607394218445, -0.02338310144841671, -0.0047246734611690044, -0.025028422474861145, -0.03108496032655239, 0.022622620686888695, -0.03120199218392372, -0.02456757053732872, 0.09420111775398254, 0.0140135008841753, -0.02296145260334015, -0.06588777154684067, -0.024325884878635406, 0.007828354835510254, -0.03306790068745613, 0.018903614953160286, -0.055863119661808014, 0.060228366404771805, 0.03800501674413681, 0.0026165787130594254, 0.026209235191345215, 0.005347678903490305, 0.01873845048248768, -0.036952730268239975, 0.03489837795495987, 0.035156335681676865, 0.016686301678419113, -0.029195863753557205, -0.0007598985102958977, 0.02780068665742874, -0.003959877882152796, -0.025139786303043365, -0.014515629038214684, -0.03656647726893425, 0.01222499180585146, -0.063726507127285, 0.0682901069521904, 0.0276442039757967, -0.0028771786019206047, 0.019300807267427444, -0.03272306174039841, 0.01931839808821678, -0.030154259875416756, -0.009749253280460835, -0.0026378249749541283, 0.016321450471878052, 0.006980329751968384, 0.0447828471660614, 0.03346201404929161, 0.03551517426967621, 0.0043646530248224735, -0.0013356921263039112, -0.01917429454624653, 0.05966620147228241, 0.042303044348955154, 0.021990180015563965, 0.022579772397875786, 0.016868412494659424, -0.038162119686603546, 0.014939894899725914, -0.0349869467318058, 0.006386364810168743, -0.05572521314024925, -0.050069186836481094, -0.012807934544980526, 0.02591012418270111, -0.0006969071109779179, 0.015790089964866638, 0.017823006957769394, 0.0016529111890122294, 0.009054884314537048, 0.04992344230413437, 0.042211081832647324, 0.034459248185157776, -0.007115883287042379, 0.0169344712048769, -0.007311161607503891, 0.021227888762950897, 0.050280939787626266, 0.01014263741672039, 0.04164935275912285, -0.011455157771706581, -0.0023743752390146255, -0.05323107913136482, -0.020637160167098045, -0.0496131107211113, -0.0011497613741084933, 0.04611775651574135, -0.03684321418404579, 0.0014094195794314146, -0.056556619703769684, 0.04435177519917488, 0.006124849431216717, 0.0046720015816390514, -0.015406545251607895, 0.023508375510573387, -0.016133267432451248, 0.0036564343608915806, 0.0005833620671182871, 0.013567577116191387, 0.03049790859222412, 0.0007206287118606269, 0.007505666930228472, 0.029153019189834595, 0.04962743818759918, 0.015619508922100067, -0.03253043070435524, 0.01021726056933403, -0.010101605206727982, -0.005522768013179302, 0.02509055845439434, -0.0012348848395049572, 0.028544055297970772, 0.0034586500842124224, 0.014931405894458294, -0.02095857635140419, 0.012870618142187595, 0.041095439344644547, -0.02913869358599186, -0.024625100195407867, -0.0011645418126136065, 0.009636719711124897, -0.004263174254447222, 0.016507811844348907, -0.04296230897307396, -0.009799269028007984, 0.0004376358992885798, -0.003713199170306325, 0.055702414363622665, -0.025319740176200867, 0.025244630873203278, -0.024672556668519974, 0.000495846092235297, -0.00861102994531393, 0.07575574517250061, 0.02004065178334713, 0.005843870807439089, 0.04141666367650032, -0.023120902478694916, -0.023782609030604362, -0.007406692951917648, 0.006197531707584858, -0.035483378916978836, -0.05078642815351486, 0.031941600143909454, 0.023595042526721954, -0.08104479312896729, 0.07600896060466766, -0.05332190915942192, 0.03730006515979767, 0.02150139957666397, 0.018176082521677017, 0.025092963129281998, 0.041913747787475586, 0.00791601836681366, -0.011084260419011116, 0.028872741386294365, 0.031567033380270004, -0.05587982013821602, 0.07081020623445511, -0.027073059231042862, 0.039997030049562454, 0.003091005142778158, -0.02130216360092163, 0.0422917939722538, -0.0464744046330452, -0.004744468256831169, 0.018881404772400856, 0.025514528155326843, -0.0017500417307019234, 0.006533780135214329, 0.023425113409757614, -0.02126050554215908, 0.01463660690933466, 0.03811977058649063, 0.024396587163209915, 0.009721669368445873, 0.02027219720184803, -0.00269601633772254, -0.028358755633234978, -0.0190594382584095, -0.033865027129650116, -0.014072753489017487, -0.04426624998450279, 0.06080040708184242, -0.018088674172759056, 0.012150800786912441, -0.00952818151563406, -0.07306809723377228, -0.031761348247528076, -0.0014618895947933197, -0.004895823076367378, -0.01043962687253952, 0.03973282501101494, 0.02864054962992668, 0.042904116213321686, -0.0519561842083931, -0.03519347682595253, 0.0001720019499771297, -0.027814161032438278, 0.004427400417625904, 0.05498812347650528, 0.048960331827402115, -0.0421689935028553, -0.039729658514261246, 0.007867575623095036, 0.06386454403400421, -0.005001411773264408, -0.0218519140034914, 0.016943946480751038, 0.022100817412137985, -0.006674792151898146, 0.012347601354122162, 0.03649085760116577, 0.04550968483090401, 0.0293013546615839, 0.027701595798134804, 0.005619722884148359, 0.050001319497823715, -0.03500581905245781, -0.025058157742023468, -0.02805814892053604, 0.0009642586810514331, -0.02905973047018051, 0.018901223316788673, 0.012944911606609821, -0.00021701354125980288, -0.0416845865547657, -0.011796100996434689, -0.022510798647999763, -0.0242462195456028, -0.026411021128296852, 0.01486271433532238, 0.0055804867297410965, 0.012494022957980633, 0.004377559758722782, 0.00641561159864068, -0.007113905157893896, 0.07684216648340225, -0.025011392310261726, -0.012630617246031761, 0.01054775808006525, 0.0007355047855526209, 0.051180947571992874, 0.023547274991869926, -0.0036737381014972925, 0.029210289940238, 0.02507776953279972, 0.014362054876983166, 0.002479050774127245, 0.027279576286673546 ]
Personal Copilot: Train Your Own Coding Assistant
smangrul
October 27, 2023
personal-copilot
bigcode, llm, nlp, inference, guide
https://huggingface.co/blog/personal-copilot
Comparison The plot below shows the eval loss, train loss and learning rate scheduler for QLoRA vs full fine-tuning. We observe that full fine-tuning leads to slightly lower loss and converges a bit faster compared to QLoRA. The learning rate for peft fine-tuning is 10X more than that of full fine-tuning. To make sure that our QLoRA model doesn't lead to catastrophic forgetting, we run the Python Human Eval on it. Below are the results we got. Pass@1 measures the pass rate of completions considering just a single generated code candidate per problem. We can observe that the performance on humaneval-python is comparable between the base bigcode/starcoder (15B params) and the fine-tuned PEFT model smangrul/peft-lora-starcoder15B-v2-personal-copilot-A100-40GB-colab. | | | |---|---| | Model | Pass@1 | |bigcode/starcoder | 33.57| |smangrul/peft-lora-starcoder15B-v2-personal-copilot-A100-40GB-colab| 33.37 | Let's now look at some qualitative samples. In our manual analysis, we noticed that the QLoRA led to slight overfitting and as such we down weigh it by creating new weighted adapter with weight 0.8 via add_weighted_adapter utility of PEFT. We will look at 2 code infilling examples wherein the task of the model is to fill the part denoted by the <FILL_ME> placeholder. We will consider infilling completions from GitHub Copilot, the QLoRA fine-tuned model and the full fine-tuned model. Qualitative Example 1 In the example above, the completion from GitHub Copilot is along the correct lines but doesn't help much. On the other hand, completions from QLoRA and full fine-tuned models are correctly infilling the entire function call with the necessary parameters. However, they are also adding a lot more noise afterwards. This could be controlled with a post-processing step to limit completions to closing brackets or new lines. Note that both QLoRA and full fine-tuned models produce results with similar quality. Qualitative Example 2 In the second example above, GitHub Copilot didn't give any completion. This can be due to the fact that ๐Ÿค— PEFT is a recent library and not yet part of Copilot's training data, which is exactly the type of problem we are trying to address. On the other hand, completions from QLoRA and full fine-tuned models are correctly infilling the entire function call with the necessary parameters. Again, note that both the QLoRA and the full fine-tuned models are giving generations of similar quality. Inference Code with various examples for full fine-tuned model and peft model are available at Full_Finetuned_StarCoder_Inference.ipynb and PEFT_StarCoder_Inference.ipynb, respectively. Therefore, we can observe that the generations from both the variants are as per expectations. Awesome! ๐Ÿš€
[ 0.06033167988061905, -0.031415656208992004, -0.02607502043247223, 0.029756346717476845, 0.03988705575466156, 0.041861020028591156, 0.04603554680943489, 0.04099138826131821, -0.021501706913113594, -0.026703689247369766, -0.005080470349639654, -0.004009035881608725, -0.047097425907850266, -0.03025846742093563, 0.0011446144198998809, -0.00979657843708992, 0.08890435099601746, -0.0023074245546013117, 0.004448974505066872, 0.02276379056274891, -0.034711357206106186, -0.03412269800901413, 0.049920957535505295, 0.026520060375332832, -0.007615392096340656, -0.02203422226011753, 0.012813899666070938, 0.006181094795465469, -0.044113606214523315, 0.038511063903570175, -0.05861739441752434, 0.001364454859867692, -0.04321932792663574, 0.01449599303305149, 0.01086858194321394, -0.029701154679059982, -0.0035710548982024193, 0.05059528723359108, -0.0030808825977146626, -0.07319655269384384, 0.023060031235218048, 0.020669441670179367, -0.0030451605562120676, 0.008932420052587986, 0.0041359965689480305, -0.03134377300739288, -0.06748003512620926, 0.024688778445124626, -0.01831119693815708, -0.021008148789405823, -0.06948231905698776, 0.05864351615309715, 0.06585817784070969, -0.008995640091598034, 0.07581391930580139, -0.012301681563258171, 0.030280495062470436, -0.022134047001600266, -0.0358051061630249, 0.04138873144984245, 0.01056403573602438, 0.009596936404705048, 0.015690963715314865, 0.015827041119337082, 0.01538665872067213, -0.0054771024733781815, -0.009554021991789341, 0.1069394126534462, -0.03473224490880966, -0.06470636278390884, 0.010728701949119568, -0.031083479523658752, 0.024148982018232346, 0.02084566280245781, -0.05689241737127304, -0.027888238430023193, -0.044332586228847504, 0.014577599242329597, 0.045715536922216415, -0.028095994144678116, -0.0009250573348253965, 0.044204551726579666, -0.003120441921055317, -0.016701070591807365, 0.007137886248528957, -0.03835160285234451, 0.002255041850730777, -0.007525232154875994, -0.03948783501982689, -0.018079079687595367, -0.04184801131486893, -0.11899649351835251, -0.04679446667432785, 0.05199018120765686, 0.022483408451080322, -0.008801826275885105, -0.0032658125273883343, 0.038973819464445114, 0.009668471291661263, -0.0555693544447422, -0.07086676359176636, -0.07704821228981018, 0.0015012818621471524, -0.06841809302568436, -0.04800435155630112, 0.03653385862708092, -0.03507303074002266, -0.028177494183182716, -0.031607359647750854, 0.09477829933166504, -0.029186682775616646, 0.06751374900341034, -0.04654324799776077, 0.09766315668821335, -0.13764598965644836, -0.004189597442746162, -0.032507624477148056, 0.006743709556758404, -0.03586409240961075, 0.003354637883603573, 0.008651343174278736, 0.09311939775943756, 0.06488224864006042, -0.0658523365855217, 0.00022900952899362892, 0.07421837002038956, -0.023923402652144432, -0.004009254276752472, 0.0017577573889866471, 0.015393811278045177, 0.042166534811258316, 0.011441008187830448, -0.014516251161694527, 0.01280324999243021, 0.007771807722747326, -0.05040094256401062, -0.004204984288662672, -0.05292097106575966, -0.03017088770866394, 0.05685080587863922, -0.06852232664823532, 0.06087103113532066, -0.006754549685865641, -0.022282447665929794, 0.016869938001036644, 0.034088484942913055, 0.005198941566050053, 0.03940800949931145, 0.03775809332728386, -0.036301616579294205, -0.09192164987325668, 0.081333227455616, -0.004735927563160658, -0.05884825065732002, 0.0644330382347107, 0.05802012234926224, -0.04148472473025322, -0.058653462678194046, -0.032475247979164124, 0.03200940042734146, -0.008897262625396252, 0.03820957615971565, -0.04730549827218056, -0.027275027707219124, 0.021216711029410362, 0.056170754134655, 0.025188658386468887, 0.009081413969397545, 0.0130721814930439, 0.030158178880810738, 0.038704778999090195, -0.009665288031101227, 0.13460981845855713, -0.016536587849259377, -0.07133309543132782, 0.0004885707749053836, -0.04244881123304367, 0.007270902395248413, -0.07787203788757324, 0.03394225984811783, 0.0302994716912508, 0.07275227457284927, -0.011517247185111046, 0.048726633191108704, 0.02563345618546009, -0.11506016552448273, -0.0006845674943178892, -0.08899583667516708, 0.05522157624363899, 0.009209828451275826, -0.06709688156843185, 0.0629844143986702, 0.08201826363801956, 0.007883337326347828, 0.05628874525427818, -0.09074839949607849, 0.01485802885144949, 0.04748939722776413, 0.1139146164059639, -0.02456679940223694, 0.028569595888257027, 0.03912189230322838, 0.048295777291059494, -0.04674498364329338, -0.03964303806424141, 0.02115321345627308, -0.049802057445049286, -0.00487282732501626, 0.0019046074012294412, -0.04173920676112175, 0.061723217368125916, -0.05105304345488548, -0.04864475503563881, -0.027530739083886147, 0.0773182064294815, 0.014479140751063824, 0.01297081634402275, -0.025892766192555428, -0.024378536269068718, -0.03337670490145683, 0.12273429334163666, -0.05470167472958565, 0.034912109375, -0.008724816143512726, -0.03902849182486534, -0.017709486186504364, 0.11126541346311569, -0.003746181959286332, -0.013870498165488243, -0.01770162768661976, -0.06632591784000397, -0.07226920872926712, -0.042044300585985184, 0.11616919189691544, 0.0037643888499587774, -0.04815109074115753, -0.0569152869284153, -0.01979796588420868, 0.004575164057314396, -0.021311026066541672, -0.0208743866533041, 0.06730655580759048, -0.02499452605843544, 0.041355475783348083, -0.08074746280908585, -0.04027184471487999, 0.036056917160749435, 0.0029022996313869953, -0.0521269217133522, 0.011209173128008842, -0.0762253925204277, 0.024512603878974915, -0.00951672624796629, 0.0030966829508543015, 0.02186272293329239, -0.02878582291305065, -0.011998855508863926, -0.019787879660725594, -0.018826905637979507, -0.00038824768853373826, 0.02034105360507965, 0.04590122774243355, -0.026964634656906128, 0.005939642898738384, 0.03252057358622551, -0.023019056767225266, -0.02952590398490429, 0.03353540226817131, -0.012631624937057495, 0.0018702486995607615, -0.011636273935437202, -0.032031819224357605, -0.01948227547109127, 0.0019849876407533884, 0.03241317719221115, 0.028898164629936218, 0.006120680365711451, -0.05000270530581474, -0.02577720209956169, -0.028311889618635178, 0.03986555337905884, -0.03911863639950752, 0.02970525249838829, 0.02083616331219673, -0.0006252574967220426, 0.029661182314157486, 0.005944788455963135, 0.02028840221464634, -0.055915795266628265, 0.0232821274548769, 0.045294106006622314, -0.007849631831049919, -0.017369776964187622, -0.026394082233309746, -0.01701734960079193, -0.016629459336400032, 0.029259735718369484, 0.0138548593968153, 0.015264625661075115, -0.037113938480615616, -0.015454876236617565, 0.02879452332854271, 0.0318695567548275, -0.036002494394779205, -0.017143651843070984, 0.030240017920732498, 0.04789161682128906, 0.03413861244916916, -0.07340691238641739, -0.00525959488004446, -0.018310705199837685, 0.02401129901409149, -0.053498558700084686, -0.021897725760936737, 0.02614090032875538, -0.036595746874809265, 0.01606939360499382, 0.03177168220281601, 0.009713122621178627, 0.006544861011207104, -0.0019482043571770191, 0.013446373865008354, 0.02502155490219593, -0.028290608897805214, 0.0238155797123909, -0.003114412073045969, 0.014577494002878666, 0.0172320157289505, 0.021587921306490898, 0.018755557015538216, -0.050065044313669205, 0.025059428066015244, -0.014314549043774605, 0.018397049978375435, -0.03894812613725662, 0.020066658034920692, 0.04882520064711571, -0.03547956421971321, 0.008152967318892479, -0.035446129739284515, -0.022266438230872154, 0.04702490568161011, -0.038969527930021286, -0.026255331933498383, -0.025622643530368805, 0.006536548491567373, -0.020244674757122993, 0.06710969656705856, -0.020916983485221863, 0.02945731393992901, 0.04482341185212135, -0.010757487267255783, 0.00796874426305294, 0.010935054160654545, -0.010409718379378319, -0.003515330608934164, 0.0019529630662873387, -0.015038108453154564, -0.03681369870901108, 0.03245552256703377, 0.0006817503017373383, 0.07840768247842789, -0.026135576888918877, 0.006884848698973656, -0.004786693025380373, 0.01023339107632637, 0.01467874739319086, -0.0015754252672195435, -0.039124250411987305, 0.045875467360019684, -0.007563586812466383, -0.02897295355796814, 0.009012973867356777, -0.02658829092979431, -0.010580334812402725, -0.03350743651390076, -0.07343728840351105, -0.0184140857309103, -0.046837810426950455, 0.006167856976389885, 0.016894200816750526, 0.005610703490674496, 0.014276515692472458, -0.05519704520702362, -0.03922092169523239, 0.035721730440855026, 0.014146242290735245, 0.020752105861902237, -0.029053164646029472, -0.0927143320441246, -0.008616374805569649, -0.009285283274948597, 0.007116242311894894, 0.018119173124432564, -0.023224089294672012, -0.07063500583171844, 0.008212827146053314, 0.03325048089027405, 0.0403607003390789, -0.01799214631319046, -0.01193073857575655, -0.000024800776373012923, 0.030249077826738358, -0.02624008059501648, 0.06008230522274971, -0.021674644201993942, -0.0066261314786970615, 0.023027053102850914, 0.032494496554136276, -0.015613479539752007, 0.015609790571033955, 0.011659969575703144, -0.035230036824941635, 0.016870705410838127, -0.06275981664657593, 0.02513977698981762, 0.04125623032450676, 0.008544431068003178, 0.04251718148589134, -0.01379816047847271, 0.04412148892879486, -0.024832678958773613, 0.0577726773917675, 0.04144121706485748, -0.0005834836047142744, -0.010031329467892647, -0.03692380338907242, 0.016889113932847977, 0.0016502866055816412, -0.02470606565475464, 0.03826659545302391, -0.0200352743268013, 0.015065045095980167, -0.016774572432041168, 0.027006810531020164, 0.0056851585395634174, 0.011628232896327972, -0.003364069852977991, -0.02058780938386917, 0.009463992901146412, -0.03417133539915085, -0.032583530992269516, -0.02208288386464119, -0.016274502500891685, 0.009435037150979042, -0.00950702466070652, 0.021671509370207787, -0.03753296658396721, 0.02395138144493103, 0.019936665892601013, 0.002892484189942479, -0.00874409917742014, -0.002369415247812867, 0.0021075643599033356, -0.023668529465794563, -0.0033885866869241, 0.012575663626194, -0.06269890069961548, 0.021273670718073845, -0.06396914273500443, -0.04857153818011284, -0.025861011818051338, 0.001394484774209559, -0.03430059924721718, 0.002491690218448639, -0.028721751645207405, -0.010183724574744701, 0.015484198927879333, 0.030439984053373337, -0.004050905816257, -0.09096245467662811, 0.020930351689457893, 0.007936744950711727, 0.01740116812288761, -0.018699442967772484, -0.017649196088314056, 0.006660934537649155, -0.05635843798518181, -0.02457442507147789, 0.009551038034260273, 0.023154769092798233, -0.01377411000430584, 0.06371980905532837, 0.0044282786548137665, -0.027949754148721695, -0.03565957769751549, 0.008666171692311764, 0.01877370849251747, -0.01090711448341608, -0.011304857209324837, 0.08011405169963837, 0.017423514276742935, 0.02602570131421089, 0.007902237586677074, 0.051211245357990265, 0.015007034875452518, 0.026808002963662148, 0.012576171196997166, 0.026769304648041725, 0.007962888106703758, 0.015940487384796143, -0.027887588366866112, -0.024104710668325424, 0.020795827731490135, -0.01489850040525198, 0.050265517085790634, -0.06466121971607208, 0.010951056145131588, 0.024945316836237907, -0.02326689101755619, -0.012745039537549019, -0.023025723174214363, 0.039744988083839417, 0.012983610853552818, 0.027355995029211044, 0.024481151252985, -0.0007925357786007226, -0.05044220760464668, -0.013295692391693592, -0.0527043379843235, -0.04233093187212944, -0.02963557280600071, 0.02532021887600422, -0.0646524578332901, -0.02283492684364319, 0.06796057522296906, -0.010211593471467495, -0.03994175046682358, -0.043954282999038696, -0.01391701027750969, 0.004645644687116146, -0.05551540106534958, 0.02008363977074623, -0.011066165752708912, -0.0073136333376169205, -0.00900120846927166, 0.008480311371386051, 0.029518332332372665, 0.009933356195688248, 0.037672050297260284, 0.0029314516577869654, 0.000284039240796119, -0.0009266594424843788, 0.0181733388453722, -0.013992962427437305, -0.004207680933177471, 0.04545460641384125, -0.04753970354795456, -0.03039679303765297, 0.023072561249136925, -0.002482403302565217, 0.0037525782827287912, -0.047309499233961105, 0.08398991823196411, 0.023031102493405342, -0.020436566323041916, 0.06734765321016312, -0.006832839455455542, 0.0384456068277359, -0.021571677178144455, -0.02088615484535694, 0.005848027300089598, -0.013609595596790314, 0.0045227366499602795, 0.02383454144001007, -0.012578447349369526, 0.012522926554083824, 0.005941559560596943, 0.04877739027142525, -0.022219736129045486, 0.05594244226813316, 0.04162821173667908, 0.021631428971886635, 0.028194217011332512, 0.05959024280309677, -0.03398381173610687, 0.016339844092726707, 0.012007297948002815, 0.055376119911670685, 0.0024879733100533485, -0.0330105759203434, 0.008471238426864147, 0.035452354699373245, -0.01140064187347889, 0.018238266929984093, 0.03842834755778313, 0.04383159801363945, 0.0035575437359511852, 0.04836638271808624, 0.04434686899185181, 0.049205489456653595, -0.004297129809856415, 0.049034483730793, -0.0179169699549675, 0.041356440633535385, 0.024621855467557907, 0.02209458500146866, 0.0309104323387146, -0.023312851786613464, -0.0001542177051305771, -0.03180288150906563, -0.05655910447239876, -0.01328574400395155, 0.004211959894746542, 0.053951408714056015, 0.025413574650883675, 0.025967037305235863, -0.047536201775074005, 0.008313844911754131, 0.032730139791965485, 0.02730901539325714, 0.011176424100995064, -0.012057529762387276, -0.012183704413473606, -0.019401390105485916, -0.04573144391179085, 0.01869364269077778, -0.0011545391753315926, -0.010954217053949833, 0.05300883948802948, 0.0472848080098629, 0.029267428442835808, 0.00007128809374989942, -0.008833462372422218, -0.010160427540540695, -0.017457013949751854, 0.023557282984256744, 0.024603907018899918, 0.010772217065095901, -0.004461490549147129, 0.04090927541255951, -0.014083677902817726, -0.03275757282972336, -0.014710662886500359, 0.046862535178661346, -0.006321152672171593, -0.007522668223828077, 0.008142040111124516, 0.004444844555109739, 0.020627330988645554, 0.007312625180929899, -0.04953460767865181, 0.010086223483085632, -0.004916662350296974, 0.000042323888919781893, 0.04898599535226822, -0.004530411213636398, 0.017840661108493805, -0.01658005639910698, -0.0011596730910241604, -0.015293281525373459, 0.09361762553453445, 0.011852871626615524, 0.018203092738986015, 0.014806634746491909, -0.03479502722620964, 0.0010702235158532858, -0.012165035121142864, -0.007627536542713642, 0.009644716046750546, -0.021165506914258003, 0.009687812998890877, 0.011772789992392063, -0.07127591967582703, 0.04298056289553642, -0.05038369446992874, -0.016129016876220703, 0.027287140488624573, 0.03500783070921898, -0.0035129839088767767, 0.03888099268078804, -0.018419696018099785, 0.0011163747403770685, -0.01151383575052023, 0.009093957021832466, -0.053760092705488205, 0.00298705673776567, 0.004634182900190353, 0.015726707875728607, -0.0037544965744018555, -0.0318654365837574, -0.0016521560028195381, -0.002300841500982642, -0.022524099797010422, 0.01950540952384472, 0.017904553562402725, -0.004767101723700762, -0.0011283286148682237, 0.04803471639752388, 0.00831704679876566, 0.04821333289146423, 0.05939571186900139, 0.013288531452417374, 0.01982683502137661, -0.024476228281855583, 0.0032096318900585175, -0.03631042316555977, -0.038863420486450195, 0.01954302005469799, -0.029695961624383926, -0.007970421575009823, 0.0381389781832695, -0.044620923697948456, 0.020693529397249222, -0.04138384014368057, -0.059058018028736115, -0.03132069483399391, -0.02288961410522461, 0.017555290833115578, -0.029541676864027977, 0.03134925290942192, 0.04564526677131653, 0.03615444898605347, -0.040856871753931046, -0.0337919220328331, 0.014719609171152115, 0.007023833692073822, -0.017058303579688072, 0.035526324063539505, -0.008871762081980705, -0.006515401881188154, -0.04193122312426567, 0.009588675573468208, 0.031428392976522446, -0.005764687433838844, -0.016662154346704483, 0.022298038005828857, 0.04395661875605583, -0.003104466712102294, -0.014347314834594727, 0.03657856956124306, 0.012109546922147274, 0.02672524005174637, 0.015101314522325993, -0.019712843000888824, 0.029196059331297874, -0.0016017018351703882, -0.05635804682970047, -0.034567512571811676, -0.02488839440047741, -0.019747614860534668, -0.014192208647727966, 0.011499318294227123, 0.037682317197322845, 0.007050126791000366, -0.0031846007332205772, -0.023595232516527176, -0.021260283887386322, -0.04326265677809715, -0.022849498316645622, 0.03199264407157898, 0.0147884301841259, 0.01841381937265396, -0.0037757684476673603, 0.019311198964715004, 0.0838775634765625, -0.003942555747926235, -0.01405368186533451, -0.0004476845497265458, -0.017244907096028328, 0.04328862205147743, 0.022585317492485046, -0.016594627872109413, 0.028408220037817955, 0.03369150683283806, 0.02085900865495205, 0.00882703810930252, 0.05257255584001541 ]
Personal Copilot: Train Your Own Coding Assistant
smangrul
October 27, 2023
personal-copilot
bigcode, llm, nlp, inference, guide
https://huggingface.co/blog/personal-copilot
Full Finetuning We will look at how to do full fine-tuning of bigcode/starcoder (15B params) on 8 A100 80GB GPUs using PyTorch Fully Sharded Data Parallel (FSDP) technique. For more information on FSDP, please refer to Fine-tuning Llama 2 70B using PyTorch FSDP and Accelerate Large Model Training using PyTorch Fully Sharded Data Parallel. Resources 1. Codebase: link. It uses the recently added Flash Attention V2 support in Transformers. 2. FSDP Config: fsdp_config.yaml 3. Model: bigcode/stacoder 4. Dataset: smangrul/hf-stack-v1 5. Fine-tuned Model: smangrul/peft-lora-starcoder15B-v2-personal-copilot-A100-40GB-colab The command to launch training is given at run_fsdp.sh. accelerate launch --config_file "configs/fsdp_config.yaml" train.py \ --model_path "bigcode/starcoder" \ --dataset_name "smangrul/hf-stack-v1" \ --subset "data" \ --data_column "content" \ --split "train" \ --seq_length 2048 \ --max_steps 2000 \ --batch_size 1 \ --gradient_accumulation_steps 2 \ --learning_rate 5e-5 \ --lr_scheduler_type "cosine" \ --weight_decay 0.01 \ --num_warmup_steps 30 \ --eval_freq 100 \ --save_freq 500 \ --log_freq 25 \ --num_workers 4 \ --bf16 \ --no_fp16 \ --output_dir "starcoder-personal-copilot-A100-40GB-colab" \ --fim_rate 0.5 \ --fim_spm_rate 0.5 \ --use_flash_attn The total training time was 9 Hours. Taking the cost of $12.00 / hr based on lambdalabs for 8x A100 80GB GPUs, the total cost would be $108.
[ 0.021239567548036575, 0.022683432325720787, -0.0018888703780248761, 0.11410059779882431, 0.030405176803469658, -0.026971641927957535, 0.02422996796667576, 0.054541993886232376, 0.013429121114313602, 0.0212407186627388, -0.08236893266439438, 0.0064396122470498085, -0.0037313879001885653, -0.005187558941543102, 0.0267307311296463, -0.019972259178757668, 0.018411099910736084, -0.046974267810583115, -0.026876088231801987, -0.0003438920248299837, 0.005394620820879936, 0.016285333782434464, 0.03475156053900719, 0.05090879276394844, -0.04655912518501282, -0.017779920250177383, -0.00039600470336154103, 0.04567169025540352, -0.014418576844036579, 0.0557524599134922, -0.11112252622842789, 0.01857857033610344, -0.00015717845235485584, 0.030417311936616898, -0.007950717583298683, 0.0024375836364924908, -0.04252449423074722, 0.0719897598028183, -0.005023144651204348, -0.06227035075426102, -0.03824630379676819, -0.032661035656929016, -0.07456021010875702, 0.015420645475387573, 0.007853887043893337, -0.0003979105385951698, -0.06230548769235611, 0.09201303124427795, -0.005981552880257368, -0.07365088909864426, -0.01767982728779316, 0.05721462517976761, 0.03667796030640602, -0.05476584658026695, 0.06129470467567444, -0.014446519315242767, -0.0376625657081604, 0.028901992365717888, -0.03193633258342743, 0.017108531668782234, 0.02642078511416912, -0.032414935529232025, 0.007778051309287548, 0.04873465374112129, 0.0506112277507782, -0.029255777597427368, -0.013127113692462444, 0.022701965644955635, -0.07987465709447861, -0.0620899461209774, 0.06479768455028534, 0.016266651451587677, 0.007125635165721178, -0.009646343998610973, -0.10404667258262634, -0.09210015088319778, -0.02393178641796112, 0.018158765509724617, 0.05976739153265953, 0.021172262728214264, -0.055517639964818954, 0.027305185794830322, -0.029338832944631577, 0.02605317533016205, -0.003420469118282199, 0.006914738565683365, 0.0002179039001930505, -0.0334196612238884, 0.0042928531765937805, -0.0005893072811886668, -0.0251327995210886, -0.11522439122200012, -0.006125045940279961, 0.02913033217191696, 0.0763956680893898, 0.018832899630069733, -0.014196813106536865, 0.0012365927686914802, 0.015305505134165287, 0.0093220891430974, -0.013410293497145176, -0.10320232063531876, -0.02363789640367031, -0.050781767815351486, -0.011747967451810837, 0.08100378513336182, -0.020748285576701164, -0.05118246749043465, -0.010175159201025963, 0.010919990949332714, -0.010057580657303333, 0.028438514098525047, -0.08908161520957947, 0.06885011494159698, -0.09058848768472672, -0.017002711072564125, 0.02279517613351345, -0.0213527362793684, -0.06799395382404327, -0.003581506898626685, -0.04476238042116165, 0.08014711737632751, 0.029207725077867508, -0.006283773109316826, -0.01271008513867855, 0.11488886177539825, 0.00561605766415596, 0.034682001918554306, -0.008652538992464542, -0.022622857242822647, 0.06219163537025452, -0.03589385747909546, -0.017685318365693092, 0.03066241182386875, 0.040395304560661316, -0.008187713101506233, -0.039955634623765945, -0.018738042563199997, -0.02516850270330906, 0.051054805517196655, -0.044323861598968506, 0.03221048042178154, 0.030258946120738983, -0.017414867877960205, 0.0593421570956707, 0.025215046480298042, -0.0336538590490818, 0.06940269470214844, -0.007894915528595448, 0.01580115221440792, -0.11662880331277847, 0.09933075308799744, -0.03183191269636154, -0.0402965284883976, 0.08145038038492203, 0.045554112643003464, -0.06585649400949478, -0.05145982652902603, -0.09378599375486374, 0.042798254638910294, 0.03337283059954643, 0.009247027337551117, -0.0626230463385582, 0.015466657467186451, -0.026252927258610725, -0.027510451152920723, 0.04064617678523064, -0.026092413812875748, 0.0012538994196802378, 0.0075775738805532455, 0.04050808399915695, 0.04247315973043442, 0.05436315760016441, -0.01654479280114174, -0.01932213269174099, -0.020115595310926437, 0.017689669504761696, 0.10230429470539093, -0.06722472608089447, -0.025284400209784508, -0.005706422496587038, 0.029606956988573074, -0.023683760315179825, 0.07262519001960754, -0.014716851525008678, -0.07336992770433426, 0.05937318131327629, -0.04174816235899925, 0.00883052684366703, 0.051166463643312454, -0.043451372534036636, 0.008940964005887508, 0.08527718484401703, -0.02669522538781166, 0.05803803727030754, -0.04998835548758507, -0.016773702576756477, 0.03252960741519928, 0.08534998446702957, -0.021398190408945084, 0.0070886327885091305, 0.02733420394361019, 0.06496188044548035, 0.04423816502094269, -0.02999827452003956, 0.008125345222651958, -0.008871843107044697, -0.05940067023038864, 0.07441825419664383, 0.0001099293731385842, -0.013859020546078682, -0.1520214080810547, -0.016774483025074005, -0.03517230972647667, 0.050209891051054, -0.040410302579402924, -0.015404426492750645, -0.006165910046547651, 0.05111781507730484, 0.015263392589986324, 0.1782190352678299, -0.01404023077338934, -0.033679187297821045, -0.016838768497109413, -0.01904747448861599, -0.016141198575496674, 0.06585710495710373, 0.014797200448811054, 0.04423001781105995, -0.030374499037861824, -0.07722533494234085, -0.05791250988841057, -0.05260417237877846, 0.1150238886475563, 0.014856668189167976, -0.025288572534918785, -0.06014208868145943, 0.018099786713719368, 0.010929783806204796, -0.04009139910340309, 0.02605588175356388, 0.043609488755464554, -0.009936723858118057, -0.012279505841434002, -0.07101985812187195, -0.019035324454307556, 0.06562341749668121, 0.014828622341156006, 0.018083468079566956, 0.015983689576387405, -0.051162417978048325, -0.01676802523434162, -0.023489875718951225, -0.014586244709789753, 0.014559905044734478, 0.006316276732832193, -0.02671920880675316, -0.04936463385820389, -0.02152828313410282, 0.04565209522843361, 0.04833502694964409, 0.03267691656947136, -0.03703039512038231, 0.024120936170220375, -0.00915542058646679, -0.01535648014396429, 0.00914575532078743, 0.0012575248256325722, -0.019031638279557228, -0.02791808731853962, 0.009732332080602646, -0.007820077240467072, 0.03141145035624504, -0.015267198905348778, 0.009358655661344528, 0.05035151168704033, 0.08534815907478333, -0.05569775402545929, -0.04955444112420082, -0.01327715627849102, 0.03595985472202301, -0.01878790371119976, -0.012138208374381065, 0.026274295523762703, 0.009826225228607655, 0.028283683583140373, -0.019712770357728004, 0.01941482536494732, -0.04427488148212433, -0.01337425597012043, 0.01392333023250103, 0.03394104167819023, 0.020245365798473358, -0.016417663544416428, -0.045551300048828125, 0.006850440986454487, -0.004521992988884449, -0.04457736015319824, 0.0023496965877711773, -0.015471274964511395, -0.023319993168115616, 0.009630806744098663, 0.013970542699098587, -0.04279111325740814, -0.01873471774160862, -0.01058591902256012, 0.013421017676591873, 0.028082402423024178, -0.08523935824632645, 0.0034293935168534517, -0.03676970675587654, 0.03926480561494827, -0.01969476416707039, -0.03148658946156502, 0.02741686999797821, -0.007716233376413584, -0.005095474421977997, -0.006353016942739487, -0.047006476670503616, 0.009572794660925865, -0.003927147015929222, -0.02112375758588314, 0.015114286914467812, -0.010869615711271763, 0.0038426171522587538, -0.028623251244425774, 0.030604083091020584, -0.015870392322540283, -0.02163523994386196, -0.0016986253904178739, -0.025958439335227013, 0.013312137685716152, -0.019293097779154778, 0.03371515870094299, -0.012177652679383755, 0.006089391186833382, -0.00007852619455661625, -0.026169797405600548, -0.04452769085764885, -0.017945846542716026, -0.03627840802073479, -0.011286899447441101, -0.028777051717042923, -0.02026202343404293, -0.005013096146285534, -0.01310273353010416, -0.011373748071491718, 0.0407116524875164, 0.02839078940451145, -0.0427953340113163, 0.015150872059166431, -0.018625615164637566, 0.035112250596284866, -0.012284777127206326, -0.024322543293237686, -0.0070147826336324215, 0.006862201262265444, -0.01446741446852684, -0.029209885746240616, 0.01903759315609932, -0.002478491049259901, 0.029218416661024094, -0.020112106576561928, 0.01015012338757515, 0.01955053210258484, 0.05808553099632263, 0.05674460530281067, 0.007660125847905874, -0.0466015599668026, 0.05226324126124382, 0.012607503682374954, -0.02812436781823635, 0.0004889838746748865, 0.021070415154099464, 0.04001323878765106, -0.049308083951473236, -0.07742566615343094, 0.019782183691859245, -0.017054282128810883, 0.030511286109685898, 0.034487005323171616, 0.00641920929774642, -0.010334271937608719, 0.0014442196115851402, -0.0532401017844677, -0.00632641464471817, 0.012731504626572132, 0.028560888022184372, 0.0033610255923122168, -0.0320458747446537, -0.02085910178720951, -0.06629396229982376, 0.023225048556923866, 0.025979479774832726, -0.0006610542768612504, -0.0658290758728981, 0.021281126886606216, -0.00926689151674509, -0.0022049332037568092, 0.024117758497595787, 0.008111722767353058, -0.009164649061858654, 0.015038100071251392, -0.020153816789388657, 0.01401500590145588, 0.009512386284768581, 0.009783773683011532, -0.0026867957785725594, 0.01676950603723526, -0.048939988017082214, 0.004471777938306332, 0.0022209379822015762, -0.008371570147573948, 0.013363363221287727, -0.01877363584935665, -0.006186117883771658, -0.00021551596000790596, 0.05150103569030762, 0.005404758732765913, 0.01222999021410942, 0.03117448464035988, -0.03240114450454712, 0.026619499549269676, 0.049962617456912994, -0.01492681447416544, -0.0043659149669110775, -0.043952472507953644, 0.031162938103079796, -0.046297334134578705, 0.012021531350910664, 0.040375299751758575, -0.02614372782409191, 0.037518467754125595, 0.0010545359691604972, 0.027111230418086052, 0.033416617661714554, 0.02598249539732933, 0.014295837841928005, -0.04743656888604164, -0.02997947484254837, -0.01980520598590374, -0.022770756855607033, 0.030242273584008217, 0.010311181657016277, -0.01717894710600376, -0.031428564339876175, 0.027169333770871162, -0.025025099515914917, -0.002453030087053776, 0.021654678508639336, 0.002237581182271242, 0.021540148183703423, 0.02712099999189377, -0.003289666725322604, -0.004457585979253054, -0.0030533147510141134, -0.027577102184295654, 0.0020972692873328924, 0.012020399793982506, -0.022490108385682106, -0.05357908830046654, -0.012673692777752876, 0.046687111258506775, -0.012206037528812885, 0.029127541929483414, 0.013602794148027897, -0.002022127853706479, 0.04095643758773804, -0.00032045418629422784, -0.004571082536131144, -0.04346690699458122, 0.013149891048669815, 0.041270650923252106, 0.040149495005607605, -0.009950278326869011, -0.04175356775522232, -0.04288257658481598, -0.03499213606119156, -0.03731107711791992, 0.01554254349321127, 0.01691821962594986, -0.02920914627611637, 0.032405782490968704, 0.04566803202033043, 0.006918633822351694, 0.01403975859284401, -0.022749749943614006, 0.0014458500081673265, -0.03604019805788994, 0.0007157318759709597, -0.019787417724728584, 0.019248340278863907, -0.028268055990338326, 0.06298474222421646, 0.027531074360013008, 0.04493485391139984, 0.020807739347219467, 0.0067325737327337265, 0.040544044226408005, -0.010620301589369774, -0.01342728640884161, -0.026852961629629135, -0.01576436683535576, 0.020511344075202942, -0.010386938229203224, 0.030593350529670715, -0.0008226404315792024, -0.003448589239269495, -0.001678411616012454, 0.017862869426608086, -0.0492214560508728, -0.034515608102083206, 0.027041595429182053, 0.01786363497376442, 0.007254434283822775, 0.015759414061903954, 0.005360783543437719, -0.023965079337358475, -0.007656363770365715, 0.009289299137890339, -0.04399107024073601, -0.016175799071788788, 0.023153172805905342, -0.03252000734210014, -0.03715171292424202, 0.017355971038341522, -0.005620449781417847, 0.012483946047723293, -0.050420984625816345, 0.001039104419760406, 0.020442243665456772, -0.015290510840713978, -0.04615052416920662, -0.04316920414566994, 0.06637950986623764, 0.04942053556442261, 0.03527649864554405, 0.07148239016532898, 0.022688621655106544, 0.000962498364970088, -0.015195702202618122, 0.025301232933998108, 0.03563811257481575, -0.005711143370717764, -0.044703446328639984, 0.01933429203927517, 0.020672691985964775, 0.02796749956905842, -0.020432457327842712, -0.0274803563952446, -0.023371869698166847, 0.02992001734673977, -0.052292611449956894, 0.03355524688959122, 0.011105255223810673, 0.004058036487549543, 0.04290081560611725, -0.007479907013475895, 0.02838771604001522, -0.022203553467988968, -0.016103774309158325, 0.010251100175082684, -0.0025867598596960306, 0.003456875216215849, 0.03293749690055847, 0.007172260899096727, 0.028171105310320854, 0.0071592386811971664, 0.042364709079265594, -0.06330488622188568, 0.03963060677051544, 0.05247770994901657, 0.021968474611639977, -0.0010480214841663837, 0.023193808272480965, -0.04231643304228783, 0.02467397041618824, -0.008419197052717209, 0.04499579593539238, -0.011619940400123596, -0.04169701039791107, 0.004820770118385553, 0.01688903197646141, -0.006759321317076683, -0.0010904946830123663, 0.0410647988319397, -0.002874752739444375, 0.0417114794254303, 0.03308509662747383, 0.021131128072738647, 0.006402196362614632, -0.001972104189917445, 0.010065406560897827, -0.010760918259620667, 0.06727880239486694, 0.04175485298037529, 0.012963810004293919, 0.04571795463562012, -0.010141444392502308, 0.01411102619022131, -0.05587029457092285, -0.015027038753032684, -0.018702803179621696, -0.03308945521712303, 0.07174775004386902, -0.03135473281145096, 0.034964703023433685, -0.05434805527329445, 0.042315270751714706, 0.02907850407063961, 0.02707228995859623, -0.0005285015213303268, 0.020956778898835182, -0.0133877694606781, -0.01422468014061451, -0.020051518455147743, 0.022812852635979652, 0.025783414021134377, -0.005397798027843237, 0.007270504720509052, -0.01126769371330738, 0.061138615012168884, 0.0010668592294678092, -0.0250850822776556, 0.017930686473846436, 0.003922839183360338, -0.0318724699318409, 0.0349624939262867, 0.0045505911111831665, 0.007006406784057617, -0.006341272499412298, 0.0013277948601171374, -0.006147377192974091, 0.020193438977003098, -0.010192425921559334, -0.021668214350938797, -0.03671538084745407, -0.0058447327464818954, -0.028907474130392075, 0.0053261355496943, -0.03435184434056282, -0.004900116007775068, -0.034399691969156265, 0.00941359344869852, -0.019190438091754913, 0.047764722257852554, -0.03752383962273598, 0.009396224282681942, -0.01844152808189392, 0.008936310186982155, -0.004360100720077753, 0.05768338590860367, -0.0088141318410635, 0.017454899847507477, 0.03659437596797943, -0.03502622991800308, -0.017297666519880295, -0.024763507768511772, 0.06018908694386482, 0.003814582247287035, -0.04687860608100891, 0.0077415150590240955, -0.012020801194012165, -0.07166662067174911, 0.09580820798873901, 0.009631127119064331, 0.025419779121875763, 0.013075838796794415, 0.027185790240764618, 0.06022779271006584, 0.020146707072854042, 0.03713912144303322, -0.024737868458032608, 0.018657593056559563, 0.029272332787513733, -0.04616309702396393, 0.023966558277606964, -0.020830988883972168, 0.03820725157856941, 0.04140698164701462, 0.019472839310765266, 0.003927181009203196, -0.042918652296066284, -0.026453252881765366, 0.03911491110920906, 0.03155902400612831, 0.027852483093738556, -0.02120058983564377, 0.05849859118461609, -0.018166352063417435, -0.015888506546616554, 0.028427831828594208, -0.006021146662533283, 0.02488444373011589, 0.0243532732129097, -0.016644427552819252, -0.0016216716030612588, -0.009462001733481884, -0.011494283564388752, -0.05323827639222145, -0.03214401751756668, 0.04137290269136429, -0.056381452828645706, 0.022830190137028694, -0.00994789693504572, -0.06296585500240326, -0.018866324797272682, -0.013997934758663177, -0.0094816405326128, -0.005917525850236416, 0.05608663335442543, 0.028858669102191925, 0.022097492590546608, -0.019980736076831818, -0.02254597656428814, 0.005937307141721249, -0.03520937263965607, -0.005844037979841232, 0.04865378141403198, 0.02809378318488598, -0.03351401910185814, -0.03430388122797012, 0.056500665843486786, 0.04203450307250023, 0.0007780330488458276, -0.049885138869285583, 0.019025903195142746, 0.007052578032016754, -0.023753635585308075, 0.02454182133078575, 0.04722099378705025, -0.005281628575176001, 0.05328948050737381, 0.013312830589711666, -0.017946068197488785, 0.018152408301830292, -0.014525805599987507, -0.05327833443880081, -0.00452418252825737, -0.005105295218527317, -0.04105577990412712, 0.031991034746170044, -0.006056542042642832, 0.026162942871451378, -0.018558761104941368, -0.01220253761857748, -0.031310342252254486, 0.0010226723970845342, -0.0355706587433815, -0.03858838975429535, -0.004087692126631737, 0.0355539433658123, 0.017893686890602112, -0.012312439270317554, 0.05627962946891785, 0.03775404766201973, -0.031490422785282135, 0.024624809622764587, 0.03351784870028496, 0.0033797568175941706, 0.00987501535564661, 0.016234537586569786, -0.0275106281042099, 0.023977775126695633, 0.03443365916609764, -0.011202476918697357, 0.00885056797415018, 0.006084803491830826 ]