Commit
·
d937abb
1
Parent(s):
057a09e
Update parquet files (step 101 of 249)
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- spaces/101-5/gpt4free/g4f/.v1/gpt4free/quora/tests/__init__.py +0 -0
- spaces/1acneusushi/gradio-2dmoleculeeditor/data/Gravity VST The Best Tool for Cinematic Sound Design.md +0 -22
- spaces/1gistliPinn/ChatGPT4/Examples/Angry Birds 1.6.3.1 For PC [BEST].md +0 -19
- spaces/1gistliPinn/ChatGPT4/Examples/Autocad 2015 Keygen Pirate Bay [PORTABLE].md +0 -8
- spaces/1gistliPinn/ChatGPT4/Examples/Code-de-la-route-en-anglais-pdf.md +0 -26
- spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Download Caneta Azul Azul Caneta and Join the Fun of the Internet Sensation.md +0 -105
- spaces/1phancelerku/anime-remove-background/Bloons TD 6 32.4 APK - How to Protect Your Towers and Team Up with Monkeys in this Offline Game.md +0 -159
- spaces/1phancelerku/anime-remove-background/Dragon Ball Legend Fighter The Ultimate 3D Battle Game APK Download.md +0 -101
- spaces/1phancelerku/anime-remove-background/Enjoy TikTok on Your Computer with These Easy Steps.md +0 -95
- spaces/1phancelerku/anime-remove-background/Football Quiz 2022 How many of these World Cup facts can you get right?.md +0 -98
- spaces/2023Liu2023/bingo/src/components/ui/separator.tsx +0 -31
- spaces/4eJIoBek/Stable_Diffusion_1.4_openvino/demo_web.py +0 -124
- spaces/AIFILMS/ControlNet-Video/app.py +0 -359
- spaces/AIGC-Audio/AudioGPT/audio_detection/audio_infer/__init__.py +0 -0
- spaces/AUST001/video/app.py +0 -11
- spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/buttons/Buttons.d.ts +0 -95
- spaces/AliHaider0343/implicit-and-explicit-aspects-Extraction-in-Restaurant-Reviews-Domain/app.py +0 -71
- spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/examples/conftest.py +0 -45
- spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/src/diffusers/dependency_versions_table.py +0 -44
- spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/tests/models/test_models_unet_2d_flax.py +0 -104
- spaces/Andy1621/uniformer_image_detection/configs/fcos/fcos_r101_caffe_fpn_gn-head_1x_coco.py +0 -4
- spaces/Andy1621/uniformer_image_detection/configs/grid_rcnn/grid_rcnn_x101_64x4d_fpn_gn-head_2x_coco.py +0 -12
- spaces/Andy1621/uniformer_image_detection/configs/lvis/mask_rcnn_r101_fpn_sample1e-3_mstrain_1x_lvis_v1.py +0 -2
- spaces/Andy1621/uniformer_image_detection/configs/regnet/mask_rcnn_regnetx-8GF_fpn_1x_coco.py +0 -16
- spaces/Andy1621/uniformer_image_detection/configs/scnet/README.md +0 -51
- spaces/Andy1621/uniformer_image_detection/mmdet/models/losses/gaussian_focal_loss.py +0 -91
- spaces/Andy1621/uniformer_image_detection/mmdet/models/utils/builder.py +0 -14
- spaces/Andy1621/uniformer_image_segmentation/configs/deeplabv3plus/deeplabv3plus_r50-d8_512x512_160k_ade20k.py +0 -6
- spaces/Anonymous-sub/Rerender/ControlNet/annotator/uniformer/configs/_base_/schedules/schedule_40k.py +0 -9
- spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/distlib/version.py +0 -739
- spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/packaging/_musllinux.py +0 -136
- spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/packaging/tags.py +0 -487
- spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_compat.py +0 -8
- spaces/Audio-AGI/AudioSep/models/CLAP/open_clip/timm_model.py +0 -112
- spaces/Awiny/Image2Paragraph/models/grit_src/third_party/CenterNet2/detectron2/evaluation/testing.py +0 -85
- spaces/Benson/text-generation/Examples/Blockman Go Newshungama Mod Apk.md +0 -56
- spaces/Benson/text-generation/Examples/Como Hacer Una Hoja De Presentacin.md +0 -63
- spaces/Big-Web/MMSD/env/Lib/site-packages/botocore/docs/client.py +0 -400
- spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_internal/vcs/mercurial.py +0 -163
- spaces/BorisovMaksim/denoising/README.md +0 -74
- spaces/CVPR/Dual-Key_Backdoor_Attacks/openvqa/utils/proc_dict_vqa.py +0 -47
- spaces/CVPR/LIVE/thrust/CHANGELOG.md +0 -1659
- spaces/CVPR/LIVE/thrust/thrust/detail/config/cpp_compatibility.h +0 -94
- spaces/CVPR/LIVE/thrust/thrust/system/tbb/detail/remove.h +0 -81
- spaces/CVPR/WALT/mmdet/models/roi_heads/mask_heads/coarse_mask_head.py +0 -91
- spaces/ChallengeHub/Chinese-LangChain/app_modules/overwrites.py +0 -49
- spaces/CofAI/optor/style.css +0 -28
- spaces/DQChoi/gpt-demo/venv/lib/python3.11/site-packages/fontTools/help.py +0 -35
- spaces/DQChoi/gpt-demo/venv/lib/python3.11/site-packages/huggingface_hub/_commit_scheduler.py +0 -318
- spaces/Dabs/UlamSpiral/README.md +0 -11
spaces/101-5/gpt4free/g4f/.v1/gpt4free/quora/tests/__init__.py
DELETED
File without changes
|
spaces/1acneusushi/gradio-2dmoleculeeditor/data/Gravity VST The Best Tool for Cinematic Sound Design.md
DELETED
@@ -1,22 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Gravity VST: A Powerful Tool for Cinematic Sound Design</h1>
|
3 |
-
<p>If you are looking for a versatile and expressive instrument to create cinematic soundscapes, atmospheres, and effects, you might want to check out Gravity VST by Heavyocity. Gravity VST is a collection of over 2000 sound sources, 1100 presets, and 800 snapshots that can be layered, manipulated, and morphed in various ways. Gravity VST lets you explore the sonic possibilities of organic and synthetic sounds, from ethereal pads and vocal phrases to gritty pulses and impacts.</p>
|
4 |
-
<p>One of the most impressive features of Gravity VST is the Motion Designer, which allows you to animate your sounds with rhythmic patterns, envelopes, filters, and effects. You can choose from over 300 presets or create your own custom motions to add movement and variation to your sounds. You can also use the Motion Designer to modulate the parameters of the four onboard effects: Delay, Reverb, Distortion, and Modulation.</p>
|
5 |
-
<h2>gravity vst</h2><br /><p><b><b>DOWNLOAD</b> ⭐ <a href="https://byltly.com/2uKwIi">https://byltly.com/2uKwIi</a></b></p><br /><br />
|
6 |
-
<p>Another feature that sets Gravity VST apart from other cinematic instruments is the Punish Knob, which lets you dial in some extra intensity and character to your sounds. The Punish Knob is a combination of compression, saturation, distortion, and limiting that can add anything from subtle warmth to extreme distortion. You can use it to make your sounds more punchy, aggressive, or dramatic.</p>
|
7 |
-
<p>Gravity VST is compatible with any DAW that supports VST, AU, or AAX plugins. It requires Kontakt 5.5 or higher (full version) to run. You can buy Gravity VST from Heavyocity's website for $449 USD or get it as part of the Gravity Pack Bundle for $699 USD. If you are looking for a powerful tool for cinematic sound design, Gravity VST might be the perfect choice for you.</p>
|
8 |
-
|
9 |
-
<p>In this article, we will take a closer look at some of the features and sounds of Gravity VST and see how it can enhance your cinematic productions. We will also share some tips and tricks on how to get the most out of this powerful instrument.</p>
|
10 |
-
<h2>Evocative Pads</h2>
|
11 |
-
<p>The Pads section of Gravity VST contains over 1000 sound sources and 400 presets that can be used to create lush and atmospheric textures. Each pad consists of two layers that can be blended, tuned, and panned independently. You can also adjust the volume envelope, filter, EQ, and stereo width of each layer.</p>
|
12 |
-
<p>One of the highlights of the Pads section is the Motion Designer, which allows you to animate your pads with rhythmic patterns, envelopes, filters, and effects. You can choose from over 300 presets or create your own custom motions to add movement and variation to your pads. You can also use the Motion Designer to modulate the parameters of the four onboard effects: Delay, Reverb, Distortion, and Modulation.</p>
|
13 |
-
<p>The Pads section also features a Master FX page, where you can apply global effects such as compression, saturation, distortion, limiting, and convolution reverb. You can use the Punish Knob to dial in some extra intensity and character to your pads. You can also use the Twist Knob to modulate the pitch and timbre of your pads with an LFO.</p>
|
14 |
-
<p>The Pads section of Gravity VST is ideal for creating cinematic soundscapes, atmospheres, and backgrounds. You can use them to set the mood and tone of your scenes, or to add depth and dimension to your mixes. You can also layer them with other instruments or sounds to create rich and complex textures.</p>
|
15 |
-
<h2>Earth-Shattering Hits</h2>
|
16 |
-
<p>The Hits section of Gravity VST contains over 500 sound sources and 200 presets that can be used to create powerful and dramatic impacts. Each hit consists of three layers: Subs, Impacts, and Tails. You can mix and match different elements from each layer to create an unlimited range of unique hit combinations.</p>
|
17 |
-
<p></p>
|
18 |
-
<p>One of the most impressive features of the Hits section is the Designer page, where you can construct layered hits by mixing up Subs, Impacts, Tails and Whooshes. You can drag and drop different elements from the browser onto the timeline, and adjust their timing, volume, pan, pitch, filter, EQ, and effects. You can also use the Snapshots feature to save and recall up to 12 different hit configurations.</p>
|
19 |
-
<p>The Hits section also features a Master FX page, where you can apply global effects such as compression, saturation, distortion, limiting, and convolution reverb. You can use the Punish Knob to dial in some extra intensity and character to your hits. You can also use the Twist Knob to modulate the pitch and timbre of your hits with an LFO.</p>
|
20 |
-
<p>The Hits section of Gravity VST is ideal for creating cinematic impacts, transitions, accents, and punctuation. You can use them to add weight and drama to your scenes, or to emphasize key moments or events. You can also layer them with other instruments or sounds to create bigger and more epic hits.</p> ddb901b051<br />
|
21 |
-
<br />
|
22 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1gistliPinn/ChatGPT4/Examples/Angry Birds 1.6.3.1 For PC [BEST].md
DELETED
@@ -1,19 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Angry Birds 1.6.3.1 for PC: The Latest Update of the Classic Game</h1>
|
3 |
-
<p>Angry Birds is one of the most popular and addictive games ever created. It was first released for iOS devices in 2009, and since then it has been ported to various platforms, including Windows PC. The game features a flock of colorful birds who are angry at the green pigs who stole their eggs. The player has to use a slingshot to launch the birds at the pigs' structures and destroy them.</p>
|
4 |
-
<p>The latest update of Angry Birds for PC is version 1.6.3.1, which was released in October 2011. This update includes the final chapter of Mine and Dine, the 17th episode of the game, which adds 15 new levels and a new golden egg. The update also fixes some bugs and improves the performance of the game.</p>
|
5 |
-
<h2>Angry Birds 1.6.3.1 for PC</h2><br /><p><b><b>Download File</b> ✅ <a href="https://imgfil.com/2uy22k">https://imgfil.com/2uy22k</a></b></p><br /><br />
|
6 |
-
<p>To download Angry Birds 1.6.3.1 for PC, you can visit the official website of Rovio Entertainment, the developer of the game, or use one of the alternative sources available online. You can also check out some tips and walkthroughs for the game on various websites and forums dedicated to Angry Birds fans.</p>
|
7 |
-
<p>Angry Birds 1.6.3.1 for PC is a fun and challenging game that will keep you entertained for hours. If you love physics-based puzzles and cute characters, you should definitely give it a try.</p>
|
8 |
-
|
9 |
-
<p>Angry Birds is not only a game of skill, but also a game of strategy. You have to plan your moves carefully and use the right bird for the right situation. Here are some tips and tricks to help you master the game and get the best scores possible.</p>
|
10 |
-
<ul>
|
11 |
-
<li>Use the zoom feature to see the whole level. Sometimes, there are hidden pigs or objects that you might miss if you don't zoom out. You can also see the trajectory of your previous bird and adjust your aim accordingly.</li>
|
12 |
-
<li>Try different angles and power levels. Sometimes, a low and soft shot can be more effective than a high and hard one. Experiment with different combinations and see what works best for each level.</li>
|
13 |
-
<li>Use the environment to your advantage. There are many elements in the game that can help you or hinder you, such as TNT crates, boulders, ice blocks, fans, balloons, etc. Learn how they behave and use them to create chain reactions or to reach difficult spots.</li>
|
14 |
-
<li>Don't waste your birds. You get bonus points for every unused bird at the end of each level, so try to use as few birds as possible to clear the level. Sometimes, you can even finish a level with one bird if you hit the right spot.</li>
|
15 |
-
<li>Watch videos of other players. If you are stuck on a level or want to improve your score, you can watch videos of other players who have completed the level with three stars. You can learn from their techniques and strategies and apply them to your own game.</li>
|
16 |
-
</ul>
|
17 |
-
<p>Angry Birds is a game that can be enjoyed by anyone, regardless of age or skill level. It is simple to play but hard to master, and it offers hours of fun and entertainment. With these tips and tricks, you can become an Angry Birds expert and impress your friends with your high scores.</p> d5da3c52bf<br />
|
18 |
-
<br />
|
19 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1gistliPinn/ChatGPT4/Examples/Autocad 2015 Keygen Pirate Bay [PORTABLE].md
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
|
2 |
-
<p>Another AutoCAD Keygen is <strong>AutoCAD 2017</strong>. Other features include ability to open and modify existing files and to perform basic pre-processing operations on the drawings. AutoCAD comes with an AutoCAD LT Viewer. Additionally, it has more advanced functionality such as the ability to create and open projects, create annotations, create camera views of 3D models, and perform basic and geometric transformations.</p>
|
3 |
-
<p>AutoCAD does not include a calculator, <strong>AutoCAD LT</strong> does. The new keygen is available as a free download from the homepage of AutoCAD LT. A trial version of the software will let you to use it for 30 days. The program requires Windows 7 or higher. The AutoCAD LT program works with all Windows systems supporting AutoCAD LT.</p>
|
4 |
-
<h2>Autocad 2015 Keygen Pirate Bay</h2><br /><p><b><b>Download</b> ★★★ <a href="https://imgfil.com/2uy1jT">https://imgfil.com/2uy1jT</a></b></p><br /><br />
|
5 |
-
<p>After which you can deploy files. The default partitioning is to use <strong>C:</strong>. You can change the partitioning and file allocation. In addition to these, a private image and a default private image are also created. The private image cannot be edited outside of the program, but you can save a private image and open it with AutoCAD. The default private image is a way to transfer the default private image to a file that you can edit. A snapshot of a default private image is created whenever you edit a drawing outside the program. The program will not allow you to open a default private image with AutoCAD.</p>
|
6 |
-
<p>The new version of AutoCAD offers additional tools such as two-dimensional (2D) floor plan and 3D rendering tools. You can create a 2D floor plan and can also use it as a reference when creating 3D objects. New 3D tools include the ability to view 3D models from different perspectives and perform 3D rotations, scaling and translations. The program includes integrated Viewers, which support most industry-standard file formats, including native DWG, DGN, DXF, and PDF. The program also includes a built-in application programming interface (API) that lets programmers automate many AutoCAD tasks. AutoCAD 2017 is a Professional product and is not free.</p> 899543212b<br />
|
7 |
-
<br />
|
8 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1gistliPinn/ChatGPT4/Examples/Code-de-la-route-en-anglais-pdf.md
DELETED
@@ -1,26 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>How to Learn the French Road Traffic Rules in English</h1>
|
3 |
-
<p>If you are planning to drive in France, you need to know the <strong>code de la route</strong>, or the road traffic rules. These rules are different from those in other countries, and they can be challenging to learn if you don't speak French. Fortunately, there are some resources that can help you learn the code de la route in English.</p>
|
4 |
-
<h2>code-de-la-route-en-anglais-pdf</h2><br /><p><b><b>Download</b> ☆☆☆ <a href="https://imgfil.com/2uxY7U">https://imgfil.com/2uxY7U</a></b></p><br /><br />
|
5 |
-
<p>One of the best ways to prepare for driving in France is to take your theory test, or <strong>passer le code de la route</strong>. This is a mandatory exam that you need to pass before you can take your practical driving test. The theory test consists of 40 multiple-choice questions based on the French road traffic laws, signs, and signals. You need to answer at least 35 questions correctly to pass.</p>
|
6 |
-
<p>To take your theory test in English, you need to find an authorized center that offers the test in English. You can search for a center near you on the official website of the French Ministry of Interior: <a href="https://www.interieur.gouv.fr/Le-ministere/Securite-routiere/Permis-de-conduire/Le-code-de-la-route">https://www.interieur.gouv.fr/Le-ministere/Securite-routiere/Permis-de-conduire/Le-code-de-la-route</a>. You also need to register online and pay a fee of 30 euros. You can then book a date and time for your test.</p>
|
7 |
-
<p>To study for your theory test, you can use various materials that are available in English. One of them is a PDF document that summarizes the main points of the code de la route. You can download it for free from this website: <a href="https://www.scribd.com/document/612594500/Code-de-La-Route-en-Anglais-Janv-2003">https://www.scribd.com/document/612594500/Code-de-La-Route-en-Anglais-Janv-2003</a>. This document covers topics such as speed limits, priority rules, traffic signs, signals, and markings, parking regulations, alcohol and drug limits, and penalties.</p>
|
8 |
-
<p>Another useful resource is an online dictionary that translates the most common terms and expressions related to the code de la route. You can access it here: <a href="https://www.wordreference.com/fren/code%20de%20la%20route">https://www.wordreference.com/fren/code%20de%20la%20route</a>. This dictionary can help you understand the questions and answers on the theory test, as well as communicate with other drivers and authorities on the road.</p>
|
9 |
-
<p></p>
|
10 |
-
<p>Finally, you can also watch some videos that explain the code de la route in English. For example, this YouTube channel offers a series of videos that cover different aspects of the code de la route: <a href="https://www.youtube.com/watch?v=G5e7HqXboAQ">https://www.youtube.com/watch?v=G5e7HqXboAQ</a>. These videos are short and easy to follow, and they include examples and illustrations.</p>
|
11 |
-
<p>By using these resources, you can learn the code de la route in English and prepare yourself for driving in France. Remember to always respect the rules and be courteous to other road users. Bonne route!</p>
|
12 |
-
|
13 |
-
<p>In addition to learning the code de la route in English, you may also want to familiarize yourself with some of the specific features of driving in France. Here are some tips and advice that can help you have a safe and enjoyable driving experience:</p>
|
14 |
-
<ul>
|
15 |
-
<li>Drive on the right side of the road and overtake on the left. This may seem obvious, but it can be confusing if you are used to driving on the left side of the road. Be especially careful at roundabouts, intersections, and exits.</li>
|
16 |
-
<li>Use your headlights at night and in poor visibility conditions. You should also use your headlights during the day when driving on motorways or dual carriageways. This is mandatory in France and it helps other drivers see you better.</li>
|
17 |
-
<li>Wear your seat belt at all times and make sure your passengers do the same. This is compulsory in France and it can save your life in case of an accident. Children under 10 years old must sit in the back seat and use an appropriate child restraint system.</li>
|
18 |
-
<li>Carry a valid driving license, insurance certificate, registration document, and proof of identity with you at all times. You may be asked to show these documents by the police or other authorities. If you are driving a rented car, you should also have the rental agreement with you.</li>
|
19 |
-
<li>Respect the speed limits and adjust your speed according to the road conditions. The general speed limits in France are 130 km/h on motorways, 110 km/h on dual carriageways, 90 km/h on other roads, and 50 km/h in built-up areas. However, these limits may vary depending on the weather, traffic, or road signs.</li>
|
20 |
-
<li>Avoid using your mobile phone while driving. This is prohibited in France and it can distract you from the road. If you need to make or receive a call, use a hands-free device or pull over to a safe place.</li>
|
21 |
-
<li>Do not drink and drive. The legal blood alcohol limit in France is 0.05%, which is lower than in some other countries. If you exceed this limit, you may face a fine, a suspension of your license, or even imprisonment.</li>
|
22 |
-
<li>Be aware of the environmental zones and toll roads in France. Some cities and regions have introduced low-emission zones that restrict the access of certain vehicles based on their emission standards. You need to obtain a special sticker called Crit'Air to enter these zones. You can order it online here: <a href="https://www.certificat-air.gouv.fr/en/">https://www.certificat-air.gouv.fr/en/</a>. Some roads and motorways in France also require you to pay a toll fee to use them. You can pay by cash, card, or an electronic device called Télépéage.</li>
|
23 |
-
</ul>
|
24 |
-
<p>By following these tips and advice, you can drive in France with confidence and enjoy the beauty and diversity of this country. Remember to always be respectful and courteous to other road users and follow the code de la route. Bon voyage!</p> d5da3c52bf<br />
|
25 |
-
<br />
|
26 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Download Caneta Azul Azul Caneta and Join the Fun of the Internet Sensation.md
DELETED
@@ -1,105 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Download Caneta Azul: How to Enjoy the Viral Song on Your Device</h1>
|
3 |
-
<p>If you are a fan of Brazilian music, you have probably heard of <strong>Caneta Azul</strong>, the viral song that took the internet by storm in 2019. The catchy tune, composed and performed by Manoel Gomes, has been covered by many famous artists and has inspired countless memes and parodies. But how can you download Caneta Azul and listen to it offline on your device? In this article, we will tell you everything you need to know about this phenomenon and how to enjoy it anytime, anywhere.</p>
|
4 |
-
<h2>What is Caneta Azul?</h2>
|
5 |
-
<h3>The origin and meaning of the song</h3>
|
6 |
-
<p>Caneta Azul, which means "blue pen" in Portuguese, is a song written by Manoel Gomes, a former security guard from Maranhão, Brazil. He wrote the song based on a personal experience of losing his blue pen at school and asking his classmates to return it. The lyrics are simple and repetitive, but they convey a sense of nostalgia and sadness for the lost object. The song also has a catchy melody and a distinctive vocal style that sounds like crying.</p>
|
7 |
-
<h2>download caneta azul</h2><br /><p><b><b>Download File</b> ✶ <a href="https://urlin.us/2uT1Db">https://urlin.us/2uT1Db</a></b></p><br /><br />
|
8 |
-
<h3>The popularity and impact of the song</h3>
|
9 |
-
<p>The song became viral after Gomes uploaded a video of himself singing it on social media in October 2019. The video quickly gained millions of views and was shared by many celebrities, such as Wesley Safadão, Simone Mendes, Tirullipa, and Neymar. The song also spawned numerous remixes, covers, and parodies in different musical genres and languages. Some examples are AtilaKw's remix with seven musical styles, Dudeth & Lukraya's electronic version, and Manoel Gomes' own bachata version. The song also became a cultural phenomenon, generating memes, merchandise, tattoos, and even a Wikipedia page. The song also earned Gomes fame and recognition, as he signed a contract with a record label and released his debut album in 2020.</p>
|
10 |
-
<h2>How to download Caneta Azul?</h2>
|
11 |
-
<h3>Download Caneta Azul from online platforms</h3>
|
12 |
-
<p>If you want to download Caneta Azul to your device, you have several options to choose from. You can use online platforms that allow you to download audio or video files from various sources. Here are some of the most popular ones:</p>
|
13 |
-
<h4>YouTube</h4>
|
14 |
-
<p>YouTube is the largest video-sharing platform in the world, where you can find many versions of Caneta Azul uploaded by different users. You can use online tools such as Y2mate or SaveFrom to download any YouTube video as an MP3 or MP4 file. Just copy the URL of the video you want to download and paste it into the tool's website. Then, choose the format and quality you prefer and click on "download". You can also use browser extensions or mobile apps that offer similar functions.</p>
|
15 |
-
<h4>SoundCloud</h4>
|
16 |
-
<p>SoundCloud is a popular audio platform that hosts millions of songs, podcasts, and other audio content. You can find several remixes and covers of Caneta Azul on SoundCloud, such as Dudeth & Lukraya's version. To download SoundCloud tracks, you can use online tools such as KlickAud or ScloudDownloader. Just copy the URL of the track you want to download and paste it into the tool's website. Then, click on "download" and save the file to your device <h4>Spotify</h4>
|
17 |
-
<p>Spotify is one of the most popular music streaming platforms in the world, where you can find millions of songs, podcasts, and playlists. You can also find the original version of Caneta Azul by Manoel Gomes on Spotify, as well as his debut album with 18 tracks. To download Caneta Azul from Spotify, you need to have a premium subscription, which costs $9.99 per month. With a premium account, you can download up to 10,000 songs on five different devices and listen to them offline. To download Caneta Azul from Spotify, just follow these steps:</p>
|
18 |
-
<ul>
|
19 |
-
<li>Open the Spotify app on your device and search for Caneta Azul by Manoel Gomes.</li>
|
20 |
-
<li>Tap on the song and then tap on the three dots icon at the top right corner.</li>
|
21 |
-
<li>Select "Download" from the menu and wait for the song to be downloaded.</li>
|
22 |
-
<li>You can also download the whole album by tapping on the download toggle at the top of the album page.</li>
|
23 |
-
<li>To access your downloaded songs, go to "Your Library" and then "Liked Songs" or "Albums". You can also create a playlist with your downloaded songs and toggle on the download option.</li>
|
24 |
-
</ul>
|
25 |
-
<h3>Download Caneta Azul from mobile apps</h3>
|
26 |
-
<p>If you prefer to use mobile apps that are dedicated to Caneta Azul, you have some options as well. These apps are designed to let you enjoy the song in different ways, such as playing games, making memes, or singing karaoke. Here are some of the best apps for Caneta Azul:</p>
|
27 |
-
<h4>Caneta Azul, Azul Caneta for Android</h4>
|
28 |
-
<p>This app is a game based on the song Caneta Azul. You have to help José, the protagonist of the song, to run as far as possible and collect blue pens along the way. You also have to avoid obstacles such as cars, buses, and birds. The app features the original song as the background music and has funny sound effects. You can also share your score with your friends and challenge them to beat it. The app is free to download and play, but it contains ads. You can download it from Google Play Store.</p>
|
29 |
-
<h4>Caneta Azul - Dudeth & Lukraya for iOS</h4>
|
30 |
-
<p>This app is an electronic version of Caneta Azul by Dudeth & Lukraya, a duo of Brazilian DJs and producers. The app lets you listen to the song and watch a video clip with animations and effects. You can also control the speed and pitch of the song, as well as add filters and stickers to the video. The app is free to download and use, but it requires an internet connection. You can download it from App Store.</p>
|
31 |
-
<h4>Caneta Azul - Manoel Gomes for Windows Phone</h4>
|
32 |
-
<p>This app is a karaoke app that allows you to sing along with Manoel Gomes' Caneta Azul. The app shows you the lyrics of the song and plays the instrumental version of it. You can also record your voice and share it with your friends. The app is free to download and use, but it contains ads. You can download it from Microsoft Store.</p>
|
33 |
-
<p>download caneta azul remix<br />
|
34 |
-
download caneta azul mp3<br />
|
35 |
-
download caneta azul album<br />
|
36 |
-
download caneta azul video<br />
|
37 |
-
download caneta azul song<br />
|
38 |
-
download caneta azul lyrics<br />
|
39 |
-
download caneta azul ringtone<br />
|
40 |
-
download caneta azul karaoke<br />
|
41 |
-
download caneta azul instrumental<br />
|
42 |
-
download caneta azul parody<br />
|
43 |
-
download caneta azul meme<br />
|
44 |
-
download caneta azul original<br />
|
45 |
-
download caneta azul bachata<br />
|
46 |
-
download caneta azul 2022<br />
|
47 |
-
download caneta azul 2023<br />
|
48 |
-
download caneta azul manoel gomes<br />
|
49 |
-
download caneta azul atilakw<br />
|
50 |
-
download caneta azul wesley safadao<br />
|
51 |
-
download caneta azul simone mendes<br />
|
52 |
-
download caneta azul gusttavo lima<br />
|
53 |
-
download caneta azul amado batista<br />
|
54 |
-
download caneta azul laercio da costa<br />
|
55 |
-
download caneta azul qes music<br />
|
56 |
-
download caneta azul youtube<br />
|
57 |
-
download caneta azul wikipedia<br />
|
58 |
-
download caneta azul know your meme<br />
|
59 |
-
download caneta azul spotify<br />
|
60 |
-
download caneta azul apple music<br />
|
61 |
-
download caneta azul deezer<br />
|
62 |
-
download caneta azul soundcloud<br />
|
63 |
-
download caneta azul amazon music<br />
|
64 |
-
download caneta azul tidal<br />
|
65 |
-
download caneta azul napster<br />
|
66 |
-
download caneta azul pandora<br />
|
67 |
-
download caneta azul iheartradio<br />
|
68 |
-
download caneta azul audiomack<br />
|
69 |
-
download caneta azul bandcamp<br />
|
70 |
-
download caneta azul reverbnation<br />
|
71 |
-
download caneta azul datpiff<br />
|
72 |
-
download caneta azul mixcloud</p>
|
73 |
-
<h2>Conclusion</h2>
|
74 |
-
<h3>Summary of the main points</h3>
|
75 |
-
<p>In this article, we have explained what Caneta Azul is, how it became viral, and how you can download it to your device. We have also suggested some online platforms and mobile apps that let you enjoy the song in different ways. Whether you want to listen to it offline, play a game with it, or sing along with it, there is an option for you.</p>
|
76 |
-
<h3>Call to action</h3>
|
77 |
-
<p>Now that you know how to download Caneta Azul, why not give it a try? Download your favorite version of the song and have fun with it. You can also share it with your friends and family and spread the joy of Caneta Azul. And if you liked this article, please share it with others who might be interested in Caneta Azul too.</p>
|
78 |
-
<h2>Frequently Asked Questions</h2>
|
79 |
-
<ol>
|
80 |
-
<li><strong>What does Caneta Azul mean?</strong></li>
|
81 |
-
<p>Caneta Azul means "blue pen" in Portuguese. It is the title of a viral song by Manoel Gomes, a Brazilian singer-songwriter who wrote it based on his personal experience of losing his blue pen at school.</p>
|
82 |
-
<li><strong>Who is Manoel Gomes?</strong></li>
|
83 |
-
<p>Manoel Gomes is a former security guard from Maranhão, Brazil. He became famous after he uploaded a video of himself singing Caneta Azul on social media in 2019. The video went viral and was shared by many celebrities and influencers. He signed a contract with a record label and released his debut album in 2020.</p>
|
84 |
-
<li><strong>How can I download Caneta Azul?</strong></li>
|
85 |
-
<p>You can download Caneta Azul from various online platforms and mobile apps. Some of the online platforms are YouTube, SoundCloud, and Spotify. Some of the mobile apps are Caneta Azul, Azul Caneta for Android, Caneta Azul - Dudeth & Lukraya for iOS, and Caneta Azul - Manoel Gomes for Windows Phone. You can use online tools or browser extensions to download audio or video files from the online platforms. You can also use the premium subscription of Spotify to download songs offline. You can download the mobile apps from the respective app stores and enjoy the song in different ways.</p>
|
86 |
-
<li><strong>What are some of the benefits of downloading Caneta Azul?</strong></li>
|
87 |
-
<p>Downloading Caneta Azul can bring you many benefits, such as:</p>
|
88 |
-
<ul>
|
89 |
-
<li>You can listen to the song offline without an internet connection.</li>
|
90 |
-
<li>You can save your data and battery by not streaming the song online.</li>
|
91 |
-
<li>You can have fun with the song by playing games, making memes, or singing karaoke.</li>
|
92 |
-
<li>You can support the artist by downloading his song legally.</li>
|
93 |
-
<li>You can join the cultural phenomenon and share your love for Caneta Azul with others.</li>
|
94 |
-
</ul>
|
95 |
-
<li><strong>What are some of the challenges of downloading Caneta Azul?</strong></li>
|
96 |
-
<p>Downloading Caneta Azul can also pose some challenges, such as:</p>
|
97 |
-
<ul>
|
98 |
-
<li>You may need to pay for some of the online platforms or mobile apps to download the song.</li>
|
99 |
-
<li>You may need to deal with ads or pop-ups when using some of the online tools or mobile apps.</li>
|
100 |
-
<li>You may need to have enough storage space on your device to download the song.</li>
|
101 |
-
<li>You may need to be careful about the quality and legality of the files you download.</li>
|
102 |
-
<li>You may need to be prepared for the possibility of getting addicted to the song and having it stuck in your head for a long time.</li>
|
103 |
-
</ul></p> 197e85843d<br />
|
104 |
-
<br />
|
105 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1phancelerku/anime-remove-background/Bloons TD 6 32.4 APK - How to Protect Your Towers and Team Up with Monkeys in this Offline Game.md
DELETED
@@ -1,159 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Bloons TD 6 32.4 APK: A Tower Defense Game with a Twist</h1>
|
3 |
-
<p>If you are looking for a fun and challenging tower defense game, you might want to check out <strong>Bloons TD 6</strong>. This game is the latest installment in the popular <em>Bloons</em> series, where you have to pop colorful balloons (or bloons) with your monkey towers and heroes. In this article, we will tell you everything you need to know about <strong>Bloons TD 6</strong>, including what it is, how to download and install it, how to play it effectively, and how to enjoy it more.</p>
|
4 |
-
<h2>bloons td 6 32.4 apk</h2><br /><p><b><b>Download Zip</b> - <a href="https://jinyurl.com/2uNMp3">https://jinyurl.com/2uNMp3</a></b></p><br /><br />
|
5 |
-
<h2>What is Bloons TD 6?</h2>
|
6 |
-
<p><strong>Bloons TD 6</strong> is a 3D tower defense game developed and published by Ninja Kiwi, a New Zealand-based game studio. It was released on June 14, 2018 for iOS, Android, and Windows platforms. It is the sixth main game in the <em>Bloons</em> franchise, and the sequel to <em>Bloons TD 5</em>.</p>
|
7 |
-
<h3>The gameplay of Bloons TD 6</h3>
|
8 |
-
<p>The gameplay of <strong>Bloons TD 6</strong> is similar to other tower defense games. You have to place your monkey towers along a path where the bloons will travel. Your goal is to pop all the bloons before they reach the end of the path and reduce your lives to zero. You can choose from different types of monkey towers, each with their own strengths and weaknesses. You can also upgrade your towers to make them more powerful and unlock new abilities.</p>
|
9 |
-
<p>However, <strong>Bloons TD 6</strong> also adds some new twists to the tower defense genre. For example, you can also use heroes, which are special monkey units that have unique skills and can level up automatically. You can also use powers and insta-monkeys, which are items that can give you an edge in difficult situations. Moreover, you can also customize your monkeys, bloons, animations, music, and more with the trophy store.</p>
|
10 |
-
<h3>The features of Bloons TD 6</h3>
|
11 |
-
<p><strong>Bloons TD 6</strong> has many features that make it a great tower defense game. Some of these features are:</p>
|
12 |
-
<ul>
|
13 |
-
<li><strong>Huge content:</strong> The game has regular updates that add new characters, features, and gameplay. It also has boss events, odysseys, contested territory, quests, content browser, and more.</li>
|
14 |
-
<li><strong>Epic monkey towers and heroes:</strong> The game has 23 powerful monkey towers, each with three upgrade paths and unique activated abilities. It also has paragons, which are the ultimate upgrades for each tower type. It also has 14 diverse heroes, each with their own signature upgrades and special abilities.</li>
|
15 |
-
<li><strong>Endless awesomeness:</strong> The game has four-player co-op mode, where you can play every map and mode with up to three other players in public or private games. It also has offline mode, where you can play single player even when your WiFi doesn’t work. It also has 68 handcrafted maps, with more added every update. It also has monkey knowledge, which are meta-upgrades that add <p>extra benefits to your towers and gameplay. It also has daily challenges, where you can test your skills and earn rewards. It also has sandbox mode, where you can experiment with unlimited money and lives.</li>
|
16 |
-
</ul>
|
17 |
-
<h2>How to download and install Bloons TD 6 32.4 APK?</h2>
|
18 |
-
<p>If you want to play <strong>Bloons TD 6</strong> on your Android device, you can download and install the latest version of the game from the Google Play Store. However, if you want to get the game for free, or if you want to access some features that are not available in the official version, you can download and install the <strong>Bloons TD 6 32.4 APK</strong> file from a third-party source.</p>
|
19 |
-
<h3>The steps to download and install Bloons TD 6 32.4 APK</h3>
|
20 |
-
<p>To download and install <strong>Bloons TD 6 32.4 APK</strong>, you need to follow these steps:</p>
|
21 |
-
<p>bloons td 6 32.4 apk mod unlimited money<br />
|
22 |
-
bloons td 6 32.4 apk download for android<br />
|
23 |
-
bloons td 6 32.4 apk free download latest version<br />
|
24 |
-
bloons td 6 32.4 apk obb data file<br />
|
25 |
-
bloons td 6 32.4 apk hack all towers unlocked<br />
|
26 |
-
bloons td 6 32.4 apk update new features<br />
|
27 |
-
bloons td 6 32.4 apk full game offline<br />
|
28 |
-
bloons td 6 32.4 apk cracked no root<br />
|
29 |
-
bloons td 6 32.4 apk premium access<br />
|
30 |
-
bloons td 6 32.4 apk best strategy guide<br />
|
31 |
-
bloons td 6 32.4 apk cheats tips and tricks<br />
|
32 |
-
bloons td 6 32.4 apk review gameplay video<br />
|
33 |
-
bloons td 6 32.4 apk how to install on pc<br />
|
34 |
-
bloons td 6 32.4 apk compatible devices list<br />
|
35 |
-
bloons td 6 32.4 apk support contact information<br />
|
36 |
-
bloons td 6 32.4 apk alternative download links<br />
|
37 |
-
bloons td 6 32.4 apk safe and secure verification<br />
|
38 |
-
bloons td 6 32.4 apk original file from ninja kiwi<br />
|
39 |
-
bloons td 6 32.4 apk fun and addictive tower defense game<br />
|
40 |
-
bloons td 6 32.4 apk new maps and modes added<br />
|
41 |
-
bloons td 6 32.4 apk online multiplayer co-op mode<br />
|
42 |
-
bloons td 6 32.4 apk custom challenges and daily quests<br />
|
43 |
-
bloons td 6 32.4 apk unlock and upgrade powerful monkeys<br />
|
44 |
-
bloons td 6 32.4 apk pop colorful balloons with different abilities<br />
|
45 |
-
bloons td 6 32.4 apk enjoy stunning graphics and animations<br />
|
46 |
-
bloons td 6 32.4 apk learn and master different strategies and tactics<br />
|
47 |
-
bloons td 6 32.4 apk earn achievements and rewards as you progress<br />
|
48 |
-
bloons td 6 32.4 apk compare your scores and rankings with other players<br />
|
49 |
-
bloons td 6 32.4 apk create and share your own custom maps and scenarios<br />
|
50 |
-
bloons td 6 32.4 apk explore the lore and history of the bloon world</p>
|
51 |
-
<ol>
|
52 |
-
<li><strong>Find a reliable source:</strong> You need to find a website that offers the <strong>Bloons TD 6 32.4 APK</strong> file for free and without viruses or malware. You can search for it on Google or use a trusted site like APKPure or APKMirror.</li>
|
53 |
-
<li><strong>Download the file:</strong> You need to click on the download button or link and save the <strong>Bloons TD 6 32.4 APK</strong> file on your device. You might need to enable the option to download files from unknown sources in your device settings.</li>
|
54 |
-
<li><strong>Install the file:</strong> You need to locate the <strong>Bloons TD 6 32.4 APK</strong> file on your device and tap on it to start the installation process. You might need to grant some permissions to the app during the installation.</li>
|
55 |
-
<li><strong>Launch the game:</strong> You need to open the app icon on your device and enjoy playing <strong>Bloons TD 6</strong>.</li>
|
56 |
-
</ol>
|
57 |
-
<h3>The benefits of downloading and installing Bloons TD 6 32.4 APK</h3>
|
58 |
-
<p>By downloading and installing <strong>Bloons TD 6 32.4 APK</strong>, you can enjoy some benefits that are not available in the official version of the game. Some of these benefits are:</p>
|
59 |
-
<ul>
|
60 |
-
<li><strong>Free access:</strong> You can get the game for free without paying any money or watching any ads.</li>
|
61 |
-
<li><strong>Unlimited resources:</strong> You can get unlimited money, lives, powers, insta-monkeys, monkey knowledge, and more in the game.</li>
|
62 |
-
<li><strong>All unlocked:</strong> You can unlock all the towers, heroes, upgrades, maps, modes, events, and more in the game.</li>
|
63 |
-
<li><strong>No root required:</strong> You do not need to root your device or modify any system files to play the game.</li>
|
64 |
-
<li><strong>No ban risk:</strong> You do not have to worry about getting banned or suspended from the game or losing your progress.</li>
|
65 |
-
</ul>
|
66 |
-
<h2>How to play Bloons TD 6 effectively?</h2>
|
67 |
-
<p><strong>Bloons TD 6</strong> is a fun and addictive game, but it can also be challenging and frustrating at times. If you want to play <strong>Bloons TD 6</strong> effectively, you need to learn some strategies, tips, and tricks that can help you pop more bloons and win more games.</p>
|
68 |
-
<h3>The best strategies, tips, and tricks for Bloons TD 6</h3>
|
69 |
-
<p>Here are some of the best strategies, tips, and tricks for <strong>Bloons TD 6</strong>:</p>
|
70 |
-
<ul>
|
71 |
-
<li><strong>Know your enemies:</strong> You need to know the different types of bloons and their properties, such as speed, health, immunity, resistance, weakness, etc. For example, red bloons are the weakest and slowest bloons, while purple bloons are immune to fire, plasma, and energy attacks.</li>
|
72 |
-
<li><strong>Know your allies:</strong> You need to know the different types of monkey towers and heroes and their abilities, such as damage, range, rate of fire, pierce, special effects, etc. For example, dart monkeys are cheap and versatile towers that can pop most bloons with their darts, while Quincy is a hero that can shoot arrows that pierce through multiple bloons.</li>
|
73 |
-
<li><strong>Plan ahead:</strong> You need to plan your strategy before placing your towers and heroes on the map. You need to consider factors such as map layout, bloon path, tower placement, tower synergy, tower upgrade path , hero choice, power usage, etc. You need to adapt your strategy according to the difficulty level, game mode, and bloon type.</li>
|
74 |
-
<li><strong>Pop smart:</strong> You need to pop the bloons efficiently and effectively. You need to use the right towers and heroes for the right bloons. You need to target the most dangerous bloons first, such as camo, lead, fortified, MOAB-class, etc. You need to use your tower abilities and powers wisely and timely.</li>
|
75 |
-
<li><strong>Have fun:</strong> You need to have fun while playing <strong>Bloons TD 6</strong>. You need to experiment with different combinations of towers, heroes, upgrades, and powers. You need to challenge yourself with different maps, modes, and events. You need to enjoy the colorful graphics, animations, sounds, and music of the game.</li>
|
76 |
-
</ul>
|
77 |
-
<h3>The best towers, heroes, and upgrades for Bloons TD 6</h3>
|
78 |
-
<p>There is no definitive answer to what are the best towers, heroes, and upgrades for <strong>Bloons TD 6</strong>, as it depends on your personal preference, play style, and strategy. However, here are some of the most popular and effective ones that you can try:</p>
|
79 |
-
<table>
|
80 |
-
<tr>
|
81 |
-
<th>Tower</th>
|
82 |
-
<th>Upgrade Path</th>
|
83 |
-
<th>Description</th>
|
84 |
-
</tr>
|
85 |
-
<tr>
|
86 |
-
<td>Ninja Monkey</td>
|
87 |
-
<td>2-0-3</td>
|
88 |
-
<td>This upgrade gives the ninja monkey the ability to throw shurikens that can pop four bloons each and can detect camo bloons. It also increases the attack speed and range of the ninja monkey.</td>
|
89 |
-
</tr>
|
90 |
-
<tr>
|
91 |
-
<td>Super Monkey</td>
|
92 |
-
<td>3-0-2</td>
|
93 |
-
<td>This upgrade gives the super monkey the ability to shoot plasma blasts that can pop 11 bloons each and have increased pierce and damage. It also increases the attack speed of the super monkey.</td>
|
94 |
-
</tr>
|
95 |
-
<tr>
|
96 |
-
<td>Bomb Shooter</td>
|
97 |
-
<td>2-0-4</td>
|
98 |
-
<td>This upgrade gives the bomb shooter the ability to shoot MOAB mauler bombs that deal extra damage to MOAB-class bloons. It also increases the blast radius and damage of the bomb shooter.</td>
|
99 |
-
</tr>
|
100 |
-
<tr>
|
101 |
-
<td>Alchemist</td>
|
102 |
-
<td>4-0-2</td>
|
103 |
-
<td>This upgrade gives the alchemist the ability to brew stronger potions that can buff up to three nearby monkeys with increased attack speed, damage, pierce, and range. It also increases the duration of the buff.</td>
|
104 |
-
</tr>
|
105 |
-
<tr>
|
106 |
-
<td>Banana Farm</td>
|
107 |
-
<td>2-3-0</td>
|
108 |
-
<td>This upgrade gives the banana farm the ability to produce valuable bananas that are worth more money. It also increases the amount of bananas produced per round.</td>
|
109 |
-
</tr>
|
110 |
-
</table>
|
111 |
-
<p>As for heroes, some of the most popular and effective ones are:</p>
|
112 |
-
<ul>
|
113 |
-
<li><strong>Gwendolin:</strong> She is a pyromaniac monkey that can shoot fireballs that deal splash damage and can pop lead and purple bloons. She can also use her abilities to create a ring of fire around her or set all bloons on fire.</li>
|
114 |
-
<li><strong>Obyn Greenfoot:</strong> He is a nature spirit that can shoot homing thorns that can pop two bloons each and can detect camo bloons. He can also use his abilities to summon a wall of trees that can swallow bloons or a bramble patch that can pop bloons.</li>
|
115 |
-
<li><strong>Ezili:</strong> She is a voodoo monkey that can shoot magic bolts that can pop two bloons each and can damage MOAB-class bloons. She can also use her abilities to hex a single bloon or MOAB-class bloon or unleash a powerful blast that can pop all bloons on screen.</li>
|
116 |
-
<li><strong>Adora:</strong> She is a divine monkey that can shoot holy bolts that can pop three bloons each and have increased pierce and damage. She can also use her abilities to transform into a powerful avatar or unleash a devastating sun beam.</li>
|
117 |
-
<li><strong>Sauda:</strong> She is a sword master monkey that can slash bloons with her blade that can pop four bloons each and have increased pierce and damage. She can also use her abilities to dash through multiple bloons or unleash a flurry of slashes.</li>
|
118 |
-
</ul>
|
119 |
-
<h2>How to enjoy Bloons TD 6 more?</h2>
|
120 |
-
<p><strong>Bloons TD 6</strong> is already a very enjoyable game, but there are ways to make it even more fun. Here are some suggestions on how to enjoy <strong>Bloons TD 6</strong> more:</p>
|
121 |
-
<h3>The modes and events of Bloons TD 6</h3>
|
122 |
-
<p><strong>Bloons TD 6</strong> has various modes and events that can spice up your gameplay and offer different challenges and rewards. Some of these modes and events are:</p>
|
123 |
-
<ul>
|
124 |
-
<li><strong>Impoppable mode:</strong> This is the hardest mode in the game, where the bloons are faster, stronger, and more numerous. You also have less money, lives, and monkey knowledge. You need to use your best skills and strategies to beat this mode.</li>
|
125 |
-
<li><strong>Chimps mode:</strong> This is a special mode where you have no continues, no hearts lost, no income, no powers, no selling, and no monkey knowledge. You need to rely on your towers and heroes alone to pop all the bloons.</li>
|
126 |
-
<li><strong>Apopalypse mode:</strong> This is a mode where the bloons never stop coming. You need to survive as long as possible and pop as many bloons as you can.</li>
|
127 |
-
<li><strong>Reverse mode:</strong> This is a mode where the bloons come from the opposite direction. You need to adjust your tower placement and strategy accordingly.</li>
|
128 |
-
<li><strong>Double HP MOABs mode:</strong> This is a mode where the MOAB-class bloons have double their normal health. You need to use more firepower and damage to pop them.</li>
|
129 |
-
<li><strong>Boss events:</strong> These are events where you have to face a giant boss bloon that has unique abilities and attacks. You need to use your towers and heroes wisely and cooperate with other players to defeat the boss.</li>
|
130 |
-
<li><strong>Odysseys:</strong> These are events where you have to complete a series of maps with limited towers and heroes. You need to plan your strategy carefully and manage your resources well.</li>
|
131 |
-
<li><strong>Contested territory:</strong> This is a competitive mode where you have to hold a territory for as long as possible against other players. You need to pop more bloons and earn more money than your opponents.</li>
|
132 |
-
</ul>
|
133 |
-
<h3>The community and content of Bloons TD 6</h3>
|
134 |
-
<p><strong>Bloons TD 6</strong> has a large and active community of players and fans that can enhance your gaming experience. You can join the community and access the content of <strong>Bloons TD 6</strong> by:</p>
|
135 |
-
<ul>
|
136 |
-
<li><strong>Following the official social media accounts:</strong> You can follow the official Facebook, Twitter, Instagram, YouTube, Reddit, Discord, and Twitch accounts of Ninja Kiwi and <em>Bloons</em>. You can get the latest news, updates, announcements, tips, tricks, videos, streams, memes, fan art, contests, giveaways, and more.</li>
|
137 |
-
<li><strong>Creating and sharing your own content:</strong> You can create and share your own content with other players using the content browser. You can make your own maps, challenges, mods, skins, videos, guides, reviews, feedback, suggestions, etc.</li>
|
138 |
-
<li><strong>Playing with your friends or other players:</strong> You can play with your friends or other players in co-op mode or contested territory. You can chat with them, cooperate with them, compete with them, or just have fun with them.</li>
|
139 |
-
</ul>
|
140 |
-
<h2>Conclusion</h2>
|
141 |
-
<p><strong>Bloons TD 6</strong> is a tower defense game with a twist. It is a game where you have to pop colorful balloons (or bloons) with your monkey towers and heroes. It is a game that has huge content, epic monkey towers and heroes, endless awesomeness, and more. It is a game that you can download and install for free using the <strong>Bloons TD 6 32.4 APK</strong> file. It is a game that you can play effectively using the best strategies, tips, tricks, towers, heroes, and upgrades. It is a game that you can enjoy more by playing the modes and events, joining the community, and creating and sharing your own content.</p>
|
142 |
-
<p>If you are a fan of tower defense games, or if you are looking for a new and exciting game to play, you should definitely give <strong>Bloons TD 6</strong> a try. You will not regret it. You will have a blast popping bloons and saving the world with your monkeys and heroes.</p>
|
143 |
-
<p>So, what are you waiting for? Download and install the <strong>Bloons TD 6 32.4 APK</strong> file now and start your bloon popping adventure!</p>
|
144 |
-
<h3>FAQs</h3>
|
145 |
-
<p>Here are some frequently asked questions about <strong>Bloons TD 6</strong> and <strong>Bloons TD 6 32.4 APK</strong>:</p>
|
146 |
-
<ol>
|
147 |
-
<li><strong>Is Bloons TD 6 free?</strong>
|
148 |
-
<p><strong>Bloons TD 6</strong> is not free on the Google Play Store. It costs $4.99 to download and install the game. However, you can get the game for free by downloading and installing the <strong>Bloons TD 6 32.4 APK</strong> file from a third-party source.</p></li>
|
149 |
-
<li><strong>Is Bloons TD 6 safe?</strong>
|
150 |
-
<p><strong>Bloons TD 6</strong> is safe to play on your device. It does not contain any viruses, malware, or harmful content. However, you should be careful when downloading and installing the <strong>Bloons TD 6 32.4 APK</strong> file from a third-party source. You should only download and install the file from a reliable and trusted website.</p></li>
|
151 |
-
<li><strong>Is Bloons TD 6 online or offline?</strong>
|
152 |
-
<p><strong>Bloons TD 6</strong> can be played both online and offline. You can play online with other players in co-op mode or contested territory. You can also play offline with single player mode even when your WiFi doesn’t work.</p></li>
|
153 |
-
<li><strong>How to update Bloons TD 6?</strong>
|
154 |
-
<p>You can update <strong>Bloons TD 6</strong> by downloading and installing the latest version of the game from the Google Play Store. However, if you are using the <strong>Bloons TD 6 32.4 APK</strong> file, you need to download and install the latest version of the file from a third-party source.</p></li>
|
155 |
-
<li><strong>How to contact Bloons TD 6 support?</strong>
|
156 |
-
<p>You can contact <strong>Bloons TD 6</strong> support by emailing them at [email protected] or by visiting their website at https://ninjakiwi.com/support.</p></li>
|
157 |
-
</ol></p> 401be4b1e0<br />
|
158 |
-
<br />
|
159 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1phancelerku/anime-remove-background/Dragon Ball Legend Fighter The Ultimate 3D Battle Game APK Download.md
DELETED
@@ -1,101 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>Dragon Ball Legend Fighter APK: A Review</h1>
|
3 |
-
<p>If you are a fan of Dragon Ball, you might be interested in trying out a new game called Dragon Ball Legend Fighter APK. This is a classic fighting game that features your favorite characters from the popular anime and manga series. You can transform into powerful warriors, fight against epic bosses, and compete with other players online. But is this game worth downloading and playing? In this article, we will review Dragon Ball Legend Fighter APK and tell you everything you need to know about it.</p>
|
4 |
-
<h2>dragon ball legend fighter apk</h2><br /><p><b><b>Download File</b> ★★★ <a href="https://jinyurl.com/2uNOH0">https://jinyurl.com/2uNOH0</a></b></p><br /><br />
|
5 |
-
<h2>What is Dragon Ball Legend Fighter APK?</h2>
|
6 |
-
<p>Dragon Ball Legend Fighter APK is an Android game developed by OneStick, a studio that specializes in creating action games. The game is inspired by the legendary Dragon Ball franchise, which follows the adventures of Goku and his friends as they protect the Earth from various threats. The game features 29+ characters that you can choose from, each with their own unique abilities and transformations. You can also customize your character's appearance, skills, and equipment.</p>
|
7 |
-
<p>The game has four different modes that you can play: Versus, Tournament, Story, and Arcade. In Versus mode, you can fight against another player or the computer in a one-on-one match. In Tournament mode, you can join a bracket of 16 fighters and try to win the championship. In Story mode, you can follow the original plot of Dragon Ball and face off against iconic villains. In Arcade mode, you can challenge yourself with different levels of difficulty and earn rewards.</p>
|
8 |
-
<h2>How to download and install Dragon Ball Legend Fighter APK?</h2>
|
9 |
-
<p>If you want to play Dragon Ball Legend Fighter APK on your Android device, you will need to download and install the APK file from a reliable source. Here are the steps that you need to follow:</p>
|
10 |
-
<p>dragon ball legends apk download<br />
|
11 |
-
dragon ball legend fighter mod apk<br />
|
12 |
-
dragon ball legend fighter game<br />
|
13 |
-
dragon ball legends android game<br />
|
14 |
-
dragon ball legend fighter apk latest version<br />
|
15 |
-
dragon ball legends apk obb<br />
|
16 |
-
dragon ball legend fighter apk offline<br />
|
17 |
-
dragon ball legends apk hack<br />
|
18 |
-
dragon ball legend fighter apk free download<br />
|
19 |
-
dragon ball legends apk update<br />
|
20 |
-
dragon ball legend fighter apk full version<br />
|
21 |
-
dragon ball legends apk mod menu<br />
|
22 |
-
dragon ball legend fighter apk unlimited money<br />
|
23 |
-
dragon ball legends apk no verification<br />
|
24 |
-
dragon ball legend fighter apk for pc<br />
|
25 |
-
dragon ball legends apk pure<br />
|
26 |
-
dragon ball legend fighter apk revdl<br />
|
27 |
-
dragon ball legends apk mirror<br />
|
28 |
-
dragon ball legend fighter apk rexdl<br />
|
29 |
-
dragon ball legends apk uptodown<br />
|
30 |
-
dragon ball legend fighter apk android 1<br />
|
31 |
-
dragon ball legends apk data<br />
|
32 |
-
dragon ball legend fighter apk 2.9.5<br />
|
33 |
-
dragon ball legends apk old version<br />
|
34 |
-
dragon ball legend fighter apk 2023<br />
|
35 |
-
dragon ball legends apk ios<br />
|
36 |
-
dragon ball legend fighter apk 2022<br />
|
37 |
-
dragon ball legends apk online<br />
|
38 |
-
dragon ball legend fighter apk 2.9.2<br />
|
39 |
-
dragon ball legends apk original<br />
|
40 |
-
dragon ball legend fighter apk 2.9.1<br />
|
41 |
-
dragon ball legends apk english version<br />
|
42 |
-
dragon ball legend fighter apk español<br />
|
43 |
-
dragon ball legends apk global version<br />
|
44 |
-
dragon ball legend fighter apk one stick<br />
|
45 |
-
dragon ball legends apk japan version<br />
|
46 |
-
dragon ball legend fighter legendary battle of god<br />
|
47 |
-
dragon ball legends apk 3d action game<br />
|
48 |
-
dragon ball legend fighter z warriors transform<br />
|
49 |
-
dragon ball legends apk card action battles game</p>
|
50 |
-
<ol>
|
51 |
-
<li>Go to <a href="(^1^)">APKCombo</a> and search for "Dragon Ball Legend Fighter APK".</li>
|
52 |
-
<li>Select the latest version of the game (2.9.5) and click on "Download APK (64 MB)".</li>
|
53 |
-
<li>Wait for the download to finish and then open the file.</li>
|
54 |
-
<li>If you see a warning message that says "Install blocked", go to your device's settings and enable "Unknown sources".</li>
|
55 |
-
<li>Tap on "Install" and wait for the installation to complete.</li>
|
56 |
-
<li>Launch the game and enjoy!</li>
|
57 |
-
</ol>
|
58 |
-
<h2>How to play Dragon Ball Legend Fighter APK?</h2>
|
59 |
-
<p>Playing Dragon Ball Legend Fighter APK is easy and fun. You can control your character using the virtual joystick on the left side of the screen and use the buttons on the right side to perform actions. You can move around, jump, dodge, attack, block, charge energy, use special moves, and transform into different forms. You can also combine different buttons to create combos and unleash powerful attacks.</p>
|
60 |
-
<p>The game has a simple interface that shows your health bar, energy bar, transformation bar, ability cards, and timer. You can also see your opponent's information on the opposite side of the screen. The goal of each match is to reduce your opponent's health bar to zero before they do the same to you or before the time runs out.</p <h2>What are the pros and cons of Dragon Ball Legend Fighter APK?</h2>
|
61 |
-
<p>Like any other game, Dragon Ball Legend Fighter APK has its pros and cons. Here are some of the advantages and disadvantages of playing this game:</p>
|
62 |
-
<table>
|
63 |
-
<tr>
|
64 |
-
<th>Pros</th>
|
65 |
-
<th>Cons</th>
|
66 |
-
</tr>
|
67 |
-
<tr>
|
68 |
-
<td>- The game has high-quality graphics and sound effects that make the gameplay more immersive and realistic.</td>
|
69 |
-
<td>- The game requires a lot of storage space and may not run smoothly on low-end devices.</td>
|
70 |
-
</tr>
|
71 |
-
<tr>
|
72 |
-
<td>- The game has a large roster of characters that you can unlock and customize to your liking.</td>
|
73 |
-
<td>- The game can be repetitive and boring after a while, especially if you play the same mode or character over and over.</td>
|
74 |
-
</tr>
|
75 |
-
<tr>
|
76 |
-
<td>- The game has a variety of modes that you can choose from, depending on your mood and preference.</td>
|
77 |
-
<td>- The game can be frustrating and challenging, especially if you face stronger opponents or higher difficulty levels.</td>
|
78 |
-
</tr>
|
79 |
-
<tr>
|
80 |
-
<td>- The game has an online multiplayer feature that allows you to compete with other players around the world.</td>
|
81 |
-
<td>- The game can have connectivity issues and lag problems that can affect your performance and enjoyment.</td>
|
82 |
-
</tr>
|
83 |
-
</table>
|
84 |
-
<h2>How does Dragon Ball Legend Fighter APK compare to other Dragon Ball games?</h2>
|
85 |
-
<p>Dragon Ball Legend Fighter APK is not the only Dragon Ball game that you can play on your Android device. There are many other games that are based on the same franchise, such as Dragon Ball Z Dokkan Battle, Dragon Ball Legends, Dragon Ball Z Kakarot, and more. How does Dragon Ball Legend Fighter APK compare to these games?</p>
|
86 |
-
<p>Well, it depends on what you are looking for in a Dragon Ball game. If you want a casual and simple fighting game that lets you relive the classic battles from the series, then Dragon Ball Legend Fighter APK might be a good choice for you. However, if you want a more complex and strategic game that involves collecting cards, building teams, upgrading characters, and exploring stories, then you might prefer one of the other games. Ultimately, it is up to you to decide which game suits your taste and style best.</p>
|
87 |
-
<h2>Conclusion</h2>
|
88 |
-
<p>Dragon Ball Legend Fighter APK is a fun and exciting fighting game that lets you experience the thrill of being a Dragon Ball fighter. You can choose from a wide range of characters, customize your skills and equipment, and fight against various enemies in different modes. You can also play online with other players and test your skills and strategies. However, the game also has some drawbacks, such as requiring a lot of storage space, being repetitive and challenging, and having connectivity issues. Therefore, you should weigh the pros and cons before downloading and playing this game.</p>
|
89 |
-
<p>If you are a fan of Dragon Ball and enjoy fighting games, then you might want to give Dragon Ball Legend Fighter APK a try. You can download it from <a href="">APKCombo</a> for free and start your adventure as a legendary fighter. Who knows, maybe you will become the next Super Saiyan!</p>
|
90 |
-
<h2>FAQs</h2>
|
91 |
-
<p>Here are some frequently asked questions and answers about Dragon Ball Legend Fighter APK:</p>
|
92 |
-
<ol>
|
93 |
-
<li><b>Is Dragon Ball Legend Fighter APK safe to download and install?</b><br>Yes, as long as you download it from a trusted source like <a href="">APKCombo</a>, which scans all the files for viruses and malware. However, you should always be careful when downloading any APK file from unknown sources, as they might contain harmful or malicious content.</li>
|
94 |
-
<li><b>Is Dragon Ball Legend Fighter APK legal to play?</b><br>Yes, as long as you do not use any cheats, hacks, or mods that alter the game's functionality or give you an unfair advantage over other players. However, you should be aware that the game is not officially licensed or endorsed by the creators of Dragon Ball, so it might violate some intellectual property rights or terms of service.</li>
|
95 |
-
<li><b>How can I get more characters in Dragon Ball Legend Fighter APK?</b><br>You can unlock more characters by playing the Story mode or by purchasing them with coins or gems. You can earn coins by winning matches or completing tasks, and you can earn gems by watching ads or buying them with real money.</li>
|
96 |
-
<li><b>How can I transform into different forms in Dragon Ball Legend Fighter APK?</b><br>You can transform into different forms by filling up your transformation bar with energy. You can charge energy by holding down the charge button or by landing hits on your opponent. Once your transformation bar is full, you can tap on it to activate your transformation. You can also tap on it again to revert back to your normal form. Different forms have different advantages and disadvantages, such as speed, power, defense, and energy consumption.</li>
|
97 |
-
<li><b>How can I play online with other players in Dragon Ball Legend Fighter APK?</b><br>You can play online with other players by selecting the Versus mode and choosing the Online option. You can then search for an opponent or create a room and invite your friends. You will need a stable internet connection to play online, otherwise you might experience lag or disconnection.</li>
|
98 |
-
</ol>
|
99 |
-
<p>I hope this article has helped you learn more about Dragon Ball Legend Fighter APK and how to play it. If you have any questions or feedback, feel free to leave a comment below. Thank you for reading and have fun!</p> 401be4b1e0<br />
|
100 |
-
<br />
|
101 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1phancelerku/anime-remove-background/Enjoy TikTok on Your Computer with These Easy Steps.md
DELETED
@@ -1,95 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>How to Download TikTok in Computer</h1>
|
3 |
-
<p>TikTok is a video-sharing app that allows users to create and share short-form videos on any topic. It’s mainly mobile-based, although you can still watch TikTok videos using the web app. The platform allows users to get creative with their content using filters, stickers, voiceovers, sound effects, and background music.</p>
|
4 |
-
<h2>download tiktok in computer</h2><br /><p><b><b>Download File</b> ··· <a href="https://jinyurl.com/2uNOvV">https://jinyurl.com/2uNOvV</a></b></p><br /><br />
|
5 |
-
<p>TikTok is one of the most popular social media apps in the world, with over one billion active users. It’s especially popular among teens and young adults who enjoy watching and making videos that are entertaining, spontaneous, and genuine. Whether you’re a sports fanatic, a pet enthusiast, or just looking for a laugh, there’s something for everyone on TikTok.</p>
|
6 |
-
<p>But what if you want to download TikTok in computer? Maybe you want to watch TikTok videos on a bigger screen, or you want to create your own videos using your PC’s camera and microphone. Or maybe you just want to have another option besides your smartphone. Whatever your reason, there are two ways to download TikTok on PC: using an emulator or using the Microsoft Store. In this article, we’ll show you how to do both, as well as how to download TikTok videos on PC using a video downloader software.</p>
|
7 |
-
<h2>How to Download TikTok in Computer Using an Emulator</h2>
|
8 |
-
<p>An emulator is a software that mimics a smartphone on your computer. You can use an emulator to run Android apps on your PC, including TikTok. One of the most popular emulators is Bluestacks, which is free and easy to use. Here are the steps to download and install Bluestacks emulator and TikTok app on your PC.</p>
|
9 |
-
<ol>
|
10 |
-
<li>Go to <a href="(^1^)">Bluestacks website</a> and click Download Bluestacks.</li>
|
11 |
-
<li>Run the installer file and follow the instructions to install Bluestacks on your PC.</li>
|
12 |
-
<li>Launch Bluestacks and sign in with your Google account.</li>
|
13 |
-
<li>Go to Google Play Store on Bluestacks and search for TikTok.</li>
|
14 |
-
<li>Click Install to download and install TikTok app on Bluestacks.</li>
|
15 |
-
<li>Open TikTok app on Bluestacks and sign in with your account or create a new one.</li>
|
16 |
-
<li>Enjoy watching and making TikTok videos on your PC.</li>
|
17 |
-
</ol>
|
18 |
-
<h2>How to Download TikTok in Computer Using the Microsoft Store</h2>
|
19 |
-
<p>The Microsoft Store is an online marketplace where you can download apps, games, movies, music, books, and more for your Windows devices. Since June 2021, you can also download the TikTok app from the Microsoft Store, which is available for Windows 10 or 11. You can also use the "Get app" button on the <a href="(^2^)">TikTok website</a> to access the Microsoft Store. Here <li>You can discover and watch videos from various categories, such as comedy, music, dance, sports, beauty, fashion, etc.</li>
|
20 |
-
<li>You can follow, like, comment, and chat with other users who share your interests or passions.</li>
|
21 |
-
<li>You can join or create challenges, trends, hashtags, or duets to participate in the TikTok community.</li>
|
22 |
-
<li>You can livestream your activities or events and interact with your fans or viewers in real time.</li>
|
23 |
-
<li>You can earn rewards or gifts from your fans or sponsors by creating quality content or engaging with them.</li>
|
24 |
-
</ul>
|
25 |
-
<h3>What are some of the alternatives to TikTok for PC?</h3>
|
26 |
-
<p>If you’re looking for some alternatives to TikTok for PC, you can try these apps:</p>
|
27 |
-
<ul>
|
28 |
-
<li><a href="">Instagram Reels</a>: This is a feature of Instagram that allows you to create and share 15-second videos with music, filters, and effects. You can also watch Reels from other users on the Explore tab.</li>
|
29 |
-
<li><a href="">YouTube Shorts</a>: This is a feature of YouTube that allows you to create and share 60-second videos with music, filters, and effects. You can also watch Shorts from other users on the Shorts tab.</li>
|
30 |
-
<li><a href="">Snapchat Spotlight</a>: This is a feature of Snapchat that allows you to create and share 60-second videos with music, filters, and effects. You can also watch Spotlight from other users on the Spotlight tab.</li>
|
31 |
-
<li><a href="">Triller</a>: This is a video-sharing app that allows you to create and share 60-second videos with music, filters, and effects. You can also watch Triller from other users on the Home tab.</li>
|
32 |
-
<li><a href="">Dubsmash</a>: This is a video-sharing app that allows you to create and share 10-second videos with music, filters, and effects. You can also watch Dubsmash from other users on the Home tab.</li>
|
33 |
-
</ul>
|
34 |
-
<h3>How can I use TikTok for business promotion?</h3>
|
35 |
-
<p>TikTok is not only a platform for entertainment but also a platform for business promotion. You can use TikTok to market your products or services, increase your brand awareness, or generate leads or sales. Here are some ways to use TikTok for business promotion:</p>
|
36 |
-
<ul>
|
37 |
-
<li>Create a business account and optimize your profile with your logo, bio, website link, etc.</li>
|
38 |
-
<li>Create engaging and relevant content that showcases your products or services, your brand story, your customer testimonials, your behind-the-scenes footage, etc.</li>
|
39 |
-
<li>Use hashtags, keywords, captions, and calls-to-action to increase your visibility and reach on TikTok.</li>
|
40 |
-
<li>Collaborate with influencers or celebrities who have a large and loyal following on TikTok.</li>
|
41 |
-
<li>Participate in challenges, trends, hashtags, or duets that are related to your niche or industry.</li>
|
42 |
-
<li>Run ads or campaigns on TikTok to target your ideal audience and drive them to your website or landing page.</li>
|
43 |
-
</ul>
|
44 |
-
<h3>How can I create a Duet or Stitch video on TikTok?</h3>
|
45 |
-
<p>A Duet or Stitch video is a type of video that allows you to collaborate with another user on TikTok. A Duet video is when you record a video alongside another user’s video. A Stitch video is when you record a video that adds to another user’s video. Here are the steps to create a Duet or Stitch video on TikTok:</p>
|
46 |
-
<ol>
|
47 |
-
<li>Find a video that you want to Duet or Stitch with on TikTok.</li>
|
48 |
-
<li>Tap the Share icon and select Duet or Stitch.</li>
|
49 |
-
<li>Record your video using the camera button. You can also add filters, stickers, voiceovers, sound effects, etc.</li>
|
50 |
-
<li>Tap the Checkmark icon when you’re done recording.</li>
|
51 |
-
<li>Edit your video using the tools at the bottom of the screen. You can also add captions, hashtags, tags, etc.</li>
|
52 |
-
<li>Tap Post to share your Duet or Stitch video on TikTok.</li>
|
53 |
-
</ol></p>
|
54 |
-
<p>download tiktok videos on pc<br />
|
55 |
-
download tiktok app for pc windows 10<br />
|
56 |
-
download tiktok apk for pc<br />
|
57 |
-
download tiktok on macbook<br />
|
58 |
-
download tiktok on pc without bluestacks<br />
|
59 |
-
download tiktok on pc microsoft store<br />
|
60 |
-
download tiktok on pc online<br />
|
61 |
-
download tiktok on pc with qr code<br />
|
62 |
-
download tiktok on pc using ssstiktok<br />
|
63 |
-
download tiktok on pc with qoob clips<br />
|
64 |
-
download tiktok for pc free<br />
|
65 |
-
download tiktok for pc windows 7<br />
|
66 |
-
download tiktok for pc windows 8<br />
|
67 |
-
download tiktok for pc windows xp<br />
|
68 |
-
download tiktok for pc latest version<br />
|
69 |
-
download tiktok for pc 64 bit<br />
|
70 |
-
download tiktok for pc 32 bit<br />
|
71 |
-
download tiktok for pc softonic<br />
|
72 |
-
download tiktok for pc filehippo<br />
|
73 |
-
download tiktok for pc uptodown<br />
|
74 |
-
how to download tiktok on pc 2023<br />
|
75 |
-
how to download tiktok on pc without emulator<br />
|
76 |
-
how to download tiktok on pc chromebook<br />
|
77 |
-
how to download tiktok on pc reddit<br />
|
78 |
-
how to download tiktok on pc quora<br />
|
79 |
-
how to download tiktok on pc with sound<br />
|
80 |
-
how to download tiktok on pc without watermark<br />
|
81 |
-
how to download tiktok on pc in hd<br />
|
82 |
-
how to download tiktok on pc using url<br />
|
83 |
-
how to download tiktok on pc using idm<br />
|
84 |
-
best way to download tiktok on pc<br />
|
85 |
-
easiest way to download tiktok on pc<br />
|
86 |
-
fastest way to download tiktok on pc<br />
|
87 |
-
safest way to download tiktok on pc<br />
|
88 |
-
cheapest way to download tiktok on pc<br />
|
89 |
-
can you download tiktok on pc<br />
|
90 |
-
can i download tiktok on my computer<br />
|
91 |
-
can we download tiktok on laptop<br />
|
92 |
-
can u download tiktok on macbook air<br />
|
93 |
-
can you watch live streams on tiktok on computer</p> 401be4b1e0<br />
|
94 |
-
<br />
|
95 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1phancelerku/anime-remove-background/Football Quiz 2022 How many of these World Cup facts can you get right?.md
DELETED
@@ -1,98 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Football Quiz 2022: How Well Do You Remember the Year in Soccer?</h1>
|
3 |
-
<p>If you are a football fan, you probably followed the action-packed year of 2022 with great interest and excitement. From the thrilling World Cup in Qatar to the drama-filled domestic leagues, there was no shortage of memorable moments and stories to keep you entertained.</p>
|
4 |
-
<h2>Introduction</h2>
|
5 |
-
<h3>Why take this quiz?</h3>
|
6 |
-
<p>Well, for one thing, it's fun! Who doesn't love a good quiz to test their knowledge and challenge their friends? Plus, it's a great way to refresh your memory and learn some new facts about the beautiful game. You might be surprised by how much you remember or how much you missed.</p>
|
7 |
-
<h2>football quiz 2022</h2><br /><p><b><b>Download Zip</b> ⚡ <a href="https://jinyurl.com/2uNTkG">https://jinyurl.com/2uNTkG</a></b></p><br /><br />
|
8 |
-
<h3>What to expect from this quiz?</h3>
|
9 |
-
<p>This quiz consists of 10 questions, each with four possible answers. The questions cover various topics and competitions related to football in 2022, such as the World Cup, the Champions League, the Premier League, and more. Some questions are easy, some are hard, and some are tricky. You will have to use your logic, your intuition, and your memory to get them right. At the end of the quiz, you will get your score and see how you compare to other football fans. Are you ready to take on the challenge?</p>
|
10 |
-
<h2>The Quiz</h2>
|
11 |
-
<h3>Question 1: Who won the FIFA World Cup in Qatar?</h3>
|
12 |
-
<h4>A) France B) Argentina C) Brazil D) Italy</h4>
|
13 |
-
<p>The correct answer is B) Argentina. The South American giants finally ended their 36-year drought and lifted their third World Cup trophy after beating France 4-2 in a thrilling final. Lionel Messi, who scored six goals and assisted four more in the tournament, was named the best player and won his first major title with his national team.</p>
|
14 |
-
<h3>Question 2: Who was the top scorer of the Premier League in 2022?</h3>
|
15 |
-
<h4>A) Harry Kane B) Mohamed Salah C) Erling Haaland D) Ivan Toney</h4>
|
16 |
-
<p>The correct answer is D) Ivan Toney. The Brentford striker had a sensational debut season in the top flight, scoring 27 goals and breaking the record for the most goals by a newly promoted player in Premier League history. He also won the Golden Boot award, beating Harry Kane and Mohamed Salah by one goal each.</p>
|
17 |
-
<h3>Question 3: Which team became the first African team to reach the World Cup semi-finals?</h3>
|
18 |
-
<h4>A) Morocco B) Cameroon C) Ghana D) Egypt</h4>
|
19 |
-
<p>The correct answer is C) Ghana. The Black Stars made history by becoming the first African team to reach the last four of the World Cup, after stunning Germany 2-1 in the quarter-finals. They were eventually knocked out by Argentina in a 3-2 thriller, but they won the hearts of many fans with their spirited and skillful performances.</p>
|
20 |
-
<h3>Question 4: Who scored the fastest hat-trick in Champions League history?</h3>
|
21 |
-
<h4>A) Kylian Mbappé B) Robert Lewandowski C) Cristiano Ronaldo D) Gonçalo Ramos</h4>
|
22 |
-
<p>The correct answer is D) Gonçalo Ramos. The Benfica youngster scored three goals in just six minutes and 18 seconds against Dynamo Kyiv in the group stage, breaking the previous record of eight minutes held by Mike Newell and Bafétimbi Gomis. Ramos, who was only 20 years old at the time, also became the youngest player to score a hat-trick in the Champions League.</p>
|
23 |
-
<p>football trivia 2022<br />
|
24 |
-
world cup 2022 quiz questions<br />
|
25 |
-
football quiz questions and answers 2022<br />
|
26 |
-
premier league quiz 2022<br />
|
27 |
-
football knowledge test 2022<br />
|
28 |
-
football quiz for kids 2022<br />
|
29 |
-
football quiz games 2022<br />
|
30 |
-
football quiz app 2022<br />
|
31 |
-
football quiz online 2022<br />
|
32 |
-
football quiz with friends 2022<br />
|
33 |
-
football quiz challenge 2022<br />
|
34 |
-
football quiz fun 2022<br />
|
35 |
-
football quiz hard 2022<br />
|
36 |
-
football quiz easy 2022<br />
|
37 |
-
football quiz multiple choice 2022<br />
|
38 |
-
football quiz true or false 2022<br />
|
39 |
-
football quiz guess the player 2022<br />
|
40 |
-
football quiz guess the team 2022<br />
|
41 |
-
football quiz guess the manager 2022<br />
|
42 |
-
football quiz guess the stadium 2022<br />
|
43 |
-
football quiz guess the logo 2022<br />
|
44 |
-
football quiz guess the country 2022<br />
|
45 |
-
football quiz guess the year 2022<br />
|
46 |
-
football quiz guess the score 2022<br />
|
47 |
-
football quiz guess the transfer 2022<br />
|
48 |
-
football quiz who am i 2022<br />
|
49 |
-
football quiz who said it 2022<br />
|
50 |
-
football quiz who won it 2022<br />
|
51 |
-
football quiz who scored it 2022<br />
|
52 |
-
football quiz who assisted it 2022<br />
|
53 |
-
football quiz who signed it 2022<br />
|
54 |
-
football quiz who managed it 2022<br />
|
55 |
-
football quiz who played it 2022<br />
|
56 |
-
football quiz who wore it 2022<br />
|
57 |
-
football quiz who sponsored it 2022<br />
|
58 |
-
football quiz how well do you know 2022<br />
|
59 |
-
football quiz how much do you remember 2022<br />
|
60 |
-
football quiz how many can you name 2022<br />
|
61 |
-
football quiz how many can you get right 2022<br />
|
62 |
-
football quiz how smart are you 2022<br />
|
63 |
-
football quiz what happened in 2022<br />
|
64 |
-
football quiz what team are you 2022<br />
|
65 |
-
football quiz what player are you 2022<br />
|
66 |
-
football quiz what manager are you 2022<br />
|
67 |
-
football quiz what position are you 2022<br />
|
68 |
-
football quiz what league are you in 2022<br />
|
69 |
-
football quiz what club should you support in 2022<br />
|
70 |
-
football quiz what is your style of play in 2022</p>
|
71 |
-
<h3>Question 5: Which team won the Copa América in 2022?</h3>
|
72 |
-
<h4>A) Colombia B) Uruguay C) Chile D) Brazil</h4>
|
73 |
-
<p>The correct answer is A) Colombia. The Cafeteros ended their 21-year wait for a continental title by beating Brazil 2-1 in the final, thanks to goals from Luis Díaz and Juan Cuadrado. Colombia also avenged their defeat to Brazil in the 2019 final, and denied them their third consecutive Copa América crown.</p>
|
74 |
-
<h3>Question 6: Who was the youngest manager in the World Cup 2022?</h3>
|
75 |
-
<h4>A) Lionel Scaloni B) Aliou Cissé C) Walid Regragui D) Gareth Southgate</h4>
|
76 |
-
<p>The correct answer is C) Walid Regragui. The former Morocco international was only 40 years old when he led Algeria to their second World Cup appearance, after replacing Djamel Belmadi in 2021. Regragui guided the Desert Foxes to the round of 16, where they lost to England on penalties.</p> <h3>Question 7: Which team had three players starting in the World Cup final?</h3>
|
77 |
-
<h4>A) Atlético Madrid B) PSG C) Real Madrid D) Tottenham Hotspur</h4>
|
78 |
-
<p>The correct answer is B) PSG. The French giants had three of their stars featuring in the World Cup final, namely Kylian Mbappé and Presnel Kimpembe for France, and Ángel Di María for Argentina. Mbappé scored a goal but could not prevent his team from losing, while Di María assisted the winner and was named the man of the match.</p>
|
79 |
-
<h3>Question 8: Which player did not score a goal in the knockout stages of the World Cup?</h3>
|
80 |
-
<h4>A) Denzel Dumfries B) Jordan Henderson C) Pepe D) Cristiano Ronaldo</h4>
|
81 |
-
<p>The correct answer is D) Cristiano Ronaldo. The Portugal captain had a disappointing World Cup, as he failed to score a single goal in the knockout stages. He did score four goals in the group stage, but his team was eliminated by Belgium in the round of 16. Ronaldo also missed a penalty in that game, which proved to be his last World Cup appearance.</p>
|
82 |
-
<h3>Question 9: How many yellow cards did England receive in their five matches at the World Cup?</h3>
|
83 |
-
<h4>A) None B) One C) Four D) Six</h4>
|
84 |
-
<p>The correct answer is A) None. England had a remarkable disciplinary record at the World Cup, as they did not receive any yellow or red cards in their five matches. They were the only team to achieve this feat, and they also conceded the fewest fouls (32) in the tournament.</p>
|
85 |
-
<h3>Question 10: Which team wore three different shirts in the World Cup?</h3>
|
86 |
-
<h4>A) France B) Canada C) Japan D) Belgium</h4>
|
87 |
-
<p>The correct answer is C) Japan. The Asian side wore three different shirts in their three group matches, each representing a different aspect of their culture and identity. They wore a blue shirt with a red sun against Colombia, a white shirt with red stripes against Poland, and a red shirt with white dots against Senegal.</p>
|
88 |
-
<h2>Conclusion</h2>
|
89 |
-
<h3>How did you do?</h3>
|
90 |
-
<p>So, how many questions did you get right? Did you ace the quiz or did you struggle? Here is a table that shows how well you did compared to other football fans:</p>
|
91 |
-
| Score | Rating | | --- | --- | | 10/10 | You are a football genius! You know everything there is to know about the beautiful game. You should be proud of yourself and brag to your friends. | | 8-9/10 | You are a football expert! You have an impressive knowledge of the game and its history. You only missed one or two questions, but that's okay. Nobody is perfect. | | 6-7/10 | You are a football fan! You have a good grasp of the game and its events. You got more than half of the questions right, which is commendable. You still have some room for improvement, though. | | 4-5/10 | You are a football novice! You have a basic understanding of the game and its rules. You got some questions right, but you also made some mistakes. You need to watch more football and learn more facts. | | 0-3/10 | You are a football beginner! You have little or no knowledge of the game and its players. You got most of the questions wrong, which is disappointing. You need to start from scratch and study hard. | <h3>What did you learn?</h3>
|
92 |
-
<p>Regardless of your score, we hope that you learned something new and interesting from this quiz. Maybe you discovered some facts that you didn't know before, or maybe you refreshed your memory on some events that you forgot. Either way, we hope that you enjoyed this quiz and that it sparked your curiosity and passion for football.</p>
|
93 |
-
<h3>What's next?</h3>
|
94 |
-
<p>If you liked this quiz, why not share it with your friends and challenge them to beat your score? You can also try some other quizzes on our website, covering different topics and levels of difficulty. Or you can read some of our articles and blogs about football, where you can find more information and insights about the game and its stars.</p>
|
95 |
-
<p>Thank you for taking this quiz and we hope to see you again soon!</p>
|
96 |
-
FAQs Q: When and where was the World Cup 2022 held? A: The World Cup 2022 was held from November 21 to December 18 in Qatar, which was the first Arab country to host the tournament. Q: Who was the oldest player in the World Cup 2022? A: The oldest player in the World Cup 2022 was Pepe, the Portugal defender, who was 39 years old at the time. Q: Who was the best goalkeeper in the World Cup 2022? A: The best goalkeeper in the World Cup 2022 was Gianluigi Donnarumma, the Italy keeper, who won the Golden Glove award after keeping five clean sheets and saving three penalties in the tournament. Q: Which team scored the most goals in the World Cup 2022? A: The team that scored the most goals in the World Cup 2022 was France, who netted 16 times in six matches, averaging 2.67 goals per game. Q: Which team had the best defense in the World Cup 2022? A: The team that had the best defense in the World Cup 2022 was England, who conceded only two goals in five matches, both from penalties, and had a goal difference of +10. Q: Which player won the Golden Ball award for the best player in the World Cup 2022? A: The player who won the Golden Ball award for the best player in the World Cup 2022 was Lionel Messi, the Argentina captain, who scored six goals and assisted four more in seven matches, and led his team to their first World Cup title since 1986.</p> 197e85843d<br />
|
97 |
-
<br />
|
98 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/2023Liu2023/bingo/src/components/ui/separator.tsx
DELETED
@@ -1,31 +0,0 @@
|
|
1 |
-
'use client'
|
2 |
-
|
3 |
-
import * as React from 'react'
|
4 |
-
import * as SeparatorPrimitive from '@radix-ui/react-separator'
|
5 |
-
|
6 |
-
import { cn } from '@/lib/utils'
|
7 |
-
|
8 |
-
const Separator = React.forwardRef<
|
9 |
-
React.ElementRef<typeof SeparatorPrimitive.Root>,
|
10 |
-
React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>
|
11 |
-
>(
|
12 |
-
(
|
13 |
-
{ className, orientation = 'horizontal', decorative = true, ...props },
|
14 |
-
ref
|
15 |
-
) => (
|
16 |
-
<SeparatorPrimitive.Root
|
17 |
-
ref={ref}
|
18 |
-
decorative={decorative}
|
19 |
-
orientation={orientation}
|
20 |
-
className={cn(
|
21 |
-
'shrink-0 bg-border',
|
22 |
-
orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]',
|
23 |
-
className
|
24 |
-
)}
|
25 |
-
{...props}
|
26 |
-
/>
|
27 |
-
)
|
28 |
-
)
|
29 |
-
Separator.displayName = SeparatorPrimitive.Root.displayName
|
30 |
-
|
31 |
-
export { Separator }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/4eJIoBek/Stable_Diffusion_1.4_openvino/demo_web.py
DELETED
@@ -1,124 +0,0 @@
|
|
1 |
-
# -- coding: utf-8 --`
|
2 |
-
import argparse
|
3 |
-
import os
|
4 |
-
import random
|
5 |
-
import streamlit as st
|
6 |
-
from streamlit_drawable_canvas import st_canvas
|
7 |
-
import numpy as np
|
8 |
-
import cv2
|
9 |
-
from PIL import Image, ImageEnhance
|
10 |
-
import numpy as np
|
11 |
-
# engine
|
12 |
-
from stable_diffusion_engine import StableDiffusionEngine
|
13 |
-
# scheduler
|
14 |
-
from diffusers import PNDMScheduler
|
15 |
-
|
16 |
-
|
17 |
-
def run(engine):
|
18 |
-
with st.form(key="request"):
|
19 |
-
with st.sidebar:
|
20 |
-
prompt = st.text_area(label='Enter prompt')
|
21 |
-
|
22 |
-
with st.expander("Initial image"):
|
23 |
-
init_image = st.file_uploader("init_image", type=['jpg','png','jpeg'])
|
24 |
-
stroke_width = st.slider("stroke_width", 1, 100, 50)
|
25 |
-
stroke_color = st.color_picker("stroke_color", "#00FF00")
|
26 |
-
canvas_result = st_canvas(
|
27 |
-
fill_color="rgb(0, 0, 0)",
|
28 |
-
stroke_width = stroke_width,
|
29 |
-
stroke_color = stroke_color,
|
30 |
-
background_color = "#000000",
|
31 |
-
background_image = Image.open(init_image) if init_image else None,
|
32 |
-
height = 512,
|
33 |
-
width = 512,
|
34 |
-
drawing_mode = "freedraw",
|
35 |
-
key = "canvas"
|
36 |
-
)
|
37 |
-
|
38 |
-
if init_image is not None:
|
39 |
-
init_image = cv2.cvtColor(np.array(Image.open(init_image)), cv2.COLOR_RGB2BGR)
|
40 |
-
|
41 |
-
if canvas_result.image_data is not None:
|
42 |
-
mask = cv2.cvtColor(canvas_result.image_data, cv2.COLOR_BGRA2GRAY)
|
43 |
-
mask[mask > 0] = 255
|
44 |
-
else:
|
45 |
-
mask = None
|
46 |
-
|
47 |
-
num_inference_steps = st.select_slider(
|
48 |
-
label='num_inference_steps',
|
49 |
-
options=range(1, 150),
|
50 |
-
value=32
|
51 |
-
)
|
52 |
-
|
53 |
-
guidance_scale = st.select_slider(
|
54 |
-
label='guidance_scale',
|
55 |
-
options=range(1, 21),
|
56 |
-
value=7
|
57 |
-
)
|
58 |
-
|
59 |
-
strength = st.slider(
|
60 |
-
label='strength',
|
61 |
-
min_value = 0.0,
|
62 |
-
max_value = 1.0,
|
63 |
-
value = 0.5
|
64 |
-
)
|
65 |
-
|
66 |
-
seed = st.number_input(
|
67 |
-
label='seed',
|
68 |
-
min_value = 0,
|
69 |
-
max_value = 2 ** 31,
|
70 |
-
value = random.randint(0, 2 ** 31)
|
71 |
-
)
|
72 |
-
|
73 |
-
generate = st.form_submit_button(label = 'Generate')
|
74 |
-
|
75 |
-
if prompt:
|
76 |
-
np.random.seed(seed)
|
77 |
-
image = engine(
|
78 |
-
prompt = prompt,
|
79 |
-
init_image = init_image,
|
80 |
-
mask = mask,
|
81 |
-
strength = strength,
|
82 |
-
num_inference_steps = num_inference_steps,
|
83 |
-
guidance_scale = guidance_scale
|
84 |
-
)
|
85 |
-
st.image(Image.fromarray(cv2.cvtColor(image, cv2.COLOR_BGR2RGB)), width=512)
|
86 |
-
|
87 |
-
@st.cache(allow_output_mutation=True)
|
88 |
-
def load_engine(args):
|
89 |
-
scheduler = PNDMScheduler(
|
90 |
-
beta_start=args.beta_start,
|
91 |
-
beta_end=args.beta_end,
|
92 |
-
beta_schedule=args.beta_schedule,
|
93 |
-
skip_prk_steps = True,
|
94 |
-
tensor_format="np"
|
95 |
-
)
|
96 |
-
engine = StableDiffusionEngine(
|
97 |
-
model = args.model,
|
98 |
-
scheduler = scheduler,
|
99 |
-
tokenizer = args.tokenizer
|
100 |
-
)
|
101 |
-
return engine
|
102 |
-
|
103 |
-
|
104 |
-
if __name__ == "__main__":
|
105 |
-
parser = argparse.ArgumentParser()
|
106 |
-
# pipeline configure
|
107 |
-
parser.add_argument("--model", type=str, default="4eJIoBek/stable-diffusion-v1-4-openvino-fp32", help="model name")
|
108 |
-
# scheduler params
|
109 |
-
parser.add_argument("--beta-start", type=float, default=0.00085, help="LMSDiscreteScheduler::beta_start")
|
110 |
-
parser.add_argument("--beta-end", type=float, default=0.012, help="LMSDiscreteScheduler::beta_end")
|
111 |
-
parser.add_argument("--beta-schedule", type=str, default="scaled_linear", help="LMSDiscreteScheduler::beta_schedule")
|
112 |
-
# tokenizer
|
113 |
-
parser.add_argument("--tokenizer", type=str, default="openai/clip-vit-large-patch14", help="tokenizer")
|
114 |
-
|
115 |
-
try:
|
116 |
-
args = parser.parse_args()
|
117 |
-
except SystemExit as e:
|
118 |
-
# This exception will be raised if --help or invalid command line arguments
|
119 |
-
# are used. Currently streamlit prevents the program from exiting normally
|
120 |
-
# so we have to do a hard exit.
|
121 |
-
os._exit(e.code)
|
122 |
-
|
123 |
-
engine = load_engine(args)
|
124 |
-
run(engine)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AIFILMS/ControlNet-Video/app.py
DELETED
@@ -1,359 +0,0 @@
|
|
1 |
-
from __future__ import annotations
|
2 |
-
import gradio as gr
|
3 |
-
import os
|
4 |
-
import cv2
|
5 |
-
import numpy as np
|
6 |
-
from PIL import Image
|
7 |
-
from moviepy.editor import *
|
8 |
-
from share_btn import community_icon_html, loading_icon_html, share_js
|
9 |
-
|
10 |
-
import pathlib
|
11 |
-
import shlex
|
12 |
-
import subprocess
|
13 |
-
|
14 |
-
is_shared_ui = True if "AIFILMS/ControlNet-Video" in os.environ['SPACE_ID'] else False
|
15 |
-
|
16 |
-
if os.getenv('SYSTEM') == 'spaces':
|
17 |
-
with open('patch') as f:
|
18 |
-
subprocess.run(shlex.split('patch -p1'), stdin=f, cwd='ControlNet')
|
19 |
-
|
20 |
-
base_url = 'https://huggingface.co/lllyasviel/ControlNet/resolve/main/annotator/ckpts/'
|
21 |
-
|
22 |
-
names = [
|
23 |
-
'body_pose_model.pth',
|
24 |
-
'dpt_hybrid-midas-501f0c75.pt',
|
25 |
-
'hand_pose_model.pth',
|
26 |
-
'mlsd_large_512_fp32.pth',
|
27 |
-
'mlsd_tiny_512_fp32.pth',
|
28 |
-
'network-bsds500.pth',
|
29 |
-
'upernet_global_small.pth',
|
30 |
-
]
|
31 |
-
|
32 |
-
for name in names:
|
33 |
-
command = f'wget https://huggingface.co/lllyasviel/ControlNet/resolve/main/annotator/ckpts/{name} -O {name}'
|
34 |
-
out_path = pathlib.Path(f'ControlNet/annotator/ckpts/{name}')
|
35 |
-
if out_path.exists():
|
36 |
-
continue
|
37 |
-
subprocess.run(shlex.split(command), cwd='ControlNet/annotator/ckpts/')
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
if(not is_shared_ui):
|
42 |
-
from model import (DEFAULT_BASE_MODEL_FILENAME, DEFAULT_BASE_MODEL_REPO,
|
43 |
-
DEFAULT_BASE_MODEL_URL, Model)
|
44 |
-
|
45 |
-
model = Model()
|
46 |
-
|
47 |
-
|
48 |
-
def controlnet(i, prompt, control_task, seed_in, ddim_steps, scale, low_threshold, high_threshold, value_threshold, distance_threshold, bg_threshold):
|
49 |
-
img= Image.open(i)
|
50 |
-
np_img = np.array(img)
|
51 |
-
|
52 |
-
a_prompt = "best quality, extremely detailed"
|
53 |
-
n_prompt = "longbody, lowres, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality"
|
54 |
-
num_samples = 1
|
55 |
-
image_resolution = 512
|
56 |
-
detect_resolution = 512
|
57 |
-
eta = 0.0
|
58 |
-
#low_threshold = 100
|
59 |
-
#high_threshold = 200
|
60 |
-
#value_threshold = 0.1
|
61 |
-
#distance_threshold = 0.1
|
62 |
-
#bg_threshold = 0.4
|
63 |
-
|
64 |
-
if control_task == 'Canny':
|
65 |
-
result = model.process_canny(np_img, prompt, a_prompt, n_prompt, num_samples,
|
66 |
-
image_resolution, ddim_steps, scale, seed_in, eta, low_threshold, high_threshold)
|
67 |
-
elif control_task == 'Depth':
|
68 |
-
result = model.process_depth(np_img, prompt, a_prompt, n_prompt, num_samples,
|
69 |
-
image_resolution, detect_resolution, ddim_steps, scale, seed_in, eta)
|
70 |
-
elif control_task == 'Hed':
|
71 |
-
result = model.process_hed(np_img, prompt, a_prompt, n_prompt, num_samples,
|
72 |
-
image_resolution, detect_resolution, ddim_steps, scale, seed_in, eta)
|
73 |
-
elif control_task == 'Hough':
|
74 |
-
result = model.process_hough(np_img, prompt, a_prompt, n_prompt, num_samples,
|
75 |
-
image_resolution, detect_resolution, ddim_steps, scale, seed_in, eta, value_threshold,
|
76 |
-
distance_threshold)
|
77 |
-
elif control_task == 'Normal':
|
78 |
-
result = model.process_normal(np_img, prompt, a_prompt, n_prompt, num_samples,
|
79 |
-
image_resolution, detect_resolution, ddim_steps, scale, seed_in, eta, bg_threshold)
|
80 |
-
elif control_task == 'Pose':
|
81 |
-
result = model.process_pose(np_img, prompt, a_prompt, n_prompt, num_samples,
|
82 |
-
image_resolution, detect_resolution, ddim_steps, scale, seed_in, eta)
|
83 |
-
elif control_task == 'Scribble':
|
84 |
-
result = model.process_scribble(np_img, prompt, a_prompt, n_prompt, num_samples,
|
85 |
-
image_resolution, ddim_steps, scale, seed_in, eta)
|
86 |
-
elif control_task == 'Seg':
|
87 |
-
result = model.process_seg(np_img, prompt, a_prompt, n_prompt, num_samples,
|
88 |
-
image_resolution, detect_resolution, ddim_steps, scale, seed_in, eta)
|
89 |
-
|
90 |
-
#print(result[0])
|
91 |
-
processor_im = Image.fromarray(result[0])
|
92 |
-
processor_im.save("process_" + control_task + "_" + str(i) + ".jpeg")
|
93 |
-
im = Image.fromarray(result[1])
|
94 |
-
im.save("your_file" + str(i) + ".jpeg")
|
95 |
-
return "your_file" + str(i) + ".jpeg", "process_" + control_task + "_" + str(i) + ".jpeg"
|
96 |
-
|
97 |
-
def change_task_options(task):
|
98 |
-
if task == "Canny" :
|
99 |
-
return canny_opt.update(visible=True), hough_opt.update(visible=False), normal_opt.update(visible=False)
|
100 |
-
elif task == "Hough" :
|
101 |
-
return canny_opt.update(visible=False),hough_opt.update(visible=True), normal_opt.update(visible=False)
|
102 |
-
elif task == "Normal" :
|
103 |
-
return canny_opt.update(visible=False),hough_opt.update(visible=False), normal_opt.update(visible=True)
|
104 |
-
else :
|
105 |
-
return canny_opt.update(visible=False),hough_opt.update(visible=False), normal_opt.update(visible=False)
|
106 |
-
|
107 |
-
def get_frames(video_in):
|
108 |
-
frames = []
|
109 |
-
#resize the video
|
110 |
-
clip = VideoFileClip(video_in)
|
111 |
-
|
112 |
-
#check fps
|
113 |
-
if clip.fps > 30:
|
114 |
-
print("vide rate is over 30, resetting to 30")
|
115 |
-
clip_resized = clip.resize(height=512)
|
116 |
-
clip_resized.write_videofile("video_resized.mp4", fps=30)
|
117 |
-
else:
|
118 |
-
print("video rate is OK")
|
119 |
-
clip_resized = clip.resize(height=512)
|
120 |
-
clip_resized.write_videofile("video_resized.mp4", fps=clip.fps)
|
121 |
-
|
122 |
-
print("video resized to 512 height")
|
123 |
-
|
124 |
-
# Opens the Video file with CV2
|
125 |
-
cap= cv2.VideoCapture("video_resized.mp4")
|
126 |
-
|
127 |
-
fps = cap.get(cv2.CAP_PROP_FPS)
|
128 |
-
print("video fps: " + str(fps))
|
129 |
-
i=0
|
130 |
-
while(cap.isOpened()):
|
131 |
-
ret, frame = cap.read()
|
132 |
-
if ret == False:
|
133 |
-
break
|
134 |
-
cv2.imwrite('kang'+str(i)+'.jpg',frame)
|
135 |
-
frames.append('kang'+str(i)+'.jpg')
|
136 |
-
i+=1
|
137 |
-
|
138 |
-
cap.release()
|
139 |
-
cv2.destroyAllWindows()
|
140 |
-
print("broke the video into frames")
|
141 |
-
|
142 |
-
return frames, fps
|
143 |
-
|
144 |
-
|
145 |
-
def convert(gif):
|
146 |
-
if gif != None:
|
147 |
-
clip = VideoFileClip(gif.name)
|
148 |
-
clip.write_videofile("my_gif_video.mp4")
|
149 |
-
return "my_gif_video.mp4"
|
150 |
-
else:
|
151 |
-
pass
|
152 |
-
|
153 |
-
|
154 |
-
def create_video(frames, fps, type):
|
155 |
-
print("building video result")
|
156 |
-
clip = ImageSequenceClip(frames, fps=fps)
|
157 |
-
clip.write_videofile(type + "_result.mp4", fps=fps)
|
158 |
-
|
159 |
-
return type + "_result.mp4"
|
160 |
-
|
161 |
-
|
162 |
-
def infer(prompt,video_in, control_task, seed_in, trim_value, ddim_steps, scale, low_threshold, high_threshold, value_threshold, distance_threshold, bg_threshold, gif_import):
|
163 |
-
if(is_shared_ui):
|
164 |
-
raise gr.Error("This Space doesn't work on this shared UI.")
|
165 |
-
print(f"""
|
166 |
-
———————————————
|
167 |
-
{prompt}
|
168 |
-
———————————————""")
|
169 |
-
|
170 |
-
# 1. break video into frames and get FPS
|
171 |
-
break_vid = get_frames(video_in)
|
172 |
-
frames_list= break_vid[0]
|
173 |
-
fps = break_vid[1]
|
174 |
-
n_frame = int(trim_value*fps)
|
175 |
-
|
176 |
-
if n_frame >= len(frames_list):
|
177 |
-
print("video is shorter than the cut value")
|
178 |
-
n_frame = len(frames_list)
|
179 |
-
|
180 |
-
# 2. prepare frames result arrays
|
181 |
-
processor_result_frames = []
|
182 |
-
result_frames = []
|
183 |
-
print("set stop frames to: " + str(n_frame))
|
184 |
-
|
185 |
-
for i in frames_list[0:int(n_frame)]:
|
186 |
-
controlnet_img = controlnet(i, prompt,control_task, seed_in, ddim_steps, scale, low_threshold, high_threshold, value_threshold, distance_threshold, bg_threshold)
|
187 |
-
#images = controlnet_img[0]
|
188 |
-
#rgb_im = images[0].convert("RGB")
|
189 |
-
|
190 |
-
# exporting the image
|
191 |
-
#rgb_im.save(f"result_img-{i}.jpg")
|
192 |
-
processor_result_frames.append(controlnet_img[1])
|
193 |
-
result_frames.append(controlnet_img[0])
|
194 |
-
print("frame " + i + "/" + str(n_frame) + ": done;")
|
195 |
-
|
196 |
-
processor_vid = create_video(processor_result_frames, fps, "processor")
|
197 |
-
final_vid = create_video(result_frames, fps, "final")
|
198 |
-
|
199 |
-
files = [processor_vid, final_vid]
|
200 |
-
if gif_import != None:
|
201 |
-
final_gif = VideoFileClip(final_vid)
|
202 |
-
final_gif.write_gif("final_result.gif")
|
203 |
-
final_gif = "final_result.gif"
|
204 |
-
|
205 |
-
files.append(final_gif)
|
206 |
-
print("finished !")
|
207 |
-
|
208 |
-
return final_vid, gr.Accordion.update(visible=True), gr.Video.update(value=processor_vid, visible=True), gr.File.update(value=files, visible=True), gr.Group.update(visible=True)
|
209 |
-
|
210 |
-
|
211 |
-
def clean():
|
212 |
-
return gr.Accordion.update(visible=False),gr.Video.update(value=None, visible=False), gr.Video.update(value=None), gr.File.update(value=None, visible=False), gr.Group.update(visible=False)
|
213 |
-
|
214 |
-
title = """
|
215 |
-
<div style="text-align: center; max-width: 700px; margin: 0 auto;">
|
216 |
-
<div
|
217 |
-
style="
|
218 |
-
display: inline-flex;
|
219 |
-
align-items: center;
|
220 |
-
gap: 0.8rem;
|
221 |
-
font-size: 1.75rem;
|
222 |
-
"
|
223 |
-
>
|
224 |
-
<h1 style="font-weight: 900; margin-bottom: 7px; margin-top: 5px;">
|
225 |
-
ControlNet Video
|
226 |
-
</h1>
|
227 |
-
</div>
|
228 |
-
<p style="margin-bottom: 10px; font-size: 94%">
|
229 |
-
Apply ControlNet to a video
|
230 |
-
</p>
|
231 |
-
</div>
|
232 |
-
"""
|
233 |
-
|
234 |
-
article = """
|
235 |
-
|
236 |
-
<div class="footer">
|
237 |
-
<p>
|
238 |
-
Follow <a href="https://twitter.com/fffiloni" target="_blank">Sylvain Filoni</a> for future updates 🤗
|
239 |
-
</p>
|
240 |
-
</div>
|
241 |
-
<div id="may-like-container" style="display: flex;justify-content: center;flex-direction: column;align-items: center;margin-bottom: 30px;">
|
242 |
-
<p>You may also like: </p>
|
243 |
-
<div id="may-like-content" style="display:flex;flex-wrap: wrap;align-items:center;height:20px;">
|
244 |
-
|
245 |
-
<svg height="20" width="148" style="margin-left:4px;margin-bottom: 6px;">
|
246 |
-
<a href="https://huggingface.co/spaces/fffiloni/Pix2Pix-Video" target="_blank">
|
247 |
-
<image href="https://img.shields.io/badge/🤗 Spaces-Pix2Pix_Video-blue" src="https://img.shields.io/badge/🤗 Spaces-Pix2Pix_Video-blue.png" height="20"/>
|
248 |
-
</a>
|
249 |
-
</svg>
|
250 |
-
|
251 |
-
</div>
|
252 |
-
|
253 |
-
</div>
|
254 |
-
|
255 |
-
"""
|
256 |
-
|
257 |
-
with gr.Blocks(css='style.css') as demo:
|
258 |
-
if(is_shared_ui):
|
259 |
-
with gr.Box():
|
260 |
-
top_description = gr.HTML(f'''
|
261 |
-
<div class="gr-prose" style="max-width: 80%">
|
262 |
-
<h2 style="margin-top: 0">Attention - This Space doesn't work in this shared UI</h2>
|
263 |
-
<p>For it to work, you can access the <a href="https://huggingface.co/spaces/fffiloni/ControlNet-Video">original</a> or duplicate this Space and run it on your own profile using a GPU. <a class="duplicate-button" style="display:inline-block" target="_blank" href="https://huggingface.co/spaces/{os.environ['SPACE_ID']}?duplicate=true"><img src="https://img.shields.io/badge/-Duplicate%20Space-blue?labelColor=white&style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAP5JREFUOE+lk7FqAkEURY+ltunEgFXS2sZGIbXfEPdLlnxJyDdYB62sbbUKpLbVNhyYFzbrrA74YJlh9r079973psed0cvUD4A+4HoCjsA85X0Dfn/RBLBgBDxnQPfAEJgBY+A9gALA4tcbamSzS4xq4FOQAJgCDwV2CPKV8tZAJcAjMMkUe1vX+U+SMhfAJEHasQIWmXNN3abzDwHUrgcRGmYcgKe0bxrblHEB4E/pndMazNpSZGcsZdBlYJcEL9Afo75molJyM2FxmPgmgPqlWNLGfwZGG6UiyEvLzHYDmoPkDDiNm9JR9uboiONcBXrpY1qmgs21x1QwyZcpvxt9NS09PlsPAAAAAElFTkSuQmCC&logoWidth=14" alt="Duplicate Space"></a></p>
|
264 |
-
</div>
|
265 |
-
''')
|
266 |
-
with gr.Column(elem_id="col-container"):
|
267 |
-
gr.HTML(title)
|
268 |
-
gr.HTML("""
|
269 |
-
<a style="display:inline-block" href="https://huggingface.co/spaces/fffiloni/ControlNet-Video?duplicate=true"><img src="https://img.shields.io/badge/-Duplicate%20Space-blue?labelColor=white&style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAP5JREFUOE+lk7FqAkEURY+ltunEgFXS2sZGIbXfEPdLlnxJyDdYB62sbbUKpLbVNhyYFzbrrA74YJlh9r079973psed0cvUD4A+4HoCjsA85X0Dfn/RBLBgBDxnQPfAEJgBY+A9gALA4tcbamSzS4xq4FOQAJgCDwV2CPKV8tZAJcAjMMkUe1vX+U+SMhfAJEHasQIWmXNN3abzDwHUrgcRGmYcgKe0bxrblHEB4E/pndMazNpSZGcsZdBlYJcEL9Afo75molJyM2FxmPgmgPqlWNLGfwZGG6UiyEvLzHYDmoPkDDiNm9JR9uboiONcBXrpY1qmgs21x1QwyZcpvxt9NS09PlsPAAAAAElFTkSuQmCC&logoWidth=14" alt="Duplicate Space"></a>
|
270 |
-
""", elem_id="duplicate-container")
|
271 |
-
with gr.Row():
|
272 |
-
with gr.Column():
|
273 |
-
video_inp = gr.Video(label="Video source", source="upload", type="filepath", elem_id="input-vid")
|
274 |
-
video_out = gr.Video(label="ControlNet video result", elem_id="video-output")
|
275 |
-
|
276 |
-
with gr.Group(elem_id="share-btn-container", visible=False) as share_group:
|
277 |
-
community_icon = gr.HTML(community_icon_html)
|
278 |
-
loading_icon = gr.HTML(loading_icon_html)
|
279 |
-
share_button = gr.Button("Share to community", elem_id="share-btn")
|
280 |
-
|
281 |
-
with gr.Accordion("Detailed results", visible=False) as detailed_result:
|
282 |
-
prep_video_out = gr.Video(label="Preprocessor video result", visible=False, elem_id="prep-video-output")
|
283 |
-
files = gr.File(label="Files can be downloaded ;)", visible=False)
|
284 |
-
|
285 |
-
with gr.Column():
|
286 |
-
#status = gr.Textbox()
|
287 |
-
|
288 |
-
prompt = gr.Textbox(label="Prompt", placeholder="enter prompt", show_label=True, elem_id="prompt-in")
|
289 |
-
|
290 |
-
with gr.Row():
|
291 |
-
control_task = gr.Dropdown(label="Control Task", choices=["Canny", "Depth", "Hed", "Hough", "Normal", "Pose", "Scribble", "Seg"], value="Pose", multiselect=False, elem_id="controltask-in")
|
292 |
-
seed_inp = gr.Slider(label="Seed", minimum=0, maximum=2147483647, step=1, value=123456, elem_id="seed-in")
|
293 |
-
|
294 |
-
with gr.Row():
|
295 |
-
trim_in = gr.Slider(label="Cut video at (s)", minimun=1, maximum=5, step=1, value=1)
|
296 |
-
|
297 |
-
with gr.Accordion("Advanced Options", open=False):
|
298 |
-
with gr.Tab("Diffusion Settings"):
|
299 |
-
with gr.Row(visible=False) as canny_opt:
|
300 |
-
low_threshold = gr.Slider(label='Canny low threshold', minimum=1, maximum=255, value=100, step=1)
|
301 |
-
high_threshold = gr.Slider(label='Canny high threshold', minimum=1, maximum=255, value=200, step=1)
|
302 |
-
|
303 |
-
with gr.Row(visible=False) as hough_opt:
|
304 |
-
value_threshold = gr.Slider(label='Hough value threshold (MLSD)', minimum=0.01, maximum=2.0, value=0.1, step=0.01)
|
305 |
-
distance_threshold = gr.Slider(label='Hough distance threshold (MLSD)', minimum=0.01, maximum=20.0, value=0.1, step=0.01)
|
306 |
-
|
307 |
-
with gr.Row(visible=False) as normal_opt:
|
308 |
-
bg_threshold = gr.Slider(label='Normal background threshold', minimum=0.0, maximum=1.0, value=0.4, step=0.01)
|
309 |
-
|
310 |
-
ddim_steps = gr.Slider(label='Steps', minimum=1, maximum=100, value=20, step=1)
|
311 |
-
scale = gr.Slider(label='Guidance Scale', minimum=0.1, maximum=30.0, value=9.0, step=0.1)
|
312 |
-
|
313 |
-
with gr.Tab("GIF import"):
|
314 |
-
gif_import = gr.File(label="import a GIF instead", file_types=['.gif'])
|
315 |
-
gif_import.change(convert, gif_import, video_inp, queue=False)
|
316 |
-
|
317 |
-
with gr.Tab("Custom Model"):
|
318 |
-
current_base_model = gr.Text(label='Current base model',
|
319 |
-
value="" if is_shared_ui else DEFAULT_BASE_MODEL_URL)
|
320 |
-
with gr.Row():
|
321 |
-
with gr.Column():
|
322 |
-
base_model_repo = gr.Text(label='Base model repo',
|
323 |
-
max_lines=1,
|
324 |
-
placeholder="" if is_shared_ui else DEFAULT_BASE_MODEL_REPO,
|
325 |
-
interactive=True)
|
326 |
-
base_model_filename = gr.Text(
|
327 |
-
label='Base model file',
|
328 |
-
max_lines=1,
|
329 |
-
placeholder="" if is_shared_ui else DEFAULT_BASE_MODEL_FILENAME,
|
330 |
-
interactive=True)
|
331 |
-
change_base_model_button = gr.Button('Change base model')
|
332 |
-
|
333 |
-
gr.HTML(
|
334 |
-
'''<p>You can use other base models by specifying the repository name and filename.<br />
|
335 |
-
The base model must be compatible with Stable Diffusion v1.5.</p>''')
|
336 |
-
if(not is_shared_ui):
|
337 |
-
change_base_model_button.click(fn=model.set_base_model,
|
338 |
-
inputs=[
|
339 |
-
base_model_repo,
|
340 |
-
base_model_filename,
|
341 |
-
],
|
342 |
-
outputs=current_base_model, queue=False)
|
343 |
-
|
344 |
-
submit_btn = gr.Button("Generate ControlNet video")
|
345 |
-
|
346 |
-
inputs = [prompt,video_inp,control_task, seed_inp, trim_in, ddim_steps, scale, low_threshold, high_threshold, value_threshold, distance_threshold, bg_threshold, gif_import]
|
347 |
-
outputs = [video_out, detailed_result, prep_video_out, files, share_group]
|
348 |
-
#outputs = [status]
|
349 |
-
|
350 |
-
|
351 |
-
gr.HTML(article)
|
352 |
-
control_task.change(change_task_options, inputs=[control_task], outputs=[canny_opt, hough_opt, normal_opt], queue=False)
|
353 |
-
submit_btn.click(clean, inputs=[], outputs=[detailed_result, prep_video_out, video_out, files, share_group], queue=False)
|
354 |
-
submit_btn.click(infer, inputs, outputs)
|
355 |
-
share_button.click(None, [], [], _js=share_js)
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
demo.queue(max_size=12).launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AIGC-Audio/AudioGPT/audio_detection/audio_infer/__init__.py
DELETED
File without changes
|
spaces/AUST001/video/app.py
DELETED
@@ -1,11 +0,0 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
import urllib.request
|
3 |
-
|
4 |
-
url = 'http://aust001.pythonanywhere.com/photo/test.avi'
|
5 |
-
def to_black(text):
|
6 |
-
if text=='love':
|
7 |
-
urllib.request.urlretrieve(url, 'uu.avi')
|
8 |
-
return 'uu.avi'
|
9 |
-
|
10 |
-
interface = gr.Interface(fn=to_black, inputs="text", outputs="video")
|
11 |
-
interface.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/buttons/Buttons.d.ts
DELETED
@@ -1,95 +0,0 @@
|
|
1 |
-
// import * as Phaser from 'phaser';
|
2 |
-
import Sizer from '../sizer/Sizer';
|
3 |
-
import { IConfig as IConfigButtons } from '../utils/buttongroup/Buttons';
|
4 |
-
|
5 |
-
export default Buttons;
|
6 |
-
|
7 |
-
declare namespace Buttons {
|
8 |
-
|
9 |
-
type AlignTypes = 'left' | 'top' | 'right' | 'bottom' | 'center';
|
10 |
-
|
11 |
-
interface IConfig extends Sizer.IConfig, IConfigButtons {
|
12 |
-
background?: Phaser.GameObjects.GameObject,
|
13 |
-
|
14 |
-
buttons?: Phaser.GameObjects.GameObject[],
|
15 |
-
|
16 |
-
expand?: boolean,
|
17 |
-
|
18 |
-
align?: AlignTypes,
|
19 |
-
}
|
20 |
-
}
|
21 |
-
|
22 |
-
declare class Buttons extends Sizer {
|
23 |
-
constructor(
|
24 |
-
scene: Phaser.Scene,
|
25 |
-
config?: Buttons.IConfig
|
26 |
-
);
|
27 |
-
|
28 |
-
emitButtonClick(
|
29 |
-
index: number | Phaser.GameObjects.GameObject
|
30 |
-
): this;
|
31 |
-
|
32 |
-
setButtonEnable(
|
33 |
-
index?: number | Phaser.GameObjects.GameObject | boolean,
|
34 |
-
enable?: boolean
|
35 |
-
): this;
|
36 |
-
|
37 |
-
toggleButtonEnable(
|
38 |
-
index?: number | Phaser.GameObjects.GameObject
|
39 |
-
): this;
|
40 |
-
|
41 |
-
getButtonEnable(
|
42 |
-
index: number | Phaser.GameObjects.GameObject
|
43 |
-
): boolean;
|
44 |
-
|
45 |
-
getButton(
|
46 |
-
index: number
|
47 |
-
): Phaser.GameObjects.GameObject | null;
|
48 |
-
|
49 |
-
addButton(
|
50 |
-
gameObject: Phaser.GameObjects.GameObject
|
51 |
-
): this;
|
52 |
-
|
53 |
-
removeButton(
|
54 |
-
gameObject: Phaser.GameObjects.GameObject,
|
55 |
-
destroyChild?: boolean
|
56 |
-
): this;
|
57 |
-
|
58 |
-
clearButtons(
|
59 |
-
destroyChild?: boolean
|
60 |
-
): this;
|
61 |
-
|
62 |
-
showButton(
|
63 |
-
index: number | Phaser.GameObjects.GameObject
|
64 |
-
): this;
|
65 |
-
|
66 |
-
hideButton(
|
67 |
-
index: number | Phaser.GameObjects.GameObject
|
68 |
-
): this;
|
69 |
-
|
70 |
-
forEachButtton(
|
71 |
-
callback: (button: Phaser.GameObjects.GameObject, index: number, buttons: Phaser.GameObjects.GameObject[]) => void,
|
72 |
-
scop?: unknown
|
73 |
-
): this;
|
74 |
-
|
75 |
-
readonly buttons: Phaser.GameObjects.GameObject[];
|
76 |
-
|
77 |
-
value: unknown;
|
78 |
-
|
79 |
-
setSelectedButtonName(
|
80 |
-
name: string
|
81 |
-
): this;
|
82 |
-
|
83 |
-
getSelectedButtonName(): string;
|
84 |
-
|
85 |
-
setButtonState(
|
86 |
-
name: string,
|
87 |
-
state?: boolean
|
88 |
-
): this;
|
89 |
-
|
90 |
-
getButtonState(
|
91 |
-
name: string
|
92 |
-
): boolean;
|
93 |
-
|
94 |
-
getAllButtonsState(): { [name: string]: boolean };
|
95 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AliHaider0343/implicit-and-explicit-aspects-Extraction-in-Restaurant-Reviews-Domain/app.py
DELETED
@@ -1,71 +0,0 @@
|
|
1 |
-
import torch
|
2 |
-
import streamlit as st
|
3 |
-
from transformers import RobertaTokenizer, RobertaForSequenceClassification
|
4 |
-
import re
|
5 |
-
import string
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
def tokenize_sentences(sentence):
|
10 |
-
encoded_dict = tokenizer.encode_plus(
|
11 |
-
sentence,
|
12 |
-
add_special_tokens=True,
|
13 |
-
max_length=128,
|
14 |
-
padding='max_length',
|
15 |
-
truncation=True,
|
16 |
-
return_attention_mask=True,
|
17 |
-
return_tensors='pt'
|
18 |
-
)
|
19 |
-
return torch.cat([encoded_dict['input_ids']], dim=0), torch.cat([encoded_dict['attention_mask']], dim=0)
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
def preprocess_query(query):
|
24 |
-
query = str(query).lower()
|
25 |
-
query = query.strip()
|
26 |
-
query=query.translate(str.maketrans("", "", string.punctuation))
|
27 |
-
return query
|
28 |
-
|
29 |
-
def predict_aspects(sentence, threshold):
|
30 |
-
input_ids, attention_mask = tokenize_sentences(sentence)
|
31 |
-
with torch.no_grad():
|
32 |
-
outputs = aspects_model(input_ids, attention_mask=attention_mask)
|
33 |
-
logits = outputs.logits
|
34 |
-
predicted_aspects = torch.sigmoid(logits).squeeze().tolist()
|
35 |
-
results = dict()
|
36 |
-
for label, prediction in zip(LABEL_COLUMNS_ASPECTS, predicted_aspects):
|
37 |
-
if prediction < threshold:
|
38 |
-
continue
|
39 |
-
precentage = round(float(prediction) * 100, 2)
|
40 |
-
results[label] = precentage
|
41 |
-
return results
|
42 |
-
|
43 |
-
# Load tokenizer and model
|
44 |
-
BERT_MODEL_NAME_FOR_ASPECTS_CLASSIFICATION = 'roberta-large'
|
45 |
-
tokenizer = RobertaTokenizer.from_pretrained(BERT_MODEL_NAME_FOR_ASPECTS_CLASSIFICATION, do_lower_case=True)
|
46 |
-
|
47 |
-
LABEL_COLUMNS_ASPECTS = ['FOOD-CUISINE', 'FOOD-DEALS', 'FOOD-DIET_OPTION', 'FOOD-EXPERIENCE', 'FOOD-FLAVOR', 'FOOD-GENERAL', 'FOOD-INGREDIENT', 'FOOD-KITCHEN', 'FOOD-MEAL', 'FOOD-MENU', 'FOOD-PORTION', 'FOOD-PRESENTATION', 'FOOD-PRICE', 'FOOD-QUALITY', 'FOOD-RECOMMENDATION', 'FOOD-TASTE', 'GENERAL-GENERAL', 'RESTAURANT-ATMOSPHERE', 'RESTAURANT-BUILDING', 'RESTAURANT-DECORATION', 'RESTAURANT-EXPERIENCE', 'RESTAURANT-FEATURES', 'RESTAURANT-GENERAL', 'RESTAURANT-HYGIENE', 'RESTAURANT-KITCHEN', 'RESTAURANT-LOCATION', 'RESTAURANT-OPTIONS', 'RESTAURANT-RECOMMENDATION', 'RESTAURANT-SEATING_PLAN', 'RESTAURANT-VIEW', 'SERVICE-BEHAVIOUR', 'SERVICE-EXPERIENCE', 'SERVICE-GENERAL', 'SERVICE-WAIT_TIME']
|
48 |
-
|
49 |
-
aspects_model = RobertaForSequenceClassification.from_pretrained(BERT_MODEL_NAME_FOR_ASPECTS_CLASSIFICATION, num_labels=len(LABEL_COLUMNS_ASPECTS))
|
50 |
-
aspects_model.load_state_dict(torch.load('./Aspects_Extraction_Model_updated.pth', map_location=torch.device('cpu')))
|
51 |
-
aspects_model.eval()
|
52 |
-
|
53 |
-
# Streamlit App
|
54 |
-
st.title("Implicit and Explicit Aspect Extraction")
|
55 |
-
|
56 |
-
sentence = st.text_input("Enter a sentence:")
|
57 |
-
threshold = st.slider("Threshold", min_value=0.0, max_value=1.0, step=0.01, value=0.5)
|
58 |
-
|
59 |
-
if sentence:
|
60 |
-
processed_sentence = preprocess_query(sentence)
|
61 |
-
results = predict_aspects(processed_sentence, threshold)
|
62 |
-
if len(results) > 0:
|
63 |
-
st.write("Predicted Aspects:")
|
64 |
-
table_data = [["Category","Aspect", "Probability"]]
|
65 |
-
for aspect, percentage in results.items():
|
66 |
-
aspect_parts = aspect.split("-")
|
67 |
-
table_data.append(aspect_parts + [f"{percentage}%"])
|
68 |
-
st.table(table_data)
|
69 |
-
else:
|
70 |
-
st.write("No aspects above the threshold.")
|
71 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/examples/conftest.py
DELETED
@@ -1,45 +0,0 @@
|
|
1 |
-
# Copyright 2023 The HuggingFace Team. All rights reserved.
|
2 |
-
#
|
3 |
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
4 |
-
# you may not use this file except in compliance with the License.
|
5 |
-
# You may obtain a copy of the License at
|
6 |
-
#
|
7 |
-
# http://www.apache.org/licenses/LICENSE-2.0
|
8 |
-
#
|
9 |
-
# Unless required by applicable law or agreed to in writing, software
|
10 |
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11 |
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12 |
-
# See the License for the specific language governing permissions and
|
13 |
-
# limitations under the License.
|
14 |
-
|
15 |
-
# tests directory-specific settings - this file is run automatically
|
16 |
-
# by pytest before any tests are run
|
17 |
-
|
18 |
-
import sys
|
19 |
-
import warnings
|
20 |
-
from os.path import abspath, dirname, join
|
21 |
-
|
22 |
-
|
23 |
-
# allow having multiple repository checkouts and not needing to remember to rerun
|
24 |
-
# 'pip install -e .[dev]' when switching between checkouts and running tests.
|
25 |
-
git_repo_path = abspath(join(dirname(dirname(dirname(__file__))), "src"))
|
26 |
-
sys.path.insert(1, git_repo_path)
|
27 |
-
|
28 |
-
|
29 |
-
# silence FutureWarning warnings in tests since often we can't act on them until
|
30 |
-
# they become normal warnings - i.e. the tests still need to test the current functionality
|
31 |
-
warnings.simplefilter(action="ignore", category=FutureWarning)
|
32 |
-
|
33 |
-
|
34 |
-
def pytest_addoption(parser):
|
35 |
-
from diffusers.utils.testing_utils import pytest_addoption_shared
|
36 |
-
|
37 |
-
pytest_addoption_shared(parser)
|
38 |
-
|
39 |
-
|
40 |
-
def pytest_terminal_summary(terminalreporter):
|
41 |
-
from diffusers.utils.testing_utils import pytest_terminal_summary_main
|
42 |
-
|
43 |
-
make_reports = terminalreporter.config.getoption("--make-reports")
|
44 |
-
if make_reports:
|
45 |
-
pytest_terminal_summary_main(terminalreporter, id=make_reports)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/src/diffusers/dependency_versions_table.py
DELETED
@@ -1,44 +0,0 @@
|
|
1 |
-
# THIS FILE HAS BEEN AUTOGENERATED. To update:
|
2 |
-
# 1. modify the `_deps` dict in setup.py
|
3 |
-
# 2. run `make deps_table_update``
|
4 |
-
deps = {
|
5 |
-
"Pillow": "Pillow",
|
6 |
-
"accelerate": "accelerate>=0.11.0",
|
7 |
-
"compel": "compel==0.1.8",
|
8 |
-
"black": "black~=23.1",
|
9 |
-
"datasets": "datasets",
|
10 |
-
"filelock": "filelock",
|
11 |
-
"flax": "flax>=0.4.1",
|
12 |
-
"hf-doc-builder": "hf-doc-builder>=0.3.0",
|
13 |
-
"huggingface-hub": "huggingface-hub>=0.13.2",
|
14 |
-
"requests-mock": "requests-mock==1.10.0",
|
15 |
-
"importlib_metadata": "importlib_metadata",
|
16 |
-
"invisible-watermark": "invisible-watermark>=0.2.0",
|
17 |
-
"isort": "isort>=5.5.4",
|
18 |
-
"jax": "jax>=0.2.8,!=0.3.2",
|
19 |
-
"jaxlib": "jaxlib>=0.1.65",
|
20 |
-
"Jinja2": "Jinja2",
|
21 |
-
"k-diffusion": "k-diffusion>=0.0.12",
|
22 |
-
"torchsde": "torchsde",
|
23 |
-
"note_seq": "note_seq",
|
24 |
-
"librosa": "librosa",
|
25 |
-
"numpy": "numpy",
|
26 |
-
"omegaconf": "omegaconf",
|
27 |
-
"parameterized": "parameterized",
|
28 |
-
"protobuf": "protobuf>=3.20.3,<4",
|
29 |
-
"pytest": "pytest",
|
30 |
-
"pytest-timeout": "pytest-timeout",
|
31 |
-
"pytest-xdist": "pytest-xdist",
|
32 |
-
"ruff": "ruff>=0.0.241",
|
33 |
-
"safetensors": "safetensors>=0.3.1",
|
34 |
-
"sentencepiece": "sentencepiece>=0.1.91,!=0.1.92",
|
35 |
-
"scipy": "scipy",
|
36 |
-
"onnx": "onnx",
|
37 |
-
"regex": "regex!=2019.12.17",
|
38 |
-
"requests": "requests",
|
39 |
-
"tensorboard": "tensorboard",
|
40 |
-
"torch": "torch>=1.4",
|
41 |
-
"torchvision": "torchvision",
|
42 |
-
"transformers": "transformers>=4.25.1",
|
43 |
-
"urllib3": "urllib3<=2.0.0",
|
44 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/tests/models/test_models_unet_2d_flax.py
DELETED
@@ -1,104 +0,0 @@
|
|
1 |
-
import gc
|
2 |
-
import unittest
|
3 |
-
|
4 |
-
from parameterized import parameterized
|
5 |
-
|
6 |
-
from diffusers import FlaxUNet2DConditionModel
|
7 |
-
from diffusers.utils import is_flax_available
|
8 |
-
from diffusers.utils.testing_utils import load_hf_numpy, require_flax, slow
|
9 |
-
|
10 |
-
|
11 |
-
if is_flax_available():
|
12 |
-
import jax
|
13 |
-
import jax.numpy as jnp
|
14 |
-
|
15 |
-
|
16 |
-
@slow
|
17 |
-
@require_flax
|
18 |
-
class FlaxUNet2DConditionModelIntegrationTests(unittest.TestCase):
|
19 |
-
def get_file_format(self, seed, shape):
|
20 |
-
return f"gaussian_noise_s={seed}_shape={'_'.join([str(s) for s in shape])}.npy"
|
21 |
-
|
22 |
-
def tearDown(self):
|
23 |
-
# clean up the VRAM after each test
|
24 |
-
super().tearDown()
|
25 |
-
gc.collect()
|
26 |
-
|
27 |
-
def get_latents(self, seed=0, shape=(4, 4, 64, 64), fp16=False):
|
28 |
-
dtype = jnp.bfloat16 if fp16 else jnp.float32
|
29 |
-
image = jnp.array(load_hf_numpy(self.get_file_format(seed, shape)), dtype=dtype)
|
30 |
-
return image
|
31 |
-
|
32 |
-
def get_unet_model(self, fp16=False, model_id="CompVis/stable-diffusion-v1-4"):
|
33 |
-
dtype = jnp.bfloat16 if fp16 else jnp.float32
|
34 |
-
revision = "bf16" if fp16 else None
|
35 |
-
|
36 |
-
model, params = FlaxUNet2DConditionModel.from_pretrained(
|
37 |
-
model_id, subfolder="unet", dtype=dtype, revision=revision
|
38 |
-
)
|
39 |
-
return model, params
|
40 |
-
|
41 |
-
def get_encoder_hidden_states(self, seed=0, shape=(4, 77, 768), fp16=False):
|
42 |
-
dtype = jnp.bfloat16 if fp16 else jnp.float32
|
43 |
-
hidden_states = jnp.array(load_hf_numpy(self.get_file_format(seed, shape)), dtype=dtype)
|
44 |
-
return hidden_states
|
45 |
-
|
46 |
-
@parameterized.expand(
|
47 |
-
[
|
48 |
-
# fmt: off
|
49 |
-
[83, 4, [-0.2323, -0.1304, 0.0813, -0.3093, -0.0919, -0.1571, -0.1125, -0.5806]],
|
50 |
-
[17, 0.55, [-0.0831, -0.2443, 0.0901, -0.0919, 0.3396, 0.0103, -0.3743, 0.0701]],
|
51 |
-
[8, 0.89, [-0.4863, 0.0859, 0.0875, -0.1658, 0.9199, -0.0114, 0.4839, 0.4639]],
|
52 |
-
[3, 1000, [-0.5649, 0.2402, -0.5518, 0.1248, 1.1328, -0.2443, -0.0325, -1.0078]],
|
53 |
-
# fmt: on
|
54 |
-
]
|
55 |
-
)
|
56 |
-
def test_compvis_sd_v1_4_flax_vs_torch_fp16(self, seed, timestep, expected_slice):
|
57 |
-
model, params = self.get_unet_model(model_id="CompVis/stable-diffusion-v1-4", fp16=True)
|
58 |
-
latents = self.get_latents(seed, fp16=True)
|
59 |
-
encoder_hidden_states = self.get_encoder_hidden_states(seed, fp16=True)
|
60 |
-
|
61 |
-
sample = model.apply(
|
62 |
-
{"params": params},
|
63 |
-
latents,
|
64 |
-
jnp.array(timestep, dtype=jnp.int32),
|
65 |
-
encoder_hidden_states=encoder_hidden_states,
|
66 |
-
).sample
|
67 |
-
|
68 |
-
assert sample.shape == latents.shape
|
69 |
-
|
70 |
-
output_slice = jnp.asarray(jax.device_get((sample[-1, -2:, -2:, :2].flatten())), dtype=jnp.float32)
|
71 |
-
expected_output_slice = jnp.array(expected_slice, dtype=jnp.float32)
|
72 |
-
|
73 |
-
# Found torch (float16) and flax (bfloat16) outputs to be within this tolerance, in the same hardware
|
74 |
-
assert jnp.allclose(output_slice, expected_output_slice, atol=1e-2)
|
75 |
-
|
76 |
-
@parameterized.expand(
|
77 |
-
[
|
78 |
-
# fmt: off
|
79 |
-
[83, 4, [0.1514, 0.0807, 0.1624, 0.1016, -0.1896, 0.0263, 0.0677, 0.2310]],
|
80 |
-
[17, 0.55, [0.1164, -0.0216, 0.0170, 0.1589, -0.3120, 0.1005, -0.0581, -0.1458]],
|
81 |
-
[8, 0.89, [-0.1758, -0.0169, 0.1004, -0.1411, 0.1312, 0.1103, -0.1996, 0.2139]],
|
82 |
-
[3, 1000, [0.1214, 0.0352, -0.0731, -0.1562, -0.0994, -0.0906, -0.2340, -0.0539]],
|
83 |
-
# fmt: on
|
84 |
-
]
|
85 |
-
)
|
86 |
-
def test_stabilityai_sd_v2_flax_vs_torch_fp16(self, seed, timestep, expected_slice):
|
87 |
-
model, params = self.get_unet_model(model_id="stabilityai/stable-diffusion-2", fp16=True)
|
88 |
-
latents = self.get_latents(seed, shape=(4, 4, 96, 96), fp16=True)
|
89 |
-
encoder_hidden_states = self.get_encoder_hidden_states(seed, shape=(4, 77, 1024), fp16=True)
|
90 |
-
|
91 |
-
sample = model.apply(
|
92 |
-
{"params": params},
|
93 |
-
latents,
|
94 |
-
jnp.array(timestep, dtype=jnp.int32),
|
95 |
-
encoder_hidden_states=encoder_hidden_states,
|
96 |
-
).sample
|
97 |
-
|
98 |
-
assert sample.shape == latents.shape
|
99 |
-
|
100 |
-
output_slice = jnp.asarray(jax.device_get((sample[-1, -2:, -2:, :2].flatten())), dtype=jnp.float32)
|
101 |
-
expected_output_slice = jnp.array(expected_slice, dtype=jnp.float32)
|
102 |
-
|
103 |
-
# Found torch (float16) and flax (bfloat16) outputs to be within this tolerance, on the same hardware
|
104 |
-
assert jnp.allclose(output_slice, expected_output_slice, atol=1e-2)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_detection/configs/fcos/fcos_r101_caffe_fpn_gn-head_1x_coco.py
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
_base_ = './fcos_r50_caffe_fpn_gn-head_1x_coco.py'
|
2 |
-
model = dict(
|
3 |
-
pretrained='open-mmlab://detectron/resnet101_caffe',
|
4 |
-
backbone=dict(depth=101))
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_detection/configs/grid_rcnn/grid_rcnn_x101_64x4d_fpn_gn-head_2x_coco.py
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
_base_ = './grid_rcnn_x101_32x4d_fpn_gn-head_2x_coco.py'
|
2 |
-
model = dict(
|
3 |
-
pretrained='open-mmlab://resnext101_64x4d',
|
4 |
-
backbone=dict(
|
5 |
-
type='ResNeXt',
|
6 |
-
depth=101,
|
7 |
-
groups=64,
|
8 |
-
base_width=4,
|
9 |
-
num_stages=4,
|
10 |
-
out_indices=(0, 1, 2, 3),
|
11 |
-
frozen_stages=1,
|
12 |
-
style='pytorch'))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_detection/configs/lvis/mask_rcnn_r101_fpn_sample1e-3_mstrain_1x_lvis_v1.py
DELETED
@@ -1,2 +0,0 @@
|
|
1 |
-
_base_ = './mask_rcnn_r50_fpn_sample1e-3_mstrain_1x_lvis_v1.py'
|
2 |
-
model = dict(pretrained='torchvision://resnet101', backbone=dict(depth=101))
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_detection/configs/regnet/mask_rcnn_regnetx-8GF_fpn_1x_coco.py
DELETED
@@ -1,16 +0,0 @@
|
|
1 |
-
_base_ = './mask_rcnn_regnetx-3.2GF_fpn_1x_coco.py'
|
2 |
-
model = dict(
|
3 |
-
pretrained='open-mmlab://regnetx_8.0gf',
|
4 |
-
backbone=dict(
|
5 |
-
type='RegNet',
|
6 |
-
arch='regnetx_8.0gf',
|
7 |
-
out_indices=(0, 1, 2, 3),
|
8 |
-
frozen_stages=1,
|
9 |
-
norm_cfg=dict(type='BN', requires_grad=True),
|
10 |
-
norm_eval=True,
|
11 |
-
style='pytorch'),
|
12 |
-
neck=dict(
|
13 |
-
type='FPN',
|
14 |
-
in_channels=[80, 240, 720, 1920],
|
15 |
-
out_channels=256,
|
16 |
-
num_outs=5))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_detection/configs/scnet/README.md
DELETED
@@ -1,51 +0,0 @@
|
|
1 |
-
# SCNet
|
2 |
-
|
3 |
-
## Introduction
|
4 |
-
|
5 |
-
[ALGORITHM]
|
6 |
-
|
7 |
-
We provide the code for reproducing experiment results of [SCNet](https://arxiv.org/abs/2012.10150).
|
8 |
-
|
9 |
-
```
|
10 |
-
@inproceedings{vu2019cascade,
|
11 |
-
title={SCNet: Training Inference Sample Consistency for Instance Segmentation},
|
12 |
-
author={Vu, Thang and Haeyong, Kang and Yoo, Chang D},
|
13 |
-
booktitle={AAAI},
|
14 |
-
year={2021}
|
15 |
-
}
|
16 |
-
```
|
17 |
-
|
18 |
-
## Dataset
|
19 |
-
|
20 |
-
SCNet requires COCO and [COCO-stuff](http://calvin.inf.ed.ac.uk/wp-content/uploads/data/cocostuffdataset/stuffthingmaps_trainval2017.zip) dataset for training. You need to download and extract it in the COCO dataset path.
|
21 |
-
The directory should be like this.
|
22 |
-
|
23 |
-
```none
|
24 |
-
mmdetection
|
25 |
-
├── mmdet
|
26 |
-
├── tools
|
27 |
-
├── configs
|
28 |
-
├── data
|
29 |
-
│ ├── coco
|
30 |
-
│ │ ├── annotations
|
31 |
-
│ │ ├── train2017
|
32 |
-
│ │ ├── val2017
|
33 |
-
│ │ ├── test2017
|
34 |
-
| | ├── stuffthingmaps
|
35 |
-
```
|
36 |
-
|
37 |
-
## Results and Models
|
38 |
-
|
39 |
-
The results on COCO 2017val are shown in the below table. (results on test-dev are usually slightly higher than val)
|
40 |
-
|
41 |
-
| Backbone | Style | Lr schd | Mem (GB) | Inf speed (fps) | box AP | mask AP | TTA box AP | TTA mask AP | Config | Download |
|
42 |
-
|:---------------:|:-------:|:-------:|:--------:|:---------------:|:------:|:-------:|:----------:|:-----------:|:------:|:------------:|
|
43 |
-
| R-50-FPN | pytorch | 1x | 7.0 | 6.2 | 43.5 | 39.2 | 44.8 | 40.9 | [config](https://github.com/open-mmlab/mmdetection/tree/master/configs/scnet/scnet_r50_fpn_1x_coco.py) | [model](https://drive.google.com/file/d/1K5_8-P0EC43WZFtoO3q9_JE-df8pEc7J/view?usp=sharing) \| [log](https://drive.google.com/file/d/1ZFS6QhFfxlOnDYPiGpSDP_Fzgb7iDGN3/view?usp=sharing) |
|
44 |
-
| R-50-FPN | pytorch | 20e | 7.0 | 6.2 | 44.5 | 40.0 | 45.8 | 41.5 | [config](https://github.com/open-mmlab/mmdetection/tree/master/configs/scnet/scnet_r50_fpn_20e_coco.py) | [model](https://drive.google.com/file/d/15VGLCt5-IO5TbzB4Kw6ZyoF6QH0Q511A/view?usp=sharing) \| [log](https://drive.google.com/file/d/1-LnkOXN8n5ojQW34H0qZ625cgrnWpqSX/view?usp=sharing) |
|
45 |
-
| R-101-FPN | pytorch | 20e | 8.9 | 5.8 | 45.8 | 40.9 | 47.3 | 42.7 | [config](https://github.com/open-mmlab/mmdetection/tree/master/configs/scnet/scnet_r101_fpn_20e_coco.py) | [model](https://drive.google.com/file/d/1aeCGHsOBdfIqVBnBPp0JUE_RSIau3583/view?usp=sharing) \| [log](https://drive.google.com/file/d/1iRx-9GRgTaIDsz-we3DGwFVH22nbvCLa/view?usp=sharing) |
|
46 |
-
| X-101-64x4d-FPN | pytorch | 20e | 13.2 | 4.9 | 47.5 | 42.3 | 48.9 | 44.0 | [config](https://github.com/open-mmlab/mmdetection/tree/master/configs/scnet/scnet_x101_64x4d_fpn_20e_coco.py) | [model](https://drive.google.com/file/d/1YjgutUKz4TTPpqSWGKUTkZJ8_X-kyCfY/view?usp=sharing) \| [log](https://drive.google.com/file/d/1OsfQJ8gwtqIQ61k358yxY21sCvbUcRjs/view?usp=sharing) |
|
47 |
-
|
48 |
-
### Notes
|
49 |
-
|
50 |
-
- Training hyper-parameters are identical to those of [HTC](https://github.com/open-mmlab/mmdetection/tree/master/configs/htc).
|
51 |
-
- TTA means Test Time Augmentation, which applies horizonal flip and multi-scale testing. Refer to [config](https://github.com/open-mmlab/mmdetection/tree/master/configs/scnet/scnet_r50_fpn_1x_coco.py).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_detection/mmdet/models/losses/gaussian_focal_loss.py
DELETED
@@ -1,91 +0,0 @@
|
|
1 |
-
import mmcv
|
2 |
-
import torch.nn as nn
|
3 |
-
|
4 |
-
from ..builder import LOSSES
|
5 |
-
from .utils import weighted_loss
|
6 |
-
|
7 |
-
|
8 |
-
@mmcv.jit(derivate=True, coderize=True)
|
9 |
-
@weighted_loss
|
10 |
-
def gaussian_focal_loss(pred, gaussian_target, alpha=2.0, gamma=4.0):
|
11 |
-
"""`Focal Loss <https://arxiv.org/abs/1708.02002>`_ for targets in gaussian
|
12 |
-
distribution.
|
13 |
-
|
14 |
-
Args:
|
15 |
-
pred (torch.Tensor): The prediction.
|
16 |
-
gaussian_target (torch.Tensor): The learning target of the prediction
|
17 |
-
in gaussian distribution.
|
18 |
-
alpha (float, optional): A balanced form for Focal Loss.
|
19 |
-
Defaults to 2.0.
|
20 |
-
gamma (float, optional): The gamma for calculating the modulating
|
21 |
-
factor. Defaults to 4.0.
|
22 |
-
"""
|
23 |
-
eps = 1e-12
|
24 |
-
pos_weights = gaussian_target.eq(1)
|
25 |
-
neg_weights = (1 - gaussian_target).pow(gamma)
|
26 |
-
pos_loss = -(pred + eps).log() * (1 - pred).pow(alpha) * pos_weights
|
27 |
-
neg_loss = -(1 - pred + eps).log() * pred.pow(alpha) * neg_weights
|
28 |
-
return pos_loss + neg_loss
|
29 |
-
|
30 |
-
|
31 |
-
@LOSSES.register_module()
|
32 |
-
class GaussianFocalLoss(nn.Module):
|
33 |
-
"""GaussianFocalLoss is a variant of focal loss.
|
34 |
-
|
35 |
-
More details can be found in the `paper
|
36 |
-
<https://arxiv.org/abs/1808.01244>`_
|
37 |
-
Code is modified from `kp_utils.py
|
38 |
-
<https://github.com/princeton-vl/CornerNet/blob/master/models/py_utils/kp_utils.py#L152>`_ # noqa: E501
|
39 |
-
Please notice that the target in GaussianFocalLoss is a gaussian heatmap,
|
40 |
-
not 0/1 binary target.
|
41 |
-
|
42 |
-
Args:
|
43 |
-
alpha (float): Power of prediction.
|
44 |
-
gamma (float): Power of target for negative samples.
|
45 |
-
reduction (str): Options are "none", "mean" and "sum".
|
46 |
-
loss_weight (float): Loss weight of current loss.
|
47 |
-
"""
|
48 |
-
|
49 |
-
def __init__(self,
|
50 |
-
alpha=2.0,
|
51 |
-
gamma=4.0,
|
52 |
-
reduction='mean',
|
53 |
-
loss_weight=1.0):
|
54 |
-
super(GaussianFocalLoss, self).__init__()
|
55 |
-
self.alpha = alpha
|
56 |
-
self.gamma = gamma
|
57 |
-
self.reduction = reduction
|
58 |
-
self.loss_weight = loss_weight
|
59 |
-
|
60 |
-
def forward(self,
|
61 |
-
pred,
|
62 |
-
target,
|
63 |
-
weight=None,
|
64 |
-
avg_factor=None,
|
65 |
-
reduction_override=None):
|
66 |
-
"""Forward function.
|
67 |
-
|
68 |
-
Args:
|
69 |
-
pred (torch.Tensor): The prediction.
|
70 |
-
target (torch.Tensor): The learning target of the prediction
|
71 |
-
in gaussian distribution.
|
72 |
-
weight (torch.Tensor, optional): The weight of loss for each
|
73 |
-
prediction. Defaults to None.
|
74 |
-
avg_factor (int, optional): Average factor that is used to average
|
75 |
-
the loss. Defaults to None.
|
76 |
-
reduction_override (str, optional): The reduction method used to
|
77 |
-
override the original reduction method of the loss.
|
78 |
-
Defaults to None.
|
79 |
-
"""
|
80 |
-
assert reduction_override in (None, 'none', 'mean', 'sum')
|
81 |
-
reduction = (
|
82 |
-
reduction_override if reduction_override else self.reduction)
|
83 |
-
loss_reg = self.loss_weight * gaussian_focal_loss(
|
84 |
-
pred,
|
85 |
-
target,
|
86 |
-
weight,
|
87 |
-
alpha=self.alpha,
|
88 |
-
gamma=self.gamma,
|
89 |
-
reduction=reduction,
|
90 |
-
avg_factor=avg_factor)
|
91 |
-
return loss_reg
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_detection/mmdet/models/utils/builder.py
DELETED
@@ -1,14 +0,0 @@
|
|
1 |
-
from mmcv.utils import Registry, build_from_cfg
|
2 |
-
|
3 |
-
TRANSFORMER = Registry('Transformer')
|
4 |
-
POSITIONAL_ENCODING = Registry('Position encoding')
|
5 |
-
|
6 |
-
|
7 |
-
def build_transformer(cfg, default_args=None):
|
8 |
-
"""Builder for Transformer."""
|
9 |
-
return build_from_cfg(cfg, TRANSFORMER, default_args)
|
10 |
-
|
11 |
-
|
12 |
-
def build_positional_encoding(cfg, default_args=None):
|
13 |
-
"""Builder for Position Encoding."""
|
14 |
-
return build_from_cfg(cfg, POSITIONAL_ENCODING, default_args)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_segmentation/configs/deeplabv3plus/deeplabv3plus_r50-d8_512x512_160k_ade20k.py
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
_base_ = [
|
2 |
-
'../_base_/models/deeplabv3plus_r50-d8.py', '../_base_/datasets/ade20k.py',
|
3 |
-
'../_base_/default_runtime.py', '../_base_/schedules/schedule_160k.py'
|
4 |
-
]
|
5 |
-
model = dict(
|
6 |
-
decode_head=dict(num_classes=150), auxiliary_head=dict(num_classes=150))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Anonymous-sub/Rerender/ControlNet/annotator/uniformer/configs/_base_/schedules/schedule_40k.py
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
# optimizer
|
2 |
-
optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=0.0005)
|
3 |
-
optimizer_config = dict()
|
4 |
-
# learning policy
|
5 |
-
lr_config = dict(policy='poly', power=0.9, min_lr=1e-4, by_epoch=False)
|
6 |
-
# runtime settings
|
7 |
-
runner = dict(type='IterBasedRunner', max_iters=40000)
|
8 |
-
checkpoint_config = dict(by_epoch=False, interval=4000)
|
9 |
-
evaluation = dict(interval=4000, metric='mIoU')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/distlib/version.py
DELETED
@@ -1,739 +0,0 @@
|
|
1 |
-
# -*- coding: utf-8 -*-
|
2 |
-
#
|
3 |
-
# Copyright (C) 2012-2017 The Python Software Foundation.
|
4 |
-
# See LICENSE.txt and CONTRIBUTORS.txt.
|
5 |
-
#
|
6 |
-
"""
|
7 |
-
Implementation of a flexible versioning scheme providing support for PEP-440,
|
8 |
-
setuptools-compatible and semantic versioning.
|
9 |
-
"""
|
10 |
-
|
11 |
-
import logging
|
12 |
-
import re
|
13 |
-
|
14 |
-
from .compat import string_types
|
15 |
-
from .util import parse_requirement
|
16 |
-
|
17 |
-
__all__ = ['NormalizedVersion', 'NormalizedMatcher',
|
18 |
-
'LegacyVersion', 'LegacyMatcher',
|
19 |
-
'SemanticVersion', 'SemanticMatcher',
|
20 |
-
'UnsupportedVersionError', 'get_scheme']
|
21 |
-
|
22 |
-
logger = logging.getLogger(__name__)
|
23 |
-
|
24 |
-
|
25 |
-
class UnsupportedVersionError(ValueError):
|
26 |
-
"""This is an unsupported version."""
|
27 |
-
pass
|
28 |
-
|
29 |
-
|
30 |
-
class Version(object):
|
31 |
-
def __init__(self, s):
|
32 |
-
self._string = s = s.strip()
|
33 |
-
self._parts = parts = self.parse(s)
|
34 |
-
assert isinstance(parts, tuple)
|
35 |
-
assert len(parts) > 0
|
36 |
-
|
37 |
-
def parse(self, s):
|
38 |
-
raise NotImplementedError('please implement in a subclass')
|
39 |
-
|
40 |
-
def _check_compatible(self, other):
|
41 |
-
if type(self) != type(other):
|
42 |
-
raise TypeError('cannot compare %r and %r' % (self, other))
|
43 |
-
|
44 |
-
def __eq__(self, other):
|
45 |
-
self._check_compatible(other)
|
46 |
-
return self._parts == other._parts
|
47 |
-
|
48 |
-
def __ne__(self, other):
|
49 |
-
return not self.__eq__(other)
|
50 |
-
|
51 |
-
def __lt__(self, other):
|
52 |
-
self._check_compatible(other)
|
53 |
-
return self._parts < other._parts
|
54 |
-
|
55 |
-
def __gt__(self, other):
|
56 |
-
return not (self.__lt__(other) or self.__eq__(other))
|
57 |
-
|
58 |
-
def __le__(self, other):
|
59 |
-
return self.__lt__(other) or self.__eq__(other)
|
60 |
-
|
61 |
-
def __ge__(self, other):
|
62 |
-
return self.__gt__(other) or self.__eq__(other)
|
63 |
-
|
64 |
-
# See http://docs.python.org/reference/datamodel#object.__hash__
|
65 |
-
def __hash__(self):
|
66 |
-
return hash(self._parts)
|
67 |
-
|
68 |
-
def __repr__(self):
|
69 |
-
return "%s('%s')" % (self.__class__.__name__, self._string)
|
70 |
-
|
71 |
-
def __str__(self):
|
72 |
-
return self._string
|
73 |
-
|
74 |
-
@property
|
75 |
-
def is_prerelease(self):
|
76 |
-
raise NotImplementedError('Please implement in subclasses.')
|
77 |
-
|
78 |
-
|
79 |
-
class Matcher(object):
|
80 |
-
version_class = None
|
81 |
-
|
82 |
-
# value is either a callable or the name of a method
|
83 |
-
_operators = {
|
84 |
-
'<': lambda v, c, p: v < c,
|
85 |
-
'>': lambda v, c, p: v > c,
|
86 |
-
'<=': lambda v, c, p: v == c or v < c,
|
87 |
-
'>=': lambda v, c, p: v == c or v > c,
|
88 |
-
'==': lambda v, c, p: v == c,
|
89 |
-
'===': lambda v, c, p: v == c,
|
90 |
-
# by default, compatible => >=.
|
91 |
-
'~=': lambda v, c, p: v == c or v > c,
|
92 |
-
'!=': lambda v, c, p: v != c,
|
93 |
-
}
|
94 |
-
|
95 |
-
# this is a method only to support alternative implementations
|
96 |
-
# via overriding
|
97 |
-
def parse_requirement(self, s):
|
98 |
-
return parse_requirement(s)
|
99 |
-
|
100 |
-
def __init__(self, s):
|
101 |
-
if self.version_class is None:
|
102 |
-
raise ValueError('Please specify a version class')
|
103 |
-
self._string = s = s.strip()
|
104 |
-
r = self.parse_requirement(s)
|
105 |
-
if not r:
|
106 |
-
raise ValueError('Not valid: %r' % s)
|
107 |
-
self.name = r.name
|
108 |
-
self.key = self.name.lower() # for case-insensitive comparisons
|
109 |
-
clist = []
|
110 |
-
if r.constraints:
|
111 |
-
# import pdb; pdb.set_trace()
|
112 |
-
for op, s in r.constraints:
|
113 |
-
if s.endswith('.*'):
|
114 |
-
if op not in ('==', '!='):
|
115 |
-
raise ValueError('\'.*\' not allowed for '
|
116 |
-
'%r constraints' % op)
|
117 |
-
# Could be a partial version (e.g. for '2.*') which
|
118 |
-
# won't parse as a version, so keep it as a string
|
119 |
-
vn, prefix = s[:-2], True
|
120 |
-
# Just to check that vn is a valid version
|
121 |
-
self.version_class(vn)
|
122 |
-
else:
|
123 |
-
# Should parse as a version, so we can create an
|
124 |
-
# instance for the comparison
|
125 |
-
vn, prefix = self.version_class(s), False
|
126 |
-
clist.append((op, vn, prefix))
|
127 |
-
self._parts = tuple(clist)
|
128 |
-
|
129 |
-
def match(self, version):
|
130 |
-
"""
|
131 |
-
Check if the provided version matches the constraints.
|
132 |
-
|
133 |
-
:param version: The version to match against this instance.
|
134 |
-
:type version: String or :class:`Version` instance.
|
135 |
-
"""
|
136 |
-
if isinstance(version, string_types):
|
137 |
-
version = self.version_class(version)
|
138 |
-
for operator, constraint, prefix in self._parts:
|
139 |
-
f = self._operators.get(operator)
|
140 |
-
if isinstance(f, string_types):
|
141 |
-
f = getattr(self, f)
|
142 |
-
if not f:
|
143 |
-
msg = ('%r not implemented '
|
144 |
-
'for %s' % (operator, self.__class__.__name__))
|
145 |
-
raise NotImplementedError(msg)
|
146 |
-
if not f(version, constraint, prefix):
|
147 |
-
return False
|
148 |
-
return True
|
149 |
-
|
150 |
-
@property
|
151 |
-
def exact_version(self):
|
152 |
-
result = None
|
153 |
-
if len(self._parts) == 1 and self._parts[0][0] in ('==', '==='):
|
154 |
-
result = self._parts[0][1]
|
155 |
-
return result
|
156 |
-
|
157 |
-
def _check_compatible(self, other):
|
158 |
-
if type(self) != type(other) or self.name != other.name:
|
159 |
-
raise TypeError('cannot compare %s and %s' % (self, other))
|
160 |
-
|
161 |
-
def __eq__(self, other):
|
162 |
-
self._check_compatible(other)
|
163 |
-
return self.key == other.key and self._parts == other._parts
|
164 |
-
|
165 |
-
def __ne__(self, other):
|
166 |
-
return not self.__eq__(other)
|
167 |
-
|
168 |
-
# See http://docs.python.org/reference/datamodel#object.__hash__
|
169 |
-
def __hash__(self):
|
170 |
-
return hash(self.key) + hash(self._parts)
|
171 |
-
|
172 |
-
def __repr__(self):
|
173 |
-
return "%s(%r)" % (self.__class__.__name__, self._string)
|
174 |
-
|
175 |
-
def __str__(self):
|
176 |
-
return self._string
|
177 |
-
|
178 |
-
|
179 |
-
PEP440_VERSION_RE = re.compile(r'^v?(\d+!)?(\d+(\.\d+)*)((a|b|c|rc)(\d+))?'
|
180 |
-
r'(\.(post)(\d+))?(\.(dev)(\d+))?'
|
181 |
-
r'(\+([a-zA-Z\d]+(\.[a-zA-Z\d]+)?))?$')
|
182 |
-
|
183 |
-
|
184 |
-
def _pep_440_key(s):
|
185 |
-
s = s.strip()
|
186 |
-
m = PEP440_VERSION_RE.match(s)
|
187 |
-
if not m:
|
188 |
-
raise UnsupportedVersionError('Not a valid version: %s' % s)
|
189 |
-
groups = m.groups()
|
190 |
-
nums = tuple(int(v) for v in groups[1].split('.'))
|
191 |
-
while len(nums) > 1 and nums[-1] == 0:
|
192 |
-
nums = nums[:-1]
|
193 |
-
|
194 |
-
if not groups[0]:
|
195 |
-
epoch = 0
|
196 |
-
else:
|
197 |
-
epoch = int(groups[0][:-1])
|
198 |
-
pre = groups[4:6]
|
199 |
-
post = groups[7:9]
|
200 |
-
dev = groups[10:12]
|
201 |
-
local = groups[13]
|
202 |
-
if pre == (None, None):
|
203 |
-
pre = ()
|
204 |
-
else:
|
205 |
-
pre = pre[0], int(pre[1])
|
206 |
-
if post == (None, None):
|
207 |
-
post = ()
|
208 |
-
else:
|
209 |
-
post = post[0], int(post[1])
|
210 |
-
if dev == (None, None):
|
211 |
-
dev = ()
|
212 |
-
else:
|
213 |
-
dev = dev[0], int(dev[1])
|
214 |
-
if local is None:
|
215 |
-
local = ()
|
216 |
-
else:
|
217 |
-
parts = []
|
218 |
-
for part in local.split('.'):
|
219 |
-
# to ensure that numeric compares as > lexicographic, avoid
|
220 |
-
# comparing them directly, but encode a tuple which ensures
|
221 |
-
# correct sorting
|
222 |
-
if part.isdigit():
|
223 |
-
part = (1, int(part))
|
224 |
-
else:
|
225 |
-
part = (0, part)
|
226 |
-
parts.append(part)
|
227 |
-
local = tuple(parts)
|
228 |
-
if not pre:
|
229 |
-
# either before pre-release, or final release and after
|
230 |
-
if not post and dev:
|
231 |
-
# before pre-release
|
232 |
-
pre = ('a', -1) # to sort before a0
|
233 |
-
else:
|
234 |
-
pre = ('z',) # to sort after all pre-releases
|
235 |
-
# now look at the state of post and dev.
|
236 |
-
if not post:
|
237 |
-
post = ('_',) # sort before 'a'
|
238 |
-
if not dev:
|
239 |
-
dev = ('final',)
|
240 |
-
|
241 |
-
#print('%s -> %s' % (s, m.groups()))
|
242 |
-
return epoch, nums, pre, post, dev, local
|
243 |
-
|
244 |
-
|
245 |
-
_normalized_key = _pep_440_key
|
246 |
-
|
247 |
-
|
248 |
-
class NormalizedVersion(Version):
|
249 |
-
"""A rational version.
|
250 |
-
|
251 |
-
Good:
|
252 |
-
1.2 # equivalent to "1.2.0"
|
253 |
-
1.2.0
|
254 |
-
1.2a1
|
255 |
-
1.2.3a2
|
256 |
-
1.2.3b1
|
257 |
-
1.2.3c1
|
258 |
-
1.2.3.4
|
259 |
-
TODO: fill this out
|
260 |
-
|
261 |
-
Bad:
|
262 |
-
1 # minimum two numbers
|
263 |
-
1.2a # release level must have a release serial
|
264 |
-
1.2.3b
|
265 |
-
"""
|
266 |
-
def parse(self, s):
|
267 |
-
result = _normalized_key(s)
|
268 |
-
# _normalized_key loses trailing zeroes in the release
|
269 |
-
# clause, since that's needed to ensure that X.Y == X.Y.0 == X.Y.0.0
|
270 |
-
# However, PEP 440 prefix matching needs it: for example,
|
271 |
-
# (~= 1.4.5.0) matches differently to (~= 1.4.5.0.0).
|
272 |
-
m = PEP440_VERSION_RE.match(s) # must succeed
|
273 |
-
groups = m.groups()
|
274 |
-
self._release_clause = tuple(int(v) for v in groups[1].split('.'))
|
275 |
-
return result
|
276 |
-
|
277 |
-
PREREL_TAGS = set(['a', 'b', 'c', 'rc', 'dev'])
|
278 |
-
|
279 |
-
@property
|
280 |
-
def is_prerelease(self):
|
281 |
-
return any(t[0] in self.PREREL_TAGS for t in self._parts if t)
|
282 |
-
|
283 |
-
|
284 |
-
def _match_prefix(x, y):
|
285 |
-
x = str(x)
|
286 |
-
y = str(y)
|
287 |
-
if x == y:
|
288 |
-
return True
|
289 |
-
if not x.startswith(y):
|
290 |
-
return False
|
291 |
-
n = len(y)
|
292 |
-
return x[n] == '.'
|
293 |
-
|
294 |
-
|
295 |
-
class NormalizedMatcher(Matcher):
|
296 |
-
version_class = NormalizedVersion
|
297 |
-
|
298 |
-
# value is either a callable or the name of a method
|
299 |
-
_operators = {
|
300 |
-
'~=': '_match_compatible',
|
301 |
-
'<': '_match_lt',
|
302 |
-
'>': '_match_gt',
|
303 |
-
'<=': '_match_le',
|
304 |
-
'>=': '_match_ge',
|
305 |
-
'==': '_match_eq',
|
306 |
-
'===': '_match_arbitrary',
|
307 |
-
'!=': '_match_ne',
|
308 |
-
}
|
309 |
-
|
310 |
-
def _adjust_local(self, version, constraint, prefix):
|
311 |
-
if prefix:
|
312 |
-
strip_local = '+' not in constraint and version._parts[-1]
|
313 |
-
else:
|
314 |
-
# both constraint and version are
|
315 |
-
# NormalizedVersion instances.
|
316 |
-
# If constraint does not have a local component,
|
317 |
-
# ensure the version doesn't, either.
|
318 |
-
strip_local = not constraint._parts[-1] and version._parts[-1]
|
319 |
-
if strip_local:
|
320 |
-
s = version._string.split('+', 1)[0]
|
321 |
-
version = self.version_class(s)
|
322 |
-
return version, constraint
|
323 |
-
|
324 |
-
def _match_lt(self, version, constraint, prefix):
|
325 |
-
version, constraint = self._adjust_local(version, constraint, prefix)
|
326 |
-
if version >= constraint:
|
327 |
-
return False
|
328 |
-
release_clause = constraint._release_clause
|
329 |
-
pfx = '.'.join([str(i) for i in release_clause])
|
330 |
-
return not _match_prefix(version, pfx)
|
331 |
-
|
332 |
-
def _match_gt(self, version, constraint, prefix):
|
333 |
-
version, constraint = self._adjust_local(version, constraint, prefix)
|
334 |
-
if version <= constraint:
|
335 |
-
return False
|
336 |
-
release_clause = constraint._release_clause
|
337 |
-
pfx = '.'.join([str(i) for i in release_clause])
|
338 |
-
return not _match_prefix(version, pfx)
|
339 |
-
|
340 |
-
def _match_le(self, version, constraint, prefix):
|
341 |
-
version, constraint = self._adjust_local(version, constraint, prefix)
|
342 |
-
return version <= constraint
|
343 |
-
|
344 |
-
def _match_ge(self, version, constraint, prefix):
|
345 |
-
version, constraint = self._adjust_local(version, constraint, prefix)
|
346 |
-
return version >= constraint
|
347 |
-
|
348 |
-
def _match_eq(self, version, constraint, prefix):
|
349 |
-
version, constraint = self._adjust_local(version, constraint, prefix)
|
350 |
-
if not prefix:
|
351 |
-
result = (version == constraint)
|
352 |
-
else:
|
353 |
-
result = _match_prefix(version, constraint)
|
354 |
-
return result
|
355 |
-
|
356 |
-
def _match_arbitrary(self, version, constraint, prefix):
|
357 |
-
return str(version) == str(constraint)
|
358 |
-
|
359 |
-
def _match_ne(self, version, constraint, prefix):
|
360 |
-
version, constraint = self._adjust_local(version, constraint, prefix)
|
361 |
-
if not prefix:
|
362 |
-
result = (version != constraint)
|
363 |
-
else:
|
364 |
-
result = not _match_prefix(version, constraint)
|
365 |
-
return result
|
366 |
-
|
367 |
-
def _match_compatible(self, version, constraint, prefix):
|
368 |
-
version, constraint = self._adjust_local(version, constraint, prefix)
|
369 |
-
if version == constraint:
|
370 |
-
return True
|
371 |
-
if version < constraint:
|
372 |
-
return False
|
373 |
-
# if not prefix:
|
374 |
-
# return True
|
375 |
-
release_clause = constraint._release_clause
|
376 |
-
if len(release_clause) > 1:
|
377 |
-
release_clause = release_clause[:-1]
|
378 |
-
pfx = '.'.join([str(i) for i in release_clause])
|
379 |
-
return _match_prefix(version, pfx)
|
380 |
-
|
381 |
-
_REPLACEMENTS = (
|
382 |
-
(re.compile('[.+-]$'), ''), # remove trailing puncts
|
383 |
-
(re.compile(r'^[.](\d)'), r'0.\1'), # .N -> 0.N at start
|
384 |
-
(re.compile('^[.-]'), ''), # remove leading puncts
|
385 |
-
(re.compile(r'^\((.*)\)$'), r'\1'), # remove parentheses
|
386 |
-
(re.compile(r'^v(ersion)?\s*(\d+)'), r'\2'), # remove leading v(ersion)
|
387 |
-
(re.compile(r'^r(ev)?\s*(\d+)'), r'\2'), # remove leading v(ersion)
|
388 |
-
(re.compile('[.]{2,}'), '.'), # multiple runs of '.'
|
389 |
-
(re.compile(r'\b(alfa|apha)\b'), 'alpha'), # misspelt alpha
|
390 |
-
(re.compile(r'\b(pre-alpha|prealpha)\b'),
|
391 |
-
'pre.alpha'), # standardise
|
392 |
-
(re.compile(r'\(beta\)$'), 'beta'), # remove parentheses
|
393 |
-
)
|
394 |
-
|
395 |
-
_SUFFIX_REPLACEMENTS = (
|
396 |
-
(re.compile('^[:~._+-]+'), ''), # remove leading puncts
|
397 |
-
(re.compile('[,*")([\\]]'), ''), # remove unwanted chars
|
398 |
-
(re.compile('[~:+_ -]'), '.'), # replace illegal chars
|
399 |
-
(re.compile('[.]{2,}'), '.'), # multiple runs of '.'
|
400 |
-
(re.compile(r'\.$'), ''), # trailing '.'
|
401 |
-
)
|
402 |
-
|
403 |
-
_NUMERIC_PREFIX = re.compile(r'(\d+(\.\d+)*)')
|
404 |
-
|
405 |
-
|
406 |
-
def _suggest_semantic_version(s):
|
407 |
-
"""
|
408 |
-
Try to suggest a semantic form for a version for which
|
409 |
-
_suggest_normalized_version couldn't come up with anything.
|
410 |
-
"""
|
411 |
-
result = s.strip().lower()
|
412 |
-
for pat, repl in _REPLACEMENTS:
|
413 |
-
result = pat.sub(repl, result)
|
414 |
-
if not result:
|
415 |
-
result = '0.0.0'
|
416 |
-
|
417 |
-
# Now look for numeric prefix, and separate it out from
|
418 |
-
# the rest.
|
419 |
-
#import pdb; pdb.set_trace()
|
420 |
-
m = _NUMERIC_PREFIX.match(result)
|
421 |
-
if not m:
|
422 |
-
prefix = '0.0.0'
|
423 |
-
suffix = result
|
424 |
-
else:
|
425 |
-
prefix = m.groups()[0].split('.')
|
426 |
-
prefix = [int(i) for i in prefix]
|
427 |
-
while len(prefix) < 3:
|
428 |
-
prefix.append(0)
|
429 |
-
if len(prefix) == 3:
|
430 |
-
suffix = result[m.end():]
|
431 |
-
else:
|
432 |
-
suffix = '.'.join([str(i) for i in prefix[3:]]) + result[m.end():]
|
433 |
-
prefix = prefix[:3]
|
434 |
-
prefix = '.'.join([str(i) for i in prefix])
|
435 |
-
suffix = suffix.strip()
|
436 |
-
if suffix:
|
437 |
-
#import pdb; pdb.set_trace()
|
438 |
-
# massage the suffix.
|
439 |
-
for pat, repl in _SUFFIX_REPLACEMENTS:
|
440 |
-
suffix = pat.sub(repl, suffix)
|
441 |
-
|
442 |
-
if not suffix:
|
443 |
-
result = prefix
|
444 |
-
else:
|
445 |
-
sep = '-' if 'dev' in suffix else '+'
|
446 |
-
result = prefix + sep + suffix
|
447 |
-
if not is_semver(result):
|
448 |
-
result = None
|
449 |
-
return result
|
450 |
-
|
451 |
-
|
452 |
-
def _suggest_normalized_version(s):
|
453 |
-
"""Suggest a normalized version close to the given version string.
|
454 |
-
|
455 |
-
If you have a version string that isn't rational (i.e. NormalizedVersion
|
456 |
-
doesn't like it) then you might be able to get an equivalent (or close)
|
457 |
-
rational version from this function.
|
458 |
-
|
459 |
-
This does a number of simple normalizations to the given string, based
|
460 |
-
on observation of versions currently in use on PyPI. Given a dump of
|
461 |
-
those version during PyCon 2009, 4287 of them:
|
462 |
-
- 2312 (53.93%) match NormalizedVersion without change
|
463 |
-
with the automatic suggestion
|
464 |
-
- 3474 (81.04%) match when using this suggestion method
|
465 |
-
|
466 |
-
@param s {str} An irrational version string.
|
467 |
-
@returns A rational version string, or None, if couldn't determine one.
|
468 |
-
"""
|
469 |
-
try:
|
470 |
-
_normalized_key(s)
|
471 |
-
return s # already rational
|
472 |
-
except UnsupportedVersionError:
|
473 |
-
pass
|
474 |
-
|
475 |
-
rs = s.lower()
|
476 |
-
|
477 |
-
# part of this could use maketrans
|
478 |
-
for orig, repl in (('-alpha', 'a'), ('-beta', 'b'), ('alpha', 'a'),
|
479 |
-
('beta', 'b'), ('rc', 'c'), ('-final', ''),
|
480 |
-
('-pre', 'c'),
|
481 |
-
('-release', ''), ('.release', ''), ('-stable', ''),
|
482 |
-
('+', '.'), ('_', '.'), (' ', ''), ('.final', ''),
|
483 |
-
('final', '')):
|
484 |
-
rs = rs.replace(orig, repl)
|
485 |
-
|
486 |
-
# if something ends with dev or pre, we add a 0
|
487 |
-
rs = re.sub(r"pre$", r"pre0", rs)
|
488 |
-
rs = re.sub(r"dev$", r"dev0", rs)
|
489 |
-
|
490 |
-
# if we have something like "b-2" or "a.2" at the end of the
|
491 |
-
# version, that is probably beta, alpha, etc
|
492 |
-
# let's remove the dash or dot
|
493 |
-
rs = re.sub(r"([abc]|rc)[\-\.](\d+)$", r"\1\2", rs)
|
494 |
-
|
495 |
-
# 1.0-dev-r371 -> 1.0.dev371
|
496 |
-
# 0.1-dev-r79 -> 0.1.dev79
|
497 |
-
rs = re.sub(r"[\-\.](dev)[\-\.]?r?(\d+)$", r".\1\2", rs)
|
498 |
-
|
499 |
-
# Clean: 2.0.a.3, 2.0.b1, 0.9.0~c1
|
500 |
-
rs = re.sub(r"[.~]?([abc])\.?", r"\1", rs)
|
501 |
-
|
502 |
-
# Clean: v0.3, v1.0
|
503 |
-
if rs.startswith('v'):
|
504 |
-
rs = rs[1:]
|
505 |
-
|
506 |
-
# Clean leading '0's on numbers.
|
507 |
-
#TODO: unintended side-effect on, e.g., "2003.05.09"
|
508 |
-
# PyPI stats: 77 (~2%) better
|
509 |
-
rs = re.sub(r"\b0+(\d+)(?!\d)", r"\1", rs)
|
510 |
-
|
511 |
-
# Clean a/b/c with no version. E.g. "1.0a" -> "1.0a0". Setuptools infers
|
512 |
-
# zero.
|
513 |
-
# PyPI stats: 245 (7.56%) better
|
514 |
-
rs = re.sub(r"(\d+[abc])$", r"\g<1>0", rs)
|
515 |
-
|
516 |
-
# the 'dev-rNNN' tag is a dev tag
|
517 |
-
rs = re.sub(r"\.?(dev-r|dev\.r)\.?(\d+)$", r".dev\2", rs)
|
518 |
-
|
519 |
-
# clean the - when used as a pre delimiter
|
520 |
-
rs = re.sub(r"-(a|b|c)(\d+)$", r"\1\2", rs)
|
521 |
-
|
522 |
-
# a terminal "dev" or "devel" can be changed into ".dev0"
|
523 |
-
rs = re.sub(r"[\.\-](dev|devel)$", r".dev0", rs)
|
524 |
-
|
525 |
-
# a terminal "dev" can be changed into ".dev0"
|
526 |
-
rs = re.sub(r"(?![\.\-])dev$", r".dev0", rs)
|
527 |
-
|
528 |
-
# a terminal "final" or "stable" can be removed
|
529 |
-
rs = re.sub(r"(final|stable)$", "", rs)
|
530 |
-
|
531 |
-
# The 'r' and the '-' tags are post release tags
|
532 |
-
# 0.4a1.r10 -> 0.4a1.post10
|
533 |
-
# 0.9.33-17222 -> 0.9.33.post17222
|
534 |
-
# 0.9.33-r17222 -> 0.9.33.post17222
|
535 |
-
rs = re.sub(r"\.?(r|-|-r)\.?(\d+)$", r".post\2", rs)
|
536 |
-
|
537 |
-
# Clean 'r' instead of 'dev' usage:
|
538 |
-
# 0.9.33+r17222 -> 0.9.33.dev17222
|
539 |
-
# 1.0dev123 -> 1.0.dev123
|
540 |
-
# 1.0.git123 -> 1.0.dev123
|
541 |
-
# 1.0.bzr123 -> 1.0.dev123
|
542 |
-
# 0.1a0dev.123 -> 0.1a0.dev123
|
543 |
-
# PyPI stats: ~150 (~4%) better
|
544 |
-
rs = re.sub(r"\.?(dev|git|bzr)\.?(\d+)$", r".dev\2", rs)
|
545 |
-
|
546 |
-
# Clean '.pre' (normalized from '-pre' above) instead of 'c' usage:
|
547 |
-
# 0.2.pre1 -> 0.2c1
|
548 |
-
# 0.2-c1 -> 0.2c1
|
549 |
-
# 1.0preview123 -> 1.0c123
|
550 |
-
# PyPI stats: ~21 (0.62%) better
|
551 |
-
rs = re.sub(r"\.?(pre|preview|-c)(\d+)$", r"c\g<2>", rs)
|
552 |
-
|
553 |
-
# Tcl/Tk uses "px" for their post release markers
|
554 |
-
rs = re.sub(r"p(\d+)$", r".post\1", rs)
|
555 |
-
|
556 |
-
try:
|
557 |
-
_normalized_key(rs)
|
558 |
-
except UnsupportedVersionError:
|
559 |
-
rs = None
|
560 |
-
return rs
|
561 |
-
|
562 |
-
#
|
563 |
-
# Legacy version processing (distribute-compatible)
|
564 |
-
#
|
565 |
-
|
566 |
-
_VERSION_PART = re.compile(r'([a-z]+|\d+|[\.-])', re.I)
|
567 |
-
_VERSION_REPLACE = {
|
568 |
-
'pre': 'c',
|
569 |
-
'preview': 'c',
|
570 |
-
'-': 'final-',
|
571 |
-
'rc': 'c',
|
572 |
-
'dev': '@',
|
573 |
-
'': None,
|
574 |
-
'.': None,
|
575 |
-
}
|
576 |
-
|
577 |
-
|
578 |
-
def _legacy_key(s):
|
579 |
-
def get_parts(s):
|
580 |
-
result = []
|
581 |
-
for p in _VERSION_PART.split(s.lower()):
|
582 |
-
p = _VERSION_REPLACE.get(p, p)
|
583 |
-
if p:
|
584 |
-
if '0' <= p[:1] <= '9':
|
585 |
-
p = p.zfill(8)
|
586 |
-
else:
|
587 |
-
p = '*' + p
|
588 |
-
result.append(p)
|
589 |
-
result.append('*final')
|
590 |
-
return result
|
591 |
-
|
592 |
-
result = []
|
593 |
-
for p in get_parts(s):
|
594 |
-
if p.startswith('*'):
|
595 |
-
if p < '*final':
|
596 |
-
while result and result[-1] == '*final-':
|
597 |
-
result.pop()
|
598 |
-
while result and result[-1] == '00000000':
|
599 |
-
result.pop()
|
600 |
-
result.append(p)
|
601 |
-
return tuple(result)
|
602 |
-
|
603 |
-
|
604 |
-
class LegacyVersion(Version):
|
605 |
-
def parse(self, s):
|
606 |
-
return _legacy_key(s)
|
607 |
-
|
608 |
-
@property
|
609 |
-
def is_prerelease(self):
|
610 |
-
result = False
|
611 |
-
for x in self._parts:
|
612 |
-
if (isinstance(x, string_types) and x.startswith('*') and
|
613 |
-
x < '*final'):
|
614 |
-
result = True
|
615 |
-
break
|
616 |
-
return result
|
617 |
-
|
618 |
-
|
619 |
-
class LegacyMatcher(Matcher):
|
620 |
-
version_class = LegacyVersion
|
621 |
-
|
622 |
-
_operators = dict(Matcher._operators)
|
623 |
-
_operators['~='] = '_match_compatible'
|
624 |
-
|
625 |
-
numeric_re = re.compile(r'^(\d+(\.\d+)*)')
|
626 |
-
|
627 |
-
def _match_compatible(self, version, constraint, prefix):
|
628 |
-
if version < constraint:
|
629 |
-
return False
|
630 |
-
m = self.numeric_re.match(str(constraint))
|
631 |
-
if not m:
|
632 |
-
logger.warning('Cannot compute compatible match for version %s '
|
633 |
-
' and constraint %s', version, constraint)
|
634 |
-
return True
|
635 |
-
s = m.groups()[0]
|
636 |
-
if '.' in s:
|
637 |
-
s = s.rsplit('.', 1)[0]
|
638 |
-
return _match_prefix(version, s)
|
639 |
-
|
640 |
-
#
|
641 |
-
# Semantic versioning
|
642 |
-
#
|
643 |
-
|
644 |
-
_SEMVER_RE = re.compile(r'^(\d+)\.(\d+)\.(\d+)'
|
645 |
-
r'(-[a-z0-9]+(\.[a-z0-9-]+)*)?'
|
646 |
-
r'(\+[a-z0-9]+(\.[a-z0-9-]+)*)?$', re.I)
|
647 |
-
|
648 |
-
|
649 |
-
def is_semver(s):
|
650 |
-
return _SEMVER_RE.match(s)
|
651 |
-
|
652 |
-
|
653 |
-
def _semantic_key(s):
|
654 |
-
def make_tuple(s, absent):
|
655 |
-
if s is None:
|
656 |
-
result = (absent,)
|
657 |
-
else:
|
658 |
-
parts = s[1:].split('.')
|
659 |
-
# We can't compare ints and strings on Python 3, so fudge it
|
660 |
-
# by zero-filling numeric values so simulate a numeric comparison
|
661 |
-
result = tuple([p.zfill(8) if p.isdigit() else p for p in parts])
|
662 |
-
return result
|
663 |
-
|
664 |
-
m = is_semver(s)
|
665 |
-
if not m:
|
666 |
-
raise UnsupportedVersionError(s)
|
667 |
-
groups = m.groups()
|
668 |
-
major, minor, patch = [int(i) for i in groups[:3]]
|
669 |
-
# choose the '|' and '*' so that versions sort correctly
|
670 |
-
pre, build = make_tuple(groups[3], '|'), make_tuple(groups[5], '*')
|
671 |
-
return (major, minor, patch), pre, build
|
672 |
-
|
673 |
-
|
674 |
-
class SemanticVersion(Version):
|
675 |
-
def parse(self, s):
|
676 |
-
return _semantic_key(s)
|
677 |
-
|
678 |
-
@property
|
679 |
-
def is_prerelease(self):
|
680 |
-
return self._parts[1][0] != '|'
|
681 |
-
|
682 |
-
|
683 |
-
class SemanticMatcher(Matcher):
|
684 |
-
version_class = SemanticVersion
|
685 |
-
|
686 |
-
|
687 |
-
class VersionScheme(object):
|
688 |
-
def __init__(self, key, matcher, suggester=None):
|
689 |
-
self.key = key
|
690 |
-
self.matcher = matcher
|
691 |
-
self.suggester = suggester
|
692 |
-
|
693 |
-
def is_valid_version(self, s):
|
694 |
-
try:
|
695 |
-
self.matcher.version_class(s)
|
696 |
-
result = True
|
697 |
-
except UnsupportedVersionError:
|
698 |
-
result = False
|
699 |
-
return result
|
700 |
-
|
701 |
-
def is_valid_matcher(self, s):
|
702 |
-
try:
|
703 |
-
self.matcher(s)
|
704 |
-
result = True
|
705 |
-
except UnsupportedVersionError:
|
706 |
-
result = False
|
707 |
-
return result
|
708 |
-
|
709 |
-
def is_valid_constraint_list(self, s):
|
710 |
-
"""
|
711 |
-
Used for processing some metadata fields
|
712 |
-
"""
|
713 |
-
# See issue #140. Be tolerant of a single trailing comma.
|
714 |
-
if s.endswith(','):
|
715 |
-
s = s[:-1]
|
716 |
-
return self.is_valid_matcher('dummy_name (%s)' % s)
|
717 |
-
|
718 |
-
def suggest(self, s):
|
719 |
-
if self.suggester is None:
|
720 |
-
result = None
|
721 |
-
else:
|
722 |
-
result = self.suggester(s)
|
723 |
-
return result
|
724 |
-
|
725 |
-
_SCHEMES = {
|
726 |
-
'normalized': VersionScheme(_normalized_key, NormalizedMatcher,
|
727 |
-
_suggest_normalized_version),
|
728 |
-
'legacy': VersionScheme(_legacy_key, LegacyMatcher, lambda self, s: s),
|
729 |
-
'semantic': VersionScheme(_semantic_key, SemanticMatcher,
|
730 |
-
_suggest_semantic_version),
|
731 |
-
}
|
732 |
-
|
733 |
-
_SCHEMES['default'] = _SCHEMES['normalized']
|
734 |
-
|
735 |
-
|
736 |
-
def get_scheme(name):
|
737 |
-
if name not in _SCHEMES:
|
738 |
-
raise ValueError('unknown scheme name: %r' % name)
|
739 |
-
return _SCHEMES[name]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/packaging/_musllinux.py
DELETED
@@ -1,136 +0,0 @@
|
|
1 |
-
"""PEP 656 support.
|
2 |
-
|
3 |
-
This module implements logic to detect if the currently running Python is
|
4 |
-
linked against musl, and what musl version is used.
|
5 |
-
"""
|
6 |
-
|
7 |
-
import contextlib
|
8 |
-
import functools
|
9 |
-
import operator
|
10 |
-
import os
|
11 |
-
import re
|
12 |
-
import struct
|
13 |
-
import subprocess
|
14 |
-
import sys
|
15 |
-
from typing import IO, Iterator, NamedTuple, Optional, Tuple
|
16 |
-
|
17 |
-
|
18 |
-
def _read_unpacked(f: IO[bytes], fmt: str) -> Tuple[int, ...]:
|
19 |
-
return struct.unpack(fmt, f.read(struct.calcsize(fmt)))
|
20 |
-
|
21 |
-
|
22 |
-
def _parse_ld_musl_from_elf(f: IO[bytes]) -> Optional[str]:
|
23 |
-
"""Detect musl libc location by parsing the Python executable.
|
24 |
-
|
25 |
-
Based on: https://gist.github.com/lyssdod/f51579ae8d93c8657a5564aefc2ffbca
|
26 |
-
ELF header: https://refspecs.linuxfoundation.org/elf/gabi4+/ch4.eheader.html
|
27 |
-
"""
|
28 |
-
f.seek(0)
|
29 |
-
try:
|
30 |
-
ident = _read_unpacked(f, "16B")
|
31 |
-
except struct.error:
|
32 |
-
return None
|
33 |
-
if ident[:4] != tuple(b"\x7fELF"): # Invalid magic, not ELF.
|
34 |
-
return None
|
35 |
-
f.seek(struct.calcsize("HHI"), 1) # Skip file type, machine, and version.
|
36 |
-
|
37 |
-
try:
|
38 |
-
# e_fmt: Format for program header.
|
39 |
-
# p_fmt: Format for section header.
|
40 |
-
# p_idx: Indexes to find p_type, p_offset, and p_filesz.
|
41 |
-
e_fmt, p_fmt, p_idx = {
|
42 |
-
1: ("IIIIHHH", "IIIIIIII", (0, 1, 4)), # 32-bit.
|
43 |
-
2: ("QQQIHHH", "IIQQQQQQ", (0, 2, 5)), # 64-bit.
|
44 |
-
}[ident[4]]
|
45 |
-
except KeyError:
|
46 |
-
return None
|
47 |
-
else:
|
48 |
-
p_get = operator.itemgetter(*p_idx)
|
49 |
-
|
50 |
-
# Find the interpreter section and return its content.
|
51 |
-
try:
|
52 |
-
_, e_phoff, _, _, _, e_phentsize, e_phnum = _read_unpacked(f, e_fmt)
|
53 |
-
except struct.error:
|
54 |
-
return None
|
55 |
-
for i in range(e_phnum + 1):
|
56 |
-
f.seek(e_phoff + e_phentsize * i)
|
57 |
-
try:
|
58 |
-
p_type, p_offset, p_filesz = p_get(_read_unpacked(f, p_fmt))
|
59 |
-
except struct.error:
|
60 |
-
return None
|
61 |
-
if p_type != 3: # Not PT_INTERP.
|
62 |
-
continue
|
63 |
-
f.seek(p_offset)
|
64 |
-
interpreter = os.fsdecode(f.read(p_filesz)).strip("\0")
|
65 |
-
if "musl" not in interpreter:
|
66 |
-
return None
|
67 |
-
return interpreter
|
68 |
-
return None
|
69 |
-
|
70 |
-
|
71 |
-
class _MuslVersion(NamedTuple):
|
72 |
-
major: int
|
73 |
-
minor: int
|
74 |
-
|
75 |
-
|
76 |
-
def _parse_musl_version(output: str) -> Optional[_MuslVersion]:
|
77 |
-
lines = [n for n in (n.strip() for n in output.splitlines()) if n]
|
78 |
-
if len(lines) < 2 or lines[0][:4] != "musl":
|
79 |
-
return None
|
80 |
-
m = re.match(r"Version (\d+)\.(\d+)", lines[1])
|
81 |
-
if not m:
|
82 |
-
return None
|
83 |
-
return _MuslVersion(major=int(m.group(1)), minor=int(m.group(2)))
|
84 |
-
|
85 |
-
|
86 |
-
@functools.lru_cache()
|
87 |
-
def _get_musl_version(executable: str) -> Optional[_MuslVersion]:
|
88 |
-
"""Detect currently-running musl runtime version.
|
89 |
-
|
90 |
-
This is done by checking the specified executable's dynamic linking
|
91 |
-
information, and invoking the loader to parse its output for a version
|
92 |
-
string. If the loader is musl, the output would be something like::
|
93 |
-
|
94 |
-
musl libc (x86_64)
|
95 |
-
Version 1.2.2
|
96 |
-
Dynamic Program Loader
|
97 |
-
"""
|
98 |
-
with contextlib.ExitStack() as stack:
|
99 |
-
try:
|
100 |
-
f = stack.enter_context(open(executable, "rb"))
|
101 |
-
except OSError:
|
102 |
-
return None
|
103 |
-
ld = _parse_ld_musl_from_elf(f)
|
104 |
-
if not ld:
|
105 |
-
return None
|
106 |
-
proc = subprocess.run([ld], stderr=subprocess.PIPE, universal_newlines=True)
|
107 |
-
return _parse_musl_version(proc.stderr)
|
108 |
-
|
109 |
-
|
110 |
-
def platform_tags(arch: str) -> Iterator[str]:
|
111 |
-
"""Generate musllinux tags compatible to the current platform.
|
112 |
-
|
113 |
-
:param arch: Should be the part of platform tag after the ``linux_``
|
114 |
-
prefix, e.g. ``x86_64``. The ``linux_`` prefix is assumed as a
|
115 |
-
prerequisite for the current platform to be musllinux-compatible.
|
116 |
-
|
117 |
-
:returns: An iterator of compatible musllinux tags.
|
118 |
-
"""
|
119 |
-
sys_musl = _get_musl_version(sys.executable)
|
120 |
-
if sys_musl is None: # Python not dynamically linked against musl.
|
121 |
-
return
|
122 |
-
for minor in range(sys_musl.minor, -1, -1):
|
123 |
-
yield f"musllinux_{sys_musl.major}_{minor}_{arch}"
|
124 |
-
|
125 |
-
|
126 |
-
if __name__ == "__main__": # pragma: no cover
|
127 |
-
import sysconfig
|
128 |
-
|
129 |
-
plat = sysconfig.get_platform()
|
130 |
-
assert plat.startswith("linux-"), "not linux"
|
131 |
-
|
132 |
-
print("plat:", plat)
|
133 |
-
print("musl:", _get_musl_version(sys.executable))
|
134 |
-
print("tags:", end=" ")
|
135 |
-
for t in platform_tags(re.sub(r"[.-]", "_", plat.split("-", 1)[-1])):
|
136 |
-
print(t, end="\n ")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/packaging/tags.py
DELETED
@@ -1,487 +0,0 @@
|
|
1 |
-
# This file is dual licensed under the terms of the Apache License, Version
|
2 |
-
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
|
3 |
-
# for complete details.
|
4 |
-
|
5 |
-
import logging
|
6 |
-
import platform
|
7 |
-
import sys
|
8 |
-
import sysconfig
|
9 |
-
from importlib.machinery import EXTENSION_SUFFIXES
|
10 |
-
from typing import (
|
11 |
-
Dict,
|
12 |
-
FrozenSet,
|
13 |
-
Iterable,
|
14 |
-
Iterator,
|
15 |
-
List,
|
16 |
-
Optional,
|
17 |
-
Sequence,
|
18 |
-
Tuple,
|
19 |
-
Union,
|
20 |
-
cast,
|
21 |
-
)
|
22 |
-
|
23 |
-
from . import _manylinux, _musllinux
|
24 |
-
|
25 |
-
logger = logging.getLogger(__name__)
|
26 |
-
|
27 |
-
PythonVersion = Sequence[int]
|
28 |
-
MacVersion = Tuple[int, int]
|
29 |
-
|
30 |
-
INTERPRETER_SHORT_NAMES: Dict[str, str] = {
|
31 |
-
"python": "py", # Generic.
|
32 |
-
"cpython": "cp",
|
33 |
-
"pypy": "pp",
|
34 |
-
"ironpython": "ip",
|
35 |
-
"jython": "jy",
|
36 |
-
}
|
37 |
-
|
38 |
-
|
39 |
-
_32_BIT_INTERPRETER = sys.maxsize <= 2 ** 32
|
40 |
-
|
41 |
-
|
42 |
-
class Tag:
|
43 |
-
"""
|
44 |
-
A representation of the tag triple for a wheel.
|
45 |
-
|
46 |
-
Instances are considered immutable and thus are hashable. Equality checking
|
47 |
-
is also supported.
|
48 |
-
"""
|
49 |
-
|
50 |
-
__slots__ = ["_interpreter", "_abi", "_platform", "_hash"]
|
51 |
-
|
52 |
-
def __init__(self, interpreter: str, abi: str, platform: str) -> None:
|
53 |
-
self._interpreter = interpreter.lower()
|
54 |
-
self._abi = abi.lower()
|
55 |
-
self._platform = platform.lower()
|
56 |
-
# The __hash__ of every single element in a Set[Tag] will be evaluated each time
|
57 |
-
# that a set calls its `.disjoint()` method, which may be called hundreds of
|
58 |
-
# times when scanning a page of links for packages with tags matching that
|
59 |
-
# Set[Tag]. Pre-computing the value here produces significant speedups for
|
60 |
-
# downstream consumers.
|
61 |
-
self._hash = hash((self._interpreter, self._abi, self._platform))
|
62 |
-
|
63 |
-
@property
|
64 |
-
def interpreter(self) -> str:
|
65 |
-
return self._interpreter
|
66 |
-
|
67 |
-
@property
|
68 |
-
def abi(self) -> str:
|
69 |
-
return self._abi
|
70 |
-
|
71 |
-
@property
|
72 |
-
def platform(self) -> str:
|
73 |
-
return self._platform
|
74 |
-
|
75 |
-
def __eq__(self, other: object) -> bool:
|
76 |
-
if not isinstance(other, Tag):
|
77 |
-
return NotImplemented
|
78 |
-
|
79 |
-
return (
|
80 |
-
(self._hash == other._hash) # Short-circuit ASAP for perf reasons.
|
81 |
-
and (self._platform == other._platform)
|
82 |
-
and (self._abi == other._abi)
|
83 |
-
and (self._interpreter == other._interpreter)
|
84 |
-
)
|
85 |
-
|
86 |
-
def __hash__(self) -> int:
|
87 |
-
return self._hash
|
88 |
-
|
89 |
-
def __str__(self) -> str:
|
90 |
-
return f"{self._interpreter}-{self._abi}-{self._platform}"
|
91 |
-
|
92 |
-
def __repr__(self) -> str:
|
93 |
-
return f"<{self} @ {id(self)}>"
|
94 |
-
|
95 |
-
|
96 |
-
def parse_tag(tag: str) -> FrozenSet[Tag]:
|
97 |
-
"""
|
98 |
-
Parses the provided tag (e.g. `py3-none-any`) into a frozenset of Tag instances.
|
99 |
-
|
100 |
-
Returning a set is required due to the possibility that the tag is a
|
101 |
-
compressed tag set.
|
102 |
-
"""
|
103 |
-
tags = set()
|
104 |
-
interpreters, abis, platforms = tag.split("-")
|
105 |
-
for interpreter in interpreters.split("."):
|
106 |
-
for abi in abis.split("."):
|
107 |
-
for platform_ in platforms.split("."):
|
108 |
-
tags.add(Tag(interpreter, abi, platform_))
|
109 |
-
return frozenset(tags)
|
110 |
-
|
111 |
-
|
112 |
-
def _get_config_var(name: str, warn: bool = False) -> Union[int, str, None]:
|
113 |
-
value = sysconfig.get_config_var(name)
|
114 |
-
if value is None and warn:
|
115 |
-
logger.debug(
|
116 |
-
"Config variable '%s' is unset, Python ABI tag may be incorrect", name
|
117 |
-
)
|
118 |
-
return value
|
119 |
-
|
120 |
-
|
121 |
-
def _normalize_string(string: str) -> str:
|
122 |
-
return string.replace(".", "_").replace("-", "_")
|
123 |
-
|
124 |
-
|
125 |
-
def _abi3_applies(python_version: PythonVersion) -> bool:
|
126 |
-
"""
|
127 |
-
Determine if the Python version supports abi3.
|
128 |
-
|
129 |
-
PEP 384 was first implemented in Python 3.2.
|
130 |
-
"""
|
131 |
-
return len(python_version) > 1 and tuple(python_version) >= (3, 2)
|
132 |
-
|
133 |
-
|
134 |
-
def _cpython_abis(py_version: PythonVersion, warn: bool = False) -> List[str]:
|
135 |
-
py_version = tuple(py_version) # To allow for version comparison.
|
136 |
-
abis = []
|
137 |
-
version = _version_nodot(py_version[:2])
|
138 |
-
debug = pymalloc = ucs4 = ""
|
139 |
-
with_debug = _get_config_var("Py_DEBUG", warn)
|
140 |
-
has_refcount = hasattr(sys, "gettotalrefcount")
|
141 |
-
# Windows doesn't set Py_DEBUG, so checking for support of debug-compiled
|
142 |
-
# extension modules is the best option.
|
143 |
-
# https://github.com/pypa/pip/issues/3383#issuecomment-173267692
|
144 |
-
has_ext = "_d.pyd" in EXTENSION_SUFFIXES
|
145 |
-
if with_debug or (with_debug is None and (has_refcount or has_ext)):
|
146 |
-
debug = "d"
|
147 |
-
if py_version < (3, 8):
|
148 |
-
with_pymalloc = _get_config_var("WITH_PYMALLOC", warn)
|
149 |
-
if with_pymalloc or with_pymalloc is None:
|
150 |
-
pymalloc = "m"
|
151 |
-
if py_version < (3, 3):
|
152 |
-
unicode_size = _get_config_var("Py_UNICODE_SIZE", warn)
|
153 |
-
if unicode_size == 4 or (
|
154 |
-
unicode_size is None and sys.maxunicode == 0x10FFFF
|
155 |
-
):
|
156 |
-
ucs4 = "u"
|
157 |
-
elif debug:
|
158 |
-
# Debug builds can also load "normal" extension modules.
|
159 |
-
# We can also assume no UCS-4 or pymalloc requirement.
|
160 |
-
abis.append(f"cp{version}")
|
161 |
-
abis.insert(
|
162 |
-
0,
|
163 |
-
"cp{version}{debug}{pymalloc}{ucs4}".format(
|
164 |
-
version=version, debug=debug, pymalloc=pymalloc, ucs4=ucs4
|
165 |
-
),
|
166 |
-
)
|
167 |
-
return abis
|
168 |
-
|
169 |
-
|
170 |
-
def cpython_tags(
|
171 |
-
python_version: Optional[PythonVersion] = None,
|
172 |
-
abis: Optional[Iterable[str]] = None,
|
173 |
-
platforms: Optional[Iterable[str]] = None,
|
174 |
-
*,
|
175 |
-
warn: bool = False,
|
176 |
-
) -> Iterator[Tag]:
|
177 |
-
"""
|
178 |
-
Yields the tags for a CPython interpreter.
|
179 |
-
|
180 |
-
The tags consist of:
|
181 |
-
- cp<python_version>-<abi>-<platform>
|
182 |
-
- cp<python_version>-abi3-<platform>
|
183 |
-
- cp<python_version>-none-<platform>
|
184 |
-
- cp<less than python_version>-abi3-<platform> # Older Python versions down to 3.2.
|
185 |
-
|
186 |
-
If python_version only specifies a major version then user-provided ABIs and
|
187 |
-
the 'none' ABItag will be used.
|
188 |
-
|
189 |
-
If 'abi3' or 'none' are specified in 'abis' then they will be yielded at
|
190 |
-
their normal position and not at the beginning.
|
191 |
-
"""
|
192 |
-
if not python_version:
|
193 |
-
python_version = sys.version_info[:2]
|
194 |
-
|
195 |
-
interpreter = f"cp{_version_nodot(python_version[:2])}"
|
196 |
-
|
197 |
-
if abis is None:
|
198 |
-
if len(python_version) > 1:
|
199 |
-
abis = _cpython_abis(python_version, warn)
|
200 |
-
else:
|
201 |
-
abis = []
|
202 |
-
abis = list(abis)
|
203 |
-
# 'abi3' and 'none' are explicitly handled later.
|
204 |
-
for explicit_abi in ("abi3", "none"):
|
205 |
-
try:
|
206 |
-
abis.remove(explicit_abi)
|
207 |
-
except ValueError:
|
208 |
-
pass
|
209 |
-
|
210 |
-
platforms = list(platforms or platform_tags())
|
211 |
-
for abi in abis:
|
212 |
-
for platform_ in platforms:
|
213 |
-
yield Tag(interpreter, abi, platform_)
|
214 |
-
if _abi3_applies(python_version):
|
215 |
-
yield from (Tag(interpreter, "abi3", platform_) for platform_ in platforms)
|
216 |
-
yield from (Tag(interpreter, "none", platform_) for platform_ in platforms)
|
217 |
-
|
218 |
-
if _abi3_applies(python_version):
|
219 |
-
for minor_version in range(python_version[1] - 1, 1, -1):
|
220 |
-
for platform_ in platforms:
|
221 |
-
interpreter = "cp{version}".format(
|
222 |
-
version=_version_nodot((python_version[0], minor_version))
|
223 |
-
)
|
224 |
-
yield Tag(interpreter, "abi3", platform_)
|
225 |
-
|
226 |
-
|
227 |
-
def _generic_abi() -> Iterator[str]:
|
228 |
-
abi = sysconfig.get_config_var("SOABI")
|
229 |
-
if abi:
|
230 |
-
yield _normalize_string(abi)
|
231 |
-
|
232 |
-
|
233 |
-
def generic_tags(
|
234 |
-
interpreter: Optional[str] = None,
|
235 |
-
abis: Optional[Iterable[str]] = None,
|
236 |
-
platforms: Optional[Iterable[str]] = None,
|
237 |
-
*,
|
238 |
-
warn: bool = False,
|
239 |
-
) -> Iterator[Tag]:
|
240 |
-
"""
|
241 |
-
Yields the tags for a generic interpreter.
|
242 |
-
|
243 |
-
The tags consist of:
|
244 |
-
- <interpreter>-<abi>-<platform>
|
245 |
-
|
246 |
-
The "none" ABI will be added if it was not explicitly provided.
|
247 |
-
"""
|
248 |
-
if not interpreter:
|
249 |
-
interp_name = interpreter_name()
|
250 |
-
interp_version = interpreter_version(warn=warn)
|
251 |
-
interpreter = "".join([interp_name, interp_version])
|
252 |
-
if abis is None:
|
253 |
-
abis = _generic_abi()
|
254 |
-
platforms = list(platforms or platform_tags())
|
255 |
-
abis = list(abis)
|
256 |
-
if "none" not in abis:
|
257 |
-
abis.append("none")
|
258 |
-
for abi in abis:
|
259 |
-
for platform_ in platforms:
|
260 |
-
yield Tag(interpreter, abi, platform_)
|
261 |
-
|
262 |
-
|
263 |
-
def _py_interpreter_range(py_version: PythonVersion) -> Iterator[str]:
|
264 |
-
"""
|
265 |
-
Yields Python versions in descending order.
|
266 |
-
|
267 |
-
After the latest version, the major-only version will be yielded, and then
|
268 |
-
all previous versions of that major version.
|
269 |
-
"""
|
270 |
-
if len(py_version) > 1:
|
271 |
-
yield f"py{_version_nodot(py_version[:2])}"
|
272 |
-
yield f"py{py_version[0]}"
|
273 |
-
if len(py_version) > 1:
|
274 |
-
for minor in range(py_version[1] - 1, -1, -1):
|
275 |
-
yield f"py{_version_nodot((py_version[0], minor))}"
|
276 |
-
|
277 |
-
|
278 |
-
def compatible_tags(
|
279 |
-
python_version: Optional[PythonVersion] = None,
|
280 |
-
interpreter: Optional[str] = None,
|
281 |
-
platforms: Optional[Iterable[str]] = None,
|
282 |
-
) -> Iterator[Tag]:
|
283 |
-
"""
|
284 |
-
Yields the sequence of tags that are compatible with a specific version of Python.
|
285 |
-
|
286 |
-
The tags consist of:
|
287 |
-
- py*-none-<platform>
|
288 |
-
- <interpreter>-none-any # ... if `interpreter` is provided.
|
289 |
-
- py*-none-any
|
290 |
-
"""
|
291 |
-
if not python_version:
|
292 |
-
python_version = sys.version_info[:2]
|
293 |
-
platforms = list(platforms or platform_tags())
|
294 |
-
for version in _py_interpreter_range(python_version):
|
295 |
-
for platform_ in platforms:
|
296 |
-
yield Tag(version, "none", platform_)
|
297 |
-
if interpreter:
|
298 |
-
yield Tag(interpreter, "none", "any")
|
299 |
-
for version in _py_interpreter_range(python_version):
|
300 |
-
yield Tag(version, "none", "any")
|
301 |
-
|
302 |
-
|
303 |
-
def _mac_arch(arch: str, is_32bit: bool = _32_BIT_INTERPRETER) -> str:
|
304 |
-
if not is_32bit:
|
305 |
-
return arch
|
306 |
-
|
307 |
-
if arch.startswith("ppc"):
|
308 |
-
return "ppc"
|
309 |
-
|
310 |
-
return "i386"
|
311 |
-
|
312 |
-
|
313 |
-
def _mac_binary_formats(version: MacVersion, cpu_arch: str) -> List[str]:
|
314 |
-
formats = [cpu_arch]
|
315 |
-
if cpu_arch == "x86_64":
|
316 |
-
if version < (10, 4):
|
317 |
-
return []
|
318 |
-
formats.extend(["intel", "fat64", "fat32"])
|
319 |
-
|
320 |
-
elif cpu_arch == "i386":
|
321 |
-
if version < (10, 4):
|
322 |
-
return []
|
323 |
-
formats.extend(["intel", "fat32", "fat"])
|
324 |
-
|
325 |
-
elif cpu_arch == "ppc64":
|
326 |
-
# TODO: Need to care about 32-bit PPC for ppc64 through 10.2?
|
327 |
-
if version > (10, 5) or version < (10, 4):
|
328 |
-
return []
|
329 |
-
formats.append("fat64")
|
330 |
-
|
331 |
-
elif cpu_arch == "ppc":
|
332 |
-
if version > (10, 6):
|
333 |
-
return []
|
334 |
-
formats.extend(["fat32", "fat"])
|
335 |
-
|
336 |
-
if cpu_arch in {"arm64", "x86_64"}:
|
337 |
-
formats.append("universal2")
|
338 |
-
|
339 |
-
if cpu_arch in {"x86_64", "i386", "ppc64", "ppc", "intel"}:
|
340 |
-
formats.append("universal")
|
341 |
-
|
342 |
-
return formats
|
343 |
-
|
344 |
-
|
345 |
-
def mac_platforms(
|
346 |
-
version: Optional[MacVersion] = None, arch: Optional[str] = None
|
347 |
-
) -> Iterator[str]:
|
348 |
-
"""
|
349 |
-
Yields the platform tags for a macOS system.
|
350 |
-
|
351 |
-
The `version` parameter is a two-item tuple specifying the macOS version to
|
352 |
-
generate platform tags for. The `arch` parameter is the CPU architecture to
|
353 |
-
generate platform tags for. Both parameters default to the appropriate value
|
354 |
-
for the current system.
|
355 |
-
"""
|
356 |
-
version_str, _, cpu_arch = platform.mac_ver()
|
357 |
-
if version is None:
|
358 |
-
version = cast("MacVersion", tuple(map(int, version_str.split(".")[:2])))
|
359 |
-
else:
|
360 |
-
version = version
|
361 |
-
if arch is None:
|
362 |
-
arch = _mac_arch(cpu_arch)
|
363 |
-
else:
|
364 |
-
arch = arch
|
365 |
-
|
366 |
-
if (10, 0) <= version and version < (11, 0):
|
367 |
-
# Prior to Mac OS 11, each yearly release of Mac OS bumped the
|
368 |
-
# "minor" version number. The major version was always 10.
|
369 |
-
for minor_version in range(version[1], -1, -1):
|
370 |
-
compat_version = 10, minor_version
|
371 |
-
binary_formats = _mac_binary_formats(compat_version, arch)
|
372 |
-
for binary_format in binary_formats:
|
373 |
-
yield "macosx_{major}_{minor}_{binary_format}".format(
|
374 |
-
major=10, minor=minor_version, binary_format=binary_format
|
375 |
-
)
|
376 |
-
|
377 |
-
if version >= (11, 0):
|
378 |
-
# Starting with Mac OS 11, each yearly release bumps the major version
|
379 |
-
# number. The minor versions are now the midyear updates.
|
380 |
-
for major_version in range(version[0], 10, -1):
|
381 |
-
compat_version = major_version, 0
|
382 |
-
binary_formats = _mac_binary_formats(compat_version, arch)
|
383 |
-
for binary_format in binary_formats:
|
384 |
-
yield "macosx_{major}_{minor}_{binary_format}".format(
|
385 |
-
major=major_version, minor=0, binary_format=binary_format
|
386 |
-
)
|
387 |
-
|
388 |
-
if version >= (11, 0):
|
389 |
-
# Mac OS 11 on x86_64 is compatible with binaries from previous releases.
|
390 |
-
# Arm64 support was introduced in 11.0, so no Arm binaries from previous
|
391 |
-
# releases exist.
|
392 |
-
#
|
393 |
-
# However, the "universal2" binary format can have a
|
394 |
-
# macOS version earlier than 11.0 when the x86_64 part of the binary supports
|
395 |
-
# that version of macOS.
|
396 |
-
if arch == "x86_64":
|
397 |
-
for minor_version in range(16, 3, -1):
|
398 |
-
compat_version = 10, minor_version
|
399 |
-
binary_formats = _mac_binary_formats(compat_version, arch)
|
400 |
-
for binary_format in binary_formats:
|
401 |
-
yield "macosx_{major}_{minor}_{binary_format}".format(
|
402 |
-
major=compat_version[0],
|
403 |
-
minor=compat_version[1],
|
404 |
-
binary_format=binary_format,
|
405 |
-
)
|
406 |
-
else:
|
407 |
-
for minor_version in range(16, 3, -1):
|
408 |
-
compat_version = 10, minor_version
|
409 |
-
binary_format = "universal2"
|
410 |
-
yield "macosx_{major}_{minor}_{binary_format}".format(
|
411 |
-
major=compat_version[0],
|
412 |
-
minor=compat_version[1],
|
413 |
-
binary_format=binary_format,
|
414 |
-
)
|
415 |
-
|
416 |
-
|
417 |
-
def _linux_platforms(is_32bit: bool = _32_BIT_INTERPRETER) -> Iterator[str]:
|
418 |
-
linux = _normalize_string(sysconfig.get_platform())
|
419 |
-
if is_32bit:
|
420 |
-
if linux == "linux_x86_64":
|
421 |
-
linux = "linux_i686"
|
422 |
-
elif linux == "linux_aarch64":
|
423 |
-
linux = "linux_armv7l"
|
424 |
-
_, arch = linux.split("_", 1)
|
425 |
-
yield from _manylinux.platform_tags(linux, arch)
|
426 |
-
yield from _musllinux.platform_tags(arch)
|
427 |
-
yield linux
|
428 |
-
|
429 |
-
|
430 |
-
def _generic_platforms() -> Iterator[str]:
|
431 |
-
yield _normalize_string(sysconfig.get_platform())
|
432 |
-
|
433 |
-
|
434 |
-
def platform_tags() -> Iterator[str]:
|
435 |
-
"""
|
436 |
-
Provides the platform tags for this installation.
|
437 |
-
"""
|
438 |
-
if platform.system() == "Darwin":
|
439 |
-
return mac_platforms()
|
440 |
-
elif platform.system() == "Linux":
|
441 |
-
return _linux_platforms()
|
442 |
-
else:
|
443 |
-
return _generic_platforms()
|
444 |
-
|
445 |
-
|
446 |
-
def interpreter_name() -> str:
|
447 |
-
"""
|
448 |
-
Returns the name of the running interpreter.
|
449 |
-
"""
|
450 |
-
name = sys.implementation.name
|
451 |
-
return INTERPRETER_SHORT_NAMES.get(name) or name
|
452 |
-
|
453 |
-
|
454 |
-
def interpreter_version(*, warn: bool = False) -> str:
|
455 |
-
"""
|
456 |
-
Returns the version of the running interpreter.
|
457 |
-
"""
|
458 |
-
version = _get_config_var("py_version_nodot", warn=warn)
|
459 |
-
if version:
|
460 |
-
version = str(version)
|
461 |
-
else:
|
462 |
-
version = _version_nodot(sys.version_info[:2])
|
463 |
-
return version
|
464 |
-
|
465 |
-
|
466 |
-
def _version_nodot(version: PythonVersion) -> str:
|
467 |
-
return "".join(map(str, version))
|
468 |
-
|
469 |
-
|
470 |
-
def sys_tags(*, warn: bool = False) -> Iterator[Tag]:
|
471 |
-
"""
|
472 |
-
Returns the sequence of tag triples for the running interpreter.
|
473 |
-
|
474 |
-
The order of the sequence corresponds to priority order for the
|
475 |
-
interpreter, from most to least important.
|
476 |
-
"""
|
477 |
-
|
478 |
-
interp_name = interpreter_name()
|
479 |
-
if interp_name == "cp":
|
480 |
-
yield from cpython_tags(warn=warn)
|
481 |
-
else:
|
482 |
-
yield from generic_tags()
|
483 |
-
|
484 |
-
if interp_name == "pp":
|
485 |
-
yield from compatible_tags(interpreter="pp3")
|
486 |
-
else:
|
487 |
-
yield from compatible_tags()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/pyproject_hooks/_compat.py
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
__all__ = ("tomllib",)
|
2 |
-
|
3 |
-
import sys
|
4 |
-
|
5 |
-
if sys.version_info >= (3, 11):
|
6 |
-
import tomllib
|
7 |
-
else:
|
8 |
-
from pip._vendor import tomli as tomllib
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Audio-AGI/AudioSep/models/CLAP/open_clip/timm_model.py
DELETED
@@ -1,112 +0,0 @@
|
|
1 |
-
""" timm model adapter
|
2 |
-
|
3 |
-
Wraps timm (https://github.com/rwightman/pytorch-image-models) models for use as a vision tower in CLIP model.
|
4 |
-
"""
|
5 |
-
from collections import OrderedDict
|
6 |
-
|
7 |
-
import torch.nn as nn
|
8 |
-
|
9 |
-
try:
|
10 |
-
import timm
|
11 |
-
from timm.models.layers import Mlp, to_2tuple
|
12 |
-
from timm.models.layers.attention_pool2d import RotAttentionPool2d
|
13 |
-
from timm.models.layers.attention_pool2d import (
|
14 |
-
AttentionPool2d as AbsAttentionPool2d,
|
15 |
-
)
|
16 |
-
except ImportError as e:
|
17 |
-
timm = None
|
18 |
-
|
19 |
-
from .utils import freeze_batch_norm_2d
|
20 |
-
|
21 |
-
|
22 |
-
class TimmModel(nn.Module):
|
23 |
-
"""timm model adapter
|
24 |
-
# FIXME this adapter is a work in progress, may change in ways that break weight compat
|
25 |
-
"""
|
26 |
-
|
27 |
-
def __init__(
|
28 |
-
self,
|
29 |
-
model_name,
|
30 |
-
embed_dim,
|
31 |
-
image_size=224,
|
32 |
-
pool="avg",
|
33 |
-
proj="linear",
|
34 |
-
drop=0.0,
|
35 |
-
pretrained=False,
|
36 |
-
):
|
37 |
-
super().__init__()
|
38 |
-
if timm is None:
|
39 |
-
raise RuntimeError("Please `pip install timm` to use timm models.")
|
40 |
-
|
41 |
-
self.image_size = to_2tuple(image_size)
|
42 |
-
self.trunk = timm.create_model(model_name, pretrained=pretrained)
|
43 |
-
feat_size = self.trunk.default_cfg.get("pool_size", None)
|
44 |
-
feature_ndim = 1 if not feat_size else 2
|
45 |
-
if pool in ("abs_attn", "rot_attn"):
|
46 |
-
assert feature_ndim == 2
|
47 |
-
# if attn pooling used, remove both classifier and default pool
|
48 |
-
self.trunk.reset_classifier(0, global_pool="")
|
49 |
-
else:
|
50 |
-
# reset global pool if pool config set, otherwise leave as network default
|
51 |
-
reset_kwargs = dict(global_pool=pool) if pool else {}
|
52 |
-
self.trunk.reset_classifier(0, **reset_kwargs)
|
53 |
-
prev_chs = self.trunk.num_features
|
54 |
-
|
55 |
-
head_layers = OrderedDict()
|
56 |
-
if pool == "abs_attn":
|
57 |
-
head_layers["pool"] = AbsAttentionPool2d(
|
58 |
-
prev_chs, feat_size=feat_size, out_features=embed_dim
|
59 |
-
)
|
60 |
-
prev_chs = embed_dim
|
61 |
-
elif pool == "rot_attn":
|
62 |
-
head_layers["pool"] = RotAttentionPool2d(prev_chs, out_features=embed_dim)
|
63 |
-
prev_chs = embed_dim
|
64 |
-
else:
|
65 |
-
assert proj, "projection layer needed if non-attention pooling is used."
|
66 |
-
|
67 |
-
# NOTE attention pool ends with a projection layer, so proj should usually be set to '' if such pooling is used
|
68 |
-
if proj == "linear":
|
69 |
-
head_layers["drop"] = nn.Dropout(drop)
|
70 |
-
head_layers["proj"] = nn.Linear(prev_chs, embed_dim)
|
71 |
-
elif proj == "mlp":
|
72 |
-
head_layers["mlp"] = Mlp(prev_chs, 2 * embed_dim, embed_dim, drop=drop)
|
73 |
-
|
74 |
-
self.head = nn.Sequential(head_layers)
|
75 |
-
|
76 |
-
def lock(self, unlocked_groups=0, freeze_bn_stats=False):
|
77 |
-
"""lock modules
|
78 |
-
Args:
|
79 |
-
unlocked_groups (int): leave last n layer groups unlocked (default: 0)
|
80 |
-
"""
|
81 |
-
if not unlocked_groups:
|
82 |
-
# lock full model
|
83 |
-
for param in self.trunk.parameters():
|
84 |
-
param.requires_grad = False
|
85 |
-
if freeze_bn_stats:
|
86 |
-
freeze_batch_norm_2d(self.trunk)
|
87 |
-
else:
|
88 |
-
# NOTE: partial freeze requires latest timm (master) branch and is subject to change
|
89 |
-
try:
|
90 |
-
# FIXME import here until API stable and in an official release
|
91 |
-
from timm.models.helpers import group_parameters, group_modules
|
92 |
-
except ImportError:
|
93 |
-
raise RuntimeError(
|
94 |
-
"Please install latest timm `pip install git+https://github.com/rwightman/pytorch-image-models`"
|
95 |
-
)
|
96 |
-
matcher = self.trunk.group_matcher()
|
97 |
-
gparams = group_parameters(self.trunk, matcher)
|
98 |
-
max_layer_id = max(gparams.keys())
|
99 |
-
max_layer_id = max_layer_id - unlocked_groups
|
100 |
-
for group_idx in range(max_layer_id + 1):
|
101 |
-
group = gparams[group_idx]
|
102 |
-
for param in group:
|
103 |
-
self.trunk.get_parameter(param).requires_grad = False
|
104 |
-
if freeze_bn_stats:
|
105 |
-
gmodules = group_modules(self.trunk, matcher, reverse=True)
|
106 |
-
gmodules = {k for k, v in gmodules.items() if v <= max_layer_id}
|
107 |
-
freeze_batch_norm_2d(self.trunk, gmodules)
|
108 |
-
|
109 |
-
def forward(self, x):
|
110 |
-
x = self.trunk(x)
|
111 |
-
x = self.head(x)
|
112 |
-
return x
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Awiny/Image2Paragraph/models/grit_src/third_party/CenterNet2/detectron2/evaluation/testing.py
DELETED
@@ -1,85 +0,0 @@
|
|
1 |
-
# Copyright (c) Facebook, Inc. and its affiliates.
|
2 |
-
import logging
|
3 |
-
import numpy as np
|
4 |
-
import pprint
|
5 |
-
import sys
|
6 |
-
from collections.abc import Mapping
|
7 |
-
|
8 |
-
|
9 |
-
def print_csv_format(results):
|
10 |
-
"""
|
11 |
-
Print main metrics in a format similar to Detectron,
|
12 |
-
so that they are easy to copypaste into a spreadsheet.
|
13 |
-
|
14 |
-
Args:
|
15 |
-
results (OrderedDict[dict]): task_name -> {metric -> score}
|
16 |
-
unordered dict can also be printed, but in arbitrary order
|
17 |
-
"""
|
18 |
-
assert isinstance(results, Mapping) or not len(results), results
|
19 |
-
logger = logging.getLogger(__name__)
|
20 |
-
for task, res in results.items():
|
21 |
-
if isinstance(res, Mapping):
|
22 |
-
# Don't print "AP-category" metrics since they are usually not tracked.
|
23 |
-
important_res = [(k, v) for k, v in res.items() if "-" not in k]
|
24 |
-
logger.info("copypaste: Task: {}".format(task))
|
25 |
-
logger.info("copypaste: " + ",".join([k[0] for k in important_res]))
|
26 |
-
logger.info("copypaste: " + ",".join(["{0:.4f}".format(k[1]) for k in important_res]))
|
27 |
-
else:
|
28 |
-
logger.info(f"copypaste: {task}={res}")
|
29 |
-
|
30 |
-
|
31 |
-
def verify_results(cfg, results):
|
32 |
-
"""
|
33 |
-
Args:
|
34 |
-
results (OrderedDict[dict]): task_name -> {metric -> score}
|
35 |
-
|
36 |
-
Returns:
|
37 |
-
bool: whether the verification succeeds or not
|
38 |
-
"""
|
39 |
-
expected_results = cfg.TEST.EXPECTED_RESULTS
|
40 |
-
if not len(expected_results):
|
41 |
-
return True
|
42 |
-
|
43 |
-
ok = True
|
44 |
-
for task, metric, expected, tolerance in expected_results:
|
45 |
-
actual = results[task].get(metric, None)
|
46 |
-
if actual is None:
|
47 |
-
ok = False
|
48 |
-
continue
|
49 |
-
if not np.isfinite(actual):
|
50 |
-
ok = False
|
51 |
-
continue
|
52 |
-
diff = abs(actual - expected)
|
53 |
-
if diff > tolerance:
|
54 |
-
ok = False
|
55 |
-
|
56 |
-
logger = logging.getLogger(__name__)
|
57 |
-
if not ok:
|
58 |
-
logger.error("Result verification failed!")
|
59 |
-
logger.error("Expected Results: " + str(expected_results))
|
60 |
-
logger.error("Actual Results: " + pprint.pformat(results))
|
61 |
-
|
62 |
-
sys.exit(1)
|
63 |
-
else:
|
64 |
-
logger.info("Results verification passed.")
|
65 |
-
return ok
|
66 |
-
|
67 |
-
|
68 |
-
def flatten_results_dict(results):
|
69 |
-
"""
|
70 |
-
Expand a hierarchical dict of scalars into a flat dict of scalars.
|
71 |
-
If results[k1][k2][k3] = v, the returned dict will have the entry
|
72 |
-
{"k1/k2/k3": v}.
|
73 |
-
|
74 |
-
Args:
|
75 |
-
results (dict):
|
76 |
-
"""
|
77 |
-
r = {}
|
78 |
-
for k, v in results.items():
|
79 |
-
if isinstance(v, Mapping):
|
80 |
-
v = flatten_results_dict(v)
|
81 |
-
for kk, vv in v.items():
|
82 |
-
r[k + "/" + kk] = vv
|
83 |
-
else:
|
84 |
-
r[k] = v
|
85 |
-
return r
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Benson/text-generation/Examples/Blockman Go Newshungama Mod Apk.md
DELETED
@@ -1,56 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>Blockman Go Newshungama Mod Apk: Un juego divertido y creativo para los usuarios de Android</h1>
|
3 |
-
<p>Si estás buscando un juego que te ofrezca infinitas posibilidades de diversión y creatividad, entonces deberías echar un vistazo a Blockman Go. Este es un juego sandbox que le permite construir y explorar diferentes mundos, jugar varios minijuegos, e interactuar con otros jugadores en línea. Y si desea mejorar su experiencia de juego aún más, entonces usted debe probar el Newshungama Mod Apk, que es una versión modificada de Blockman Go que le da dinero y recursos ilimitados. En este artículo, le diremos todo lo que necesita saber sobre Blockman Go y Newshungama Mod Apk, incluyendo lo que son, lo que ofrecen, y cómo conseguirlos en su dispositivo Android. </p>
|
4 |
-
<h2>¿Qué es Blockman Go? </h2>
|
5 |
-
<p>Blockman Go es un juego sandbox que fue desarrollado por Blockman GO Studio. Fue lanzado en 2017 y desde entonces ha ganado millones de fans en todo el mundo. El juego tiene varias características que lo hacen único y atractivo, como:</p>
|
6 |
-
<h2>blockman go newshungama mod apk</h2><br /><p><b><b>Download Zip</b> ››› <a href="https://bltlly.com/2v6KnG">https://bltlly.com/2v6KnG</a></b></p><br /><br />
|
7 |
-
<h3>Un juego de sandbox con múltiples mini-juegos</h3>
|
8 |
-
<p>Blockman Go no es solo un juego, sino una colección de muchos minijuegos entre los que puedes elegir. Puedes jugar juegos como Bed Wars, Sky Wars, Murder Mystery, Parkour, Prison Escape, y más. Cada juego tiene sus propias reglas, objetivos y desafíos que te mantendrán entretenido durante horas. También puedes crear tus propios juegos usando el editor integrado y compartirlos con otros jugadores. </p>
|
9 |
-
<h3>Una plataforma social con funciones de chat y voz</h3>
|
10 |
-
<p>Blockman Go no es solo un juego, sino también una plataforma social donde puedes conocer y chatear con otros jugadores de diferentes países. Puede unirse o crear salas y servidores donde puede jugar juegos juntos, chatear con mensajes de texto o voz y hacer nuevos amigos. También puedes unirte a clanes y gremios donde puedes cooperar y competir con otros miembros. </p>
|
11 |
-
<h3>Un sistema avatar personalizable con pieles y accesorios</h3>
|
12 |
-
|
13 |
-
<h2>¿Qué es Newshungama Mod Apk? </h2>
|
14 |
-
<p>Newshungama Mod Apk es una versión modificada de Blockman Go que fue creado por Newshungama.com. Es un archivo apk mod que se puede descargar e instalar en su dispositivo Android para disfrutar de algunas características y beneficios adicionales en el juego, tales como:</p>
|
15 |
-
<h3>Una versión modificada de Blockman Go con dinero y recursos ilimitados</h3>
|
16 |
-
<p>Newshungama Mod Apk le da dinero y recursos ilimitados en el juego, lo que significa que usted puede comprar o utilizar cualquier cosa que desee sin preocuparse por quedarse sin monedas o gemas. Puedes comprar más skins y accesorios para tu avatar, más artículos para tus juegos, más privilegios VIP y más. </p>
|
17 |
-
<h3>Una forma de acceder a características y artículos premium de forma gratuita</h3>
|
18 |
-
<p>Newshungama Mod Apk también le permite acceder a algunas características premium y artículos que normalmente no están disponibles de forma gratuita en el juego. Puedes obtener membresía VIP gratis, lo que te da más beneficios y privilegios, como pieles exclusivas, insignias, colores de chat y más. También puedes obtener códigos de regalo gratis, que te dan recompensas aleatorias, como monedas, gemas, pieles y más. </p>
|
19 |
-
<h3>Un archivo apk seguro y fácil de instalar para dispositivos Android</h3>
|
20 |
-
<p>Newshungama Mod Apk es un archivo apk seguro y fácil de instalar que no requiere ninguna raíz o jailbreak en su dispositivo. Puede descargarlo desde el sitio web oficial de Newshungama.com, que es una fuente confiable de archivos apk mod. También puede seguir las instrucciones sobre cómo instalarlo en su dispositivo sin problemas. </p>
|
21 |
-
<h2>¿Cuáles son los beneficios de usar Newshungama Mod Apk? </h2>
|
22 |
-
<p>Mediante el uso de Newshungama Mod Apk, se puede disfrutar de más diversión y variedad en el juego. Algunos de los beneficios de usar este mod apk son:</p>
|
23 |
-
<p></p>
|
24 |
-
<h3>Puedes disfrutar de más diversión y variedad en el juego</h3>
|
25 |
-
|
26 |
-
<h3>Puede crear y unir más salas y servidores</h3>
|
27 |
-
<p>Con dinero y recursos ilimitados, también puede crear y unir más salas y servidores en el juego. Puedes organizar tus propios juegos e invitar a otros jugadores a unirse a ti. También puedes unirte a los juegos de otros jugadores y divertirte con ellos. También puedes chatear y hablar con ellos usando las características sociales del juego. </p>
|
28 |
-
<h3>Puedes desbloquear y usar más skins y accesorios para tu avatar</h3>
|
29 |
-
<p>Con dinero y recursos ilimitados, también puedes desbloquear y usar más skins y accesorios para tu avatar. Puede elegir entre una amplia gama de opciones para personalizar su apariencia y expresar su personalidad. También puede mezclar y combinar diferentes elementos para crear su propio aspecto único. </p>
|
30 |
-
<h2>Cómo descargar e instalar Newshungama Mod Apk? </h2>
|
31 |
-
<p>Si desea descargar e instalar Newshungama Mod Apk en su dispositivo Android, puede seguir estos sencillos pasos:</p>
|
32 |
-
<h3>Siga estos sencillos pasos para obtener el apk mod en su dispositivo</h3>
|
33 |
-
<ol>
|
34 |
-
<li>Ir a la página web oficial de Newshungama.com y encontrar el enlace de descarga de Blockman Go Newshungama Mod Apk.</li>
|
35 |
-
<li>Haga clic en el enlace de descarga y espere a que el archivo apk se descargue en su dispositivo. </li>
|
36 |
-
<li>Una vez completada la descarga, vaya a la configuración del dispositivo y habilite la instalación de fuentes desconocidas. </li>
|
37 |
-
<li>Busque el archivo apk en el almacenamiento del dispositivo y toque en él para iniciar el proceso de instalación. </li>
|
38 |
-
<li> Siga las instrucciones en la pantalla y espere a que termine la instalación. </li>
|
39 |
-
<li>Iniciar el juego desde el cajón de la aplicación y disfrutar de las características de mod. </li>
|
40 |
-
</ol>
|
41 |
-
<h2>Conclusión</h2>
|
42 |
-
|
43 |
-
<h2>Preguntas frecuentes</h2>
|
44 |
-
<p>Aquí están algunas de las preguntas más frecuentes sobre Blockman Go Newshungama Mod Apk:</p>
|
45 |
-
<h4>Q: ¿Es seguro usar Blockman Go Newshungama Mod Apk? </h4>
|
46 |
-
<p>A: Sí, Blockman Go Newshungama Mod Apk es seguro de usar, siempre y cuando se descarga desde el sitio web oficial de Newshungama.com, que es una fuente confiable de archivos mod apk. El apk mod no contiene ningún virus o malware que podría dañar su dispositivo o datos. </p>
|
47 |
-
<h4>Q: ¿Es Blockman Go Newshungama Mod Apk compatible con mi dispositivo? </h4>
|
48 |
-
<p>A: Blockman Go Newshungama Mod Apk es compatible con cualquier dispositivo Android que tiene Android 4.1 o superior y al menos 2 GB de RAM. Puede comprobar las especificaciones de su dispositivo y la compatibilidad antes de descargar el apk mod. </p>
|
49 |
-
<h4>Q: Será Blockman Go Newshungama Mod Apk afectar a mis datos originales del juego? </h4>
|
50 |
-
<p>A: No, Blockman Go Newshungama Mod Apk no afectará a los datos originales del juego. El mod apk es un archivo separado que no sobrescribe ni interfiere con los datos originales del juego. Todavía puedes jugar el juego original sin ningún problema. </p>
|
51 |
-
<h4>Q: ¿Puedo actualizar Blockman Go Newshungama Mod Apk a la última versión? </h4>
|
52 |
-
<p>A: Sí, puede actualizar Blockman Go Newshungama Mod Apk a la última versión cada vez que hay una nueva actualización disponible. Puede consultar el sitio web oficial de Newshungama.com para obtener las últimas actualizaciones y descargarlas desde allí. También puede habilitar la función de actualización automática en la configuración de apk mod para obtener las actualizaciones automáticamente. </p>
|
53 |
-
<h4>Q: ¿Puedo jugar Blockman Go Newshungama Mod Apk con otros jugadores en línea? </h4>
|
54 |
-
<p>A: Sí, puedes jugar Blockman Go Newshungama Mod Apk con otros jugadores en línea. El mod apk es compatible con el modo multijugador en línea, lo que significa que puede unirse o crear salas y servidores donde se puede jugar y chatear con otros jugadores. Sin embargo, es posible que no pueda jugar con jugadores que estén usando el juego original o un apk mod diferente, ya que pueden tener diferentes versiones o características. </p> 64aa2da5cf<br />
|
55 |
-
<br />
|
56 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Benson/text-generation/Examples/Como Hacer Una Hoja De Presentacin.md
DELETED
@@ -1,63 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Cómo descargar Alquimia de almas episodio 18</h1>
|
3 |
-
<p>Si eres un fan de los dramas de fantasía coreanos, es posible que hayas oído hablar de <strong>Alchemy of Souls</strong>, una serie original de Netflix que sigue las aventuras de jóvenes magos que pueden manipular almas. El espectáculo ha sido elogiado por su cautivadora trama, impresionantes efectos visuales y un reparto talentoso. Pero ¿qué pasa si desea ver el último episodio sin conexión, o no tiene acceso a Netflix en su región? En este artículo, te mostraremos cómo descargar el episodio 18 de Alchemy of Souls de dos fuentes diferentes: Netflix y Bilibili. También discutiremos los pros y los contras de descargar el episodio, y responderemos algunas preguntas frecuentes sobre el programa. </p>
|
4 |
-
<h2>como hacer una hoja de presentación</h2><br /><p><b><b>Download</b> >>>>> <a href="https://bltlly.com/2v6M2q">https://bltlly.com/2v6M2q</a></b></p><br /><br />
|
5 |
-
<h2>Dónde ver Alchemy of Souls Online</h2>
|
6 |
-
<p>Lo primero que necesitas saber es dónde puedes ver Alquimia de almas en línea. Hay dos opciones principales:</p>
|
7 |
-
<ul>
|
8 |
-
<li><strong>Netflix</strong>: Esta es la plataforma oficial de streaming para Alchemy of Souls, y ofrece todos los episodios con subtítulos en varios idiomas. Puede ver el programa en cualquier dispositivo compatible con Netflix, como su computadora, teléfono inteligente, tableta, televisor inteligente o consola de juegos. Sin embargo, necesita tener una suscripción de pago para acceder al contenido de Netflix, y la disponibilidad del programa puede variar dependiendo de su ubicación. </li>
|
9 |
-
<li><strong>Bilibili</strong>: Este es un popular sitio web chino para compartir videos que ofrece una amplia gama de contenido, incluyendo anime, películas, música, juegos y más. Puedes ver Alquimia de almas en Bilibili con subtítulos en chino o inglés. También puedes interactuar con otros fans a través de comentarios, likes y viñetas. No necesitas pagar nada para ver el programa en Bilibili, pero sí necesitas crear una cuenta gratuita e iniciar sesión. </li>
|
10 |
-
</ul>
|
11 |
-
<h2>Cómo descargar la alquimia de las almas de Netflix</h2>
|
12 |
-
<p>Si tienes una cuenta de Netflix y quieres descargar Alquimia de Almas episodio 18 desde allí, aquí están los pasos que necesitas seguir:</p>
|
13 |
-
<ol>
|
14 |
-
|
15 |
-
<li><strong>Buscar Alquimia de almas y seleccionar el episodio que desea descargar</strong>: Puede utilizar la barra de búsqueda o navegar por las categorías para encontrar Alquimia de almas en Netflix. Una vez que encuentre el programa, haga clic en él y seleccione el episodio que desea descargar. En este caso, es el episodio 18, titulado "La batalla final". </li>
|
16 |
-
<li><strong>Toque el icono de descarga junto al título del episodio y espere a que la descarga termine</strong>: Verá un icono de descarga que parece una flecha hacia abajo junto al título del episodio. Toque en él y la descarga comenzará. Puede comprobar el progreso de la descarga en la sección de descargas de la aplicación. Una vez completada la descarga, puedes ver el episodio sin conexión cuando quieras. </li>
|
17 |
-
</ol>
|
18 |
-
<h2>Cómo Descargar Alquimia de Almas de Bilibili</h2>
|
19 |
-
<p>Si no tienes una cuenta de Netflix o prefieres ver Alquimia de almas en Bilibili, estos son los pasos que debes seguir:</p>
|
20 |
-
<p></p>
|
21 |
-
<ol>
|
22 |
-
<li><strong>Visite el sitio web de Bilibili o descargue la aplicación en su dispositivo</strong>: Puede acceder a Bilibili en su navegador web o descargar su aplicación desde la Google Play Store o la App Store. Necesitará tener una conexión a Internet estable para usar Bilibili.</li>
|
23 |
-
<li><strong>Cree una cuenta gratuita o inicie sesión con su cuenta existente</strong>: Puede crear una cuenta gratuita en Bilibili proporcionando su dirección de correo electrónico, número de teléfono, nombre de usuario y contraseña. También puede iniciar sesión con su cuenta existente si ya tiene una. </li>
|
24 |
-
<li><strong>Buscar Alquimia de almas y seleccionar el episodio que desea descargar</strong>: Puede utilizar la barra de búsqueda o navegar por las categorías para encontrar Alquimia de almas en Bilibili. Una vez que encuentre el programa, haga clic en él y seleccione el episodio que desea descargar. En este caso, es el episodio 18, titulado "La batalla final". </li>
|
25 |
-
|
26 |
-
</ol>
|
27 |
-
<h2>Pros y contras de descargar alquimia de almas</h2>
|
28 |
-
<p>Descargar el episodio 18 de Alchemy of Souls puede parecer una buena idea, pero hay algunos pros y contras que debes considerar antes de hacerlo. Estos son algunos de ellos:</p>
|
29 |
-
<ul>
|
30 |
-
<li><strong>Pros</strong>: <ul>
|
31 |
-
<li>Puede ver el episodio sin conexión, lo que significa que no necesita una conexión a Internet o un plan de datos para disfrutarlo. </li>
|
32 |
-
<li>Puede guardar datos, especialmente si tiene un plan de datos limitado o caro. </li>
|
33 |
-
<li>Puedes evitar spoilers, especialmente si estás atrasado en el programa o vives en una zona horaria diferente. </li>
|
34 |
-
<li> Puede disfrutar de vídeo y audio de alta calidad, sin búfer ni interrupciones. </li>
|
35 |
-
</ul>
|
36 |
-
</li>
|
37 |
-
<li><strong>Contras</strong>: <ul>
|
38 |
-
<li>Puede violar los términos de servicio de Netflix o Bilibili, que prohíben descargar o distribuir su contenido sin permiso. </li>
|
39 |
-
<li>Es posible que tenga problemas legales, especialmente si comparte o vende el episodio descargado a otros. </li>
|
40 |
-
<li>Es posible que encuentre malware, virus u otro software dañino que pueda dañar su dispositivo o comprometer su seguridad. </li>
|
41 |
-
<li>Es posible que se pierda actualizaciones y extras, como imágenes entre bastidores, entrevistas, eventos de fans y más. </li>
|
42 |
-
</ul>
|
43 |
-
</li>
|
44 |
-
</ul>
|
45 |
-
<h2>Conclusión</h2>
|
46 |
-
<p>En conclusión, descargar el episodio 18 de Alchemy of Souls es posible desde dos fuentes diferentes: Netflix y Bilibili. Sin embargo, hay algunos pros y contras que usted debe pesar antes de hacerlo. Si decides descargar el episodio, asegúrate de hacerlo de forma segura y legal. Alternativamente, puedes ver el episodio en línea en Netflix o Bilibili y disfrutarlo con otros fans de todo el mundo. </p>
|
47 |
-
<h2>Preguntas frecuentes</h2>
|
48 |
-
<p>Aquí hay algunas preguntas frecuentes sobre la alquimia de las almas:</p>
|
49 |
-
<ol>
|
50 |
-
|
51 |
-
<li <li><strong> ¿Cuántos episodios hay en Alchemy of Souls? </strong>: Alchemy of Souls tiene 20 episodios en total, cada uno dura aproximadamente una hora. El programa se estrenó en Netflix el 1 de mayo de 2023 y se emitió todos los lunes y martes hasta el 20 de junio de 2023. </li>
|
52 |
-
<li><strong>¿La alquimia de las almas se basa en una novela o en un webtoon? </strong>: Alchemy of Souls se basa en un webtoon del mismo nombre de Kim Eun-hee y Yang Kyung-il. El webtoon se publicó por primera vez en Naver Webtoon en 2019 y tiene más de 10 millones de visitas. El webtoon también está disponible en inglés en Webtoon.</li>
|
53 |
-
<li><strong> ¿Quiénes son los actores principales en Alquimia de almas? </strong>: Los actores principales en Alquimia de almas son: <ul>
|
54 |
-
<li>Park Seo-joon como Lee Ji-hoon, un mago genio que puede crear y destruir almas. </li>
|
55 |
-
<li>Kim Ji-won como Kim Soo-hyun, un mago valiente y leal que puede controlar almas. </li>
|
56 |
-
<li>Lee Jong-suk como Choi Min-ki, un mago misterioso y poderoso que puede manipular almas. </li>
|
57 |
-
<li>Park Shin-hye como Yoo Na-ra, un mago amable y gentil que puede sanar almas. </li>
|
58 |
-
</ul>
|
59 |
-
</li>
|
60 |
-
¿Habrá una segunda temporada de Alquimia de Almas? </strong>: Todavía no hay confirmación oficial, pero el programa ha sido bien recibido por críticos y fans por igual. El espectáculo también ha dejado algunas preguntas sin respuesta y cliffhangers que sugieren una posible continuación. El webtoon todavía está en curso, por lo que hay más material para adaptar. Sin embargo, la decisión final dependerá de las calificaciones, el presupuesto y la disponibilidad del elenco y el equipo. </li>
|
61 |
-
</ol></p> 64aa2da5cf<br />
|
62 |
-
<br />
|
63 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Big-Web/MMSD/env/Lib/site-packages/botocore/docs/client.py
DELETED
@@ -1,400 +0,0 @@
|
|
1 |
-
# Copyright 2015 Amazon.com, Inc. or its affiliates. All Rights Reserved.
|
2 |
-
#
|
3 |
-
# Licensed under the Apache License, Version 2.0 (the "License"). You
|
4 |
-
# may not use this file except in compliance with the License. A copy of
|
5 |
-
# the License is located at
|
6 |
-
#
|
7 |
-
# http://aws.amazon.com/apache2.0/
|
8 |
-
#
|
9 |
-
# or in the "license" file accompanying this file. This file is
|
10 |
-
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
|
11 |
-
# ANY KIND, either express or implied. See the License for the specific
|
12 |
-
# language governing permissions and limitations under the License.
|
13 |
-
import os
|
14 |
-
|
15 |
-
from botocore.compat import OrderedDict
|
16 |
-
from botocore.docs.bcdoc.restdoc import DocumentStructure
|
17 |
-
from botocore.docs.example import ResponseExampleDocumenter
|
18 |
-
from botocore.docs.method import (
|
19 |
-
document_custom_method,
|
20 |
-
document_model_driven_method,
|
21 |
-
get_instance_public_methods,
|
22 |
-
)
|
23 |
-
from botocore.docs.params import ResponseParamsDocumenter
|
24 |
-
from botocore.docs.sharedexample import document_shared_examples
|
25 |
-
from botocore.docs.utils import DocumentedShape, get_official_service_name
|
26 |
-
|
27 |
-
|
28 |
-
def _allowlist_generate_presigned_url(method_name, service_name, **kwargs):
|
29 |
-
if method_name != 'generate_presigned_url':
|
30 |
-
return None
|
31 |
-
return service_name in ['s3']
|
32 |
-
|
33 |
-
|
34 |
-
class ClientDocumenter:
|
35 |
-
_CLIENT_METHODS_FILTERS = [
|
36 |
-
_allowlist_generate_presigned_url,
|
37 |
-
]
|
38 |
-
|
39 |
-
def __init__(self, client, root_docs_path, shared_examples=None):
|
40 |
-
self._client = client
|
41 |
-
self._client_class_name = self._client.__class__.__name__
|
42 |
-
self._root_docs_path = root_docs_path
|
43 |
-
self._shared_examples = shared_examples
|
44 |
-
if self._shared_examples is None:
|
45 |
-
self._shared_examples = {}
|
46 |
-
self._service_name = self._client.meta.service_model.service_name
|
47 |
-
|
48 |
-
def document_client(self, section):
|
49 |
-
"""Documents a client and its methods
|
50 |
-
|
51 |
-
:param section: The section to write to.
|
52 |
-
"""
|
53 |
-
self._add_title(section)
|
54 |
-
self._add_class_signature(section)
|
55 |
-
client_methods = self._get_client_methods()
|
56 |
-
self._add_client_intro(section, client_methods)
|
57 |
-
self._add_client_methods(client_methods)
|
58 |
-
|
59 |
-
def _get_client_methods(self):
|
60 |
-
client_methods = get_instance_public_methods(self._client)
|
61 |
-
return self._filter_client_methods(client_methods)
|
62 |
-
|
63 |
-
def _filter_client_methods(self, client_methods):
|
64 |
-
filtered_methods = {}
|
65 |
-
for method_name, method in client_methods.items():
|
66 |
-
include = self._filter_client_method(
|
67 |
-
method=method,
|
68 |
-
method_name=method_name,
|
69 |
-
service_name=self._service_name,
|
70 |
-
)
|
71 |
-
if include:
|
72 |
-
filtered_methods[method_name] = method
|
73 |
-
return filtered_methods
|
74 |
-
|
75 |
-
def _filter_client_method(self, **kwargs):
|
76 |
-
# Apply each filter to the method
|
77 |
-
for filter in self._CLIENT_METHODS_FILTERS:
|
78 |
-
filter_include = filter(**kwargs)
|
79 |
-
# Use the first non-None value returned by any of the filters
|
80 |
-
if filter_include is not None:
|
81 |
-
return filter_include
|
82 |
-
# Otherwise default to including it
|
83 |
-
return True
|
84 |
-
|
85 |
-
def _add_title(self, section):
|
86 |
-
section.style.h2('Client')
|
87 |
-
|
88 |
-
def _add_client_intro(self, section, client_methods):
|
89 |
-
section = section.add_new_section('intro')
|
90 |
-
# Write out the top level description for the client.
|
91 |
-
official_service_name = get_official_service_name(
|
92 |
-
self._client.meta.service_model
|
93 |
-
)
|
94 |
-
section.write(
|
95 |
-
f"A low-level client representing {official_service_name}"
|
96 |
-
)
|
97 |
-
section.style.new_line()
|
98 |
-
section.include_doc_string(
|
99 |
-
self._client.meta.service_model.documentation
|
100 |
-
)
|
101 |
-
|
102 |
-
# Write out the client example instantiation.
|
103 |
-
self._add_client_creation_example(section)
|
104 |
-
|
105 |
-
# List out all of the possible client methods.
|
106 |
-
section.style.dedent()
|
107 |
-
section.style.new_paragraph()
|
108 |
-
section.writeln('These are the available methods:')
|
109 |
-
section.style.toctree()
|
110 |
-
for method_name in sorted(client_methods):
|
111 |
-
section.style.tocitem(f'{self._service_name}/client/{method_name}')
|
112 |
-
|
113 |
-
def _add_class_signature(self, section):
|
114 |
-
section.style.start_sphinx_py_class(
|
115 |
-
class_name=f'{self._client_class_name}.Client'
|
116 |
-
)
|
117 |
-
|
118 |
-
def _add_client_creation_example(self, section):
|
119 |
-
section.style.start_codeblock()
|
120 |
-
section.style.new_line()
|
121 |
-
section.write(
|
122 |
-
'client = session.create_client(\'{service}\')'.format(
|
123 |
-
service=self._service_name
|
124 |
-
)
|
125 |
-
)
|
126 |
-
section.style.end_codeblock()
|
127 |
-
|
128 |
-
def _add_client_methods(self, client_methods):
|
129 |
-
for method_name in sorted(client_methods):
|
130 |
-
# Create a new DocumentStructure for each client method and add contents.
|
131 |
-
method_doc_structure = DocumentStructure(
|
132 |
-
method_name, target='html'
|
133 |
-
)
|
134 |
-
self._add_client_method(
|
135 |
-
method_doc_structure, method_name, client_methods[method_name]
|
136 |
-
)
|
137 |
-
# Write client methods in individual/nested files.
|
138 |
-
# Path: <root>/reference/services/<service>/client/<method_name>.rst
|
139 |
-
client_dir_path = os.path.join(
|
140 |
-
self._root_docs_path, self._service_name, 'client'
|
141 |
-
)
|
142 |
-
method_doc_structure.write_to_file(client_dir_path, method_name)
|
143 |
-
|
144 |
-
def _add_client_method(self, section, method_name, method):
|
145 |
-
breadcrumb_section = section.add_new_section('breadcrumb')
|
146 |
-
breadcrumb_section.style.ref(
|
147 |
-
self._client_class_name, f'../../{self._service_name}'
|
148 |
-
)
|
149 |
-
breadcrumb_section.write(f' / Client / {method_name}')
|
150 |
-
section.add_title_section(method_name)
|
151 |
-
method_section = section.add_new_section(
|
152 |
-
method_name,
|
153 |
-
context={'qualifier': f'{self._client_class_name}.Client.'},
|
154 |
-
)
|
155 |
-
if self._is_custom_method(method_name):
|
156 |
-
self._add_custom_method(
|
157 |
-
method_section,
|
158 |
-
method_name,
|
159 |
-
method,
|
160 |
-
)
|
161 |
-
else:
|
162 |
-
self._add_model_driven_method(method_section, method_name)
|
163 |
-
|
164 |
-
def _is_custom_method(self, method_name):
|
165 |
-
return method_name not in self._client.meta.method_to_api_mapping
|
166 |
-
|
167 |
-
def _add_custom_method(self, section, method_name, method):
|
168 |
-
document_custom_method(section, method_name, method)
|
169 |
-
|
170 |
-
def _add_method_exceptions_list(self, section, operation_model):
|
171 |
-
error_section = section.add_new_section('exceptions')
|
172 |
-
error_section.style.new_line()
|
173 |
-
error_section.style.bold('Exceptions')
|
174 |
-
error_section.style.new_line()
|
175 |
-
for error in operation_model.error_shapes:
|
176 |
-
class_name = (
|
177 |
-
f'{self._client_class_name}.Client.exceptions.{error.name}'
|
178 |
-
)
|
179 |
-
error_section.style.li(':py:class:`%s`' % class_name)
|
180 |
-
|
181 |
-
def _add_model_driven_method(self, section, method_name):
|
182 |
-
service_model = self._client.meta.service_model
|
183 |
-
operation_name = self._client.meta.method_to_api_mapping[method_name]
|
184 |
-
operation_model = service_model.operation_model(operation_name)
|
185 |
-
|
186 |
-
example_prefix = 'response = client.%s' % method_name
|
187 |
-
full_method_name = (
|
188 |
-
f"{section.context.get('qualifier', '')}{method_name}"
|
189 |
-
)
|
190 |
-
document_model_driven_method(
|
191 |
-
section,
|
192 |
-
full_method_name,
|
193 |
-
operation_model,
|
194 |
-
event_emitter=self._client.meta.events,
|
195 |
-
method_description=operation_model.documentation,
|
196 |
-
example_prefix=example_prefix,
|
197 |
-
)
|
198 |
-
|
199 |
-
# Add any modeled exceptions
|
200 |
-
if operation_model.error_shapes:
|
201 |
-
self._add_method_exceptions_list(section, operation_model)
|
202 |
-
|
203 |
-
# Add the shared examples
|
204 |
-
shared_examples = self._shared_examples.get(operation_name)
|
205 |
-
if shared_examples:
|
206 |
-
document_shared_examples(
|
207 |
-
section, operation_model, example_prefix, shared_examples
|
208 |
-
)
|
209 |
-
|
210 |
-
|
211 |
-
class ClientExceptionsDocumenter:
|
212 |
-
_USER_GUIDE_LINK = (
|
213 |
-
'https://boto3.amazonaws.com/'
|
214 |
-
'v1/documentation/api/latest/guide/error-handling.html'
|
215 |
-
)
|
216 |
-
_GENERIC_ERROR_SHAPE = DocumentedShape(
|
217 |
-
name='Error',
|
218 |
-
type_name='structure',
|
219 |
-
documentation=('Normalized access to common exception attributes.'),
|
220 |
-
members=OrderedDict(
|
221 |
-
[
|
222 |
-
(
|
223 |
-
'Code',
|
224 |
-
DocumentedShape(
|
225 |
-
name='Code',
|
226 |
-
type_name='string',
|
227 |
-
documentation=(
|
228 |
-
'An identifier specifying the exception type.'
|
229 |
-
),
|
230 |
-
),
|
231 |
-
),
|
232 |
-
(
|
233 |
-
'Message',
|
234 |
-
DocumentedShape(
|
235 |
-
name='Message',
|
236 |
-
type_name='string',
|
237 |
-
documentation=(
|
238 |
-
'A descriptive message explaining why the exception '
|
239 |
-
'occured.'
|
240 |
-
),
|
241 |
-
),
|
242 |
-
),
|
243 |
-
]
|
244 |
-
),
|
245 |
-
)
|
246 |
-
|
247 |
-
def __init__(self, client, root_docs_path):
|
248 |
-
self._client = client
|
249 |
-
self._client_class_name = self._client.__class__.__name__
|
250 |
-
self._service_name = self._client.meta.service_model.service_name
|
251 |
-
self._root_docs_path = root_docs_path
|
252 |
-
|
253 |
-
def document_exceptions(self, section):
|
254 |
-
self._add_title(section)
|
255 |
-
self._add_overview(section)
|
256 |
-
self._add_exceptions_list(section)
|
257 |
-
self._add_exception_classes()
|
258 |
-
|
259 |
-
def _add_title(self, section):
|
260 |
-
section.style.h2('Client Exceptions')
|
261 |
-
|
262 |
-
def _add_overview(self, section):
|
263 |
-
section.style.new_line()
|
264 |
-
section.write(
|
265 |
-
'Client exceptions are available on a client instance '
|
266 |
-
'via the ``exceptions`` property. For more detailed instructions '
|
267 |
-
'and examples on the exact usage of client exceptions, see the '
|
268 |
-
'error handling '
|
269 |
-
)
|
270 |
-
section.style.external_link(
|
271 |
-
title='user guide',
|
272 |
-
link=self._USER_GUIDE_LINK,
|
273 |
-
)
|
274 |
-
section.write('.')
|
275 |
-
section.style.new_line()
|
276 |
-
|
277 |
-
def _exception_class_name(self, shape):
|
278 |
-
return f'{self._client_class_name}.Client.exceptions.{shape.name}'
|
279 |
-
|
280 |
-
def _add_exceptions_list(self, section):
|
281 |
-
error_shapes = self._client.meta.service_model.error_shapes
|
282 |
-
if not error_shapes:
|
283 |
-
section.style.new_line()
|
284 |
-
section.write('This client has no modeled exception classes.')
|
285 |
-
section.style.new_line()
|
286 |
-
return
|
287 |
-
section.style.new_line()
|
288 |
-
section.writeln('The available client exceptions are:')
|
289 |
-
section.style.toctree()
|
290 |
-
for shape in error_shapes:
|
291 |
-
section.style.tocitem(
|
292 |
-
f'{self._service_name}/client/exceptions/{shape.name}'
|
293 |
-
)
|
294 |
-
|
295 |
-
def _add_exception_classes(self):
|
296 |
-
for shape in self._client.meta.service_model.error_shapes:
|
297 |
-
# Create a new DocumentStructure for each exception method and add contents.
|
298 |
-
exception_doc_structure = DocumentStructure(
|
299 |
-
shape.name, target='html'
|
300 |
-
)
|
301 |
-
self._add_exception_class(exception_doc_structure, shape)
|
302 |
-
# Write exceptions in individual/nested files.
|
303 |
-
# Path: <root>/reference/services/<service>/client/exceptions/<exception_name>.rst
|
304 |
-
exception_dir_path = os.path.join(
|
305 |
-
self._root_docs_path,
|
306 |
-
self._service_name,
|
307 |
-
'client',
|
308 |
-
'exceptions',
|
309 |
-
)
|
310 |
-
exception_doc_structure.write_to_file(
|
311 |
-
exception_dir_path, shape.name
|
312 |
-
)
|
313 |
-
|
314 |
-
def _add_exception_class(self, section, shape):
|
315 |
-
breadcrumb_section = section.add_new_section('breadcrumb')
|
316 |
-
breadcrumb_section.style.ref(
|
317 |
-
self._client_class_name, f'../../../{self._service_name}'
|
318 |
-
)
|
319 |
-
breadcrumb_section.write(f' / Client / exceptions / {shape.name}')
|
320 |
-
section.add_title_section(shape.name)
|
321 |
-
class_section = section.add_new_section(shape.name)
|
322 |
-
class_name = self._exception_class_name(shape)
|
323 |
-
class_section.style.start_sphinx_py_class(class_name=class_name)
|
324 |
-
self._add_top_level_documentation(class_section, shape)
|
325 |
-
self._add_exception_catch_example(class_section, shape)
|
326 |
-
self._add_response_attr(class_section, shape)
|
327 |
-
class_section.style.end_sphinx_py_class()
|
328 |
-
|
329 |
-
def _add_top_level_documentation(self, section, shape):
|
330 |
-
if shape.documentation:
|
331 |
-
section.style.new_line()
|
332 |
-
section.include_doc_string(shape.documentation)
|
333 |
-
section.style.new_line()
|
334 |
-
|
335 |
-
def _add_exception_catch_example(self, section, shape):
|
336 |
-
section.style.new_line()
|
337 |
-
section.style.bold('Example')
|
338 |
-
section.style.start_codeblock()
|
339 |
-
section.write('try:')
|
340 |
-
section.style.indent()
|
341 |
-
section.style.new_line()
|
342 |
-
section.write('...')
|
343 |
-
section.style.dedent()
|
344 |
-
section.style.new_line()
|
345 |
-
section.write('except client.exceptions.%s as e:' % shape.name)
|
346 |
-
section.style.indent()
|
347 |
-
section.style.new_line()
|
348 |
-
section.write('print(e.response)')
|
349 |
-
section.style.dedent()
|
350 |
-
section.style.end_codeblock()
|
351 |
-
|
352 |
-
def _add_response_attr(self, section, shape):
|
353 |
-
response_section = section.add_new_section('response')
|
354 |
-
response_section.style.start_sphinx_py_attr('response')
|
355 |
-
self._add_response_attr_description(response_section)
|
356 |
-
self._add_response_example(response_section, shape)
|
357 |
-
self._add_response_params(response_section, shape)
|
358 |
-
response_section.style.end_sphinx_py_attr()
|
359 |
-
|
360 |
-
def _add_response_attr_description(self, section):
|
361 |
-
section.style.new_line()
|
362 |
-
section.include_doc_string(
|
363 |
-
'The parsed error response. All exceptions have a top level '
|
364 |
-
'``Error`` key that provides normalized access to common '
|
365 |
-
'exception atrributes. All other keys are specific to this '
|
366 |
-
'service or exception class.'
|
367 |
-
)
|
368 |
-
section.style.new_line()
|
369 |
-
|
370 |
-
def _add_response_example(self, section, shape):
|
371 |
-
example_section = section.add_new_section('syntax')
|
372 |
-
example_section.style.new_line()
|
373 |
-
example_section.style.bold('Syntax')
|
374 |
-
example_section.style.new_paragraph()
|
375 |
-
documenter = ResponseExampleDocumenter(
|
376 |
-
service_name=self._service_name,
|
377 |
-
operation_name=None,
|
378 |
-
event_emitter=self._client.meta.events,
|
379 |
-
)
|
380 |
-
documenter.document_example(
|
381 |
-
example_section,
|
382 |
-
shape,
|
383 |
-
include=[self._GENERIC_ERROR_SHAPE],
|
384 |
-
)
|
385 |
-
|
386 |
-
def _add_response_params(self, section, shape):
|
387 |
-
params_section = section.add_new_section('Structure')
|
388 |
-
params_section.style.new_line()
|
389 |
-
params_section.style.bold('Structure')
|
390 |
-
params_section.style.new_paragraph()
|
391 |
-
documenter = ResponseParamsDocumenter(
|
392 |
-
service_name=self._service_name,
|
393 |
-
operation_name=None,
|
394 |
-
event_emitter=self._client.meta.events,
|
395 |
-
)
|
396 |
-
documenter.document_params(
|
397 |
-
params_section,
|
398 |
-
shape,
|
399 |
-
include=[self._GENERIC_ERROR_SHAPE],
|
400 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_internal/vcs/mercurial.py
DELETED
@@ -1,163 +0,0 @@
|
|
1 |
-
import configparser
|
2 |
-
import logging
|
3 |
-
import os
|
4 |
-
from typing import List, Optional, Tuple
|
5 |
-
|
6 |
-
from pip._internal.exceptions import BadCommand, InstallationError
|
7 |
-
from pip._internal.utils.misc import HiddenText, display_path
|
8 |
-
from pip._internal.utils.subprocess import make_command
|
9 |
-
from pip._internal.utils.urls import path_to_url
|
10 |
-
from pip._internal.vcs.versioncontrol import (
|
11 |
-
RevOptions,
|
12 |
-
VersionControl,
|
13 |
-
find_path_to_project_root_from_repo_root,
|
14 |
-
vcs,
|
15 |
-
)
|
16 |
-
|
17 |
-
logger = logging.getLogger(__name__)
|
18 |
-
|
19 |
-
|
20 |
-
class Mercurial(VersionControl):
|
21 |
-
name = "hg"
|
22 |
-
dirname = ".hg"
|
23 |
-
repo_name = "clone"
|
24 |
-
schemes = (
|
25 |
-
"hg+file",
|
26 |
-
"hg+http",
|
27 |
-
"hg+https",
|
28 |
-
"hg+ssh",
|
29 |
-
"hg+static-http",
|
30 |
-
)
|
31 |
-
|
32 |
-
@staticmethod
|
33 |
-
def get_base_rev_args(rev: str) -> List[str]:
|
34 |
-
return [rev]
|
35 |
-
|
36 |
-
def fetch_new(
|
37 |
-
self, dest: str, url: HiddenText, rev_options: RevOptions, verbosity: int
|
38 |
-
) -> None:
|
39 |
-
rev_display = rev_options.to_display()
|
40 |
-
logger.info(
|
41 |
-
"Cloning hg %s%s to %s",
|
42 |
-
url,
|
43 |
-
rev_display,
|
44 |
-
display_path(dest),
|
45 |
-
)
|
46 |
-
if verbosity <= 0:
|
47 |
-
flags: Tuple[str, ...] = ("--quiet",)
|
48 |
-
elif verbosity == 1:
|
49 |
-
flags = ()
|
50 |
-
elif verbosity == 2:
|
51 |
-
flags = ("--verbose",)
|
52 |
-
else:
|
53 |
-
flags = ("--verbose", "--debug")
|
54 |
-
self.run_command(make_command("clone", "--noupdate", *flags, url, dest))
|
55 |
-
self.run_command(
|
56 |
-
make_command("update", *flags, rev_options.to_args()),
|
57 |
-
cwd=dest,
|
58 |
-
)
|
59 |
-
|
60 |
-
def switch(self, dest: str, url: HiddenText, rev_options: RevOptions) -> None:
|
61 |
-
repo_config = os.path.join(dest, self.dirname, "hgrc")
|
62 |
-
config = configparser.RawConfigParser()
|
63 |
-
try:
|
64 |
-
config.read(repo_config)
|
65 |
-
config.set("paths", "default", url.secret)
|
66 |
-
with open(repo_config, "w") as config_file:
|
67 |
-
config.write(config_file)
|
68 |
-
except (OSError, configparser.NoSectionError) as exc:
|
69 |
-
logger.warning("Could not switch Mercurial repository to %s: %s", url, exc)
|
70 |
-
else:
|
71 |
-
cmd_args = make_command("update", "-q", rev_options.to_args())
|
72 |
-
self.run_command(cmd_args, cwd=dest)
|
73 |
-
|
74 |
-
def update(self, dest: str, url: HiddenText, rev_options: RevOptions) -> None:
|
75 |
-
self.run_command(["pull", "-q"], cwd=dest)
|
76 |
-
cmd_args = make_command("update", "-q", rev_options.to_args())
|
77 |
-
self.run_command(cmd_args, cwd=dest)
|
78 |
-
|
79 |
-
@classmethod
|
80 |
-
def get_remote_url(cls, location: str) -> str:
|
81 |
-
url = cls.run_command(
|
82 |
-
["showconfig", "paths.default"],
|
83 |
-
show_stdout=False,
|
84 |
-
stdout_only=True,
|
85 |
-
cwd=location,
|
86 |
-
).strip()
|
87 |
-
if cls._is_local_repository(url):
|
88 |
-
url = path_to_url(url)
|
89 |
-
return url.strip()
|
90 |
-
|
91 |
-
@classmethod
|
92 |
-
def get_revision(cls, location: str) -> str:
|
93 |
-
"""
|
94 |
-
Return the repository-local changeset revision number, as an integer.
|
95 |
-
"""
|
96 |
-
current_revision = cls.run_command(
|
97 |
-
["parents", "--template={rev}"],
|
98 |
-
show_stdout=False,
|
99 |
-
stdout_only=True,
|
100 |
-
cwd=location,
|
101 |
-
).strip()
|
102 |
-
return current_revision
|
103 |
-
|
104 |
-
@classmethod
|
105 |
-
def get_requirement_revision(cls, location: str) -> str:
|
106 |
-
"""
|
107 |
-
Return the changeset identification hash, as a 40-character
|
108 |
-
hexadecimal string
|
109 |
-
"""
|
110 |
-
current_rev_hash = cls.run_command(
|
111 |
-
["parents", "--template={node}"],
|
112 |
-
show_stdout=False,
|
113 |
-
stdout_only=True,
|
114 |
-
cwd=location,
|
115 |
-
).strip()
|
116 |
-
return current_rev_hash
|
117 |
-
|
118 |
-
@classmethod
|
119 |
-
def is_commit_id_equal(cls, dest: str, name: Optional[str]) -> bool:
|
120 |
-
"""Always assume the versions don't match"""
|
121 |
-
return False
|
122 |
-
|
123 |
-
@classmethod
|
124 |
-
def get_subdirectory(cls, location: str) -> Optional[str]:
|
125 |
-
"""
|
126 |
-
Return the path to Python project root, relative to the repo root.
|
127 |
-
Return None if the project root is in the repo root.
|
128 |
-
"""
|
129 |
-
# find the repo root
|
130 |
-
repo_root = cls.run_command(
|
131 |
-
["root"], show_stdout=False, stdout_only=True, cwd=location
|
132 |
-
).strip()
|
133 |
-
if not os.path.isabs(repo_root):
|
134 |
-
repo_root = os.path.abspath(os.path.join(location, repo_root))
|
135 |
-
return find_path_to_project_root_from_repo_root(location, repo_root)
|
136 |
-
|
137 |
-
@classmethod
|
138 |
-
def get_repository_root(cls, location: str) -> Optional[str]:
|
139 |
-
loc = super().get_repository_root(location)
|
140 |
-
if loc:
|
141 |
-
return loc
|
142 |
-
try:
|
143 |
-
r = cls.run_command(
|
144 |
-
["root"],
|
145 |
-
cwd=location,
|
146 |
-
show_stdout=False,
|
147 |
-
stdout_only=True,
|
148 |
-
on_returncode="raise",
|
149 |
-
log_failed_cmd=False,
|
150 |
-
)
|
151 |
-
except BadCommand:
|
152 |
-
logger.debug(
|
153 |
-
"could not determine if %s is under hg control "
|
154 |
-
"because hg is not available",
|
155 |
-
location,
|
156 |
-
)
|
157 |
-
return None
|
158 |
-
except InstallationError:
|
159 |
-
return None
|
160 |
-
return os.path.normpath(r.rstrip("\r\n"))
|
161 |
-
|
162 |
-
|
163 |
-
vcs.register(Mercurial)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/BorisovMaksim/denoising/README.md
DELETED
@@ -1,74 +0,0 @@
|
|
1 |
-
---
|
2 |
-
title: Denoising
|
3 |
-
emoji: 🤗
|
4 |
-
colorFrom: red
|
5 |
-
colorTo: orange
|
6 |
-
sdk: gradio
|
7 |
-
sdk_version: 3.28.1
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
-
---
|
11 |
-
This is a repo that implements web interface for DEMUCS model proposed in [Real Time Speech Enhancement in the Waveform Domain](https://arxiv.org/abs/2006.12847).
|
12 |
-
The model was trained from scratch in Pytorch. The proposed model is based on an encoder-decoder architecture with skip-connections. It is optimized on both time and frequency domains, using multiple loss functions.
|
13 |
-
You can record your voice in noisy conditions and get denoised version using DEMUCS model. There is also Spectral Gating denoiser as baseline.
|
14 |
-
|
15 |
-
<center><img src="https://th.bing.com/th/id/OIP.JuP5GDiGXTGkVR-x7Ov0bgHaF8?w=233&h=186&c=7&r=0&o=5&dpr=2&pid=1.7" >
|
16 |
-
</center>
|
17 |
-
|
18 |
-
# Running
|
19 |
-
Without docker:
|
20 |
-
|
21 |
-
<pre><code>pip install -r requirements.txt
|
22 |
-
python app.py</code></pre>
|
23 |
-
|
24 |
-
|
25 |
-
Using docker:
|
26 |
-
<pre><code>docker build . --tag python-docker
|
27 |
-
docker run -p 7860:7860 -e GRADIO_SERVER_NAME=0.0.0.0 -it python-docker:latest</code></pre>
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
# Data
|
32 |
-
In the scope of this project [Valentini](https://datashare.ed.ac.uk/handle/10283/2791) dataset in used. It is clean and noisy parallel speech database. The database was designed to train and test speech enhancement methods that operate at 48kHz. There are 56 speakers and ~10 gb of speech data.
|
33 |
-
|
34 |
-
For model improvement it is possible to use a bigger training set from [DNS](https://www.bing.com/search?q=dns+challenge&cvid=3773a401b19d40269d725a02faf6f79c&aqs=edge.0.69i59j69i57j0l6j69i60.1021j0j4&FORM=ANAB01&PC=U531) challenge.
|
35 |
-
|
36 |
-
# Training
|
37 |
-
The training process in impemented in Pytorch. The data is (noisy speech, clean speech) pairs that are loaded as 2 second samples, randomly cutted from audio and padded if necessary. Model is optimized using SGD. In terms of loss functions, the L1 loss and MultiResolutionSTFTLoss are used. MultiResolutionSTFTLoss is the sum of STFT loss over different window sizes, hop sizes and fft sizes.
|
38 |
-
|
39 |
-
$$L_{STFT}= L_{sc} + L_{mag}$$
|
40 |
-
|
41 |
-
$$L_{sc}= \frac{|| |STFT(\tilde{x})| - |STFT(x)| ||_{F}^{1}}{|STFT(x)|}$$
|
42 |
-
|
43 |
-
$$L_{mag} = \frac{1}{T}|| log|STFT(\tilde{x})| - log|STFT(x)| ||_{F}^{1}$$
|
44 |
-
|
45 |
-
where T is the time points in the waveform.
|
46 |
-
|
47 |
-
# Metrics
|
48 |
-
- Perceptual Evaluation of Speech Quality ([PESQ](https://torchmetrics.readthedocs.io/en/stable/audio/perceptual_evaluation_speech_quality.html))
|
49 |
-
- Short-Time Objective Intelligibility ([STOI](https://torchmetrics.readthedocs.io/en/stable/audio/short_time_objective_intelligibility.html))
|
50 |
-
|
51 |
-
The PESQ metric is used for estimating overall speech quality after denoising and STOI is used for estimating speech intelligibility after denoising.
|
52 |
-
Intelligibility measure is highly correlated with the intelligibility of degraded speech signals
|
53 |
-
|
54 |
-
# Experiments
|
55 |
-
For tracking experiments local server of [Weights & Biases](https://wandb.ai/site) is used. To manage configs for different experiments [hydra](https://hydra.cc/) is used. It allows an easy way to track configs and override paramaters.
|
56 |
-
|
57 |
-
|
58 |
-
| Experiment | Description | Result |
|
59 |
-
|--------------|:-----:|--------------------------------------------------------|
|
60 |
-
| Baseline | Initial experiment with L1 loss | Poor quality |
|
61 |
-
| Baseline_L1_Multi_STFT_loss | Changed loss to Multi STFT + L1 loss | Better performance |
|
62 |
-
|L1_Multi_STFT_no_resample | Tried to train without resampling | No impovement, probably because RELU on the last layer |
|
63 |
-
|Updated_DEMUCS | Used relu in the last layer. Removed it.| Significant improvement |
|
64 |
-
|wav_normalization | Tried to normalized wav by std during training| Small improvement |
|
65 |
-
| original_sr| Train with original sample rate | Significant improvement |
|
66 |
-
|increased_L | Increased number of encoder-decoder pairs from 3 to 5| Performance comparable with original_sr |
|
67 |
-
| double_sr| Train with double sample rate| Small improvement |
|
68 |
-
|replicate paper | Lower learning rate and fix bug in dataloader | Massive improvement! |
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-

|
73 |
-
|
74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/Dual-Key_Backdoor_Attacks/openvqa/utils/proc_dict_vqa.py
DELETED
@@ -1,47 +0,0 @@
|
|
1 |
-
# --------------------------------------------------------
|
2 |
-
# mcan-vqa (Deep Modular Co-Attention Networks)
|
3 |
-
# Licensed under The MIT License [see LICENSE for details]
|
4 |
-
# Written by Yuhao Cui https://github.com/cuiyuhao1996
|
5 |
-
# --------------------------------------------------------
|
6 |
-
|
7 |
-
import sys
|
8 |
-
sys.path.append('../')
|
9 |
-
from openvqa.utils.ans_punct import prep_ans
|
10 |
-
from openvqa.core.path_cfgs import PATH
|
11 |
-
import json
|
12 |
-
|
13 |
-
path = PATH()
|
14 |
-
|
15 |
-
# Loading answer word list
|
16 |
-
stat_ans_list = \
|
17 |
-
json.load(open(path.RAW_PATH['vqa']['train-anno'], 'r'))['annotations'] + \
|
18 |
-
json.load(open(path.RAW_PATH['vqa']['val-anno'], 'r'))['annotations']
|
19 |
-
|
20 |
-
|
21 |
-
def ans_stat(stat_ans_list):
|
22 |
-
ans_to_ix = {}
|
23 |
-
ix_to_ans = {}
|
24 |
-
ans_freq_dict = {}
|
25 |
-
|
26 |
-
for ans in stat_ans_list:
|
27 |
-
ans_proc = prep_ans(ans['multiple_choice_answer'])
|
28 |
-
if ans_proc not in ans_freq_dict:
|
29 |
-
ans_freq_dict[ans_proc] = 1
|
30 |
-
else:
|
31 |
-
ans_freq_dict[ans_proc] += 1
|
32 |
-
|
33 |
-
ans_freq_filter = ans_freq_dict.copy()
|
34 |
-
for ans in ans_freq_dict:
|
35 |
-
if ans_freq_dict[ans] <= 8:
|
36 |
-
ans_freq_filter.pop(ans)
|
37 |
-
|
38 |
-
for ans in ans_freq_filter:
|
39 |
-
ix_to_ans[ans_to_ix.__len__()] = ans
|
40 |
-
ans_to_ix[ans] = ans_to_ix.__len__()
|
41 |
-
|
42 |
-
return ans_to_ix, ix_to_ans
|
43 |
-
|
44 |
-
ans_to_ix, ix_to_ans = ans_stat(stat_ans_list)
|
45 |
-
print(ans_to_ix)
|
46 |
-
# print(ans_to_ix.__len__())
|
47 |
-
json.dump([ans_to_ix, ix_to_ans], open('../openvqa/datasets/vqa/answer_dict.json', 'w'))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/LIVE/thrust/CHANGELOG.md
DELETED
@@ -1,1659 +0,0 @@
|
|
1 |
-
# Thrust 1.9.10-1 (NVIDIA HPC SDK 20.7, CUDA Toolkit 11.1)
|
2 |
-
|
3 |
-
## Summary
|
4 |
-
|
5 |
-
Thrust 1.9.10-1 is the minor release accompanying the NVIDIA HPC SDK 20.7 release
|
6 |
-
and the CUDA Toolkit 11.1 release.
|
7 |
-
|
8 |
-
## Bug Fixes
|
9 |
-
|
10 |
-
- #1214, NVBug 200619442: Stop using `std::allocator` APIs deprecated in C++17.
|
11 |
-
- #1216, NVBug 200540293: Make `thrust::optional` work with Clang when used
|
12 |
-
with older libstdc++.
|
13 |
-
- #1207, NVBug 200618218: Don't force C++14 with older compilers that don't
|
14 |
-
support it.
|
15 |
-
- #1218: Wrap includes of `<memory>` and `<algorithm>` to avoid circular
|
16 |
-
inclusion with NVC++.
|
17 |
-
|
18 |
-
# Thrust 1.9.10 (NVIDIA HPC SDK 20.5)
|
19 |
-
|
20 |
-
## Summary
|
21 |
-
|
22 |
-
Thrust 1.9.10 is the release accompanying the NVIDIA HPC SDK 20.5 release.
|
23 |
-
It adds CMake support for compilation with NVC++ and a number of minor bug fixes
|
24 |
-
for NVC++.
|
25 |
-
It also adds CMake `find_package` support, which replaces the broken 3rd-party
|
26 |
-
legacy `FindThrust.cmake` script.
|
27 |
-
C++03, C++11, GCC < 5, Clang < 6, and MSVC < 2017 are now deprecated.
|
28 |
-
Starting with the upcoming 1.10.0 release, C++03 support will be dropped
|
29 |
-
entirely.
|
30 |
-
|
31 |
-
## Breaking Changes
|
32 |
-
|
33 |
-
- #1082: Thrust now checks that it is compatible with the version of CUB found
|
34 |
-
in your include path, generating an error if it is not.
|
35 |
-
If you are using your own version of CUB, it may be too old.
|
36 |
-
It is recommended to simply delete your own version of CUB and use the
|
37 |
-
version of CUB that comes with Thrust.
|
38 |
-
- #1089: C++03 and C++11 are deprecated.
|
39 |
-
Using these dialects will generate a compile-time warning.
|
40 |
-
These warnings can be suppressed by defining
|
41 |
-
`THRUST_IGNORE_DEPRECATED_CPP_DIALECT` (to suppress C++03 and C++11
|
42 |
-
deprecation warnings) or `THRUST_IGNORE_DEPRECATED_CPP11` (to suppress C++11
|
43 |
-
deprecation warnings).
|
44 |
-
Suppression is only a short term solution.
|
45 |
-
We will be dropping support for C++03 in the 1.10.0 release and C++11 in the
|
46 |
-
near future.
|
47 |
-
- #1089: GCC < 5, Clang < 6, and MSVC < 2017 are deprecated.
|
48 |
-
Using these compilers will generate a compile-time warning.
|
49 |
-
These warnings can be suppressed by defining
|
50 |
-
`THRUST_IGNORE_DEPRECATED_COMPILER`.
|
51 |
-
Suppression is only a short term solution.
|
52 |
-
We will be dropping support for these compilers in the near future.
|
53 |
-
|
54 |
-
## New Features
|
55 |
-
|
56 |
-
- #1130: CMake `find_package` support.
|
57 |
-
This is significant because there is a legacy `FindThrust.cmake` script
|
58 |
-
authored by a third party in widespread use in the community which has a
|
59 |
-
bug in how it parses Thrust version numbers which will cause it to
|
60 |
-
incorrectly parse 1.9.10.
|
61 |
-
This script only handles the first digit of each part of the Thrust version
|
62 |
-
number correctly: for example, Thrust 17.17.17 would be interpreted as
|
63 |
-
Thrust 1.1.1701717.
|
64 |
-
You can find directions for using the new CMake `find_package` support and
|
65 |
-
migrating away from the legacy `FindThrust.cmake` [here](https://github.com/thrust/thrust/blob/master/thrust/cmake/README.md)
|
66 |
-
- #1129: Added `thrust::detail::single_device_tls_caching_allocator`, a
|
67 |
-
convenient way to get an MR caching allocator for device memory, which is
|
68 |
-
used by NVC++.
|
69 |
-
|
70 |
-
## Other Enhancements
|
71 |
-
|
72 |
-
- #1129: Refactored RDC handling in CMake to be a global option and not create
|
73 |
-
two targets for each example and test.
|
74 |
-
|
75 |
-
## Bug Fixes
|
76 |
-
|
77 |
-
- #1129: Fix the legacy `thrust::return_temporary_buffer` API to support
|
78 |
-
passing a size.
|
79 |
-
This was necessary to enable usage of Thrust caching MR allocators with
|
80 |
-
synchronous Thrust algorithms.
|
81 |
-
This change has allowed NVC++’s C++17 Parallel Algorithms implementation to
|
82 |
-
switch to use Thrust caching MR allocators for device temporary storage,
|
83 |
-
which gives a 2x speedup on large multi-GPU systems such as V100 and A100
|
84 |
-
DGX where `cudaMalloc` is very slow.
|
85 |
-
- #1128: Respect `CUDA_API_PER_THREAD_DEFAULT_STREAM`.
|
86 |
-
Thanks to Rong Ou for this contribution.
|
87 |
-
- #1131: Fix the one-policy overload of `thrust::async::copy` to not copy the
|
88 |
-
policy, resolving use-afer-move issues.
|
89 |
-
- #1145: When cleaning up type names in `unittest::base_class_name`, only call
|
90 |
-
`std::string::replace` if we found the substring we are looking to replace.
|
91 |
-
- #1139: Don't use `cxx::__demangle` in NVC++.
|
92 |
-
- #1102: Don't use `thrust::detail::normal_distribution_nvcc` for Feta because
|
93 |
-
it uses `erfcinv`, a non-standard function that Feta doesn't have.
|
94 |
-
|
95 |
-
# Thrust 1.9.9 (CUDA Toolkit 11.0)
|
96 |
-
|
97 |
-
## Summary
|
98 |
-
|
99 |
-
Thrust 1.9.9 adds support for NVC++, which uses Thrust to implement
|
100 |
-
GPU-accelerated C++17 Parallel Algorithms.
|
101 |
-
`thrust::zip_function` and `thrust::shuffle` were also added.
|
102 |
-
C++03, C++11, GCC < 5, Clang < 6, and MSVC < 2017 are now deprecated.
|
103 |
-
Starting with the upcoming 1.10.0 release, C++03 support will be dropped
|
104 |
-
entirely.
|
105 |
-
All other deprecated platforms will be dropped in the near future.
|
106 |
-
|
107 |
-
## Breaking Changes
|
108 |
-
|
109 |
-
- #1082: Thrust now checks that it is compatible with the version of CUB found
|
110 |
-
in your include path, generating an error if it is not.
|
111 |
-
If you are using your own version of CUB, it may be too old.
|
112 |
-
It is recommended to simply delete your own version of CUB and use the
|
113 |
-
version of CUB that comes with Thrust.
|
114 |
-
- #1089: C++03 and C++11 are deprecated.
|
115 |
-
Using these dialects will generate a compile-time warning.
|
116 |
-
These warnings can be suppressed by defining
|
117 |
-
`THRUST_IGNORE_DEPRECATED_CPP_DIALECT` (to suppress C++03 and C++11
|
118 |
-
deprecation warnings) or `THRUST_IGNORE_DEPRECATED_CPP_11` (to suppress C++11
|
119 |
-
deprecation warnings).
|
120 |
-
Suppression is only a short term solution.
|
121 |
-
We will be dropping support for C++03 in the 1.10.0 release and C++11 in the
|
122 |
-
near future.
|
123 |
-
- #1089: GCC < 5, Clang < 6, and MSVC < 2017 are deprecated.
|
124 |
-
Using these compilers will generate a compile-time warning.
|
125 |
-
These warnings can be suppressed by defining
|
126 |
-
`THRUST_IGNORE_DEPRECATED_COMPILER`.
|
127 |
-
Suppression is only a short term solution.
|
128 |
-
We will be dropping support for these compilers in the near future.
|
129 |
-
|
130 |
-
## New Features
|
131 |
-
|
132 |
-
- #1086: Support for NVC++ aka "Feta".
|
133 |
-
The most significant change is in how we use `__CUDA_ARCH__`.
|
134 |
-
Now, there are four macros that must be used:
|
135 |
-
- `THRUST_IS_DEVICE_CODE`, which should be used in an `if` statement around
|
136 |
-
device-only code.
|
137 |
-
- `THRUST_INCLUDE_DEVICE_CODE`, which should be used in an `#if` preprocessor
|
138 |
-
directive inside of the `if` statement mentioned in the prior bullet.
|
139 |
-
- `THRUST_IS_HOST_CODE`, which should be used in an `if` statement around
|
140 |
-
host-only code.
|
141 |
-
- `THRUST_INCLUDE_HOST_CODE`, which should be used in an `#if` preprocessor
|
142 |
-
directive inside of the `if` statement mentioned in the prior bullet.
|
143 |
-
- #1085: `thrust::shuffle`.
|
144 |
-
Thanks to Rory Mitchell for this contribution.
|
145 |
-
- #1029: `thrust::zip_function`, a facility for zipping functions that take N
|
146 |
-
parameters instead of a tuple of N parameters as `thrust::zip_iterator`
|
147 |
-
does.
|
148 |
-
Thanks to Ben Jude for this contribution.
|
149 |
-
- #1068: `thrust::system::cuda::managed_memory_pointer`, a universal memory
|
150 |
-
strongly typed pointer compatible with the ISO C++ Standard Library.
|
151 |
-
|
152 |
-
## Other Enhancements
|
153 |
-
|
154 |
-
- #1029: Thrust is now built and tested with NVCC warnings treated as errors.
|
155 |
-
- #1029: MSVC C++11 support.
|
156 |
-
- #1029: `THRUST_DEPRECATED` abstraction for generating compile-time
|
157 |
-
deprecation warning messages.
|
158 |
-
- #1029: `thrust::pointer<T>::pointer_to(reference)`.
|
159 |
-
- #1070: Unit test for `thrust::inclusive_scan` with a user defined types.
|
160 |
-
Thanks to Conor Hoekstra for this contribution.
|
161 |
-
|
162 |
-
## Bug Fixes
|
163 |
-
|
164 |
-
- #1088: Allow `thrust::replace` to take functions that have non-`const`
|
165 |
-
`operator()`.
|
166 |
-
- #1094: Add missing `constexpr` to `par_t` constructors.
|
167 |
-
Thanks to Patrick Stotko for this contribution.
|
168 |
-
- #1077: Remove `__device__` from CUDA MR-based device allocators to fix
|
169 |
-
obscure "host function called from host device function" warning that occurs
|
170 |
-
when you use the new Thrust MR-based allocators.
|
171 |
-
- #1029: Remove inconsistently-used `THRUST_BEGIN`/`END_NS` macros.
|
172 |
-
- #1029: Fix C++ dialect detection on newer MSVC.
|
173 |
-
- #1029 Use `_Pragma`/`__pragma` instead of `#pragma` in macros.
|
174 |
-
- #1029: Replace raw `__cplusplus` checks with the appropriate Thrust macros.
|
175 |
-
- #1105: Add a missing `<math.h>` include.
|
176 |
-
- #1103: Fix regression of `thrust::detail::temporary_allocator` with non-CUDA
|
177 |
-
back ends.
|
178 |
-
- #1111: Use Thrust's random number engine instead of `std::`s in device code.
|
179 |
-
- #1108: Get rid of a GCC 9 warning about deprecated generation of copy ctors.
|
180 |
-
|
181 |
-
# Thrust 1.9.8-1 (NVIDIA HPC SDK 20.3)
|
182 |
-
|
183 |
-
## Summary
|
184 |
-
|
185 |
-
Thrust 1.9.8-1 is a variant of 1.9.8 accompanying the NVIDIA HPC SDK 20.3
|
186 |
-
release.
|
187 |
-
It contains modifications necessary to serve as the implementation of NVC++'s
|
188 |
-
GPU-accelerated C++17 Parallel Algorithms when using the CUDA Toolkit 11.0
|
189 |
-
release.
|
190 |
-
|
191 |
-
# Thrust 1.9.8 (CUDA Toolkit 11.0 Early Access)
|
192 |
-
|
193 |
-
## Summary
|
194 |
-
|
195 |
-
Thrust 1.9.8, which is included in the CUDA Toolkit 11.0 release, removes
|
196 |
-
Thrust's internal derivative of CUB, upstreams all relevant changes too CUB,
|
197 |
-
and adds CUB as a Git submodule.
|
198 |
-
It will now be necessary to do `git clone --recursive` when checking out
|
199 |
-
Thrust, and to update the CUB submodule when pulling in new Thrust changes.
|
200 |
-
Additionally, CUB is now included as a first class citizen in the CUDA toolkit.
|
201 |
-
Thrust 1.9.8 also fixes bugs preventing most Thrust algorithms from working
|
202 |
-
with more than `2^31-1` elements.
|
203 |
-
Now, `thrust::reduce`, `thrust::*_scan`, and related algorithms (aka most of
|
204 |
-
Thrust) work with large element counts.
|
205 |
-
|
206 |
-
## Breaking Changes
|
207 |
-
|
208 |
-
- Thrust will now use the version of CUB in your include path instead of its own
|
209 |
-
internal copy.
|
210 |
-
If you are using your own version of CUB, it may be older and incompatible
|
211 |
-
with Thrust.
|
212 |
-
It is recommended to simply delete your own version of CUB and use the
|
213 |
-
version of CUB that comes with Thrust.
|
214 |
-
|
215 |
-
## Other Enhancements
|
216 |
-
|
217 |
-
- Refactor Thrust and CUB to support 64-bit indices in most algorithms.
|
218 |
-
In most cases, Thrust now selects between kernels that use 32-bit indices and
|
219 |
-
64-bit indices at runtime depending on the size of the input.
|
220 |
-
This means large element counts work, but small element counts do not have to
|
221 |
-
pay for the register usage of 64-bit indices if they are not needed.
|
222 |
-
Now, `thrust::reduce`, `thrust::*_scan`, and related algorithms (aka most of
|
223 |
-
Thrust) work with more than `2^31-1` elements.
|
224 |
-
Notably, `thrust::sort` is still limited to less than `2^31-1` elements.
|
225 |
-
- CUB is now a submodule and the internal copy of CUB has been removed.
|
226 |
-
- #1051: Stop specifying the `__launch_bounds__` minimum blocks parameter
|
227 |
-
because it messes up register allocation and increases register pressure,
|
228 |
-
and we don't actually know at compile time how many blocks we will use
|
229 |
-
(aside from single tile kernels).
|
230 |
-
|
231 |
-
## Bug Fixes
|
232 |
-
|
233 |
-
- #1020: After making a CUDA API call, always clear the global CUDA error state
|
234 |
-
by calling `cudaGetLastError`.
|
235 |
-
- #1021: Avoid calling destroy in the destructor of a Thrust vector if the
|
236 |
-
vector is empty.
|
237 |
-
- #1046: Actually throw `thrust::bad_alloc` when `thrust::system::cuda::malloc`
|
238 |
-
fails instead of just constructing a temporary and doing nothing with it.
|
239 |
-
- Add missing copy constructor or copy assignment operator to all classes that
|
240 |
-
GCC 9's `-Wdeprecated-copy` complains about
|
241 |
-
- Add missing move operations to `thrust::system::cuda::vector`.
|
242 |
-
- #1015: Check that the backend is CUDA before using CUDA-specifics in
|
243 |
-
`thrust::detail::temporary_allocator`.
|
244 |
-
Thanks to Hugh Winkler for this contribution.
|
245 |
-
- #1055: More correctly detect the presence of aligned/sized `new`/`delete`.
|
246 |
-
- #1043: Fix ill-formed specialization of `thrust::system::is_error_code_enum`
|
247 |
-
for `thrust::event_errc`.
|
248 |
-
Thanks to Toru Niina for this contribution.
|
249 |
-
- #1027: Add tests for `thrust::tuple_for_each` and `thrust::tuple_subset`.
|
250 |
-
Thanks to Ben Jude for this contribution.
|
251 |
-
- #1027: Use correct macro in `thrust::tuple_for_each`.
|
252 |
-
Thanks to Ben Jude for this contribution.
|
253 |
-
- #1026: Use correct MSVC version formatting in CMake.
|
254 |
-
Thanks to Ben Jude for this contribution.
|
255 |
-
- Workaround an NVCC issue with type aliases with template template arguments
|
256 |
-
containing a parameter pack.
|
257 |
-
- Remove unused functions from the CUDA backend which call slow CUDA attribute
|
258 |
-
query APIs.
|
259 |
-
- Replace `CUB_RUNTIME_FUNCTION` with `THRUST_RUNTIME_FUNCTION`.
|
260 |
-
- Correct typo in `thrust::transform` documentation.
|
261 |
-
Thanks to Eden Yefet for this contribution.
|
262 |
-
|
263 |
-
## Known Issues
|
264 |
-
|
265 |
-
- `thrust::sort` remains limited to `2^31-1` elements for now.
|
266 |
-
|
267 |
-
# Thrust 1.9.7-1 (CUDA Toolkit 10.2 for Tegra)
|
268 |
-
|
269 |
-
## Summary
|
270 |
-
|
271 |
-
Thrust 1.9.7-1 is a minor release accompanying the CUDA Toolkit 10.2 release
|
272 |
-
for Tegra.
|
273 |
-
It is nearly identical to 1.9.7.
|
274 |
-
|
275 |
-
## Bug Fixes
|
276 |
-
|
277 |
-
- Remove support for GCC's broken nodiscard-like attribute.
|
278 |
-
|
279 |
-
# Thrust 1.9.7 (CUDA Toolkit 10.2)
|
280 |
-
|
281 |
-
## Summary
|
282 |
-
|
283 |
-
Thrust 1.9.7 is a minor release accompanying the CUDA Toolkit 10.2 release.
|
284 |
-
Unfortunately, although the version and patch numbers are identical, one bug
|
285 |
-
fix present in Thrust 1.9.7 (NVBug 2646034: Fix incorrect dependency handling
|
286 |
-
for stream acquisition in `thrust::future`) was not included in the CUDA
|
287 |
-
Toolkit 10.2 preview release for AArch64 SBSA.
|
288 |
-
The tag `cuda-10.2aarch64sbsa` contains the exact version of Thrust present
|
289 |
-
in the CUDA Toolkit 10.2 preview release for AArch64 SBSA.
|
290 |
-
|
291 |
-
## Bug Fixes
|
292 |
-
|
293 |
-
- #967, NVBug 2448170: Fix the CUDA backend `thrust::for_each` so that it
|
294 |
-
supports large input sizes with 64-bit indices.
|
295 |
-
- NVBug 2646034: Fix incorrect dependency handling for stream acquisition in
|
296 |
-
`thrust::future`.
|
297 |
-
- Not present in the CUDA Toolkit 10.2 preview release for AArch64 SBSA.
|
298 |
-
- #968, NVBug 2612102: Fix the `thrust::mr::polymorphic_adaptor` to actually
|
299 |
-
use its template parameter.
|
300 |
-
|
301 |
-
# Thrust 1.9.6-1 (NVIDIA HPC SDK 20.3)
|
302 |
-
|
303 |
-
## Summary
|
304 |
-
|
305 |
-
Thrust 1.9.6-1 is a variant of 1.9.6 accompanying the NVIDIA HPC SDK 20.3
|
306 |
-
release.
|
307 |
-
It contains modifications necessary to serve as the implementation of NVC++'s
|
308 |
-
GPU-accelerated C++17 Parallel Algorithms when using the CUDA Toolkit 10.1
|
309 |
-
Update 2 release.
|
310 |
-
|
311 |
-
# Thrust 1.9.6 (CUDA Toolkit 10.1 Update 2)
|
312 |
-
|
313 |
-
## Summary
|
314 |
-
|
315 |
-
Thrust 1.9.6 is a minor release accompanying the CUDA Toolkit 10.1 Update 2
|
316 |
-
release.
|
317 |
-
|
318 |
-
## Bug Fixes
|
319 |
-
|
320 |
-
- NVBug 2509847: Inconsistent alignment of `thrust::complex`
|
321 |
-
- NVBug 2586774: Compilation failure with Clang + older libstdc++ that doesn't
|
322 |
-
have `std::is_trivially_copyable`
|
323 |
-
- NVBug 200488234: CUDA header files contain Unicode characters which leads
|
324 |
-
compiling errors on Windows
|
325 |
-
- #949, #973, NVBug 2422333, NVBug 2522259, NVBug 2528822:
|
326 |
-
`thrust::detail::aligned_reinterpret_cast` must be annotated with
|
327 |
-
`__host__ __device__`.
|
328 |
-
- NVBug 2599629: Missing include in the OpenMP sort implementation
|
329 |
-
- NVBug 200513211: Truncation warning in test code under VC142
|
330 |
-
|
331 |
-
# Thrust 1.9.5 (CUDA Toolkit 10.1 Update 1)
|
332 |
-
|
333 |
-
## Summary
|
334 |
-
|
335 |
-
Thrust 1.9.5 is a minor release accompanying the CUDA Toolkit 10.1 Update 1
|
336 |
-
release.
|
337 |
-
|
338 |
-
## Bug Fixes
|
339 |
-
|
340 |
-
- NVBug 2502854: Fixed assignment of
|
341 |
-
`thrust::device_vector<thrust::complex<T>>` between host and device.
|
342 |
-
|
343 |
-
# Thrust 1.9.4 (CUDA Toolkit 10.1)
|
344 |
-
|
345 |
-
## Summary
|
346 |
-
|
347 |
-
Thrust 1.9.4 adds asynchronous interfaces for parallel algorithms, a new
|
348 |
-
allocator system including caching allocators and unified memory support, as
|
349 |
-
well as a variety of other enhancements, mostly related to
|
350 |
-
C++11/C++14/C++17/C++20 support.
|
351 |
-
The new asynchronous algorithms in the `thrust::async` namespace return
|
352 |
-
`thrust::event` or `thrust::future` objects, which can be waited upon to
|
353 |
-
synchronize with the completion of the parallel operation.
|
354 |
-
|
355 |
-
## Breaking Changes
|
356 |
-
|
357 |
-
Synchronous Thrust algorithms now block until all of their operations have
|
358 |
-
completed.
|
359 |
-
Use the new asynchronous Thrust algorithms for non-blocking behavior.
|
360 |
-
|
361 |
-
## New Features
|
362 |
-
|
363 |
-
- `thrust::event` and `thrust::future<T>`, uniquely-owned asynchronous handles
|
364 |
-
consisting of a state (ready or not ready), content (some value; for
|
365 |
-
`thrust::future` only), and an optional set of objects that should be
|
366 |
-
destroyed only when the future's value is ready and has been consumed.
|
367 |
-
- The design is loosely based on C++11's `std::future`.
|
368 |
-
- They can be `.wait`'d on, and the value of a future can be waited on and
|
369 |
-
retrieved with `.get` or `.extract`.
|
370 |
-
- Multiple `thrust::event`s and `thrust::future`s can be combined with
|
371 |
-
`thrust::when_all`.
|
372 |
-
- `thrust::future`s can be converted to `thrust::event`s.
|
373 |
-
- Currently, these primitives are only implemented for the CUDA backend and
|
374 |
-
are C++11 only.
|
375 |
-
- New asynchronous algorithms that return `thrust::event`/`thrust::future`s,
|
376 |
-
implemented as C++20 range style customization points:
|
377 |
-
- `thrust::async::reduce`.
|
378 |
-
- `thrust::async::reduce_into`, which takes a target location to store the
|
379 |
-
reduction result into.
|
380 |
-
- `thrust::async::copy`, including a two-policy overload that allows
|
381 |
-
explicit cross system copies which execution policy properties can be
|
382 |
-
attached to.
|
383 |
-
- `thrust::async::transform`.
|
384 |
-
- `thrust::async::for_each`.
|
385 |
-
- `thrust::async::stable_sort`.
|
386 |
-
- `thrust::async::sort`.
|
387 |
-
- By default the asynchronous algorithms use the new caching allocators.
|
388 |
-
Deallocation of temporary storage is deferred until the destruction of
|
389 |
-
the returned `thrust::future`. The content of `thrust::future`s is
|
390 |
-
stored in either device or universal memory and transferred to the host
|
391 |
-
only upon request to prevent unnecessary data migration.
|
392 |
-
- Asynchronous algorithms are currently only implemented for the CUDA
|
393 |
-
system and are C++11 only.
|
394 |
-
- `exec.after(f, g, ...)`, a new execution policy method that takes a set of
|
395 |
-
`thrust::event`/`thrust::future`s and returns an execution policy that
|
396 |
-
operations on that execution policy should depend upon.
|
397 |
-
- New logic and mindset for the type requirements for cross-system sequence
|
398 |
-
copies (currently only used by `thrust::async::copy`), based on:
|
399 |
-
- `thrust::is_contiguous_iterator` and `THRUST_PROCLAIM_CONTIGUOUS_ITERATOR`
|
400 |
-
for detecting/indicating that an iterator points to contiguous storage.
|
401 |
-
- `thrust::is_trivially_relocatable` and
|
402 |
-
`THRUST_PROCLAIM_TRIVIALLY_RELOCATABLE` for detecting/indicating that a
|
403 |
-
type is `memcpy`able (based on principles from
|
404 |
-
[P1144](https://wg21.link/P1144)).
|
405 |
-
- The new approach reduces buffering, increases performance, and increases
|
406 |
-
correctness.
|
407 |
-
- The fast path is now enabled when copying CUDA `__half` and vector types with
|
408 |
-
`thrust::async::copy`.
|
409 |
-
- All Thrust synchronous algorithms for the CUDA backend now actually
|
410 |
-
synchronize. Previously, any algorithm that did not allocate temporary
|
411 |
-
storage (counterexample: `thrust::sort`) and did not have a
|
412 |
-
computation-dependent result (counterexample: `thrust::reduce`) would
|
413 |
-
actually be launched asynchronously. Additionally, synchronous algorithms
|
414 |
-
that allocated temporary storage would become asynchronous if a custom
|
415 |
-
allocator was supplied that did not synchronize on allocation/deallocation,
|
416 |
-
unlike `cudaMalloc`/`cudaFree`. So, now `thrust::for_each`,
|
417 |
-
`thrust::transform`, `thrust::sort`, etc are truly synchronous. In some
|
418 |
-
cases this may be a performance regression; if you need asynchrony, use the
|
419 |
-
new asynchronous algorithms.
|
420 |
-
- Thrust's allocator framework has been rewritten. It now uses a memory
|
421 |
-
resource system, similar to C++17's `std::pmr` but supporting static
|
422 |
-
polymorphism. Memory resources are objects that allocate untyped storage and
|
423 |
-
allocators are cheap handles to memory resources in this new model. The new
|
424 |
-
facilities live in `<thrust/mr/*>`.
|
425 |
-
- `thrust::mr::memory_resource<Pointer>`, the memory resource base class,
|
426 |
-
which takes a (possibly tagged) pointer to `void` type as a parameter.
|
427 |
-
- `thrust::mr::allocator<T, MemoryResource>`, an allocator backed by a memory
|
428 |
-
resource object.
|
429 |
-
- `thrust::mr::polymorphic_adaptor_resource<Pointer>`, a type-erased memory
|
430 |
-
resource adaptor.
|
431 |
-
- `thrust::mr::polymorphic_allocator<T>`, a C++17-style polymorphic allocator
|
432 |
-
backed by a type-erased memory resource object.
|
433 |
-
- New tunable C++17-style caching memory resources,
|
434 |
-
`thrust::mr::(disjoint_)?(un)?synchronized_pool_resource`, designed to
|
435 |
-
cache both small object allocations and large repetitive temporary
|
436 |
-
allocations. The disjoint variants use separate storage for management of
|
437 |
-
the pool, which is necessary if the memory being allocated cannot be
|
438 |
-
accessed on the host (e.g. device memory).
|
439 |
-
- System-specific allocators were rewritten to use the new memory resource
|
440 |
-
framework.
|
441 |
-
- New `thrust::device_memory_resource` for allocating device memory.
|
442 |
-
- New `thrust::universal_memory_resource` for allocating memory that can be
|
443 |
-
accessed from both the host and device (e.g. `cudaMallocManaged`).
|
444 |
-
- New `thrust::universal_host_pinned_memory_resource` for allocating memory
|
445 |
-
that can be accessed from the host and the device but always resides in
|
446 |
-
host memory (e.g. `cudaMallocHost`).
|
447 |
-
- `thrust::get_per_device_resource` and `thrust::per_device_allocator`, which
|
448 |
-
lazily create and retrieve a per-device singleton memory resource.
|
449 |
-
- Rebinding mechanisms (`rebind_traits` and `rebind_alloc`) for
|
450 |
-
`thrust::allocator_traits`.
|
451 |
-
- `thrust::device_make_unique`, a factory function for creating a
|
452 |
-
`std::unique_ptr` to a newly allocated object in device memory.
|
453 |
-
- `<thrust/detail/memory_algorithms>`, a C++11 implementation of the C++17
|
454 |
-
uninitialized memory algorithms.
|
455 |
-
- `thrust::allocate_unique` and friends, based on the proposed C++23
|
456 |
-
[`std::allocate_unique`](https://wg21.link/P0211).
|
457 |
-
- New type traits and metaprogramming facilities. Type traits are slowly being
|
458 |
-
migrated out of `thrust::detail::` and `<thrust/detail/*>`; their new home
|
459 |
-
will be `thrust::` and `<thrust/type_traits/*>`.
|
460 |
-
- `thrust::is_execution_policy`.
|
461 |
-
- `thrust::is_operator_less_or_greater_function_object`, which detects
|
462 |
-
`thrust::less`, `thrust::greater`, `std::less`, and `std::greater`.
|
463 |
-
- `thrust::is_operator_plus_function_object``, which detects `thrust::plus`
|
464 |
-
and `std::plus`.
|
465 |
-
- `thrust::remove_cvref(_t)?`, a C++11 implementation of C++20's
|
466 |
-
`thrust::remove_cvref(_t)?`.
|
467 |
-
- `thrust::void_t`, and various other new type traits.
|
468 |
-
- `thrust::integer_sequence` and friends, a C++11 implementation of C++20's
|
469 |
-
`std::integer_sequence`
|
470 |
-
- `thrust::conjunction`, `thrust::disjunction`, and `thrust::disjunction`, a
|
471 |
-
C++11 implementation of C++17's logical metafunctions.
|
472 |
-
- Some Thrust type traits (such as `thrust::is_constructible`) have been
|
473 |
-
redefined in terms of C++11's type traits when they are available.
|
474 |
-
- `<thrust/detail/tuple_algorithms.h>`, new `std::tuple` algorithms:
|
475 |
-
- `thrust::tuple_transform`.
|
476 |
-
- `thrust::tuple_for_each`.
|
477 |
-
- `thrust::tuple_subset`.
|
478 |
-
- Miscellaneous new `std::`-like facilities:
|
479 |
-
- `thrust::optional`, a C++11 implementation of C++17's `std::optional`.
|
480 |
-
- `thrust::addressof`, an implementation of C++11's `std::addressof`.
|
481 |
-
- `thrust::next` and `thrust::prev`, an implementation of C++11's `std::next`
|
482 |
-
and `std::prev`.
|
483 |
-
- `thrust::square`, a `<functional>` style unary function object that
|
484 |
-
multiplies its argument by itself.
|
485 |
-
- `<thrust/limits.h>` and `thrust::numeric_limits`, a customized version of
|
486 |
-
`<limits>` and `std::numeric_limits`.
|
487 |
-
- `<thrust/detail/preprocessor.h>`, new general purpose preprocessor facilities:
|
488 |
-
- `THRUST_PP_CAT[2-5]`, concatenates two to five tokens.
|
489 |
-
- `THRUST_PP_EXPAND(_ARGS)?`, performs double expansion.
|
490 |
-
- `THRUST_PP_ARITY` and `THRUST_PP_DISPATCH`, tools for macro overloading.
|
491 |
-
- `THRUST_PP_BOOL`, boolean conversion.
|
492 |
-
- `THRUST_PP_INC` and `THRUST_PP_DEC`, increment/decrement.
|
493 |
-
- `THRUST_PP_HEAD`, a variadic macro that expands to the first argument.
|
494 |
-
- `THRUST_PP_TAIL`, a variadic macro that expands to all its arguments after
|
495 |
-
the first.
|
496 |
-
- `THRUST_PP_IIF`, bitwise conditional.
|
497 |
-
- `THRUST_PP_COMMA_IF`, and `THRUST_PP_HAS_COMMA`, facilities for adding and
|
498 |
-
detecting comma tokens.
|
499 |
-
- `THRUST_PP_IS_VARIADIC_NULLARY`, returns true if called with a nullary
|
500 |
-
`__VA_ARGS__`.
|
501 |
-
- `THRUST_CURRENT_FUNCTION`, expands to the name of the current function.
|
502 |
-
- New C++11 compatibility macros:
|
503 |
-
- `THRUST_NODISCARD`, expands to `[[nodiscard]]` when available and the best
|
504 |
-
equivalent otherwise.
|
505 |
-
- `THRUST_CONSTEXPR`, expands to `constexpr` when available and the best
|
506 |
-
equivalent otherwise.
|
507 |
-
- `THRUST_OVERRIDE`, expands to `override` when available and the best
|
508 |
-
equivalent otherwise.
|
509 |
-
- `THRUST_DEFAULT`, expands to `= default;` when available and the best
|
510 |
-
equivalent otherwise.
|
511 |
-
- `THRUST_NOEXCEPT`, expands to `noexcept` when available and the best
|
512 |
-
equivalent otherwise.
|
513 |
-
- `THRUST_FINAL`, expands to `final` when available and the best equivalent
|
514 |
-
otherwise.
|
515 |
-
- `THRUST_INLINE_CONSTANT`, expands to `inline constexpr` when available and
|
516 |
-
the best equivalent otherwise.
|
517 |
-
- `<thrust/detail/type_deduction.h>`, new C++11-only type deduction helpers:
|
518 |
-
- `THRUST_DECLTYPE_RETURNS*`, expand to function definitions with suitable
|
519 |
-
conditional `noexcept` qualifiers and trailing return types.
|
520 |
-
- `THRUST_FWD(x)`, expands to `::std::forward<decltype(x)>(x)`.
|
521 |
-
- `THRUST_MVCAP`, expands to a lambda move capture.
|
522 |
-
- `THRUST_RETOF`, expands to a decltype computing the return type of an
|
523 |
-
invocable.
|
524 |
-
- New CMake build system.
|
525 |
-
|
526 |
-
## New Examples
|
527 |
-
|
528 |
-
- `mr_basic` demonstrates how to use the new memory resource allocator system.
|
529 |
-
|
530 |
-
## Other Enhancements
|
531 |
-
|
532 |
-
- Tagged pointer enhancements:
|
533 |
-
- New `thrust::pointer_traits` specialization for `void const*`.
|
534 |
-
- `nullptr` support to Thrust tagged pointers.
|
535 |
-
- New `explicit operator bool` for Thrust tagged pointers when using C++11
|
536 |
-
for `std::unique_ptr` interoperability.
|
537 |
-
- Added `thrust::reinterpret_pointer_cast` and `thrust::static_pointer_cast`
|
538 |
-
for casting Thrust tagged pointers.
|
539 |
-
- Iterator enhancements:
|
540 |
-
- `thrust::iterator_system` is now SFINAE friendly.
|
541 |
-
- Removed cv qualifiers from iterator types when using
|
542 |
-
`thrust::iterator_system`.
|
543 |
-
- Static assert enhancements:
|
544 |
-
- New `THRUST_STATIC_ASSERT_MSG`, takes an optional string constant to be
|
545 |
-
used as the error message when possible.
|
546 |
-
- Update `THRUST_STATIC_ASSERT(_MSG)` to use C++11's `static_assert` when
|
547 |
-
it's available.
|
548 |
-
- Introduce a way to test for static assertions.
|
549 |
-
- Testing enhancements:
|
550 |
-
- Additional scalar and sequence types, including non-builtin types and
|
551 |
-
vectors with unified memory allocators, have been added to the list of
|
552 |
-
types used by generic unit tests.
|
553 |
-
- The generation of random input data has been improved to increase the range
|
554 |
-
of values used and catch more corner cases.
|
555 |
-
- New `unittest::truncate_to_max_representable` utility for avoiding the
|
556 |
-
generation of ranges that cannot be represented by the underlying element
|
557 |
-
type in generic unit test code.
|
558 |
-
- The test driver now synchronizes with CUDA devices and check for errors
|
559 |
-
after each test, when switching devices, and after each raw kernel launch.
|
560 |
-
- The `warningtester` uber header is now compiled with NVCC to avoid needing
|
561 |
-
to disable CUDA-specific code with the preprocessor.
|
562 |
-
- Fixed the unit test framework's `ASSERT_*` to print `char`s as `int`s.
|
563 |
-
- New `DECLARE_INTEGRAL_VARIABLE_UNITTEST` test declaration macro.
|
564 |
-
- New `DECLARE_VARIABLE_UNITTEST_WITH_TYPES_AND_NAME` test declaration macro.
|
565 |
-
- `thrust::system_error` in the CUDA backend now print out its `cudaError_t`
|
566 |
-
enumerator in addition to the diagnostic message.
|
567 |
-
- Stopped using conditionally signed types like `char`.
|
568 |
-
|
569 |
-
## Bug Fixes
|
570 |
-
|
571 |
-
- #897, NVBug 2062242: Fix compilation error when using `__device__` lambdas
|
572 |
-
with `thrust::reduce` on MSVC.
|
573 |
-
- #908, NVBug 2089386: Static assert that `thrust::generate`/`thrust::fill`
|
574 |
-
isn't operating on const iterators.
|
575 |
-
- #919 Fix compilation failure with `thrust::zip_iterator` and
|
576 |
-
`thrust::complex`.
|
577 |
-
- #924, NVBug 2096679, NVBug 2315990: Fix dispatch for the CUDA backend's
|
578 |
-
`thrust::reduce` to use two functions (one with the pragma for disabling
|
579 |
-
exec checks, one with `THRUST_RUNTIME_FUNCTION`) instead of one. This fixes
|
580 |
-
a regression with device compilation that started in CUDA Toolkit 9.2.
|
581 |
-
- #928, NVBug 2341455: Add missing `__host__ __device__` annotations to a
|
582 |
-
`thrust::complex::operator=` to satisfy GoUDA.
|
583 |
-
- NVBug 2094642: Make `thrust::vector_base::clear` not depend on the element
|
584 |
-
type being default constructible.
|
585 |
-
- NVBug 2289115: Remove flaky `simple_cuda_streams` example.
|
586 |
-
- NVBug 2328572: Add missing `thrust::device_vector` constructor that takes an
|
587 |
-
allocator parameter.
|
588 |
-
- NVBug 2455740: Update the `range_view` example to not use device-side launch.
|
589 |
-
- NVBug 2455943: Ensure that sized unit tests that use
|
590 |
-
`thrust::counting_iterator` perform proper truncation.
|
591 |
-
- NVBug 2455952: Refactor questionable `thrust::copy_if` unit tests.
|
592 |
-
|
593 |
-
# Thrust 1.9.3 (CUDA Toolkit 10.0)
|
594 |
-
|
595 |
-
## Summary
|
596 |
-
|
597 |
-
Thrust 1.9.3 unifies and integrates CUDA Thrust and GitHub Thrust.
|
598 |
-
|
599 |
-
## Bug Fixes
|
600 |
-
|
601 |
-
- #725, #850, #855, #859, #860: Unify the `thrust::iter_swap` interface and fix
|
602 |
-
`thrust::device_reference` swapping.
|
603 |
-
- NVBug 2004663: Add a `data` method to `thrust::detail::temporary_array` and
|
604 |
-
refactor temporary memory allocation in the CUDA backend to be exception
|
605 |
-
and leak safe.
|
606 |
-
- #886, #894, #914: Various documentation typo fixes.
|
607 |
-
- #724: Provide `NVVMIR_LIBRARY_DIR` environment variable to NVCC.
|
608 |
-
- #878: Optimize `thrust::min/max_element` to only use
|
609 |
-
`thrust::detail::get_iterator_value` for non-numeric types.
|
610 |
-
- #899: Make `thrust::cuda::experimental::pinned_allocator`'s comparison
|
611 |
-
operators `const`.
|
612 |
-
- NVBug 2092152: Remove all includes of `<cuda.h>`.
|
613 |
-
- #911: Fix default comparator element type for `thrust::merge_by_key`.
|
614 |
-
|
615 |
-
## Acknowledgments
|
616 |
-
|
617 |
-
- Thanks to Andrew Corrigan for contributing fixes for swapping interfaces.
|
618 |
-
- Thanks to Francisco Facioni for contributing optimizations for
|
619 |
-
`thrust::min/max_element`.
|
620 |
-
|
621 |
-
# Thrust 1.9.2 (CUDA Toolkit 9.2)
|
622 |
-
|
623 |
-
## Summary
|
624 |
-
|
625 |
-
Thrust 1.9.2 brings a variety of performance enhancements, bug fixes and test
|
626 |
-
improvements.
|
627 |
-
CUB 1.7.5 was integrated, enhancing the performance of `thrust::sort` on
|
628 |
-
small data types and `thrust::reduce`.
|
629 |
-
Changes were applied to `complex` to optimize memory access.
|
630 |
-
Thrust now compiles with compiler warnings enabled and treated as errors.
|
631 |
-
Additionally, the unit test suite and framework was enhanced to increase
|
632 |
-
coverage.
|
633 |
-
|
634 |
-
## Breaking Changes
|
635 |
-
|
636 |
-
- The `fallback_allocator` example was removed, as it was buggy and difficult
|
637 |
-
to support.
|
638 |
-
|
639 |
-
## New Features
|
640 |
-
|
641 |
-
- `<thrust/detail/alignment.h>`, utilities for memory alignment:
|
642 |
-
- `thrust::aligned_reinterpret_cast`.
|
643 |
-
- `thrust::aligned_storage_size`, which computes the amount of storage needed
|
644 |
-
for an object of a particular size and alignment.
|
645 |
-
- `thrust::alignment_of`, a C++03 implementation of C++11's
|
646 |
-
`std::alignment_of`.
|
647 |
-
- `thrust::aligned_storage`, a C++03 implementation of C++11's
|
648 |
-
`std::aligned_storage`.
|
649 |
-
- `thrust::max_align_t`, a C++03 implementation of C++11's
|
650 |
-
`std::max_align_t`.
|
651 |
-
|
652 |
-
## Bug Fixes
|
653 |
-
|
654 |
-
- NVBug 200385527, NVBug 200385119, NVBug 200385113, NVBug 200349350, NVBug
|
655 |
-
2058778: Various compiler warning issues.
|
656 |
-
- NVBug 200355591: `thrust::reduce` performance issues.
|
657 |
-
- NVBug 2053727: Fixed an ADL bug that caused user-supplied `allocate` to be
|
658 |
-
overlooked but `deallocate` to be called with GCC <= 4.3.
|
659 |
-
- NVBug 1777043: Fixed `thrust::complex` to work with `thrust::sequence`.
|
660 |
-
|
661 |
-
# Thrust 1.9.1-2 (CUDA Toolkit 9.1)
|
662 |
-
|
663 |
-
## Summary
|
664 |
-
|
665 |
-
Thrust 1.9.1-2 integrates version 1.7.4 of CUB and introduces a new CUDA backend
|
666 |
-
for `thrust::reduce` based on CUB.
|
667 |
-
|
668 |
-
## Bug Fixes
|
669 |
-
|
670 |
-
- NVBug 1965743: Remove unnecessary static qualifiers.
|
671 |
-
- NVBug 1940974: Fix regression causing a compilation error when using
|
672 |
-
`thrust::merge_by_key` with `thrust::constant_iterator`s.
|
673 |
-
- NVBug 1904217: Allow callables that take non-const refs to be used with
|
674 |
-
`thrust::reduce` and `thrust::*_scan`.
|
675 |
-
|
676 |
-
# Thrust 1.9.0-5 (CUDA Toolkit 9.0)
|
677 |
-
|
678 |
-
## Summary
|
679 |
-
|
680 |
-
Thrust 1.9.0-5 replaces the original CUDA backend (bulk) with a new one
|
681 |
-
written using CUB, a high performance CUDA collectives library.
|
682 |
-
This brings a substantial performance improvement to the CUDA backend across
|
683 |
-
the board.
|
684 |
-
|
685 |
-
## Breaking Changes
|
686 |
-
|
687 |
-
- Any code depending on CUDA backend implementation details will likely be
|
688 |
-
broken.
|
689 |
-
|
690 |
-
## New Features
|
691 |
-
|
692 |
-
- New CUDA backend based on CUB which delivers substantially higher performance.
|
693 |
-
- `thrust::transform_output_iterator`, a fancy iterator that applies a function
|
694 |
-
to the output before storing the result.
|
695 |
-
|
696 |
-
## New Examples
|
697 |
-
|
698 |
-
- `transform_output_iterator` demonstrates use of the new fancy iterator
|
699 |
-
`thrust::transform_output_iterator`.
|
700 |
-
|
701 |
-
## Other Enhancements
|
702 |
-
|
703 |
-
- When C++11 is enabled, functors do not have to inherit from
|
704 |
-
`thrust::(unary|binary)_function` anymore to be used with
|
705 |
-
`thrust::transform_iterator`.
|
706 |
-
- Added C++11 only move constructors and move assignment operators for
|
707 |
-
`thrust::detail::vector_base`-based classes, e.g. `thrust::host_vector`,
|
708 |
-
`thrust::device_vector`, and friends.
|
709 |
-
|
710 |
-
## Bug Fixes
|
711 |
-
|
712 |
-
- `sin(thrust::complex<double>)` no longer has precision loss to float.
|
713 |
-
|
714 |
-
## Acknowledgments
|
715 |
-
|
716 |
-
- Thanks to Manuel Schiller for contributing a C++11 based enhancement
|
717 |
-
regarding the deduction of functor return types, improving the performance
|
718 |
-
of `thrust::unique` and implementing `thrust::transform_output_iterator`.
|
719 |
-
- Thanks to Thibault Notargiacomo for the implementation of move semantics for
|
720 |
-
the `thrust::vector_base`-based classes.
|
721 |
-
- Thanks to Duane Merrill for developing CUB and helping to integrate it into
|
722 |
-
Thrust's backend.
|
723 |
-
|
724 |
-
# Thrust 1.8.3 (CUDA Toolkit 8.0)
|
725 |
-
|
726 |
-
## Summary
|
727 |
-
|
728 |
-
Thrust 1.8.3 is a small bug fix release.
|
729 |
-
|
730 |
-
## New Examples
|
731 |
-
|
732 |
-
- `range_view` demonstrates the use of a view (a non-owning wrapper for an
|
733 |
-
iterator range with a container-like interface).
|
734 |
-
|
735 |
-
## Bug Fixes
|
736 |
-
|
737 |
-
- `thrust::(min|max|minmax)_element` can now accept raw device pointers when
|
738 |
-
an explicit device execution policy is used.
|
739 |
-
- `thrust::clear` operations on vector types no longer requires the element
|
740 |
-
type to have a default constructor.
|
741 |
-
|
742 |
-
# Thrust 1.8.2 (CUDA Toolkit 7.5)
|
743 |
-
|
744 |
-
## Summary
|
745 |
-
|
746 |
-
Thrust 1.8.2 is a small bug fix release.
|
747 |
-
|
748 |
-
## Bug Fixes
|
749 |
-
|
750 |
-
- Avoid warnings and errors concerning user functions called from
|
751 |
-
`__host__ __device__` functions.
|
752 |
-
- #632: Fix an error in `thrust::set_intersection_by_key` with the CUDA backend.
|
753 |
-
- #651: `thrust::copy` between host and device now accepts execution policies
|
754 |
-
with streams attached, i.e. `thrust::::cuda::par.on(stream)`.
|
755 |
-
- #664: `thrust::for_each` and algorithms based on it no longer ignore streams
|
756 |
-
attached to execution policys.
|
757 |
-
|
758 |
-
## Known Issues
|
759 |
-
|
760 |
-
- #628: `thrust::reduce_by_key` for the CUDA backend fails for Compute
|
761 |
-
Capability 5.0 devices.
|
762 |
-
|
763 |
-
# Thrust 1.8.1 (CUDA Toolkit 7.0)
|
764 |
-
|
765 |
-
## Summary
|
766 |
-
|
767 |
-
Thrust 1.8.1 is a small bug fix release.
|
768 |
-
|
769 |
-
## Bug Fixes
|
770 |
-
|
771 |
-
- #615, #620: Fixed `thrust::for_each` and `thrust::reduce` to no longer fail on
|
772 |
-
large inputs.
|
773 |
-
|
774 |
-
## Known Issues
|
775 |
-
|
776 |
-
- #628: `thrust::reduce_by_key` for the CUDA backend fails for Compute
|
777 |
-
Capability 5.0 devices.
|
778 |
-
|
779 |
-
# Thrust 1.8.0
|
780 |
-
|
781 |
-
## Summary
|
782 |
-
|
783 |
-
Thrust 1.8.0 introduces support for algorithm invocation from CUDA device
|
784 |
-
code, support for CUDA streams, and algorithm performance improvements.
|
785 |
-
Users may now invoke Thrust algorithms from CUDA device code, providing a
|
786 |
-
parallel algorithms library to CUDA programmers authoring custom kernels, as
|
787 |
-
well as allowing Thrust programmers to nest their algorithm calls within
|
788 |
-
functors.
|
789 |
-
The `thrust::seq` execution policy allows users to require sequential algorithm
|
790 |
-
execution in the calling thread and makes a sequential algorithms library
|
791 |
-
available to individual CUDA threads.
|
792 |
-
The `.on(stream)` syntax allows users to request a CUDA stream for kernels
|
793 |
-
launched during algorithm execution.
|
794 |
-
Finally, new CUDA algorithm implementations provide substantial performance
|
795 |
-
improvements.
|
796 |
-
|
797 |
-
## New Features
|
798 |
-
|
799 |
-
- Algorithms in CUDA Device Code:
|
800 |
-
- Thrust algorithms may now be invoked from CUDA `__device__` and
|
801 |
-
`__host__` __device__ functions.
|
802 |
-
Algorithms invoked in this manner must be invoked with an execution
|
803 |
-
policy as the first parameter.
|
804 |
-
The following execution policies are supported in CUDA __device__ code:
|
805 |
-
- `thrust::seq`
|
806 |
-
- `thrust::cuda::par`
|
807 |
-
- `thrust::device`, when THRUST_DEVICE_SYSTEM == THRUST_DEVICE_SYSTEM_CUDA.
|
808 |
-
- Device-side algorithm execution may not be parallelized unless CUDA Dynamic
|
809 |
-
Parallelism is available.
|
810 |
-
- Execution Policies:
|
811 |
-
- CUDA Streams
|
812 |
-
- The `thrust::cuda::par.on(stream)` syntax allows users to request that
|
813 |
-
CUDA kernels launched during algorithm execution should occur on a given
|
814 |
-
stream.
|
815 |
-
- Algorithms executed with a CUDA stream in this manner may still
|
816 |
-
synchronize with other streams when allocating temporary storage or
|
817 |
-
returning results to the CPU.
|
818 |
-
- `thrust::seq`, which allows users to require that an algorithm execute
|
819 |
-
sequentially in the calling thread.
|
820 |
-
- `thrust::complex`, a complex number data type.
|
821 |
-
|
822 |
-
## New Examples
|
823 |
-
|
824 |
-
- simple_cuda_streams demonstrates how to request a CUDA stream during
|
825 |
-
algorithm execution.
|
826 |
-
- async_reduce demonstrates ways to achieve algorithm invocations which are
|
827 |
-
asynchronous with the calling thread.
|
828 |
-
|
829 |
-
## Other Enhancements
|
830 |
-
|
831 |
-
- CUDA sort performance for user-defined types is 300% faster on Tesla K20c for
|
832 |
-
large problem sizes.
|
833 |
-
- CUDA merge performance is 200% faster on Tesla K20c for large problem sizes.
|
834 |
-
- CUDA sort performance for primitive types is 50% faster on Tesla K20c for
|
835 |
-
large problem sizes.
|
836 |
-
- CUDA reduce_by_key performance is 25% faster on Tesla K20c for large problem
|
837 |
-
sizes.
|
838 |
-
- CUDA scan performance is 15% faster on Tesla K20c for large problem sizes.
|
839 |
-
- fallback_allocator example is simpler.
|
840 |
-
|
841 |
-
## Bug Fixes
|
842 |
-
|
843 |
-
- #364: Iterators with unrelated system tags may be used with algorithms invoked
|
844 |
-
with an execution policy
|
845 |
-
- #371: Do not redefine `__CUDA_ARCH__`.
|
846 |
-
- #379: Fix crash when dereferencing transform_iterator on the host.
|
847 |
-
- #391: Avoid use of uppercase variable names.
|
848 |
-
- #392: Fix `thrust::copy` between `cusp::complex` and `std::complex`.
|
849 |
-
- #396: Program compiled with gcc < 4.3 hangs during comparison sort.
|
850 |
-
- #406: `fallback_allocator.cu` example checks device for unified addressing support.
|
851 |
-
- #417: Avoid using `std::less<T>` in binary search algorithms.
|
852 |
-
- #418: Avoid various warnings.
|
853 |
-
- #443: Including version.h no longer configures default systems.
|
854 |
-
- #578: NVCC produces warnings when sequential algorithms are used with CPU systems.
|
855 |
-
|
856 |
-
## Known Issues
|
857 |
-
|
858 |
-
- When invoked with primitive data types, thrust::sort, thrust::sort_by_key,
|
859 |
-
thrust::stable_sort, & thrust::stable_sort_by_key may
|
860 |
-
- Sometimes linking fails when compiling with `-rdc=true` with NVCC.
|
861 |
-
- The CUDA implementation of thrust::reduce_by_key incorrectly outputs the last
|
862 |
-
element in a segment of equivalent keys instead of the first.
|
863 |
-
|
864 |
-
## Acknowledgments
|
865 |
-
|
866 |
-
- Thanks to Sean Baxter for contributing faster CUDA reduce, merge, and scan
|
867 |
-
implementations.
|
868 |
-
- Thanks to Duane Merrill for contributing a faster CUDA radix sort implementation.
|
869 |
-
- Thanks to Filipe Maia for contributing the implementation of thrust::complex.
|
870 |
-
|
871 |
-
# Thrust 1.7.2 (CUDA Toolkit 6.5)
|
872 |
-
|
873 |
-
## Summary
|
874 |
-
|
875 |
-
Thrust 1.7.2 is a minor bug fix release.
|
876 |
-
|
877 |
-
## Bug Fixes
|
878 |
-
|
879 |
-
- Avoid use of `std::min` in generic find implementation.
|
880 |
-
|
881 |
-
# Thrust 1.7.1 (CUDA Toolkit 6.0)
|
882 |
-
|
883 |
-
## Summary
|
884 |
-
|
885 |
-
Thrust 1.7.1 is a minor bug fix release.
|
886 |
-
|
887 |
-
## Bug Fixes
|
888 |
-
|
889 |
-
- Eliminate identifiers in `set_operations.cu` example with leading underscore.
|
890 |
-
- Eliminate unused variable warning in CUDA `reduce_by_key` implementation.
|
891 |
-
- Avoid deriving function objects from `std::unary_function` and
|
892 |
-
`std::binary_function`.
|
893 |
-
|
894 |
-
# Thrust 1.7.0 (CUDA Toolkit 5.5)
|
895 |
-
|
896 |
-
## Summary
|
897 |
-
|
898 |
-
Thrust 1.7.0 introduces a new interface for controlling algorithm execution as
|
899 |
-
well as several new algorithms and performance improvements.
|
900 |
-
With this new interface, users may directly control how algorithms execute as
|
901 |
-
well as details such as the allocation of temporary storage.
|
902 |
-
Key/value versions of thrust::merge and the set operation algorithms have been
|
903 |
-
added, as well stencil versions of partitioning algorithms.
|
904 |
-
thrust::tabulate has been introduced to tabulate the values of functions taking
|
905 |
-
integers.
|
906 |
-
For 32b types, new CUDA merge and set operations provide 2-15x faster
|
907 |
-
performance while a new CUDA comparison sort provides 1.3-4x faster
|
908 |
-
performance.
|
909 |
-
Finally, a new TBB reduce_by_key implementation provides 80% faster
|
910 |
-
performance.
|
911 |
-
|
912 |
-
## Breaking Changes
|
913 |
-
|
914 |
-
- Dispatch:
|
915 |
-
- Custom user backend systems' tag types must now inherit from the
|
916 |
-
corresponding system's execution_policy template (e.g.
|
917 |
-
thrust::cuda::execution_policy) instead of the tag struct (e.g.
|
918 |
-
thrust::cuda::tag). Otherwise, algorithm specializations will silently go
|
919 |
-
unfound during dispatch. See examples/minimal_custom_backend.cu and
|
920 |
-
examples/cuda/fallback_allocator.cu for usage examples.
|
921 |
-
- thrust::advance and thrust::distance are no longer dispatched based on
|
922 |
-
iterator system type and thus may no longer be customized.
|
923 |
-
- Iterators:
|
924 |
-
- iterator_facade and iterator_adaptor's Pointer template parameters have
|
925 |
-
been eliminated.
|
926 |
-
- iterator_adaptor has been moved into the thrust namespace (previously
|
927 |
-
thrust::experimental::iterator_adaptor).
|
928 |
-
- iterator_facade has been moved into the thrust namespace (previously
|
929 |
-
thrust::experimental::iterator_facade).
|
930 |
-
- iterator_core_access has been moved into the thrust namespace (previously
|
931 |
-
thrust::experimental::iterator_core_access).
|
932 |
-
- All iterators' nested pointer typedef (the type of the result of
|
933 |
-
operator->) is now void instead of a pointer type to indicate that such
|
934 |
-
expressions are currently impossible.
|
935 |
-
- Floating point counting_iterators' nested difference_type typedef is now a
|
936 |
-
signed integral type instead of a floating point type.
|
937 |
-
- Other:
|
938 |
-
- normal_distribution has been moved into the thrust::random namespace
|
939 |
-
(previously thrust::random::experimental::normal_distribution).
|
940 |
-
- Placeholder expressions may no longer include the comma operator.
|
941 |
-
|
942 |
-
## New Features
|
943 |
-
- Execution Policies:
|
944 |
-
- Users may directly control the dispatch of algorithm invocations with
|
945 |
-
optional execution policy arguments.
|
946 |
-
For example, instead of wrapping raw pointers allocated by cudaMalloc with
|
947 |
-
thrust::device_ptr, the thrust::device execution_policy may be passed as
|
948 |
-
an argument to an algorithm invocation to enable CUDA execution.
|
949 |
-
- The following execution policies are supported in this version:
|
950 |
-
- `thrust::host`
|
951 |
-
- `thrust::device`
|
952 |
-
- `thrust::cpp::par`
|
953 |
-
- `thrust::cuda::par`
|
954 |
-
- `thrust::omp::par`
|
955 |
-
- `thrust::tbb::par`
|
956 |
-
- Algorithms:
|
957 |
-
- `thrust::merge_by_key`
|
958 |
-
- `thrust::partition` with stencil
|
959 |
-
- `thrust::partition_copy` with stencil
|
960 |
-
- `thrust::set_difference_by_key`
|
961 |
-
- `thrust::set_intersection_by_key`
|
962 |
-
- `thrust::set_symmetric_difference_by_key`
|
963 |
-
- `thrust::set_union_by_key`
|
964 |
-
- `thrust::stable_partition with stencil`
|
965 |
-
- `thrust::stable_partition_copy with stencil`
|
966 |
-
- `thrust::tabulate`
|
967 |
-
- Memory Allocation:
|
968 |
-
- `thrust::malloc`
|
969 |
-
- `thrust::free`
|
970 |
-
- `thrust::get_temporary_buffer`
|
971 |
-
- `thrust::return_temporary_buffer`
|
972 |
-
|
973 |
-
## New Examples
|
974 |
-
|
975 |
-
- uninitialized_vector demonstrates how to use a custom allocator to avoid the
|
976 |
-
automatic initialization of elements in thrust::device_vector.
|
977 |
-
|
978 |
-
## Other Enhancements
|
979 |
-
|
980 |
-
- Authors of custom backend systems may manipulate arbitrary state during
|
981 |
-
algorithm dispatch by incorporating it into their execution_policy parameter.
|
982 |
-
- Users may control the allocation of temporary storage during algorithm
|
983 |
-
execution by passing standard allocators as parameters via execution policies
|
984 |
-
such as thrust::device.
|
985 |
-
- THRUST_DEVICE_SYSTEM_CPP has been added as a compile-time target for the
|
986 |
-
device backend.
|
987 |
-
- CUDA merge performance is 2-15x faster.
|
988 |
-
- CUDA comparison sort performance is 1.3-4x faster.
|
989 |
-
- CUDA set operation performance is 1.5-15x faster.
|
990 |
-
- TBB reduce_by_key performance is 80% faster.
|
991 |
-
- Several algorithms have been parallelized with TBB.
|
992 |
-
- Support for user allocators in vectors has been improved.
|
993 |
-
- The sparse_vector example is now implemented with merge_by_key instead of
|
994 |
-
sort_by_key.
|
995 |
-
- Warnings have been eliminated in various contexts.
|
996 |
-
- Warnings about __host__ or __device__-only functions called from __host__
|
997 |
-
__device__ functions have been eliminated in various contexts.
|
998 |
-
- Documentation about algorithm requirements have been improved.
|
999 |
-
- Simplified the minimal_custom_backend example.
|
1000 |
-
- Simplified the cuda/custom_temporary_allocation example.
|
1001 |
-
- Simplified the cuda/fallback_allocator example.
|
1002 |
-
|
1003 |
-
## Bug Fixes
|
1004 |
-
|
1005 |
-
- #248: Fix broken `thrust::counting_iterator<float>` behavior with OpenMP.
|
1006 |
-
- #231, #209: Fix set operation failures with CUDA.
|
1007 |
-
- #187: Fix incorrect occupancy calculation with CUDA.
|
1008 |
-
- #153: Fix broken multi GPU behavior with CUDA.
|
1009 |
-
- #142: Eliminate warning produced by `thrust::random::taus88` and MSVC 2010.
|
1010 |
-
- #208: Correctly initialize elements in temporary storage when necessary.
|
1011 |
-
- #16: Fix compilation error when sorting bool with CUDA.
|
1012 |
-
- #10: Fix ambiguous overloads of `thrust::reinterpret_tag`.
|
1013 |
-
|
1014 |
-
## Known Issues
|
1015 |
-
|
1016 |
-
- GCC 4.3 and lower may fail to dispatch thrust::get_temporary_buffer correctly
|
1017 |
-
causing infinite recursion in examples such as
|
1018 |
-
cuda/custom_temporary_allocation.
|
1019 |
-
|
1020 |
-
## Acknowledgments
|
1021 |
-
|
1022 |
-
- Thanks to Sean Baxter, Bryan Catanzaro, and Manjunath Kudlur for contributing
|
1023 |
-
a faster merge implementation for CUDA.
|
1024 |
-
- Thanks to Sean Baxter for contributing a faster set operation implementation
|
1025 |
-
for CUDA.
|
1026 |
-
- Thanks to Cliff Woolley for contributing a correct occupancy calculation
|
1027 |
-
algorithm.
|
1028 |
-
|
1029 |
-
# Thrust 1.6.0
|
1030 |
-
|
1031 |
-
## Summary
|
1032 |
-
|
1033 |
-
Thrust 1.6.0 provides an interface for customization and extension and a new
|
1034 |
-
backend system based on the Threading Building Blocks library.
|
1035 |
-
With this new interface, programmers may customize the behavior of specific
|
1036 |
-
algorithms as well as control the allocation of temporary storage or invent
|
1037 |
-
entirely new backends.
|
1038 |
-
These enhancements also allow multiple different backend systems
|
1039 |
-
such as CUDA and OpenMP to coexist within a single program.
|
1040 |
-
Support for TBB allows Thrust programs to integrate more naturally into
|
1041 |
-
applications which may already employ the TBB task scheduler.
|
1042 |
-
|
1043 |
-
## Breaking Changes
|
1044 |
-
|
1045 |
-
- The header <thrust/experimental/cuda/pinned_allocator.h> has been moved to
|
1046 |
-
<thrust/system/cuda/experimental/pinned_allocator.h>
|
1047 |
-
- thrust::experimental::cuda::pinned_allocator has been moved to
|
1048 |
-
thrust::cuda::experimental::pinned_allocator
|
1049 |
-
- The macro THRUST_DEVICE_BACKEND has been renamed THRUST_DEVICE_SYSTEM
|
1050 |
-
- The macro THRUST_DEVICE_BACKEND_CUDA has been renamed THRUST_DEVICE_SYSTEM_CUDA
|
1051 |
-
- The macro THRUST_DEVICE_BACKEND_OMP has been renamed THRUST_DEVICE_SYSTEM_OMP
|
1052 |
-
- thrust::host_space_tag has been renamed thrust::host_system_tag
|
1053 |
-
- thrust::device_space_tag has been renamed thrust::device_system_tag
|
1054 |
-
- thrust::any_space_tag has been renamed thrust::any_system_tag
|
1055 |
-
- thrust::iterator_space has been renamed thrust::iterator_system
|
1056 |
-
|
1057 |
-
## New Features
|
1058 |
-
|
1059 |
-
- Backend Systems
|
1060 |
-
- Threading Building Blocks (TBB) is now supported
|
1061 |
-
- Algorithms
|
1062 |
-
- `thrust::for_each_n`
|
1063 |
-
- `thrust::raw_reference_cast`
|
1064 |
-
- Types
|
1065 |
-
- `thrust::pointer`
|
1066 |
-
- `thrust::reference`
|
1067 |
-
|
1068 |
-
## New Examples
|
1069 |
-
|
1070 |
-
- `cuda/custom_temporary_allocation`
|
1071 |
-
- `cuda/fallback_allocator`
|
1072 |
-
- `device_ptr`
|
1073 |
-
- `expand`
|
1074 |
-
- `minimal_custom_backend`
|
1075 |
-
- `raw_reference_cast`
|
1076 |
-
- `set_operations`
|
1077 |
-
|
1078 |
-
## Other Enhancements
|
1079 |
-
- thrust::for_each now returns the end of the input range similar to most other algorithms
|
1080 |
-
- thrust::pair and thrust::tuple have swap functionality
|
1081 |
-
- All CUDA algorithms now support large data types
|
1082 |
-
- Iterators may be dereferenced in user __device__ or __global__ functions
|
1083 |
-
- The safe use of different backend systems is now possible within a single binary
|
1084 |
-
|
1085 |
-
## Bug Fixes
|
1086 |
-
|
1087 |
-
- #469 `min_element` and `max_element` algorithms no longer require a const comparison operator
|
1088 |
-
|
1089 |
-
## Known Issues
|
1090 |
-
|
1091 |
-
- NVCC may crash when parsing TBB headers on Windows.
|
1092 |
-
|
1093 |
-
# Thrust 1.5.3 (CUDA Toolkit 5.0)
|
1094 |
-
|
1095 |
-
## Summary
|
1096 |
-
|
1097 |
-
Thrust 1.5.3 is a minor bug fix release.
|
1098 |
-
|
1099 |
-
## Bug Fixes
|
1100 |
-
|
1101 |
-
- Avoid warnings about potential race due to `__shared__` non-POD variable
|
1102 |
-
|
1103 |
-
# Thrust 1.5.2 (CUDA Toolkit 4.2)
|
1104 |
-
|
1105 |
-
## Summary
|
1106 |
-
|
1107 |
-
Thrust 1.5.2 is a minor bug fix release.
|
1108 |
-
|
1109 |
-
## Bug Fixes
|
1110 |
-
|
1111 |
-
- Fixed warning about C-style initialization of structures
|
1112 |
-
|
1113 |
-
# Thrust 1.5.1 (CUDA Toolkit 4.1)
|
1114 |
-
|
1115 |
-
## Summary
|
1116 |
-
|
1117 |
-
Thrust 1.5.1 is a minor bug fix release.
|
1118 |
-
|
1119 |
-
## Bug Fixes
|
1120 |
-
|
1121 |
-
- Sorting data referenced by permutation_iterators on CUDA produces invalid results
|
1122 |
-
|
1123 |
-
# Thrust 1.5.0
|
1124 |
-
|
1125 |
-
## Summary
|
1126 |
-
|
1127 |
-
Thrust 1.5.0 provides introduces new programmer productivity and performance
|
1128 |
-
enhancements.
|
1129 |
-
New functionality for creating anonymous "lambda" functions has been added.
|
1130 |
-
A faster host sort provides 2-10x faster performance for sorting arithmetic
|
1131 |
-
types on (single-threaded) CPUs.
|
1132 |
-
A new OpenMP sort provides 2.5x-3.0x speedup over the host sort using a
|
1133 |
-
quad-core CPU.
|
1134 |
-
When sorting arithmetic types with the OpenMP backend the combined performance
|
1135 |
-
improvement is 5.9x for 32-bit integers and ranges from 3.0x (64-bit types) to
|
1136 |
-
14.2x (8-bit types).
|
1137 |
-
A new CUDA `reduce_by_key` implementation provides 2-3x faster
|
1138 |
-
performance.
|
1139 |
-
|
1140 |
-
## Breaking Changes
|
1141 |
-
- device_ptr<void> no longer unsafely converts to device_ptr<T> without an
|
1142 |
-
explicit cast.
|
1143 |
-
Use the expression device_pointer_cast(static_cast<int*>(void_ptr.get())) to
|
1144 |
-
convert, for example, device_ptr<void> to device_ptr<int>.
|
1145 |
-
|
1146 |
-
## New Features
|
1147 |
-
|
1148 |
-
- Algorithms:
|
1149 |
-
- Stencil-less `thrust::transform_if`.
|
1150 |
-
- Lambda placeholders
|
1151 |
-
|
1152 |
-
## New Examples
|
1153 |
-
- lambda
|
1154 |
-
|
1155 |
-
## Other Enhancements
|
1156 |
-
|
1157 |
-
- Host sort is 2-10x faster for arithmetic types
|
1158 |
-
- OMP sort provides speedup over host sort
|
1159 |
-
- `reduce_by_key` is 2-3x faster
|
1160 |
-
- `reduce_by_key` no longer requires O(N) temporary storage
|
1161 |
-
- CUDA scan algorithms are 10-40% faster
|
1162 |
-
- `host_vector` and `device_vector` are now documented
|
1163 |
-
- out-of-memory exceptions now provide detailed information from CUDART
|
1164 |
-
- improved histogram example
|
1165 |
-
- `device_reference` now has a specialized swap
|
1166 |
-
- `reduce_by_key` and scan algorithms are compatible with `discard_iterator`
|
1167 |
-
|
1168 |
-
## Bug Fixes
|
1169 |
-
|
1170 |
-
- #44: Allow `thrust::host_vector` to compile when `value_type` uses
|
1171 |
-
`__align__`.
|
1172 |
-
- #198: Allow `thrust::adjacent_difference` to permit safe in-situ operation.
|
1173 |
-
- #303: Make thrust thread-safe.
|
1174 |
-
- #313: Avoid race conditions in `thrust::device_vector::insert`.
|
1175 |
-
- #314: Avoid unintended ADL invocation when dispatching copy.
|
1176 |
-
- #365: Fix merge and set operation failures.
|
1177 |
-
|
1178 |
-
## Known Issues
|
1179 |
-
|
1180 |
-
- None
|
1181 |
-
|
1182 |
-
## Acknowledgments
|
1183 |
-
|
1184 |
-
- Thanks to Manjunath Kudlur for contributing his Carbon library, from which
|
1185 |
-
the lambda functionality is derived.
|
1186 |
-
- Thanks to Jean-Francois Bastien for suggesting a fix for #303.
|
1187 |
-
|
1188 |
-
# Thrust 1.4.0 (CUDA Toolkit 4.0)
|
1189 |
-
|
1190 |
-
## Summary
|
1191 |
-
|
1192 |
-
Thrust 1.4.0 is the first release of Thrust to be included in the CUDA Toolkit.
|
1193 |
-
Additionally, it brings many feature and performance improvements.
|
1194 |
-
New set theoretic algorithms operating on sorted sequences have been added.
|
1195 |
-
Additionally, a new fancy iterator allows discarding redundant or otherwise
|
1196 |
-
unnecessary output from algorithms, conserving memory storage and bandwidth.
|
1197 |
-
|
1198 |
-
## Breaking Changes
|
1199 |
-
|
1200 |
-
- Eliminations
|
1201 |
-
- `thrust/is_sorted.h`
|
1202 |
-
- `thrust/utility.h`
|
1203 |
-
- `thrust/set_intersection.h`
|
1204 |
-
- `thrust/experimental/cuda/ogl_interop_allocator.h` and the functionality
|
1205 |
-
therein
|
1206 |
-
- `thrust::deprecated::copy_when`
|
1207 |
-
- `thrust::deprecated::absolute_value`
|
1208 |
-
- `thrust::deprecated::copy_when`
|
1209 |
-
- `thrust::deprecated::absolute_value`
|
1210 |
-
- `thrust::deprecated::copy_when`
|
1211 |
-
- `thrust::deprecated::absolute_value`
|
1212 |
-
- `thrust::gather` and `thrust::scatter` from host to device and vice versa
|
1213 |
-
are no longer supported.
|
1214 |
-
- Operations which modify the elements of a thrust::device_vector are no longer
|
1215 |
-
available from source code compiled without nvcc when the device backend
|
1216 |
-
is CUDA.
|
1217 |
-
Instead, use the idiom from the cpp_interop example.
|
1218 |
-
|
1219 |
-
## New Features
|
1220 |
-
|
1221 |
-
- Algorithms:
|
1222 |
-
- `thrust::copy_n`
|
1223 |
-
- `thrust::merge`
|
1224 |
-
- `thrust::set_difference`
|
1225 |
-
- `thrust::set_symmetric_difference`
|
1226 |
-
- `thrust::set_union`
|
1227 |
-
|
1228 |
-
- Types
|
1229 |
-
- `thrust::discard_iterator`
|
1230 |
-
|
1231 |
-
- Device Support:
|
1232 |
-
- Compute Capability 2.1 GPUs.
|
1233 |
-
|
1234 |
-
## New Examples
|
1235 |
-
|
1236 |
-
- run_length_decoding
|
1237 |
-
|
1238 |
-
## Other Enhancements
|
1239 |
-
|
1240 |
-
- Compilation warnings are substantially reduced in various contexts.
|
1241 |
-
- The compilation time of thrust::sort, thrust::stable_sort,
|
1242 |
-
thrust::sort_by_key, and thrust::stable_sort_by_key are substantially
|
1243 |
-
reduced.
|
1244 |
-
- A fast sort implementation is used when sorting primitive types with
|
1245 |
-
thrust::greater.
|
1246 |
-
- The performance of thrust::set_intersection is improved.
|
1247 |
-
- The performance of thrust::fill is improved on SM 1.x devices.
|
1248 |
-
- A code example is now provided in each algorithm's documentation.
|
1249 |
-
- thrust::reverse now operates in-place
|
1250 |
-
|
1251 |
-
## Bug Fixes
|
1252 |
-
|
1253 |
-
- #212: `thrust::set_intersection` works correctly for large input sizes.
|
1254 |
-
- #275: `thrust::counting_iterator` and `thrust::constant_iterator` work
|
1255 |
-
correctly with OpenMP as the backend when compiling with optimization.
|
1256 |
-
- #256: `min` and `max` correctly return their first argument as a tie-breaker
|
1257 |
-
- #248: `NDEBUG` is interpreted incorrectly
|
1258 |
-
|
1259 |
-
## Known Issues
|
1260 |
-
|
1261 |
-
- NVCC may generate code containing warnings when compiling some Thrust
|
1262 |
-
algorithms.
|
1263 |
-
- When compiling with `-arch=sm_1x`, some Thrust algorithms may cause NVCC to
|
1264 |
-
issue benign pointer advisories.
|
1265 |
-
- When compiling with `-arch=sm_1x` and -G, some Thrust algorithms may fail to
|
1266 |
-
execute correctly.
|
1267 |
-
- `thrust::inclusive_scan`, `thrust::exclusive_scan`,
|
1268 |
-
`thrust::inclusive_scan_by_key`, and `thrust::exclusive_scan_by_key` are
|
1269 |
-
currently incompatible with `thrust::discard_iterator`.
|
1270 |
-
|
1271 |
-
## Acknowledgments
|
1272 |
-
|
1273 |
-
- Thanks to David Tarjan for improving the performance of set_intersection.
|
1274 |
-
- Thanks to Duane Merrill for continued help with sort.
|
1275 |
-
- Thanks to Nathan Whitehead for help with CUDA Toolkit integration.
|
1276 |
-
|
1277 |
-
# Thrust 1.3.0
|
1278 |
-
|
1279 |
-
## Summary
|
1280 |
-
|
1281 |
-
Thrust 1.3.0 provides support for CUDA Toolkit 3.2 in addition to many feature
|
1282 |
-
and performance enhancements.
|
1283 |
-
Performance of the sort and sort_by_key algorithms is improved by as much as 3x
|
1284 |
-
in certain situations.
|
1285 |
-
The performance of stream compaction algorithms, such as copy_if, is improved
|
1286 |
-
by as much as 2x.
|
1287 |
-
CUDA errors are now converted to runtime exceptions using the system_error
|
1288 |
-
interface.
|
1289 |
-
Combined with a debug mode, also new in 1.3, runtime errors can be located with
|
1290 |
-
greater precision.
|
1291 |
-
Lastly, a few header files have been consolidated or renamed for clarity.
|
1292 |
-
See the deprecations section below for additional details.
|
1293 |
-
|
1294 |
-
## Breaking Changes
|
1295 |
-
|
1296 |
-
- Promotions
|
1297 |
-
- thrust::experimental::inclusive_segmented_scan has been renamed
|
1298 |
-
thrust::inclusive_scan_by_key and exposes a different interface
|
1299 |
-
- thrust::experimental::exclusive_segmented_scan has been renamed
|
1300 |
-
thrust::exclusive_scan_by_key and exposes a different interface
|
1301 |
-
- thrust::experimental::partition_copy has been renamed
|
1302 |
-
thrust::partition_copy and exposes a different interface
|
1303 |
-
- thrust::next::gather has been renamed thrust::gather
|
1304 |
-
- thrust::next::gather_if has been renamed thrust::gather_if
|
1305 |
-
- thrust::unique_copy_by_key has been renamed thrust::unique_by_key_copy
|
1306 |
-
- Deprecations
|
1307 |
-
- thrust::copy_when has been renamed thrust::deprecated::copy_when
|
1308 |
-
- thrust::absolute_value has been renamed thrust::deprecated::absolute_value
|
1309 |
-
- The header thrust/set_intersection.h is now deprecated; use
|
1310 |
-
thrust/set_operations.h instead
|
1311 |
-
- The header thrust/utility.h is now deprecated; use thrust/swap.h instead
|
1312 |
-
- The header thrust/swap_ranges.h is now deprecated; use thrust/swap.h instead
|
1313 |
-
- Eliminations
|
1314 |
-
- thrust::deprecated::gather
|
1315 |
-
- thrust::deprecated::gather_if
|
1316 |
-
- thrust/experimental/arch.h and the functions therein
|
1317 |
-
- thrust/sorting/merge_sort.h
|
1318 |
-
- thrust/sorting/radix_sort.h
|
1319 |
-
- NVCC 2.3 is no longer supported
|
1320 |
-
|
1321 |
-
## New Features
|
1322 |
-
|
1323 |
-
- Algorithms:
|
1324 |
-
- `thrust::exclusive_scan_by_key`
|
1325 |
-
- `thrust::find`
|
1326 |
-
- `thrust::find_if`
|
1327 |
-
- `thrust::find_if_not`
|
1328 |
-
- `thrust::inclusive_scan_by_key`
|
1329 |
-
- `thrust::is_partitioned`
|
1330 |
-
- `thrust::is_sorted_until`
|
1331 |
-
- `thrust::mismatch`
|
1332 |
-
- `thrust::partition_point`
|
1333 |
-
- `thrust::reverse`
|
1334 |
-
- `thrust::reverse_copy`
|
1335 |
-
- `thrust::stable_partition_copy`
|
1336 |
-
|
1337 |
-
- Types:
|
1338 |
-
- `thrust::system_error` and related types.
|
1339 |
-
- `thrust::experimental::cuda::ogl_interop_allocator`.
|
1340 |
-
- `thrust::bit_and`, `thrust::bit_or`, and `thrust::bit_xor`.
|
1341 |
-
|
1342 |
-
- Device Support:
|
1343 |
-
- GF104-based GPUs.
|
1344 |
-
|
1345 |
-
## New Examples
|
1346 |
-
|
1347 |
-
- opengl_interop.cu
|
1348 |
-
- repeated_range.cu
|
1349 |
-
- simple_moving_average.cu
|
1350 |
-
- sparse_vector.cu
|
1351 |
-
- strided_range.cu
|
1352 |
-
|
1353 |
-
## Other Enhancements
|
1354 |
-
|
1355 |
-
- Performance of thrust::sort and thrust::sort_by_key is substantially improved
|
1356 |
-
for primitive key types
|
1357 |
-
- Performance of thrust::copy_if is substantially improved
|
1358 |
-
- Performance of thrust::reduce and related reductions is improved
|
1359 |
-
- THRUST_DEBUG mode added
|
1360 |
-
- Callers of Thrust functions may detect error conditions by catching
|
1361 |
-
thrust::system_error, which derives from std::runtime_error
|
1362 |
-
- The number of compiler warnings generated by Thrust has been substantially
|
1363 |
-
reduced
|
1364 |
-
- Comparison sort now works correctly for input sizes > 32M
|
1365 |
-
- min & max usage no longer collides with <windows.h> definitions
|
1366 |
-
- Compiling against the OpenMP backend no longer requires nvcc
|
1367 |
-
- Performance of device_vector initialized in .cpp files is substantially
|
1368 |
-
improved in common cases
|
1369 |
-
- Performance of thrust::sort_by_key on the host is substantially improved
|
1370 |
-
|
1371 |
-
## Bug Fixes
|
1372 |
-
|
1373 |
-
- Debug device code now compiles correctly
|
1374 |
-
- thrust::uninitialized_copy and thrust::uninitialized_fill now dispatch
|
1375 |
-
constructors on the device rather than the host
|
1376 |
-
|
1377 |
-
## Known Issues
|
1378 |
-
|
1379 |
-
- #212 set_intersection is known to fail for large input sizes
|
1380 |
-
- partition_point is known to fail for 64b types with nvcc 3.2
|
1381 |
-
|
1382 |
-
Acknowledgments
|
1383 |
-
- Thanks to Duane Merrill for contributing a fast CUDA radix sort implementation
|
1384 |
-
- Thanks to Erich Elsen for contributing an implementation of find_if
|
1385 |
-
- Thanks to Andrew Corrigan for contributing changes which allow the OpenMP
|
1386 |
-
backend to compile in the absence of nvcc
|
1387 |
-
- Thanks to Andrew Corrigan, Cliff Wooley, David Coeurjolly, Janick Martinez
|
1388 |
-
Esturo, John Bowers, Maxim Naumov, Michael Garland, and Ryuta Suzuki for
|
1389 |
-
bug reports
|
1390 |
-
- Thanks to Cliff Woolley for help with testing
|
1391 |
-
|
1392 |
-
# Thrust 1.2.1
|
1393 |
-
|
1394 |
-
## Summary
|
1395 |
-
|
1396 |
-
Small fixes for compatibility for the CUDA Toolkit 3.1.
|
1397 |
-
|
1398 |
-
## Known Issues
|
1399 |
-
|
1400 |
-
- `thrust::inclusive_scan` and `thrust::exclusive_scan` may fail with very
|
1401 |
-
large types.
|
1402 |
-
- MSVC may fail to compile code using both sort and binary search algorithms.
|
1403 |
-
- `thrust::uninitialized_fill` and `thrust::uninitialized_copy` dispatch
|
1404 |
-
constructors on the host rather than the device.
|
1405 |
-
- #109: Some algorithms may exhibit poor performance with the OpenMP backend
|
1406 |
-
with large numbers (>= 6) of CPU threads.
|
1407 |
-
- `thrust::default_random_engine::discard` is not accelerated with NVCC 2.3
|
1408 |
-
- NVCC 3.1 may fail to compile code using types derived from
|
1409 |
-
`thrust::subtract_with_carry_engine`, such as `thrust::ranlux24` and
|
1410 |
-
`thrust::ranlux48`.
|
1411 |
-
|
1412 |
-
# Thrust 1.2.0
|
1413 |
-
|
1414 |
-
## Summary
|
1415 |
-
|
1416 |
-
Thrust 1.2 introduces support for compilation to multicore CPUs and the Ocelot
|
1417 |
-
virtual machine, and several new facilities for pseudo-random number
|
1418 |
-
generation.
|
1419 |
-
New algorithms such as set intersection and segmented reduction have also been
|
1420 |
-
added.
|
1421 |
-
Lastly, improvements to the robustness of the CUDA backend ensure correctness
|
1422 |
-
across a broad set of (uncommon) use cases.
|
1423 |
-
|
1424 |
-
## Breaking Changes
|
1425 |
-
|
1426 |
-
- `thrust::gather`'s interface was incorrect and has been removed.
|
1427 |
-
The old interface is deprecated but will be preserved for Thrust version 1.2
|
1428 |
-
at `thrust::deprecated::gather` and `thrust::deprecated::gather_if`.
|
1429 |
-
The new interface is provided at `thrust::next::gather` and
|
1430 |
-
`thrust::next::gather_if`.
|
1431 |
-
The new interface will be promoted to `thrust::` in Thrust version 1.3.
|
1432 |
-
For more details, please refer to [this thread](http://groups.google.com/group/thrust-users/browse_thread/thread/f5f0583cb97b51fd).
|
1433 |
-
- The `thrust::sorting` namespace has been deprecated in favor of the top-level
|
1434 |
-
sorting functions, such as `thrust::sort` and `thrust::sort_by_key`.
|
1435 |
-
- Removed support for `thrust::equal` between host & device sequences.
|
1436 |
-
- Removed support for `thrust::scatter` between host & device sequences.
|
1437 |
-
|
1438 |
-
## New Features
|
1439 |
-
|
1440 |
-
- Algorithms:
|
1441 |
-
- `thrust::reduce_by_key`
|
1442 |
-
- `thrust::set_intersection`
|
1443 |
-
- `thrust::unique_copy`
|
1444 |
-
- `thrust::unique_by_key`
|
1445 |
-
- `thrust::unique_copy_by_key`
|
1446 |
-
- Types
|
1447 |
-
- Random Number Generation:
|
1448 |
-
- `thrust::discard_block_engine`
|
1449 |
-
- `thrust::default_random_engine`
|
1450 |
-
- `thrust::linear_congruential_engine`
|
1451 |
-
- `thrust::linear_feedback_shift_engine`
|
1452 |
-
- `thrust::subtract_with_carry_engine`
|
1453 |
-
- `thrust::xor_combine_engine`
|
1454 |
-
- `thrust::minstd_rand`
|
1455 |
-
- `thrust::minstd_rand0`
|
1456 |
-
- `thrust::ranlux24`
|
1457 |
-
- `thrust::ranlux48`
|
1458 |
-
- `thrust::ranlux24_base`
|
1459 |
-
- `thrust::ranlux48_base`
|
1460 |
-
- `thrust::taus88`
|
1461 |
-
- `thrust::uniform_int_distribution`
|
1462 |
-
- `thrust::uniform_real_distribution`
|
1463 |
-
- `thrust::normal_distribution` (experimental)
|
1464 |
-
- Function Objects:
|
1465 |
-
- `thrust::project1st`
|
1466 |
-
- `thrust::project2nd`
|
1467 |
-
- `thrust::tie`
|
1468 |
-
- Fancy Iterators:
|
1469 |
-
- `thrust::permutation_iterator`
|
1470 |
-
- `thrust::reverse_iterator`
|
1471 |
-
- Vector Functions:
|
1472 |
-
- `operator!=`
|
1473 |
-
- `rbegin`
|
1474 |
-
- `crbegin`
|
1475 |
-
- `rend`
|
1476 |
-
- `crend`
|
1477 |
-
- `data`
|
1478 |
-
- `shrink_to_fit`
|
1479 |
-
- Device Support:
|
1480 |
-
- Multicore CPUs via OpenMP.
|
1481 |
-
- Fermi-class GPUs.
|
1482 |
-
- Ocelot virtual machines.
|
1483 |
-
- Support for NVCC 3.0.
|
1484 |
-
|
1485 |
-
## New Examples
|
1486 |
-
|
1487 |
-
- `cpp_integration`
|
1488 |
-
- `histogram`
|
1489 |
-
- `mode`
|
1490 |
-
- `monte_carlo`
|
1491 |
-
- `monte_carlo_disjoint_sequences`
|
1492 |
-
- `padded_grid_reduction`
|
1493 |
-
- `permutation_iterator`
|
1494 |
-
- `row_sum`
|
1495 |
-
- `run_length_encoding`
|
1496 |
-
- `segmented_scan`
|
1497 |
-
- `stream_compaction`
|
1498 |
-
- `summary_statistics`
|
1499 |
-
- `transform_iterator`
|
1500 |
-
- `word_count`
|
1501 |
-
|
1502 |
-
## Other Enhancements
|
1503 |
-
|
1504 |
-
- Integer sorting performance is improved when max is large but (max - min) is
|
1505 |
-
small and when min is negative
|
1506 |
-
- Performance of `thrust::inclusive_scan` and `thrust::exclusive_scan` is
|
1507 |
-
improved by 20-25% for primitive types.
|
1508 |
-
|
1509 |
-
## Bug Fixes
|
1510 |
-
|
1511 |
-
- #8 cause a compiler error if the required compiler is not found rather than a
|
1512 |
-
mysterious error at link time
|
1513 |
-
- #42 device_ptr & device_reference are classes rather than structs,
|
1514 |
-
eliminating warnings on certain platforms
|
1515 |
-
- #46 gather & scatter handle any space iterators correctly
|
1516 |
-
- #51 thrust::experimental::arch functions gracefully handle unrecognized GPUs
|
1517 |
-
- #52 avoid collisions with common user macros such as BLOCK_SIZE
|
1518 |
-
- #62 provide better documentation for device_reference
|
1519 |
-
- #68 allow built-in CUDA vector types to work with device_vector in pure C++
|
1520 |
-
mode
|
1521 |
-
- #102 eliminated a race condition in device_vector::erase
|
1522 |
-
- various compilation warnings eliminated
|
1523 |
-
|
1524 |
-
## Known Issues
|
1525 |
-
|
1526 |
-
- inclusive_scan & exclusive_scan may fail with very large types
|
1527 |
-
- MSVC may fail to compile code using both sort and binary search algorithms
|
1528 |
-
- uninitialized_fill & uninitialized_copy dispatch constructors on the host
|
1529 |
-
rather than the device
|
1530 |
-
- #109 some algorithms may exhibit poor performance with the OpenMP backend
|
1531 |
-
with large numbers (>= 6) of CPU threads
|
1532 |
-
- default_random_engine::discard is not accelerated with nvcc 2.3
|
1533 |
-
|
1534 |
-
## Acknowledgments
|
1535 |
-
|
1536 |
-
- Thanks to Gregory Diamos for contributing a CUDA implementation of
|
1537 |
-
set_intersection
|
1538 |
-
- Thanks to Ryuta Suzuki & Gregory Diamos for rigorously testing Thrust's unit
|
1539 |
-
tests and examples against Ocelot
|
1540 |
-
- Thanks to Tom Bradley for contributing an implementation of normal_distribution
|
1541 |
-
- Thanks to Joseph Rhoads for contributing the example summary_statistics
|
1542 |
-
|
1543 |
-
# Thrust 1.1.1
|
1544 |
-
|
1545 |
-
## Summary
|
1546 |
-
|
1547 |
-
Small fixes for compatibility with CUDA Toolkit 2.3a and Mac OSX Snow Leopard.
|
1548 |
-
|
1549 |
-
# Thrust 1.1.0
|
1550 |
-
|
1551 |
-
## Summary
|
1552 |
-
|
1553 |
-
Thrust 1.1.0 introduces fancy iterators, binary search functions, and several
|
1554 |
-
specialized reduction functions.
|
1555 |
-
Experimental support for segmented scans has also been added.
|
1556 |
-
|
1557 |
-
## Breaking Changes
|
1558 |
-
|
1559 |
-
- `thrust::counting_iterator` has been moved into the `thrust` namespace
|
1560 |
-
(previously `thrust::experimental`).
|
1561 |
-
|
1562 |
-
## New Features
|
1563 |
-
|
1564 |
-
- Algorithms:
|
1565 |
-
- `thrust::copy_if`
|
1566 |
-
- `thrust::lower_bound`
|
1567 |
-
- `thrust::upper_bound`
|
1568 |
-
- `thrust::vectorized lower_bound`
|
1569 |
-
- `thrust::vectorized upper_bound`
|
1570 |
-
- `thrust::equal_range`
|
1571 |
-
- `thrust::binary_search`
|
1572 |
-
- `thrust::vectorized binary_search`
|
1573 |
-
- `thrust::all_of`
|
1574 |
-
- `thrust::any_of`
|
1575 |
-
- `thrust::none_of`
|
1576 |
-
- `thrust::minmax_element`
|
1577 |
-
- `thrust::advance`
|
1578 |
-
- `thrust::inclusive_segmented_scan` (experimental)
|
1579 |
-
- `thrust::exclusive_segmented_scan` (experimental)
|
1580 |
-
- Types:
|
1581 |
-
- `thrust::pair`
|
1582 |
-
- `thrust::tuple`
|
1583 |
-
- `thrust::device_malloc_allocator`
|
1584 |
-
- Fancy Iterators:
|
1585 |
-
- `thrust::constant_iterator`
|
1586 |
-
- `thrust::counting_iterator`
|
1587 |
-
- `thrust::transform_iterator`
|
1588 |
-
- `thrust::zip_iterator`
|
1589 |
-
|
1590 |
-
## New Examples
|
1591 |
-
|
1592 |
-
- Computing the maximum absolute difference between vectors.
|
1593 |
-
- Computing the bounding box of a two-dimensional point set.
|
1594 |
-
- Sorting multiple arrays together (lexicographical sorting).
|
1595 |
-
- Constructing a summed area table.
|
1596 |
-
- Using `thrust::zip_iterator` to mimic an array of structs.
|
1597 |
-
- Using `thrust::constant_iterator` to increment array values.
|
1598 |
-
|
1599 |
-
## Other Enhancements
|
1600 |
-
|
1601 |
-
- Added pinned memory allocator (experimental).
|
1602 |
-
- Added more methods to host_vector & device_vector (issue #4).
|
1603 |
-
- Added variant of remove_if with a stencil argument (issue #29).
|
1604 |
-
- Scan and reduce use cudaFuncGetAttributes to determine grid size.
|
1605 |
-
- Exceptions are reported when temporary device arrays cannot be allocated.
|
1606 |
-
|
1607 |
-
## Bug Fixes
|
1608 |
-
|
1609 |
-
- #5: Make vector work for larger data types
|
1610 |
-
- #9: stable_partition_copy doesn't respect OutputIterator concept semantics
|
1611 |
-
- #10: scans should return OutputIterator
|
1612 |
-
- #16: make algorithms work for larger data types
|
1613 |
-
- #27: Dispatch radix_sort even when comp=less<T> is explicitly provided
|
1614 |
-
|
1615 |
-
## Known Issues
|
1616 |
-
|
1617 |
-
- Using functors with Thrust entry points may not compile on Mac OSX with gcc
|
1618 |
-
4.0.1.
|
1619 |
-
- `thrust::uninitialized_copy` and `thrust::uninitialized_fill` dispatch
|
1620 |
-
constructors on the host rather than the device.
|
1621 |
-
- `thrust::inclusive_scan`, `thrust::inclusive_scan_by_key`,
|
1622 |
-
`thrust::exclusive_scan`, and `thrust::exclusive_scan_by_key` may fail when
|
1623 |
-
used with large types with the CUDA Toolkit 3.1.
|
1624 |
-
|
1625 |
-
# Thrust 1.0.0
|
1626 |
-
|
1627 |
-
## Breaking Changes
|
1628 |
-
|
1629 |
-
- Rename top level namespace `komrade` to `thrust`.
|
1630 |
-
- Move `thrust::partition_copy` & `thrust::stable_partition_copy` into
|
1631 |
-
`thrust::experimental` namespace until we can easily provide the standard
|
1632 |
-
interface.
|
1633 |
-
- Rename `thrust::range` to `thrust::sequence` to avoid collision with
|
1634 |
-
Boost.Range.
|
1635 |
-
- Rename `thrust::copy_if` to `thrust::copy_when` due to semantic differences
|
1636 |
-
with C++0x `std::copy_if`.
|
1637 |
-
|
1638 |
-
## New Features
|
1639 |
-
|
1640 |
-
- Add C++0x style `cbegin` & `cend` methods to `thrust::host_vector` and
|
1641 |
-
`thrust::device_vector`.
|
1642 |
-
- Add `thrust::transform_if` function.
|
1643 |
-
- Add stencil versions of `thrust::replace_if` & `thrust::replace_copy_if`.
|
1644 |
-
- Allow `counting_iterator` to work with `thrust::for_each`.
|
1645 |
-
- Allow types with constructors in comparison `thrust::sort` and
|
1646 |
-
`thrust::reduce`.
|
1647 |
-
|
1648 |
-
## Other Enhancements
|
1649 |
-
|
1650 |
-
- `thrust::merge_sort` and `thrust::stable_merge_sort` are now 2x to 5x faster
|
1651 |
-
when executed on the parallel device.
|
1652 |
-
|
1653 |
-
## Bug Fixes
|
1654 |
-
|
1655 |
-
- Komrade 6: Workaround an issue where an incremented iterator causes NVCC to
|
1656 |
-
crash.
|
1657 |
-
- Komrade 7: Fix an issue where `const_iterator`s could not be passed to
|
1658 |
-
`thrust::transform`.
|
1659 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/LIVE/thrust/thrust/detail/config/cpp_compatibility.h
DELETED
@@ -1,94 +0,0 @@
|
|
1 |
-
/*
|
2 |
-
* Copyright 2008-2018 NVIDIA Corporation
|
3 |
-
*
|
4 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
-
* you may not use this file except in compliance with the License.
|
6 |
-
* You may obtain a copy of the License at
|
7 |
-
*
|
8 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
9 |
-
*
|
10 |
-
* Unless required by applicable law or agreed to in writing, software
|
11 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
-
* See the License for the specific language governing permissions and
|
14 |
-
* limitations under the License.
|
15 |
-
*/
|
16 |
-
|
17 |
-
#pragma once
|
18 |
-
|
19 |
-
#include <thrust/detail/config/cpp_dialect.h>
|
20 |
-
|
21 |
-
#include <cstddef>
|
22 |
-
|
23 |
-
#if THRUST_CPP_DIALECT >= 2011
|
24 |
-
# ifndef __has_cpp_attribute
|
25 |
-
# define __has_cpp_attribute(X) 0
|
26 |
-
# endif
|
27 |
-
|
28 |
-
# if __has_cpp_attribute(nodiscard)
|
29 |
-
# define THRUST_NODISCARD [[nodiscard]]
|
30 |
-
# endif
|
31 |
-
|
32 |
-
# define THRUST_CONSTEXPR constexpr
|
33 |
-
# define THRUST_OVERRIDE override
|
34 |
-
# define THRUST_DEFAULT = default;
|
35 |
-
# define THRUST_NOEXCEPT noexcept
|
36 |
-
# define THRUST_FINAL final
|
37 |
-
#else
|
38 |
-
# define THRUST_CONSTEXPR
|
39 |
-
# define THRUST_OVERRIDE
|
40 |
-
# define THRUST_DEFAULT {}
|
41 |
-
# define THRUST_NOEXCEPT throw()
|
42 |
-
# define THRUST_FINAL
|
43 |
-
#endif
|
44 |
-
|
45 |
-
#ifndef THRUST_NODISCARD
|
46 |
-
# define THRUST_NODISCARD
|
47 |
-
#endif
|
48 |
-
|
49 |
-
// FIXME: Combine THRUST_INLINE_CONSTANT and
|
50 |
-
// THRUST_INLINE_INTEGRAL_MEMBER_CONSTANT into one macro when NVCC properly
|
51 |
-
// supports `constexpr` globals in host and device code.
|
52 |
-
#if defined(__CUDA_ARCH__) || defined(__NVCOMPILER_CUDA__)
|
53 |
-
// FIXME: Add this when NVCC supports inline variables.
|
54 |
-
//# if THRUST_CPP_DIALECT >= 2017
|
55 |
-
//# define THRUST_INLINE_CONSTANT inline constexpr
|
56 |
-
//# define THRUST_INLINE_INTEGRAL_MEMBER_CONSTANT inline constexpr
|
57 |
-
# if THRUST_CPP_DIALECT >= 2011
|
58 |
-
# define THRUST_INLINE_CONSTANT static const __device__
|
59 |
-
# define THRUST_INLINE_INTEGRAL_MEMBER_CONSTANT static constexpr
|
60 |
-
# else
|
61 |
-
# define THRUST_INLINE_CONSTANT static const __device__
|
62 |
-
# define THRUST_INLINE_INTEGRAL_MEMBER_CONSTANT static const
|
63 |
-
# endif
|
64 |
-
#else
|
65 |
-
// FIXME: Add this when NVCC supports inline variables.
|
66 |
-
//# if THRUST_CPP_DIALECT >= 2017
|
67 |
-
//# define THRUST_INLINE_CONSTANT inline constexpr
|
68 |
-
//# define THRUST_INLINE_INTEGRAL_MEMBER_CONSTANT inline constexpr
|
69 |
-
# if THRUST_CPP_DIALECT >= 2011
|
70 |
-
# define THRUST_INLINE_CONSTANT static constexpr
|
71 |
-
# define THRUST_INLINE_INTEGRAL_MEMBER_CONSTANT static constexpr
|
72 |
-
# else
|
73 |
-
# define THRUST_INLINE_CONSTANT static const
|
74 |
-
# define THRUST_INLINE_INTEGRAL_MEMBER_CONSTANT static const
|
75 |
-
# endif
|
76 |
-
#endif
|
77 |
-
|
78 |
-
#if defined(__NVCOMPILER_CUDA__)
|
79 |
-
# define THRUST_IS_DEVICE_CODE __builtin_is_device_code()
|
80 |
-
# define THRUST_IS_HOST_CODE (!__builtin_is_device_code())
|
81 |
-
# define THRUST_INCLUDE_DEVICE_CODE 1
|
82 |
-
# define THRUST_INCLUDE_HOST_CODE 1
|
83 |
-
#elif defined(__CUDA_ARCH__)
|
84 |
-
# define THRUST_IS_DEVICE_CODE 1
|
85 |
-
# define THRUST_IS_HOST_CODE 0
|
86 |
-
# define THRUST_INCLUDE_DEVICE_CODE 1
|
87 |
-
# define THRUST_INCLUDE_HOST_CODE 0
|
88 |
-
#else
|
89 |
-
# define THRUST_IS_DEVICE_CODE 0
|
90 |
-
# define THRUST_IS_HOST_CODE 1
|
91 |
-
# define THRUST_INCLUDE_DEVICE_CODE 0
|
92 |
-
# define THRUST_INCLUDE_HOST_CODE 1
|
93 |
-
#endif
|
94 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/LIVE/thrust/thrust/system/tbb/detail/remove.h
DELETED
@@ -1,81 +0,0 @@
|
|
1 |
-
/*
|
2 |
-
* Copyright 2008-2013 NVIDIA Corporation
|
3 |
-
*
|
4 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
-
* you may not use this file except in compliance with the License.
|
6 |
-
* You may obtain a copy of the License at
|
7 |
-
*
|
8 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
9 |
-
*
|
10 |
-
* Unless required by applicable law or agreed to in writing, software
|
11 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
-
* See the License for the specific language governing permissions and
|
14 |
-
* limitations under the License.
|
15 |
-
*/
|
16 |
-
|
17 |
-
#pragma once
|
18 |
-
|
19 |
-
#include <thrust/detail/config.h>
|
20 |
-
#include <thrust/system/omp/detail/execution_policy.h>
|
21 |
-
|
22 |
-
namespace thrust
|
23 |
-
{
|
24 |
-
namespace system
|
25 |
-
{
|
26 |
-
namespace omp
|
27 |
-
{
|
28 |
-
namespace detail
|
29 |
-
{
|
30 |
-
|
31 |
-
template<typename ExecutionPolicy,
|
32 |
-
typename ForwardIterator,
|
33 |
-
typename Predicate>
|
34 |
-
ForwardIterator remove_if(execution_policy<ExecutionPolicy> &exec,
|
35 |
-
ForwardIterator first,
|
36 |
-
ForwardIterator last,
|
37 |
-
Predicate pred);
|
38 |
-
|
39 |
-
|
40 |
-
template<typename ExecutionPolicy,
|
41 |
-
typename ForwardIterator,
|
42 |
-
typename InputIterator,
|
43 |
-
typename Predicate>
|
44 |
-
ForwardIterator remove_if(execution_policy<ExecutionPolicy> &exec,
|
45 |
-
ForwardIterator first,
|
46 |
-
ForwardIterator last,
|
47 |
-
InputIterator stencil,
|
48 |
-
Predicate pred);
|
49 |
-
|
50 |
-
|
51 |
-
template<typename ExecutionPolicy,
|
52 |
-
typename InputIterator,
|
53 |
-
typename OutputIterator,
|
54 |
-
typename Predicate>
|
55 |
-
OutputIterator remove_copy_if(execution_policy<ExecutionPolicy> &exec,
|
56 |
-
InputIterator first,
|
57 |
-
InputIterator last,
|
58 |
-
OutputIterator result,
|
59 |
-
Predicate pred);
|
60 |
-
|
61 |
-
|
62 |
-
template<typename ExecutionPolicy,
|
63 |
-
typename InputIterator1,
|
64 |
-
typename InputIterator2,
|
65 |
-
typename OutputIterator,
|
66 |
-
typename Predicate>
|
67 |
-
OutputIterator remove_copy_if(execution_policy<ExecutionPolicy> &exec,
|
68 |
-
InputIterator1 first,
|
69 |
-
InputIterator1 last,
|
70 |
-
InputIterator2 stencil,
|
71 |
-
OutputIterator result,
|
72 |
-
Predicate pred);
|
73 |
-
|
74 |
-
|
75 |
-
} // end namespace detail
|
76 |
-
} // end namespace omp
|
77 |
-
} // end namespace system
|
78 |
-
} // end namespace thrust
|
79 |
-
|
80 |
-
#include <thrust/system/tbb/detail/remove.inl>
|
81 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/WALT/mmdet/models/roi_heads/mask_heads/coarse_mask_head.py
DELETED
@@ -1,91 +0,0 @@
|
|
1 |
-
import torch.nn as nn
|
2 |
-
from mmcv.cnn import ConvModule, Linear, constant_init, xavier_init
|
3 |
-
from mmcv.runner import auto_fp16
|
4 |
-
|
5 |
-
from mmdet.models.builder import HEADS
|
6 |
-
from .fcn_mask_head import FCNMaskHead
|
7 |
-
|
8 |
-
|
9 |
-
@HEADS.register_module()
|
10 |
-
class CoarseMaskHead(FCNMaskHead):
|
11 |
-
"""Coarse mask head used in PointRend.
|
12 |
-
|
13 |
-
Compared with standard ``FCNMaskHead``, ``CoarseMaskHead`` will downsample
|
14 |
-
the input feature map instead of upsample it.
|
15 |
-
|
16 |
-
Args:
|
17 |
-
num_convs (int): Number of conv layers in the head. Default: 0.
|
18 |
-
num_fcs (int): Number of fc layers in the head. Default: 2.
|
19 |
-
fc_out_channels (int): Number of output channels of fc layer.
|
20 |
-
Default: 1024.
|
21 |
-
downsample_factor (int): The factor that feature map is downsampled by.
|
22 |
-
Default: 2.
|
23 |
-
"""
|
24 |
-
|
25 |
-
def __init__(self,
|
26 |
-
num_convs=0,
|
27 |
-
num_fcs=2,
|
28 |
-
fc_out_channels=1024,
|
29 |
-
downsample_factor=2,
|
30 |
-
*arg,
|
31 |
-
**kwarg):
|
32 |
-
super(CoarseMaskHead, self).__init__(
|
33 |
-
*arg, num_convs=num_convs, upsample_cfg=dict(type=None), **kwarg)
|
34 |
-
self.num_fcs = num_fcs
|
35 |
-
assert self.num_fcs > 0
|
36 |
-
self.fc_out_channels = fc_out_channels
|
37 |
-
self.downsample_factor = downsample_factor
|
38 |
-
assert self.downsample_factor >= 1
|
39 |
-
# remove conv_logit
|
40 |
-
delattr(self, 'conv_logits')
|
41 |
-
|
42 |
-
if downsample_factor > 1:
|
43 |
-
downsample_in_channels = (
|
44 |
-
self.conv_out_channels
|
45 |
-
if self.num_convs > 0 else self.in_channels)
|
46 |
-
self.downsample_conv = ConvModule(
|
47 |
-
downsample_in_channels,
|
48 |
-
self.conv_out_channels,
|
49 |
-
kernel_size=downsample_factor,
|
50 |
-
stride=downsample_factor,
|
51 |
-
padding=0,
|
52 |
-
conv_cfg=self.conv_cfg,
|
53 |
-
norm_cfg=self.norm_cfg)
|
54 |
-
else:
|
55 |
-
self.downsample_conv = None
|
56 |
-
|
57 |
-
self.output_size = (self.roi_feat_size[0] // downsample_factor,
|
58 |
-
self.roi_feat_size[1] // downsample_factor)
|
59 |
-
self.output_area = self.output_size[0] * self.output_size[1]
|
60 |
-
|
61 |
-
last_layer_dim = self.conv_out_channels * self.output_area
|
62 |
-
|
63 |
-
self.fcs = nn.ModuleList()
|
64 |
-
for i in range(num_fcs):
|
65 |
-
fc_in_channels = (
|
66 |
-
last_layer_dim if i == 0 else self.fc_out_channels)
|
67 |
-
self.fcs.append(Linear(fc_in_channels, self.fc_out_channels))
|
68 |
-
last_layer_dim = self.fc_out_channels
|
69 |
-
output_channels = self.num_classes * self.output_area
|
70 |
-
self.fc_logits = Linear(last_layer_dim, output_channels)
|
71 |
-
|
72 |
-
def init_weights(self):
|
73 |
-
for m in self.fcs.modules():
|
74 |
-
if isinstance(m, nn.Linear):
|
75 |
-
xavier_init(m)
|
76 |
-
constant_init(self.fc_logits, 0.001)
|
77 |
-
|
78 |
-
@auto_fp16()
|
79 |
-
def forward(self, x):
|
80 |
-
for conv in self.convs:
|
81 |
-
x = conv(x)
|
82 |
-
|
83 |
-
if self.downsample_conv is not None:
|
84 |
-
x = self.downsample_conv(x)
|
85 |
-
|
86 |
-
x = x.flatten(1)
|
87 |
-
for fc in self.fcs:
|
88 |
-
x = self.relu(fc(x))
|
89 |
-
mask_pred = self.fc_logits(x).view(
|
90 |
-
x.size(0), self.num_classes, *self.output_size)
|
91 |
-
return mask_pred
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/ChallengeHub/Chinese-LangChain/app_modules/overwrites.py
DELETED
@@ -1,49 +0,0 @@
|
|
1 |
-
from __future__ import annotations
|
2 |
-
|
3 |
-
from typing import List, Tuple
|
4 |
-
|
5 |
-
from app_modules.utils import *
|
6 |
-
|
7 |
-
|
8 |
-
def postprocess(
|
9 |
-
self, y: List[Tuple[str | None, str | None]]
|
10 |
-
) -> List[Tuple[str | None, str | None]]:
|
11 |
-
"""
|
12 |
-
Parameters:
|
13 |
-
y: List of tuples representing the message and response pairs. Each message and response should be a string, which may be in Markdown format.
|
14 |
-
Returns:
|
15 |
-
List of tuples representing the message and response. Each message and response will be a string of HTML.
|
16 |
-
"""
|
17 |
-
if y is None or y == []:
|
18 |
-
return []
|
19 |
-
temp = []
|
20 |
-
for x in y:
|
21 |
-
user, bot = x
|
22 |
-
if not detect_converted_mark(user):
|
23 |
-
user = convert_asis(user)
|
24 |
-
if not detect_converted_mark(bot):
|
25 |
-
bot = convert_mdtext(bot)
|
26 |
-
temp.append((user, bot))
|
27 |
-
return temp
|
28 |
-
|
29 |
-
|
30 |
-
with open("./assets/custom.js", "r", encoding="utf-8") as f, open("./assets/Kelpy-Codos.js", "r",
|
31 |
-
encoding="utf-8") as f2:
|
32 |
-
customJS = f.read()
|
33 |
-
kelpyCodos = f2.read()
|
34 |
-
|
35 |
-
|
36 |
-
def reload_javascript():
|
37 |
-
print("Reloading javascript...")
|
38 |
-
js = f'<script>{customJS}</script><script>{kelpyCodos}</script>'
|
39 |
-
|
40 |
-
def template_response(*args, **kwargs):
|
41 |
-
res = GradioTemplateResponseOriginal(*args, **kwargs)
|
42 |
-
res.body = res.body.replace(b'</html>', f'{js}</html>'.encode("utf8"))
|
43 |
-
res.init_headers()
|
44 |
-
return res
|
45 |
-
|
46 |
-
gr.routes.templates.TemplateResponse = template_response
|
47 |
-
|
48 |
-
|
49 |
-
GradioTemplateResponseOriginal = gr.routes.templates.TemplateResponse
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CofAI/optor/style.css
DELETED
@@ -1,28 +0,0 @@
|
|
1 |
-
body {
|
2 |
-
padding: 2rem;
|
3 |
-
font-family: -apple-system, BlinkMacSystemFont, "Arial", sans-serif;
|
4 |
-
}
|
5 |
-
|
6 |
-
h1 {
|
7 |
-
font-size: 16px;
|
8 |
-
margin-top: 0;
|
9 |
-
}
|
10 |
-
|
11 |
-
p {
|
12 |
-
color: rgb(107, 114, 128);
|
13 |
-
font-size: 15px;
|
14 |
-
margin-bottom: 10px;
|
15 |
-
margin-top: 5px;
|
16 |
-
}
|
17 |
-
|
18 |
-
.card {
|
19 |
-
max-width: 620px;
|
20 |
-
margin: 0 auto;
|
21 |
-
padding: 16px;
|
22 |
-
border: 1px solid lightgray;
|
23 |
-
border-radius: 16px;
|
24 |
-
}
|
25 |
-
|
26 |
-
.card p:last-child {
|
27 |
-
margin-bottom: 0;
|
28 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/DQChoi/gpt-demo/venv/lib/python3.11/site-packages/fontTools/help.py
DELETED
@@ -1,35 +0,0 @@
|
|
1 |
-
import pkgutil
|
2 |
-
import sys
|
3 |
-
import fontTools
|
4 |
-
import importlib
|
5 |
-
import os
|
6 |
-
from pathlib import Path
|
7 |
-
|
8 |
-
|
9 |
-
def main():
|
10 |
-
"""Show this help"""
|
11 |
-
path = fontTools.__path__
|
12 |
-
descriptions = {}
|
13 |
-
for pkg in sorted(
|
14 |
-
mod.name
|
15 |
-
for mod in pkgutil.walk_packages([fontTools.__path__[0]], prefix="fontTools.")
|
16 |
-
):
|
17 |
-
try:
|
18 |
-
imports = __import__(pkg, globals(), locals(), ["main"])
|
19 |
-
except ImportError as e:
|
20 |
-
continue
|
21 |
-
try:
|
22 |
-
description = imports.main.__doc__
|
23 |
-
if description:
|
24 |
-
pkg = pkg.replace("fontTools.", "").replace(".__main__", "")
|
25 |
-
# show the docstring's first line only
|
26 |
-
descriptions[pkg] = description.splitlines()[0]
|
27 |
-
except AttributeError as e:
|
28 |
-
pass
|
29 |
-
for pkg, description in descriptions.items():
|
30 |
-
print("fonttools %-12s %s" % (pkg, description), file=sys.stderr)
|
31 |
-
|
32 |
-
|
33 |
-
if __name__ == "__main__":
|
34 |
-
print("fonttools v%s\n" % fontTools.__version__, file=sys.stderr)
|
35 |
-
main()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/DQChoi/gpt-demo/venv/lib/python3.11/site-packages/huggingface_hub/_commit_scheduler.py
DELETED
@@ -1,318 +0,0 @@
|
|
1 |
-
import atexit
|
2 |
-
import logging
|
3 |
-
import os
|
4 |
-
import time
|
5 |
-
from concurrent.futures import Future
|
6 |
-
from dataclasses import dataclass
|
7 |
-
from io import SEEK_END, SEEK_SET, BytesIO
|
8 |
-
from pathlib import Path
|
9 |
-
from threading import Lock, Thread
|
10 |
-
from typing import Dict, List, Optional, Union
|
11 |
-
|
12 |
-
from .hf_api import IGNORE_GIT_FOLDER_PATTERNS, CommitInfo, CommitOperationAdd, HfApi
|
13 |
-
from .utils import filter_repo_objects
|
14 |
-
|
15 |
-
|
16 |
-
logger = logging.getLogger(__name__)
|
17 |
-
|
18 |
-
|
19 |
-
@dataclass(frozen=True)
|
20 |
-
class _FileToUpload:
|
21 |
-
"""Temporary dataclass to store info about files to upload. Not meant to be used directly."""
|
22 |
-
|
23 |
-
local_path: Path
|
24 |
-
path_in_repo: str
|
25 |
-
size_limit: int
|
26 |
-
last_modified: float
|
27 |
-
|
28 |
-
|
29 |
-
class CommitScheduler:
|
30 |
-
"""
|
31 |
-
Scheduler to upload a local folder to the Hub at regular intervals (e.g. push to hub every 5 minutes).
|
32 |
-
|
33 |
-
The scheduler is started when instantiated and run indefinitely. At the end of your script, a last commit is
|
34 |
-
triggered. Checkout the [upload guide](https://huggingface.co/docs/huggingface_hub/guides/upload#scheduled-uploads)
|
35 |
-
to learn more about how to use it.
|
36 |
-
|
37 |
-
Args:
|
38 |
-
repo_id (`str`):
|
39 |
-
The id of the repo to commit to.
|
40 |
-
folder_path (`str` or `Path`):
|
41 |
-
Path to the local folder to upload regularly.
|
42 |
-
every (`int` or `float`, *optional*):
|
43 |
-
The number of minutes between each commit. Defaults to 5 minutes.
|
44 |
-
path_in_repo (`str`, *optional*):
|
45 |
-
Relative path of the directory in the repo, for example: `"checkpoints/"`. Defaults to the root folder
|
46 |
-
of the repository.
|
47 |
-
repo_type (`str`, *optional*):
|
48 |
-
The type of the repo to commit to. Defaults to `model`.
|
49 |
-
revision (`str`, *optional*):
|
50 |
-
The revision of the repo to commit to. Defaults to `main`.
|
51 |
-
private (`bool`, *optional*):
|
52 |
-
Whether to make the repo private. Defaults to `False`. This value is ignored if the repo already exist.
|
53 |
-
token (`str`, *optional*):
|
54 |
-
The token to use to commit to the repo. Defaults to the token saved on the machine.
|
55 |
-
allow_patterns (`List[str]` or `str`, *optional*):
|
56 |
-
If provided, only files matching at least one pattern are uploaded.
|
57 |
-
ignore_patterns (`List[str]` or `str`, *optional*):
|
58 |
-
If provided, files matching any of the patterns are not uploaded.
|
59 |
-
hf_api (`HfApi`, *optional*):
|
60 |
-
The [`HfApi`] client to use to commit to the Hub. Can be set with custom settings (user agent, token,...).
|
61 |
-
|
62 |
-
Example:
|
63 |
-
```py
|
64 |
-
>>> from pathlib import Path
|
65 |
-
>>> from huggingface_hub import CommitScheduler
|
66 |
-
|
67 |
-
# Scheduler uploads every 10 minutes
|
68 |
-
>>> csv_path = Path("watched_folder/data.csv")
|
69 |
-
>>> CommitScheduler(repo_id="test_scheduler", repo_type="dataset", folder_path=csv_path.parent, every=10)
|
70 |
-
|
71 |
-
>>> with csv_path.open("a") as f:
|
72 |
-
... f.write("first line")
|
73 |
-
|
74 |
-
# Some time later (...)
|
75 |
-
>>> with csv_path.open("a") as f:
|
76 |
-
... f.write("second line")
|
77 |
-
```
|
78 |
-
"""
|
79 |
-
|
80 |
-
def __init__(
|
81 |
-
self,
|
82 |
-
*,
|
83 |
-
repo_id: str,
|
84 |
-
folder_path: Union[str, Path],
|
85 |
-
every: Union[int, float] = 5,
|
86 |
-
path_in_repo: Optional[str] = None,
|
87 |
-
repo_type: Optional[str] = None,
|
88 |
-
revision: Optional[str] = None,
|
89 |
-
private: bool = False,
|
90 |
-
token: Optional[str] = None,
|
91 |
-
allow_patterns: Optional[Union[List[str], str]] = None,
|
92 |
-
ignore_patterns: Optional[Union[List[str], str]] = None,
|
93 |
-
hf_api: Optional["HfApi"] = None,
|
94 |
-
) -> None:
|
95 |
-
self.api = hf_api or HfApi(token=token)
|
96 |
-
|
97 |
-
# Folder
|
98 |
-
self.folder_path = Path(folder_path).expanduser().resolve()
|
99 |
-
self.path_in_repo = path_in_repo or ""
|
100 |
-
self.allow_patterns = allow_patterns
|
101 |
-
|
102 |
-
if ignore_patterns is None:
|
103 |
-
ignore_patterns = []
|
104 |
-
elif isinstance(ignore_patterns, str):
|
105 |
-
ignore_patterns = [ignore_patterns]
|
106 |
-
self.ignore_patterns = ignore_patterns + IGNORE_GIT_FOLDER_PATTERNS
|
107 |
-
|
108 |
-
if self.folder_path.is_file():
|
109 |
-
raise ValueError(f"'folder_path' must be a directory, not a file: '{self.folder_path}'.")
|
110 |
-
self.folder_path.mkdir(parents=True, exist_ok=True)
|
111 |
-
|
112 |
-
# Repository
|
113 |
-
repo_url = self.api.create_repo(repo_id=repo_id, private=private, repo_type=repo_type, exist_ok=True)
|
114 |
-
self.repo_id = repo_url.repo_id
|
115 |
-
self.repo_type = repo_type
|
116 |
-
self.revision = revision
|
117 |
-
self.token = token
|
118 |
-
|
119 |
-
# Keep track of already uploaded files
|
120 |
-
self.last_uploaded: Dict[Path, float] = {} # key is local path, value is timestamp
|
121 |
-
|
122 |
-
# Scheduler
|
123 |
-
if not every > 0:
|
124 |
-
raise ValueError(f"'every' must be a positive integer, not '{every}'.")
|
125 |
-
self.lock = Lock()
|
126 |
-
self.every = every
|
127 |
-
|
128 |
-
logger.info(f"Scheduled job to push '{self.folder_path}' to '{self.repo_id}' every {self.every} minutes.")
|
129 |
-
self._scheduler_thread = Thread(target=self._run_scheduler, daemon=True)
|
130 |
-
self._scheduler_thread.start()
|
131 |
-
atexit.register(self._push_to_hub)
|
132 |
-
|
133 |
-
self.__stopped = False
|
134 |
-
|
135 |
-
def stop(self) -> None:
|
136 |
-
"""Stop the scheduler.
|
137 |
-
|
138 |
-
A stopped scheduler cannot be restarted. Mostly for tests purposes.
|
139 |
-
"""
|
140 |
-
self.__stopped = True
|
141 |
-
|
142 |
-
def _run_scheduler(self) -> None:
|
143 |
-
"""Dumb thread waiting between each scheduled push to Hub."""
|
144 |
-
while True:
|
145 |
-
self.last_future = self.trigger()
|
146 |
-
time.sleep(self.every * 60)
|
147 |
-
if self.__stopped:
|
148 |
-
break
|
149 |
-
|
150 |
-
def trigger(self) -> Future:
|
151 |
-
"""Trigger a `push_to_hub` and return a future.
|
152 |
-
|
153 |
-
This method is automatically called every `every` minutes. You can also call it manually to trigger a commit
|
154 |
-
immediately, without waiting for the next scheduled commit.
|
155 |
-
"""
|
156 |
-
return self.api.run_as_future(self._push_to_hub)
|
157 |
-
|
158 |
-
def _push_to_hub(self) -> Optional[CommitInfo]:
|
159 |
-
if self.__stopped: # If stopped, already scheduled commits are ignored
|
160 |
-
return None
|
161 |
-
|
162 |
-
logger.info("(Background) scheduled commit triggered.")
|
163 |
-
try:
|
164 |
-
return self.push_to_hub()
|
165 |
-
except Exception as e:
|
166 |
-
logger.error(f"Error while pushing to Hub: {e}") # Depending on the setup, error might be silenced
|
167 |
-
raise
|
168 |
-
|
169 |
-
def push_to_hub(self) -> Optional[CommitInfo]:
|
170 |
-
"""
|
171 |
-
Push folder to the Hub and return the commit info.
|
172 |
-
|
173 |
-
<Tip warning={true}>
|
174 |
-
|
175 |
-
This method is not meant to be called directly. It is run in the background by the scheduler, respecting a
|
176 |
-
queue mechanism to avoid concurrent commits. Making a direct call to the method might lead to concurrency
|
177 |
-
issues.
|
178 |
-
|
179 |
-
</Tip>
|
180 |
-
|
181 |
-
The default behavior of `push_to_hub` is to assume an append-only folder. It lists all files in the folder and
|
182 |
-
uploads only changed files. If no changes are found, the method returns without committing anything. If you want
|
183 |
-
to change this behavior, you can inherit from [`CommitScheduler`] and override this method. This can be useful
|
184 |
-
for example to compress data together in a single file before committing. For more details and examples, check
|
185 |
-
out our [integration guide](https://huggingface.co/docs/huggingface_hub/main/en/guides/upload#scheduled-uploads).
|
186 |
-
"""
|
187 |
-
# Check files to upload (with lock)
|
188 |
-
with self.lock:
|
189 |
-
logger.debug("Listing files to upload for scheduled commit.")
|
190 |
-
|
191 |
-
# List files from folder (taken from `_prepare_upload_folder_additions`)
|
192 |
-
relpath_to_abspath = {
|
193 |
-
path.relative_to(self.folder_path).as_posix(): path
|
194 |
-
for path in sorted(self.folder_path.glob("**/*")) # sorted to be deterministic
|
195 |
-
if path.is_file()
|
196 |
-
}
|
197 |
-
prefix = f"{self.path_in_repo.strip('/')}/" if self.path_in_repo else ""
|
198 |
-
|
199 |
-
# Filter with pattern + filter out unchanged files + retrieve current file size
|
200 |
-
files_to_upload: List[_FileToUpload] = []
|
201 |
-
for relpath in filter_repo_objects(
|
202 |
-
relpath_to_abspath.keys(), allow_patterns=self.allow_patterns, ignore_patterns=self.ignore_patterns
|
203 |
-
):
|
204 |
-
local_path = relpath_to_abspath[relpath]
|
205 |
-
stat = local_path.stat()
|
206 |
-
if self.last_uploaded.get(local_path) is None or self.last_uploaded[local_path] != stat.st_mtime:
|
207 |
-
files_to_upload.append(
|
208 |
-
_FileToUpload(
|
209 |
-
local_path=local_path,
|
210 |
-
path_in_repo=prefix + relpath,
|
211 |
-
size_limit=stat.st_size,
|
212 |
-
last_modified=stat.st_mtime,
|
213 |
-
)
|
214 |
-
)
|
215 |
-
|
216 |
-
# Return if nothing to upload
|
217 |
-
if len(files_to_upload) == 0:
|
218 |
-
logger.debug("Dropping schedule commit: no changed file to upload.")
|
219 |
-
return None
|
220 |
-
|
221 |
-
# Convert `_FileToUpload` as `CommitOperationAdd` (=> compute file shas + limit to file size)
|
222 |
-
logger.debug("Removing unchanged files since previous scheduled commit.")
|
223 |
-
add_operations = [
|
224 |
-
CommitOperationAdd(
|
225 |
-
# Cap the file to its current size, even if the user append data to it while a scheduled commit is happening
|
226 |
-
path_or_fileobj=PartialFileIO(file_to_upload.local_path, size_limit=file_to_upload.size_limit),
|
227 |
-
path_in_repo=file_to_upload.path_in_repo,
|
228 |
-
)
|
229 |
-
for file_to_upload in files_to_upload
|
230 |
-
]
|
231 |
-
|
232 |
-
# Upload files (append mode expected - no need for lock)
|
233 |
-
logger.debug("Uploading files for scheduled commit.")
|
234 |
-
commit_info = self.api.create_commit(
|
235 |
-
repo_id=self.repo_id,
|
236 |
-
repo_type=self.repo_type,
|
237 |
-
operations=add_operations,
|
238 |
-
commit_message="Scheduled Commit",
|
239 |
-
revision=self.revision,
|
240 |
-
)
|
241 |
-
|
242 |
-
# Successful commit: keep track of the latest "last_modified" for each file
|
243 |
-
for file in files_to_upload:
|
244 |
-
self.last_uploaded[file.local_path] = file.last_modified
|
245 |
-
return commit_info
|
246 |
-
|
247 |
-
|
248 |
-
class PartialFileIO(BytesIO):
|
249 |
-
"""A file-like object that reads only the first part of a file.
|
250 |
-
|
251 |
-
Useful to upload a file to the Hub when the user might still be appending data to it. Only the first part of the
|
252 |
-
file is uploaded (i.e. the part that was available when the filesystem was first scanned).
|
253 |
-
|
254 |
-
In practice, only used internally by the CommitScheduler to regularly push a folder to the Hub with minimal
|
255 |
-
disturbance for the user. The object is passed to `CommitOperationAdd`.
|
256 |
-
|
257 |
-
Only supports `read`, `tell` and `seek` methods.
|
258 |
-
|
259 |
-
Args:
|
260 |
-
file_path (`str` or `Path`):
|
261 |
-
Path to the file to read.
|
262 |
-
size_limit (`int`):
|
263 |
-
The maximum number of bytes to read from the file. If the file is larger than this, only the first part
|
264 |
-
will be read (and uploaded).
|
265 |
-
"""
|
266 |
-
|
267 |
-
def __init__(self, file_path: Union[str, Path], size_limit: int) -> None:
|
268 |
-
self._file_path = Path(file_path)
|
269 |
-
self._file = self._file_path.open("rb")
|
270 |
-
self._size_limit = min(size_limit, os.fstat(self._file.fileno()).st_size)
|
271 |
-
|
272 |
-
def __del__(self) -> None:
|
273 |
-
self._file.close()
|
274 |
-
return super().__del__()
|
275 |
-
|
276 |
-
def __repr__(self) -> str:
|
277 |
-
return f"<PartialFileIO file_path={self._file_path} size_limit={self._size_limit}>"
|
278 |
-
|
279 |
-
def __len__(self) -> int:
|
280 |
-
return self._size_limit
|
281 |
-
|
282 |
-
def __getattribute__(self, name: str):
|
283 |
-
if name.startswith("_") or name in ("read", "tell", "seek"): # only 3 public methods supported
|
284 |
-
return super().__getattribute__(name)
|
285 |
-
raise NotImplementedError(f"PartialFileIO does not support '{name}'.")
|
286 |
-
|
287 |
-
def tell(self) -> int:
|
288 |
-
"""Return the current file position."""
|
289 |
-
return self._file.tell()
|
290 |
-
|
291 |
-
def seek(self, __offset: int, __whence: int = SEEK_SET) -> int:
|
292 |
-
"""Change the stream position to the given offset.
|
293 |
-
|
294 |
-
Behavior is the same as a regular file, except that the position is capped to the size limit.
|
295 |
-
"""
|
296 |
-
if __whence == SEEK_END:
|
297 |
-
# SEEK_END => set from the truncated end
|
298 |
-
__offset = len(self) + __offset
|
299 |
-
__whence = SEEK_SET
|
300 |
-
|
301 |
-
pos = self._file.seek(__offset, __whence)
|
302 |
-
if pos > self._size_limit:
|
303 |
-
return self._file.seek(self._size_limit)
|
304 |
-
return pos
|
305 |
-
|
306 |
-
def read(self, __size: Optional[int] = -1) -> bytes:
|
307 |
-
"""Read at most `__size` bytes from the file.
|
308 |
-
|
309 |
-
Behavior is the same as a regular file, except that it is capped to the size limit.
|
310 |
-
"""
|
311 |
-
current = self._file.tell()
|
312 |
-
if __size is None or __size < 0:
|
313 |
-
# Read until file limit
|
314 |
-
truncated_size = self._size_limit - current
|
315 |
-
else:
|
316 |
-
# Read until file limit or __size
|
317 |
-
truncated_size = min(__size, self._size_limit - current)
|
318 |
-
return self._file.read(truncated_size)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Dabs/UlamSpiral/README.md
DELETED
@@ -1,11 +0,0 @@
|
|
1 |
-
---
|
2 |
-
title: UlamSpiral
|
3 |
-
emoji: 🐨
|
4 |
-
colorFrom: indigo
|
5 |
-
colorTo: red
|
6 |
-
sdk: gradio
|
7 |
-
app_file: app.py
|
8 |
-
pinned: false
|
9 |
-
---
|
10 |
-
|
11 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces#reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|