Upload 30 files
Browse files- assets/custom.js +1 -1
- assets/favicon.ico +0 -0
- index/main.json +1 -0
- locale/en_US.json +2 -2
- modules/__pycache__/__init__.cpython-310.pyc +0 -0
- modules/__pycache__/base_model.cpython-310.pyc +0 -0
- modules/__pycache__/config.cpython-310.pyc +0 -0
- modules/__pycache__/llama_func.cpython-310.pyc +0 -0
- modules/__pycache__/models.cpython-310.pyc +0 -0
- modules/__pycache__/overwrites.cpython-310.pyc +0 -0
- modules/__pycache__/pdf_func.cpython-310.pyc +0 -0
- modules/__pycache__/presets.cpython-310.pyc +0 -0
- modules/__pycache__/shared.cpython-310.pyc +0 -0
- modules/__pycache__/utils.cpython-310.pyc +0 -0
- modules/__pycache__/webui_locale.cpython-310.pyc +0 -0
- modules/base_model.py +63 -59
- modules/config.py +3 -5
- modules/llama_func.py +6 -3
- modules/presets.py +6 -6
- modules/utils.py +7 -11
- modules/webui_locale.py +1 -2
assets/custom.js
CHANGED
|
@@ -160,7 +160,7 @@ function showOrHideUserInfo() {
|
|
| 160 |
}
|
| 161 |
|
| 162 |
function toggleDarkMode(isEnabled) {
|
| 163 |
-
if (isEnabled) {
|
| 164 |
gradioContainer.classList.add("dark");
|
| 165 |
document.body.style.setProperty("background-color", "var(--neutral-950)", "important");
|
| 166 |
} else {
|
|
|
|
| 160 |
}
|
| 161 |
|
| 162 |
function toggleDarkMode(isEnabled) {
|
| 163 |
+
if (!isEnabled) {
|
| 164 |
gradioContainer.classList.add("dark");
|
| 165 |
document.body.style.setProperty("background-color", "var(--neutral-950)", "important");
|
| 166 |
} else {
|
assets/favicon.ico
CHANGED
|
|
|
|
index/main.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"index_struct": {"__type__": "simple_dict", "__data__": {"index_id": "dbc618b1-c2c6-4ba2-b3c8-abecf941d79f", "summary": null, "nodes_dict": {"8ba9a62b-7f42-4205-ba1c-15ed4a920312": "8ba9a62b-7f42-4205-ba1c-15ed4a920312"}, "doc_id_dict": {"66334fd4-64ab-48cd-a8fc-cfce16148644": ["8ba9a62b-7f42-4205-ba1c-15ed4a920312"]}, "embeddings_dict": {}}}, "docstore": {"docs": {"8ba9a62b-7f42-4205-ba1c-15ed4a920312": {"text": "\ufeffQuestion,Answer\nMaxis / Hotlink boleh guna tak ?,Maxis/Hotlink Perlu subs maxis tv plan rm18 (tanpa had) dekat https://tv.maxis.com.my\nMaxis Or Hotlink Can Bypass?,\nMaxis/Hotlink tanpa langganan boleh guna bypass itu ?,\nMaxis/Hotlink unlimited data plan boleh guna tak ?,\n,\n###,\n,\n\"Maxis/Hotlink unlimited data saya sudah FUP, boleh bypass ?\",tak boleh bypass FUP\n\"Maxis/Hotlink sudah FUP, boleh bypass ?\",\nMaxis/Hotlink already FUP can bypass ?,\n\"Maxis/Hotlink FUP, can bypass ?\",\n,\n###,\n,\nDekat mana boleh subscribe maxis tv?,\"https://tv.maxis.com.my , Goto >> Offers >> Multi-Pass >> RM18, Kalau takde plan RM18 itu maksud tak support.\"\nmana boleh subs maxis tv?,\nmaxis tv plan itu subcribe dekat mana tu?,\nboleh terangkan maxis tv nak subscribe dekat mana tak?,\n,\n###,\n,\nCelcom boleh dapat bypass?,Celcom perlu subscribe rm35/rm12 3Mbps To use the config for bypass 3mbps capped.\nCelcom can bypass?,\nCelcom need to subscribe what plan to bypass?,\nCelcom subs what plan,\nCelcom boleh guna tak?,\n", "doc_id": "8ba9a62b-7f42-4205-ba1c-15ed4a920312", "embedding": null, "doc_hash": "5b41f391d121ddddfb91610d945408479183cba6b613b4a7605b1c2e91c87c9a", "extra_info": null, "node_info": {"start": 0, "end": 999}, "relationships": {"1": "66334fd4-64ab-48cd-a8fc-cfce16148644"}, "__type__": "1"}}, "ref_doc_info": {"66334fd4-64ab-48cd-a8fc-cfce16148644": {"doc_hash": "5b41f391d121ddddfb91610d945408479183cba6b613b4a7605b1c2e91c87c9a"}, "8ba9a62b-7f42-4205-ba1c-15ed4a920312": {"doc_hash": "5b41f391d121ddddfb91610d945408479183cba6b613b4a7605b1c2e91c87c9a"}}}, "vector_store": {"__type__": "simple", "__data__": {"simple_vector_store_data_dict": {"embedding_dict": {"8ba9a62b-7f42-4205-ba1c-15ed4a920312": [-0.01307397335767746, -0.0027875970117747784, 0.006309362594038248, -0.04324221611022949, -0.015145034529268742, 0.008040590211749077, -0.016876261681318283, -0.030264422297477722, -0.021274862810969353, -0.018620314076542854, 0.024160241708159447, 0.022762436419725418, -0.02141592651605606, -0.009188329800963402, -0.012227595783770084, 0.009598694741725922, 0.02122356742620468, 0.0016390556702390313, 0.035804349929094315, -0.009367864578962326, -0.0034656610805541277, 0.028699904680252075, -0.0006624349625781178, -0.0018001560820266604, -0.015555399470031261, -0.003952969331294298, 0.009515339508652687, -0.010496368631720543, -0.0068030827678740025, -0.002922247862443328, 0.02716103568673134, 0.0013881879858672619, -0.006020824424922466, -0.010855438187718391, 0.006636372301727533, -0.0002123959711752832, -0.00043080313480459154, -0.02762269787490368, -0.002763552125543356, 0.01863313838839531, 0.014696198515594006, -0.008745905011892319, 0.014516663737595081, -0.014311481267213821, 0.0025407366920262575, 0.019992472603917122, 0.011919822543859482, -0.012086533010005951, -0.02076190710067749, 0.012246831320226192, -0.014824436977505684, -0.02625053934752941, -0.0030296482145786285, 0.010092414915561676, 0.004340892657637596, -0.0001572932378621772, 0.026904558762907982, 0.03059784322977066, 0.01609400473535061, -0.01783805526793003, 0.01381134893745184, 0.019607754424214363, -0.02977711334824562, 0.01162487268447876, -0.017658520489931107, -0.0047929356805980206, -0.023070210590958595, -0.0033758936915546656, -0.032034121453762054, -0.005866937804967165, 0.02122356742620468, 0.026494193822145462, -0.0006756596267223358, -0.015068091452121735, 0.03175199404358864, -0.009835937060415745, -0.004523633513599634, 0.007226272020488977, -0.006479279138147831, 0.007251919712871313, 0.029212862253189087, 0.006492103450000286, 0.00094095419626683, 0.01947951503098011, 0.005514280404895544, 0.038189597427845, 0.014657726511359215, 0.025673463940620422, 0.0123878950253129, -0.020030943676829338, -0.017504634335637093, 0.0067069036886096, 0.04113909602165222, 0.02177499420940876, 0.019735993817448616, 0.03313697874546051, -0.02846907451748848, 0.009592282585799694, -0.004706373903900385, -3.170911440975033e-05, 0.003252463648095727, 0.0022906705271452665, -0.013593342155218124, -0.013875467702746391, -0.00732245109975338, -0.00849583838135004, 0.0021816673688590527, -0.026981500908732414, 0.03524009883403778, 0.01102214865386486, -0.04367822781205177, 0.04113909602165222, -0.011605636216700077, -0.02387811616063118, 0.001423453795723617, -0.0124456025660038, 0.026045355945825577, 0.00038912546006031334, -0.016158124431967735, -0.008765140548348427, 0.010489956475794315, 0.013926764018833637, 0.02242901362478733, 0.02680196613073349, 0.026648079976439476, 0.0013144505210220814, -0.02215971238911152, 0.01195188146084547, -0.005806024186313152, 0.02049260400235653, 0.02813565358519554, 0.0030280451755970716, 0.009996236301958561, 0.032008472830057144, -0.0005602444871328771, 0.025801701471209526, -0.0050077359192073345, 0.006030442658811808, -0.029854057356715202, -0.033726878464221954, 0.030700433999300003, 0.01636330597102642, 0.007136504631489515, 0.0009497706778347492, 0.010650255717337132, 0.005947086960077286, 0.0014218507567420602, -0.0025295158848166466, 0.005386041011661291, 0.005879761651158333, 0.005065443459898233, -0.0017103886930271983, -0.010740022175014019, 0.013888292014598846, 0.0017087856540456414, 0.013901115395128727, -0.014298656955361366, 0.014632078818976879, -0.0013152520405128598, 0.01088749710470438, 0.014657726511359215, 0.04152381420135498, 0.009220389649271965, -0.009739757515490055, 0.004190211649984121, 0.02010788768529892, 0.003641989780589938, 0.011002913117408752, 0.030264422297477722, 0.0014106298331171274, -0.006232419051229954, 0.031162096187472343, -0.04367822781205177, 0.012137828394770622, 0.0019989265128970146, 0.04367822781205177, 0.005241772159934044, 0.0015877600526437163, -0.03308568149805069, -0.02185193821787834, -0.03931809961795807, 0.013683109544217587, 0.016850614920258522, 0.046294305473566055, -0.02636595442891121, 0.008611254394054413, 0.0004772898100782186, -0.01528609823435545, 0.0170429740101099, -0.021108152344822884, 0.012375070713460445, 0.040908265858888626, 0.002178461290895939, -0.014824436977505684, -0.6241652369499207, 0.011060620658099651, 0.003898467868566513, 0.02762269787490368, 0.008335540071129799, 0.019005030393600464, 0.015401513315737247, 0.004735227674245834, -0.017555929720401764, 0.003417571308091283, -0.030905617401003838, -0.005780376493930817, -0.019825760275125504, -0.025827350094914436, -0.011656931601464748, -0.012343010865151882, 0.009060090407729149, -0.013631814159452915, 0.0006932925316505134, -0.004026706796139479, 0.0010170962195843458, 0.010451484471559525, -0.037061091512441635, 0.02467319741845131, 0.003359863767400384, -0.009393512271344662, 0.008842084556818008, -0.009374276734888554, 0.0033694817684590816, 0.032906148582696915, -0.029494987800717354, 0.01824842020869255, 0.028674257919192314, 0.00043481061584316194, 0.06247807666659355, -0.037420161068439484, -0.00808547344058752, 0.012003177776932716, 0.0007714381790719926, 0.038317836821079254, -0.01824842020869255, -0.014157594181597233, 0.017478985711932182, 0.0038632021751254797, 0.014632078818976879, 0.00848301500082016, 0.009008795022964478, -0.00803417805582285, -0.028212597593665123, -0.00523215439170599, -0.015337393619120121, 0.005591223947703838, -0.008252184838056564, -0.00035365932853892446, -0.0011693800333887339, 0.014285832643508911, 0.037907470017671585, -0.01317015290260315, 0.008252184838056564, 0.009791053831577301, -0.01066949125379324, 0.01617094688117504, 0.0014074238715693355, -0.03947198763489723, -0.025391336530447006, 0.0039177038706839085, -0.030007943511009216, 0.006011206656694412, 0.030264422297477722, 0.013990882784128189, 0.01781240850687027, 0.008002118207514286, 0.0027779790107160807, -0.004286391194909811, -0.015247626230120659, 0.014298656955361366, 0.024878380820155144, -0.010720786638557911, -0.008624077774584293, 0.0389077365398407, 0.006867202464491129, -0.0067004915326833725, 0.0031819320283830166, -0.007925175130367279, 0.017222508788108826, -0.026160771027207375, 0.002571193501353264, -0.016850614920258522, 0.03267531841993332, -0.0020983119029551744, 0.006738963536918163, -0.023480575531721115, -0.01653001643717289, -0.007341687101870775, 0.0009754184866324067, 0.005389247089624405, -0.03400900214910507, -0.014196066185832024, -0.013029090128839016, -0.008649725466966629, -0.013477927073836327, -0.004385776352137327, -0.003504132851958275, 0.01863313838839531, 0.016542840749025345, -0.001728021539747715, -0.013798524625599384, -0.009387100115418434, 0.032547079026699066, -0.014901380985975266, 0.016222242265939713, 0.00855354592204094, -0.0010683918371796608, 0.012817495502531528, -0.017145564779639244, -0.030059238895773888, 0.018543370068073273, 0.008649725466966629, 0.009117797948420048, -0.00913703441619873, -0.0008495838847011328, -0.018145829439163208, 0.007174976170063019, -0.009964176453649998, 0.027468809857964516, 0.04190852865576744, -0.01177234761416912, -0.014593606814742088, -0.010297597385942936, -0.005402070935815573, -0.02603253163397312, -0.01851772330701351, 0.022057121619582176, -0.004433866124600172, -0.005244978237897158, -0.004603782668709755, 0.027802230790257454, -0.0028933940920978785, -0.005882967729121447, -0.03388076275587082, -0.012772612273693085, -0.0023964678402990103, 0.01549128070473671, -0.01710709184408188, -0.02685326337814331, -0.031700700521469116, -0.021300511434674263, 0.01386264432221651, -0.006389511749148369, 0.011515868827700615, -0.020030943676829338, -0.004392188508063555, 0.0019043502397835255, 0.018543370068073273, -0.027879174798727036, -0.010534839704632759, 0.029982296749949455, -0.009720521979033947, -0.017927823588252068, 0.008265008218586445, -0.0026882116217166185, 0.004933998454362154, -0.023698581382632256, 0.00495964614674449, 0.00581884803250432, 0.006203565280884504, 0.01143251359462738, -0.026673728600144386, 0.004196623805910349, -0.01803041435778141, -0.01289443951100111, -0.011496633291244507, -0.00038251312798820436, 0.030854322016239166, -0.04162640497088432, -0.014734669588506222, -0.013529222458600998, -0.0017007706919685006, -0.003978617489337921, 0.0019139682408422232, 0.006860790774226189, -0.0034400131553411484, -0.012246831320226192, 0.00485705491155386, 0.005591223947703838, 0.008156005293130875, 0.0018225978128612041, 0.007610989268869162, -0.04406294599175453, -0.00976540520787239, 0.001037133508361876, 0.03718933090567589, -0.0040299128741025925, 0.029879704117774963, 0.022082768380641937, 0.009367864578962326, 0.023429278284311295, 0.0268276147544384, 0.015516928397119045, 0.0012367055751383305, 0.019248684868216515, 0.007816171273589134, 0.0280330628156662, -0.012843143194913864, 0.03054654784500599, -0.010098827071487904, 0.02073625847697258, -0.023865291848778725, 0.010695138946175575, -0.0016671080375090241, 0.028263892978429794, -0.0422932468354702, -0.0026481368113309145, -0.014465367421507835, 0.018351010978221893, 0.018569018691778183, 0.010996500961482525, 0.029854057356715202, -0.025237450376152992, 0.025904294103384018, -0.005668167024850845, -0.003053693100810051, 0.007784111890941858, 0.006104180123656988, -0.02283937856554985, 0.02721233107149601, 0.023531870916485786, 0.04198547452688217, 0.020992737263441086, -0.01817147620022297, -0.022313598543405533, 0.018376659601926804, -0.001673519960604608, 0.020236127078533173, 0.03526574745774269, -0.002317921258509159, 0.035368338227272034, -0.008745905011892319, 0.022659845650196075, -0.011714639142155647, -0.007335274945944548, 0.017966294661164284, 0.010836201719939709, -0.02008223906159401, 0.028289539739489555, 0.010111651383340359, 0.03767663985490799, 0.020030943676829338, -0.003904879791662097, 0.010073179379105568, -0.004741639830172062, 0.01783805526793003, -0.017658520489931107, 0.0014474985655397177, 0.025660639628767967, -0.02109532803297043, 0.01647872105240822, 0.018697258085012436, 0.02199300192296505, -0.006068914197385311, 0.010804141871631145, 5.4752075811848044e-05, -0.005065443459898233, -0.008489427156746387, -0.003952969331294298, 0.008265008218586445, -0.0063734822906553745, -0.005376423243433237, -0.006488897372037172, -0.01193905808031559, -0.020454132929444313, -0.0025535605382174253, 0.011195271275937557, -0.01824842020869255, 0.002313112374395132, -0.002526309806853533, 0.019582107663154602, 0.0103296572342515, 0.016876261681318283, 0.0069505576975643635, -0.016658255830407143, -0.04642254486680031, 0.01819712482392788, 0.014555134810507298, -0.013836996629834175, -0.013311215676367283, -0.015555399470031261, 0.004687138367444277, -0.0011188859352841973, 0.025724759325385094, -0.009393512271344662, 0.012189123779535294, 0.00913703441619873, -0.006280508823692799, -0.026673728600144386, -0.040472254157066345, 0.04385776445269585, 0.0029655287507921457, 0.016158124431967735, -0.011252978816628456, -0.008547134697437286, 0.00014627269410993904, -0.03126468509435654, -0.016863439232110977, 0.02450648695230484, 0.0014042179100215435, -0.024275656789541245, -0.012727728113532066, 0.0067261396907269955, -0.03149551525712013, -0.017658520489931107, -0.012746964581310749, -0.01844077929854393, -0.002725080354139209, 0.01701732538640499, 0.00046045842464081943, 0.0011389233404770494, 0.005652137100696564, -0.0022922735661268234, 0.013426631689071655, -0.023070210590958595, 0.0029206450562924147, -0.02122356742620468, 0.013990882784128189, 0.051295630633831024, -0.002263419795781374, 0.012516133487224579, 0.023749876767396927, -0.004058766644448042, -0.022069944068789482, -0.016427425667643547, -0.04067743569612503, 0.0020037356298416853, -0.02687891013920307, 0.016760846599936485, 0.02097991295158863, -0.01565799117088318, 0.009367864578962326, 0.008457367308437824, -0.009810289368033409, 0.00064119539456442, -0.0012631549034267664, -0.004818583372980356, 0.009124210104346275, -0.0033342160750180483, -0.00945121981203556, 0.0035233686212450266, 0.034983620047569275, 0.021787818521261215, 0.0063029504381120205, 0.005504662171006203, 0.018530545756220818, 0.008515074849128723, -0.015042443759739399, 0.016683904454112053, -0.005200094543397427, 0.006309362594038248, 0.012932910583913326, -0.03313697874546051, 0.00690567446872592, 0.004004265181720257, 0.007687932811677456, 0.015106563456356525, 0.006944146007299423, 0.006751787383109331, 0.013978059403598309, -0.0012134622083976865, 0.018338188529014587, 0.00290942401625216, -0.036317307502031326, -0.017735464498400688, 0.025776054710149765, -0.012541781179606915, 0.005456572864204645, 0.02677631936967373, -0.0075212218798696995, -0.021518517285585403, -0.009951352141797543, 0.02117227204144001, -0.02844342775642872, -0.01742769032716751, -0.009771817363798618, -0.007130092475563288, -0.006956969853490591, -0.0021928881760686636, -0.009117797948420048, 0.04024142026901245, 0.011028560809791088, -0.009188329800963402, 0.009803877212107182, -0.012157064862549305, 0.013144505210220814, -0.027827879413962364, 0.006158681586384773, 0.01808170974254608, -0.003053693100810051, -0.01570928655564785, 0.02008223906159401, 0.02005659230053425, 0.008470190688967705, 0.013734404928982258, 0.01803041435778141, 0.004164563957601786, 0.02248031087219715, -0.007886703126132488, -0.025827350094914436, 0.005828465800732374, -0.027109740301966667, 0.003908085636794567, 0.0014739478938281536, 0.005014148075133562, 0.018722904846072197, -0.012343010865151882, -0.003975411411374807, 0.0037285510916262865, 0.01290726289153099, 0.013311215676367283, -0.025314394384622574, 0.012862379662692547, 0.018094534054398537, 0.013125269673764706, -0.02109532803297043, 0.006969793699681759, 0.007604577112942934, 0.00913703441619873, -0.026494193822145462, -0.04739716276526451, -0.0019684697035700083, -0.0026465340051800013, 0.01991552859544754, 0.010509192012250423, 0.01890243962407112, 0.0015268465504050255, -0.01906915009021759, 0.015324569307267666, -0.007354510948061943, 0.005671373102813959, 0.008047002367675304, 0.016376130282878876, 0.005898997653275728, 0.00602403050288558, 0.016324834898114204, -0.005863731727004051, -0.016209419816732407, -0.01663260906934738, -0.03898467868566513, 0.003757404861971736, 0.005161623004823923, -0.03570175915956497, 0.005286655854433775, -0.0159529410302639, -0.033675581216812134, 0.019171742722392082, -0.011143975891172886, 0.012310951016843319, 0.003398335538804531, -0.025288745760917664, -0.031982824206352234, -0.02226230315864086, -0.010451484471559525, 0.010060355067253113, 0.000687682069838047, -0.010207829996943474, 0.010393776930868626, -0.011887762695550919, 0.003712521167472005, 0.013234272599220276, 0.01204806100577116, 0.0008095091907307506, -0.015170683152973652, -0.010432248935103416, -0.011727463454008102, -0.007405806798487902, 0.004783317446708679, 0.014157594181597233, -0.0032332276459783316, -0.00033442347194068134, 0.002125562634319067, 0.01301626581698656, -0.03439372032880783, -0.023403631523251534, -0.027956118807196617, 0.015273273922502995, 0.034137241542339325, 0.022826556116342545, -0.0058380840346217155, -0.005402070935815573, 0.015132211148738861, -0.002184873213991523, -0.008976735174655914, -0.021082503721117973, 0.017914999276399612, 0.0019380130106583238, -0.012054473161697388, 0.01679931953549385, 0.0321367122232914, 0.017825230956077576, 0.015606695786118507, -0.009028030559420586, 0.025622166693210602, -0.0034143654629588127, 0.004603782668709755, -0.017581576481461525, -0.043780822306871414, 0.03146987035870552, 0.00849583838135004, 0.009265272878110409, -0.012131416238844395, -0.029956648126244545, -0.025699110701680183, 0.0003143860958516598, 0.004606988746672869, 0.013234272599220276, 0.013144505210220814, -0.0016150109004229307, -0.01508091576397419, 0.04144686833024025, -0.0027026385068893433, 0.0033630698453634977, 0.0028901882469654083, -0.016671080142259598, -0.010868261568248272, 0.023159977048635483, 0.019376924261450768, 0.002813244704157114, -0.01487573329359293, -0.0036580197047442198, 0.0020502221304923296, -0.0034239832311868668, 0.003792670788243413, -0.014747493900358677, -0.02363446168601513, 0.008297068066895008, -0.01025912631303072, 0.005453366786241531, -0.03670202195644379, -0.006732551380991936, -0.02131333388388157, 0.013644637539982796, 0.009111386723816395, -0.006453631445765495, 0.016876261681318283, -0.021467221900820732, -0.0008095091907307506, 0.019979648292064667, -0.014247361570596695, 0.013798524625599384, 0.004119680263102055, 0.025481104850769043, 0.03221365436911583, -0.013503574766218662, -0.018812673166394234, -0.014452544040977955, -0.009348629042506218, 0.006110591813921928, 0.0030360601376742125, 0.03380382061004639, -0.0034207773860543966, -0.006094561889767647, -0.008906204253435135, -0.0064055416733026505, -0.024852732196450233, -0.040831319987773895, 0.011406865902245045, 0.014144769869744778, 0.01906915009021759, 0.005927851423621178, -0.004164563957601786, -0.02844342775642872, 0.0021063268650323153, -0.019825760275125504, -0.0082778325304389, -0.024788612499833107, -0.02305738627910614, -0.016889085993170738, 0.03759969770908356, -0.010361717082560062, 0.0070210895501077175, 0.008919027633965015, -0.005533515941351652, -0.019376924261450768, -0.007431454490870237, -0.017850879579782486, -0.009316569194197655, 0.007277567405253649, 0.03557351976633072, -0.0034656610805541277, 0.016709551215171814, 0.031213391572237015, 0.016401777043938637, -0.022903498262166977, -0.004004265181720257, 0.0027459191624075174, 0.021877586841583252, 0.008854907937347889, 0.010637431405484676, -0.0053700110875070095, 0.0038183184806257486, 0.013247096911072731, -0.01070796325802803, -0.01609400473535061, -0.03352169319987297, -0.02431412972509861, -0.02726362831890583, 0.017914999276399612, 0.012836731970310211, -0.006783847231417894, -0.008765140548348427, 0.0027330953162163496, -0.0073737469501793385, -0.007098033092916012, -0.007450690492987633, 0.0369841493666172, -0.022659845650196075, -0.03321392089128494, 0.008156005293130875, -0.019787289202213287, 0.004087620414793491, -0.005870143882930279, -0.01677367091178894, 0.017337923869490623, 0.03724062815308571, -0.02327539213001728, 0.0022425807546824217, 0.017966294661164284, 0.027494458481669426, -0.00633180420845747, 0.010701551102101803, 0.019594930112361908, -0.019543634727597237, 0.01674802415072918, 0.001211057766340673, -0.015042443759739399, -0.03272661194205284, 0.007457102183252573, 0.005328333470970392, 0.011374806053936481, -0.01132351066917181, 0.009387100115418434, 0.02571193501353264, 0.001214263727888465, -0.020095063373446465, -0.01378570031374693, 0.020595194771885872, -0.0102719496935606, 0.0032252126839011908, 0.004405012354254723, 0.011124739423394203, 0.010823378339409828, -0.03321392089128494, 0.028751200065016747, 0.008649725466966629, -0.023980706930160522, -0.012599489651620388, 0.010528428480029106, 0.009034442715346813, -0.0015637152828276157, -0.02581452578306198, -0.012099356390535831, -0.020800378173589706, -0.017004501074552536, 0.005831671878695488, -0.018569018691778183, 0.0026914176996797323, 0.014567959122359753, 0.015375865623354912, -0.0216339323669672, 0.0015236404724419117, -0.009944939985871315, -0.005148798692971468, -0.010528428480029106, -0.00961793027818203, -0.02431412972509861, -0.02392941154539585, -0.020043767988681793, 0.030367013067007065, -0.01183005515486002, -0.01036812923848629, -0.02049260400235653, -0.013965235091745853, -0.06406824290752411, -0.02226230315864086, -0.01892808824777603, 0.0340859480202198, 0.01732509955763817, 0.008681785315275192, -0.005565575789660215, 0.03326521813869476, 0.009528163820505142, 0.020697787404060364, -0.02898203209042549, 0.013157329522073269, -0.0335986390709877, 0.004238301422446966, 0.021928882226347923, -0.00012423160660546273, -0.04934639483690262, -0.0031723142601549625, -0.009528163820505142, -0.019761642441153526, 0.006040060427039862, 0.03570175915956497, -0.03434242308139801, 0.008431719616055489, 0.006081738043576479, 0.0076238131150603294, -0.0019620577804744244, -0.019953999668359756, 0.018735729157924652, -0.02395506016910076, 0.018953735008835793, 0.028571665287017822, -0.0041100624948740005, -0.017850879579782486, 0.008040590211749077, 0.009669226594269276, 0.005289861932396889, 0.0024365424178540707, 0.006004794966429472, -0.012092945165932178, -0.011701815761625767, -0.00475446367636323, -0.0017664933111518621, 0.004039531107991934, -0.01904350332915783, 0.019146094098687172, 0.02757140062749386, -0.010009059682488441, 0.013388159684836864, 0.019710345193743706, -0.01713274046778679, -0.003061707830056548, 0.035778701305389404, -0.04557616636157036, 0.036317307502031326, -0.032470133155584335, 0.011400453746318817, -0.003895262023434043, 0.0007542060920968652, -0.009188329800963402, -0.0003750993055291474, -0.032880499958992004, 0.015824701637029648, -0.00026168787735514343, -0.019184565171599388, 0.011099091731011868, 0.02185193821787834, -0.03406029939651489, 0.0008051009499467909, 0.006495309062302113, 0.03644554689526558, -0.024762965738773346, 0.014606431126594543, 0.0028372895903885365, 0.019376924261450768, -0.0369841493666172, 0.023801172152161598, -0.003930527716875076, 0.001532456954009831, 0.018710080534219742, 0.22241784632205963, -0.0005089488113299012, -0.024173066020011902, 0.020992737263441086, 0.0025022649206221104, 0.016324834898114204, -0.0007798539008945227, 0.018145829439163208, -0.01088749710470438, 0.011349158361554146, -0.025224626064300537, 0.00471919821575284, -0.014837261289358139, -0.011143975891172886, 0.012753375805914402, -0.014196066185832024, -0.012490485794842243, -0.0502697192132473, -0.032059770077466965, -0.011259390972554684, -0.011522280983626842, 0.021326158195734024, -0.032521430402994156, -0.003449631156399846, -0.0016446661902591586, 0.0006171505665406585, 0.01427300926297903, -0.02131333388388157, 0.03739451617002487, 0.02496814727783203, -0.02849472314119339, -0.040010590106248856, 0.0012759787496179342, 0.016055531799793243, -0.01526044961065054, -0.0009489691583439708, -0.00965640228241682, -0.00516482861712575, 0.01953081041574478, 0.0263403058052063, -0.009079326875507832, 0.015991412103176117, -0.007200624328106642, 0.00345604307949543, 0.011470985598862171, -0.014208889566361904, 0.004296008963137865, -0.008752317167818546, -0.042549725621938705, 0.009047267027199268, -0.013965235091745853, -0.030700433999300003, 0.00116296811029315, -0.004215859808027744, -0.0037734347861260176, -0.021403102204203606, -0.006687667686492205, -0.01549128070473671, -0.031187742948532104, 0.0035169566981494427, 0.015029619447886944, 0.021018384024500847, -0.010990088805556297, 0.030777378007769585, -0.036317307502031326, 0.00690567446872592, -0.012009589932858944, -0.005597635637968779, -0.006662019994109869, 0.0056457254104316235, -0.013529222458600998, -0.013452279381453991, -0.014567959122359753, 0.000469675607746467, -0.0006712513859383762, -0.02112097665667534, 0.021441573277115822, 0.011817230843007565, 0.03180329129099846, 0.030777378007769585, -6.296738865785301e-05, 0.0011204889742657542, 0.014619254507124424, 0.00701467739418149, 0.010900321416556835, -0.018120180815458298, 0.020864497870206833, 0.010566899552941322, 0.021954528987407684, -0.019735993817448616, -0.01057331170886755, -0.016671080142259598, -0.01173387560993433, -0.003757404861971736, -0.005571987945586443, 0.006572252605110407, 0.02844342775642872, -0.006790258921682835, -0.017068620771169662, -0.01576058194041252, 0.0014827643753960729, 0.0432678647339344, 0.010663079097867012, -0.006049678195267916, -0.013747229240834713, -0.02636595442891121, 0.026596784591674805, 0.020454132929444313, 0.006492103450000286, -0.019030679017305374, 0.02024894952774048, -0.008047002367675304, 0.009265272878110409, -0.013298392295837402, 0.0017969500040635467, 0.004353716503828764, 0.010393776930868626, -0.024352600798010826, -0.015465633012354374, 0.005575194023549557, 0.00037850564694963396, -0.028571665287017822, -0.013400983065366745, -0.0008107114117592573, 0.010810554027557373, -0.006629960145801306, -0.006376687902957201, 0.0015565018402412534, -0.009079326875507832, -0.05416818708181381, 0.017094269394874573, 0.006360657978802919, 0.02037718892097473, -0.012644372880458832, 0.004696756135672331, -0.0018370248144492507, 0.007790524046868086, -0.04026706889271736, -0.020992737263441086, 0.013516399078071117, -0.003204373875632882, -0.009374276734888554, 0.01163769606500864, 0.009079326875507832, 0.016376130282878876, -0.02445519156754017, 0.01077849417924881, 0.00878437701612711, -0.019107623025774956, -0.01322144828736782, -0.03606082871556282, -0.0012831923086196184, -0.006719727534800768, -0.0068479664623737335, 0.01885114423930645, -0.00838683545589447, -0.046294305473566055, -0.04193417727947235, 0.03554787114262581, -0.010489956475794315, -0.02846907451748848, -0.03313697874546051, 0.02841777913272381, -0.00011802002700278535, -0.007886703126132488, -0.0008239360759034753, -0.15993978083133698, 0.01931280456483364, 0.02568628638982773, -0.005427719093859196, 0.020120710134506226, -0.011592812836170197, 0.025147682055830956, -0.007662284653633833, -0.016324834898114204, 0.0033117742277681828, 0.02407047525048256, -0.008867732249200344, -0.013734404928982258, -0.013644637539982796, 0.008027765899896622, -0.00472560990601778, -0.008675373159348965, 0.011060620658099651, 0.026930205523967743, -0.0009666020632721484, 0.04262666776776314, 0.00831630453467369, 0.012997030280530453, -0.002125562634319067, -0.0008656137506477535, 0.012913675047457218, -0.02404482662677765, 0.018710080534219742, 0.002511882921680808, -0.014529487118124962, -0.019517987966537476, 0.002712256507948041, 0.008713845163583755, -0.01173387560993433, 0.024326952174305916, 0.01487573329359293, 0.018645960837602615, 0.027391865849494934, -0.010143711231648922, 0.028289539739489555, 0.011355570517480373, 0.00188190839253366, 0.018915263935923576, 0.00162703322712332, 0.012811083346605301, 0.024326952174305916, 0.007290391251444817, 0.0002606860070955008, 0.01174669899046421, 0.0056906091049313545, 0.006129827816039324, -0.023172801360487938, 0.040036238729953766, 0.009592282585799694, 0.0019332041265442967, -0.0019588519353419542, -0.0020406043622642756, 0.006469661369919777, 0.010195006616413593, 0.017196860164403915, -0.008829260244965553, 0.007239095866680145, -0.0012992221163585782, -0.011554340831935406, -0.01658131182193756, -0.004703168291598558, -0.01846642605960369, -0.0003053692926187068, -0.027520105242729187, -0.017440514639019966, 0.019953999668359756, -5.37001142220106e-05, 0.0326240211725235, -0.008681785315275192, 0.024852732196450233, -0.0004885107045993209, -0.02800741419196129, -0.02885379269719124, 0.009149857796728611, 0.02617359533905983, 0.011176035739481449, 0.03129033371806145, -0.011650520376861095, 0.02259572595357895, 0.0055078682489693165, 0.011086268350481987, 0.014324304647743702, 0.00040936318691819906, 0.02032589353621006, -4.879096013610251e-05, 0.013939587399363518, 0.0018947323551401496, 0.009393512271344662, -0.001361738657578826, -0.005244978237897158, -0.016542840749025345, 0.018133005127310753, -0.008976735174655914, -0.016619784757494926, 0.002410894725471735, 0.026930205523967743, -0.028879439458251, -0.004780111368745565, 0.012913675047457218, 0.01173387560993433, 0.00879720039665699, -0.003795876633375883, 0.021403102204203606, 0.04195982590317726, 0.01159922406077385, -0.02625053934752941, -0.007437866646796465, 0.018299715593457222, 0.006815907079726458, -0.01422171387821436, -0.010951616801321507, -0.010028296150267124, -0.022082768380641937, 0.010387364774942398, 0.02298044227063656, 0.01628636196255684, -0.005289861932396889, 0.01180440653115511, 0.001734433462843299, -0.033367808908224106, -0.0093037448823452, -0.08125227689743042, -0.00660431245341897, 0.023288216441869736, 0.008341952227056026, -0.00133528932929039, 0.004552487283945084, -0.013009854592382908, 0.010605371557176113, -0.009464044123888016, 0.025237450376152992, -0.02324974536895752, -0.025237450376152992, -0.0242884811013937, 0.0025279128458350897, 0.02131333388388157, -0.015388689003884792, 0.019389748573303223, -0.02139027789235115, -0.0031242244876921177, 0.010849026031792164, 0.0042126537300646305, -0.011208095587790012, -0.014824436977505684, -0.039164215326309204, -0.006636372301727533, -0.0054405429400503635, -0.029597578570246696, 0.0031883439514786005, 0.034521959722042084, 0.003305362071841955, 0.006758199539035559, -0.025904294103384018, -0.03321392089128494, -0.016427425667643547, 0.001979690743610263, 0.010348893702030182, 0.00414532795548439, -0.05898997560143471, -0.005873349495232105, -0.015311745926737785, -0.008963911794126034, 0.023839645087718964, 0.00700826570391655, -0.02687891013920307, -0.028315188363194466, -0.029264157637953758, -0.010207829996943474, 0.015439984388649464, 0.00040415345574729145, -0.027391865849494934, 0.007136504631489515, -0.01679931953549385, -0.03967716917395592, 0.0067453752271831036, 0.0054982504807412624, -0.0038119065575301647, -0.02726362831890583, -0.0009762199479155242, -0.017081445083022118, 0.004055560566484928, -0.04072872921824455, -0.0053956592455506325, -0.03095691278576851, 0.019902704283595085, 0.020428484305739403, -0.0007778501603752375, 0.00011190863006049767, 0.0028388926293700933, 0.0022521987557411194, 0.016055531799793243, -0.03064913861453533, 0.021300511434674263, -0.006963382009416819, 0.012169888243079185, -0.05406559631228447, 0.00782899558544159, -0.01619659550487995, -0.02675067074596882, 0.022723963484168053, 0.007636636961251497, 0.01488855667412281, -0.01590164564549923, 0.010246302001178265, -0.014798789285123348, -0.0262248907238245, -0.007348099257797003, 0.010021883994340897, 0.004683932289481163, 0.019569283351302147, -0.04531969130039215, -0.0016911528073251247, 0.024442367255687714, -0.002128768712282181, 0.020018119364976883, 0.01663260906934738, -0.003744581015780568, -0.009989824146032333, 0.00642798375338316, 0.0051359748467803, 0.001605392899364233, -0.025558046996593475, -0.012317363172769547, -0.07786677032709122, 0.024019179865717888, 0.04080567508935928, -0.00414532795548439, -0.018209949135780334, 0.03588129207491875, -0.014170417562127113, -0.022505957633256912, -0.017478985711932182, 0.01565799117088318, -0.0004724808386527002, 0.010906733572483063, -0.029494987800717354, -0.02772528864443302, -0.02576323039829731, -0.029161565005779266, -0.016953205689787865, -0.017517458647489548, 0.012227595783770084, 0.027340570464730263, -0.008444542996585369, -0.008861320093274117, 0.004010677337646484, 0.0016230258625000715, -0.0014955882215872407, -0.0035329866223037243, -0.005591223947703838, 0.024519311264157295, 0.02472449466586113, -0.01844077929854393, 0.033701229840517044, -0.026289010420441628, -0.013708757236599922, -0.01234942302107811, -0.014042179100215435, -0.006072120275348425, 0.0017184036551043391, 0.024788612499833107, -0.013131681829690933, 0.039600227028131485, -0.019812937825918198, 0.009316569194197655, -0.006617136299610138, -0.010156534612178802, -0.004786523524671793, -0.0038856440223753452, -0.014542311429977417, 0.0016406587092205882, 0.012189123779535294, -0.003391923615708947, 0.014721846207976341, 0.0038792320992797613, -0.018351010978221893, -0.019992472603917122, -0.006161887664347887, -0.020890144631266594, 0.018261244520545006, -0.014106298796832561, 0.05570705607533455, -0.042088065296411514, 0.029084622859954834, 0.009502515196800232, 0.01266360841691494, -0.02339080721139908, 0.014375600032508373, 0.013683109544217587, -0.008104709908366203, 0.010310421697795391, -0.014914204366505146, -0.04049789905548096, -0.010522016324102879, -0.016568489372730255, 0.021954528987407684, 0.02687891013920307, 0.02289067581295967, 0.02303173765540123, -0.007136504631489515, -0.004687138367444277, -0.01549128070473671, -0.0033726876135915518, 0.021454397588968277, -0.028392132371664047, -0.026519840583205223, 0.008643313311040401, -0.013708757236599922, 0.026571135967969894, -0.004190211649984121, -0.017876526340842247, -0.005636107176542282, 0.004555693361908197, -0.010624607093632221, 0.0009818304097279906, -0.004337686579674482, 0.006165093742311001, 0.020146358758211136, 0.01358051784336567, 0.037522751837968826, -0.0025006618816405535, -0.010002647526562214, 0.019594930112361908, 0.032854851335287094, -0.007277567405253649, -0.0012134622083976865, -0.03221365436911583, -0.005373217165470123, 0.013285567983984947, -0.013195800594985485, -0.03690720722079277, -0.012105768546462059, 0.0006127423257566988, -0.004199829883873463, -0.011445337906479836, 0.03775358572602272, 0.017914999276399612, 0.003895262023434043, 0.02341645583510399, 0.013349687680602074, -0.012939322739839554, -0.024788612499833107, 0.018979383632540703, -0.004094032570719719, 0.0035265746992081404, 0.017312275245785713, -0.025852996855974197, 0.017632873728871346, 0.012900850735604763, 0.012766200117766857, -0.007957234978675842, 0.01066949125379324, -0.0021111357491463423, -0.017799584195017815, 0.013311215676367283, -0.01658131182193756, -0.020197654142975807, -0.01568363979458809, -0.009322980418801308, 0.013182977214455605, 0.007399394642561674, -0.02595558948814869, 0.08520204573869705, 0.02158263698220253, -0.00304567813873291, 0.017337923869490623, 0.0023788348771631718, 0.0205438993871212, -0.004433866124600172, -0.019056327641010284, -0.03603518009185791, 0.0011285038199275732, -0.02436542510986328, 0.002319524297490716, 0.016465896740555763, -0.0006492102984338999, -0.030341366305947304, 0.005020559765398502, 0.015427161008119583, 0.02136462926864624, -0.04111344739794731, -0.014529487118124962, 0.010675903409719467, -0.02363446168601513, -0.024160241708159447, 0.011887762695550919, -0.010522016324102879, 0.0012246831320226192, -0.008720257319509983, 0.012811083346605301, -0.022416191175580025, -0.001428262679837644, -0.0059502930380403996, 0.0034592491574585438, -0.030238773673772812, -0.03134163096547127, 0.011086268350481987, -0.0016927558463066816, -0.01508091576397419, 0.03323956951498985, 0.024762965738773346, 0.007873878814280033, 0.008130357600748539, 0.02242901362478733, -0.022762436419725418, -0.020864497870206833, 0.0029655287507921457, -0.02395506016910076, -0.003924115560948849, -0.01149022113531828, -0.007598165422677994]}, "text_id_to_doc_id": {"8ba9a62b-7f42-4205-ba1c-15ed4a920312": "66334fd4-64ab-48cd-a8fc-cfce16148644"}}}}}
|
locale/en_US.json
CHANGED
|
@@ -44,7 +44,7 @@
|
|
| 44 |
"代理地址(示例:http://127.0.0.1:10809)": "Proxy address (example: http://127.0.0.1:10809)",
|
| 45 |
"🔄 设置代理地址": "🔄 Set Proxy Address",
|
| 46 |
"🔙 恢复默认设置": "🔙 Restore Default Settings",
|
| 47 |
-
"川虎Chat 🚀": "
|
| 48 |
"开始实时传输回答……": "Start streaming output...",
|
| 49 |
"Token 计数: ": "Token Count: ",
|
| 50 |
",本次对话累计消耗了 ": ",Total cost for this dialogue is ",
|
|
@@ -64,7 +64,7 @@
|
|
| 64 |
"API key为空,请检查是否输入正确。": "API key is empty, check whether it is entered correctly.",
|
| 65 |
"请输入对话内容。": "Enter the content of the conversation.",
|
| 66 |
"账单信息不适用": "Billing information is not applicable",
|
| 67 |
-
"由Bilibili [土川虎虎虎](https://space.bilibili.com/29125536) 和 [明昭MZhao](https://space.bilibili.com/24807452)开发<br />访问川虎Chat的 [GitHub项目](https://github.com/GaiZhenbiao/ChuanhuChatGPT) 下载最新版脚本": "
|
| 68 |
"切换亮暗色主题": "Switch light/dark theme",
|
| 69 |
"您的IP区域:未知。": "Your IP region: Unknown.",
|
| 70 |
"获取IP地理位置失败。原因:": "Failed to get IP location. Reason: ",
|
|
|
|
| 44 |
"代理地址(示例:http://127.0.0.1:10809)": "Proxy address (example: http://127.0.0.1:10809)",
|
| 45 |
"🔄 设置代理地址": "🔄 Set Proxy Address",
|
| 46 |
"🔙 恢复默认设置": "🔙 Restore Default Settings",
|
| 47 |
+
"川虎Chat 🚀": "MTYB Chat 🤖",
|
| 48 |
"开始实时传输回答……": "Start streaming output...",
|
| 49 |
"Token 计数: ": "Token Count: ",
|
| 50 |
",本次对话累计消耗了 ": ",Total cost for this dialogue is ",
|
|
|
|
| 64 |
"API key为空,请检查是否输入正确。": "API key is empty, check whether it is entered correctly.",
|
| 65 |
"请输入对话内容。": "Enter the content of the conversation.",
|
| 66 |
"账单信息不适用": "Billing information is not applicable",
|
| 67 |
+
"由Bilibili [土川虎虎虎](https://space.bilibili.com/29125536) 和 [明昭MZhao](https://space.bilibili.com/24807452)开发<br />访问川虎Chat的 [GitHub项目](https://github.com/GaiZhenbiao/ChuanhuChatGPT) 下载最新版脚本": "Official Store: [MTYB Shopee](https://shopee.com.my/mtyb_official)",
|
| 68 |
"切换亮暗色主题": "Switch light/dark theme",
|
| 69 |
"您的IP区域:未知。": "Your IP region: Unknown.",
|
| 70 |
"获取IP地理位置失败。原因:": "Failed to get IP location. Reason: ",
|
modules/__pycache__/__init__.cpython-310.pyc
ADDED
|
Binary file (164 Bytes). View file
|
|
|
modules/__pycache__/base_model.cpython-310.pyc
ADDED
|
Binary file (15.8 kB). View file
|
|
|
modules/__pycache__/config.cpython-310.pyc
ADDED
|
Binary file (3.81 kB). View file
|
|
|
modules/__pycache__/llama_func.cpython-310.pyc
ADDED
|
Binary file (4.85 kB). View file
|
|
|
modules/__pycache__/models.cpython-310.pyc
ADDED
|
Binary file (16.5 kB). View file
|
|
|
modules/__pycache__/overwrites.cpython-310.pyc
ADDED
|
Binary file (4.08 kB). View file
|
|
|
modules/__pycache__/pdf_func.cpython-310.pyc
ADDED
|
Binary file (6.15 kB). View file
|
|
|
modules/__pycache__/presets.cpython-310.pyc
ADDED
|
Binary file (6.4 kB). View file
|
|
|
modules/__pycache__/shared.cpython-310.pyc
ADDED
|
Binary file (2.21 kB). View file
|
|
|
modules/__pycache__/utils.cpython-310.pyc
ADDED
|
Binary file (17.9 kB). View file
|
|
|
modules/__pycache__/webui_locale.cpython-310.pyc
ADDED
|
Binary file (1.11 kB). View file
|
|
|
modules/base_model.py
CHANGED
|
@@ -169,11 +169,12 @@ class BaseLLMModel:
|
|
| 169 |
return chatbot, status_text
|
| 170 |
|
| 171 |
def handle_file_upload(self, files, chatbot):
|
|
|
|
| 172 |
"""if the model accepts multi modal input, implement this function"""
|
| 173 |
status = gr.Markdown.update()
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
return gr.Files.update(), chatbot, status
|
| 178 |
|
| 179 |
def prepare_inputs(self, real_inputs, use_websearch, files, reply_language, chatbot):
|
|
@@ -181,61 +182,63 @@ class BaseLLMModel:
|
|
| 181 |
display_append = []
|
| 182 |
limited_context = False
|
| 183 |
fake_inputs = real_inputs
|
| 184 |
-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 194 |
)
|
| 195 |
-
|
| 196 |
-
msg = "加载索引中……"
|
| 197 |
-
logging.info(msg)
|
| 198 |
-
# yield chatbot + [(inputs, "")], msg
|
| 199 |
-
index = construct_index(self.api_key, file_src=files)
|
| 200 |
-
assert index is not None, "获取索引失败"
|
| 201 |
-
msg = "索引获取成功,生成回答中……"
|
| 202 |
-
logging.info(msg)
|
| 203 |
-
if local_embedding or self.model_type != ModelType.OpenAI:
|
| 204 |
-
embed_model = LangchainEmbedding(HuggingFaceEmbeddings())
|
| 205 |
-
else:
|
| 206 |
-
embed_model = OpenAIEmbedding()
|
| 207 |
-
# yield chatbot + [(inputs, "")], msg
|
| 208 |
-
with retrieve_proxy():
|
| 209 |
-
prompt_helper = PromptHelper(
|
| 210 |
-
max_input_size=4096,
|
| 211 |
-
num_output=5,
|
| 212 |
-
max_chunk_overlap=20,
|
| 213 |
-
chunk_size_limit=600,
|
| 214 |
-
)
|
| 215 |
-
from llama_index import ServiceContext
|
| 216 |
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
)
|
| 227 |
-
query_bundle = QueryBundle(real_inputs)
|
| 228 |
-
nodes = query_object.retrieve(query_bundle)
|
| 229 |
-
reference_results = [n.node.text for n in nodes]
|
| 230 |
-
reference_results = add_source_numbers(reference_results, use_source=False)
|
| 231 |
-
display_append = add_details(reference_results)
|
| 232 |
-
display_append = "\n\n" + "".join(display_append)
|
| 233 |
-
real_inputs = (
|
| 234 |
-
replace_today(PROMPT_TEMPLATE)
|
| 235 |
-
.replace("{query_str}", real_inputs)
|
| 236 |
-
.replace("{context_str}", "\n\n".join(reference_results))
|
| 237 |
-
.replace("{reply_language}", reply_language)
|
| 238 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 239 |
elif use_websearch:
|
| 240 |
limited_context = True
|
| 241 |
search_results = ddg(real_inputs, max_results=5)
|
|
@@ -245,10 +248,11 @@ class BaseLLMModel:
|
|
| 245 |
domain_name = urllib3.util.parse_url(result["href"]).host
|
| 246 |
reference_results.append([result["body"], result["href"]])
|
| 247 |
display_append.append(
|
| 248 |
-
f"{idx+1}. [{domain_name}]({result['href']})\n"
|
|
|
|
| 249 |
)
|
| 250 |
reference_results = add_source_numbers(reference_results)
|
| 251 |
-
display_append = "\n\n" + "".join(display_append)
|
| 252 |
real_inputs = (
|
| 253 |
replace_today(WEBSEARCH_PTOMPT_TEMPLATE)
|
| 254 |
.replace("{query}", real_inputs)
|
|
@@ -463,9 +467,9 @@ class BaseLLMModel:
|
|
| 463 |
|
| 464 |
def set_key(self, new_access_key):
|
| 465 |
self.api_key = new_access_key.strip()
|
| 466 |
-
msg =
|
| 467 |
logging.info(msg)
|
| 468 |
-
return
|
| 469 |
|
| 470 |
def set_single_turn(self, new_single_turn):
|
| 471 |
self.single_turn = new_single_turn
|
|
|
|
| 169 |
return chatbot, status_text
|
| 170 |
|
| 171 |
def handle_file_upload(self, files, chatbot):
|
| 172 |
+
print(files)
|
| 173 |
"""if the model accepts multi modal input, implement this function"""
|
| 174 |
status = gr.Markdown.update()
|
| 175 |
+
construct_index(self.api_key, file_src=files)
|
| 176 |
+
status = "索引构建完成"
|
| 177 |
+
|
| 178 |
return gr.Files.update(), chatbot, status
|
| 179 |
|
| 180 |
def prepare_inputs(self, real_inputs, use_websearch, files, reply_language, chatbot):
|
|
|
|
| 182 |
display_append = []
|
| 183 |
limited_context = False
|
| 184 |
fake_inputs = real_inputs
|
| 185 |
+
|
| 186 |
+
from llama_index.indices.vector_store.base_query import GPTVectorStoreIndexQuery
|
| 187 |
+
from llama_index.indices.query.schema import QueryBundle
|
| 188 |
+
from langchain.embeddings.huggingface import HuggingFaceEmbeddings
|
| 189 |
+
from langchain.chat_models import ChatOpenAI
|
| 190 |
+
from llama_index import (
|
| 191 |
+
GPTSimpleVectorIndex,
|
| 192 |
+
ServiceContext,
|
| 193 |
+
LangchainEmbedding,
|
| 194 |
+
OpenAIEmbedding,
|
| 195 |
+
)
|
| 196 |
+
limited_context = True
|
| 197 |
+
msg = "加载索引中……"
|
| 198 |
+
logging.info(msg)
|
| 199 |
+
# yield chatbot + [(inputs, "")], msg
|
| 200 |
+
index = construct_index(self.api_key, file_src=files)
|
| 201 |
+
assert index is not None, "获取索引失败"
|
| 202 |
+
msg = "索引获取成功,生成回答中……"
|
| 203 |
+
logging.info(msg)
|
| 204 |
+
if local_embedding or self.model_type != ModelType.OpenAI:
|
| 205 |
+
embed_model = LangchainEmbedding(HuggingFaceEmbeddings())
|
| 206 |
+
else:
|
| 207 |
+
embed_model = OpenAIEmbedding()
|
| 208 |
+
# yield chatbot + [(inputs, "")], msg
|
| 209 |
+
with retrieve_proxy():
|
| 210 |
+
prompt_helper = PromptHelper(
|
| 211 |
+
max_input_size=4096,
|
| 212 |
+
num_output=5,
|
| 213 |
+
max_chunk_overlap=20,
|
| 214 |
+
chunk_size_limit=600,
|
| 215 |
)
|
| 216 |
+
from llama_index import ServiceContext
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 217 |
|
| 218 |
+
service_context = ServiceContext.from_defaults(
|
| 219 |
+
prompt_helper=prompt_helper, embed_model=embed_model
|
| 220 |
+
)
|
| 221 |
+
query_object = GPTVectorStoreIndexQuery(
|
| 222 |
+
index.index_struct,
|
| 223 |
+
service_context=service_context,
|
| 224 |
+
similarity_top_k=5,
|
| 225 |
+
vector_store=index._vector_store,
|
| 226 |
+
docstore=index._docstore,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 227 |
)
|
| 228 |
+
query_bundle = QueryBundle(real_inputs)
|
| 229 |
+
nodes = query_object.retrieve(query_bundle)
|
| 230 |
+
reference_results = [n.node.text for n in nodes]
|
| 231 |
+
reference_results = add_source_numbers(reference_results, use_source=False)
|
| 232 |
+
display_append = add_details(reference_results)
|
| 233 |
+
display_append = "\n\n" + "".join(display_append)
|
| 234 |
+
real_inputs = (
|
| 235 |
+
replace_today(PROMPT_TEMPLATE)
|
| 236 |
+
.replace("{query_str}", real_inputs)
|
| 237 |
+
.replace("{context_str}", "\n\n".join(reference_results))
|
| 238 |
+
.replace("{reply_language}", reply_language)
|
| 239 |
+
)
|
| 240 |
+
if files:
|
| 241 |
+
print("MIAO MIAO")
|
| 242 |
elif use_websearch:
|
| 243 |
limited_context = True
|
| 244 |
search_results = ddg(real_inputs, max_results=5)
|
|
|
|
| 248 |
domain_name = urllib3.util.parse_url(result["href"]).host
|
| 249 |
reference_results.append([result["body"], result["href"]])
|
| 250 |
display_append.append(
|
| 251 |
+
# f"{idx+1}. [{domain_name}]({result['href']})\n"
|
| 252 |
+
f"<li><a href=\"{result['href']}\" target=\"_blank\">{domain_name}</a></li>\n"
|
| 253 |
)
|
| 254 |
reference_results = add_source_numbers(reference_results)
|
| 255 |
+
display_append = "<ol>\n\n" + "".join(display_append) + "</ol>"
|
| 256 |
real_inputs = (
|
| 257 |
replace_today(WEBSEARCH_PTOMPT_TEMPLATE)
|
| 258 |
.replace("{query}", real_inputs)
|
|
|
|
| 467 |
|
| 468 |
def set_key(self, new_access_key):
|
| 469 |
self.api_key = new_access_key.strip()
|
| 470 |
+
msg = i18n("API密钥更改为了") + hide_middle_chars(self.api_key)
|
| 471 |
logging.info(msg)
|
| 472 |
+
return self.api_key, msg
|
| 473 |
|
| 474 |
def set_single_turn(self, new_single_turn):
|
| 475 |
self.single_turn = new_single_turn
|
modules/config.py
CHANGED
|
@@ -31,10 +31,8 @@ if os.path.exists("config.json"):
|
|
| 31 |
config = json.load(f)
|
| 32 |
else:
|
| 33 |
config = {}
|
| 34 |
-
|
| 35 |
-
language = config.get("language", "auto")
|
| 36 |
-
language = os.environ.get("LANGUAGE", language)
|
| 37 |
-
|
| 38 |
|
| 39 |
if os.path.exists("api_key.txt"):
|
| 40 |
logging.info("检测到api_key.txt文件,正在进行迁移...")
|
|
@@ -67,7 +65,7 @@ if os.environ.get("dockerrun") == "yes":
|
|
| 67 |
|
| 68 |
## 处理 api-key 以及 允许的用户列表
|
| 69 |
my_api_key = config.get("openai_api_key", "") # 在这里输入你的 API 密钥
|
| 70 |
-
my_api_key = os.environ.get("
|
| 71 |
|
| 72 |
## 多账户机制
|
| 73 |
multi_api_key = config.get("multi_api_key", False) # 是否开启多账户机制
|
|
|
|
| 31 |
config = json.load(f)
|
| 32 |
else:
|
| 33 |
config = {}
|
| 34 |
+
|
| 35 |
+
language = config.get("language", "auto")
|
|
|
|
|
|
|
| 36 |
|
| 37 |
if os.path.exists("api_key.txt"):
|
| 38 |
logging.info("检测到api_key.txt文件,正在进行迁移...")
|
|
|
|
| 65 |
|
| 66 |
## 处理 api-key 以及 允许的用户列表
|
| 67 |
my_api_key = config.get("openai_api_key", "") # 在这里输入你的 API 密钥
|
| 68 |
+
my_api_key = os.environ.get("my_api_key", my_api_key)
|
| 69 |
|
| 70 |
## 多账户机制
|
| 71 |
multi_api_key = config.get("multi_api_key", False) # 是否开启多账户机制
|
modules/llama_func.py
CHANGED
|
@@ -103,7 +103,7 @@ def construct_index(
|
|
| 103 |
max_chunk_overlap=20,
|
| 104 |
chunk_size_limit=600,
|
| 105 |
embedding_limit=None,
|
| 106 |
-
separator="
|
| 107 |
):
|
| 108 |
from langchain.chat_models import ChatOpenAI
|
| 109 |
from langchain.embeddings.huggingface import HuggingFaceEmbeddings
|
|
@@ -123,10 +123,13 @@ def construct_index(
|
|
| 123 |
num_output=num_outputs,
|
| 124 |
max_chunk_overlap=max_chunk_overlap,
|
| 125 |
embedding_limit=embedding_limit,
|
| 126 |
-
chunk_size_limit=
|
| 127 |
separator=separator,
|
| 128 |
)
|
| 129 |
-
|
|
|
|
|
|
|
|
|
|
| 130 |
if os.path.exists(f"./index/{index_name}.json"):
|
| 131 |
logging.info("找到了缓存的索引文件,加载中……")
|
| 132 |
return GPTSimpleVectorIndex.load_from_disk(f"./index/{index_name}.json")
|
|
|
|
| 103 |
max_chunk_overlap=20,
|
| 104 |
chunk_size_limit=600,
|
| 105 |
embedding_limit=None,
|
| 106 |
+
separator="###",
|
| 107 |
):
|
| 108 |
from langchain.chat_models import ChatOpenAI
|
| 109 |
from langchain.embeddings.huggingface import HuggingFaceEmbeddings
|
|
|
|
| 123 |
num_output=num_outputs,
|
| 124 |
max_chunk_overlap=max_chunk_overlap,
|
| 125 |
embedding_limit=embedding_limit,
|
| 126 |
+
chunk_size_limit=200,
|
| 127 |
separator=separator,
|
| 128 |
)
|
| 129 |
+
if (file_src == None):
|
| 130 |
+
index_name = "main"
|
| 131 |
+
else:
|
| 132 |
+
index_name = get_index_name(file_src)
|
| 133 |
if os.path.exists(f"./index/{index_name}.json"):
|
| 134 |
logging.info("找到了缓存的索引文件,加载中……")
|
| 135 |
return GPTSimpleVectorIndex.load_from_disk(f"./index/{index_name}.json")
|
modules/presets.py
CHANGED
|
@@ -12,7 +12,7 @@ LLAMA_MODEL = None
|
|
| 12 |
LLAMA_INFERENCER = None
|
| 13 |
|
| 14 |
# ChatGPT 设置
|
| 15 |
-
INITIAL_SYSTEM_PROMPT = "
|
| 16 |
API_HOST = "api.openai.com"
|
| 17 |
COMPLETION_URL = "https://api.openai.com/v1/chat/completions"
|
| 18 |
BALANCE_API_URL="https://api.openai.com/dashboard/billing/credit_grants"
|
|
@@ -36,13 +36,13 @@ BILLING_NOT_APPLICABLE_MSG = i18n("账单信息不适用") # 本地运行的模
|
|
| 36 |
TIMEOUT_STREAMING = 60 # 流式对话时的超时时间
|
| 37 |
TIMEOUT_ALL = 200 # 非流式对话时的超时时间
|
| 38 |
ENABLE_STREAMING_OPTION = True # 是否启用选择选择是否实时显示回答的勾选框
|
| 39 |
-
HIDE_MY_KEY =
|
| 40 |
CONCURRENT_COUNT = 100 # 允许同时使用的用户数量
|
| 41 |
|
| 42 |
SIM_K = 5
|
| 43 |
INDEX_QUERY_TEMPRATURE = 1.0
|
| 44 |
|
| 45 |
-
CHUANHU_TITLE = i18n("
|
| 46 |
|
| 47 |
CHUANHU_DESCRIPTION = i18n("由Bilibili [土川虎虎虎](https://space.bilibili.com/29125536) 和 [明昭MZhao](https://space.bilibili.com/24807452)开发<br />访问川虎Chat的 [GitHub项目](https://github.com/GaiZhenbiao/ChuanhuChatGPT) 下载最新版脚本")
|
| 48 |
|
|
@@ -96,8 +96,8 @@ for dir_name in os.listdir("models"):
|
|
| 96 |
MODELS.append(dir_name)
|
| 97 |
|
| 98 |
MODEL_TOKEN_LIMIT = {
|
| 99 |
-
"gpt-3.5-turbo":
|
| 100 |
-
"gpt-3.5-turbo-0301":
|
| 101 |
"gpt-4": 8192,
|
| 102 |
"gpt-4-0314": 8192,
|
| 103 |
"gpt-4-32k": 32768,
|
|
@@ -116,7 +116,7 @@ REPLY_LANGUAGES = [
|
|
| 116 |
"Español",
|
| 117 |
"Français",
|
| 118 |
"Deutsch",
|
| 119 |
-
"
|
| 120 |
]
|
| 121 |
|
| 122 |
|
|
|
|
| 12 |
LLAMA_INFERENCER = None
|
| 13 |
|
| 14 |
# ChatGPT 设置
|
| 15 |
+
INITIAL_SYSTEM_PROMPT = "I want you to act as a document that I am having a conversation with. Your name is \"AI Assistant\". You will provide me with answers from the given info. If the answer is not included, say exactly \"Hmm, I am not sure.\" and stop after that. Refuse to answer any question not about the info. Never break character.Beautify the output and parenthesis () the URL links. Maximum 30 Words"
|
| 16 |
API_HOST = "api.openai.com"
|
| 17 |
COMPLETION_URL = "https://api.openai.com/v1/chat/completions"
|
| 18 |
BALANCE_API_URL="https://api.openai.com/dashboard/billing/credit_grants"
|
|
|
|
| 36 |
TIMEOUT_STREAMING = 60 # 流式对话时的超时时间
|
| 37 |
TIMEOUT_ALL = 200 # 非流式对话时的超时时间
|
| 38 |
ENABLE_STREAMING_OPTION = True # 是否启用选择选择是否实时显示回答的勾选框
|
| 39 |
+
HIDE_MY_KEY = True # 如果你想在UI中隐藏你的 API 密钥,将此值设置为 True
|
| 40 |
CONCURRENT_COUNT = 100 # 允许同时使用的用户数量
|
| 41 |
|
| 42 |
SIM_K = 5
|
| 43 |
INDEX_QUERY_TEMPRATURE = 1.0
|
| 44 |
|
| 45 |
+
CHUANHU_TITLE = i18n("MTYB ChatBot 🤖")
|
| 46 |
|
| 47 |
CHUANHU_DESCRIPTION = i18n("由Bilibili [土川虎虎虎](https://space.bilibili.com/29125536) 和 [明昭MZhao](https://space.bilibili.com/24807452)开发<br />访问川虎Chat的 [GitHub项目](https://github.com/GaiZhenbiao/ChuanhuChatGPT) 下载最新版脚本")
|
| 48 |
|
|
|
|
| 96 |
MODELS.append(dir_name)
|
| 97 |
|
| 98 |
MODEL_TOKEN_LIMIT = {
|
| 99 |
+
"gpt-3.5-turbo": 200,
|
| 100 |
+
"gpt-3.5-turbo-0301": 200,
|
| 101 |
"gpt-4": 8192,
|
| 102 |
"gpt-4-0314": 8192,
|
| 103 |
"gpt-4-32k": 32768,
|
|
|
|
| 116 |
"Español",
|
| 117 |
"Français",
|
| 118 |
"Deutsch",
|
| 119 |
+
"Auto"
|
| 120 |
]
|
| 121 |
|
| 122 |
|
modules/utils.py
CHANGED
|
@@ -451,11 +451,11 @@ Error code: {result.returncode}""")
|
|
| 451 |
result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True, env=os.environ if custom_env is None else custom_env)
|
| 452 |
if result.returncode != 0:
|
| 453 |
message = f"""{errdesc or 'Error running command'}.
|
| 454 |
-
Command: {command}
|
| 455 |
-
Error code: {result.returncode}
|
| 456 |
-
stdout: {result.stdout.decode(encoding="utf8", errors="ignore") if len(result.stdout)>0 else '<empty>'}
|
| 457 |
-
stderr: {result.stderr.decode(encoding="utf8", errors="ignore") if len(result.stderr)>0 else '<empty>'}
|
| 458 |
-
"""
|
| 459 |
raise RuntimeError(message)
|
| 460 |
return result.stdout.decode(encoding="utf8", errors="ignore")
|
| 461 |
|
|
@@ -472,12 +472,8 @@ def versions_html():
|
|
| 472 |
else:
|
| 473 |
commit_info = "unknown \U0001F615"
|
| 474 |
return f"""
|
| 475 |
-
|
| 476 |
-
|
| 477 |
-
Gradio: {gr.__version__}
|
| 478 |
-
•
|
| 479 |
-
Commit: {commit_info}
|
| 480 |
-
"""
|
| 481 |
|
| 482 |
def add_source_numbers(lst, source_name = "Source", use_source = True):
|
| 483 |
if use_source:
|
|
|
|
| 451 |
result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True, env=os.environ if custom_env is None else custom_env)
|
| 452 |
if result.returncode != 0:
|
| 453 |
message = f"""{errdesc or 'Error running command'}.
|
| 454 |
+
Command: {command}
|
| 455 |
+
Error code: {result.returncode}
|
| 456 |
+
stdout: {result.stdout.decode(encoding="utf8", errors="ignore") if len(result.stdout)>0 else '<empty>'}
|
| 457 |
+
stderr: {result.stderr.decode(encoding="utf8", errors="ignore") if len(result.stderr)>0 else '<empty>'}
|
| 458 |
+
"""
|
| 459 |
raise RuntimeError(message)
|
| 460 |
return result.stdout.decode(encoding="utf8", errors="ignore")
|
| 461 |
|
|
|
|
| 472 |
else:
|
| 473 |
commit_info = "unknown \U0001F615"
|
| 474 |
return f"""
|
| 475 |
+
|
| 476 |
+
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
| 477 |
|
| 478 |
def add_source_numbers(lst, source_name = "Source", use_source = True):
|
| 479 |
if use_source:
|
modules/webui_locale.py
CHANGED
|
@@ -9,8 +9,7 @@ class I18nAuto:
|
|
| 9 |
config = json.load(f)
|
| 10 |
else:
|
| 11 |
config = {}
|
| 12 |
-
language = config.get("language", "auto")
|
| 13 |
-
language = os.environ.get("LANGUAGE", language)
|
| 14 |
if language == "auto":
|
| 15 |
language = locale.getdefaultlocale()[0] # get the language code of the system (ex. zh_CN)
|
| 16 |
self.language_map = {}
|
|
|
|
| 9 |
config = json.load(f)
|
| 10 |
else:
|
| 11 |
config = {}
|
| 12 |
+
language = config.get("language", "auto")
|
|
|
|
| 13 |
if language == "auto":
|
| 14 |
language = locale.getdefaultlocale()[0] # get the language code of the system (ex. zh_CN)
|
| 15 |
self.language_map = {}
|