narugo1992 commited on
Commit
0c8e1ea
1 Parent(s): 834d753

dev(narugo): init commit

Browse files
Files changed (5) hide show
  1. .gitignore +1216 -0
  2. app.py +124 -0
  3. character.py +36 -0
  4. huggingface.py +38 -0
  5. requirements.txt +8 -0
.gitignore ADDED
@@ -0,0 +1,1216 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Created by .ignore support plugin (hsz.mobi)
2
+ ### Example user template template
3
+ ### Example user template
4
+
5
+ # IntelliJ project files
6
+ .idea
7
+ *.iml
8
+ out
9
+ gen
10
+ ### CVS template
11
+ /CVS/*
12
+ **/CVS/*
13
+ .cvsignore
14
+ */.cvsignore
15
+
16
+ ### C++ template
17
+ # Prerequisites
18
+ *.d
19
+
20
+ # Compiled Object files
21
+ *.slo
22
+ *.lo
23
+ *.o
24
+ *.obj
25
+
26
+ # Precompiled Headers
27
+ *.gch
28
+ *.pch
29
+
30
+ # Compiled Dynamic libraries
31
+ *.so
32
+ *.dylib
33
+ *.dll
34
+
35
+ # Fortran module files
36
+ *.mod
37
+ *.smod
38
+
39
+ # Compiled Static libraries
40
+ *.lai
41
+ *.la
42
+ *.a
43
+ *.lib
44
+
45
+ # Executables
46
+ *.exe
47
+ *.out
48
+ *.app
49
+
50
+ ### CUDA template
51
+ *.i
52
+ *.ii
53
+ *.gpu
54
+ *.ptx
55
+ *.cubin
56
+ *.fatbin
57
+
58
+ ### SVN template
59
+ .svn/
60
+
61
+ ### Images template
62
+ # JPEG
63
+ *.jpe
64
+ *.jif
65
+ *.jfif
66
+ *.jfi
67
+
68
+ # JPEG 2000
69
+ *.jp2
70
+ *.j2k
71
+ *.jpf
72
+ *.jpx
73
+ *.jpm
74
+ *.mj2
75
+
76
+ # JPEG XR
77
+ *.jxr
78
+ *.hdp
79
+ *.wdp
80
+
81
+ # Graphics Interchange Format
82
+ *.gif
83
+
84
+ # RAW
85
+ *.raw
86
+
87
+ # Web P
88
+ *.webp
89
+
90
+ # Animated Portable Network Graphics
91
+ *.apng
92
+
93
+ # Multiple-image Network Graphics
94
+ *.mng
95
+
96
+ # Tagged Image File Format
97
+ *.tiff
98
+ *.tif
99
+
100
+ # Scalable Vector Graphics
101
+ *.svg
102
+ *.svgz
103
+
104
+ # Portable Document Format
105
+ *.pdf
106
+
107
+ # X BitMap
108
+ *.xbm
109
+
110
+ # BMP
111
+ *.bmp
112
+ *.dib
113
+
114
+ # ICO
115
+ *.ico
116
+
117
+ # 3D Images
118
+ *.3dm
119
+ *.max
120
+
121
+ ### Eclipse template
122
+ .metadata
123
+ bin/
124
+ tmp/
125
+ *.tmp
126
+ *.bak
127
+ *.swp
128
+ *~.nib
129
+ local.properties
130
+ .settings/
131
+ .loadpath
132
+ .recommenders
133
+
134
+ # External tool builders
135
+ .externalToolBuilders/
136
+
137
+ # Locally stored "Eclipse launch configurations"
138
+ *.launch
139
+
140
+ # PyDev specific (Python IDE for Eclipse)
141
+ *.pydevproject
142
+
143
+ # CDT-specific (C/C++ Development Tooling)
144
+ .cproject
145
+
146
+ # CDT- autotools
147
+ .autotools
148
+
149
+ # Java annotation processor (APT)
150
+ .factorypath
151
+
152
+ # PDT-specific (PHP Development Tools)
153
+ .buildpath
154
+
155
+ # sbteclipse plugin
156
+ .target
157
+
158
+ # Tern plugin
159
+ .tern-project
160
+
161
+ # TeXlipse plugin
162
+ .texlipse
163
+
164
+ # STS (Spring Tool Suite)
165
+ .springBeans
166
+
167
+ # Code Recommenders
168
+ .recommenders/
169
+
170
+ # Annotation Processing
171
+ .apt_generated/
172
+ .apt_generated_test/
173
+
174
+ # Scala IDE specific (Scala & Java development for Eclipse)
175
+ .cache-main
176
+ .scala_dependencies
177
+ .worksheet
178
+
179
+ # Uncomment this line if you wish to ignore the project description file.
180
+ # Typically, this file would be tracked if it contains build/dependency configurations:
181
+ #.project
182
+
183
+ ### Diff template
184
+ *.patch
185
+ *.diff
186
+
187
+ ### macOS template
188
+ # General
189
+ .DS_Store
190
+ .AppleDouble
191
+ .LSOverride
192
+
193
+ # Icon must end with two \r
194
+ Icon
195
+
196
+ # Thumbnails
197
+ ._*
198
+
199
+ # Files that might appear in the root of a volume
200
+ .DocumentRevisions-V100
201
+ .fseventsd
202
+ .Spotlight-V100
203
+ .TemporaryItems
204
+ .Trashes
205
+ .VolumeIcon.icns
206
+ .com.apple.timemachine.donotpresent
207
+
208
+ # Directories potentially created on remote AFP share
209
+ .AppleDB
210
+ .AppleDesktop
211
+ Network Trash Folder
212
+ Temporary Items
213
+ .apdisk
214
+
215
+ ### CMake template
216
+ CMakeLists.txt.user
217
+ CMakeCache.txt
218
+ CMakeFiles
219
+ CMakeScripts
220
+ Testing
221
+ cmake_install.cmake
222
+ install_manifest.txt
223
+ compile_commands.json
224
+ CTestTestfile.cmake
225
+ _deps
226
+
227
+ ### Linux template
228
+ *~
229
+
230
+ # temporary files which can be created if a process still has a handle open of a deleted file
231
+ .fuse_hidden*
232
+
233
+ # KDE directory preferences
234
+ .directory
235
+
236
+ # Linux trash folder which might appear on any partition or disk
237
+ .Trash-*
238
+
239
+ # .nfs files are created when an open file is removed but is still being accessed
240
+ .nfs*
241
+
242
+ ### MicrosoftOffice template
243
+ *.tmp
244
+
245
+ # Word temporary
246
+ ~$*.doc*
247
+
248
+ # Word Auto Backup File
249
+ Backup of *.doc*
250
+
251
+ # Excel temporary
252
+ ~$*.xls*
253
+
254
+ # Excel Backup File
255
+ *.xlk
256
+
257
+ # PowerPoint temporary
258
+ ~$*.ppt*
259
+
260
+ # Visio autosave temporary files
261
+ *.~vsd*
262
+
263
+ ### VisualStudio template
264
+ ## Ignore Visual Studio temporary files, build results, and
265
+ ## files generated by popular Visual Studio add-ons.
266
+ ##
267
+ ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
268
+
269
+ # User-specific files
270
+ *.rsuser
271
+ *.suo
272
+ *.user
273
+ *.userosscache
274
+ *.sln.docstates
275
+
276
+ # User-specific files (MonoDevelop/Xamarin Studio)
277
+ *.userprefs
278
+
279
+ # Mono auto generated files
280
+ mono_crash.*
281
+
282
+ # Build results
283
+ [Dd]ebug/
284
+ [Dd]ebugPublic/
285
+ [Rr]elease/
286
+ [Rr]eleases/
287
+ x64/
288
+ x86/
289
+ [Ww][Ii][Nn]32/
290
+ [Aa][Rr][Mm]/
291
+ [Aa][Rr][Mm]64/
292
+ bld/
293
+ [Bb]in/
294
+ [Oo]bj/
295
+ [Ll]og/
296
+ [Ll]ogs/
297
+
298
+ # Visual Studio 2015/2017 cache/options directory
299
+ .vs/
300
+ # Uncomment if you have tasks that create the project's static files in wwwroot
301
+ #wwwroot/
302
+
303
+ # Visual Studio 2017 auto generated files
304
+ Generated\ Files/
305
+
306
+ # MSTest test Results
307
+ [Tt]est[Rr]esult*/
308
+ [Bb]uild[Ll]og.*
309
+
310
+ # NUnit
311
+ *.VisualState.xml
312
+ TestResult.xml
313
+ nunit-*.xml
314
+
315
+ # Build Results of an ATL Project
316
+ [Dd]ebugPS/
317
+ [Rr]eleasePS/
318
+ dlldata.c
319
+
320
+ # Benchmark Results
321
+ BenchmarkDotNet.Artifacts/
322
+
323
+ # .NET Core
324
+ project.lock.json
325
+ project.fragment.lock.json
326
+ artifacts/
327
+
328
+ # ASP.NET Scaffolding
329
+ ScaffoldingReadMe.txt
330
+
331
+ # StyleCop
332
+ StyleCopReport.xml
333
+
334
+ # Files built by Visual Studio
335
+ *_i.c
336
+ *_p.c
337
+ *_h.h
338
+ *.ilk
339
+ *.meta
340
+ *.obj
341
+ *.iobj
342
+ *.pch
343
+ *.pdb
344
+ *.ipdb
345
+ *.pgc
346
+ *.pgd
347
+ *.rsp
348
+ *.sbr
349
+ *.tlb
350
+ *.tli
351
+ *.tlh
352
+ *.tmp
353
+ *.tmp_proj
354
+ *_wpftmp.csproj
355
+ *.log
356
+ *.vspscc
357
+ *.vssscc
358
+ .builds
359
+ *.pidb
360
+ *.svclog
361
+ *.scc
362
+
363
+ # Chutzpah Test files
364
+ _Chutzpah*
365
+
366
+ # Visual C++ cache files
367
+ ipch/
368
+ *.aps
369
+ *.ncb
370
+ *.opendb
371
+ *.opensdf
372
+ *.sdf
373
+ *.cachefile
374
+ *.VC.db
375
+ *.VC.VC.opendb
376
+
377
+ # Visual Studio profiler
378
+ *.psess
379
+ *.vsp
380
+ *.vspx
381
+ *.sap
382
+
383
+ # Visual Studio Trace Files
384
+ *.e2e
385
+
386
+ # TFS 2012 Local Workspace
387
+ $tf/
388
+
389
+ # Guidance Automation Toolkit
390
+ *.gpState
391
+
392
+ # ReSharper is a .NET coding add-in
393
+ _ReSharper*/
394
+ *.[Rr]e[Ss]harper
395
+ *.DotSettings.user
396
+
397
+ # TeamCity is a build add-in
398
+ _TeamCity*
399
+
400
+ # DotCover is a Code Coverage Tool
401
+ *.dotCover
402
+
403
+ # AxoCover is a Code Coverage Tool
404
+ .axoCover/*
405
+ !.axoCover/settings.json
406
+
407
+ # Coverlet is a free, cross platform Code Coverage Tool
408
+ coverage*.json
409
+ coverage*.xml
410
+ coverage*.info
411
+
412
+ # Visual Studio code coverage results
413
+ *.coverage
414
+ *.coveragexml
415
+
416
+ # NCrunch
417
+ _NCrunch_*
418
+ .*crunch*.local.xml
419
+ nCrunchTemp_*
420
+
421
+ # MightyMoose
422
+ *.mm.*
423
+ AutoTest.Net/
424
+
425
+ # Web workbench (sass)
426
+ .sass-cache/
427
+
428
+ # Installshield output folder
429
+ [Ee]xpress/
430
+
431
+ # DocProject is a documentation generator add-in
432
+ DocProject/buildhelp/
433
+ DocProject/Help/*.HxT
434
+ DocProject/Help/*.HxC
435
+ DocProject/Help/*.hhc
436
+ DocProject/Help/*.hhk
437
+ DocProject/Help/*.hhp
438
+ DocProject/Help/Html2
439
+ DocProject/Help/html
440
+
441
+ # Click-Once directory
442
+ publish/
443
+
444
+ # Publish Web Output
445
+ *.[Pp]ublish.xml
446
+ *.azurePubxml
447
+ # Note: Comment the next line if you want to checkin your web deploy settings,
448
+ # but database connection strings (with potential passwords) will be unencrypted
449
+ *.pubxml
450
+ *.publishproj
451
+
452
+ # Microsoft Azure Web App publish settings. Comment the next line if you want to
453
+ # checkin your Azure Web App publish settings, but sensitive information contained
454
+ # in these scripts will be unencrypted
455
+ PublishScripts/
456
+
457
+ # NuGet Packages
458
+ *.nupkg
459
+ # NuGet Symbol Packages
460
+ *.snupkg
461
+ # The packages folder can be ignored because of Package Restore
462
+ **/[Pp]ackages/*
463
+ # except build/, which is used as an MSBuild target.
464
+ !**/[Pp]ackages/build/
465
+ # Uncomment if necessary however generally it will be regenerated when needed
466
+ #!**/[Pp]ackages/repositories.config
467
+ # NuGet v3's project.json files produces more ignorable files
468
+ *.nuget.props
469
+ *.nuget.targets
470
+
471
+ # Microsoft Azure Build Output
472
+ csx/
473
+ *.build.csdef
474
+
475
+ # Microsoft Azure Emulator
476
+ ecf/
477
+ rcf/
478
+
479
+ # Windows Store app package directories and files
480
+ AppPackages/
481
+ BundleArtifacts/
482
+ Package.StoreAssociation.xml
483
+ _pkginfo.txt
484
+ *.appx
485
+ *.appxbundle
486
+ *.appxupload
487
+
488
+ # Visual Studio cache files
489
+ # files ending in .cache can be ignored
490
+ *.[Cc]ache
491
+ # but keep track of directories ending in .cache
492
+ !?*.[Cc]ache/
493
+
494
+ # Others
495
+ ClientBin/
496
+ ~$*
497
+ *~
498
+ *.dbmdl
499
+ *.dbproj.schemaview
500
+ *.jfm
501
+ *.pfx
502
+ *.publishsettings
503
+ orleans.codegen.cs
504
+
505
+ # Including strong name files can present a security risk
506
+ # (https://github.com/github/gitignore/pull/2483#issue-259490424)
507
+ #*.snk
508
+
509
+ # Since there are multiple workflows, uncomment next line to ignore bower_components
510
+ # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
511
+ #bower_components/
512
+
513
+ # RIA/Silverlight projects
514
+ Generated_Code/
515
+
516
+ # Backup & report files from converting an old project file
517
+ # to a newer Visual Studio version. Backup files are not needed,
518
+ # because we have git ;-)
519
+ _UpgradeReport_Files/
520
+ Backup*/
521
+ UpgradeLog*.XML
522
+ UpgradeLog*.htm
523
+ ServiceFabricBackup/
524
+ *.rptproj.bak
525
+
526
+ # SQL Server files
527
+ *.mdf
528
+ *.ldf
529
+ *.ndf
530
+
531
+ # Business Intelligence projects
532
+ *.rdl.data
533
+ *.bim.layout
534
+ *.bim_*.settings
535
+ *.rptproj.rsuser
536
+ *- [Bb]ackup.rdl
537
+ *- [Bb]ackup ([0-9]).rdl
538
+ *- [Bb]ackup ([0-9][0-9]).rdl
539
+
540
+ # Microsoft Fakes
541
+ FakesAssemblies/
542
+
543
+ # GhostDoc plugin setting file
544
+ *.GhostDoc.xml
545
+
546
+ # Node.js Tools for Visual Studio
547
+ .ntvs_analysis.dat
548
+ node_modules/
549
+
550
+ # Visual Studio 6 build log
551
+ *.plg
552
+
553
+ # Visual Studio 6 workspace options file
554
+ *.opt
555
+
556
+ # Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
557
+ *.vbw
558
+
559
+ # Visual Studio LightSwitch build output
560
+ **/*.HTMLClient/GeneratedArtifacts
561
+ **/*.DesktopClient/GeneratedArtifacts
562
+ **/*.DesktopClient/ModelManifest.xml
563
+ **/*.Server/GeneratedArtifacts
564
+ **/*.Server/ModelManifest.xml
565
+ _Pvt_Extensions
566
+
567
+ # Paket dependency manager
568
+ .paket/paket.exe
569
+ paket-files/
570
+
571
+ # FAKE - F# Make
572
+ .fake/
573
+
574
+ # CodeRush personal settings
575
+ .cr/personal
576
+
577
+ # Python Tools for Visual Studio (PTVS)
578
+ __pycache__/
579
+ *.pyc
580
+
581
+ # Cake - Uncomment if you are using it
582
+ # tools/**
583
+ # !tools/packages.config
584
+
585
+ # Tabs Studio
586
+ *.tss
587
+
588
+ # Telerik's JustMock configuration file
589
+ *.jmconfig
590
+
591
+ # BizTalk build output
592
+ *.btp.cs
593
+ *.btm.cs
594
+ *.odx.cs
595
+ *.xsd.cs
596
+
597
+ # OpenCover UI analysis results
598
+ OpenCover/
599
+
600
+ # Azure Stream Analytics local run output
601
+ ASALocalRun/
602
+
603
+ # MSBuild Binary and Structured Log
604
+ *.binlog
605
+
606
+ # NVidia Nsight GPU debugger configuration file
607
+ *.nvuser
608
+
609
+ # MFractors (Xamarin productivity tool) working folder
610
+ .mfractor/
611
+
612
+ # Local History for Visual Studio
613
+ .localhistory/
614
+
615
+ # BeatPulse healthcheck temp database
616
+ healthchecksdb
617
+
618
+ # Backup folder for Package Reference Convert tool in Visual Studio 2017
619
+ MigrationBackup/
620
+
621
+ # Ionide (cross platform F# VS Code tools) working folder
622
+ .ionide/
623
+
624
+ # Fody - auto-generated XML schema
625
+ FodyWeavers.xsd
626
+
627
+ ### Vim template
628
+ # Swap
629
+ [._]*.s[a-v][a-z]
630
+ !*.svg # comment out if you don't need vector files
631
+ [._]*.sw[a-p]
632
+ [._]s[a-rt-v][a-z]
633
+ [._]ss[a-gi-z]
634
+ [._]sw[a-p]
635
+
636
+ # Session
637
+ Session.vim
638
+ Sessionx.vim
639
+
640
+ # Temporary
641
+ .netrwhist
642
+ *~
643
+ # Auto-generated tag files
644
+ tags
645
+ # Persistent undo
646
+ [._]*.un~
647
+
648
+ ### Backup template
649
+ *.bak
650
+ *.gho
651
+ *.ori
652
+ *.orig
653
+ *.tmp
654
+
655
+ ### SublimeText template
656
+ # Cache files for Sublime Text
657
+ *.tmlanguage.cache
658
+ *.tmPreferences.cache
659
+ *.stTheme.cache
660
+
661
+ # Workspace files are user-specific
662
+ *.sublime-workspace
663
+
664
+ # Project files should be checked into the repository, unless a significant
665
+ # proportion of contributors will probably not be using Sublime Text
666
+ # *.sublime-project
667
+
668
+ # SFTP configuration file
669
+ sftp-config.json
670
+ sftp-config-alt*.json
671
+
672
+ # Package control specific files
673
+ Package Control.last-run
674
+ Package Control.ca-list
675
+ Package Control.ca-bundle
676
+ Package Control.system-ca-bundle
677
+ Package Control.cache/
678
+ Package Control.ca-certs/
679
+ Package Control.merged-ca-bundle
680
+ Package Control.user-ca-bundle
681
+ oscrypto-ca-bundle.crt
682
+ bh_unicode_properties.cache
683
+
684
+ # Sublime-github package stores a github token in this file
685
+ # https://packagecontrol.io/packages/sublime-github
686
+ GitHub.sublime-settings
687
+
688
+ ### C template
689
+ # Prerequisites
690
+ *.d
691
+
692
+ # Object files
693
+ *.o
694
+ *.ko
695
+ *.obj
696
+ *.elf
697
+
698
+ # Linker output
699
+ *.ilk
700
+ *.map
701
+ *.exp
702
+
703
+ # Precompiled Headers
704
+ *.gch
705
+ *.pch
706
+
707
+ # Libraries
708
+ *.lib
709
+ *.a
710
+ *.la
711
+ *.lo
712
+
713
+ # Shared objects (inc. Windows DLLs)
714
+ *.dll
715
+ *.so
716
+ *.so.*
717
+ *.dylib
718
+
719
+ # Executables
720
+ *.exe
721
+ *.out
722
+ *.app
723
+ *.i*86
724
+ *.x86_64
725
+ *.hex
726
+
727
+ # Debug files
728
+ *.dSYM/
729
+ *.su
730
+ *.idb
731
+ *.pdb
732
+
733
+ # Kernel Module Compile Results
734
+ *.mod*
735
+ *.cmd
736
+ .tmp_versions/
737
+ modules.order
738
+ Module.symvers
739
+ Mkfile.old
740
+ dkms.conf
741
+
742
+ ### VirtualEnv template
743
+ # Virtualenv
744
+ # http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
745
+ .Python
746
+ [Bb]in
747
+ [Ii]nclude
748
+ [Ll]ib
749
+ [Ll]ib64
750
+ [Ll]ocal
751
+ [Ss]cripts
752
+ pyvenv.cfg
753
+ .venv
754
+ pip-selfcheck.json
755
+
756
+ ### LibreOffice template
757
+ # LibreOffice locks
758
+ .~lock.*#
759
+
760
+ ### Xilinx template
761
+ # gitignore template for Xilinx Vivado Design Suite
762
+ # website: https://www.xilinx.com/support/download.html
763
+
764
+ # [home]
765
+ *.jou
766
+ *.log
767
+ *.debug
768
+ *.str
769
+ *.tmp
770
+ *.os
771
+ *.js
772
+ *.pb
773
+ *.dcp
774
+ *.hwdef
775
+ *.vds
776
+ *.veo
777
+ *.wdf
778
+ *.vdi
779
+ *.dmp
780
+ *.rpx
781
+ *.rpt
782
+ *_stub.v
783
+ *_stub.vhdl
784
+ *_funcsim.v
785
+ *_funcsim.vhdl
786
+ .project
787
+
788
+ # [dir]
789
+ *.cache
790
+ .metadata
791
+ *.data
792
+ *.ipdefs
793
+ .Xil
794
+ *.sdk
795
+ *.hw
796
+ *.ip_user_files
797
+
798
+ ### IP synth
799
+ *_synth_*
800
+
801
+ .jobs
802
+
803
+ ### project synth
804
+ */*.runs/synth*/*.xml
805
+ */*.runs/synth*/*.txt
806
+ */*.runs/synth*/*.sh
807
+ */*.runs/synth*/*.tcl
808
+ */*.runs/synth*/*.bat
809
+ */*.runs/synth*/*.xdc
810
+ !*/*.runs/synth*/*utilization*.rpt
811
+
812
+ *.runs/synth*/*.xml
813
+ *.runs/synth*/*.txt
814
+ *.runs/synth*/*.sh
815
+ *.runs/synth*/*.tcl
816
+ *.runs/synth*/*.bat
817
+ *.runs/synth*/*.xdc
818
+ !*.runs/synth*/*utilization*.rpt
819
+
820
+ ### project impl
821
+ */*.runs/impl*/*.xml
822
+ */*.runs/impl*/*.html
823
+ */*.runs/impl*/*.txt
824
+ */*.runs/impl*/*.sh
825
+ */*.runs/impl*/*.tcl
826
+ */*.runs/impl*/*.bat
827
+ !*/*.runs/impl*/*utilization*.rpt
828
+
829
+ *.runs/impl*/*.xml
830
+ *.runs/impl*/*.html
831
+ *.runs/impl*/*.txt
832
+ *.runs/impl*/*.sh
833
+ *.runs/impl*/*.tcl
834
+ *.runs/impl*/*.bat
835
+ !*.runs/impl*/*utilization*.rpt
836
+
837
+ ### block design
838
+ */*/bd/*/hdl
839
+ */*/*/bd/*/hdl
840
+
841
+ */*/bd/*/*.xdc
842
+ */*/*/bd/*/*.xdc
843
+
844
+ */*/bd/*/ip/*/*.xdc
845
+ */*/*/bd/*/ip/*/*.xdc
846
+
847
+ */*/bd/*/ip/*/*/
848
+ */*/*/bd/*/ip/*/*/
849
+
850
+ */*/bd/*/ip/*/*.vhd
851
+ */*/*/bd/*/ip/*/*.vhd
852
+
853
+ */*/bd/*/ip/*/*.xml
854
+ */*/*/bd/*/ip/*/*.xml
855
+
856
+ *.c
857
+ *.cpp
858
+ *.h
859
+ *.vho
860
+ */*/bd/*/ip/*/*.tcl
861
+ */*/*/bd/*/ip/*/*.tcl
862
+ hw_handoff
863
+ ipshared
864
+
865
+ ### Lua template
866
+ # Compiled Lua sources
867
+ luac.out
868
+
869
+ # luarocks build files
870
+ *.src.rock
871
+ *.zip
872
+
873
+ # Object files
874
+ *.o
875
+ *.os
876
+ *.ko
877
+ *.obj
878
+ *.elf
879
+
880
+ # Precompiled Headers
881
+ *.gch
882
+ *.pch
883
+
884
+ # Libraries
885
+ *.lib
886
+ *.a
887
+ *.la
888
+ *.lo
889
+ *.def
890
+ *.exp
891
+
892
+ # Shared objects (inc. Windows DLLs)
893
+ *.dll
894
+ *.so
895
+ *.so.*
896
+ *.dylib
897
+
898
+ # Executables
899
+ *.exe
900
+ *.out
901
+ *.app
902
+ *.i*86
903
+ *.x86_64
904
+ *.hex
905
+
906
+
907
+ ### Vagrant template
908
+ # General
909
+ .vagrant/
910
+
911
+ # Log files (if you are creating logs in debug mode, uncomment this)
912
+ # *.log
913
+
914
+ ### PuTTY template
915
+ # Private key
916
+ *.ppk
917
+
918
+ ### Patch template
919
+ *.orig
920
+ *.rej
921
+
922
+ ### Python template
923
+ # Byte-compiled / optimized / DLL files
924
+ __pycache__/
925
+ *.py[cod]
926
+ *$py.class
927
+
928
+ # C extensions
929
+ *.so
930
+
931
+ # Distribution / packaging
932
+ .Python
933
+ build/
934
+ develop-eggs/
935
+ /dist
936
+ wheelhouse/
937
+ downloads/
938
+ eggs/
939
+ .eggs/
940
+ lib/
941
+ lib64/
942
+ parts/
943
+ sdist/
944
+ var/
945
+ wheels/
946
+ share/python-wheels/
947
+ *.egg-info/
948
+ .installed.cfg
949
+ *.egg
950
+ MANIFEST
951
+
952
+ # PyInstaller
953
+ # Usually these files are written by a python script from a template
954
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
955
+ *.manifest
956
+ *.spec
957
+
958
+ # Installer logs
959
+ pip-log.txt
960
+ pip-delete-this-directory.txt
961
+
962
+ # Unit test / coverage reports
963
+ htmlcov/
964
+ .tox/
965
+ .nox/
966
+ .coverage
967
+ .coverage.*
968
+ .cache
969
+ nosetests.xml
970
+ coverage.xml
971
+ *.cover
972
+ *.py,cover
973
+ .hypothesis/
974
+ .pytest_cache/
975
+ cover/
976
+
977
+ # Translations
978
+ *.mo
979
+ *.pot
980
+
981
+ # Django stuff:
982
+ *.log
983
+ local_settings.py
984
+ db.sqlite3
985
+ db.sqlite3-journal
986
+
987
+ # Flask stuff:
988
+ instance/
989
+ .webassets-cache
990
+
991
+ # Scrapy stuff:
992
+ .scrapy
993
+
994
+ # Sphinx documentation
995
+ docs/_build/
996
+
997
+ # PyBuilder
998
+ .pybuilder/
999
+ target/
1000
+
1001
+ # Jupyter Notebook
1002
+ .ipynb_checkpoints
1003
+
1004
+ # IPython
1005
+ profile_default/
1006
+ ipython_config.py
1007
+
1008
+ # pyenv
1009
+ # For a library or package, you might want to ignore these files since the code is
1010
+ # intended to run in multiple environments; otherwise, check them in:
1011
+ # .python-version
1012
+
1013
+ # pipenv
1014
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
1015
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
1016
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
1017
+ # install all needed dependencies.
1018
+ #Pipfile.lock
1019
+
1020
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow
1021
+ __pypackages__/
1022
+
1023
+ # Celery stuff
1024
+ celerybeat-schedule
1025
+ celerybeat.pid
1026
+
1027
+ # SageMath parsed files
1028
+ *.sage.py
1029
+
1030
+ # Environments
1031
+ .env
1032
+ .venv
1033
+ /env/
1034
+ venv/
1035
+ ENV/
1036
+ env.bak/
1037
+ venv.bak/
1038
+
1039
+ # Spyder project settings
1040
+ .spyderproject
1041
+ .spyproject
1042
+
1043
+ # Rope project settings
1044
+ .ropeproject
1045
+
1046
+ # mkdocs documentation
1047
+ /site
1048
+
1049
+ # mypy
1050
+ .mypy_cache/
1051
+ .dmypy.json
1052
+ dmypy.json
1053
+
1054
+ # Pyre type checker
1055
+ .pyre/
1056
+
1057
+ # pytype static type analyzer
1058
+ .pytype/
1059
+
1060
+ # Cython debug symbols
1061
+ cython_debug/
1062
+
1063
+ ### Windows template
1064
+ # Windows thumbnail cache files
1065
+ Thumbs.db
1066
+ Thumbs.db:encryptable
1067
+ ehthumbs.db
1068
+ ehthumbs_vista.db
1069
+
1070
+ # Dump file
1071
+ *.stackdump
1072
+
1073
+ # Folder config file
1074
+ [Dd]esktop.ini
1075
+
1076
+ # Recycle Bin used on file shares
1077
+ $RECYCLE.BIN/
1078
+
1079
+ # Windows Installer files
1080
+ *.cab
1081
+ *.msi
1082
+ *.msix
1083
+ *.msm
1084
+ *.msp
1085
+
1086
+ # Windows shortcuts
1087
+ *.lnk
1088
+
1089
+ ### Xcode template
1090
+ # Xcode
1091
+ #
1092
+ # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
1093
+
1094
+ ## User settings
1095
+ xcuserdata/
1096
+
1097
+ ## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
1098
+ *.xcscmblueprint
1099
+ *.xccheckout
1100
+
1101
+ ## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
1102
+ build/
1103
+ DerivedData/
1104
+ *.moved-aside
1105
+ *.pbxuser
1106
+ !default.pbxuser
1107
+ *.mode1v3
1108
+ !default.mode1v3
1109
+ *.mode2v3
1110
+ !default.mode2v3
1111
+ *.perspectivev3
1112
+ !default.perspectivev3
1113
+
1114
+ ## Gcc Patch
1115
+ /*.gcno
1116
+
1117
+ ### JetBrains template
1118
+ # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
1119
+ # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
1120
+
1121
+ # User-specific stuff
1122
+ .idea/**/workspace.xml
1123
+ .idea/**/tasks.xml
1124
+ .idea/**/usage.statistics.xml
1125
+ .idea/**/dictionaries
1126
+ .idea/**/shelf
1127
+
1128
+ # Generated files
1129
+ .idea/**/contentModel.xml
1130
+
1131
+ # Sensitive or high-churn files
1132
+ .idea/**/dataSources/
1133
+ .idea/**/dataSources.ids
1134
+ .idea/**/dataSources.local.xml
1135
+ .idea/**/sqlDataSources.xml
1136
+ .idea/**/dynamic.xml
1137
+ .idea/**/uiDesigner.xml
1138
+ .idea/**/dbnavigator.xml
1139
+
1140
+ # Gradle
1141
+ .idea/**/gradle.xml
1142
+ .idea/**/libraries
1143
+
1144
+ # Gradle and Maven with auto-import
1145
+ # When using Gradle or Maven with auto-import, you should exclude module files,
1146
+ # since they will be recreated, and may cause churn. Uncomment if using
1147
+ # auto-import.
1148
+ # .idea/artifacts
1149
+ # .idea/compiler.xml
1150
+ # .idea/jarRepositories.xml
1151
+ # .idea/modules.xml
1152
+ # .idea/*.iml
1153
+ # .idea/modules
1154
+ # *.iml
1155
+ # *.ipr
1156
+
1157
+ # CMake
1158
+ cmake-build-*/
1159
+
1160
+ # Mongo Explorer plugin
1161
+ .idea/**/mongoSettings.xml
1162
+
1163
+ # File-based project format
1164
+ *.iws
1165
+
1166
+ # IntelliJ
1167
+ out/
1168
+
1169
+ # mpeltonen/sbt-idea plugin
1170
+ .idea_modules/
1171
+
1172
+ # JIRA plugin
1173
+ atlassian-ide-plugin.xml
1174
+
1175
+ # Cursive Clojure plugin
1176
+ .idea/replstate.xml
1177
+
1178
+ # Crashlytics plugin (for Android Studio and IntelliJ)
1179
+ com_crashlytics_export_strings.xml
1180
+ crashlytics.properties
1181
+ crashlytics-build.properties
1182
+ fabric.properties
1183
+
1184
+ # Editor-based Rest Client
1185
+ .idea/httpRequests
1186
+
1187
+ # Android studio 3.1+ serialized cache file
1188
+ .idea/caches/build_file_checksums.ser
1189
+
1190
+ /test_*
1191
+ .python-version
1192
+ /docs/build
1193
+ /public
1194
+ /docs/source/**/*.puml.svg
1195
+ /docs/source/**/*.puml.png
1196
+ /docs/source/**/*.gv.svg
1197
+ /docs/source/**/*.gv.png
1198
+ /docs/source/**/*.py.txt
1199
+ /docs/source/**/*.py.err
1200
+ /docs/source/**/*.py.exitcode
1201
+ /docs/source/**/*.sh.txt
1202
+ /docs/source/**/*.sh.err
1203
+ /docs/source/**/*.sh.exitcode
1204
+ /docs/source/**/*.dat.*
1205
+ !/docs/source/_static/**/*
1206
+ /cartpole_dqn_*
1207
+ /extra
1208
+ /resource/yolort/*
1209
+ !/resource/yolort/Makefile
1210
+ /images
1211
+ /output
1212
+ /ckpt
1213
+ /ckpts
1214
+ /.benchmarks
1215
+ /onnxs
1216
+ /.temp
app.py ADDED
@@ -0,0 +1,124 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import io
2
+ import json
3
+ import os
4
+
5
+ import gradio as gr
6
+ import markdown
7
+ import pandas as pd
8
+ from gchar.games.dispatch.access import get_character
9
+ from gchar.resources.pixiv import get_pixiv_keywords, get_pixiv_posts
10
+ from gchar.resources.sites import list_available_sites, get_site_tag
11
+ from huggingface_hub import hf_hub_url
12
+
13
+ from character import get_ch_name
14
+ from huggingface import get_hf_fs
15
+
16
+ hf_fs = get_hf_fs()
17
+
18
+
19
+ def query(chr_name):
20
+ ch = get_character(chr_name, allow_fuzzy=True)
21
+
22
+ # get character info
23
+ info_columns = ['Property', 'Value']
24
+ info_data = []
25
+ info_data.append(('Index', ch.index))
26
+ ennames = [str(enname) for enname in ch.ennames]
27
+ if ennames:
28
+ info_data.append(('EN Name', ', '.join(ennames)))
29
+ cnnames = [str(cnname) for cnname in ch.cnnames]
30
+ if cnnames:
31
+ info_data.append(('CN Name', ', '.join(cnnames)))
32
+ jpnames = [str(jpname) for jpname in ch.jpnames]
33
+ if jpnames:
34
+ info_data.append(('JP Name', ', '.join(jpnames)))
35
+ if hasattr(ch, 'krnames'):
36
+ krnames = [str(krname) for krname in ch.krnames]
37
+ if krnames:
38
+ info_data.append(('KR Name', ', '.join(krnames)))
39
+ info_data.append(('Sex', ch.gender.name))
40
+ info_data.append(('Source', ch.__official_name__))
41
+ info_df = pd.DataFrame(columns=info_columns, data=info_data)
42
+
43
+ # get skins
44
+ skin_dir = f'datasets/deepghs/game_character_skins/{ch.__game_name__}/{ch.index}'
45
+ meta_json = f'{skin_dir}/.meta.json'
46
+ skin_urls = []
47
+ if hf_fs.exists(meta_json):
48
+ meta = json.loads(hf_fs.read_text(meta_json))
49
+ for item in meta['files']:
50
+ skin_urls.append(hf_hub_url(
51
+ 'deepghs/game_character_skins',
52
+ filename=f'{ch.__game_name__}/{ch.index}/{item["name"]}',
53
+ repo_type='dataset',
54
+ ))
55
+
56
+ # get repo info
57
+ repo = f'CyberHarem/{get_ch_name(ch)}'
58
+ with io.StringIO() as sf:
59
+ if hf_fs.exists(f'{repo}/meta.json'):
60
+ model_url = f'https://huggingface.co/{repo}'
61
+ print(f'Model: [{model_url}]({model_url})', file=sf)
62
+ else:
63
+ print(f'Model not found.', file=sf)
64
+ print(file=sf)
65
+
66
+ if hf_fs.exists(f'datasets/{repo}/dataset-raw.zip'):
67
+ ds_url = f'https://huggingface.co/datasets/{repo}'
68
+ print(f'Dataset: [{ds_url}]({ds_url})', file=sf)
69
+ else:
70
+ print('Dataset not found.', file=sf)
71
+ print(file=sf)
72
+ html = markdown.markdown(sf.getvalue())
73
+
74
+ # get tags on all sites
75
+ tags_columns = ['Site', 'Tag', 'Posts']
76
+ tags_data = []
77
+ tags_data.append(('Pixiv (ALL)', get_pixiv_keywords(ch), get_pixiv_posts(ch)[0]))
78
+ tags_data.append(('Pixiv (R18)', get_pixiv_keywords(ch, includes=['R-18']), get_pixiv_posts(ch)[1]))
79
+ for site in list_available_sites():
80
+ tag_retval = get_site_tag(ch, site, with_posts=True, sure_only=True)
81
+ if tag_retval is not None:
82
+ tag_name, tag_cnt = tag_retval
83
+ tags_data.append((site, tag_name, tag_cnt))
84
+ tags_data = sorted(tags_data, key=lambda x: (-x[2], x[1]))
85
+ tags_df = pd.DataFrame(columns=tags_columns, data=tags_data)
86
+
87
+ return info_df, skin_urls, html, tags_df
88
+
89
+
90
+ if __name__ == '__main__':
91
+ with gr.Blocks() as demo:
92
+ gr_input = gr.Textbox(
93
+ label='Character Name',
94
+ placeholder='Enter name or alias of the character.'
95
+ )
96
+ gr_submit = gr.Button(value='Find My Waifu', variant='primary')
97
+
98
+ with gr.Row():
99
+ with gr.Column():
100
+ with gr.Row():
101
+ gr_info = gr.DataFrame(label='Character Info')
102
+ with gr.Row():
103
+ gr_skins = gr.Gallery(label='Skins')
104
+
105
+ with gr.Column():
106
+ with gr.Row():
107
+ gr_html = gr.HTML(label='Entry of Model and Dataset', value='(N/A)')
108
+ with gr.Row():
109
+ gr_tags = gr.DataFrame(label='Character Tags')
110
+
111
+ gr_submit.click(
112
+ query,
113
+ inputs=[
114
+ gr_input,
115
+ ],
116
+ outputs=[
117
+ gr_info,
118
+ gr_skins,
119
+ gr_html,
120
+ gr_tags,
121
+ ]
122
+ )
123
+
124
+ demo.queue(os.cpu_count()).launch()
character.py ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import re
2
+
3
+ from gchar.games.base import Character
4
+ from thefuzz import fuzz
5
+
6
+
7
+ def get_pure_name(name: str) -> str:
8
+ return '_'.join([word for word in re.split(r'[\W_]+', name.lower()) if word])
9
+
10
+
11
+ def get_alphabet_name(name: str) -> str:
12
+ return '_'.join(re.findall(r'[a-zA-Z\d+]+', name.lower()))
13
+
14
+
15
+ def _name_alphabet_ratio(name: str) -> float:
16
+ pure_name = get_pure_name(name)
17
+ alphabet_name = get_alphabet_name(name)
18
+ return fuzz.token_set_ratio(pure_name, alphabet_name)
19
+
20
+
21
+ def get_ch_name(ch: Character):
22
+ names = [
23
+ *map(str, ch.ennames),
24
+ *map(str, ch.cnnames),
25
+ *map(str, ch.jpnames),
26
+ ]
27
+ all_names = [(name, _name_alphabet_ratio(name), i) for i, name in enumerate(names)]
28
+ all_names = sorted(all_names, key=lambda x: (-x[1], x[2]))
29
+
30
+ name, ratio, _ = all_names[0]
31
+ if ratio >= 0.9:
32
+ short_name = get_alphabet_name(name)
33
+ else:
34
+ raise ValueError(f'No suitable alphabet-based name for {ch!r}.')
35
+
36
+ return f'{short_name}_{ch.__game_name__}'
huggingface.py ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import math
2
+ import os
3
+
4
+ from gchar.utils import get_requests_session
5
+ from huggingface_hub import configure_http_backend, HfApi, HfFileSystem
6
+
7
+ _NUM_TAGS = [
8
+ ('n<1K', 0, 1_000),
9
+ ('1K<n<10K', 1_000, 10_000),
10
+ ('10K<n<100K', 10_000, 100_000),
11
+ ('100K<n<1M', 100_000, 1_000_000),
12
+ ('1M<n<10M', 1_000_000, 10_000_000),
13
+ ('10M<n<100M', 10_000_000, 100_000_000),
14
+ ('100M<n<1B', 100_000_000, 1_000_000_000),
15
+ ('1B<n<10B', 1_000_000_000, 10_000_000_000),
16
+ ('10B<n<100B', 10_000_000_000, 100_000_000_000),
17
+ ('100B<n<1T', 100_000_000_000, 1_000_000_000_000),
18
+ ('n>1T', 1_000_000_000_000, math.inf),
19
+ ]
20
+
21
+
22
+ def number_to_tag(v):
23
+ for tag, min_, max_ in _NUM_TAGS:
24
+ if min_ <= v < max_:
25
+ return tag
26
+
27
+ raise ValueError(f'No tags found for {v!r}')
28
+
29
+
30
+ configure_http_backend(get_requests_session)
31
+
32
+
33
+ def get_hf_client() -> HfApi:
34
+ return HfApi(token=os.environ.get('HF_TOKEN'))
35
+
36
+
37
+ def get_hf_fs() -> HfFileSystem:
38
+ return HfFileSystem(token=os.environ.get('HF_TOKEN'))
requirements.txt ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ gradio==3.39.0
2
+ pycivitai
3
+ huggingface_hub
4
+ requests
5
+ gchar
6
+ hbutils>=0.9.1
7
+ markdown
8
+ pandas