parquet-converter commited on
Commit
b00b764
·
1 Parent(s): f6e189b

Update parquet files (step 49 of 476)

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. spaces/101-5/gpt4free/g4f/.v1/gui/streamlit_app.py +0 -52
  2. spaces/1acneusushi/gradio-2dmoleculeeditor/data/((TOP)) Free Windows 11.md +0 -41
  3. spaces/1acneusushi/gradio-2dmoleculeeditor/data/Geant 2500hd probleme boot Le guide complet pour le dbloquer.md +0 -126
  4. spaces/1line/AutoGPT/autogpt/agent/agent.py +0 -197
  5. spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Bus Simulator Ultimate The Ultimate Guide to Modding Your Game.md +0 -158
  6. spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Download GTA Liberty City Stories APK and Obb Data - Streamlined Missions and Enhanced Graphics.md +0 -138
  7. spaces/1phancelerku/anime-remove-background/FateGrand Order PC How to Install and Play the Epic RPG on Your Computer.md +0 -235
  8. spaces/2-2/blockchain.ai/README.md +0 -10
  9. spaces/2023Liu2023/bingo/src/pages/api/healthz.ts +0 -7
  10. spaces/656-156/Real-CUGAN/app.py +0 -62
  11. spaces/801artistry/RVC801/infer/lib/uvr5_pack/lib_v5/spec_utils.py +0 -672
  12. spaces/A666sxr/Genshin_TTS/stft_loss.py +0 -136
  13. spaces/AIFILMS/audioldm-text-to-audio-generation/audioldm/variational_autoencoder/autoencoder.py +0 -102
  14. spaces/ALSv/FSW/roop/typing.py +0 -7
  15. spaces/AQaTaHaGoD/GoD/README.md +0 -12
  16. spaces/ATang0729/Forecast4Muses/Model/Model6/Model6_2_ProfileRecogition/mmpretrain/configs/_base_/models/resnest200.py +0 -25
  17. spaces/Abhaykoul/Youtube_video_downloader/app.py +0 -59
  18. spaces/Amrrs/DragGan-Inversion/stylegan_human/openpose/src/util.py +0 -106
  19. spaces/Amrrs/DragGan-Inversion/torch_utils/ops/filtered_lrelu.cpp +0 -300
  20. spaces/Andy1621/uniformer_image_detection/configs/gn+ws/README.md +0 -44
  21. spaces/Andy1621/uniformer_image_detection/configs/regnet/mask_rcnn_regnetx-12GF_fpn_1x_coco.py +0 -16
  22. spaces/Andy1621/uniformer_image_detection/mmdet/models/detectors/fcos.py +0 -17
  23. spaces/Andy1621/uniformer_image_segmentation/configs/_base_/models/deeplabv3_unet_s5-d16.py +0 -50
  24. spaces/AnimalEquality/chatbot/lv_recipe_chatbot/__init__.py +0 -1
  25. spaces/Anonymous-sub/Rerender/ControlNet/gradio_depth2image.py +0 -98
  26. spaces/Ariharasudhan/YoloV5/utils/docker/Dockerfile +0 -65
  27. spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/dotenv/variables.py +0 -86
  28. spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/packaging/_manylinux.py +0 -301
  29. spaces/Audio-AGI/AudioSep/models/CLAP/training/logger.py +0 -30
  30. spaces/Audio-AGI/WavJourney/scripts/download_models.py +0 -32
  31. spaces/Benson/text-generation/Examples/Cmo Conseguir Sobre l Mod Apk Descarga Apkpure.md +0 -33
  32. spaces/Benson/text-generation/Examples/Descargar Archivo Pdf De 1 Mb.md +0 -159
  33. spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_vendor/packaging/__about__.py +0 -26
  34. spaces/Big-Web/MMSD/env/Lib/site-packages/setuptools/installer.py +0 -104
  35. spaces/Blealtan/clip-guided-binary-autoencoder/README.md +0 -13
  36. spaces/CVPR/Dual-Key_Backdoor_Attacks/datagen/detectron2/docs/Makefile +0 -19
  37. spaces/CVPR/LIVE/pybind11/pybind11/_version.py +0 -3
  38. spaces/CVPR/LIVE/thrust/thrust/detail/functional/operators/compound_assignment_operators.h +0 -513
  39. spaces/CVPR/LIVE/thrust/thrust/system/cpp/detail/sequence.h +0 -22
  40. spaces/CVPR/LIVE/thrust/thrust/system/omp/detail/partition.h +0 -91
  41. spaces/CVPR/Text2Human/Text2Human/utils/util.py +0 -123
  42. spaces/CVPR/WALT/mmdet/datasets/utils.py +0 -158
  43. spaces/Chaitanya01/InvestingPlatform/patterns.py +0 -64
  44. spaces/CikeyQI/meme-api/meme_generator/memes/addiction/__init__.py +0 -39
  45. spaces/ClinBAY/Safeterm_Demo/app.py +0 -410
  46. spaces/Conner/IAPdemo/app.py +0 -46
  47. spaces/Cyril666/ContourNet-ABI/maskrcnn_benchmark/csrc/cpu/vision.h +0 -73
  48. spaces/DQChoi/gpt-demo/venv/lib/python3.11/site-packages/altair/utils/plugin_registry.py +0 -228
  49. spaces/DQChoi/gpt-demo/venv/lib/python3.11/site-packages/gradio/templates/cdn/assets/index-1e03cd90.css +0 -1
  50. spaces/DQChoi/gpt-demo/venv/lib/python3.11/site-packages/gradio/templates/cdn/assets/index-28bbfef4.js +0 -3
spaces/101-5/gpt4free/g4f/.v1/gui/streamlit_app.py DELETED
@@ -1,52 +0,0 @@
1
- import os
2
- import sys
3
-
4
- sys.path.append(os.path.join(os.path.dirname(__file__), os.path.pardir))
5
-
6
- import streamlit as st
7
- from gpt4free import you
8
-
9
-
10
- def get_answer(question: str) -> str:
11
- # Set cloudflare clearance cookie and get answer from GPT-4 model
12
- try:
13
- result = you.Completion.create(prompt=question)
14
-
15
- return result.text
16
-
17
- except Exception as e:
18
- # Return error message if an exception occurs
19
- return (
20
- f'An error occurred: {e}. Please make sure you are using a valid cloudflare clearance token and user agent.'
21
- )
22
-
23
-
24
- # Set page configuration and add header
25
- st.set_page_config(
26
- page_title="gpt4freeGUI",
27
- initial_sidebar_state="expanded",
28
- page_icon="🧠",
29
- menu_items={
30
- 'Get Help': 'https://github.com/xtekky/gpt4free/blob/main/README.md',
31
- 'Report a bug': "https://github.com/xtekky/gpt4free/issues",
32
- 'About': "### gptfree GUI",
33
- },
34
- )
35
- st.header('GPT4free GUI')
36
-
37
- # Add text area for user input and button to get answer
38
- question_text_area = st.text_area('🤖 Ask Any Question :', placeholder='Explain quantum computing in 50 words')
39
- if st.button('🧠 Think'):
40
- answer = get_answer(question_text_area)
41
- escaped = answer.encode('utf-8').decode('unicode-escape')
42
- # Display answer
43
- st.caption("Answer :")
44
- st.markdown(escaped)
45
-
46
- # Hide Streamlit footer
47
- hide_streamlit_style = """
48
- <style>
49
- footer {visibility: hidden;}
50
- </style>
51
- """
52
- st.markdown(hide_streamlit_style, unsafe_allow_html=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/1acneusushi/gradio-2dmoleculeeditor/data/((TOP)) Free Windows 11.md DELETED
@@ -1,41 +0,0 @@
1
-
2
- <h1>How to Get Windows 11 for Free on Your PC</h1>
3
- <p>Windows 11 is the latest version of Microsoft's operating system that offers a redesigned and refreshed look, new tools, sounds, and apps, and improved performance and security. If you are wondering how to get Windows 11 for free on your PC, you have come to the right place.</p>
4
- <h2>free windows 11</h2><br /><p><b><b>Download</b> &gt;&gt;&gt;&gt;&gt; <a href="https://byltly.com/2uKyib">https://byltly.com/2uKyib</a></b></p><br /><br />
5
- <p>In this article, we will show you how to check if your PC is eligible for a free upgrade to Windows 11, how to download and install Windows 11 for free using Windows Update or Installation Assistant, and how to buy a license for Windows 11 if you don't have one. Let's get started.</p>
6
- <h2>Check If Your PC Is Eligible for a Free Upgrade to Windows 11</h2>
7
- <p>Windows 11 is a free upgrade for Windows 10 users who have a compatible PC and a valid license. To check if your PC meets the minimum hardware requirements for Windows 11, you can use the PC Health Check app that you can download from Microsoft's website. The app will scan your PC and tell you if it can run Windows 11 or not.</p>
8
- <p>The minimum hardware requirements for Windows 11 are:</p>
9
- <ul>
10
- <li>Processor: 1 gigahertz (GHz) or faster with 2 or more cores on a compatible 64-bit processor or System on a Chip (SoC).</li>
11
- <li>Memory: 4 GB RAM.</li>
12
- <li>Storage: 64 GB or larger storage device.</li>
13
- <li>System firmware: UEFI, Secure Boot capable.</li>
14
- <li>TPM: Trusted Platform Module (TPM) version 2.0.</li>
15
- <li>Graphics card: Compatible with DirectX 12 or later with WDDM 2.0 driver.</li>
16
- <li>Display Resolution: High definition (720p) display that is greater than 9” diagonally, 8 bits per color channel.</li>
17
- <li>Internet connection: Microsoft account and internet connectivity required for setup for Windows 11 Home and for Windows 11 Pro for personal use.</li>
18
- </ul>
19
- <p>If your PC meets these requirements, you can proceed to the next step. If not, you may need to upgrade your hardware or buy a new PC that supports Windows 11.</p>
20
- <h2>Download and Install Windows 11 for Free Using Windows Update or Installation Assistant</h2>
21
- <p>If your PC is eligible for a free upgrade to Windows 11, you have two options to download and install it: using Windows Update or using Installation Assistant.</p>
22
- <p></p>
23
- <p>The first option is to use Windows Update, which is the easiest and most recommended way. To do this, follow these steps:</p>
24
- <ol>
25
- <li>Select the Start button, then click on Settings.</li>
26
- <li>Click on Update & Security.</li>
27
- <li>Select Check for updates to see if your PC can run Windows 11, or if the upgrade is ready for your PC.</li>
28
- <li>If the upgrade is available, follow the on-screen instructions to download and install Windows 11.</li>
29
- </ol>
30
- <p>The second option is to use Installation Assistant, which is a tool that you can download from Microsoft's website. This option is for those who want to upgrade a Windows 10 PC to Windows 11 manually. To do this, follow these steps:</p>
31
- <ol>
32
- <li>Download the Installation Assistant from Microsoft's website and run it on your PC.</li>
33
- <li>You need to be an administrator to run this tool.</li>
34
- <li>Once the tool confirms that your device hardware is compatible, you will be presented with the license terms. Select Accept and Install.</li>
35
- <li>The tool will download and install Windows 11 on your PC. This may take some time depending on your internet speed and PC performance.</li>
36
- </ol>
37
- <h2>Buy a License for Windows 11 If You Don't Have One</h2>
38
- <p>If you don't have a valid license for Windows 10 or any other previous version of Windows, you will need to buy one to run Windows 11 on your PC. You can buy a license from Microsoft's website or from other retailers. The price may vary depending on the edition (Home or Pro) and the region.</p>
39
- <p>Once you</p> ddb901b051<br />
40
- <br />
41
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/1acneusushi/gradio-2dmoleculeeditor/data/Geant 2500hd probleme boot Le guide complet pour le dbloquer.md DELETED
@@ -1,126 +0,0 @@
1
-
2
- <h1>How to Fix Geant 2500hd Probleme Boot</h1>
3
- <p>If you own a Geant 2500hd satellite receiver, you may have encountered a boot problem that prevents you from using your device normally. This problem can be frustrating and annoying, especially if you don't know how to fix it. In this article, we will explain what is Geant 2500hd and what is the boot problem, what are the possible causes of this problem, and how to solve it with different methods.</p>
4
- <h2>Geant 2500hd probleme boot</h2><br /><p><b><b>Download File</b> ->>> <a href="https://byltly.com/2uKyuS">https://byltly.com/2uKyuS</a></b></p><br /><br />
5
- <h2>What is Geant 2500hd and what is the boot problem?</h2>
6
- <h3>Geant 2500hd is a satellite receiver that offers many features and channels</h3>
7
- <p>Geant 2500hd is a popular satellite receiver that allows you to watch hundreds of channels from different satellites. It also supports various functions such as recording, playback, internet access, IPTV, YouTube, weather forecast, and more. It has a sleek design and a user-friendly interface that makes it easy to operate.</p>
8
- <h3>The boot problem occurs when the device is stuck on the boot screen or shows an error message</h3>
9
- <p>The boot problem is one of the most common issues that affect Geant 2500hd users. It happens when the device fails to start up properly and gets stuck on the boot screen or shows an error message such as "ERROR 114" or "ERROR 10". When this happens, you cannot access any of the features or channels of your device.</p>
10
- <h2>What are the possible causes of the boot problem?</h2>
11
- <h3>The boot problem can be caused by a corrupted firmware, a wrong update, a power outage, or a hardware issue</h3>
12
- <p>There are several factors that can trigger the boot problem on your Geant 2500hd device. Some of them are:</p>
13
- <ul>
14
- <li>A corrupted firmware: The firmware is the software that controls your device's functions and performance. If it gets corrupted due to a virus infection, a faulty download, or an incomplete installation, it can cause your device to malfunction.</li>
15
- <li>A wrong update: Sometimes, you may accidentally install an incompatible or outdated firmware update on your device. This can cause conflicts and errors that prevent your device from booting up normally.</li>
16
- <li>A power outage: A sudden power outage or surge can damage your device's components or interrupt its operation. This can result in data loss or corruption that affects your device's functionality.</li>
17
- <li>A hardware issue: A hardware issue refers to any physical damage or defect that affects your device's parts. This can be caused by dropping, hitting, overheating, or water exposure. A hardware issue can prevent your device from turning on or working properly.</li>
18
- </ul>
19
- <h2>How to solve the boot problem with different methods?</h2>
20
- <h3>Method 1: Use a USB flash drive to install the latest firmware</h3>
21
- <p>One of the easiest ways to fix the boot problem on your Geant 2500hd device is to use a USB flash drive to install the latest firmware. This can help you restore your device's original settings and fix any software issues. To do this, follow these steps:</p>
22
- <ol>
23
- <li>Download the latest firmware from <a href="https://www.geantsat.com/">the official website</a> or <a href="https://www.mediafire.com/folder/k4g...-2500HD%20Plus">a trusted source</a>. Make sure you choose the correct model and version for your device.</li>
24
- <li>Rename the firmware file to Ali_update.bin and copy it to the root of a formatted USB flash drive.</li>
25
- <li>Insert the USB flash drive into your device's USB port.</li>
26
- <li>Turn on your device while holding down the standby button on your remote control.</li>
27
- <li>Wait for your device to detect the firmware file and install it automatically. You will see a progress bar on your screen.</li>
28
- <li>Restart your device and check if the boot problem is solved.</li>
29
- </ol>
30
- <h3>Method 2: Use a RS232 cable and a loader software to flash your device</h3>
31
- <p>Another way to fix the boot problem on your Geant 2500hd device is to use a RS232 cable and a loader software to flash your device. This can help you overwrite your device's memory with a new firmware file. To do this, follow these steps:</p>
32
- <ol>
33
- <li>Download <a href="https://khandishnetwork.com/dl/geant-gn-2500-hd-plus-boot-solution-du-probleme/">a dump file</a> and <a href="https://www.dzsat.org/forum/f466/geant-2500-hd-plus-bloque-boot-458270.html">a loader software</a> from a reliable source. Make sure you choose compatible files for your device.</li>
34
- <li>Connect your device to your computer using a RS232 cable.</li>
35
- <li>Open the loader software and select <code>EromUpgrade.exe</code>.</li>
36
- <li>Select <code>Browse</code> and choose <code>virusdz.bin</code>, which is <code>Géant GN 2500 HD Plus Dump File</code>.</li>
37
- <li>Select <code>Include Bootloader</code>.</li>
38
- <li>Select <code>Start</code>.</li>
39
- <li>Wait for <code>EromUpgrade.exe</code> program window status bar shows <code>DONE!</code>.</li>
40
- <li>Disconnect <code>EromUpgrade.exe</code>.</li>
41
- <li>Turn on your device.</li>
42
- <li>Check if <code>Géant GN 2500 HD Plus Boot Solution du Problème</code>.</li>
43
- </ol>
44
- <h3>Method 3: Contact a professional technician or customer service for assistance</h3>
45
- <p>If none of these methods work for you, you may have a hardware issue that requires professional repair. In this case, you should contact your nearest technician or customer service center for help. They can diagnose your device's problem and provide you with an appropriate solution. To do this, follow these steps:</p>
46
- <ol>
47
- <li>Find out where you can find <a href="https://www.geantsat.com/contact-us/">a technician or customer service center</a> near you.</li>
48
- <li>Contact them by phone or email and explain your situation.</li>
49
- <li>Provide them with your device's model number, serial number, and warranty information if applicable.</li>
50
- <li>Follow their instructions on how to send or bring your device for repair.</li>
51
- <li>Wait for them to fix your device and return it to you.</li>
52
- </ol>
53
- <h2>Conclusion</h2>
54
- <p>The boot problem on Geant 2500hd is a common issue that can prevent you from enjoying your satellite receiver. However, you can fix this problem by using one of the methods we have discussed in this article. You can use a USB flash drive to install the latest firmware, use a RS232 cable and a loader software to flash your device, or contact a professional technician or customer service for assistance. We hope this article has helped you solve your boot problem and restore your device's functionality.</p>
55
- <p>How to fix Geant 2500hd boot error<br />
56
- Geant 2500hd plus bloqué sur boot solution<br />
57
- Geant 2500hd new stuck on boot mode<br />
58
- Geant 2500hd plus error 114 and boot problem<br />
59
- Geant 2500hd plus firmware update and boot issue<br />
60
- Geant 2500hd plus dump original and boot repair<br />
61
- Geant 2500hd plus loader Eromupgrade and boot recovery<br />
62
- Geant 2500hd plus reprogrammer la mémoire flash and boot<br />
63
- Geant 2500hd plus ALIUP loader and boot fix<br />
64
- Geant 2500hd plus MAJ 1.44 and boot error<br />
65
- Geant 2500hd plus ALI3606_AL and boot problem<br />
66
- Geant 2500hd plus DZSat forum and boot issue<br />
67
- Geant 2500hd plus gulfup download and boot repair<br />
68
- Geant 2500hd plus youtube video and boot recovery<br />
69
- Geant 2500hd plus شرح بسيط لحل مشكل BOOT<br />
70
- Geant 2500hd plus حل مشكلة error114 و التوقف على BOOT<br />
71
- Geant 2500hd plus starsat sr-9900 hd and boot fix<br />
72
- Geant 2500hd plus platini firmware and boot error<br />
73
- Geant 2500hd plus virusdz.bin dump and boot problem<br />
74
- Geant 2500hd plus include bootloader and boot issue<br />
75
- Geant 2500hd new bloqué sur error114 et boot solution<br />
76
- Geant 2500hd new firmware upgrade and boot problem<br />
77
- Geant 2500hd new dump original et boot repair<br />
78
- Geant 2500hd new loader Eromupgrade et boot recovery<br />
79
- Geant 2500hd new reprogrammer la mémoire flash et boot<br />
80
- Geant 2500hd new ALIUP loader et boot fix<br />
81
- Geant 2500hd new MAJ 1.44 et boot error<br />
82
- Geant 2500hd new ALI3606_AL et boot problem<br />
83
- Geant 2500hd new DZSat forum et boot issue<br />
84
- Geant 2500hd new gulfup télécharger et boot repair<br />
85
- Geant 2500hd new youtube vidéo et boot recovery<br />
86
- Geant 2500hd new شرح بسيط لحل مشكل BOOT و error114<br />
87
- Geant 2500hd new حل مشكلة error114 و التوقف على BOOT في جهاز <br />
88
- Geant 2500hd new starsat sr-9900 hd et boot fix<br />
89
- Geant 2500hd new platini firmware et boot error<br />
90
- Geant 2500hd new virusdz.bin dump et boot problem<br />
91
- Geant 2500hd new include bootloader et boot issue<br />
92
- How to solve Geant 2500hd plus and new boot problem <br />
93
- How to recover from Geant 2500hd plus and new error114 and boot issue <br />
94
- How to repair Geant 2500hd plus and new stuck on boot mode <br />
95
- How to update firmware for Geant 2500hd plus and new and fix boot error <br />
96
- How to use loader Eromupgrade for Geant 2500hd plus and new and repair boot problem <br />
97
- How to reprogram flash memory for Geant 2500hd plus and new and recover from boot issue <br />
98
- How to use ALIUP loader for Geant 2500hd plus and new and solve boot problem <br />
99
- How to use MAJ 1.44 for Geant 2500hd plus and new and fix boot error <br />
100
- How to use ALI3606_AL for Geant 2500hd plus and new and repair boot problem <br />
101
- How to use DZSat forum for Geant 2500hd plus and new and recover from boot issue <br />
102
- How to use gulfup download for Geant 2500hd plus and new and solve boot problem <br />
103
- How to use youtube video for Geant 2500hd plus and new and fix boot error <br />
104
- How to use virusdz.bin dump for Geant 2500hd plus and new and repair boot problem </p>
105
- <h2>FAQs</h2>
106
- <h3>What is the difference between Geant 2500hd and Geant 2500hd plus?</h3>
107
- <p>Geant 2500hd and Geant 2500hd plus are two models of satellite receivers from the same brand. They have similar features and functions, but Geant 2500hd plus has some improvements and enhancements over Geant 2500hd. For example, Geant 2500hd plus has more memory, more channels, more IPTV options, and more compatibility with different satellites.</p>
108
- <h3>How can I update my Geant 2500hd device?</h3>
109
- <p>You can update your Geant 2500hd device by downloading the latest firmware from the official website or a trusted source and installing it on your device using a USB flash drive. You can also use a RS232 cable and a loader software to flash your device with a new firmware file. You should always check the compatibility and validity of the firmware before installing it on your device.</p>
110
- <h3>How can I reset my Geant 2500hd device to factory settings?</h3>
111
- <p>You can reset your Geant 2500hd device to factory settings by using the menu option on your remote control. You can access the menu by pressing the menu button on your remote control and then selecting settings. You can then select factory reset and confirm your choice. This will erase all your data and settings and restore your device to its original state.</p>
112
- <h3>How can I backup my Geant 2500hd device's data?</h3>
113
- <p>You can backup your Geant 2500hd device's data by using a USB flash drive or an external hard drive. You can connect your storage device to your receiver's USB port and then use the menu option on your remote control to copy or transfer your data. You can backup your channel list, favorite list, IPTV list, recording files, and other settings.</p>
114
- <h3>How can I troubleshoot my Geant 2500hd device's problems?</h3>
115
- <p>You can troubleshoot your Geant 2500hd device's problems by checking the following things:</p>
116
- <ul>
117
- <li>Make sure your device is connected to a stable power source and a working satellite dish.</li>
118
- <li>Make sure your device has the latest firmware installed and updated.</li>
119
- <li>Make sure your device's settings are correct and compatible with your satellite and TV.</li>
120
- <li>Make sure your device's cables are properly connected and not damaged.</li>
121
- <li>Make sure your device's remote control has working batteries and is within range.</li>
122
- </ul>
123
- <p>If you still have problems with your device, you can contact a professional technician or customer service for help.</p>
124
- </p> 0a6ba089eb<br />
125
- <br />
126
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/1line/AutoGPT/autogpt/agent/agent.py DELETED
@@ -1,197 +0,0 @@
1
- from colorama import Fore, Style
2
-
3
- from autogpt.app import execute_command, get_command
4
- from autogpt.chat import chat_with_ai, create_chat_message
5
- from autogpt.config import Config
6
- from autogpt.json_utils.json_fix_llm import fix_json_using_multiple_techniques
7
- from autogpt.json_utils.utilities import validate_json
8
- from autogpt.logs import logger, print_assistant_thoughts
9
- from autogpt.speech import say_text
10
- from autogpt.spinner import Spinner
11
- from autogpt.utils import clean_input
12
-
13
-
14
- class Agent:
15
- """Agent class for interacting with Auto-GPT.
16
-
17
- Attributes:
18
- ai_name: The name of the agent.
19
- memory: The memory object to use.
20
- full_message_history: The full message history.
21
- next_action_count: The number of actions to execute.
22
- system_prompt: The system prompt is the initial prompt that defines everything the AI needs to know to achieve its task successfully.
23
- Currently, the dynamic and customizable information in the system prompt are ai_name, description and goals.
24
-
25
- triggering_prompt: The last sentence the AI will see before answering. For Auto-GPT, this prompt is:
26
- Determine which next command to use, and respond using the format specified above:
27
- The triggering prompt is not part of the system prompt because between the system prompt and the triggering
28
- prompt we have contextual information that can distract the AI and make it forget that its goal is to find the next task to achieve.
29
- SYSTEM PROMPT
30
- CONTEXTUAL INFORMATION (memory, previous conversations, anything relevant)
31
- TRIGGERING PROMPT
32
-
33
- The triggering prompt reminds the AI about its short term meta task (defining the next task)
34
- """
35
-
36
- def __init__(
37
- self,
38
- ai_name,
39
- memory,
40
- full_message_history,
41
- next_action_count,
42
- system_prompt,
43
- triggering_prompt,
44
- ):
45
- self.ai_name = ai_name
46
- self.memory = memory
47
- self.full_message_history = full_message_history
48
- self.next_action_count = next_action_count
49
- self.system_prompt = system_prompt
50
- self.triggering_prompt = triggering_prompt
51
-
52
- def start_interaction_loop(self):
53
- # Interaction Loop
54
- cfg = Config()
55
- loop_count = 0
56
- command_name = None
57
- arguments = None
58
- user_input = ""
59
-
60
- while True:
61
- # Discontinue if continuous limit is reached
62
- loop_count += 1
63
- if (
64
- cfg.continuous_mode
65
- and cfg.continuous_limit > 0
66
- and loop_count > cfg.continuous_limit
67
- ):
68
- logger.typewriter_log(
69
- "Continuous Limit Reached: ", Fore.YELLOW, f"{cfg.continuous_limit}"
70
- )
71
- break
72
-
73
- # Send message to AI, get response
74
- with Spinner("Thinking... "):
75
- assistant_reply = chat_with_ai(
76
- self.system_prompt,
77
- self.triggering_prompt,
78
- self.full_message_history,
79
- self.memory,
80
- cfg.fast_token_limit,
81
- ) # TODO: This hardcodes the model to use GPT3.5. Make this an argument
82
-
83
- assistant_reply_json = fix_json_using_multiple_techniques(assistant_reply)
84
-
85
- # Print Assistant thoughts
86
- if assistant_reply_json != {}:
87
- validate_json(assistant_reply_json, "llm_response_format_1")
88
- # Get command name and arguments
89
- try:
90
- print_assistant_thoughts(self.ai_name, assistant_reply_json)
91
- command_name, arguments = get_command(assistant_reply_json)
92
- # command_name, arguments = assistant_reply_json_valid["command"]["name"], assistant_reply_json_valid["command"]["args"]
93
- if cfg.speak_mode:
94
- say_text(f"I want to execute {command_name}")
95
- except Exception as e:
96
- logger.error("Error: \n", str(e))
97
-
98
- if not cfg.continuous_mode and self.next_action_count == 0:
99
- ### GET USER AUTHORIZATION TO EXECUTE COMMAND ###
100
- # Get key press: Prompt the user to press enter to continue or escape
101
- # to exit
102
- logger.typewriter_log(
103
- "NEXT ACTION: ",
104
- Fore.CYAN,
105
- f"COMMAND = {Fore.CYAN}{command_name}{Style.RESET_ALL} "
106
- f"ARGUMENTS = {Fore.CYAN}{arguments}{Style.RESET_ALL}",
107
- )
108
- print(
109
- "Enter 'y' to authorise command, 'y -N' to run N continuous "
110
- "commands, 'n' to exit program, or enter feedback for "
111
- f"{self.ai_name}...",
112
- flush=True,
113
- )
114
- while True:
115
- console_input = clean_input(
116
- Fore.MAGENTA + "Input:" + Style.RESET_ALL
117
- )
118
- if console_input.lower().strip() == "y":
119
- user_input = "GENERATE NEXT COMMAND JSON"
120
- break
121
- elif console_input.lower().strip() == "":
122
- print("Invalid input format.")
123
- continue
124
- elif console_input.lower().startswith("y -"):
125
- try:
126
- self.next_action_count = abs(
127
- int(console_input.split(" ")[1])
128
- )
129
- user_input = "GENERATE NEXT COMMAND JSON"
130
- except ValueError:
131
- print(
132
- "Invalid input format. Please enter 'y -n' where n is"
133
- " the number of continuous tasks."
134
- )
135
- continue
136
- break
137
- elif console_input.lower() == "n":
138
- user_input = "EXIT"
139
- break
140
- else:
141
- user_input = console_input
142
- command_name = "human_feedback"
143
- break
144
-
145
- if user_input == "GENERATE NEXT COMMAND JSON":
146
- logger.typewriter_log(
147
- "-=-=-=-=-=-=-= COMMAND AUTHORISED BY USER -=-=-=-=-=-=-=",
148
- Fore.MAGENTA,
149
- "",
150
- )
151
- elif user_input == "EXIT":
152
- print("Exiting...", flush=True)
153
- break
154
- else:
155
- # Print command
156
- logger.typewriter_log(
157
- "NEXT ACTION: ",
158
- Fore.CYAN,
159
- f"COMMAND = {Fore.CYAN}{command_name}{Style.RESET_ALL}"
160
- f" ARGUMENTS = {Fore.CYAN}{arguments}{Style.RESET_ALL}",
161
- )
162
-
163
- # Execute command
164
- if command_name is not None and command_name.lower().startswith("error"):
165
- result = (
166
- f"Command {command_name} threw the following error: {arguments}"
167
- )
168
- elif command_name == "human_feedback":
169
- result = f"Human feedback: {user_input}"
170
- else:
171
- result = (
172
- f"Command {command_name} returned: "
173
- f"{execute_command(command_name, arguments)}"
174
- )
175
- if self.next_action_count > 0:
176
- self.next_action_count -= 1
177
-
178
- memory_to_add = (
179
- f"Assistant Reply: {assistant_reply} "
180
- f"\nResult: {result} "
181
- f"\nHuman Feedback: {user_input} "
182
- )
183
-
184
- self.memory.add(memory_to_add)
185
-
186
- # Check if there's a result from the command append it to the message
187
- # history
188
- if result is not None:
189
- self.full_message_history.append(create_chat_message("system", result))
190
- logger.typewriter_log("SYSTEM: ", Fore.YELLOW, result)
191
- else:
192
- self.full_message_history.append(
193
- create_chat_message("system", "Unable to execute command")
194
- )
195
- logger.typewriter_log(
196
- "SYSTEM: ", Fore.YELLOW, "Unable to execute command"
197
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Bus Simulator Ultimate The Ultimate Guide to Modding Your Game.md DELETED
@@ -1,158 +0,0 @@
1
- <br />
2
- <h1>How to Use Mod Editor Bus Simulator Ultimate to Create Your Own Bus Driving Experience</h1>
3
- <p>Do you love bus simulator games? Do you want to customize your own buses, routes, maps, and more? Do you want to share your creations with other bus enthusiasts? If you answered yes to any of these questions, then you need to try mod editor bus simulator ultimate. In this article, we will show you what mod editor bus simulator ultimate is, how to download and install it, how to create and share mods with it, and some FAQs about it. By the end of this article, you will be ready to unleash your creativity and enjoy a whole new level of bus simulation.</p>
4
- <h2>mod editor bus simulator ultimate</h2><br /><p><b><b>Download File</b> - <a href="https://urlin.us/2uSTzm">https://urlin.us/2uSTzm</a></b></p><br /><br />
5
- <h2>What is Mod Editor Bus Simulator Ultimate?</h2>
6
- <h3>A brief introduction to the game and its features</h3>
7
- <p>Mod editor bus simulator ultimate is a modding tool for the popular game bus simulator ultimate. Bus simulator ultimate is a realistic and immersive game that lets you drive various buses across different cities and countries. You can choose from different bus models, customize your bus interior and exterior, transport passengers, follow traffic rules, earn money, and more. You can also play online with other players or offline with AI drivers. The game has stunning graphics, realistic physics, dynamic weather, day-night cycle, and many other features that make it one of the best bus simulator games on the market.</p>
8
- <h3>A brief introduction to the mod editor and its features</h3>
9
- <p>The mod editor is a free tool that allows you to create your own mods for bus simulator ultimate. Mods are modifications that change or add something to the game, such as new buses, maps, routes, skins, decals, sounds, etc. With the mod editor, you can enhance your bus driving experience by creating your own content and sharing it with the community. The mod editor has many features that make it easy and fun to use, such as:</p>
10
- <ul>
11
- <li>A user-friendly interface that guides you through the mod creation process</li>
12
- <li>A powerful editor that lets you edit various aspects of the game, such as meshes, textures, materials, animations, sounds, etc.</li>
13
- <li>A preview mode that lets you test your mods before publishing them</li>
14
- <li>A built-in uploader that lets you upload your mods directly to mod.io or Steam Workshop</li>
15
- <li>A compatibility checker that ensures your mods work with the latest version of the game</li>
16
- <li>A documentation that explains how to use the mod editor in detail</li>
17
- </ul>
18
- <h2>How to Download and Install Mod Editor Bus Simulator Ultimate?</h2>
19
- <h3>The steps to download and install the mod editor for different platforms</h3>
20
- <p>The mod editor is available for Windows PC and Mac OS. You can download it from the official website of bus simulator ultimate or from the Epic Games Store. To install it, you need to follow these steps:</p>
21
- <ol>
22
- <li>Download the mod editor installer file from the source of your choice</li>
23
- <li>Run the installer file and follow the instructions on the screen</li>
24
- <li>Select the destination folder where you want to install the mod editor</li>
25
- <li>Wait for the installation to complete and launch the mod editor from the shortcut on your desktop or start menu</li>
26
- </ol>
27
- <p>If you have bus simulator ultimate installed on your PC or Mac, the mod editor will automatically detect it and link it to your game folder. If not, you will need to manually locate your game folder and select it in the mod editor settings.</p>
28
- <h3>The requirements and recommendations for using the mod editor</h3>
29
- <p>To use the mod editor, you need to have a PC or Mac that meets the minimum system requirements for bus simulator ultimate. These are:</p>
30
- <table>
31
- <tr>
32
- <th>OS</th>
33
- <th>Processor</th>
34
- <th>Memory</th>
35
- <th>Graphics</th>
36
- <th>Storage</th>
37
- </tr>
38
- <tr>
39
- <td>Windows 7/8/10 64-bit or Mac OS X 10.9 or higher</td>
40
- <td>Intel Core i3 or equivalent</td>
41
- <td>4 GB RAM</td>
42
- <td>NVIDIA GeForce GTX 760 or equivalent</td>
43
- <td>4 GB available space</td>
44
- </tr>
45
- </table>
46
- <p>However, we recommend that you have a PC or Mac that exceeds the recommended system requirements for bus simulator ultimate. These are:</p>
47
- <p>How to create your own map mod with BUSSID Mod Editor<br />
48
- Bus Simulator 21 Modding Kit free download on Epic Games Store<br />
49
- Best community created buses and maps for Bus Simulator 21 on mod.io<br />
50
- Bus Simulator 21 Next Stop - Gold Edition with all premium DLCs<br />
51
- Bus Simulator 21 Modding Kit tutorial and documentation<br />
52
- How to share your mods with your friends and the community via mod.io<br />
53
- Bus Simulator 21 modding kit features and requirements<br />
54
- How to enhance your bus driving experience with custom decals, skins, and interiors<br />
55
- Bus Simulator 21 modding kit support and feedback<br />
56
- How to install and update mods for Bus Simulator 21<br />
57
- Bus Simulator 21 modding kit vs BUSSID Mod Editor comparison<br />
58
- Bus Simulator 21 modding kit best practices and tips<br />
59
- How to create realistic exterior skins and interior designs for Bus Simulator 21<br />
60
- Bus Simulator 21 modding kit FAQs and troubleshooting<br />
61
- How to create custom decals and logos for Bus Simulator 21<br />
62
- Bus Simulator 21 modding kit latest news and updates<br />
63
- How to create your own buses with different models and specifications for Bus Simulator 21<br />
64
- Bus Simulator 21 modding kit reviews and ratings<br />
65
- How to create custom maps with different terrains, roads, and landmarks for Bus Simulator 21<br />
66
- Bus Simulator 21 modding kit showcase and examples<br />
67
- How to optimize your mods for performance and compatibility for Bus Simulator 21<br />
68
- Bus Simulator 21 modding kit community and forums<br />
69
- How to create your own scenarios and missions for Bus Simulator 21<br />
70
- Bus Simulator 21 modding kit development roadmap and future plans<br />
71
- How to test and debug your mods for Bus Simulator 21</p>
72
- <table>
73
- <tr>
74
- <th>OS</th>
75
- <th>Processor</th>
76
- <th>Memory</th>
77
- <th>Graphics</th>
78
- <th>Storage</th>
79
- </tr>
80
- <tr>
81
- <td>Windows 10 64-bit or Mac OS X 10.15 or higher</td>
82
- <td>Intel Core i5 or equivalent</td>
83
- <td>8 GB RAM</td>
84
- <td>NVIDIA GeForce GTX 1060 or equivalent</td>
85
- <td>8 GB available space</td>
86
- </tr>
87
- </table>
88
- <p>This will ensure that you have a smooth and stable performance when using the mod editor and playing the game with your mods. You also need to have a stable internet connection to download and upload mods, and an account on mod.io or Steam to access the modding community.</p>
89
- <h2>How to Create and Share Mods with Mod Editor Bus Simulator Ultimate?</h2>
90
- <h3>The basic steps to create a mod with the mod editor</h3>
91
- <p>To create a mod with the mod editor, you need to follow these basic steps:</p>
92
- <ol>
93
- <li>Launch the mod editor and select "Create New Mod" from the main menu</li>
94
- <li>Enter a name, description, and tags for your mod and click "Create"</li>
95
- <li>Select the type of mod you want to create from the list of templates (e.g. bus, map, route, skin, etc.) and click "Next"</li>
96
- <li>Edit the mod settings and properties according to your preferences (e.g. bus model, map size, route length, skin color, etc.) and click "Next"</li>
97
- <li>Edit the mod content using the editor tools (e.g. add meshes, textures, materials, animations, sounds, etc.) and click "Save"</li>
98
- <li>Preview your mod using the preview mode and make any adjustments if needed (e.g. fix errors, improve quality, add details, etc.) and click "Save"</li>
99
- <li>Publish your mod using the built-in uploader and select the platform of your choice (mod.io or Steam Workshop) and click "Upload"</li>
100
- <li>Wait for your mod to be uploaded and approved by the platform moderators and enjoy your mod in the game!</li>
101
- </ol>
102
- <h3>The types of mods you can create with the mod editor</h3>
103
- <p>The mod editor allows you to create various types of mods for bus simulator ultimate. Some of the most popular types are:</p>
104
- <ul>
105
- <li>Buses: You can create new buses or modify existing ones by changing their models, interiors, exteriors, sounds, physics, etc.</li>
106
- <li>Maps: You can create new maps or modify existing ones by changing their sizes, terrains, roads, buildings, landmarks, etc.</li>
107
- <li>Routes: You can create new routes or modify existing ones by changing their lengths, destinations, stops, traffic, etc.</li>
108
- <li>Skins: You can create new skins or modify existing ones by changing their colors, patterns, logos, decals, etc.</li>
109
- <li>Sounds: You can create new sounds or modify existing ones by changing their volumes, pitches, effects, etc.</li>
110
- <li>Others: You can also create other types of mods such as animations, effects, scripts, etc.</li>
111
- </ul>
112
- <h3>The tips and tricks to make your mods more realistic and fun</h3>
113
- <p>To make your mods more realistic and fun for yourself and other players, you can follow these tips and tricks:</p>
114
- <ul>
115
- <li>Do some research on the topic of your mod and use realistic and accurate data and information (e.g. bus specifications, map locations, route schedules, etc.)</li>
116
- <li>Use high-quality and original assets for your mod and avoid using copyrighted or low-resolution images, sounds, etc.</li>
117
- <li>Use the editor tools wisely and efficiently and avoid adding unnecessary or excessive elements that may affect the performance or compatibility of your mod</li>
118
- <li>Test your mod thoroughly and fix any bugs, errors, or glitches that may occur before publishing it</li>
119
- <li>Ask for feedback and suggestions from other modders and players and improve your mod based on their input</li>
120
- <li>Be creative and innovative and try to add some unique and original features to your mod that make it stand out from the rest</li>
121
- </ul>
122
- <h3>The steps to share your mods with the community via mod.io or Steam Workshop</h3>
123
- <p>To share your mods with the community, you can use either mod.io or Steam Workshop. These are online platforms that allow you to upload, download, rate, comment, and subscribe to mods for various games. To share your mods with them, you need to follow these steps:</p>
124
- <ol>
125
- <li>Create an account on mod.io or Steam if you don't have one already</li>
126
- <li>Launch the mod editor and select "Publish Mod" from the main menu</li>
127
- <li>Select the mod you want to publish and click "Next"</li>
128
- <li>Select the platform you want to publish your mod on (mod.io or Steam Workshop) and click "Next"</li>
129
- <li>Enter the details of your mod such as title, description, tags, screenshots, etc. and click "Next"</li>
130
- <li>Review the terms and conditions of the platform and agree to them if you accept them</li>
131
- <li>Click "Upload" and wait for your mod to be uploaded and approved by the platform moderators</li>
132
- <li>Once your mod is published, you can view it on the platform website or app and manage it as you wish (e.g. update, delete, etc.)</li>
133
- </ol>
134
- <h2>Conclusion</h2>
135
- <h3>A summary of the main points and benefits of using mod editor bus simulator ultimate</h3>
136
- <p>In conclusion, mod editor bus simulator ultimate is a great tool that allows you to create your own bus driving experience by creating and sharing mods for bus simulator ultimate. You can customize various aspects of the game such as buses, maps, routes, skins, sounds, etc. You can also enjoy other people's mods and discover new content and features. Mod editor bus simulator ultimate is easy and fun to use and has many features that make it one of the best modding tools for bus simulator games.</p>
137
- <h3>A call to action to download and try the mod editor</h3>
138
- <p>If you are interested in using mod editor bus simulator ultimate, you can download it for free from the official website of bus simulator ultimate or from the Epic Games Store. You can also visit the mod.io or Steam Workshop websites or apps to find and download thousands of mods for bus simulator ultimate created by other users. You can also join the modding community and share your feedback, suggestions, questions, and ideas with other modders and players. So what are you waiting for? Download mod editor bus simulator ultimate today and create your own bus driving experience!</p>
139
- <h2>FAQs</h2>
140
- <h3>Q1: What are the advantages of using mod editor bus simulator ultimate over other bus simulator games?</h3>
141
- <p>A1: Mod editor bus simulator ultimate has several advantages over other bus simulator games, such as:</p>
142
- <ul>
143
- <li>It allows you to create your own content and customize the game according to your preferences</li>
144
- <li>It has a user-friendly interface and powerful tools that make modding easy and fun</li>
145
- <li>It has a large and active modding community that offers support, feedback, and inspiration</li>
146
- <li>It is compatible with both PC and Mac platforms</li>
147
- <li>It is free to download and use</li>
148
- </ul>
149
- <h3>Q2: How can I get feedback and support for my mods?</h3>
150
- <p>A2: You can get feedback and support for your mods by visiting the mod.io or Steam Workshop websites or apps where you published your mods. There you can read the comments, ratings, reviews, and subscriptions of other users who downloaded your mods. You can also reply to them and thank them for their feedback or answer their questions. You can also join the official discord server of bus simulator ultimate where you can chat with other modders and players.</p>
151
- <h3>Q3: How can I update or delete my mods?</h3>
152
- <p>A3: You can update or delete your mods by launching the mod editor and selecting "Publish Mod" from the main menu. There you can select the mod you want to update or delete and click "Next". Then you can select the platform where you published your mod (mod.io or Steam Workshop) and click "Next". Then you can either edit the details of your mod and click "Update" or click "Delete" to remove your mod from the platform. You can also update or delete your mods from the mod.io or Steam Workshop websites or apps by logging in to your account and managing your mods.</p>
153
- <h3>Q4: How can I find and download other people's mods?</h3>
154
- <p>A4: You can find and download other people's mods by visiting the mod.io or Steam Workshop websites or apps where they published their mods. There you can browse, search, filter, and sort thousands of mods for bus simulator ultimate created by other users. You can also read the descriptions, screenshots, ratings, reviews, and comments of the mods and decide which ones you want to download. To download a mod, you need to click on the "Subscribe" button on the mod page and wait for the mod to be downloaded and installed in your game. You can also unsubscribe from a mod if you don't want it anymore.</p>
155
- <h3>Q5: How can I learn more about modding for bus simulator ultimate?</h3>
156
- <p>A5: You can learn more about modding for bus simulator ultimate by reading the documentation that comes with the mod editor. The documentation explains how to use the mod editor in detail and provides examples and tutorials for creating different types of mods. You can also watch some videos on YouTube that show how to use the mod editor and create mods. You can also join the official discord server of bus simulator ultimate where you can ask questions, get tips, and share ideas with other modders and players.</p> 197e85843d<br />
157
- <br />
158
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Download GTA Liberty City Stories APK and Obb Data - Streamlined Missions and Enhanced Graphics.md DELETED
@@ -1,138 +0,0 @@
1
-
2
- <table>
3
- <tr>
4
- <td>
5
- <h1>GTA: Liberty City Stories APK and OBB: How to Download and Install on Android</h1>
6
- <p>If you are a fan of Grand Theft Auto (GTA) games, you probably know that GTA: Liberty City Stories is one of the best titles in the series. It was originally released in 2005 for PlayStation Portable (PSP) and later ported to PlayStation 2 (PS2) in 2006. It <p>is a spin-off of GTA III, set in the same fictional city of Liberty City, but three years earlier. You play as Toni Cipriani, a former hitman for the Leone crime family, who returns to the city after a four-year absence. You will have to deal with rival gangs, corrupt politicians, and the FBI as you rise through the ranks of the mafia.</p>
7
- <p>But what if you want to play GTA: Liberty City Stories on your Android device? Well, you are in luck, because Rockstar Games has remastered the game for mobile platforms in 2016. The Android version of GTA: Liberty City Stories has improved graphics, touch controls, and cross-platform saves. It also has some exclusive features that are not available on the original versions, such as new high-resolution textures, real-time lighting and shadows, enhanced draw distance, and rebalanced gameplay.</p>
8
- <h2>gta liberty city stories apk and obb</h2><br /><p><b><b>Download Zip</b> --->>> <a href="https://urlin.us/2uSUkp">https://urlin.us/2uSUkp</a></b></p><br /><br />
9
- <p>GTA: Liberty City Stories is one of the best GTA games on mobile devices, because it has a shorter and more focused story than other GTA games, making it ideal for playing on the go. It also has a lot of content and variety, such as side missions, mini-games, hidden packages, rampages, and more. You can explore the city on foot or by using various vehicles, such as cars, bikes, boats, and helicopters. You can also customize your character's appearance and weapons.</p>
10
- <h2>Requirements: What you need to download and install GTA: Liberty City Stories APK and OBB files</h2>
11
- <p>Before you download and install GTA: Liberty City Stories APK and OBB files on your Android device, you need to make sure that your device meets the minimum and recommended specifications for running the game smoothly. Here are the requirements:</p>
12
- <table>
13
- <tr>
14
- <th>Minimum</th>
15
- <th>Recommended</th>
16
- </tr>
17
- <tr>
18
- <td>Android 4.0 or higher</td>
19
- <td>Android 5.0 or higher</td>
20
- </tr>
21
- <tr>
22
- <td>1 GB of RAM</td>
23
- <td>2 GB of RAM or more</td>
24
- </tr>
25
- <tr>
26
- <td>2 GB of free storage space</td>
27
- <td>4 GB of free storage space or more</td>
28
- </tr>
29
- <tr>
30
- <td>Dual-core processor</td>
31
- <td>Quad-core processor or better</td>
32
- </tr>
33
- <tr>
34
- <td>Adreno 220 GPU or equivalent</td>
35
- <td>Adreno 330 GPU or better</td>
36
- </tr>
37
- </table>
38
- <p>You also need to be aware of the risks of downloading APK and OBB files from untrusted sources. APK and OBB files are the files that contain the game's data and resources. APK stands for Android Package Kit, and OBB stands for Opaque Binary Blob. If you download these files from unknown or malicious websites, you may expose your device to viruses, malware, spyware, or other harmful software. You may also compromise your personal information, such as your contacts, photos, messages, or passwords.</p>
39
- <p>To avoid these risks, you should only download GTA: Liberty City Stories APK and OBB files from a reliable source that has positive reviews and ratings from other users. One such source is APKCombo, which is a website that provides safe and fast downloads of APK and OBB files for various Android games and apps. You can download GTA: Liberty City Stories APK and OBB files from APKCombo by following this link. <h2>Steps: How to download and install GTA: Liberty City Stories APK and OBB files on your Android device</h2>
40
- <p>Now that you have checked the requirements and found a reliable source to download GTA: Liberty City Stories APK and OBB files, you are ready to install the game on your Android device. Here are the steps you need to follow:</p>
41
- <h3>Step 1: Download GTA: Liberty City Stories APK and OBB files from APKCombo</h3>
42
- <p>The first step is to download GTA: Liberty City Stories APK and OBB files from APKCombo. You can do this by using your web browser on your Android device or on your computer. Here are the screenshots of the process:</p>
43
- <p><img src="https://i.imgur.com/8Z4gQZy.png" alt="Screenshot of APKCombo website with GTA: Liberty City Stories download link" width="300"></p>
44
- <p>This is the APKCombo website with the GTA: Liberty City Stories download link. You can see the game's icon, name, rating, size, and version. You can also see the green Download button that you need to tap or click.</p>
45
- <p><img src="https://i.imgur.com/9m7qX4o.png" alt="Screenshot of APKCombo download page with GTA: Liberty City Stories APK and OBB files" width="300"></p>
46
- <p>gta liberty city stories android download apk and obb<br />
47
- how to install gta liberty city stories apk and obb<br />
48
- gta liberty city stories mod apk and obb data<br />
49
- gta liberty city stories apk and obb highly compressed<br />
50
- gta liberty city stories apk and obb free download<br />
51
- gta liberty city stories apk and obb latest version<br />
52
- gta liberty city stories cheats android apk and obb<br />
53
- gta liberty city stories apk and obb file download<br />
54
- gta liberty city stories apk and obb revdl<br />
55
- gta liberty city stories apk and obb offline<br />
56
- gta liberty city stories apk and obb for pc<br />
57
- gta liberty city stories apk and obb android 1<br />
58
- gta liberty city stories apk and obb rexdl<br />
59
- gta liberty city stories apk and obb google drive<br />
60
- gta liberty city stories apk and obb 2023 update<br />
61
- gta liberty city stories apk and obb unlimited money<br />
62
- gta liberty city stories apk and obb gameplay<br />
63
- gta liberty city stories apk and obb size<br />
64
- gta liberty city stories apk and obb requirements<br />
65
- gta liberty city stories apk and obb mega link<br />
66
- gta liberty city stories apk and obb mediafıre link<br />
67
- gta liberty city stories apk and obb mod menu<br />
68
- gta liberty city stories apk and obb no verification<br />
69
- gta liberty city stories apk and obb original<br />
70
- gta liberty city stories apk and obb zip file</p>
71
- <p>This is the APKCombo download page with the GTA: Liberty City Stories APK and OBB files. You can see the file names, sizes, and download links. You can also see the blue Download button that you need to tap or click for each file.</p>
72
- <p><img src="https://i.imgur.com/6LXnYwN.png" alt="Screenshot of Android device with GTA: Liberty City Stories APK and OBB files downloaded" width="300"></p>
73
- <p>This is how your Android device will look like after you have downloaded the GTA: Liberty City Stories APK and OBB files. You can see the file icons, names, and sizes in your notification bar or in your file manager app.</p>
74
- <h3>Step 2: Install GTA: Liberty City Stories APK file on your Android device</h3>
75
- <p>The next step is to install GTA: Liberty City Stories APK file on your Android device. You can do this by using your file manager app or by tapping on the notification of the downloaded file. Here are the screenshots of the process:</p>
76
- <p><img src="https://i.imgur.com/0Wl0WjO.png" alt="Screenshot of Android device with GTA: Liberty City Stories APK file ready to install" width="300"></p>
77
- <p>This is how your Android device will look like when you are ready to install GTA: Liberty City Stories APK file. You can see the file icon, name, and size. You can also see the Install button that you need to tap.</p>
78
- <p><img src="https://i.imgur.com/1fYwJ5u.png" alt="Screenshot of Android device with security warning for installing unknown apps" width="300"></p>
79
- <p>This is a security warning that may appear on your Android device when you try to install GTA: Liberty City Stories APK file. It tells you that installing unknown apps may harm your device. You can ignore this warning by tapping on Settings.</p>
80
- <p><img src="https://i.imgur.com/7x0dGcE.png" alt="Screenshot of Android device with option to allow installing unknown apps from browser" width="300"></p>
81
- <p>This is an option that may appear on your Android device after you tap on Settings. It allows you to enable installing unknown apps from your web browser. You can enable this option by toggling the switch.</p>
82
- <p><img src="https://i.imgur.com/8Qkxg1R.png" alt="Screenshot of Android device with GTA: Liberty City Stories APK file installing" width="300"></p>
83
- <p>This is how your Android device will look like when GTA: Liberty City Stories APK file is installing. You can see the progress bar and the app permissions. You can also see the Cancel button that you can tap if you want to stop the installation.</p>
84
- <p><img src="https://i.imgur.com/5n9qk7L.png" alt="Screenshot of Android device with GTA: Liberty City Stories APK file installed" width="300"></p>
85
- <p>This is how your Android device will look like when GTA: Liberty City Stories APK file is installed. You can see the app icon, name, and version. You can also see the Done and Open buttons that you can tap.</p> <h3>Step 3: Copy GTA: Liberty City Stories OBB file to your Android device</h3>
86
- <p>The final step is to copy GTA: Liberty City Stories OBB file to your Android device. You can do this by using your file manager app or by connecting your device to your computer via USB cable. Here are the screenshots of the process:</p>
87
- <p><img src="https://i.imgur.com/0x7f8yM.png" alt="Screenshot of Android device with GTA: Liberty City Stories OBB file ready to copy" width="300"></p>
88
- <p>This is how your Android device will look like when you are ready to copy GTA: Liberty City Stories OBB file. You can see the file icon, name, and size. You can also see the Copy button that you need to tap.</p>
89
- <p><img src="https://i.imgur.com/1wOQX8W.png" alt="Screenshot of Android device with option to select destination folder for GTA: Liberty City Stories OBB file" width="300"></p>
90
- <p>This is an option that may appear on your Android device after you tap on Copy. It allows you to select the destination folder for GTA: Liberty City Stories OBB file. You need to navigate to the folder named Android, then OBB, then com.rockstargames.gtalcs. If you don't see this folder, you need to create it manually.</p>
91
- <p><img src="https://i.imgur.com/6u9gWZP.png" alt="Screenshot of Android device with GTA: Liberty City Stories OBB file copied to destination folder" width="300"></p>
92
- <p>This is how your Android device will look like when GTA: Liberty City Stories OBB file is copied to the destination folder. You can see the file icon, name, and size in the folder named com.rockstargames.gtalcs.</p>
93
- <h2>Tips: How to optimize your gameplay experience and avoid common issues</h2>
94
- <p>Congratulations! You have successfully downloaded and installed GTA: Liberty City Stories APK and OBB files on your Android device. You are now ready to enjoy the game on your mobile screen. But before you start playing, here are some tips on how to optimize your gameplay experience and avoid common issues:</p>
95
- <h3>Tip 1: Adjust the game's settings, controls, graphics, sound, and language to suit your preferences</h3>
96
- <p>One of the first things you should do when you launch GTA: Liberty City Stories on your Android device is to adjust the game's settings, controls, graphics, sound, and language to suit your preferences. You can do this by tapping on the Menu button on the top left corner of the screen, then tapping on Settings. Here are some screenshots of the options you can customize:</p>
97
- <p><img src="https://i.imgur.com/9l7kYmN.png" alt="Screenshot of GTA: Liberty City Stories settings menu with options for controls" width="300"></p>
98
- <p>This is the settings menu with options for controls. You can change the control layout, sensitivity, vibration, and auto-aim.</p>
99
- <p><img src="https://i.imgur.com/0qfXs0F.png" alt="Screenshot of GTA: Liberty City Stories settings menu with options for graphics" width="300"></p>
100
- <p>This is the settings menu with options for graphics. You can change the resolution, draw distance, shadows, reflections, and frame limiter.</p>
101
- <p><img src="https://i.imgur.com/5aZjJnL.png" alt="Screenshot of GTA: Liberty City Stories settings menu with options for sound" width="300"></p>
102
- <p>This is the settings menu with options for sound. You can change the volume, subtitles, radio station, and radio mode.</p>
103
- <p><img src="https://i.imgur.com/9wv4t5o.png" alt="Screenshot of GTA: Liberty City Stories settings menu with options for language" width="300"></p>
104
- <p>This is the settings menu with options for language. You can change the language of the game's text and voice.</p> <h3>Tip 2: Save your progress, access cheats, use mods, and connect with other players online</h3>
105
- <p>Another thing you should do when you play GTA: Liberty City Stories on your Android device is to save your progress, access cheats, use mods, and connect with other players online. You can do this by using the following features:</p>
106
- <ul>
107
- <li>Save your progress: You can save your progress by visiting any of the safe houses marked on the map. You can also use the cloud save feature to sync your progress across different devices. You can access the cloud save feature by tapping on the Menu button on the top left corner of the screen, then tapping on Cloud Save.</li>
108
- <li>Access cheats: You can access cheats by using the cheat device app that is included in the game. You can launch the cheat device app by tapping on the Menu button on the top left corner of the screen, then tapping on Cheat Device. You can then select from various categories of cheats, such as weapons, health, armor, money, wanted level, weather, time, and more.</li>
109
- <li>Use mods: You can use mods to enhance or change your gameplay experience. Mods are modifications made by other users that add new features, content, or graphics to the game. You can download and install mods from various websites, such as GTAInside or GTA5-Mods. You can then activate or deactivate mods by using the mod manager app that is included in the game. You can launch the mod manager app by tapping on the Menu button on the top left corner of the screen, then tapping on Mod Manager.</li>
110
- <li>Connect with other players online: You can connect with other players online by using the multiplayer mode that is included in the game. You can launch the multiplayer mode by tapping on the Menu button on the top left corner of the screen, then tapping on Multiplayer. You can then choose from various modes of multiplayer, such as deathmatch, team deathmatch, capture the flag, and more. You can also chat with other players and invite them to join your game.</li>
111
- </ul>
112
- <h3>Tip 3: Fix common issues that may occur while playing GTA: Liberty City Stories on your Android device</h3>
113
- <p>The last thing you should do when you play GTA: Liberty City Stories on your Android device is to fix common issues that may occur while playing. Some of these issues are:</p>
114
- <ul>
115
- <li>Game crashing or freezing: This may happen if your device does not meet the minimum or recommended specifications for running the game smoothly. To fix this issue, you should try to lower the game's graphics settings, close other apps running in the background, clear your device's cache and memory, or restart your device.</li>
116
- <li>Game not launching or loading: This may happen if you have not installed GTA: Liberty City Stories APK and OBB files correctly or if you have corrupted or missing files. To fix this issue, you should try to reinstall GTA: Liberty City Stories APK and OBB files from a trusted source or check if you have enough storage space on your device.</li>
117
- <li>Game not saving or syncing: This may happen if you have not enabled cloud save feature or if you have a poor internet connection. To fix this issue, you should try to enable cloud save feature by tapping on the Menu button on the top left corner of the screen, then tapping on Cloud Save. You should also try to connect to a stable and secure Wi-Fi network or use mobile data.</li>
118
- </ul>
119
- <h2>Conclusion: A summary of the main points and a call to action</h2>
120
- <p>In conclusion, GTA: Liberty City Stories is one of the best GTA games on mobile devices, because it has a shorter and more focused story than other GTA games, making it ideal for playing on the go. It also has a lot of content and variety, such as side missions, mini-games, hidden packages, rampages, and more. You can explore the city on foot or by using various vehicles, such as cars, bikes, boats, and helicopters. You can also customize your character's appearance and weapons.</p>
121
- <p>To play GTA: Liberty City Stories on your Android device, you need to download and install GTA: Liberty City Stories APK and OBB files from a reliable source like APKCombo. You also need to make sure that your device meets the minimum and recommended specifications for running the game smoothly. You also need to follow some simple steps to install GTA: Liberty City Stories APK and OBB files on your Android device.</p>
122
- <p>To optimize your gameplay experience and avoid common issues while playing GTA: Liberty City Stories on your Android device, you need to adjust the game's settings, controls, graphics, sound, and language to suit your preferences. You also need to save your progress, access cheats, use mods, and connect with other players online. You also need to fix some common issues that may occur while playing GTA: Liberty City Stories on your Android device.</p>
123
- <p>If you are looking for a fun and immersive GTA game on your mobile device, you should definitely try out GTA: Liberty City Stories. It is one of the best GTA games on mobile devices, because it has a lot of features and content that will keep you entertained for hours. You can download and install GTA: Liberty City Stories APK and OBB files from APKCombo by following this link. You can also check out the official website of Rockstar Games for more information about the game.</p>
124
- <p>So what are you waiting for? Download GTA: Liberty City Stories APK and OBB files now and enjoy the game on your Android device. And don't forget to share your feedback with us in the comments section below. We would love to hear from you!</p>
125
- <h2>FAQs</h2>
126
- <p>Here are some frequently asked questions about GTA: Liberty City Stories APK and OBB files:</p>
127
- <h3>Q: Is GTA: Liberty City Stories free to download and play?</h3>
128
- <p>A: No, GTA: Liberty City Stories is not free to download and play. It is a paid game that costs $6.99 on the Google Play Store. However, you can download and install GTA: Liberty City Stories APK and OBB files from APKCombo for free, as long as you have purchased the game legally from the Google Play Store.</p>
129
- <h3>Q: Is GTA: Liberty City Stories compatible with my Android device?</h3>
130
- <p>A: GTA: Liberty City Stories is compatible with most Android devices that run on Android 4.0 or higher. However, some devices may not be able to run the game smoothly due to their specifications or performance. You can check the minimum and recommended specifications for running the game smoothly in the Requirements section of this article.</p>
131
- <h3>Q: How much storage space do I need to download and install GTA: Liberty City Stories APK and OBB files?</h3>
132
- <p>A: You need at least 2 GB of free storage space on your Android device to download and install GTA: Liberty City Stories APK and OBB files. However, we recommend that you have at least 4 GB of free storage space or more to avoid any issues while playing the game.</p>
133
- <h3>Q: How long does it take to download and install GTA: Liberty City Stories APK and OBB files?</h3>
134
- <p>A: The time it takes to download and install GTA: Liberty City Stories APK and OBB files depends on your internet speed and your device's performance. On average, it may take around 10 to 15 minutes to complete the process.</p>
135
- <h3>Q: Can I play GTA: Liberty City Stories offline or online?</h3>
136
- <p>A: You can play GTA: Liberty City Stories offline or online. You can play the game offline without an internet connection, as long as you have downloaded and installed GTA: Liberty City Stories APK and OBB files correctly. You can also play the game online with other players by using the multiplayer mode that is included in the game.</p> 197e85843d<br />
137
- <br />
138
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/1phancelerku/anime-remove-background/FateGrand Order PC How to Install and Play the Epic RPG on Your Computer.md DELETED
@@ -1,235 +0,0 @@
1
- <br />
2
- <h1>How to Download and Play Fate/Grand Order on PC</h1>
3
- <p>Do you love playing Fate/Grand Order on your mobile device but wish you could enjoy it on a bigger screen and with better performance? If so, you're not alone. Many fans of this popular mobile game based on the Fate franchise are looking for ways to play it on their computers. Fortunately, there is a simple solution: using an emulator.</p>
4
- <h2>download fate grand order computer</h2><br /><p><b><b>DOWNLOAD</b> - <a href="https://jinyurl.com/2uNK7w">https://jinyurl.com/2uNK7w</a></b></p><br /><br />
5
- <p>In this article, we will show you how to download and play Fate/Grand Order on PC using an emulator. We will also explain what is Fate/Grand Order, why you should play it on PC, how to choose the best emulator for it, how to optimize your gameplay experience on PC, and how to troubleshoot common issues. By the end of this article, you will be ready to enjoy this amazing game on your PC with ease.</p>
6
- <h2>What is Fate/Grand Order?</h2>
7
- <h3>A brief introduction to the game and its features</h3>
8
- <p>Fate/Grand Order is a turn-based role-playing game with some visual novel elements. The player takes the role of a "Master" and commands a group of individuals called "Servants", who are typically historical, literary, and mythological figures from various cultures. The game is set in a world where human history is about to be erased by a mysterious force called "The Singularities". The player's mission is to travel back in time and restore human history by defeating enemies and solving the mystery of The Singularities.</p>
9
- <p>The game features millions of words of original story, with an impressive cast of voice actors and a stunning soundtrack. The game also boasts hundreds of Servants to collect and customize, each with their own skills, stats, and Noble Phantasms (special attacks). The game is constantly updated with new events, stories, and Servants to keep the players engaged.</p>
10
- <h3>Why play Fate/Grand Order on PC?</h3>
11
- <h4>Benefits of playing on PC vs mobile</h4>
12
- <p>While Fate/Grand Order is designed for mobile devices, there are many reasons why you might want to play it on PC instead. Here are some of the benefits of playing on PC:</p>
13
- <ul>
14
- <li>You can enjoy the game on a larger screen and with higher resolution, which makes the graphics and animations more immersive and detailed.</li>
15
- <li>You can use your keyboard and mouse to control the game, which can be more comfortable and precise than tapping on a touchscreen.</li>
16
- <li>You can avoid draining your battery or overheating your device, which can happen when playing for long periods of time on mobile.</li>
17
- <li>You can save your phone's storage space and data usage, which can be limited or expensive depending on your plan.</li>
18
- <li>You can access the game from multiple devices, such as your laptop or desktop, without having to transfer your account or data.</li>
19
- </ul>
20
- <h4>Requirements for playing on PC</h4>
21
- <p>To play Fate/Grand Order on PC, you will need two things: a computer and an emulator. A computer is the device that you will use to run the game, and an emulator is the software that will allow you to run the game as if it were a mobile app. Here are the minimum requirements for both:</p>
22
- <table>
23
- <tr>
24
- <th>Computer</th>
25
- <th>Emulator</th>
26
- </tr>
27
- <tr>
28
- <td>Windows 7 or higher</td>
29
- <td>Android 5.0 or higher</td>
30
- </tr>
31
- <tr>
32
- <td>Intel or AMD processor</td>
33
- <td>At least 2 GB of RAM</td>
34
- </tr>
35
- <tr>
36
- <td>At least 4 GB of RAM</td>
37
- <td>At least 5 GB of disk space</td>
38
- </tr>
39
- <tr>
40
- <td>At least 5 GB of disk space</td>
41
- <td>A stable internet connection</td>
42
- </tr>
43
- <tr>
44
- <td>A stable internet connection</td>
45
- <td>A Google account (optional but recommended)</td>
46
- </tr>
47
- </table>
48
- <p>If your computer meets these requirements, you should be able to play Fate/Grand Order on PC without any problems. However, if you want to improve your performance and experience, you might want to upgrade your hardware or software accordingly.</p>
49
- <p>How to play fate grand order on pc with emulator<br />
50
- Fate grand order pc version download free<br />
51
- Best emulator for fate grand order on windows<br />
52
- Fate grand order pc game system requirements<br />
53
- Download fate grand order english apk for pc<br />
54
- Fate grand order pc download noxplayer<br />
55
- Fate grand order pc bluestacks guide<br />
56
- Fate grand order pc gameplay and tips<br />
57
- Fate grand order pc download qooapp<br />
58
- Fate grand order pc download apkpure<br />
59
- How to install fate grand order on mac<br />
60
- Fate grand order mac download and play<br />
61
- Fate grand order mac emulator options<br />
62
- Fate grand order mac system requirements<br />
63
- Fate grand order mac gameplay and tips<br />
64
- Download fate grand order japanese version for pc<br />
65
- Fate grand order jp pc download and install<br />
66
- Fate grand order jp pc emulator guide<br />
67
- Fate grand order jp pc gameplay and tips<br />
68
- Fate grand order jp pc vpn and account setup<br />
69
- Download fate grand order chinese version for pc<br />
70
- Fate grand order cn pc download and install<br />
71
- Fate grand order cn pc emulator guide<br />
72
- Fate grand order cn pc gameplay and tips<br />
73
- Fate grand order cn pc vpn and account setup<br />
74
- Download fate grand order korean version for pc<br />
75
- Fate grand order kr pc download and install<br />
76
- Fate grand order kr pc emulator guide<br />
77
- Fate grand order kr pc gameplay and tips<br />
78
- Fate grand order kr pc vpn and account setup<br />
79
- Download fate grand order arcade for pc<br />
80
- Fate grand order arcade pc download and install<br />
81
- Fate grand order arcade pc emulator guide<br />
82
- Fate grand order arcade pc gameplay and tips<br />
83
- Fate grand order arcade pc vpn and account setup<br />
84
- Download fate grand order vr for pc<br />
85
- Fate grand order vr pc download and install<br />
86
- Fate grand order vr pc emulator guide<br />
87
- Fate grand order vr pc gameplay and tips<br />
88
- Fate grand order vr pc vpn and account setup<br />
89
- Download fate stay night for pc<br />
90
- Fate stay night pc download and install<br />
91
- Fate stay night pc emulator guide<br />
92
- Fate stay night pc gameplay and tips<br />
93
- Fate stay night pc vpn and account setup<br />
94
- Download fate extra for pc <br />
95
- Fate extra pc download and install <br />
96
- Fate extra pc emulator guide <br />
97
- Fate extra pc gameplay and tips <br />
98
- Fate extra pc vpn and account setup</p>
99
- <h2>How to install an emulator for Fate/Grand Order</h2>
100
- <h3>What is an emulator and how does it work?</h3>
101
- <p>An emulator is a program that mimics the functions of another device or system. In this case, an emulator will allow you to run Android apps on your PC as if they were native applications. An emulator will create a virtual environment on your PC that will simulate the Android operating system and its features. This way, you can download and install Android apps from the Google Play Store or other sources and run them on your PC with ease.</p>
102
- <h3>Choosing the best emulator for Fate/Grand Order</h3>
103
- <h4>Comparing different emulators and their pros and cons</h4>
104
- <p>There are many emulators available for PC that can run Android apps, but not all of them are suitable for Fate/Grand Order. Some emulators may have compatibility issues, performance problems, security risks, or limited features that can affect your gameplay experience. Therefore, you need to choose an emulator that is reliable, fast, safe, and feature-rich for Fate/Grand Order.</p>
105
- <p>To help you choose the best emulator for Fate/Grand Order, we have compared some of the most popular emulators based on their pros and cons. Here is a table that summarizes our findings:</p>
106
- <table>
107
- <tr>
108
- <th>Emulator</th>
109
- <th>Pros</th>
110
- <th>Cons</th>
111
- </tr>
112
- <tr>
113
- <td>BlueStacks</td>
114
- <td>- The most popular and trusted emulator for Android games<br>- Supports high-definition graphics and smooth gameplay<br>- Offers many features to enhance your game such as keyboard and mouse controls, multi-instance, sync, real-time translation, etc.<br>- Compatible with most Android apps and games<br>- Easy to install and use<br>- Free to download and play<br></td>
115
- <td>- Requires a relatively high-end PC to run smoothly<br>- May have some ads or promotions<br></td>
116
- </tr>
117
- <tr>
118
- <td>NoxPlayer</td>
119
- <td>- A fast and stable emulator for Android games<br>- Supports high-resolution graphics and smooth gameplay<br>- Offers many features to enhance your game such as keyboard and mouse controls, multi-instance, macro recorder, etc - Compatible with most Android apps and games<br>- Easy to install and use<br>- Free to download and play<br></td>
120
- <td>- May have some compatibility issues with some games<br>- May have some ads or promotions<br>- May have some security risks or malware<br></td>
121
- </tr>
122
- <tr>
123
- <td>LDPlayer</td>
124
- <td>- A lightweight and fast emulator for Android games<br>- Supports high-performance graphics and smooth gameplay<br>- Offers some features to enhance your game such as keyboard and mouse controls, multi-instance, etc.<br>- Compatible with most Android apps and games<br>- Easy to install and use<br>- Free to download and play<br></td>
125
- <td>- May have some compatibility issues with some games<br>- May have some ads or promotions<br>- May have some security risks or malware<br></td>
126
- </tr>
127
- <tr>
128
- <td>MEmu</td>
129
- <td>- A powerful and flexible emulator for Android games<br>- Supports high-quality graphics and smooth gameplay<br>- Offers many features to enhance your game such as keyboard and mouse controls, multi-instance, macro recorder, etc.<br>- Compatible with most Android apps and games<br>- Easy to install and use<br>- Free to download and play<br></td>
130
- <td>- May have some compatibility issues with some games<br>- May have some ads or promotions<br>- May have some security risks or malware<br></td>
131
- </tr>
132
- <tr>
133
- <td>Genymotion</td>
134
- <td>- A professional and advanced emulator for Android developers and testers<br>- Supports high-performance graphics and smooth gameplay<br>- Offers many features to customize your game such as screen size, resolution, device model, etc.<br>- Compatible with most Android apps and games<br>- Easy to install and use<br></td>
135
- <td>- Requires a paid subscription for personal or commercial use<br>- May have some compatibility issues with some games<br></td>
136
- </tr>
137
- </table>
138
- <h4>Recommending BlueStacks as the best emulator for Fate/Grand Order</h4>
139
- <p>Based on our comparison, we recommend BlueStacks as the best emulator for Fate/Grand Order. BlueStacks is the most popular and trusted emulator for Android games, with over 500 million users worldwide. It supports high-definition graphics and smooth gameplay, and offers many features to enhance your game such as keyboard and mouse controls, multi-instance, sync, real-time translation, etc. It is also compatible with most Android apps and games, including Fate/Grand Order. It is easy to install and use, and free to download and play.</p>
140
- <p>BlueStacks is the emulator that we will use in this article to show you how to download and play Fate/Grand Order on PC. However, you can choose any other emulator that suits your preferences and needs. Just make sure that the emulator is reliable, fast, safe, and feature-rich for Fate/Grand Order.</p>
141
- <h2>How to download and install Fate/Grand Order on BlueStacks</h2>
142
- <h3>Step-by-step guide for downloading and installing BlueStacks on PC</h3>
143
- <p>To download and install BlueStacks on your PC, follow these steps:</p>
144
- <ol>
145
- <li>Go to the official website of BlueStacks at <a href="">https://www.bluestacks.com/</a> and click on the "Download BlueStacks" button.</li>
146
- <li>Wait for the download to finish and then run the installer file.</li>
147
- <li>Follow the instructions on the screen to complete the installation process.</li>
148
- <li>Launch BlueStacks on your PC and sign in with your Google account (optional but recommended).</li>
149
- <li>Congratulations! You have successfully installed BlueStacks on your PC.</li>
150
- </ol>
151
- <h3>Step-by-step guide for downloading and installing Fate/Grand Order on BlueStacks</h3>
152
- <p>To download and install Fate/Grand Order on BlueStacks, follow these steps:</p>
153
- <ol>
154
- <li>Open BlueStacks on your PC and go to the home screen.</li>
155
- <li>Click on the "Game Center" tab and search for "Fate/Grand Order" in the search bar.</li>
156
- <li>Select the game from the results and click on the "Install" button.</li>
157
- <li>Wait for the download and installation to finish.</li>
158
- <li>Click on the "Open" button to launch the game.</li>
159
- <li>Congratulations! You have successfully installed Fate/Grand Order on BlueStacks.</li>
160
- </ol>
161
- <h3>How to transfer your account from mobile to PC</h3>
162
- <p>If you already have an account on Fate/Grand Order on your mobile device, you can transfer it to your PC using a transfer code. A transfer code is a unique code that you can generate from your game settings that will allow you to access your account from another device. To transfer your account from mobile to PC, follow these steps:</ <p>- On your mobile device, open Fate/Grand Order and go to the menu.</p>
163
- <p>- Tap on "My Room" and then on "Issue Transfer Number".</p>
164
- <p>- Enter a password of your choice and tap on "Confirm".</p>
165
- <p>- You will see a transfer code on the screen. Write it down or take a screenshot of it. Do not share it with anyone else.</p>
166
- <p>- On your PC, open Fate/Grand Order on BlueStacks and go to the title screen.</p>
167
- <p>- Tap on "Data Transfer" and enter your transfer code and password.</p>
168
- <p>- Tap on "Confirm" and wait for the data transfer to complete.</p>
169
- <p>- Congratulations! You have successfully transferred your account from mobile to PC.</p>
170
- <h2>How to optimize your gameplay experience on PC</h2>
171
- <h3>How to use BlueStacks features to enhance your game</h3>
172
- <h4>Using keyboard and mouse controls</h4>
173
- <p>One of the advantages of playing Fate/Grand Order on PC is that you can use your keyboard and mouse to control the game, which can be more comfortable and precise than tapping on a touchscreen. BlueStacks allows you to customize your keyboard and mouse controls according to your preferences. To use keyboard and mouse controls, follow these steps:</p>
174
- <ol>
175
- <li>Open Fate/Grand Order on BlueStacks and go to the game screen.</li>
176
- <li>Click on the keyboard icon on the right side of the screen.</li>
177
- <li>You will see a list of predefined keyboard and mouse controls for the game. You can edit them by clicking on the edit icon or create new ones by clicking on the plus icon.</li>
178
- <li>You can assign keys or mouse buttons to perform actions such as moving, attacking, selecting cards, using skills, etc.</li>
179
- <li>You can also adjust the sensitivity, opacity, size, and position of the controls.</li>
180
- <li>When you are done, click on "Save" and close the window.</li>
181
- <li>You can now use your keyboard and mouse to play Fate/Grand Order on PC.</li>
182
- </ol>
183
- <h4>Using multi-instance and sync features</h4>
184
- <p>Another advantage of playing Fate/Grand Order on PC is that you can use multiple instances of BlueStacks to run multiple accounts or games at the same time. This can be useful if you want to switch between different accounts or regions, or if you want to play other games while waiting for your stamina to refill. BlueStacks also allows you to sync your actions across multiple instances, which can be useful if you want to perform the same tasks or commands on different accounts or games. To use multi-instance and sync features, follow these steps:</p>
185
- <ol>
186
- <li>Open BlueStacks and go to the home screen.</li>
187
- <li>Click on the multi-instance icon on the right side of the screen.</li>
188
- <li>You will see a list of existing instances or create new ones by clicking on the plus icon.</li>
189
- <li>You can choose between fresh instances or clone instances. Fresh instances are new instances that start from scratch, while clone instances are copies of existing instances that share the same data and settings.</li>
190
- <li>You can also choose between 32-bit or 64-bit instances depending on your system and game requirements.</li>
191
- <li>When you have created or selected an instance, click on "Start" to launch it.</li>
192
- <li>You can now run multiple instances of BlueStacks at the same time. You can switch between them by clicking on their tabs or windows.</li>
193
- <li>If you want to sync your actions across multiple instances, click on the sync icon on the right side of the screen.</li>
194
- <li>You will see a list of available instances to sync with. Select the ones you want and click on "Start Syncing".</li>
195
- <li>You can now perform actions on one instance and see them replicated on other instances. You can stop syncing by clicking on "Stop Syncing".</li>
196
- </ol>
197
- <h4>Using real-time translation and high definition graphics features</h4>
198
- <p>A final advantage of playing Fate/Grand Order on PC is that you can use real-time translation and high definition graphics features to enhance your game. Real-time translation allows you to translate any text in the game into your preferred language, which can be useful if you want to play in different regions or understand the story better. High definition graphics allows you to adjust the graphics quality and resolution of the game, which can make it more immersive and detailed. To use real-time translation and high definition graphics features, follow these steps:</p>
199
- <ol>
200
- <li>Open Fate/Grand Order on BlueStacks and go to the game screen.</li>
201
- <li>Click on the settings icon on the right side of the screen.</li>
202
- <li>To use real-time translation, click on the translation icon and select your preferred language. You can also toggle the translation mode to auto or manual. You can also adjust the translation speed and accuracy.</li>
203
- <li>To use high definition graphics, click on the graphics icon and select your preferred graphics quality and resolution. You can also enable or disable anti-aliasing, FPS, and V-sync.</li>
204
- <li>When you are done, click on "Save" and close the window.</li>
205
- <li>You can now enjoy Fate/Grand Order on PC with real-time translation and high definition graphics.</li>
206
- </ol>
207
- <h2>Conclusion</h2>
208
- <h3>Summarizing the main points of the article</h3>
209
- <p>In this article, we have shown you how to download and play Fate/Grand Order on PC using an emulator. We have also explained what is Fate/Grand Order, why you should play it on PC, how to choose the best emulator for it, how to optimize your gameplay experience on PC, and how to troubleshoot common issues. By following our guide, you will be able to enjoy this amazing game on your PC with ease.</p>
210
- <h3>Providing some tips and tricks for playing Fate/Grand Order on PC</h3>
211
- <p>Before we end this article, we would like to share some tips and tricks for playing Fate/Grand Order on PC that can help you improve your game and have more fun. Here are some of them:</p>
212
- <ul>
213
- <li>Use the game's wiki or guides to learn more about the game's mechanics, characters, events, and strategies.</li>
214
- <li>Join the game's community on social media or forums to interact with other players, get news and updates, and participate in contests and giveaways.</li>
215
- <li>Backup your account data regularly using a transfer code or a bind code to avoid losing your progress or data.</li>
216
- <li>Use the game's support system or customer service to report any bugs, errors, or issues that you encounter in the game or the emulator.</li>
217
- <li>Have fun and enjoy the game!</li>
218
- </ul>
219
- <h3>Ending with a call to action or a question</h3>
220
- <p>We hope that this article has been helpful and informative for you. If you have any questions or feedback, please feel free to leave a comment below. We would love to hear from you. Thank you for reading and happy gaming!</p>
221
- <h2>Frequently Asked Questions</h2>
222
- <h3>Is Fate/Grand Order free to play?</h3>
223
- <p>Yes, Fate/Grand Order is free to download and play on both mobile devices and PC. However, the game has some optional in-app purchases that can enhance your gameplay experience or speed up your progress. You can buy items such as Saint Quartz, Golden Apples, Summon Tickets, etc. using real money. However, these items are not necessary to enjoy the game and you can earn them for free by playing the game regularly.</p>
224
- <h3>Is Fate/Grand Order available in my region?</h3>
225
- <p>Fate/Grand Order is currently available in four regions: Japan, North America, China, and Korea. Each region has its own server, language, and content. You can choose which region you want to play in by downloading the corresponding version of the game from the Google Play Store or other sources. However, you cannot transfer your account or data between different regions, so make sure you choose wisely.</p>
226
- <h3>How can I get more Servants in Fate/Grand Order?</h3>
227
- <p>You can get more Servants in Fate/Grand Order by using the Summon system. The Summon system allows you to spend Saint Quartz or Summon Tickets to randomly obtain Servants or Craft Essences (items that can boost your Servants' abilities). There are different types of Summons such as Story Summons, Event Summons, Limited Summons, etc. that offer different rates and pools of Servants and Craft Essences. You can also get some Servants for free by completing certain quests or events in the game.</p>
228
- <h3>How can I level up my Servants in Fate/Grand Order?</h3>
229
- <p>You can level up your Servants in Fate/Grand Order by using EXP Cards. EXP Cards are items that can grant a certain amount of experience points to your Servants when used. You can obtain EXP Cards by completing Daily Quests or Events in the game. You can also use other Servants or Craft Essences as materials to level up your Servants, but this will consume them permanently. You can also increase your Servants' level cap by using Ascension Materials or Grails.</p>
230
- <h3>How can I improve my combat skills in Fate/Grand Order?</h3>
231
- <p>You can improve your combat skills in Fate/Grand Order by learning the basics of the combat system and applying some strategies. The combat system is based on a turn-based card system where you have to select three cards from a pool of five cards every turn. The cards represent your Serv ants' actions, such as Buster (red), Arts (blue), or Quick (green). The cards have different effects and combinations that can affect your damage, NP gauge, critical stars, etc. You also have to consider your Servants' skills, Noble Phantasms, class advantages, and team composition when fighting. You can learn more about the combat system and strategies by reading the game's wiki or guides, or by watching some gameplay videos or tutorials online.</p>
232
- <h2></h2>
233
- <p>That's it for this article. We hope that you have learned how to download and play Fate/Grand Order on PC using an emulator. We also hope that you have enjoyed reading this article and found it useful and interesting. If you have any questions or feedback, please feel free to leave a comment below. We would love to hear from you. Thank you for reading and happy gaming!</p> 197e85843d<br />
234
- <br />
235
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/2-2/blockchain.ai/README.md DELETED
@@ -1,10 +0,0 @@
1
- ---
2
- title: Blockchain.ai
3
- emoji: 👀
4
- colorFrom: blue
5
- colorTo: gray
6
- sdk: static
7
- pinned: false
8
- ---
9
-
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
spaces/2023Liu2023/bingo/src/pages/api/healthz.ts DELETED
@@ -1,7 +0,0 @@
1
- 'use server'
2
-
3
- import { NextApiRequest, NextApiResponse } from 'next'
4
-
5
- export default async function handler(req: NextApiRequest, res: NextApiResponse) {
6
- res.status(200).end('ok')
7
- }
 
 
 
 
 
 
 
 
spaces/656-156/Real-CUGAN/app.py DELETED
@@ -1,62 +0,0 @@
1
- from upcunet_v3 import RealWaifuUpScaler
2
- import gradio as gr
3
- import time
4
- import logging
5
- import os
6
- from PIL import ImageOps
7
- import numpy as np
8
- import math
9
-
10
-
11
- def greet(input_img, input_model_name, input_tile_mode):
12
- # if input_img.size[0] * input_img.size[1] > 256 * 256:
13
- # y = int(math.sqrt(256*256/input_img.size[0]*input_img.size[1]))
14
- # x = int(input_img.size[0]/input_img.size[1]*y)
15
- # input_img = ImageOps.fit(input_img, (x, y))
16
- input_img = np.array(input_img)
17
- if input_model_name not in model_cache:
18
- t1 = time.time()
19
- upscaler = RealWaifuUpScaler(input_model_name[2], ModelPath + input_model_name, half=False, device="cpu")
20
- t2 = time.time()
21
- logger.info(f'load model time, {t2 - t1}')
22
- model_cache[input_model_name] = upscaler
23
- else:
24
- upscaler = model_cache[input_model_name]
25
- logger.info(f'load model from cache')
26
-
27
- start = time.time()
28
- result = upscaler(input_img, tile_mode=input_tile_mode)
29
- end = time.time()
30
- logger.info(f'input_model_name, {input_model_name}')
31
- logger.info(f'input_tile_mode, {input_tile_mode}')
32
- logger.info(f'input shape, {input_img.shape}')
33
- logger.info(f'output shape, {result.shape}')
34
- logger.info(f'speed time, {end - start}')
35
- return result
36
-
37
-
38
- if __name__ == '__main__':
39
- logging.basicConfig(level=logging.INFO, format="[%(asctime)s] [%(process)d] [%(levelname)s] %(message)s")
40
- logger = logging.getLogger()
41
-
42
- ModelPath = "weights_v3/"
43
- model_cache = {}
44
-
45
- input_model_name = gr.inputs.Dropdown(os.listdir(ModelPath), default="up2x-latest-denoise2x.pth", label='选择model')
46
- input_tile_mode = gr.inputs.Dropdown([0, 1, 2, 3, 4], default=2, label='选择tile_mode')
47
- input_img = gr.inputs.Image(label='image', type='pil')
48
-
49
- inputs = [input_img, input_model_name, input_tile_mode]
50
- outputs = "image"
51
- iface = gr.Interface(fn=greet,
52
- inputs=inputs,
53
- outputs=outputs,
54
- allow_screenshot=False,
55
- allow_flagging='never',
56
- examples=[['test-img.jpg', "up2x-latest-denoise2x.pth", 2]],
57
- article='[https://github.com/bilibili/ailab/tree/main/Real-CUGAN](https://github.com/bilibili/ailab/tree/main/Real-CUGAN)<br>'
58
- '感谢b站开源的项目,图片过大会导致内存不足,所有我将图片裁剪小,想体验大图片的效果请自行前往上面的链接。<br>'
59
- '修改bbb'
60
- 'The large image will lead to memory limit exceeded. So I crop and resize image. '
61
- 'If you want to experience the large image, please go to the link above.')
62
- iface.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/801artistry/RVC801/infer/lib/uvr5_pack/lib_v5/spec_utils.py DELETED
@@ -1,672 +0,0 @@
1
- import hashlib
2
- import json
3
- import math
4
- import os
5
-
6
- import librosa
7
- import numpy as np
8
- import soundfile as sf
9
- from tqdm import tqdm
10
-
11
-
12
- def crop_center(h1, h2):
13
- h1_shape = h1.size()
14
- h2_shape = h2.size()
15
-
16
- if h1_shape[3] == h2_shape[3]:
17
- return h1
18
- elif h1_shape[3] < h2_shape[3]:
19
- raise ValueError("h1_shape[3] must be greater than h2_shape[3]")
20
-
21
- # s_freq = (h2_shape[2] - h1_shape[2]) // 2
22
- # e_freq = s_freq + h1_shape[2]
23
- s_time = (h1_shape[3] - h2_shape[3]) // 2
24
- e_time = s_time + h2_shape[3]
25
- h1 = h1[:, :, :, s_time:e_time]
26
-
27
- return h1
28
-
29
-
30
- def wave_to_spectrogram(
31
- wave, hop_length, n_fft, mid_side=False, mid_side_b2=False, reverse=False
32
- ):
33
- if reverse:
34
- wave_left = np.flip(np.asfortranarray(wave[0]))
35
- wave_right = np.flip(np.asfortranarray(wave[1]))
36
- elif mid_side:
37
- wave_left = np.asfortranarray(np.add(wave[0], wave[1]) / 2)
38
- wave_right = np.asfortranarray(np.subtract(wave[0], wave[1]))
39
- elif mid_side_b2:
40
- wave_left = np.asfortranarray(np.add(wave[1], wave[0] * 0.5))
41
- wave_right = np.asfortranarray(np.subtract(wave[0], wave[1] * 0.5))
42
- else:
43
- wave_left = np.asfortranarray(wave[0])
44
- wave_right = np.asfortranarray(wave[1])
45
-
46
- spec_left = librosa.stft(wave_left, n_fft, hop_length=hop_length)
47
- spec_right = librosa.stft(wave_right, n_fft, hop_length=hop_length)
48
-
49
- spec = np.asfortranarray([spec_left, spec_right])
50
-
51
- return spec
52
-
53
-
54
- def wave_to_spectrogram_mt(
55
- wave, hop_length, n_fft, mid_side=False, mid_side_b2=False, reverse=False
56
- ):
57
- import threading
58
-
59
- if reverse:
60
- wave_left = np.flip(np.asfortranarray(wave[0]))
61
- wave_right = np.flip(np.asfortranarray(wave[1]))
62
- elif mid_side:
63
- wave_left = np.asfortranarray(np.add(wave[0], wave[1]) / 2)
64
- wave_right = np.asfortranarray(np.subtract(wave[0], wave[1]))
65
- elif mid_side_b2:
66
- wave_left = np.asfortranarray(np.add(wave[1], wave[0] * 0.5))
67
- wave_right = np.asfortranarray(np.subtract(wave[0], wave[1] * 0.5))
68
- else:
69
- wave_left = np.asfortranarray(wave[0])
70
- wave_right = np.asfortranarray(wave[1])
71
-
72
- def run_thread(**kwargs):
73
- global spec_left
74
- spec_left = librosa.stft(**kwargs)
75
-
76
- thread = threading.Thread(
77
- target=run_thread,
78
- kwargs={"y": wave_left, "n_fft": n_fft, "hop_length": hop_length},
79
- )
80
- thread.start()
81
- spec_right = librosa.stft(wave_right, n_fft, hop_length=hop_length)
82
- thread.join()
83
-
84
- spec = np.asfortranarray([spec_left, spec_right])
85
-
86
- return spec
87
-
88
-
89
- def combine_spectrograms(specs, mp):
90
- l = min([specs[i].shape[2] for i in specs])
91
- spec_c = np.zeros(shape=(2, mp.param["bins"] + 1, l), dtype=np.complex64)
92
- offset = 0
93
- bands_n = len(mp.param["band"])
94
-
95
- for d in range(1, bands_n + 1):
96
- h = mp.param["band"][d]["crop_stop"] - mp.param["band"][d]["crop_start"]
97
- spec_c[:, offset : offset + h, :l] = specs[d][
98
- :, mp.param["band"][d]["crop_start"] : mp.param["band"][d]["crop_stop"], :l
99
- ]
100
- offset += h
101
-
102
- if offset > mp.param["bins"]:
103
- raise ValueError("Too much bins")
104
-
105
- # lowpass fiter
106
- if (
107
- mp.param["pre_filter_start"] > 0
108
- ): # and mp.param['band'][bands_n]['res_type'] in ['scipy', 'polyphase']:
109
- if bands_n == 1:
110
- spec_c = fft_lp_filter(
111
- spec_c, mp.param["pre_filter_start"], mp.param["pre_filter_stop"]
112
- )
113
- else:
114
- gp = 1
115
- for b in range(
116
- mp.param["pre_filter_start"] + 1, mp.param["pre_filter_stop"]
117
- ):
118
- g = math.pow(
119
- 10, -(b - mp.param["pre_filter_start"]) * (3.5 - gp) / 20.0
120
- )
121
- gp = g
122
- spec_c[:, b, :] *= g
123
-
124
- return np.asfortranarray(spec_c)
125
-
126
-
127
- def spectrogram_to_image(spec, mode="magnitude"):
128
- if mode == "magnitude":
129
- if np.iscomplexobj(spec):
130
- y = np.abs(spec)
131
- else:
132
- y = spec
133
- y = np.log10(y**2 + 1e-8)
134
- elif mode == "phase":
135
- if np.iscomplexobj(spec):
136
- y = np.angle(spec)
137
- else:
138
- y = spec
139
-
140
- y -= y.min()
141
- y *= 255 / y.max()
142
- img = np.uint8(y)
143
-
144
- if y.ndim == 3:
145
- img = img.transpose(1, 2, 0)
146
- img = np.concatenate([np.max(img, axis=2, keepdims=True), img], axis=2)
147
-
148
- return img
149
-
150
-
151
- def reduce_vocal_aggressively(X, y, softmask):
152
- v = X - y
153
- y_mag_tmp = np.abs(y)
154
- v_mag_tmp = np.abs(v)
155
-
156
- v_mask = v_mag_tmp > y_mag_tmp
157
- y_mag = np.clip(y_mag_tmp - v_mag_tmp * v_mask * softmask, 0, np.inf)
158
-
159
- return y_mag * np.exp(1.0j * np.angle(y))
160
-
161
-
162
- def mask_silence(mag, ref, thres=0.2, min_range=64, fade_size=32):
163
- if min_range < fade_size * 2:
164
- raise ValueError("min_range must be >= fade_area * 2")
165
-
166
- mag = mag.copy()
167
-
168
- idx = np.where(ref.mean(axis=(0, 1)) < thres)[0]
169
- starts = np.insert(idx[np.where(np.diff(idx) != 1)[0] + 1], 0, idx[0])
170
- ends = np.append(idx[np.where(np.diff(idx) != 1)[0]], idx[-1])
171
- uninformative = np.where(ends - starts > min_range)[0]
172
- if len(uninformative) > 0:
173
- starts = starts[uninformative]
174
- ends = ends[uninformative]
175
- old_e = None
176
- for s, e in zip(starts, ends):
177
- if old_e is not None and s - old_e < fade_size:
178
- s = old_e - fade_size * 2
179
-
180
- if s != 0:
181
- weight = np.linspace(0, 1, fade_size)
182
- mag[:, :, s : s + fade_size] += weight * ref[:, :, s : s + fade_size]
183
- else:
184
- s -= fade_size
185
-
186
- if e != mag.shape[2]:
187
- weight = np.linspace(1, 0, fade_size)
188
- mag[:, :, e - fade_size : e] += weight * ref[:, :, e - fade_size : e]
189
- else:
190
- e += fade_size
191
-
192
- mag[:, :, s + fade_size : e - fade_size] += ref[
193
- :, :, s + fade_size : e - fade_size
194
- ]
195
- old_e = e
196
-
197
- return mag
198
-
199
-
200
- def align_wave_head_and_tail(a, b):
201
- l = min([a[0].size, b[0].size])
202
-
203
- return a[:l, :l], b[:l, :l]
204
-
205
-
206
- def cache_or_load(mix_path, inst_path, mp):
207
- mix_basename = os.path.splitext(os.path.basename(mix_path))[0]
208
- inst_basename = os.path.splitext(os.path.basename(inst_path))[0]
209
-
210
- cache_dir = "mph{}".format(
211
- hashlib.sha1(json.dumps(mp.param, sort_keys=True).encode("utf-8")).hexdigest()
212
- )
213
- mix_cache_dir = os.path.join("cache", cache_dir)
214
- inst_cache_dir = os.path.join("cache", cache_dir)
215
-
216
- os.makedirs(mix_cache_dir, exist_ok=True)
217
- os.makedirs(inst_cache_dir, exist_ok=True)
218
-
219
- mix_cache_path = os.path.join(mix_cache_dir, mix_basename + ".npy")
220
- inst_cache_path = os.path.join(inst_cache_dir, inst_basename + ".npy")
221
-
222
- if os.path.exists(mix_cache_path) and os.path.exists(inst_cache_path):
223
- X_spec_m = np.load(mix_cache_path)
224
- y_spec_m = np.load(inst_cache_path)
225
- else:
226
- X_wave, y_wave, X_spec_s, y_spec_s = {}, {}, {}, {}
227
-
228
- for d in range(len(mp.param["band"]), 0, -1):
229
- bp = mp.param["band"][d]
230
-
231
- if d == len(mp.param["band"]): # high-end band
232
- X_wave[d], _ = librosa.load(
233
- mix_path, bp["sr"], False, dtype=np.float32, res_type=bp["res_type"]
234
- )
235
- y_wave[d], _ = librosa.load(
236
- inst_path,
237
- bp["sr"],
238
- False,
239
- dtype=np.float32,
240
- res_type=bp["res_type"],
241
- )
242
- else: # lower bands
243
- X_wave[d] = librosa.resample(
244
- X_wave[d + 1],
245
- mp.param["band"][d + 1]["sr"],
246
- bp["sr"],
247
- res_type=bp["res_type"],
248
- )
249
- y_wave[d] = librosa.resample(
250
- y_wave[d + 1],
251
- mp.param["band"][d + 1]["sr"],
252
- bp["sr"],
253
- res_type=bp["res_type"],
254
- )
255
-
256
- X_wave[d], y_wave[d] = align_wave_head_and_tail(X_wave[d], y_wave[d])
257
-
258
- X_spec_s[d] = wave_to_spectrogram(
259
- X_wave[d],
260
- bp["hl"],
261
- bp["n_fft"],
262
- mp.param["mid_side"],
263
- mp.param["mid_side_b2"],
264
- mp.param["reverse"],
265
- )
266
- y_spec_s[d] = wave_to_spectrogram(
267
- y_wave[d],
268
- bp["hl"],
269
- bp["n_fft"],
270
- mp.param["mid_side"],
271
- mp.param["mid_side_b2"],
272
- mp.param["reverse"],
273
- )
274
-
275
- del X_wave, y_wave
276
-
277
- X_spec_m = combine_spectrograms(X_spec_s, mp)
278
- y_spec_m = combine_spectrograms(y_spec_s, mp)
279
-
280
- if X_spec_m.shape != y_spec_m.shape:
281
- raise ValueError("The combined spectrograms are different: " + mix_path)
282
-
283
- _, ext = os.path.splitext(mix_path)
284
-
285
- np.save(mix_cache_path, X_spec_m)
286
- np.save(inst_cache_path, y_spec_m)
287
-
288
- return X_spec_m, y_spec_m
289
-
290
-
291
- def spectrogram_to_wave(spec, hop_length, mid_side, mid_side_b2, reverse):
292
- spec_left = np.asfortranarray(spec[0])
293
- spec_right = np.asfortranarray(spec[1])
294
-
295
- wave_left = librosa.istft(spec_left, hop_length=hop_length)
296
- wave_right = librosa.istft(spec_right, hop_length=hop_length)
297
-
298
- if reverse:
299
- return np.asfortranarray([np.flip(wave_left), np.flip(wave_right)])
300
- elif mid_side:
301
- return np.asfortranarray(
302
- [np.add(wave_left, wave_right / 2), np.subtract(wave_left, wave_right / 2)]
303
- )
304
- elif mid_side_b2:
305
- return np.asfortranarray(
306
- [
307
- np.add(wave_right / 1.25, 0.4 * wave_left),
308
- np.subtract(wave_left / 1.25, 0.4 * wave_right),
309
- ]
310
- )
311
- else:
312
- return np.asfortranarray([wave_left, wave_right])
313
-
314
-
315
- def spectrogram_to_wave_mt(spec, hop_length, mid_side, reverse, mid_side_b2):
316
- import threading
317
-
318
- spec_left = np.asfortranarray(spec[0])
319
- spec_right = np.asfortranarray(spec[1])
320
-
321
- def run_thread(**kwargs):
322
- global wave_left
323
- wave_left = librosa.istft(**kwargs)
324
-
325
- thread = threading.Thread(
326
- target=run_thread, kwargs={"stft_matrix": spec_left, "hop_length": hop_length}
327
- )
328
- thread.start()
329
- wave_right = librosa.istft(spec_right, hop_length=hop_length)
330
- thread.join()
331
-
332
- if reverse:
333
- return np.asfortranarray([np.flip(wave_left), np.flip(wave_right)])
334
- elif mid_side:
335
- return np.asfortranarray(
336
- [np.add(wave_left, wave_right / 2), np.subtract(wave_left, wave_right / 2)]
337
- )
338
- elif mid_side_b2:
339
- return np.asfortranarray(
340
- [
341
- np.add(wave_right / 1.25, 0.4 * wave_left),
342
- np.subtract(wave_left / 1.25, 0.4 * wave_right),
343
- ]
344
- )
345
- else:
346
- return np.asfortranarray([wave_left, wave_right])
347
-
348
-
349
- def cmb_spectrogram_to_wave(spec_m, mp, extra_bins_h=None, extra_bins=None):
350
- wave_band = {}
351
- bands_n = len(mp.param["band"])
352
- offset = 0
353
-
354
- for d in range(1, bands_n + 1):
355
- bp = mp.param["band"][d]
356
- spec_s = np.ndarray(
357
- shape=(2, bp["n_fft"] // 2 + 1, spec_m.shape[2]), dtype=complex
358
- )
359
- h = bp["crop_stop"] - bp["crop_start"]
360
- spec_s[:, bp["crop_start"] : bp["crop_stop"], :] = spec_m[
361
- :, offset : offset + h, :
362
- ]
363
-
364
- offset += h
365
- if d == bands_n: # higher
366
- if extra_bins_h: # if --high_end_process bypass
367
- max_bin = bp["n_fft"] // 2
368
- spec_s[:, max_bin - extra_bins_h : max_bin, :] = extra_bins[
369
- :, :extra_bins_h, :
370
- ]
371
- if bp["hpf_start"] > 0:
372
- spec_s = fft_hp_filter(spec_s, bp["hpf_start"], bp["hpf_stop"] - 1)
373
- if bands_n == 1:
374
- wave = spectrogram_to_wave(
375
- spec_s,
376
- bp["hl"],
377
- mp.param["mid_side"],
378
- mp.param["mid_side_b2"],
379
- mp.param["reverse"],
380
- )
381
- else:
382
- wave = np.add(
383
- wave,
384
- spectrogram_to_wave(
385
- spec_s,
386
- bp["hl"],
387
- mp.param["mid_side"],
388
- mp.param["mid_side_b2"],
389
- mp.param["reverse"],
390
- ),
391
- )
392
- else:
393
- sr = mp.param["band"][d + 1]["sr"]
394
- if d == 1: # lower
395
- spec_s = fft_lp_filter(spec_s, bp["lpf_start"], bp["lpf_stop"])
396
- wave = librosa.resample(
397
- spectrogram_to_wave(
398
- spec_s,
399
- bp["hl"],
400
- mp.param["mid_side"],
401
- mp.param["mid_side_b2"],
402
- mp.param["reverse"],
403
- ),
404
- bp["sr"],
405
- sr,
406
- res_type="sinc_fastest",
407
- )
408
- else: # mid
409
- spec_s = fft_hp_filter(spec_s, bp["hpf_start"], bp["hpf_stop"] - 1)
410
- spec_s = fft_lp_filter(spec_s, bp["lpf_start"], bp["lpf_stop"])
411
- wave2 = np.add(
412
- wave,
413
- spectrogram_to_wave(
414
- spec_s,
415
- bp["hl"],
416
- mp.param["mid_side"],
417
- mp.param["mid_side_b2"],
418
- mp.param["reverse"],
419
- ),
420
- )
421
- # wave = librosa.core.resample(wave2, bp['sr'], sr, res_type="sinc_fastest")
422
- wave = librosa.core.resample(wave2, bp["sr"], sr, res_type="scipy")
423
-
424
- return wave.T
425
-
426
-
427
- def fft_lp_filter(spec, bin_start, bin_stop):
428
- g = 1.0
429
- for b in range(bin_start, bin_stop):
430
- g -= 1 / (bin_stop - bin_start)
431
- spec[:, b, :] = g * spec[:, b, :]
432
-
433
- spec[:, bin_stop:, :] *= 0
434
-
435
- return spec
436
-
437
-
438
- def fft_hp_filter(spec, bin_start, bin_stop):
439
- g = 1.0
440
- for b in range(bin_start, bin_stop, -1):
441
- g -= 1 / (bin_start - bin_stop)
442
- spec[:, b, :] = g * spec[:, b, :]
443
-
444
- spec[:, 0 : bin_stop + 1, :] *= 0
445
-
446
- return spec
447
-
448
-
449
- def mirroring(a, spec_m, input_high_end, mp):
450
- if "mirroring" == a:
451
- mirror = np.flip(
452
- np.abs(
453
- spec_m[
454
- :,
455
- mp.param["pre_filter_start"]
456
- - 10
457
- - input_high_end.shape[1] : mp.param["pre_filter_start"]
458
- - 10,
459
- :,
460
- ]
461
- ),
462
- 1,
463
- )
464
- mirror = mirror * np.exp(1.0j * np.angle(input_high_end))
465
-
466
- return np.where(
467
- np.abs(input_high_end) <= np.abs(mirror), input_high_end, mirror
468
- )
469
-
470
- if "mirroring2" == a:
471
- mirror = np.flip(
472
- np.abs(
473
- spec_m[
474
- :,
475
- mp.param["pre_filter_start"]
476
- - 10
477
- - input_high_end.shape[1] : mp.param["pre_filter_start"]
478
- - 10,
479
- :,
480
- ]
481
- ),
482
- 1,
483
- )
484
- mi = np.multiply(mirror, input_high_end * 1.7)
485
-
486
- return np.where(np.abs(input_high_end) <= np.abs(mi), input_high_end, mi)
487
-
488
-
489
- def ensembling(a, specs):
490
- for i in range(1, len(specs)):
491
- if i == 1:
492
- spec = specs[0]
493
-
494
- ln = min([spec.shape[2], specs[i].shape[2]])
495
- spec = spec[:, :, :ln]
496
- specs[i] = specs[i][:, :, :ln]
497
-
498
- if "min_mag" == a:
499
- spec = np.where(np.abs(specs[i]) <= np.abs(spec), specs[i], spec)
500
- if "max_mag" == a:
501
- spec = np.where(np.abs(specs[i]) >= np.abs(spec), specs[i], spec)
502
-
503
- return spec
504
-
505
-
506
- def stft(wave, nfft, hl):
507
- wave_left = np.asfortranarray(wave[0])
508
- wave_right = np.asfortranarray(wave[1])
509
- spec_left = librosa.stft(wave_left, nfft, hop_length=hl)
510
- spec_right = librosa.stft(wave_right, nfft, hop_length=hl)
511
- spec = np.asfortranarray([spec_left, spec_right])
512
-
513
- return spec
514
-
515
-
516
- def istft(spec, hl):
517
- spec_left = np.asfortranarray(spec[0])
518
- spec_right = np.asfortranarray(spec[1])
519
-
520
- wave_left = librosa.istft(spec_left, hop_length=hl)
521
- wave_right = librosa.istft(spec_right, hop_length=hl)
522
- wave = np.asfortranarray([wave_left, wave_right])
523
-
524
-
525
- if __name__ == "__main__":
526
- import argparse
527
- import sys
528
- import time
529
-
530
- import cv2
531
- from model_param_init import ModelParameters
532
-
533
- p = argparse.ArgumentParser()
534
- p.add_argument(
535
- "--algorithm",
536
- "-a",
537
- type=str,
538
- choices=["invert", "invert_p", "min_mag", "max_mag", "deep", "align"],
539
- default="min_mag",
540
- )
541
- p.add_argument(
542
- "--model_params",
543
- "-m",
544
- type=str,
545
- default=os.path.join("modelparams", "1band_sr44100_hl512.json"),
546
- )
547
- p.add_argument("--output_name", "-o", type=str, default="output")
548
- p.add_argument("--vocals_only", "-v", action="store_true")
549
- p.add_argument("input", nargs="+")
550
- args = p.parse_args()
551
-
552
- start_time = time.time()
553
-
554
- if args.algorithm.startswith("invert") and len(args.input) != 2:
555
- raise ValueError("There should be two input files.")
556
-
557
- if not args.algorithm.startswith("invert") and len(args.input) < 2:
558
- raise ValueError("There must be at least two input files.")
559
-
560
- wave, specs = {}, {}
561
- mp = ModelParameters(args.model_params)
562
-
563
- for i in range(len(args.input)):
564
- spec = {}
565
-
566
- for d in range(len(mp.param["band"]), 0, -1):
567
- bp = mp.param["band"][d]
568
-
569
- if d == len(mp.param["band"]): # high-end band
570
- wave[d], _ = librosa.load(
571
- args.input[i],
572
- bp["sr"],
573
- False,
574
- dtype=np.float32,
575
- res_type=bp["res_type"],
576
- )
577
-
578
- if len(wave[d].shape) == 1: # mono to stereo
579
- wave[d] = np.array([wave[d], wave[d]])
580
- else: # lower bands
581
- wave[d] = librosa.resample(
582
- wave[d + 1],
583
- mp.param["band"][d + 1]["sr"],
584
- bp["sr"],
585
- res_type=bp["res_type"],
586
- )
587
-
588
- spec[d] = wave_to_spectrogram(
589
- wave[d],
590
- bp["hl"],
591
- bp["n_fft"],
592
- mp.param["mid_side"],
593
- mp.param["mid_side_b2"],
594
- mp.param["reverse"],
595
- )
596
-
597
- specs[i] = combine_spectrograms(spec, mp)
598
-
599
- del wave
600
-
601
- if args.algorithm == "deep":
602
- d_spec = np.where(np.abs(specs[0]) <= np.abs(spec[1]), specs[0], spec[1])
603
- v_spec = d_spec - specs[1]
604
- sf.write(
605
- os.path.join("{}.wav".format(args.output_name)),
606
- cmb_spectrogram_to_wave(v_spec, mp),
607
- mp.param["sr"],
608
- )
609
-
610
- if args.algorithm.startswith("invert"):
611
- ln = min([specs[0].shape[2], specs[1].shape[2]])
612
- specs[0] = specs[0][:, :, :ln]
613
- specs[1] = specs[1][:, :, :ln]
614
-
615
- if "invert_p" == args.algorithm:
616
- X_mag = np.abs(specs[0])
617
- y_mag = np.abs(specs[1])
618
- max_mag = np.where(X_mag >= y_mag, X_mag, y_mag)
619
- v_spec = specs[1] - max_mag * np.exp(1.0j * np.angle(specs[0]))
620
- else:
621
- specs[1] = reduce_vocal_aggressively(specs[0], specs[1], 0.2)
622
- v_spec = specs[0] - specs[1]
623
-
624
- if not args.vocals_only:
625
- X_mag = np.abs(specs[0])
626
- y_mag = np.abs(specs[1])
627
- v_mag = np.abs(v_spec)
628
-
629
- X_image = spectrogram_to_image(X_mag)
630
- y_image = spectrogram_to_image(y_mag)
631
- v_image = spectrogram_to_image(v_mag)
632
-
633
- cv2.imwrite("{}_X.png".format(args.output_name), X_image)
634
- cv2.imwrite("{}_y.png".format(args.output_name), y_image)
635
- cv2.imwrite("{}_v.png".format(args.output_name), v_image)
636
-
637
- sf.write(
638
- "{}_X.wav".format(args.output_name),
639
- cmb_spectrogram_to_wave(specs[0], mp),
640
- mp.param["sr"],
641
- )
642
- sf.write(
643
- "{}_y.wav".format(args.output_name),
644
- cmb_spectrogram_to_wave(specs[1], mp),
645
- mp.param["sr"],
646
- )
647
-
648
- sf.write(
649
- "{}_v.wav".format(args.output_name),
650
- cmb_spectrogram_to_wave(v_spec, mp),
651
- mp.param["sr"],
652
- )
653
- else:
654
- if not args.algorithm == "deep":
655
- sf.write(
656
- os.path.join("ensembled", "{}.wav".format(args.output_name)),
657
- cmb_spectrogram_to_wave(ensembling(args.algorithm, specs), mp),
658
- mp.param["sr"],
659
- )
660
-
661
- if args.algorithm == "align":
662
- trackalignment = [
663
- {
664
- "file1": '"{}"'.format(args.input[0]),
665
- "file2": '"{}"'.format(args.input[1]),
666
- }
667
- ]
668
-
669
- for i, e in tqdm(enumerate(trackalignment), desc="Performing Alignment..."):
670
- os.system(f"python lib/align_tracks.py {e['file1']} {e['file2']}")
671
-
672
- # print('Total time: {0:.{1}f}s'.format(time.time() - start_time, 1))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/A666sxr/Genshin_TTS/stft_loss.py DELETED
@@ -1,136 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
-
3
- # Copyright 2019 Tomoki Hayashi
4
- # MIT License (https://opensource.org/licenses/MIT)
5
-
6
- """STFT-based Loss modules."""
7
-
8
- import torch
9
- import torch.nn.functional as F
10
-
11
-
12
- def stft(x, fft_size, hop_size, win_length, window):
13
- """Perform STFT and convert to magnitude spectrogram.
14
- Args:
15
- x (Tensor): Input signal tensor (B, T).
16
- fft_size (int): FFT size.
17
- hop_size (int): Hop size.
18
- win_length (int): Window length.
19
- window (str): Window function type.
20
- Returns:
21
- Tensor: Magnitude spectrogram (B, #frames, fft_size // 2 + 1).
22
- """
23
- x_stft = torch.stft(x, fft_size, hop_size, win_length, window.to(x.device))
24
- real = x_stft[..., 0]
25
- imag = x_stft[..., 1]
26
-
27
- # NOTE(kan-bayashi): clamp is needed to avoid nan or inf
28
- return torch.sqrt(torch.clamp(real ** 2 + imag ** 2, min=1e-7)).transpose(2, 1)
29
-
30
-
31
- class SpectralConvergengeLoss(torch.nn.Module):
32
- """Spectral convergence loss module."""
33
-
34
- def __init__(self):
35
- """Initilize spectral convergence loss module."""
36
- super(SpectralConvergengeLoss, self).__init__()
37
-
38
- def forward(self, x_mag, y_mag):
39
- """Calculate forward propagation.
40
- Args:
41
- x_mag (Tensor): Magnitude spectrogram of predicted signal (B, #frames, #freq_bins).
42
- y_mag (Tensor): Magnitude spectrogram of groundtruth signal (B, #frames, #freq_bins).
43
- Returns:
44
- Tensor: Spectral convergence loss value.
45
- """
46
- return torch.norm(y_mag - x_mag, p="fro") / torch.norm(y_mag, p="fro")
47
-
48
-
49
- class LogSTFTMagnitudeLoss(torch.nn.Module):
50
- """Log STFT magnitude loss module."""
51
-
52
- def __init__(self):
53
- """Initilize los STFT magnitude loss module."""
54
- super(LogSTFTMagnitudeLoss, self).__init__()
55
-
56
- def forward(self, x_mag, y_mag):
57
- """Calculate forward propagation.
58
- Args:
59
- x_mag (Tensor): Magnitude spectrogram of predicted signal (B, #frames, #freq_bins).
60
- y_mag (Tensor): Magnitude spectrogram of groundtruth signal (B, #frames, #freq_bins).
61
- Returns:
62
- Tensor: Log STFT magnitude loss value.
63
- """
64
- return F.l1_loss(torch.log(y_mag), torch.log(x_mag))
65
-
66
-
67
- class STFTLoss(torch.nn.Module):
68
- """STFT loss module."""
69
-
70
- def __init__(self, fft_size=1024, shift_size=120, win_length=600, window="hann_window"):
71
- """Initialize STFT loss module."""
72
- super(STFTLoss, self).__init__()
73
- self.fft_size = fft_size
74
- self.shift_size = shift_size
75
- self.win_length = win_length
76
- self.window = getattr(torch, window)(win_length)
77
- self.spectral_convergenge_loss = SpectralConvergengeLoss()
78
- self.log_stft_magnitude_loss = LogSTFTMagnitudeLoss()
79
-
80
- def forward(self, x, y):
81
- """Calculate forward propagation.
82
- Args:
83
- x (Tensor): Predicted signal (B, T).
84
- y (Tensor): Groundtruth signal (B, T).
85
- Returns:
86
- Tensor: Spectral convergence loss value.
87
- Tensor: Log STFT magnitude loss value.
88
- """
89
- x_mag = stft(x, self.fft_size, self.shift_size, self.win_length, self.window)
90
- y_mag = stft(y, self.fft_size, self.shift_size, self.win_length, self.window)
91
- sc_loss = self.spectral_convergenge_loss(x_mag, y_mag)
92
- mag_loss = self.log_stft_magnitude_loss(x_mag, y_mag)
93
-
94
- return sc_loss, mag_loss
95
-
96
-
97
- class MultiResolutionSTFTLoss(torch.nn.Module):
98
- """Multi resolution STFT loss module."""
99
-
100
- def __init__(self,
101
- fft_sizes=[1024, 2048, 512],
102
- hop_sizes=[120, 240, 50],
103
- win_lengths=[600, 1200, 240],
104
- window="hann_window"):
105
- """Initialize Multi resolution STFT loss module.
106
- Args:
107
- fft_sizes (list): List of FFT sizes.
108
- hop_sizes (list): List of hop sizes.
109
- win_lengths (list): List of window lengths.
110
- window (str): Window function type.
111
- """
112
- super(MultiResolutionSTFTLoss, self).__init__()
113
- assert len(fft_sizes) == len(hop_sizes) == len(win_lengths)
114
- self.stft_losses = torch.nn.ModuleList()
115
- for fs, ss, wl in zip(fft_sizes, hop_sizes, win_lengths):
116
- self.stft_losses += [STFTLoss(fs, ss, wl, window)]
117
-
118
- def forward(self, x, y):
119
- """Calculate forward propagation.
120
- Args:
121
- x (Tensor): Predicted signal (B, T).
122
- y (Tensor): Groundtruth signal (B, T).
123
- Returns:
124
- Tensor: Multi resolution spectral convergence loss value.
125
- Tensor: Multi resolution log STFT magnitude loss value.
126
- """
127
- sc_loss = 0.0
128
- mag_loss = 0.0
129
- for f in self.stft_losses:
130
- sc_l, mag_l = f(x, y)
131
- sc_loss += sc_l
132
- mag_loss += mag_l
133
- sc_loss /= len(self.stft_losses)
134
- mag_loss /= len(self.stft_losses)
135
-
136
- return sc_loss, mag_loss
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/AIFILMS/audioldm-text-to-audio-generation/audioldm/variational_autoencoder/autoencoder.py DELETED
@@ -1,102 +0,0 @@
1
- import torch
2
- from audioldm.latent_diffusion.ema import *
3
- from audioldm.variational_autoencoder.modules import Encoder, Decoder
4
- from audioldm.variational_autoencoder.distributions import DiagonalGaussianDistribution
5
-
6
- from audioldm.hifigan.utilities import get_vocoder, vocoder_infer
7
-
8
- class AutoencoderKL(nn.Module):
9
- def __init__(
10
- self,
11
- ddconfig=None,
12
- lossconfig=None,
13
- image_key="fbank",
14
- embed_dim=None,
15
- time_shuffle=1,
16
- subband=1,
17
- ckpt_path=None,
18
- reload_from_ckpt=None,
19
- ignore_keys=[],
20
- colorize_nlabels=None,
21
- monitor=None,
22
- base_learning_rate=1e-5,
23
- ):
24
- super().__init__()
25
-
26
- self.encoder = Encoder(**ddconfig)
27
- self.decoder = Decoder(**ddconfig)
28
-
29
- self.subband = int(subband)
30
-
31
- if self.subband > 1:
32
- print("Use subband decomposition %s" % self.subband)
33
-
34
- self.quant_conv = torch.nn.Conv2d(2 * ddconfig["z_channels"], 2 * embed_dim, 1)
35
- self.post_quant_conv = torch.nn.Conv2d(embed_dim, ddconfig["z_channels"], 1)
36
-
37
- self.vocoder = get_vocoder(None, "cpu")
38
- self.embed_dim = embed_dim
39
-
40
- if monitor is not None:
41
- self.monitor = monitor
42
-
43
- self.time_shuffle = time_shuffle
44
- self.reload_from_ckpt = reload_from_ckpt
45
- self.reloaded = False
46
- self.mean, self.std = None, None
47
-
48
- def encode(self, x):
49
- # x = self.time_shuffle_operation(x)
50
- x = self.freq_split_subband(x)
51
- h = self.encoder(x)
52
- moments = self.quant_conv(h)
53
- posterior = DiagonalGaussianDistribution(moments)
54
- return posterior
55
-
56
- def decode(self, z):
57
- z = self.post_quant_conv(z)
58
- dec = self.decoder(z)
59
- dec = self.freq_merge_subband(dec)
60
- return dec
61
-
62
- def decode_to_waveform(self, dec):
63
- dec = dec.squeeze(1).permute(0, 2, 1)
64
- wav_reconstruction = vocoder_infer(dec, self.vocoder)
65
- return wav_reconstruction
66
-
67
- def forward(self, input, sample_posterior=True):
68
- posterior = self.encode(input)
69
- if sample_posterior:
70
- z = posterior.sample()
71
- else:
72
- z = posterior.mode()
73
-
74
- if self.flag_first_run:
75
- print("Latent size: ", z.size())
76
- self.flag_first_run = False
77
-
78
- dec = self.decode(z)
79
-
80
- return dec, posterior
81
-
82
- def freq_split_subband(self, fbank):
83
- if self.subband == 1 or self.image_key != "stft":
84
- return fbank
85
-
86
- bs, ch, tstep, fbins = fbank.size()
87
-
88
- assert fbank.size(-1) % self.subband == 0
89
- assert ch == 1
90
-
91
- return (
92
- fbank.squeeze(1)
93
- .reshape(bs, tstep, self.subband, fbins // self.subband)
94
- .permute(0, 2, 1, 3)
95
- )
96
-
97
- def freq_merge_subband(self, subband_fbank):
98
- if self.subband == 1 or self.image_key != "stft":
99
- return subband_fbank
100
- assert subband_fbank.size(1) == self.subband # Channel dimension
101
- bs, sub_ch, tstep, fbins = subband_fbank.size()
102
- return subband_fbank.permute(0, 2, 1, 3).reshape(bs, tstep, -1).unsqueeze(1)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/ALSv/FSW/roop/typing.py DELETED
@@ -1,7 +0,0 @@
1
- from typing import Any
2
-
3
- from insightface.app.common import Face
4
- import numpy
5
-
6
- Face = Face
7
- Frame = numpy.ndarray[Any, Any]
 
 
 
 
 
 
 
 
spaces/AQaTaHaGoD/GoD/README.md DELETED
@@ -1,12 +0,0 @@
1
- ---
2
- title: GoD
3
- emoji: 🌍
4
- colorFrom: red
5
- colorTo: blue
6
- sdk: streamlit
7
- sdk_version: 1.15.2
8
- app_file: app.py
9
- pinned: false
10
- ---
11
-
12
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/ATang0729/Forecast4Muses/Model/Model6/Model6_2_ProfileRecogition/mmpretrain/configs/_base_/models/resnest200.py DELETED
@@ -1,25 +0,0 @@
1
- # model settings
2
- model = dict(
3
- type='ImageClassifier',
4
- backbone=dict(
5
- type='ResNeSt',
6
- depth=200,
7
- num_stages=4,
8
- stem_channels=128,
9
- out_indices=(3, ),
10
- style='pytorch'),
11
- neck=dict(type='GlobalAveragePooling'),
12
- head=dict(
13
- type='LinearClsHead',
14
- num_classes=1000,
15
- in_channels=2048,
16
- loss=dict(
17
- type='LabelSmoothLoss',
18
- label_smooth_val=0.1,
19
- num_classes=1000,
20
- reduction='mean',
21
- loss_weight=1.0),
22
- topk=(1, 5),
23
- cal_acc=False),
24
- train_cfg=dict(augments=dict(type='Mixup', alpha=0.2)),
25
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Abhaykoul/Youtube_video_downloader/app.py DELETED
@@ -1,59 +0,0 @@
1
- import streamlit as st
2
- from pytube import YouTube
3
-
4
- class YouTubeDownloader:
5
- @staticmethod
6
- def run():
7
- st.header("YouTube Video Downloader")
8
- url = st.text_input("Enter YouTube URL to download:")
9
- if url:
10
- YouTubeDownloader.validate_url(url)
11
- with st.expander("preview video"):
12
- st.video(url)
13
- if st.button("Download"):
14
- YouTubeDownloader.cleanup()
15
- file_ = YouTubeDownloader.download_video(url)
16
- st.video(file_)
17
- YouTubeDownloader.helper_message()
18
- st.markdown("> App made by Abhay Koul ([HelpingAI on GitHub](https://github.com/HelpingAI))")
19
-
20
-
21
- @staticmethod
22
- def download_video(url):
23
- with st.spinner("Downloading..."):
24
- local_file = (
25
- YouTube(url)
26
- .streams.filter(progressive=True, file_extension="mp4")
27
- .first()
28
- .download()
29
- )
30
- st.success("Downloaded")
31
- return local_file
32
-
33
- @staticmethod
34
- def validate_url(url):
35
- import validators
36
-
37
- if not validators.url(url):
38
- st.error("Hi there 👋 URL seems invalid 👽")
39
- st.stop()
40
-
41
- @classmethod
42
- def cleanup(cls):
43
- import pathlib
44
- import glob
45
-
46
- junks = glob.glob("*.mp4")
47
- for junk in junks:
48
- pathlib.Path(junk).unlink()
49
-
50
- @classmethod
51
- def helper_message(cls):
52
- st.write(
53
- "> To save the video to local computer, "
54
- "click the vertical ... icon (aka hamburger button) in the bottom-right corner (in the video above) and click download."
55
- )
56
-
57
-
58
- if __name__ == "__main__":
59
- YouTubeDownloader.run()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Amrrs/DragGan-Inversion/stylegan_human/openpose/src/util.py DELETED
@@ -1,106 +0,0 @@
1
- import numpy as np
2
- import math
3
- import cv2
4
- import matplotlib
5
- from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
6
- from matplotlib.figure import Figure
7
- import numpy as np
8
- import matplotlib.pyplot as plt
9
- import cv2
10
-
11
-
12
- def padRightDownCorner(img, stride, padValue):
13
- h = img.shape[0]
14
- w = img.shape[1]
15
-
16
- pad = 4 * [None]
17
- pad[0] = 0 # up
18
- pad[1] = 0 # left
19
- pad[2] = 0 if (h % stride == 0) else stride - (h % stride) # down
20
- pad[3] = 0 if (w % stride == 0) else stride - (w % stride) # right
21
-
22
- img_padded = img
23
- pad_up = np.tile(img_padded[0:1, :, :]*0 + padValue, (pad[0], 1, 1))
24
- img_padded = np.concatenate((pad_up, img_padded), axis=0)
25
- pad_left = np.tile(img_padded[:, 0:1, :]*0 + padValue, (1, pad[1], 1))
26
- img_padded = np.concatenate((pad_left, img_padded), axis=1)
27
- pad_down = np.tile(img_padded[-2:-1, :, :]*0 + padValue, (pad[2], 1, 1))
28
- img_padded = np.concatenate((img_padded, pad_down), axis=0)
29
- pad_right = np.tile(img_padded[:, -2:-1, :]*0 + padValue, (1, pad[3], 1))
30
- img_padded = np.concatenate((img_padded, pad_right), axis=1)
31
-
32
- return img_padded, pad
33
-
34
- # transfer caffe model to pytorch which will match the layer name
35
-
36
-
37
- def transfer(model, model_weights):
38
- transfered_model_weights = {}
39
- for weights_name in model.state_dict().keys():
40
- transfered_model_weights[weights_name] = model_weights['.'.join(
41
- weights_name.split('.')[1:])]
42
- return transfered_model_weights
43
-
44
- # draw the body keypoint and lims
45
-
46
-
47
- def draw_bodypose(canvas, candidate, subset, show_number=False):
48
- stickwidth = 4
49
- limbSeq = [[2, 3], [2, 6], [3, 4], [4, 5], [6, 7], [7, 8], [2, 9], [9, 10],
50
- [10, 11], [2, 12], [12, 13], [13, 14], [2, 1], [1, 15], [15, 17],
51
- [1, 16], [16, 18], [3, 17], [6, 18]]
52
-
53
- colors = [[255, 0, 0], [255, 85, 0], [255, 170, 0], [255, 255, 0], [170, 255, 0], [85, 255, 0], [0, 255, 0],
54
- [0, 255, 85], [0, 255, 170], [0, 255, 255], [
55
- 0, 170, 255], [0, 85, 255], [0, 0, 255], [85, 0, 255],
56
- [170, 0, 255], [255, 0, 255], [255, 0, 170], [255, 0, 85]]
57
- for i in range(18):
58
- for n in range(len(subset)):
59
- index = int(subset[n][i])
60
- if index == -1:
61
- continue
62
- x, y = candidate[index][0:2]
63
- cv2.circle(canvas, (int(x), int(y)), 4, colors[i], thickness=-1)
64
- if show_number:
65
- cv2.putText(canvas, f'{index}', (int(x), int(y)), cv2.FONT_HERSHEY_SIMPLEX, 0.6,
66
- (255, 255, 0), 1, cv2.LINE_AA)
67
- # calc and print average
68
- for i in range(17):
69
- for n in range(len(subset)):
70
- index = subset[n][np.array(limbSeq[i]) - 1]
71
- if -1 in index:
72
- continue
73
- cur_canvas = canvas.copy()
74
- Y = candidate[index.astype(int), 0]
75
- X = candidate[index.astype(int), 1]
76
- mX = np.mean(X)
77
- mY = np.mean(Y)
78
- length = ((X[0] - X[1]) ** 2 + (Y[0] - Y[1]) ** 2) ** 0.5
79
- angle = math.degrees(math.atan2(X[0] - X[1], Y[0] - Y[1]))
80
- polygon = cv2.ellipse2Poly((int(mY), int(mX)), (int(
81
- length / 2), stickwidth), int(angle), 0, 360, 1)
82
- cv2.fillConvexPoly(cur_canvas, polygon, colors[i])
83
- canvas = cv2.addWeighted(canvas, 0.4, cur_canvas, 0.6, 0)
84
-
85
- return canvas
86
-
87
- # get max index of 2d array
88
-
89
-
90
- def npmax(array):
91
- arrayindex = array.argmax(1)
92
- arrayvalue = array.max(1)
93
- i = arrayvalue.argmax()
94
- j = arrayindex[i]
95
- return i, j
96
-
97
- # get max index of 2d array
98
-
99
-
100
- def npmax_with_score(array):
101
- arrayindex = array.argmax(1)
102
- arrayvalue = array.max(1)
103
- i = arrayvalue.argmax()
104
- j = arrayindex[i]
105
- score = array[i][j]
106
- return i, j, score
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Amrrs/DragGan-Inversion/torch_utils/ops/filtered_lrelu.cpp DELETED
@@ -1,300 +0,0 @@
1
- // Copyright (c) 2021, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2
- //
3
- // NVIDIA CORPORATION and its licensors retain all intellectual property
4
- // and proprietary rights in and to this software, related documentation
5
- // and any modifications thereto. Any use, reproduction, disclosure or
6
- // distribution of this software and related documentation without an express
7
- // license agreement from NVIDIA CORPORATION is strictly prohibited.
8
-
9
- #include <torch/extension.h>
10
- #include <ATen/cuda/CUDAContext.h>
11
- #include <c10/cuda/CUDAGuard.h>
12
- #include "filtered_lrelu.h"
13
-
14
- //------------------------------------------------------------------------
15
-
16
- static std::tuple<torch::Tensor, torch::Tensor, int> filtered_lrelu(
17
- torch::Tensor x, torch::Tensor fu, torch::Tensor fd, torch::Tensor b, torch::Tensor si,
18
- int up, int down, int px0, int px1, int py0, int py1, int sx, int sy, float gain, float slope, float clamp, bool flip_filters, bool writeSigns)
19
- {
20
- // Set CUDA device.
21
- TORCH_CHECK(x.is_cuda(), "x must reside on CUDA device");
22
- const at::cuda::OptionalCUDAGuard device_guard(device_of(x));
23
-
24
- // Validate arguments.
25
- TORCH_CHECK(fu.device() == x.device() && fd.device() == x.device() && b.device() == x.device(), "all input tensors must reside on the same device");
26
- TORCH_CHECK(fu.dtype() == torch::kFloat && fd.dtype() == torch::kFloat, "fu and fd must be float32");
27
- TORCH_CHECK(b.dtype() == x.dtype(), "x and b must have the same dtype");
28
- TORCH_CHECK(x.dtype() == torch::kHalf || x.dtype() == torch::kFloat, "x and b must be float16 or float32");
29
- TORCH_CHECK(x.dim() == 4, "x must be rank 4");
30
- TORCH_CHECK(x.size(0) * x.size(1) <= INT_MAX && x.size(2) <= INT_MAX && x.size(3) <= INT_MAX, "x is too large");
31
- TORCH_CHECK(x.numel() > 0, "x is empty");
32
- TORCH_CHECK((fu.dim() == 1 || fu.dim() == 2) && (fd.dim() == 1 || fd.dim() == 2), "fu and fd must be rank 1 or 2");
33
- TORCH_CHECK(fu.size(0) <= INT_MAX && fu.size(-1) <= INT_MAX, "fu is too large");
34
- TORCH_CHECK(fd.size(0) <= INT_MAX && fd.size(-1) <= INT_MAX, "fd is too large");
35
- TORCH_CHECK(fu.numel() > 0, "fu is empty");
36
- TORCH_CHECK(fd.numel() > 0, "fd is empty");
37
- TORCH_CHECK(b.dim() == 1 && b.size(0) == x.size(1), "b must be a vector with the same number of channels as x");
38
- TORCH_CHECK(up >= 1 && down >= 1, "up and down must be at least 1");
39
-
40
- // Figure out how much shared memory is available on the device.
41
- int maxSharedBytes = 0;
42
- AT_CUDA_CHECK(cudaDeviceGetAttribute(&maxSharedBytes, cudaDevAttrMaxSharedMemoryPerBlockOptin, x.device().index()));
43
- int sharedKB = maxSharedBytes >> 10;
44
-
45
- // Populate enough launch parameters to check if a CUDA kernel exists.
46
- filtered_lrelu_kernel_params p;
47
- p.up = up;
48
- p.down = down;
49
- p.fuShape = make_int2((int)fu.size(-1), fu.dim() == 2 ? (int)fu.size(0) : 0); // shape [n, 0] indicates separable filter.
50
- p.fdShape = make_int2((int)fd.size(-1), fd.dim() == 2 ? (int)fd.size(0) : 0);
51
- filtered_lrelu_kernel_spec test_spec = choose_filtered_lrelu_kernel<float, int32_t, false, false>(p, sharedKB);
52
- if (!test_spec.exec)
53
- {
54
- // No kernel found - return empty tensors and indicate missing kernel with return code of -1.
55
- return std::make_tuple(torch::Tensor(), torch::Tensor(), -1);
56
- }
57
-
58
- // Input/output element size.
59
- int64_t sz = (x.dtype() == torch::kHalf) ? 2 : 4;
60
-
61
- // Input sizes.
62
- int64_t xw = (int)x.size(3);
63
- int64_t xh = (int)x.size(2);
64
- int64_t fut_w = (int)fu.size(-1) - 1;
65
- int64_t fut_h = (int)fu.size(0) - 1;
66
- int64_t fdt_w = (int)fd.size(-1) - 1;
67
- int64_t fdt_h = (int)fd.size(0) - 1;
68
-
69
- // Logical size of upsampled buffer.
70
- int64_t cw = xw * up + (px0 + px1) - fut_w;
71
- int64_t ch = xh * up + (py0 + py1) - fut_h;
72
- TORCH_CHECK(cw > fdt_w && ch > fdt_h, "upsampled buffer must be at least the size of downsampling filter");
73
- TORCH_CHECK(cw <= INT_MAX && ch <= INT_MAX, "upsampled buffer is too large");
74
-
75
- // Compute output size and allocate.
76
- int64_t yw = (cw - fdt_w + (down - 1)) / down;
77
- int64_t yh = (ch - fdt_h + (down - 1)) / down;
78
- TORCH_CHECK(yw > 0 && yh > 0, "output must be at least 1x1");
79
- TORCH_CHECK(yw <= INT_MAX && yh <= INT_MAX, "output is too large");
80
- torch::Tensor y = torch::empty({x.size(0), x.size(1), yh, yw}, x.options(), x.suggest_memory_format());
81
-
82
- // Allocate sign tensor.
83
- torch::Tensor so;
84
- torch::Tensor s = si;
85
- bool readSigns = !!s.numel();
86
- int64_t sw_active = 0; // Active width of sign tensor.
87
- if (writeSigns)
88
- {
89
- sw_active = yw * down - (down - 1) + fdt_w; // Active width in elements.
90
- int64_t sh = yh * down - (down - 1) + fdt_h; // Height = active height.
91
- int64_t sw = (sw_active + 15) & ~15; // Width = active width in elements, rounded up to multiple of 16.
92
- TORCH_CHECK(sh <= INT_MAX && (sw >> 2) <= INT_MAX, "signs is too large");
93
- s = so = torch::empty({x.size(0), x.size(1), sh, sw >> 2}, x.options().dtype(torch::kUInt8), at::MemoryFormat::Contiguous);
94
- }
95
- else if (readSigns)
96
- sw_active = s.size(3) << 2;
97
-
98
- // Validate sign tensor if in use.
99
- if (readSigns || writeSigns)
100
- {
101
- TORCH_CHECK(s.is_contiguous(), "signs must be contiguous");
102
- TORCH_CHECK(s.dtype() == torch::kUInt8, "signs must be uint8");
103
- TORCH_CHECK(s.device() == x.device(), "signs must reside on the same device as x");
104
- TORCH_CHECK(s.dim() == 4, "signs must be rank 4");
105
- TORCH_CHECK(s.size(0) == x.size(0) && s.size(1) == x.size(1), "signs must have same batch & channels as x");
106
- TORCH_CHECK(s.size(2) <= INT_MAX && s.size(3) <= INT_MAX, "signs is too large");
107
- }
108
-
109
- // Populate rest of CUDA kernel parameters.
110
- p.x = x.data_ptr();
111
- p.y = y.data_ptr();
112
- p.b = b.data_ptr();
113
- p.s = (readSigns || writeSigns) ? s.data_ptr<unsigned char>() : 0;
114
- p.fu = fu.data_ptr<float>();
115
- p.fd = fd.data_ptr<float>();
116
- p.pad0 = make_int2(px0, py0);
117
- p.gain = gain;
118
- p.slope = slope;
119
- p.clamp = clamp;
120
- p.flip = (flip_filters) ? 1 : 0;
121
- p.xShape = make_int4((int)x.size(3), (int)x.size(2), (int)x.size(1), (int)x.size(0));
122
- p.yShape = make_int4((int)y.size(3), (int)y.size(2), (int)y.size(1), (int)y.size(0));
123
- p.sShape = (readSigns || writeSigns) ? make_int2((int)s.size(3), (int)s.size(2)) : make_int2(0, 0); // Width is in bytes. Contiguous.
124
- p.sOfs = make_int2(sx, sy);
125
- p.swLimit = (sw_active + 3) >> 2; // Rounded up to bytes.
126
-
127
- // x, y, b strides are in bytes.
128
- p.xStride = make_longlong4(sz * x.stride(3), sz * x.stride(2), sz * x.stride(1), sz * x.stride(0));
129
- p.yStride = make_longlong4(sz * y.stride(3), sz * y.stride(2), sz * y.stride(1), sz * y.stride(0));
130
- p.bStride = sz * b.stride(0);
131
-
132
- // fu, fd strides are in elements.
133
- p.fuStride = make_longlong3(fu.stride(-1), fu.dim() == 2 ? fu.stride(0) : 0, 0);
134
- p.fdStride = make_longlong3(fd.stride(-1), fd.dim() == 2 ? fd.stride(0) : 0, 0);
135
-
136
- // Determine if indices don't fit in int32. Support negative strides although Torch currently never produces those.
137
- bool index64b = false;
138
- if (std::abs(p.bStride * x.size(1)) > INT_MAX) index64b = true;
139
- if (std::min(x.size(0) * p.xStride.w, 0ll) + std::min(x.size(1) * p.xStride.z, 0ll) + std::min(x.size(2) * p.xStride.y, 0ll) + std::min(x.size(3) * p.xStride.x, 0ll) < -INT_MAX) index64b = true;
140
- if (std::max(x.size(0) * p.xStride.w, 0ll) + std::max(x.size(1) * p.xStride.z, 0ll) + std::max(x.size(2) * p.xStride.y, 0ll) + std::max(x.size(3) * p.xStride.x, 0ll) > INT_MAX) index64b = true;
141
- if (std::min(y.size(0) * p.yStride.w, 0ll) + std::min(y.size(1) * p.yStride.z, 0ll) + std::min(y.size(2) * p.yStride.y, 0ll) + std::min(y.size(3) * p.yStride.x, 0ll) < -INT_MAX) index64b = true;
142
- if (std::max(y.size(0) * p.yStride.w, 0ll) + std::max(y.size(1) * p.yStride.z, 0ll) + std::max(y.size(2) * p.yStride.y, 0ll) + std::max(y.size(3) * p.yStride.x, 0ll) > INT_MAX) index64b = true;
143
- if (s.numel() > INT_MAX) index64b = true;
144
-
145
- // Choose CUDA kernel.
146
- filtered_lrelu_kernel_spec spec = { 0 };
147
- AT_DISPATCH_FLOATING_TYPES_AND_HALF(x.scalar_type(), "filtered_lrelu_cuda", [&]
148
- {
149
- if constexpr (sizeof(scalar_t) <= 4) // Exclude doubles. constexpr prevents template instantiation.
150
- {
151
- // Choose kernel based on index type, datatype and sign read/write modes.
152
- if (!index64b && writeSigns && !readSigns) spec = choose_filtered_lrelu_kernel<scalar_t, int32_t, true, false>(p, sharedKB);
153
- else if (!index64b && !writeSigns && readSigns) spec = choose_filtered_lrelu_kernel<scalar_t, int32_t, false, true >(p, sharedKB);
154
- else if (!index64b && !writeSigns && !readSigns) spec = choose_filtered_lrelu_kernel<scalar_t, int32_t, false, false>(p, sharedKB);
155
- else if ( index64b && writeSigns && !readSigns) spec = choose_filtered_lrelu_kernel<scalar_t, int64_t, true, false>(p, sharedKB);
156
- else if ( index64b && !writeSigns && readSigns) spec = choose_filtered_lrelu_kernel<scalar_t, int64_t, false, true >(p, sharedKB);
157
- else if ( index64b && !writeSigns && !readSigns) spec = choose_filtered_lrelu_kernel<scalar_t, int64_t, false, false>(p, sharedKB);
158
- }
159
- });
160
- TORCH_CHECK(spec.exec, "internal error - CUDA kernel not found") // This should not happen because we tested earlier that kernel exists.
161
-
162
- // Launch CUDA kernel.
163
- void* args[] = {&p};
164
- int bx = spec.numWarps * 32;
165
- int gx = (p.yShape.x - 1) / spec.tileOut.x + 1;
166
- int gy = (p.yShape.y - 1) / spec.tileOut.y + 1;
167
- int gz = p.yShape.z * p.yShape.w;
168
-
169
- // Repeat multiple horizontal tiles in a CTA?
170
- if (spec.xrep)
171
- {
172
- p.tilesXrep = spec.xrep;
173
- p.tilesXdim = gx;
174
-
175
- gx = (gx + p.tilesXrep - 1) / p.tilesXrep;
176
- std::swap(gx, gy);
177
- }
178
- else
179
- {
180
- p.tilesXrep = 0;
181
- p.tilesXdim = 0;
182
- }
183
-
184
- // Launch filter setup kernel.
185
- AT_CUDA_CHECK(cudaLaunchKernel(spec.setup, 1, 1024, args, 0, at::cuda::getCurrentCUDAStream()));
186
-
187
- // Copy kernels to constant memory.
188
- if ( writeSigns && !readSigns) AT_CUDA_CHECK((copy_filters<true, false>(at::cuda::getCurrentCUDAStream())));
189
- else if (!writeSigns && readSigns) AT_CUDA_CHECK((copy_filters<false, true >(at::cuda::getCurrentCUDAStream())));
190
- else if (!writeSigns && !readSigns) AT_CUDA_CHECK((copy_filters<false, false>(at::cuda::getCurrentCUDAStream())));
191
-
192
- // Set cache and shared memory configurations for main kernel.
193
- AT_CUDA_CHECK(cudaFuncSetCacheConfig(spec.exec, cudaFuncCachePreferShared));
194
- if (spec.dynamicSharedKB) // Need dynamically allocated shared memory?
195
- AT_CUDA_CHECK(cudaFuncSetAttribute(spec.exec, cudaFuncAttributeMaxDynamicSharedMemorySize, spec.dynamicSharedKB << 10));
196
- AT_CUDA_CHECK(cudaFuncSetSharedMemConfig(spec.exec, cudaSharedMemBankSizeFourByte));
197
-
198
- // Launch main kernel.
199
- const int maxSubGz = 65535; // CUDA maximum for block z dimension.
200
- for (int zofs=0; zofs < gz; zofs += maxSubGz) // Do multiple launches if gz is too big.
201
- {
202
- p.blockZofs = zofs;
203
- int subGz = std::min(maxSubGz, gz - zofs);
204
- AT_CUDA_CHECK(cudaLaunchKernel(spec.exec, dim3(gx, gy, subGz), bx, args, spec.dynamicSharedKB << 10, at::cuda::getCurrentCUDAStream()));
205
- }
206
-
207
- // Done.
208
- return std::make_tuple(y, so, 0);
209
- }
210
-
211
- //------------------------------------------------------------------------
212
-
213
- static torch::Tensor filtered_lrelu_act(torch::Tensor x, torch::Tensor si, int sx, int sy, float gain, float slope, float clamp, bool writeSigns)
214
- {
215
- // Set CUDA device.
216
- TORCH_CHECK(x.is_cuda(), "x must reside on CUDA device");
217
- const at::cuda::OptionalCUDAGuard device_guard(device_of(x));
218
-
219
- // Validate arguments.
220
- TORCH_CHECK(x.dim() == 4, "x must be rank 4");
221
- TORCH_CHECK(x.size(0) * x.size(1) <= INT_MAX && x.size(2) <= INT_MAX && x.size(3) <= INT_MAX, "x is too large");
222
- TORCH_CHECK(x.numel() > 0, "x is empty");
223
- TORCH_CHECK(x.dtype() == torch::kHalf || x.dtype() == torch::kFloat || x.dtype() == torch::kDouble, "x must be float16, float32 or float64");
224
-
225
- // Output signs if we don't have sign input.
226
- torch::Tensor so;
227
- torch::Tensor s = si;
228
- bool readSigns = !!s.numel();
229
- if (writeSigns)
230
- {
231
- int64_t sw = x.size(3);
232
- sw = (sw + 15) & ~15; // Round to a multiple of 16 for coalescing.
233
- s = so = torch::empty({x.size(0), x.size(1), x.size(2), sw >> 2}, x.options().dtype(torch::kUInt8), at::MemoryFormat::Contiguous);
234
- }
235
-
236
- // Validate sign tensor if in use.
237
- if (readSigns || writeSigns)
238
- {
239
- TORCH_CHECK(s.is_contiguous(), "signs must be contiguous");
240
- TORCH_CHECK(s.dtype() == torch::kUInt8, "signs must be uint8");
241
- TORCH_CHECK(s.device() == x.device(), "signs must reside on the same device as x");
242
- TORCH_CHECK(s.dim() == 4, "signs must be rank 4");
243
- TORCH_CHECK(s.size(0) == x.size(0) && s.size(1) == x.size(1), "signs must have same batch & channels as x");
244
- TORCH_CHECK(s.size(2) <= INT_MAX && (s.size(3) << 2) <= INT_MAX, "signs tensor is too large");
245
- }
246
-
247
- // Initialize CUDA kernel parameters.
248
- filtered_lrelu_act_kernel_params p;
249
- p.x = x.data_ptr();
250
- p.s = (readSigns || writeSigns) ? s.data_ptr<unsigned char>() : 0;
251
- p.gain = gain;
252
- p.slope = slope;
253
- p.clamp = clamp;
254
- p.xShape = make_int4((int)x.size(3), (int)x.size(2), (int)x.size(1), (int)x.size(0));
255
- p.xStride = make_longlong4(x.stride(3), x.stride(2), x.stride(1), x.stride(0));
256
- p.sShape = (readSigns || writeSigns) ? make_int2((int)s.size(3) << 2, (int)s.size(2)) : make_int2(0, 0); // Width is in elements. Contiguous.
257
- p.sOfs = make_int2(sx, sy);
258
-
259
- // Choose CUDA kernel.
260
- void* func = 0;
261
- AT_DISPATCH_FLOATING_TYPES_AND_HALF(x.scalar_type(), "filtered_lrelu_act_cuda", [&]
262
- {
263
- if (writeSigns)
264
- func = choose_filtered_lrelu_act_kernel<scalar_t, true, false>();
265
- else if (readSigns)
266
- func = choose_filtered_lrelu_act_kernel<scalar_t, false, true>();
267
- else
268
- func = choose_filtered_lrelu_act_kernel<scalar_t, false, false>();
269
- });
270
- TORCH_CHECK(func, "internal error - CUDA kernel not found");
271
-
272
- // Launch CUDA kernel.
273
- void* args[] = {&p};
274
- int bx = 128; // 4 warps per block.
275
-
276
- // Logical size of launch = writeSigns ? p.s : p.x
277
- uint32_t gx = writeSigns ? p.sShape.x : p.xShape.x;
278
- uint32_t gy = writeSigns ? p.sShape.y : p.xShape.y;
279
- uint32_t gz = p.xShape.z * p.xShape.w; // Same as in p.sShape if signs are in use.
280
- gx = (gx - 1) / bx + 1;
281
-
282
- // Make sure grid y and z dimensions are within CUDA launch limits. Kernel loops internally to do the rest.
283
- const uint32_t gmax = 65535;
284
- gy = std::min(gy, gmax);
285
- gz = std::min(gz, gmax);
286
-
287
- // Launch.
288
- AT_CUDA_CHECK(cudaLaunchKernel(func, dim3(gx, gy, gz), bx, args, 0, at::cuda::getCurrentCUDAStream()));
289
- return so;
290
- }
291
-
292
- //------------------------------------------------------------------------
293
-
294
- PYBIND11_MODULE(TORCH_EXTENSION_NAME, m)
295
- {
296
- m.def("filtered_lrelu", &filtered_lrelu); // The whole thing.
297
- m.def("filtered_lrelu_act_", &filtered_lrelu_act); // Activation and sign tensor handling only. Modifies data tensor in-place.
298
- }
299
-
300
- //------------------------------------------------------------------------
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Andy1621/uniformer_image_detection/configs/gn+ws/README.md DELETED
@@ -1,44 +0,0 @@
1
- # Weight Standardization
2
-
3
- ## Introduction
4
-
5
- [ALGORITHM]
6
-
7
- ```
8
- @article{weightstandardization,
9
- author = {Siyuan Qiao and Huiyu Wang and Chenxi Liu and Wei Shen and Alan Yuille},
10
- title = {Weight Standardization},
11
- journal = {arXiv preprint arXiv:1903.10520},
12
- year = {2019},
13
- }
14
- ```
15
-
16
- ## Results and Models
17
-
18
- Faster R-CNN
19
-
20
- | Backbone | Style | Normalization | Lr schd | Mem (GB) | Inf time (fps) | box AP | mask AP | Config | Download |
21
- |:---------:|:-------:|:-------------:|:-------:|:--------:|:--------------:|:------:|:-------:|:------:|:--------:|
22
- | R-50-FPN | pytorch | GN+WS | 1x | 5.9 | 11.7 | 39.7 | - | [config](https://github.com/open-mmlab/mmdetection/tree/master/configs/gn%2Bws/faster_rcnn_r50_fpn_gn_ws-all_1x_coco.py) | [model](http://download.openmmlab.com/mmdetection/v2.0/gn%2Bws/faster_rcnn_r50_fpn_gn_ws-all_1x_coco/faster_rcnn_r50_fpn_gn_ws-all_1x_coco_20200130-613d9fe2.pth) &#124; [log](http://download.openmmlab.com/mmdetection/v2.0/gn%2Bws/faster_rcnn_r50_fpn_gn_ws-all_1x_coco/faster_rcnn_r50_fpn_gn_ws-all_1x_coco_20200130_210936.log.json) |
23
- | R-101-FPN | pytorch | GN+WS | 1x | 8.9 | 9.0 | 41.7 | - | [config](https://github.com/open-mmlab/mmdetection/tree/master/configs/gn%2Bws/faster_rcnn_r101_fpn_gn_ws-all_1x_coco.py) | [model](http://download.openmmlab.com/mmdetection/v2.0/gn%2Bws/faster_rcnn_r101_fpn_gn_ws-all_1x_coco/faster_rcnn_r101_fpn_gn_ws-all_1x_coco_20200205-a93b0d75.pth) &#124; [log](http://download.openmmlab.com/mmdetection/v2.0/gn%2Bws/faster_rcnn_r101_fpn_gn_ws-all_1x_coco/faster_rcnn_r101_fpn_gn_ws-all_1x_coco_20200205_232146.log.json) |
24
- | X-50-32x4d-FPN | pytorch | GN+WS | 1x | 7.0 | 10.3 | 40.7 | - | [config](https://github.com/open-mmlab/mmdetection/tree/master/configs/gn%2Bws/faster_rcnn_x50_32x4d_fpn_gn_ws-all_1x_coco.py) | [model](http://download.openmmlab.com/mmdetection/v2.0/gn%2Bws/faster_rcnn_x50_32x4d_fpn_gn_ws-all_1x_coco/faster_rcnn_x50_32x4d_fpn_gn_ws-all_1x_coco_20200203-839c5d9d.pth) &#124; [log](http://download.openmmlab.com/mmdetection/v2.0/gn%2Bws/faster_rcnn_x50_32x4d_fpn_gn_ws-all_1x_coco/faster_rcnn_x50_32x4d_fpn_gn_ws-all_1x_coco_20200203_220113.log.json) |
25
- | X-101-32x4d-FPN | pytorch | GN+WS | 1x | 10.8 | 7.6 | 42.1 | - | [config](https://github.com/open-mmlab/mmdetection/tree/master/configs/gn%2Bws/faster_rcnn_x101_32x4d_fpn_gn_ws-all_1x_coco.py) | [model](http://download.openmmlab.com/mmdetection/v2.0/gn%2Bws/faster_rcnn_x101_32x4d_fpn_gn_ws-all_1x_coco/faster_rcnn_x101_32x4d_fpn_gn_ws-all_1x_coco_20200212-27da1bc2.pth) &#124; [log](http://download.openmmlab.com/mmdetection/v2.0/gn%2Bws/faster_rcnn_x101_32x4d_fpn_gn_ws-all_1x_coco/faster_rcnn_x101_32x4d_fpn_gn_ws-all_1x_coco_20200212_195302.log.json) |
26
-
27
- Mask R-CNN
28
-
29
- | Backbone | Style | Normalization | Lr schd | Mem (GB) | Inf time (fps) | box AP | mask AP | Config | Download |
30
- |:---------:|:-------:|:-------------:|:---------:|:--------:|:--------------:|:------:|:-------:|:------:|:--------:|
31
- | R-50-FPN | pytorch | GN+WS | 2x | 7.3 | 10.5 | 40.6 | 36.6 | [config](https://github.com/open-mmlab/mmdetection/tree/master/configs/gn%2Bws/mask_rcnn_r50_fpn_gn_ws-all_2x_coco.py) | [model](http://download.openmmlab.com/mmdetection/v2.0/gn%2Bws/mask_rcnn_r50_fpn_gn_ws-all_2x_coco/mask_rcnn_r50_fpn_gn_ws-all_2x_coco_20200226-16acb762.pth) &#124; [log](http://download.openmmlab.com/mmdetection/v2.0/gn%2Bws/mask_rcnn_r50_fpn_gn_ws-all_2x_coco/mask_rcnn_r50_fpn_gn_ws-all_2x_coco_20200226_062128.log.json) |
32
- | R-101-FPN | pytorch | GN+WS | 2x | 10.3 | 8.6 | 42.0 | 37.7 | [config](https://github.com/open-mmlab/mmdetection/tree/master/configs/gn%2Bws/mask_rcnn_r101_fpn_gn_ws-all_2x_coco.py) | [model](http://download.openmmlab.com/mmdetection/v2.0/gn%2Bws/mask_rcnn_r101_fpn_gn_ws-all_2x_coco/mask_rcnn_r101_fpn_gn_ws-all_2x_coco_20200212-ea357cd9.pth) &#124; [log](http://download.openmmlab.com/mmdetection/v2.0/gn%2Bws/mask_rcnn_r101_fpn_gn_ws-all_2x_coco/mask_rcnn_r101_fpn_gn_ws-all_2x_coco_20200212_213627.log.json) |
33
- | X-50-32x4d-FPN | pytorch | GN+WS | 2x | 8.4 | 9.3 | 41.1 | 37.0 | [config](https://github.com/open-mmlab/mmdetection/tree/master/configs/gn%2Bws/mask_rcnn_x50_32x4d_fpn_gn_ws-all_2x_coco.py) | [model](http://download.openmmlab.com/mmdetection/v2.0/gn%2Bws/mask_rcnn_x50_32x4d_fpn_gn_ws-all_2x_coco/mask_rcnn_x50_32x4d_fpn_gn_ws-all_2x_coco_20200216-649fdb6f.pth) &#124; [log](http://download.openmmlab.com/mmdetection/v2.0/gn%2Bws/mask_rcnn_x50_32x4d_fpn_gn_ws-all_2x_coco/mask_rcnn_x50_32x4d_fpn_gn_ws-all_2x_coco_20200216_201500.log.json) |
34
- | X-101-32x4d-FPN | pytorch | GN+WS | 2x | 12.2 | 7.1 | 42.1 | 37.9 | [config](https://github.com/open-mmlab/mmdetection/tree/master/configs/gn%2Bws/mask_rcnn_x101_32x4d_fpn_gn_ws-all_2x_coco.py) | [model](http://download.openmmlab.com/mmdetection/v2.0/gn%2Bws/mask_rcnn_x101_32x4d_fpn_gn_ws-all_2x_coco/mask_rcnn_x101_32x4d_fpn_gn_ws-all_2x_coco_20200319-33fb95b5.pth) &#124; [log](http://download.openmmlab.com/mmdetection/v2.0/gn%2Bws/mask_rcnn_x101_32x4d_fpn_gn_ws-all_2x_coco/mask_rcnn_x101_32x4d_fpn_gn_ws-all_2x_coco_20200319_104101.log.json) |
35
- | R-50-FPN | pytorch | GN+WS | 20-23-24e | 7.3 | - | 41.1 | 37.1 | [config](https://github.com/open-mmlab/mmdetection/tree/master/configs/gn%2Bws/mask_rcnn_r50_fpn_gn_ws-all_20_23_24e_coco.py) | [model](http://download.openmmlab.com/mmdetection/v2.0/gn%2Bws/mask_rcnn_r50_fpn_gn_ws-all_20_23_24e_coco/mask_rcnn_r50_fpn_gn_ws-all_20_23_24e_coco_20200213-487d1283.pth) &#124; [log](http://download.openmmlab.com/mmdetection/v2.0/gn%2Bws/mask_rcnn_r50_fpn_gn_ws-all_20_23_24e_coco/mask_rcnn_r50_fpn_gn_ws-all_20_23_24e_coco_20200213_035123.log.json) |
36
- | R-101-FPN | pytorch | GN+WS | 20-23-24e | 10.3 | - | 43.1 | 38.6 | [config](https://github.com/open-mmlab/mmdetection/tree/master/configs/gn%2Bws/mask_rcnn_r101_fpn_gn_ws-all_20_23_24e_coco.py) | [model](http://download.openmmlab.com/mmdetection/v2.0/gn%2Bws/mask_rcnn_r101_fpn_gn_ws-all_20_23_24e_coco/mask_rcnn_r101_fpn_gn_ws-all_20_23_24e_coco_20200213-57b5a50f.pth) &#124; [log](http://download.openmmlab.com/mmdetection/v2.0/gn%2Bws/mask_rcnn_r101_fpn_gn_ws-all_20_23_24e_coco/mask_rcnn_r101_fpn_gn_ws-all_20_23_24e_coco_20200213_130142.log.json) |
37
- | X-50-32x4d-FPN | pytorch | GN+WS | 20-23-24e | 8.4 | - | 42.1 | 38.0 | [config](https://github.com/open-mmlab/mmdetection/tree/master/configs/gn%2Bws/mask_rcnn_x50_32x4d_fpn_gn_ws-all_20_23_24e_coco.py) | [model](http://download.openmmlab.com/mmdetection/v2.0/gn%2Bws/mask_rcnn_x50_32x4d_fpn_gn_ws-all_20_23_24e_coco/mask_rcnn_x50_32x4d_fpn_gn_ws-all_20_23_24e_coco_20200226-969bcb2c.pth) &#124; [log](http://download.openmmlab.com/mmdetection/v2.0/gn%2Bws/mask_rcnn_x50_32x4d_fpn_gn_ws-all_20_23_24e_coco/mask_rcnn_x50_32x4d_fpn_gn_ws-all_20_23_24e_coco_20200226_093732.log.json) |
38
- | X-101-32x4d-FPN | pytorch | GN+WS | 20-23-24e | 12.2 | - | 42.7 | 38.5 | [config](https://github.com/open-mmlab/mmdetection/tree/master/configs/gn%2Bws/mask_rcnn_x101_32x4d_fpn_gn_ws-all_20_23_24e_coco.py) | [model](http://download.openmmlab.com/mmdetection/v2.0/gn%2Bws/mask_rcnn_x101_32x4d_fpn_gn_ws-all_20_23_24e_coco/mask_rcnn_x101_32x4d_fpn_gn_ws-all_20_23_24e_coco_20200316-e6cd35ef.pth) &#124; [log](http://download.openmmlab.com/mmdetection/v2.0/gn%2Bws/mask_rcnn_x101_32x4d_fpn_gn_ws-all_20_23_24e_coco/mask_rcnn_x101_32x4d_fpn_gn_ws-all_20_23_24e_coco_20200316_013741.log.json) |
39
-
40
- Note:
41
-
42
- - GN+WS requires about 5% more memory than GN, and it is only 5% slower than GN.
43
- - In the paper, a 20-23-24e lr schedule is used instead of 2x.
44
- - The X-50-GN and X-101-GN pretrained models are also shared by the authors.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Andy1621/uniformer_image_detection/configs/regnet/mask_rcnn_regnetx-12GF_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_12gf',
4
- backbone=dict(
5
- type='RegNet',
6
- arch='regnetx_12gf',
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=[224, 448, 896, 2240],
15
- out_channels=256,
16
- num_outs=5))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Andy1621/uniformer_image_detection/mmdet/models/detectors/fcos.py DELETED
@@ -1,17 +0,0 @@
1
- from ..builder import DETECTORS
2
- from .single_stage import SingleStageDetector
3
-
4
-
5
- @DETECTORS.register_module()
6
- class FCOS(SingleStageDetector):
7
- """Implementation of `FCOS <https://arxiv.org/abs/1904.01355>`_"""
8
-
9
- def __init__(self,
10
- backbone,
11
- neck,
12
- bbox_head,
13
- train_cfg=None,
14
- test_cfg=None,
15
- pretrained=None):
16
- super(FCOS, self).__init__(backbone, neck, bbox_head, train_cfg,
17
- test_cfg, pretrained)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Andy1621/uniformer_image_segmentation/configs/_base_/models/deeplabv3_unet_s5-d16.py DELETED
@@ -1,50 +0,0 @@
1
- # model settings
2
- norm_cfg = dict(type='SyncBN', requires_grad=True)
3
- model = dict(
4
- type='EncoderDecoder',
5
- pretrained=None,
6
- backbone=dict(
7
- type='UNet',
8
- in_channels=3,
9
- base_channels=64,
10
- num_stages=5,
11
- strides=(1, 1, 1, 1, 1),
12
- enc_num_convs=(2, 2, 2, 2, 2),
13
- dec_num_convs=(2, 2, 2, 2),
14
- downsamples=(True, True, True, True),
15
- enc_dilations=(1, 1, 1, 1, 1),
16
- dec_dilations=(1, 1, 1, 1),
17
- with_cp=False,
18
- conv_cfg=None,
19
- norm_cfg=norm_cfg,
20
- act_cfg=dict(type='ReLU'),
21
- upsample_cfg=dict(type='InterpConv'),
22
- norm_eval=False),
23
- decode_head=dict(
24
- type='ASPPHead',
25
- in_channels=64,
26
- in_index=4,
27
- channels=16,
28
- dilations=(1, 12, 24, 36),
29
- dropout_ratio=0.1,
30
- num_classes=2,
31
- norm_cfg=norm_cfg,
32
- align_corners=False,
33
- loss_decode=dict(
34
- type='CrossEntropyLoss', use_sigmoid=False, loss_weight=1.0)),
35
- auxiliary_head=dict(
36
- type='FCNHead',
37
- in_channels=128,
38
- in_index=3,
39
- channels=64,
40
- num_convs=1,
41
- concat_input=False,
42
- dropout_ratio=0.1,
43
- num_classes=2,
44
- norm_cfg=norm_cfg,
45
- align_corners=False,
46
- loss_decode=dict(
47
- type='CrossEntropyLoss', use_sigmoid=False, loss_weight=0.4)),
48
- # model training and testing settings
49
- train_cfg=dict(),
50
- test_cfg=dict(mode='slide', crop_size=256, stride=170))
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/AnimalEquality/chatbot/lv_recipe_chatbot/__init__.py DELETED
@@ -1 +0,0 @@
1
- __version__ = "0.0.1"
 
 
spaces/Anonymous-sub/Rerender/ControlNet/gradio_depth2image.py DELETED
@@ -1,98 +0,0 @@
1
- from share import *
2
- import config
3
-
4
- import cv2
5
- import einops
6
- import gradio as gr
7
- import numpy as np
8
- import torch
9
- import random
10
-
11
- from pytorch_lightning import seed_everything
12
- from annotator.util import resize_image, HWC3
13
- from annotator.midas import MidasDetector
14
- from cldm.model import create_model, load_state_dict
15
- from cldm.ddim_hacked import DDIMSampler
16
-
17
-
18
- apply_midas = MidasDetector()
19
-
20
- model = create_model('./models/cldm_v15.yaml').cpu()
21
- model.load_state_dict(load_state_dict('./models/control_sd15_depth.pth', location='cuda'))
22
- model = model.cuda()
23
- ddim_sampler = DDIMSampler(model)
24
-
25
-
26
- def process(input_image, prompt, a_prompt, n_prompt, num_samples, image_resolution, detect_resolution, ddim_steps, guess_mode, strength, scale, seed, eta):
27
- with torch.no_grad():
28
- input_image = HWC3(input_image)
29
- detected_map, _ = apply_midas(resize_image(input_image, detect_resolution))
30
- detected_map = HWC3(detected_map)
31
- img = resize_image(input_image, image_resolution)
32
- H, W, C = img.shape
33
-
34
- detected_map = cv2.resize(detected_map, (W, H), interpolation=cv2.INTER_LINEAR)
35
-
36
- control = torch.from_numpy(detected_map.copy()).float().cuda() / 255.0
37
- control = torch.stack([control for _ in range(num_samples)], dim=0)
38
- control = einops.rearrange(control, 'b h w c -> b c h w').clone()
39
-
40
- if seed == -1:
41
- seed = random.randint(0, 65535)
42
- seed_everything(seed)
43
-
44
- if config.save_memory:
45
- model.low_vram_shift(is_diffusing=False)
46
-
47
- cond = {"c_concat": [control], "c_crossattn": [model.get_learned_conditioning([prompt + ', ' + a_prompt] * num_samples)]}
48
- un_cond = {"c_concat": None if guess_mode else [control], "c_crossattn": [model.get_learned_conditioning([n_prompt] * num_samples)]}
49
- shape = (4, H // 8, W // 8)
50
-
51
- if config.save_memory:
52
- model.low_vram_shift(is_diffusing=True)
53
-
54
- model.control_scales = [strength * (0.825 ** float(12 - i)) for i in range(13)] if guess_mode else ([strength] * 13) # Magic number. IDK why. Perhaps because 0.825**12<0.01 but 0.826**12>0.01
55
- samples, intermediates = ddim_sampler.sample(ddim_steps, num_samples,
56
- shape, cond, verbose=False, eta=eta,
57
- unconditional_guidance_scale=scale,
58
- unconditional_conditioning=un_cond)
59
-
60
- if config.save_memory:
61
- model.low_vram_shift(is_diffusing=False)
62
-
63
- x_samples = model.decode_first_stage(samples)
64
- x_samples = (einops.rearrange(x_samples, 'b c h w -> b h w c') * 127.5 + 127.5).cpu().numpy().clip(0, 255).astype(np.uint8)
65
-
66
- results = [x_samples[i] for i in range(num_samples)]
67
- return [detected_map] + results
68
-
69
-
70
- block = gr.Blocks().queue()
71
- with block:
72
- with gr.Row():
73
- gr.Markdown("## Control Stable Diffusion with Depth Maps")
74
- with gr.Row():
75
- with gr.Column():
76
- input_image = gr.Image(source='upload', type="numpy")
77
- prompt = gr.Textbox(label="Prompt")
78
- run_button = gr.Button(label="Run")
79
- with gr.Accordion("Advanced options", open=False):
80
- num_samples = gr.Slider(label="Images", minimum=1, maximum=12, value=1, step=1)
81
- image_resolution = gr.Slider(label="Image Resolution", minimum=256, maximum=768, value=512, step=64)
82
- strength = gr.Slider(label="Control Strength", minimum=0.0, maximum=2.0, value=1.0, step=0.01)
83
- guess_mode = gr.Checkbox(label='Guess Mode', value=False)
84
- detect_resolution = gr.Slider(label="Depth Resolution", minimum=128, maximum=1024, value=384, step=1)
85
- ddim_steps = gr.Slider(label="Steps", minimum=1, maximum=100, value=20, step=1)
86
- scale = gr.Slider(label="Guidance Scale", minimum=0.1, maximum=30.0, value=9.0, step=0.1)
87
- seed = gr.Slider(label="Seed", minimum=-1, maximum=2147483647, step=1, randomize=True)
88
- eta = gr.Number(label="eta (DDIM)", value=0.0)
89
- a_prompt = gr.Textbox(label="Added Prompt", value='best quality, extremely detailed')
90
- n_prompt = gr.Textbox(label="Negative Prompt",
91
- value='longbody, lowres, bad anatomy, bad hands, missing fingers, extra digit, fewer digits, cropped, worst quality, low quality')
92
- with gr.Column():
93
- result_gallery = gr.Gallery(label='Output', show_label=False, elem_id="gallery").style(grid=2, height='auto')
94
- ips = [input_image, prompt, a_prompt, n_prompt, num_samples, image_resolution, detect_resolution, ddim_steps, guess_mode, strength, scale, seed, eta]
95
- run_button.click(fn=process, inputs=ips, outputs=[result_gallery])
96
-
97
-
98
- block.launch(server_name='0.0.0.0')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Ariharasudhan/YoloV5/utils/docker/Dockerfile DELETED
@@ -1,65 +0,0 @@
1
- # YOLOv5 🚀 by Ultralytics, GPL-3.0 license
2
- # Builds ultralytics/yolov5:latest image on DockerHub https://hub.docker.com/r/ultralytics/yolov5
3
- # Image is CUDA-optimized for YOLOv5 single/multi-GPU training and inference
4
-
5
- # Start FROM NVIDIA PyTorch image https://ngc.nvidia.com/catalog/containers/nvidia:pytorch
6
- FROM nvcr.io/nvidia/pytorch:22.10-py3
7
- RUN rm -rf /opt/pytorch # remove 1.2GB dir
8
-
9
- # Downloads to user config dir
10
- ADD https://ultralytics.com/assets/Arial.ttf https://ultralytics.com/assets/Arial.Unicode.ttf /root/.config/Ultralytics/
11
-
12
- # Install linux packages
13
- RUN apt update && apt install --no-install-recommends -y zip htop screen libgl1-mesa-glx
14
-
15
- # Install pip packages
16
- COPY requirements.txt .
17
- RUN python -m pip install --upgrade pip wheel
18
- RUN pip uninstall -y Pillow torchtext # torch torchvision
19
- RUN pip install --no-cache -r requirements.txt ultralytics albumentations comet gsutil notebook Pillow>=9.1.0 \
20
- 'opencv-python<4.6.0.66' \
21
- --extra-index-url https://download.pytorch.org/whl/cu113
22
-
23
- # Create working directory
24
- RUN mkdir -p /usr/src/app
25
- WORKDIR /usr/src/app
26
-
27
- # Copy contents
28
- # COPY . /usr/src/app (issues as not a .git directory)
29
- RUN git clone https://github.com/ultralytics/yolov5 /usr/src/app
30
-
31
- # Set environment variables
32
- ENV OMP_NUM_THREADS=8
33
-
34
-
35
- # Usage Examples -------------------------------------------------------------------------------------------------------
36
-
37
- # Build and Push
38
- # t=ultralytics/yolov5:latest && sudo docker build -f utils/docker/Dockerfile -t $t . && sudo docker push $t
39
-
40
- # Pull and Run
41
- # t=ultralytics/yolov5:latest && sudo docker pull $t && sudo docker run -it --ipc=host --gpus all $t
42
-
43
- # Pull and Run with local directory access
44
- # t=ultralytics/yolov5:latest && sudo docker pull $t && sudo docker run -it --ipc=host --gpus all -v "$(pwd)"/datasets:/usr/src/datasets $t
45
-
46
- # Kill all
47
- # sudo docker kill $(sudo docker ps -q)
48
-
49
- # Kill all image-based
50
- # sudo docker kill $(sudo docker ps -qa --filter ancestor=ultralytics/yolov5:latest)
51
-
52
- # DockerHub tag update
53
- # t=ultralytics/yolov5:latest tnew=ultralytics/yolov5:v6.2 && sudo docker pull $t && sudo docker tag $t $tnew && sudo docker push $tnew
54
-
55
- # Clean up
56
- # docker system prune -a --volumes
57
-
58
- # Update Ubuntu drivers
59
- # https://www.maketecheasier.com/install-nvidia-drivers-ubuntu/
60
-
61
- # DDP test
62
- # python -m torch.distributed.run --nproc_per_node 2 --master_port 1 train.py --epochs 3
63
-
64
- # GCP VM from Image
65
- # docker.io/ultralytics/yolov5:latest
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/dotenv/variables.py DELETED
@@ -1,86 +0,0 @@
1
- import re
2
- from abc import ABCMeta, abstractmethod
3
- from typing import Iterator, Mapping, Optional, Pattern
4
-
5
- _posix_variable: Pattern[str] = re.compile(
6
- r"""
7
- \$\{
8
- (?P<name>[^\}:]*)
9
- (?::-
10
- (?P<default>[^\}]*)
11
- )?
12
- \}
13
- """,
14
- re.VERBOSE,
15
- )
16
-
17
-
18
- class Atom(metaclass=ABCMeta):
19
- def __ne__(self, other: object) -> bool:
20
- result = self.__eq__(other)
21
- if result is NotImplemented:
22
- return NotImplemented
23
- return not result
24
-
25
- @abstractmethod
26
- def resolve(self, env: Mapping[str, Optional[str]]) -> str: ...
27
-
28
-
29
- class Literal(Atom):
30
- def __init__(self, value: str) -> None:
31
- self.value = value
32
-
33
- def __repr__(self) -> str:
34
- return f"Literal(value={self.value})"
35
-
36
- def __eq__(self, other: object) -> bool:
37
- if not isinstance(other, self.__class__):
38
- return NotImplemented
39
- return self.value == other.value
40
-
41
- def __hash__(self) -> int:
42
- return hash((self.__class__, self.value))
43
-
44
- def resolve(self, env: Mapping[str, Optional[str]]) -> str:
45
- return self.value
46
-
47
-
48
- class Variable(Atom):
49
- def __init__(self, name: str, default: Optional[str]) -> None:
50
- self.name = name
51
- self.default = default
52
-
53
- def __repr__(self) -> str:
54
- return f"Variable(name={self.name}, default={self.default})"
55
-
56
- def __eq__(self, other: object) -> bool:
57
- if not isinstance(other, self.__class__):
58
- return NotImplemented
59
- return (self.name, self.default) == (other.name, other.default)
60
-
61
- def __hash__(self) -> int:
62
- return hash((self.__class__, self.name, self.default))
63
-
64
- def resolve(self, env: Mapping[str, Optional[str]]) -> str:
65
- default = self.default if self.default is not None else ""
66
- result = env.get(self.name, default)
67
- return result if result is not None else ""
68
-
69
-
70
- def parse_variables(value: str) -> Iterator[Atom]:
71
- cursor = 0
72
-
73
- for match in _posix_variable.finditer(value):
74
- (start, end) = match.span()
75
- name = match["name"]
76
- default = match["default"]
77
-
78
- if start > cursor:
79
- yield Literal(value=value[cursor:start])
80
-
81
- yield Variable(name=name, default=default)
82
- cursor = end
83
-
84
- length = len(value)
85
- if cursor < length:
86
- yield Literal(value=value[cursor:length])
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/packaging/_manylinux.py DELETED
@@ -1,301 +0,0 @@
1
- import collections
2
- import functools
3
- import os
4
- import re
5
- import struct
6
- import sys
7
- import warnings
8
- from typing import IO, Dict, Iterator, NamedTuple, Optional, Tuple
9
-
10
-
11
- # Python does not provide platform information at sufficient granularity to
12
- # identify the architecture of the running executable in some cases, so we
13
- # determine it dynamically by reading the information from the running
14
- # process. This only applies on Linux, which uses the ELF format.
15
- class _ELFFileHeader:
16
- # https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header
17
- class _InvalidELFFileHeader(ValueError):
18
- """
19
- An invalid ELF file header was found.
20
- """
21
-
22
- ELF_MAGIC_NUMBER = 0x7F454C46
23
- ELFCLASS32 = 1
24
- ELFCLASS64 = 2
25
- ELFDATA2LSB = 1
26
- ELFDATA2MSB = 2
27
- EM_386 = 3
28
- EM_S390 = 22
29
- EM_ARM = 40
30
- EM_X86_64 = 62
31
- EF_ARM_ABIMASK = 0xFF000000
32
- EF_ARM_ABI_VER5 = 0x05000000
33
- EF_ARM_ABI_FLOAT_HARD = 0x00000400
34
-
35
- def __init__(self, file: IO[bytes]) -> None:
36
- def unpack(fmt: str) -> int:
37
- try:
38
- data = file.read(struct.calcsize(fmt))
39
- result: Tuple[int, ...] = struct.unpack(fmt, data)
40
- except struct.error:
41
- raise _ELFFileHeader._InvalidELFFileHeader()
42
- return result[0]
43
-
44
- self.e_ident_magic = unpack(">I")
45
- if self.e_ident_magic != self.ELF_MAGIC_NUMBER:
46
- raise _ELFFileHeader._InvalidELFFileHeader()
47
- self.e_ident_class = unpack("B")
48
- if self.e_ident_class not in {self.ELFCLASS32, self.ELFCLASS64}:
49
- raise _ELFFileHeader._InvalidELFFileHeader()
50
- self.e_ident_data = unpack("B")
51
- if self.e_ident_data not in {self.ELFDATA2LSB, self.ELFDATA2MSB}:
52
- raise _ELFFileHeader._InvalidELFFileHeader()
53
- self.e_ident_version = unpack("B")
54
- self.e_ident_osabi = unpack("B")
55
- self.e_ident_abiversion = unpack("B")
56
- self.e_ident_pad = file.read(7)
57
- format_h = "<H" if self.e_ident_data == self.ELFDATA2LSB else ">H"
58
- format_i = "<I" if self.e_ident_data == self.ELFDATA2LSB else ">I"
59
- format_q = "<Q" if self.e_ident_data == self.ELFDATA2LSB else ">Q"
60
- format_p = format_i if self.e_ident_class == self.ELFCLASS32 else format_q
61
- self.e_type = unpack(format_h)
62
- self.e_machine = unpack(format_h)
63
- self.e_version = unpack(format_i)
64
- self.e_entry = unpack(format_p)
65
- self.e_phoff = unpack(format_p)
66
- self.e_shoff = unpack(format_p)
67
- self.e_flags = unpack(format_i)
68
- self.e_ehsize = unpack(format_h)
69
- self.e_phentsize = unpack(format_h)
70
- self.e_phnum = unpack(format_h)
71
- self.e_shentsize = unpack(format_h)
72
- self.e_shnum = unpack(format_h)
73
- self.e_shstrndx = unpack(format_h)
74
-
75
-
76
- def _get_elf_header() -> Optional[_ELFFileHeader]:
77
- try:
78
- with open(sys.executable, "rb") as f:
79
- elf_header = _ELFFileHeader(f)
80
- except (OSError, TypeError, _ELFFileHeader._InvalidELFFileHeader):
81
- return None
82
- return elf_header
83
-
84
-
85
- def _is_linux_armhf() -> bool:
86
- # hard-float ABI can be detected from the ELF header of the running
87
- # process
88
- # https://static.docs.arm.com/ihi0044/g/aaelf32.pdf
89
- elf_header = _get_elf_header()
90
- if elf_header is None:
91
- return False
92
- result = elf_header.e_ident_class == elf_header.ELFCLASS32
93
- result &= elf_header.e_ident_data == elf_header.ELFDATA2LSB
94
- result &= elf_header.e_machine == elf_header.EM_ARM
95
- result &= (
96
- elf_header.e_flags & elf_header.EF_ARM_ABIMASK
97
- ) == elf_header.EF_ARM_ABI_VER5
98
- result &= (
99
- elf_header.e_flags & elf_header.EF_ARM_ABI_FLOAT_HARD
100
- ) == elf_header.EF_ARM_ABI_FLOAT_HARD
101
- return result
102
-
103
-
104
- def _is_linux_i686() -> bool:
105
- elf_header = _get_elf_header()
106
- if elf_header is None:
107
- return False
108
- result = elf_header.e_ident_class == elf_header.ELFCLASS32
109
- result &= elf_header.e_ident_data == elf_header.ELFDATA2LSB
110
- result &= elf_header.e_machine == elf_header.EM_386
111
- return result
112
-
113
-
114
- def _have_compatible_abi(arch: str) -> bool:
115
- if arch == "armv7l":
116
- return _is_linux_armhf()
117
- if arch == "i686":
118
- return _is_linux_i686()
119
- return arch in {"x86_64", "aarch64", "ppc64", "ppc64le", "s390x"}
120
-
121
-
122
- # If glibc ever changes its major version, we need to know what the last
123
- # minor version was, so we can build the complete list of all versions.
124
- # For now, guess what the highest minor version might be, assume it will
125
- # be 50 for testing. Once this actually happens, update the dictionary
126
- # with the actual value.
127
- _LAST_GLIBC_MINOR: Dict[int, int] = collections.defaultdict(lambda: 50)
128
-
129
-
130
- class _GLibCVersion(NamedTuple):
131
- major: int
132
- minor: int
133
-
134
-
135
- def _glibc_version_string_confstr() -> Optional[str]:
136
- """
137
- Primary implementation of glibc_version_string using os.confstr.
138
- """
139
- # os.confstr is quite a bit faster than ctypes.DLL. It's also less likely
140
- # to be broken or missing. This strategy is used in the standard library
141
- # platform module.
142
- # https://github.com/python/cpython/blob/fcf1d003bf4f0100c/Lib/platform.py#L175-L183
143
- try:
144
- # os.confstr("CS_GNU_LIBC_VERSION") returns a string like "glibc 2.17".
145
- version_string = os.confstr("CS_GNU_LIBC_VERSION")
146
- assert version_string is not None
147
- _, version = version_string.split()
148
- except (AssertionError, AttributeError, OSError, ValueError):
149
- # os.confstr() or CS_GNU_LIBC_VERSION not available (or a bad value)...
150
- return None
151
- return version
152
-
153
-
154
- def _glibc_version_string_ctypes() -> Optional[str]:
155
- """
156
- Fallback implementation of glibc_version_string using ctypes.
157
- """
158
- try:
159
- import ctypes
160
- except ImportError:
161
- return None
162
-
163
- # ctypes.CDLL(None) internally calls dlopen(NULL), and as the dlopen
164
- # manpage says, "If filename is NULL, then the returned handle is for the
165
- # main program". This way we can let the linker do the work to figure out
166
- # which libc our process is actually using.
167
- #
168
- # We must also handle the special case where the executable is not a
169
- # dynamically linked executable. This can occur when using musl libc,
170
- # for example. In this situation, dlopen() will error, leading to an
171
- # OSError. Interestingly, at least in the case of musl, there is no
172
- # errno set on the OSError. The single string argument used to construct
173
- # OSError comes from libc itself and is therefore not portable to
174
- # hard code here. In any case, failure to call dlopen() means we
175
- # can proceed, so we bail on our attempt.
176
- try:
177
- process_namespace = ctypes.CDLL(None)
178
- except OSError:
179
- return None
180
-
181
- try:
182
- gnu_get_libc_version = process_namespace.gnu_get_libc_version
183
- except AttributeError:
184
- # Symbol doesn't exist -> therefore, we are not linked to
185
- # glibc.
186
- return None
187
-
188
- # Call gnu_get_libc_version, which returns a string like "2.5"
189
- gnu_get_libc_version.restype = ctypes.c_char_p
190
- version_str: str = gnu_get_libc_version()
191
- # py2 / py3 compatibility:
192
- if not isinstance(version_str, str):
193
- version_str = version_str.decode("ascii")
194
-
195
- return version_str
196
-
197
-
198
- def _glibc_version_string() -> Optional[str]:
199
- """Returns glibc version string, or None if not using glibc."""
200
- return _glibc_version_string_confstr() or _glibc_version_string_ctypes()
201
-
202
-
203
- def _parse_glibc_version(version_str: str) -> Tuple[int, int]:
204
- """Parse glibc version.
205
-
206
- We use a regexp instead of str.split because we want to discard any
207
- random junk that might come after the minor version -- this might happen
208
- in patched/forked versions of glibc (e.g. Linaro's version of glibc
209
- uses version strings like "2.20-2014.11"). See gh-3588.
210
- """
211
- m = re.match(r"(?P<major>[0-9]+)\.(?P<minor>[0-9]+)", version_str)
212
- if not m:
213
- warnings.warn(
214
- "Expected glibc version with 2 components major.minor,"
215
- " got: %s" % version_str,
216
- RuntimeWarning,
217
- )
218
- return -1, -1
219
- return int(m.group("major")), int(m.group("minor"))
220
-
221
-
222
- @functools.lru_cache()
223
- def _get_glibc_version() -> Tuple[int, int]:
224
- version_str = _glibc_version_string()
225
- if version_str is None:
226
- return (-1, -1)
227
- return _parse_glibc_version(version_str)
228
-
229
-
230
- # From PEP 513, PEP 600
231
- def _is_compatible(name: str, arch: str, version: _GLibCVersion) -> bool:
232
- sys_glibc = _get_glibc_version()
233
- if sys_glibc < version:
234
- return False
235
- # Check for presence of _manylinux module.
236
- try:
237
- import _manylinux # noqa
238
- except ImportError:
239
- return True
240
- if hasattr(_manylinux, "manylinux_compatible"):
241
- result = _manylinux.manylinux_compatible(version[0], version[1], arch)
242
- if result is not None:
243
- return bool(result)
244
- return True
245
- if version == _GLibCVersion(2, 5):
246
- if hasattr(_manylinux, "manylinux1_compatible"):
247
- return bool(_manylinux.manylinux1_compatible)
248
- if version == _GLibCVersion(2, 12):
249
- if hasattr(_manylinux, "manylinux2010_compatible"):
250
- return bool(_manylinux.manylinux2010_compatible)
251
- if version == _GLibCVersion(2, 17):
252
- if hasattr(_manylinux, "manylinux2014_compatible"):
253
- return bool(_manylinux.manylinux2014_compatible)
254
- return True
255
-
256
-
257
- _LEGACY_MANYLINUX_MAP = {
258
- # CentOS 7 w/ glibc 2.17 (PEP 599)
259
- (2, 17): "manylinux2014",
260
- # CentOS 6 w/ glibc 2.12 (PEP 571)
261
- (2, 12): "manylinux2010",
262
- # CentOS 5 w/ glibc 2.5 (PEP 513)
263
- (2, 5): "manylinux1",
264
- }
265
-
266
-
267
- def platform_tags(linux: str, arch: str) -> Iterator[str]:
268
- if not _have_compatible_abi(arch):
269
- return
270
- # Oldest glibc to be supported regardless of architecture is (2, 17).
271
- too_old_glibc2 = _GLibCVersion(2, 16)
272
- if arch in {"x86_64", "i686"}:
273
- # On x86/i686 also oldest glibc to be supported is (2, 5).
274
- too_old_glibc2 = _GLibCVersion(2, 4)
275
- current_glibc = _GLibCVersion(*_get_glibc_version())
276
- glibc_max_list = [current_glibc]
277
- # We can assume compatibility across glibc major versions.
278
- # https://sourceware.org/bugzilla/show_bug.cgi?id=24636
279
- #
280
- # Build a list of maximum glibc versions so that we can
281
- # output the canonical list of all glibc from current_glibc
282
- # down to too_old_glibc2, including all intermediary versions.
283
- for glibc_major in range(current_glibc.major - 1, 1, -1):
284
- glibc_minor = _LAST_GLIBC_MINOR[glibc_major]
285
- glibc_max_list.append(_GLibCVersion(glibc_major, glibc_minor))
286
- for glibc_max in glibc_max_list:
287
- if glibc_max.major == too_old_glibc2.major:
288
- min_minor = too_old_glibc2.minor
289
- else:
290
- # For other glibc major versions oldest supported is (x, 0).
291
- min_minor = -1
292
- for glibc_minor in range(glibc_max.minor, min_minor, -1):
293
- glibc_version = _GLibCVersion(glibc_max.major, glibc_minor)
294
- tag = "manylinux_{}_{}".format(*glibc_version)
295
- if _is_compatible(tag, arch, glibc_version):
296
- yield linux.replace("linux", tag)
297
- # Handle the legacy manylinux1, manylinux2010, manylinux2014 tags.
298
- if glibc_version in _LEGACY_MANYLINUX_MAP:
299
- legacy_tag = _LEGACY_MANYLINUX_MAP[glibc_version]
300
- if _is_compatible(legacy_tag, arch, glibc_version):
301
- yield linux.replace("linux", legacy_tag)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Audio-AGI/AudioSep/models/CLAP/training/logger.py DELETED
@@ -1,30 +0,0 @@
1
- import logging
2
-
3
-
4
- def setup_logging(log_file, level, include_host=False):
5
- if include_host:
6
- import socket
7
-
8
- hostname = socket.gethostname()
9
- formatter = logging.Formatter(
10
- f"%(asctime)s | {hostname} | %(levelname)s | %(message)s",
11
- datefmt="%Y-%m-%d,%H:%M:%S",
12
- )
13
- else:
14
- formatter = logging.Formatter(
15
- "%(asctime)s | %(levelname)s | %(message)s", datefmt="%Y-%m-%d,%H:%M:%S"
16
- )
17
-
18
- logging.root.setLevel(level)
19
- loggers = [logging.getLogger(name) for name in logging.root.manager.loggerDict]
20
- for logger in loggers:
21
- logger.setLevel(level)
22
-
23
- stream_handler = logging.StreamHandler()
24
- stream_handler.setFormatter(formatter)
25
- logging.root.addHandler(stream_handler)
26
-
27
- if log_file:
28
- file_handler = logging.FileHandler(filename=log_file)
29
- file_handler.setFormatter(formatter)
30
- logging.root.addHandler(file_handler)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Audio-AGI/WavJourney/scripts/download_models.py DELETED
@@ -1,32 +0,0 @@
1
- import yaml
2
- import os
3
-
4
- # Read the YAML file
5
- with open('config.yaml', 'r') as file:
6
- config = yaml.safe_load(file)
7
-
8
- # Extract values for each application
9
- ttm_model_size = config['AudioCraft']['ttm_model_size']
10
- tta_model_size = config['AudioCraft']['tta_model_size']
11
-
12
- # Download nltk
13
- import nltk
14
- nltk.download('punkt')
15
-
16
- # Downloading the TTS models
17
- print('Step 1: Downloading TTS model ...')
18
- os.system(f'conda run --live-stream -n WavJourney python -c \'from transformers import BarkModel; BarkModel.from_pretrained("suno/bark")\'')
19
-
20
- print('Step 2: Downloading TTA model ...')
21
- os.system(f'conda run --live-stream -n WavJourney python -c \'from audiocraft.models import AudioGen; tta_model = AudioGen.get_pretrained("facebook/audiogen-{tta_model_size}")\'')
22
-
23
- print('Step 3: Downloading TTM model ...')
24
- os.system(f'conda run --live-stream -n WavJourney python -c \'from audiocraft.models import MusicGen; tta_model = MusicGen.get_pretrained("facebook/musicgen-{ttm_model_size}")\'')
25
-
26
- print('Step 4: Downloading SR model ...')
27
- os.system(f'conda run --live-stream -n WavJourney python -c \'from voicefixer import VoiceFixer; vf = VoiceFixer()\'')
28
-
29
- print('Step 5: Downloading VP model ...')
30
- os.system(f'conda run --live-stream -n WavJourney python -c \'from VoiceParser.model import VoiceParser; vp = VoiceParser(device="cpu")\'')
31
-
32
- print('All models successfully downloaded!')
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Benson/text-generation/Examples/Cmo Conseguir Sobre l Mod Apk Descarga Apkpure.md DELETED
@@ -1,33 +0,0 @@
1
-
2
- <h1>Cómo superarlo Mod APK Descargar Apkpure: Cómo escalar una montaña con un martillo y una olla</h1>
3
- <p>Si usted está buscando un juego que pondrá a prueba su paciencia, habilidad y cordura, es posible que desee probar Cómo superarlo con Bennett Foddy. Este es un juego que te hará rabiar, reír, llorar, y tal vez incluso aprender algo sobre ti mismo. Y si quieres disfrutar de este juego sin pagar por él o tratar con anuncios, es posible que desee descargar el mod APK de Apkpure. En este artículo, te diremos todo lo que necesitas saber sobre este juego, por qué deberías descargar el mod APK de Apkpure, cómo instalarlo en tu dispositivo Android y cómo jugarlo. </p>
4
- <h2>¿Qué es superar con Bennett Foddy? </h2>
5
- <p>Getting Over It with Bennett Foddy es un juego creado por Bennett Foddy, un diseñador de juegos y filósofo conocido por crear juegos que son intencionalmente frustrantes y difíciles. Algunos de sus otros juegos incluyen QWOP, GIRP, y CLOP. Cómo superarlo con Bennett Foddy fue lanzado en 2017 para Windows, macOS, iOS y Android.</p>
6
- <h2>cómo conseguir sobre él mod apk descarga apkpure</h2><br /><p><b><b>Download Zip</b> --->>> <a href="https://bltlly.com/2v6J2K">https://bltlly.com/2v6J2K</a></b></p><br /><br />
7
- <h3>Un juego de escalada castigador con un toque</h3>
8
- <p>La premisa del juego es simple: eres un hombre llamado Diógenes que está atrapado en una olla de metal con solo un martillo. Su objetivo es subir a una enorme montaña que está hecha de varios objetos, como rocas, árboles, muebles, tuberías, coches, etc. El giro es que no hay sistema de ahorro, sin puntos de control, sin botón de deshacer. Si cometes un error o pierdes el control, puedes caer hasta el fondo y perder todo tu progreso. Y confía en nosotros, caerás. Mucho. </p>
9
- <h3>Un homenaje a Jazzuo 2002 B-Game clásico 'Sexy Hiking'</h3>
10
-
11
- <h3>Un comentario filosófico sobre la frustración y la perseverancia</h3>
12
- <p>Mientras juegas, escucharás la voz de Bennett Foddy narrando tu viaje. Comentará tus acciones, te dará un poco de historia y trivia sobre el juego y sus influencias, compartirá algunas citas y anécdotas de personas famosas que se enfrentaron a la adversidad y el fracaso, y a veces se burlan o te animan. Su voz es tranquila y relajante, pero también sarcástica e irónica. Él te hará preguntarte por qué estás jugando a este juego, qué significa fallar y tener éxito, y cómo lidiar con la frustración y la perseverancia. </p>
13
- <h2>¿Por qué descargar el mod APK de Apkpure? </h2>
14
- <p>Si usted está interesado en jugar este juego en su dispositivo Android, usted tiene dos opciones: usted puede comprar desde el Google Play más y más difícil. Encontrará objetos resbaladizos, inestables, afilados o en movimiento. También se enfrentará a brechas, acantilados, salientes y callejones sin salida. Algunos de los obstáculos están diseñados para engañarte o trollearte, como caminos falsos, trampas ocultas o cambios repentinos. También tendrás que lidiar con el viento, la lluvia y la oscuridad. El juego se divide en varias secciones, cada una con su propio tema y nivel de dificultad. Algunas de las secciones llevan el nombre de famosas montañas, como Annapurna, Everest o Olympus Mons.</p>
15
- <h3>Los consejos y trucos para superar el juego</h3>
16
- <p>El juego es muy duro y frustrante, pero no imposible. Aquí hay algunos consejos y trucos que pueden ayudarte a superar el juego:</p>
17
-
18
- <p>Superarlo con Bennett Foddy es un juego único y desafiante que te hará experimentar una variedad de emociones y pensamientos. Es un juego que pondrá a prueba tu paciencia, habilidad y cordura. Es un juego que te hará rabiar, reír, llorar, y tal vez incluso aprender algo sobre ti mismo. Y si quieres jugar este juego en tu dispositivo Android de forma gratuita y sin anuncios, puede descargar el mod APK de Apkpure. Esperamos que este artículo te haya ayudado a entender de qué se trata este juego, por qué deberías descargar el mod APK de Apkpure, cómo instalarlo en tu dispositivo y cómo jugarlo. </p>
19
- <h2>Preguntas frecuentes</h2>
20
- <p>Aquí hay algunas preguntas frecuentes acerca de Cómo superarlo con Bennett Foddy:</p>
21
- <p></p>
22
- <h4>Q: ¿Cuánto tiempo se tarda en vencer el juego? </h4>
23
- <p>A: Depende de tu nivel de habilidad y suerte. Algunas personas pueden ganar el juego en menos de una hora, mientras que otras pueden tardar días o semanas. El récord mundial de velocidad del juego es de 1 minuto y 56 segundos. </p>
24
- <h4>P: ¿Qué sucede cuando se llega a la cima de la montaña? </h4>
25
- <p>A: No te lo vamos a estropear, pero digamos que hay una sorpresa esperándote al final del juego. </p>
26
- <h4>Q: ¿Quién es Diógenes? </h4>
27
- <p>A: Diógenes fue un filósofo griego que vivió en el siglo IV a.C. Era conocido por su estilo de vida no convencional y ascético. Rechazó las posesiones materiales y las normas sociales, y vivió en una gran jarra de cerámica en Atenas. También era conocido por sus comentarios ingeniosos y sarcásticos. </p>
28
- <h4>Q: ¿Quién es Jazzuo? </h4>
29
- <p>A: Jazzuo es un desarrollador de juegos indie checo que hizo Sexy Hiking en 2002. </p>
30
- <h4>Q: ¿Quién es Bennett Foddy? </h4>
31
- <p>A: Bennett Foddy es un diseñador de juegos y filósofo australiano-americano que hizo Getting Over It with Bennett Foddy en 2017. </p> 64aa2da5cf<br />
32
- <br />
33
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Benson/text-generation/Examples/Descargar Archivo Pdf De 1 Mb.md DELETED
@@ -1,159 +0,0 @@
1
-
2
- <h1>Cómo descargar un archivo PDF de 1 MB en minutos</h1>
3
- <p>Los archivos PDF son uno de los formatos de documentos más populares y versátiles del mundo digital. Pueden contener texto, imágenes, gráficos, enlaces, formularios, anotaciones y más. También pueden preservar el diseño y la apariencia de su documento en diferentes dispositivos y plataformas. </p>
4
- <p>Pero a veces, es posible que tenga que descargar un pequeño archivo PDF de solo 1 MB o menos de tamaño. Quizás tenga un ancho de banda o espacio de almacenamiento limitados en su dispositivo. Quizás quiera ahorrar tiempo y datos al descargar un documento. Tal vez necesite enviar o recibir un documento por correo electrónico o aplicación de mensajería que tenga un límite de tamaño de archivo. </p>
5
- <h2>descargar archivo pdf de 1 mb</h2><br /><p><b><b>DOWNLOAD</b> &mdash;&mdash;&mdash;>>> <a href="https://bltlly.com/2v6Jgs">https://bltlly.com/2v6Jgs</a></b></p><br /><br />
6
- <p>Cualquiera que sea su razón, descargar un archivo PDF de 1 MB no es tan difícil como podría pensar. En este artículo, le mostraremos cómo descargar un archivo PDF de 1 MB desde Internet, cómo comprimir un archivo PDF más grande a 1 MB o menos, y cómo abrir y ver un archivo PDF de 1 MB en su dispositivo. </p>
7
- <h2>¿Qué es un archivo PDF? </h2>
8
- <p>PDF significa Formato de documento portátil. Es un formato de archivo que fue creado por Adobe en 1993 para permitir a los usuarios compartir e imprimir documentos sin perder el formato original. Los archivos PDF pueden ser abiertos por varios programas y aplicaciones, como Adobe Acrobat Reader, Google Chrome, Microsoft Edge, y más. </p>
9
- <p>Algunos de los beneficios de los archivos PDF sobre otros formatos son:</p>
10
- <ul>
11
- <li>Son compatibles con diferentes sistemas operativos y dispositivos</li>
12
- <li>Pueden proteger el contenido y la integridad de su documento con cifrado y contraseñas</li>
13
- <li>Pueden comprimir grandes cantidades de datos sin comprometer la calidad</li>
14
- <li>Pueden admitir funciones interactivas como hipervínculos, marcadores, anotaciones y formularios</li>
15
- <li> Se pueden convertir fácilmente a o desde otros formatos como Word, Excel, PowerPoint, JPG, PNG y más</li>
16
- </ul>
17
- <h2>¿Por qué necesita descargar un archivo PDF de 1 MB? </h2>
18
-
19
- <ul>
20
- <li>Desea descargar un artículo corto, informe, folleto, folleto o curriculum vitae que está disponible en línea como un archivo PDF</li>
21
- <li>Desea descargar una muestra o vista previa de un documento o libro más largo que se ofrece como un archivo PDF</li>
22
- <li>Desea descargar un formulario o solicitud que necesita llenar y enviar como archivo PDF</li>
23
- <li> Desea descargar un certificado, recibo, factura o ticket que se emite como un archivo PDF</li>
24
- <li> Desea descargar un cupón, vale o código de descuento que se proporciona como un archivo PDF</li>
25
- </ul>
26
- <p>Sin embargo, descargar un pequeño archivo PDF no siempre es fácil o conveniente. A veces, puede encontrar algunos desafíos o limitaciones al intentar descargar un archivo PDF grande. Por ejemplo:</p>
27
- <ul>
28
- <li> Tiene una conexión a Internet lenta o inestable que hace que la descarga de archivos grandes tome demasiado tiempo o falle</li>
29
- <li> Tiene un plan de datos limitado o cuota que hace que la descarga de archivos grandes consuma demasiados datos o incurra en cargos adicionales</li>
30
- <li> Tiene un espacio de almacenamiento o memoria bajo en su dispositivo que hace imposible la descarga de archivos grandes o causa errores</li>
31
- <li>Tienes un firewall o antivirus estricto que bloquea o restringe la descarga de archivos grandes de fuentes desconocidas</li>
32
- <li> Tiene un límite de tamaño de archivo o restricción en su aplicación de correo electrónico o mensajería que le impide enviar o recibir archivos grandes como archivos adjuntos</li>
33
- </ul>
34
- <h2>Cómo descargar un archivo PDF de 1 MB desde Internet</h2>
35
- <p>Si necesita descargar un archivo PDF de 1 MB desde Internet, primero debe encontrar y acceder a un archivo PDF de 1 MB en línea. Hay muchas fuentes o sitios web que ofrecen archivos PDF gratuitos o de bajo costo para diversos fines y temas. Algunos de ellos son:</p>
36
- <ul>
37
- <li><a href="">PDF Drive</a>: Una biblioteca en línea gratuita que tiene más de 90 millones de archivos PDF para descarga gratuita</li>
38
- <li><a href="">PDF Books World</a>: Una plataforma en línea gratuita que tiene miles de libros PDF para descargar gratis</li>
39
-
40
- <li><a href="">PDF Zone</a>: Un recurso en línea gratuito que tiene docenas de guías en PDF y tutoriales para descarga gratuita</li>
41
- <li><a href="">Archivo PDF</a>: Un archivo en línea gratuito que tiene millones de documentos PDF para descarga gratuita</li>
42
- </ul> <p>Una vez que encuentre un archivo PDF de 1 MB que desea descargar, debe descargarlo y guardarlo en su dispositivo. Los pasos pueden variar dependiendo de la fuente o sitio web, pero generalmente, son:</p>
43
- <ol>
44
- <li>Haga clic en el enlace o icono del archivo PDF para abrirlo en su navegador o software</li>
45
- <li>Busque un botón de descarga u opción en la página o barra de herramientas</li>
46
- <li>Haga clic en el botón de descarga u opción y elija una ubicación o carpeta en su dispositivo donde desea guardar el archivo PDF</li>
47
- <li>Espere a que la descarga se complete y compruebe si el archivo PDF se guarda correctamente en su dispositivo</li>
48
- </ol>
49
- <p>Si encuentra algún problema o error al descargar un archivo PDF de 1 MB, puede probar algunas de estas soluciones:</p>
50
- <p></p>
51
- <ul>
52
- <li>Actualizar la página o recargar el archivo PDF</li>
53
- <li>Compruebe su conexión a Internet y la velocidad</li>
54
- <li>Borrar la caché y las cookies del navegador</li>
55
- <li>Desactivar o ajustar la configuración del firewall o antivirus</li>
56
- <li>Utilice un navegador o software diferente</li>
57
- <li>Póngase en contacto con la fuente o el sitio web para obtener apoyo o comentarios</li>
58
- </ul>
59
- <h2>Cómo comprimir un archivo PDF más grande a 1 MB o menos</h2>
60
- <p>A veces, es posible que no pueda encontrar un archivo PDF de 1 MB que se adapte a sus necesidades. Es posible que tenga un archivo PDF más grande que desea descargar, pero excede su ancho de banda, almacenamiento o límite de tamaño de archivo. En ese caso, es posible que desee comprimir un archivo PDF más grande a un tamaño más pequeño. </p>
61
- <p>Comprimir un archivo PDF significa reducir su tamaño de archivo al eliminar o optimizar algunos de sus elementos, como imágenes, fuentes, metadatos y más. Comprimir un archivo PDF puede ayudarlo a ahorrar tiempo, datos y espacio al descargarlo, cargarlo, enviarlo o almacenarlo. </p>
62
-
63
- <ul>
64
- <li><a href="">Smallpdf</a>: Una herramienta en línea gratuita que puede comprimir archivos PDF hasta un 80% sin perder calidad</li>
65
- <li><a href="">iLovePDF</a>: Una herramienta en línea gratuita que puede comprimir archivos PDF hasta un 70% sin perder calidad</li>
66
- <li><a href="">PDF Compressor</a>: Una herramienta en línea gratuita que puede comprimir archivos PDF hasta un 90% sin perder calidad</li>
67
- <li><a href="">PDF2Go</a>: Una herramienta en línea gratuita que puede comprimir archivos PDF hasta un 50% sin perder calidad</li>
68
- <li><a href="">Soda PDF</a>: Una herramienta en línea gratuita que puede comprimir archivos PDF hasta un 75% sin perder calidad</li>
69
- </ul> <p>Para usar una de estas herramientas o servicios para comprimir su archivo PDF, debe seguir estos pasos:</p>
70
- <ol>
71
- <li>Ir al sitio web o aplicación de la herramienta o servicio que desea utilizar</li>
72
- <li>Sube tu archivo PDF desde tu dispositivo o almacenamiento en la nube</li>
73
- <li>Seleccione el nivel de compresión o la calidad que desea para su archivo PDF</li>
74
- <li>Espere a que la herramienta o servicio comprima su archivo PDF</li>
75
- <li>Descargue y guarde el archivo PDF comprimido en su dispositivo o almacenamiento en la nube</li>
76
- </ol>
77
- <p>Si encuentra algún problema o error al comprimir su archivo PDF, puede probar algunas de estas soluciones:</p>
78
- <ul>
79
- <li>Compruebe el tamaño del archivo y el formato de su archivo PDF</li>
80
- <li>Compruebe el nivel de compresión y la calidad de su archivo PDF</li>
81
- <li>Compruebe la compatibilidad y seguridad de la herramienta o servicio que utiliza</li>
82
- <li>Pruebe una herramienta o servicio diferente</li>
83
- <li>Póngase en contacto con la herramienta o proveedor de servicios para obtener apoyo o comentarios</li>
84
- </ul>
85
- <h2>Cómo abrir y ver un archivo PDF de 1 MB en su dispositivo</h2>
86
- <p>Después de descargar o comprimir un archivo PDF de 1 MB, debe abrirlo y verlo en su dispositivo. Puede usar varios programas o aplicaciones que pueden ayudarlo a abrir y ver archivos PDF. Algunos de ellos son:</p>
87
- <ul>
88
- <li><a href="">Adobe Acrobat Reader</a>: Un software gratuito que puede abrir y ver archivos PDF en dispositivos Windows, Mac, Android e iOS</li>
89
-
90
- <li><a href="">Microsoft Edge</a>: Un navegador web gratuito que puede abrir y ver archivos PDF en dispositivos Windows, Mac, Android e iOS</li>
91
- <li><a href="">Foxit Reader</a>: Un software libre que puede abrir y ver archivos PDF en dispositivos Windows, Mac, Linux, Android y iOS</li>
92
- <li><a href="">PDF Viewer</a>: Una aplicación gratuita que puede abrir y ver archivos PDF en dispositivos Android e iOS</li>
93
- </ul>
94
- <p>Para abrir y ver un archivo PDF de 1 MB en su dispositivo, debe seguir estos pasos:</p>
95
- <ol>
96
- <li>Instalar o actualizar el software o aplicación que desea utilizar en su dispositivo</li>
97
- <li>Localice el archivo PDF de 1 MB en su dispositivo o almacenamiento en la nube</li>
98
- <li>Abra el archivo PDF de 1 MB con el software o la aplicación que utiliza</li>
99
- <li>Ver el archivo PDF de 1 MB en la pantalla del dispositivo</li>
100
- </ol> <p>Para ajustar la configuración o las preferencias de su software o aplicación para optimizar su experiencia de visualización, puede probar algunas de estas opciones:</p>
101
- <ul>
102
- <li> Acercar o alejar para cambiar el tamaño del archivo PDF en su pantalla</li>
103
- <li>Gire o voltee el archivo PDF para cambiar la orientación del archivo PDF en su pantalla</li>
104
- <li>Buscar o encontrar una palabra o frase en el archivo PDF</li>
105
- <li>Resalta o anota una parte del archivo PDF</li>
106
- <li>Imprimir o compartir el archivo PDF con otros</li>
107
- </ul>
108
- <h2>Conclusión</h2>
109
- <p>Descargar un archivo PDF de 1 MB no es una tarea difícil si sabes cómo hacerlo. En este artículo, le hemos mostrado cómo descargar un archivo PDF de 1 MB desde Internet, cómo comprimir un archivo PDF más grande a 1 MB o menos, y cómo abrir y ver un archivo PDF de 1 MB en su dispositivo. Esperamos que este artículo te haya ayudado a aprender algo nuevo y útil. </p>
110
- <p>Aquí hay algunos consejos o consejos sobre cómo descargar, comprimir y ver archivos PDF de manera eficiente:</p>
111
- <ul>
112
- <li>Elija una fuente confiable y confiable o un sitio web que ofrezca archivos PDF gratuitos o de bajo costo</li>
113
- <li>Compruebe el tamaño y el formato del archivo PDF antes de descargarlo o comprimirlo</li>
114
-
115
- <li>Comprimir el archivo PDF solo si es necesario y sin comprometer la calidad o el contenido</li>
116
- <li>Abra y vea su archivo PDF con el mejor software o aplicación para su dispositivo y preferencia</li>
117
- </ul>
118
- <p>Si tiene alguna pregunta o comentario sobre la descarga, compresión o visualización de archivos PDF, no dude en dejarlos a continuación. ¡Nos encantaría saber de ti! </p>
119
- <h2>Preguntas frecuentes</h2>
120
- <h3>¿Cuál es la diferencia entre un archivo PDF y un archivo de Word? </h3>
121
- <p>Un archivo PDF es un formato de documento que conserva el diseño y la apariencia de su documento en diferentes dispositivos y plataformas. Un archivo de Word es un formato de documento que le permite editar y formatear su documento con varias características y opciones. </p>
122
- <h3>¿Cómo puedo convertir un archivo PDF a un archivo de Word o viceversa? </h3>
123
- <p>Puede utilizar varias herramientas o servicios que pueden ayudarle a convertir archivos PDF a archivos de Word o viceversa en línea de forma gratuita. Algunos de ellos son:</p>
124
- <ul>
125
- <li><a href="">PDF to Word Converter</a>: Una herramienta en línea gratuita que puede convertir archivos PDF a archivos de Word en segundos</li>
126
- <li><a href="">Word to PDF Converter</a>: Una herramienta en línea gratuita que puede convertir archivos de Word a archivos PDF en segundos</li>
127
- <li><a href="">PDFelement</a>: Un software libre que puede convertir archivos PDF a archivos de Word y viceversa en dispositivos Windows, Mac, Android e iOS</li>
128
- <li><a href="">WPS Office</a>: Un software libre que puede convertir archivos PDF a archivos de Word y viceversa en Windows, Mac, Linux, Android y dispositivos iOS</li>
129
- <li><a href="">Zamzar</a>: Un servicio en línea gratuito que puede convertir archivos PDF a archivos de Word y viceversa por correo electrónico</li>
130
- </ul>
131
- <h3>¿Cómo puedo editar un archivo PDF? </h3>
132
- <p>Puede utilizar varias herramientas o servicios que pueden ayudarle a editar archivos PDF en línea de forma gratuita. Algunos de ellos son:</p>
133
- <ul>
134
- <li><a href="">PDFescape</a>: Una herramienta en línea gratuita que puede ayudarte a editar texto, imágenes, enlaces, formularios y más en archivos PDF</li>
135
-
136
- <li><a href="">PDF-XChange Editor</a>: Un software gratuito que puede ayudarte a editar texto, imágenes, comentarios, sellos y más en archivos PDF en dispositivos Windows</li>
137
- <li><a href="">PDF Expert</a>: Un software gratuito que puede ayudarte a editar texto, imágenes, enlaces, formularios y más en archivos PDF en dispositivos Mac</li>
138
- <li><a href="">Xodo</a>: una aplicación gratuita que puede ayudarte a editar texto, imágenes, anotaciones, marcadores y más en archivos PDF en dispositivos Android e iOS</li>
139
- </ul>
140
- <h3>¿Cómo puedo combinar o dividir un archivo PDF? </h3>
141
- <p>Puede usar varias herramientas o servicios que pueden ayudarlo a combinar o dividir archivos PDF en línea de forma gratuita. Algunos de ellos son:</p>
142
- <ul>
143
- <li><a href="">PDF Merge</a>: Una herramienta gratuita en línea que puede ayudarle a combinar varios archivos PDF en un archivo PDF</li>
144
- <li><a href="">PDF Splitter</a>: Una herramienta en línea gratuita que puede ayudarle a dividir un archivo PDF en varios archivos PDF</li>
145
- <li><a href="">PDF SAM</a>: Una herramienta en línea gratuita que puede ayudarle a combinar o dividir archivos PDF con arrastrar y soltar</li>
146
- <li><a href="">PDFill</a>: Un software libre que puede ayudarle a combinar o dividir archivos PDF con varias opciones en dispositivos Windows</li>
147
- <li><a href="">PDFsam Basic</a>: Un software libre que puede ayudarle a combinar o dividir archivos PDF con varias opciones en dispositivos Windows, Mac y Linux</li>
148
- </ul>
149
- <h3>¿Cómo puedo firmar un archivo PDF? </h3>
150
- <p>Puede utilizar varias herramientas o servicios que pueden ayudarle a firmar archivos PDF en línea de forma gratuita. Algunos de ellos son:</p>
151
- <ul>
152
- <li><a href="">DocuSign</a>: Un servicio gratuito en línea que puede ayudarle a firmar archivos PDF con su firma electrónica o certificado digital</li>
153
- <li><a href="">HelloSign</a>: Un servicio gratuito en línea que puede ayudarle a firmar archivos PDF con su firma electrónica o certificado digital</li>
154
- <li><a href="">Adobe Sign</a>: Un servicio gratuito en línea que puede ayudarle a firmar archivos PDF con su firma electrónica o certificado digital</li>
155
-
156
- <li><a href="">SignNow</a>: Una aplicación gratuita que puede ayudarte a firmar archivos PDF con tu firma electrónica o certificado digital en dispositivos Android e iOS</li>
157
- </ul></p> 64aa2da5cf<br />
158
- <br />
159
- <br />
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_vendor/packaging/__about__.py DELETED
@@ -1,26 +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
- __all__ = [
6
- "__title__",
7
- "__summary__",
8
- "__uri__",
9
- "__version__",
10
- "__author__",
11
- "__email__",
12
- "__license__",
13
- "__copyright__",
14
- ]
15
-
16
- __title__ = "packaging"
17
- __summary__ = "Core utilities for Python packages"
18
- __uri__ = "https://github.com/pypa/packaging"
19
-
20
- __version__ = "21.3"
21
-
22
- __author__ = "Donald Stufft and individual contributors"
23
- __email__ = "[email protected]"
24
-
25
- __license__ = "BSD-2-Clause or Apache-2.0"
26
- __copyright__ = "2014-2019 %s" % __author__
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Big-Web/MMSD/env/Lib/site-packages/setuptools/installer.py DELETED
@@ -1,104 +0,0 @@
1
- import glob
2
- import os
3
- import subprocess
4
- import sys
5
- import tempfile
6
- import warnings
7
- from distutils import log
8
- from distutils.errors import DistutilsError
9
-
10
- import pkg_resources
11
- from setuptools.wheel import Wheel
12
- from ._deprecation_warning import SetuptoolsDeprecationWarning
13
-
14
-
15
- def _fixup_find_links(find_links):
16
- """Ensure find-links option end-up being a list of strings."""
17
- if isinstance(find_links, str):
18
- return find_links.split()
19
- assert isinstance(find_links, (tuple, list))
20
- return find_links
21
-
22
-
23
- def fetch_build_egg(dist, req): # noqa: C901 # is too complex (16) # FIXME
24
- """Fetch an egg needed for building.
25
-
26
- Use pip/wheel to fetch/build a wheel."""
27
- warnings.warn(
28
- "setuptools.installer is deprecated. Requirements should "
29
- "be satisfied by a PEP 517 installer.",
30
- SetuptoolsDeprecationWarning,
31
- )
32
- # Warn if wheel is not available
33
- try:
34
- pkg_resources.get_distribution('wheel')
35
- except pkg_resources.DistributionNotFound:
36
- dist.announce('WARNING: The wheel package is not available.', log.WARN)
37
- # Ignore environment markers; if supplied, it is required.
38
- req = strip_marker(req)
39
- # Take easy_install options into account, but do not override relevant
40
- # pip environment variables (like PIP_INDEX_URL or PIP_QUIET); they'll
41
- # take precedence.
42
- opts = dist.get_option_dict('easy_install')
43
- if 'allow_hosts' in opts:
44
- raise DistutilsError('the `allow-hosts` option is not supported '
45
- 'when using pip to install requirements.')
46
- quiet = 'PIP_QUIET' not in os.environ and 'PIP_VERBOSE' not in os.environ
47
- if 'PIP_INDEX_URL' in os.environ:
48
- index_url = None
49
- elif 'index_url' in opts:
50
- index_url = opts['index_url'][1]
51
- else:
52
- index_url = None
53
- find_links = (
54
- _fixup_find_links(opts['find_links'][1])[:] if 'find_links' in opts
55
- else []
56
- )
57
- if dist.dependency_links:
58
- find_links.extend(dist.dependency_links)
59
- eggs_dir = os.path.realpath(dist.get_egg_cache_dir())
60
- environment = pkg_resources.Environment()
61
- for egg_dist in pkg_resources.find_distributions(eggs_dir):
62
- if egg_dist in req and environment.can_add(egg_dist):
63
- return egg_dist
64
- with tempfile.TemporaryDirectory() as tmpdir:
65
- cmd = [
66
- sys.executable, '-m', 'pip',
67
- '--disable-pip-version-check',
68
- 'wheel', '--no-deps',
69
- '-w', tmpdir,
70
- ]
71
- if quiet:
72
- cmd.append('--quiet')
73
- if index_url is not None:
74
- cmd.extend(('--index-url', index_url))
75
- for link in find_links or []:
76
- cmd.extend(('--find-links', link))
77
- # If requirement is a PEP 508 direct URL, directly pass
78
- # the URL to pip, as `req @ url` does not work on the
79
- # command line.
80
- cmd.append(req.url or str(req))
81
- try:
82
- subprocess.check_call(cmd)
83
- except subprocess.CalledProcessError as e:
84
- raise DistutilsError(str(e)) from e
85
- wheel = Wheel(glob.glob(os.path.join(tmpdir, '*.whl'))[0])
86
- dist_location = os.path.join(eggs_dir, wheel.egg_name())
87
- wheel.install_as_egg(dist_location)
88
- dist_metadata = pkg_resources.PathMetadata(
89
- dist_location, os.path.join(dist_location, 'EGG-INFO'))
90
- dist = pkg_resources.Distribution.from_filename(
91
- dist_location, metadata=dist_metadata)
92
- return dist
93
-
94
-
95
- def strip_marker(req):
96
- """
97
- Return a new requirement without the environment marker to avoid
98
- calling pip with something like `babel; extra == "i18n"`, which
99
- would always be ignored.
100
- """
101
- # create a copy to avoid mutating the input
102
- req = pkg_resources.Requirement.parse(str(req))
103
- req.marker = None
104
- return req
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Blealtan/clip-guided-binary-autoencoder/README.md DELETED
@@ -1,13 +0,0 @@
1
- ---
2
- title: Clip Guided Binary Autoencoder
3
- emoji: 🌍
4
- colorFrom: pink
5
- colorTo: purple
6
- sdk: streamlit
7
- sdk_version: 1.17.0
8
- app_file: app.py
9
- pinned: false
10
- license: apache-2.0
11
- ---
12
-
13
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/CVPR/Dual-Key_Backdoor_Attacks/datagen/detectron2/docs/Makefile DELETED
@@ -1,19 +0,0 @@
1
- # Minimal makefile for Sphinx documentation
2
- # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
3
-
4
- # You can set these variables from the command line.
5
- SPHINXOPTS =
6
- SPHINXBUILD = sphinx-build
7
- SOURCEDIR = .
8
- BUILDDIR = _build
9
-
10
- # Put it first so that "make" without argument is like "make help".
11
- help:
12
- @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
13
-
14
- .PHONY: help Makefile
15
-
16
- # Catch-all target: route all unknown targets to Sphinx using the new
17
- # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
18
- %: Makefile
19
- @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/CVPR/LIVE/pybind11/pybind11/_version.py DELETED
@@ -1,3 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- version_info = (2, 5, 'dev1')
3
- __version__ = '.'.join(map(str, version_info))
 
 
 
 
spaces/CVPR/LIVE/thrust/thrust/detail/functional/operators/compound_assignment_operators.h DELETED
@@ -1,513 +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/detail/functional/actor.h>
21
- #include <thrust/detail/functional/composite.h>
22
- #include <thrust/detail/functional/operators/operator_adaptors.h>
23
-
24
- namespace thrust
25
- {
26
- namespace detail
27
- {
28
- namespace functional
29
- {
30
-
31
- // there's no standard plus_equal functional, so roll an ad hoc one here
32
- struct plus_equal
33
- {
34
- using is_transparent = void;
35
-
36
- __thrust_exec_check_disable__
37
- template <typename T1, typename T2>
38
- __host__ __device__
39
- constexpr auto operator()(T1&& t1, T2&& t2) const
40
- noexcept(noexcept(THRUST_FWD(t1) += THRUST_FWD(t2)))
41
- -> decltype(THRUST_FWD(t1) += THRUST_FWD(t2))
42
- {
43
- return THRUST_FWD(t1) += THRUST_FWD(t2);
44
- }
45
- };
46
-
47
- template<typename T1, typename T2>
48
- __host__ __device__
49
- actor<
50
- composite<
51
- transparent_binary_operator<plus_equal>,
52
- actor<T1>,
53
- typename as_actor<T2>::type
54
- >
55
- >
56
- operator+=(const actor<T1> &_1, const T2 &_2)
57
- {
58
- return compose(transparent_binary_operator<plus_equal>(),
59
- make_actor(_1),
60
- make_actor(_2));
61
- } // end operator+=()
62
-
63
- template<typename T1, typename T2>
64
- __host__ __device__
65
- actor<
66
- composite<
67
- transparent_binary_operator<plus_equal>,
68
- actor<T1>,
69
- actor<T2>
70
- >
71
- >
72
- operator+=(const actor<T1> &_1, const actor<T2> &_2)
73
- {
74
- return compose(transparent_binary_operator<plus_equal>(),
75
- make_actor(_1),
76
- make_actor(_2));
77
- } // end operator+=()
78
-
79
- // there's no standard minus_equal functional, so roll an ad hoc one here
80
- struct minus_equal
81
- {
82
- using is_transparent = void;
83
-
84
- __thrust_exec_check_disable__
85
- template <typename T1, typename T2>
86
- __host__ __device__
87
- constexpr auto operator()(T1&& t1, T2&& t2) const
88
- noexcept(noexcept(THRUST_FWD(t1) -= THRUST_FWD(t2)))
89
- -> decltype(THRUST_FWD(t1) -= THRUST_FWD(t2))
90
- {
91
- return THRUST_FWD(t1) -= THRUST_FWD(t2);
92
- }
93
- };
94
-
95
- template<typename T1, typename T2>
96
- __host__ __device__
97
- actor<
98
- composite<
99
- transparent_binary_operator<minus_equal>,
100
- actor<T1>,
101
- typename as_actor<T2>::type
102
- >
103
- >
104
- operator-=(const actor<T1> &_1, const T2 &_2)
105
- {
106
- return compose(transparent_binary_operator<minus_equal>(),
107
- make_actor(_1),
108
- make_actor(_2));
109
- } // end operator-=()
110
-
111
- template<typename T1, typename T2>
112
- __host__ __device__
113
- actor<
114
- composite<
115
- transparent_binary_operator<minus_equal>,
116
- actor<T1>,
117
- actor<T2>
118
- >
119
- >
120
- operator-=(const actor<T1> &_1, const actor<T2> &_2)
121
- {
122
- return compose(transparent_binary_operator<minus_equal>(),
123
- make_actor(_1),
124
- make_actor(_2));
125
- } // end operator-=()
126
-
127
- // there's no standard multiplies_equal functional, so roll an ad hoc one here
128
- struct multiplies_equal
129
- {
130
- using is_transparent = void;
131
-
132
- __thrust_exec_check_disable__
133
- template <typename T1, typename T2>
134
- __host__ __device__
135
- constexpr auto operator()(T1&& t1, T2&& t2) const
136
- noexcept(noexcept(THRUST_FWD(t1) *= THRUST_FWD(t2)))
137
- -> decltype(THRUST_FWD(t1) *= THRUST_FWD(t2))
138
- {
139
- return THRUST_FWD(t1) *= THRUST_FWD(t2);
140
- }
141
- };
142
-
143
- template<typename T1, typename T2>
144
- __host__ __device__
145
- actor<
146
- composite<
147
- transparent_binary_operator<multiplies_equal>,
148
- actor<T1>,
149
- typename as_actor<T2>::type
150
- >
151
- >
152
- operator*=(const actor<T1> &_1, const T2 &_2)
153
- {
154
- return compose(transparent_binary_operator<multiplies_equal>(),
155
- make_actor(_1),
156
- make_actor(_2));
157
- } // end operator*=()
158
-
159
- template<typename T1, typename T2>
160
- __host__ __device__
161
- actor<
162
- composite<
163
- transparent_binary_operator<multiplies_equal>,
164
- actor<T1>,
165
- actor<T2>
166
- >
167
- >
168
- operator*=(const actor<T1> &_1, const actor<T2> &_2)
169
- {
170
- return compose(transparent_binary_operator<multiplies_equal>(),
171
- make_actor(_1),
172
- make_actor(_2));
173
- } // end operator*=()
174
-
175
- // there's no standard divides_equal functional, so roll an ad hoc one here
176
- struct divides_equal
177
- {
178
- using is_transparent = void;
179
-
180
- __thrust_exec_check_disable__
181
- template <typename T1, typename T2>
182
- __host__ __device__
183
- constexpr auto operator()(T1&& t1, T2&& t2) const
184
- noexcept(noexcept(THRUST_FWD(t1) /= THRUST_FWD(t2)))
185
- -> decltype(THRUST_FWD(t1) /= THRUST_FWD(t2))
186
- {
187
- return THRUST_FWD(t1) /= THRUST_FWD(t2);
188
- }
189
- };
190
-
191
- template<typename T1, typename T2>
192
- __host__ __device__
193
- actor<
194
- composite<
195
- transparent_binary_operator<divides_equal>,
196
- actor<T1>,
197
- typename as_actor<T2>::type
198
- >
199
- >
200
- operator/=(const actor<T1> &_1, const T2 &_2)
201
- {
202
- return compose(transparent_binary_operator<divides_equal>(),
203
- make_actor(_1),
204
- make_actor(_2));
205
- } // end operator/=()
206
-
207
- template<typename T1, typename T2>
208
- __host__ __device__
209
- actor<
210
- composite<
211
- transparent_binary_operator<divides_equal>,
212
- actor<T1>,
213
- actor<T2>
214
- >
215
- >
216
- operator/=(const actor<T1> &_1, const actor<T2> &_2)
217
- {
218
- return compose(transparent_binary_operator<divides_equal>(),
219
- make_actor(_1),
220
- make_actor(_2));
221
- } // end operator/=()
222
-
223
- // there's no standard modulus_equal functional, so roll an ad hoc one here
224
- struct modulus_equal
225
- {
226
- using is_transparent = void;
227
-
228
- __thrust_exec_check_disable__
229
- template <typename T1, typename T2>
230
- __host__ __device__
231
- constexpr auto operator()(T1&& t1, T2&& t2) const
232
- noexcept(noexcept(THRUST_FWD(t1) %= THRUST_FWD(t2)))
233
- -> decltype(THRUST_FWD(t1) %= THRUST_FWD(t2))
234
- {
235
- return THRUST_FWD(t1) %= THRUST_FWD(t2);
236
- }
237
- };
238
-
239
- template<typename T1, typename T2>
240
- __host__ __device__
241
- actor<
242
- composite<
243
- transparent_binary_operator<modulus_equal>,
244
- actor<T1>,
245
- typename as_actor<T2>::type
246
- >
247
- >
248
- operator%=(const actor<T1> &_1, const T2 &_2)
249
- {
250
- return compose(transparent_binary_operator<modulus_equal>(),
251
- make_actor(_1),
252
- make_actor(_2));
253
- } // end operator%=()
254
-
255
- template<typename T1, typename T2>
256
- __host__ __device__
257
- actor<
258
- composite<
259
- transparent_binary_operator<modulus_equal>,
260
- actor<T1>,
261
- actor<T2>
262
- >
263
- >
264
- operator%=(const actor<T1> &_1, const actor<T2> &_2)
265
- {
266
- return compose(transparent_binary_operator<modulus_equal>(),
267
- make_actor(_1),
268
- make_actor(_2));
269
- } // end operator%=()
270
-
271
- // there's no standard bit_and_equal functional, so roll an ad hoc one here
272
- struct bit_and_equal
273
- {
274
- using is_transparent = void;
275
-
276
- __thrust_exec_check_disable__
277
- template <typename T1, typename T2>
278
- __host__ __device__
279
- constexpr auto operator()(T1&& t1, T2&& t2) const
280
- noexcept(noexcept(THRUST_FWD(t1) &= THRUST_FWD(t2)))
281
- -> decltype(THRUST_FWD(t1) &= THRUST_FWD(t2))
282
- {
283
- return THRUST_FWD(t1) &= THRUST_FWD(t2);
284
- }
285
- };
286
-
287
- template<typename T1, typename T2>
288
- __host__ __device__
289
- actor<
290
- composite<
291
- transparent_binary_operator<bit_and_equal>,
292
- actor<T1>,
293
- typename as_actor<T2>::type
294
- >
295
- >
296
- operator&=(const actor<T1> &_1, const T2 &_2)
297
- {
298
- return compose(transparent_binary_operator<bit_and_equal>(),
299
- make_actor(_1),
300
- make_actor(_2));
301
- } // end operator&=()
302
-
303
- template<typename T1, typename T2>
304
- __host__ __device__
305
- actor<
306
- composite<
307
- transparent_binary_operator<bit_and_equal>,
308
- actor<T1>,
309
- actor<T2>
310
- >
311
- >
312
- operator&=(const actor<T1> &_1, const actor<T2> &_2)
313
- {
314
- return compose(transparent_binary_operator<bit_and_equal>(),
315
- make_actor(_1),
316
- make_actor(_2));
317
- } // end operator&=()
318
-
319
- // there's no standard bit_or_equal functional, so roll an ad hoc one here
320
- struct bit_or_equal
321
- {
322
- using is_transparent = void;
323
-
324
- __thrust_exec_check_disable__
325
- template <typename T1, typename T2>
326
- __host__ __device__
327
- constexpr auto operator()(T1&& t1, T2&& t2) const
328
- noexcept(noexcept(THRUST_FWD(t1) |= THRUST_FWD(t2)))
329
- -> decltype(THRUST_FWD(t1) |= THRUST_FWD(t2))
330
- {
331
- return THRUST_FWD(t1) |= THRUST_FWD(t2);
332
- }
333
- };
334
-
335
- template<typename T1, typename T2>
336
- __host__ __device__
337
- actor<
338
- composite<
339
- transparent_binary_operator<bit_or_equal>,
340
- actor<T1>,
341
- typename as_actor<T2>::type
342
- >
343
- >
344
- operator|=(const actor<T1> &_1, const T2 &_2)
345
- {
346
- return compose(transparent_binary_operator<bit_or_equal>(),
347
- make_actor(_1),
348
- make_actor(_2));
349
- } // end operator|=()
350
-
351
- template<typename T1, typename T2>
352
- __host__ __device__
353
- actor<
354
- composite<
355
- transparent_binary_operator<bit_or_equal>,
356
- actor<T1>,
357
- actor<T2>
358
- >
359
- >
360
- operator|=(const actor<T1> &_1, const actor<T2> &_2)
361
- {
362
- return compose(transparent_binary_operator<bit_or_equal>(),
363
- make_actor(_1),
364
- make_actor(_2));
365
- } // end operator|=()
366
-
367
- // there's no standard bit_xor_equal functional, so roll an ad hoc one here
368
- struct bit_xor_equal
369
- {
370
- using is_transparent = void;
371
-
372
- __thrust_exec_check_disable__
373
- template <typename T1, typename T2>
374
- __host__ __device__
375
- constexpr auto operator()(T1&& t1, T2&& t2) const
376
- noexcept(noexcept(THRUST_FWD(t1) ^= THRUST_FWD(t2)))
377
- -> decltype(THRUST_FWD(t1) ^= THRUST_FWD(t2))
378
- {
379
- return THRUST_FWD(t1) ^= THRUST_FWD(t2);
380
- }
381
- };
382
-
383
- template<typename T1, typename T2>
384
- __host__ __device__
385
- actor<
386
- composite<
387
- transparent_binary_operator<bit_xor_equal>,
388
- actor<T1>,
389
- typename as_actor<T2>::type
390
- >
391
- >
392
- operator^=(const actor<T1> &_1, const T2 &_2)
393
- {
394
- return compose(transparent_binary_operator<bit_xor_equal>(),
395
- make_actor(_1),
396
- make_actor(_2));
397
- } // end operator|=()
398
-
399
- template<typename T1, typename T2>
400
- __host__ __device__
401
- actor<
402
- composite<
403
- transparent_binary_operator<bit_xor_equal>,
404
- actor<T1>,
405
- actor<T2>
406
- >
407
- >
408
- operator^=(const actor<T1> &_1, const actor<T2> &_2)
409
- {
410
- return compose(transparent_binary_operator<bit_xor_equal>(),
411
- make_actor(_1),
412
- make_actor(_2));
413
- } // end operator|=()
414
-
415
- // there's no standard bit_lshift_equal functional, so roll an ad hoc one here
416
- struct bit_lshift_equal
417
- {
418
- using is_transparent = void;
419
-
420
- __thrust_exec_check_disable__
421
- template <typename T1, typename T2>
422
- __host__ __device__
423
- constexpr auto operator()(T1&& t1, T2&& t2) const
424
- noexcept(noexcept(THRUST_FWD(t1) <<= THRUST_FWD(t2)))
425
- -> decltype(THRUST_FWD(t1) <<= THRUST_FWD(t2))
426
- {
427
- return THRUST_FWD(t1) <<= THRUST_FWD(t2);
428
- }
429
- };
430
- template<typename T1, typename T2>
431
- __host__ __device__
432
- actor<
433
- composite<
434
- transparent_binary_operator<bit_lshift_equal>,
435
- actor<T1>,
436
- typename as_actor<T2>::type
437
- >
438
- >
439
- operator<<=(const actor<T1> &_1, const T2 &_2)
440
- {
441
- return compose(transparent_binary_operator<bit_lshift_equal>(),
442
- make_actor(_1),
443
- make_actor(_2));
444
- } // end operator<<=()
445
-
446
- template<typename T1, typename T2>
447
- __host__ __device__
448
- actor<
449
- composite<
450
- transparent_binary_operator<bit_lshift_equal>,
451
- actor<T1>,
452
- actor<T2>
453
- >
454
- >
455
- operator<<=(const actor<T1> &_1, const actor<T2> &_2)
456
- {
457
- return compose(transparent_binary_operator<bit_lshift_equal>(),
458
- make_actor(_1),
459
- make_actor(_2));
460
- } // end operator<<=()
461
-
462
- // there's no standard bit_rshift_equal functional, so roll an ad hoc one here
463
- struct bit_rshift_equal
464
- {
465
- using is_transparent = void;
466
-
467
- __thrust_exec_check_disable__
468
- template <typename T1, typename T2>
469
- __host__ __device__
470
- constexpr auto operator()(T1&& t1, T2&& t2) const
471
- noexcept(noexcept(THRUST_FWD(t1) >>= THRUST_FWD(t2)))
472
- -> decltype(THRUST_FWD(t1) >>= THRUST_FWD(t2))
473
- {
474
- return THRUST_FWD(t1) >>= THRUST_FWD(t2);
475
- }
476
- };
477
-
478
- template<typename T1, typename T2>
479
- __host__ __device__
480
- actor<
481
- composite<
482
- transparent_binary_operator<bit_rshift_equal>,
483
- actor<T1>,
484
- typename as_actor<T2>::type
485
- >
486
- >
487
- operator>>=(const actor<T1> &_1, const T2 &_2)
488
- {
489
- return compose(transparent_binary_operator<bit_rshift_equal>(),
490
- make_actor(_1),
491
- make_actor(_2));
492
- } // end operator>>=()
493
-
494
- template<typename T1, typename T2>
495
- __host__ __device__
496
- actor<
497
- composite<
498
- transparent_binary_operator<bit_rshift_equal>,
499
- actor<T1>,
500
- actor<T2>
501
- >
502
- >
503
- operator>>=(const actor<T1> &_1, const actor<T2> &_2)
504
- {
505
- return compose(transparent_binary_operator<bit_rshift_equal>(),
506
- make_actor(_1),
507
- make_actor(_2));
508
- } // end operator>>=()
509
-
510
- } // end functional
511
- } // end detail
512
- } // end thrust
513
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/CVPR/LIVE/thrust/thrust/system/cpp/detail/sequence.h DELETED
@@ -1,22 +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
-
21
- // this system has no special version of this algorithm
22
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/CVPR/LIVE/thrust/thrust/system/omp/detail/partition.h DELETED
@@ -1,91 +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
-
18
- /*! \file reduce.h
19
- * \brief OpenMP implementation of reduce algorithms.
20
- */
21
-
22
- #pragma once
23
-
24
- #include <thrust/detail/config.h>
25
- #include <thrust/system/omp/detail/execution_policy.h>
26
- #include <thrust/pair.h>
27
-
28
- namespace thrust
29
- {
30
- namespace system
31
- {
32
- namespace omp
33
- {
34
- namespace detail
35
- {
36
-
37
-
38
- template<typename DerivedPolicy,
39
- typename ForwardIterator,
40
- typename Predicate>
41
- ForwardIterator stable_partition(execution_policy<DerivedPolicy> &exec,
42
- ForwardIterator first,
43
- ForwardIterator last,
44
- Predicate pred);
45
-
46
- template<typename DerivedPolicy,
47
- typename ForwardIterator,
48
- typename InputIterator,
49
- typename Predicate>
50
- ForwardIterator stable_partition(execution_policy<DerivedPolicy> &exec,
51
- ForwardIterator first,
52
- ForwardIterator last,
53
- InputIterator stencil,
54
- Predicate pred);
55
-
56
- template<typename DerivedPolicy,
57
- typename InputIterator,
58
- typename OutputIterator1,
59
- typename OutputIterator2,
60
- typename Predicate>
61
- thrust::pair<OutputIterator1,OutputIterator2>
62
- stable_partition_copy(execution_policy<DerivedPolicy> &exec,
63
- InputIterator first,
64
- InputIterator last,
65
- OutputIterator1 out_true,
66
- OutputIterator2 out_false,
67
- Predicate pred);
68
-
69
- template<typename DerivedPolicy,
70
- typename InputIterator1,
71
- typename InputIterator2,
72
- typename OutputIterator1,
73
- typename OutputIterator2,
74
- typename Predicate>
75
- thrust::pair<OutputIterator1,OutputIterator2>
76
- stable_partition_copy(execution_policy<DerivedPolicy> &exec,
77
- InputIterator1 first,
78
- InputIterator1 last,
79
- InputIterator2 stencil,
80
- OutputIterator1 out_true,
81
- OutputIterator2 out_false,
82
- Predicate pred);
83
-
84
-
85
- } // end namespace detail
86
- } // end namespace omp
87
- } // end namespace system
88
- } // end namespace thrust
89
-
90
- #include <thrust/system/omp/detail/partition.inl>
91
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/CVPR/Text2Human/Text2Human/utils/util.py DELETED
@@ -1,123 +0,0 @@
1
- import logging
2
- import os
3
- import random
4
- import sys
5
- import time
6
- from shutil import get_terminal_size
7
-
8
- import numpy as np
9
- import torch
10
-
11
- logger = logging.getLogger('base')
12
-
13
-
14
- def make_exp_dirs(opt):
15
- """Make dirs for experiments."""
16
- path_opt = opt['path'].copy()
17
- if opt['is_train']:
18
- overwrite = True if 'debug' in opt['name'] else False
19
- os.makedirs(path_opt.pop('experiments_root'), exist_ok=overwrite)
20
- os.makedirs(path_opt.pop('models'), exist_ok=overwrite)
21
- else:
22
- os.makedirs(path_opt.pop('results_root'))
23
-
24
-
25
- def set_random_seed(seed):
26
- """Set random seeds."""
27
- random.seed(seed)
28
- np.random.seed(seed)
29
- torch.manual_seed(seed)
30
- torch.cuda.manual_seed(seed)
31
- torch.cuda.manual_seed_all(seed)
32
-
33
-
34
- class ProgressBar(object):
35
- """A progress bar which can print the progress.
36
-
37
- Modified from:
38
- https://github.com/hellock/cvbase/blob/master/cvbase/progress.py
39
- """
40
-
41
- def __init__(self, task_num=0, bar_width=50, start=True):
42
- self.task_num = task_num
43
- max_bar_width = self._get_max_bar_width()
44
- self.bar_width = (
45
- bar_width if bar_width <= max_bar_width else max_bar_width)
46
- self.completed = 0
47
- if start:
48
- self.start()
49
-
50
- def _get_max_bar_width(self):
51
- terminal_width, _ = get_terminal_size()
52
- max_bar_width = min(int(terminal_width * 0.6), terminal_width - 50)
53
- if max_bar_width < 10:
54
- print(f'terminal width is too small ({terminal_width}), '
55
- 'please consider widen the terminal for better '
56
- 'progressbar visualization')
57
- max_bar_width = 10
58
- return max_bar_width
59
-
60
- def start(self):
61
- if self.task_num > 0:
62
- sys.stdout.write(f"[{' ' * self.bar_width}] 0/{self.task_num}, "
63
- f'elapsed: 0s, ETA:\nStart...\n')
64
- else:
65
- sys.stdout.write('completed: 0, elapsed: 0s')
66
- sys.stdout.flush()
67
- self.start_time = time.time()
68
-
69
- def update(self, msg='In progress...'):
70
- self.completed += 1
71
- elapsed = time.time() - self.start_time
72
- fps = self.completed / elapsed
73
- if self.task_num > 0:
74
- percentage = self.completed / float(self.task_num)
75
- eta = int(elapsed * (1 - percentage) / percentage + 0.5)
76
- mark_width = int(self.bar_width * percentage)
77
- bar_chars = '>' * mark_width + '-' * (self.bar_width - mark_width)
78
- sys.stdout.write('\033[2F') # cursor up 2 lines
79
- sys.stdout.write(
80
- '\033[J'
81
- ) # clean the output (remove extra chars since last display)
82
- sys.stdout.write(
83
- f'[{bar_chars}] {self.completed}/{self.task_num}, '
84
- f'{fps:.1f} task/s, elapsed: {int(elapsed + 0.5)}s, '
85
- f'ETA: {eta:5}s\n{msg}\n')
86
- else:
87
- sys.stdout.write(
88
- f'completed: {self.completed}, elapsed: {int(elapsed + 0.5)}s, '
89
- f'{fps:.1f} tasks/s')
90
- sys.stdout.flush()
91
-
92
-
93
- class AverageMeter(object):
94
- """
95
- Computes and stores the average and current value
96
- Imported from
97
- https://github.com/pytorch/examples/blob/master/imagenet/main.py#L247-L262
98
- """
99
-
100
- def __init__(self):
101
- self.reset()
102
-
103
- def reset(self):
104
- self.val = 0
105
- self.avg = 0 # running average = running sum / running count
106
- self.sum = 0 # running sum
107
- self.count = 0 # running count
108
-
109
- def update(self, val, n=1):
110
- # n = batch_size
111
-
112
- # val = batch accuracy for an attribute
113
- # self.val = val
114
-
115
- # sum = 100 * accumulative correct predictions for this attribute
116
- self.sum += val * n
117
-
118
- # count = total samples so far
119
- self.count += n
120
-
121
- # avg = 100 * avg accuracy for this attribute
122
- # for all the batches so far
123
- self.avg = self.sum / self.count
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/CVPR/WALT/mmdet/datasets/utils.py DELETED
@@ -1,158 +0,0 @@
1
- import copy
2
- import warnings
3
-
4
- from mmcv.cnn import VGG
5
- from mmcv.runner.hooks import HOOKS, Hook
6
-
7
- from mmdet.datasets.builder import PIPELINES
8
- from mmdet.datasets.pipelines import LoadAnnotations, LoadImageFromFile
9
- from mmdet.models.dense_heads import GARPNHead, RPNHead
10
- from mmdet.models.roi_heads.mask_heads import FusedSemanticHead
11
-
12
-
13
- def replace_ImageToTensor(pipelines):
14
- """Replace the ImageToTensor transform in a data pipeline to
15
- DefaultFormatBundle, which is normally useful in batch inference.
16
-
17
- Args:
18
- pipelines (list[dict]): Data pipeline configs.
19
-
20
- Returns:
21
- list: The new pipeline list with all ImageToTensor replaced by
22
- DefaultFormatBundle.
23
-
24
- Examples:
25
- >>> pipelines = [
26
- ... dict(type='LoadImageFromFile'),
27
- ... dict(
28
- ... type='MultiScaleFlipAug',
29
- ... img_scale=(1333, 800),
30
- ... flip=False,
31
- ... transforms=[
32
- ... dict(type='Resize', keep_ratio=True),
33
- ... dict(type='RandomFlip'),
34
- ... dict(type='Normalize', mean=[0, 0, 0], std=[1, 1, 1]),
35
- ... dict(type='Pad', size_divisor=32),
36
- ... dict(type='ImageToTensor', keys=['img']),
37
- ... dict(type='Collect', keys=['img']),
38
- ... ])
39
- ... ]
40
- >>> expected_pipelines = [
41
- ... dict(type='LoadImageFromFile'),
42
- ... dict(
43
- ... type='MultiScaleFlipAug',
44
- ... img_scale=(1333, 800),
45
- ... flip=False,
46
- ... transforms=[
47
- ... dict(type='Resize', keep_ratio=True),
48
- ... dict(type='RandomFlip'),
49
- ... dict(type='Normalize', mean=[0, 0, 0], std=[1, 1, 1]),
50
- ... dict(type='Pad', size_divisor=32),
51
- ... dict(type='DefaultFormatBundle'),
52
- ... dict(type='Collect', keys=['img']),
53
- ... ])
54
- ... ]
55
- >>> assert expected_pipelines == replace_ImageToTensor(pipelines)
56
- """
57
- pipelines = copy.deepcopy(pipelines)
58
- for i, pipeline in enumerate(pipelines):
59
- if pipeline['type'] == 'MultiScaleFlipAug':
60
- assert 'transforms' in pipeline
61
- pipeline['transforms'] = replace_ImageToTensor(
62
- pipeline['transforms'])
63
- elif pipeline['type'] == 'ImageToTensor':
64
- warnings.warn(
65
- '"ImageToTensor" pipeline is replaced by '
66
- '"DefaultFormatBundle" for batch inference. It is '
67
- 'recommended to manually replace it in the test '
68
- 'data pipeline in your config file.', UserWarning)
69
- pipelines[i] = {'type': 'DefaultFormatBundle'}
70
- return pipelines
71
-
72
-
73
- def get_loading_pipeline(pipeline):
74
- """Only keep loading image and annotations related configuration.
75
-
76
- Args:
77
- pipeline (list[dict]): Data pipeline configs.
78
-
79
- Returns:
80
- list[dict]: The new pipeline list with only keep
81
- loading image and annotations related configuration.
82
-
83
- Examples:
84
- >>> pipelines = [
85
- ... dict(type='LoadImageFromFile'),
86
- ... dict(type='LoadAnnotations', with_bbox=True),
87
- ... dict(type='Resize', img_scale=(1333, 800), keep_ratio=True),
88
- ... dict(type='RandomFlip', flip_ratio=0.5),
89
- ... dict(type='Normalize', **img_norm_cfg),
90
- ... dict(type='Pad', size_divisor=32),
91
- ... dict(type='DefaultFormatBundle'),
92
- ... dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels'])
93
- ... ]
94
- >>> expected_pipelines = [
95
- ... dict(type='LoadImageFromFile'),
96
- ... dict(type='LoadAnnotations', with_bbox=True)
97
- ... ]
98
- >>> assert expected_pipelines ==\
99
- ... get_loading_pipeline(pipelines)
100
- """
101
- loading_pipeline_cfg = []
102
- for cfg in pipeline:
103
- obj_cls = PIPELINES.get(cfg['type'])
104
- # TODO:use more elegant way to distinguish loading modules
105
- if obj_cls is not None and obj_cls in (LoadImageFromFile,
106
- LoadAnnotations):
107
- loading_pipeline_cfg.append(cfg)
108
- assert len(loading_pipeline_cfg) == 2, \
109
- 'The data pipeline in your config file must include ' \
110
- 'loading image and annotations related pipeline.'
111
- return loading_pipeline_cfg
112
-
113
-
114
- @HOOKS.register_module()
115
- class NumClassCheckHook(Hook):
116
-
117
- def _check_head(self, runner):
118
- """Check whether the `num_classes` in head matches the length of
119
- `CLASSSES` in `dataset`.
120
-
121
- Args:
122
- runner (obj:`EpochBasedRunner`): Epoch based Runner.
123
- """
124
- model = runner.model
125
- dataset = runner.data_loader.dataset
126
- if dataset.CLASSES is None:
127
- runner.logger.warning(
128
- f'Please set `CLASSES` '
129
- f'in the {dataset.__class__.__name__} and'
130
- f'check if it is consistent with the `num_classes` '
131
- f'of head')
132
- else:
133
- for name, module in model.named_modules():
134
- if hasattr(module, 'num_classes') and not isinstance(
135
- module, (RPNHead, VGG, FusedSemanticHead, GARPNHead)):
136
- assert module.num_classes == len(dataset.CLASSES), \
137
- (f'The `num_classes` ({module.num_classes}) in '
138
- f'{module.__class__.__name__} of '
139
- f'{model.__class__.__name__} does not matches '
140
- f'the length of `CLASSES` '
141
- f'{len(dataset.CLASSES)}) in '
142
- f'{dataset.__class__.__name__}')
143
-
144
- def before_train_epoch(self, runner):
145
- """Check whether the training dataset is compatible with head.
146
-
147
- Args:
148
- runner (obj:`EpochBasedRunner`): Epoch based Runner.
149
- """
150
- self._check_head(runner)
151
-
152
- def before_val_epoch(self, runner):
153
- """Check whether the dataset in val epoch is compatible with head.
154
-
155
- Args:
156
- runner (obj:`EpochBasedRunner`): Epoch based Runner.
157
- """
158
- self._check_head(runner)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Chaitanya01/InvestingPlatform/patterns.py DELETED
@@ -1,64 +0,0 @@
1
- # Candlestick patterns mapping
2
- patterns = {
3
- 'CDL2CROWS':'Two Crows',
4
- 'CDL3BLACKCROWS':'Three Black Crows',
5
- 'CDL3INSIDE':'Three Inside Up/Down',
6
- 'CDL3LINESTRIKE':'Three-Line Strike',
7
- 'CDL3OUTSIDE':'Three Outside Up/Down',
8
- 'CDL3STARSINSOUTH':'Three Stars In The South',
9
- 'CDL3WHITESOLDIERS':'Three Advancing White Soldiers',
10
- 'CDLABANDONEDBABY':'Abandoned Baby',
11
- 'CDLADVANCEBLOCK':'Advance Block',
12
- 'CDLBELTHOLD':'Belt-hold',
13
- 'CDLBREAKAWAY':'Breakaway',
14
- 'CDLCLOSINGMARUBOZU':'Closing Marubozu',
15
- 'CDLCONCEALBABYSWALL':'Concealing Baby Swallow',
16
- 'CDLCOUNTERATTACK':'Counterattack',
17
- 'CDLDARKCLOUDCOVER':'Dark Cloud Cover',
18
- 'CDLDOJI':'Doji',
19
- 'CDLDOJISTAR':'Doji Star',
20
- 'CDLDRAGONFLYDOJI':'Dragonfly Doji',
21
- 'CDLENGULFING':'Engulfing Pattern',
22
- 'CDLEVENINGDOJISTAR':'Evening Doji Star',
23
- 'CDLEVENINGSTAR':'Evening Star',
24
- 'CDLGAPSIDESIDEWHITE':'Up/Down-gap side-by-side white lines',
25
- 'CDLGRAVESTONEDOJI':'Gravestone Doji',
26
- 'CDLHAMMER':'Hammer',
27
- 'CDLHANGINGMAN':'Hanging Man',
28
- 'CDLHARAMI':'Harami Pattern',
29
- 'CDLHARAMICROSS':'Harami Cross Pattern',
30
- 'CDLHIGHWAVE':'High-Wave Candle',
31
- 'CDLHIKKAKE':'Hikkake Pattern',
32
- 'CDLHIKKAKEMOD':'Modified Hikkake Pattern',
33
- 'CDLHOMINGPIGEON':'Homing Pigeon',
34
- 'CDLIDENTICAL3CROWS':'Identical Three Crows',
35
- 'CDLINNECK':'In-Neck Pattern',
36
- 'CDLINVERTEDHAMMER':'Inverted Hammer',
37
- 'CDLKICKING':'Kicking',
38
- 'CDLKICKINGBYLENGTH':'Kicking - bull/bear determined by the longer marubozu',
39
- 'CDLLADDERBOTTOM':'Ladder Bottom',
40
- 'CDLLONGLEGGEDDOJI':'Long Legged Doji',
41
- 'CDLLONGLINE':'Long Line Candle',
42
- 'CDLMARUBOZU':'Marubozu',
43
- 'CDLMATCHINGLOW':'Matching Low',
44
- 'CDLMATHOLD':'Mat Hold',
45
- 'CDLMORNINGDOJISTAR':'Morning Doji Star',
46
- 'CDLMORNINGSTAR':'Morning Star',
47
- 'CDLONNECK':'On-Neck Pattern',
48
- 'CDLPIERCING':'Piercing Pattern',
49
- 'CDLRICKSHAWMAN':'Rickshaw Man',
50
- 'CDLRISEFALL3METHODS':'Rising/Falling Three Methods',
51
- 'CDLSEPARATINGLINES':'Separating Lines',
52
- 'CDLSHOOTINGSTAR':'Shooting Star',
53
- 'CDLSHORTLINE':'Short Line Candle',
54
- 'CDLSPINNINGTOP':'Spinning Top',
55
- 'CDLSTALLEDPATTERN':'Stalled Pattern',
56
- 'CDLSTICKSANDWICH':'Stick Sandwich',
57
- 'CDLTAKURI':'Takuri (Dragonfly Doji with very long lower shadow)',
58
- 'CDLTASUKIGAP':'Tasuki Gap',
59
- 'CDLTHRUSTING':'Thrusting Pattern',
60
- 'CDLTRISTAR':'Tristar Pattern',
61
- 'CDLUNIQUE3RIVER':'Unique 3 River',
62
- 'CDLUPSIDEGAP2CROWS':'Upside Gap Two Crows',
63
- 'CDLXSIDEGAP3METHODS':'Upside/Downside Gap Three Methods'
64
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/CikeyQI/meme-api/meme_generator/memes/addiction/__init__.py DELETED
@@ -1,39 +0,0 @@
1
- from pathlib import Path
2
- from typing import List
3
-
4
- from pil_utils import BuildImage
5
-
6
- from meme_generator import add_meme
7
- from meme_generator.exception import TextOverLength
8
- from meme_generator.utils import make_jpg_or_gif
9
-
10
- img_dir = Path(__file__).parent / "images"
11
-
12
-
13
- def addiction(images: List[BuildImage], texts: List[str], args):
14
- frame = BuildImage.open(img_dir / "0.png")
15
-
16
- if texts:
17
- text = texts[0]
18
- frame = frame.resize_canvas((246, 286), direction="north", bg_color="white")
19
- try:
20
- frame.draw_text((10, 246, 236, 286), texts[0], max_fontsize=45)
21
- except ValueError:
22
- raise TextOverLength(text)
23
-
24
- def make(img: BuildImage) -> BuildImage:
25
- img = img.convert("RGBA").resize((91, 91), keep_ratio=True)
26
- return frame.copy().paste(img, alpha=True)
27
-
28
- return make_jpg_or_gif(images[0], make)
29
-
30
-
31
- add_meme(
32
- "addiction",
33
- addiction,
34
- min_images=1,
35
- max_images=1,
36
- min_texts=0,
37
- max_texts=1,
38
- keywords=["上瘾", "毒瘾发作"],
39
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/ClinBAY/Safeterm_Demo/app.py DELETED
@@ -1,410 +0,0 @@
1
- import gradio as gr
2
- import requests
3
- import json
4
- from send_email_request import send_email
5
-
6
-
7
- def request_api_key_form(req_email, req_name, req_organization, req_meddra_license, req_agree_terms, req_save_data):
8
- # Check if all required fields are filled and the conditions are met
9
- if not req_email or not req_name or not req_organization:
10
- return "**Please fill in all required fields.**"
11
- if "@" not in req_email or "." not in req_email:
12
- return "**Please enter a valid email.**"
13
- if not req_meddra_license:
14
- return "**You need to have a valid MedDRA license.**"
15
- if not req_agree_terms:
16
- return "**You need to agree to Safeterm terms of use.**"
17
- if not req_save_data:
18
- return "**You need to agree to share data for training and communication purposes.**"
19
-
20
- subject = "API Key Request for Safeterm"
21
-
22
- send_email(subject, req_email, req_name, req_organization, req_meddra_license, req_agree_terms, req_save_data)
23
-
24
- return "**Your request for API key has been submitted successfully! We will send it to you via mail soon!**"
25
-
26
-
27
- def encode_caller(apikey, reported_terms_encoder, validation_request, single_term):
28
- if not apikey:
29
- return "Please enter a valid API key!"
30
-
31
- url = "https://safeterm.proddis.com/meddra_encode"
32
- reported_terms_list = [term.strip() for term in reported_terms_encoder.split(",")]
33
-
34
- # Convert string values to boolean
35
- validation_request_bool = validation_request == "True"
36
- single_term_bool = single_term == "True"
37
-
38
- payload = json.dumps({
39
- "reported_terms": reported_terms_list,
40
- "nmax": 1,
41
- "version": float("26.0"),
42
- "validation_request": validation_request_bool,
43
- "single_term": single_term_bool
44
- })
45
-
46
- headers = {
47
- 'Content-Type': 'application/json',
48
- 'Authorization': f'Bearer {apikey}'
49
- }
50
-
51
- response = requests.post(url, headers=headers, data=payload)
52
- data = response.json()
53
-
54
- if "detail" in data:
55
- return data["detail"]
56
-
57
- results = []
58
-
59
- for encoded_term in data.get("encoded_terms", []):
60
- result = f"Reported Term: {encoded_term['term']}\n"
61
-
62
- # Check if 'encoded_term' contains a list of dictionaries (valid_request = False)
63
- if isinstance(encoded_term['encoded_term'][0], dict):
64
- for sub_term_entry in encoded_term['encoded_term']:
65
- for llt_id, llt_term in zip(sub_term_entry['llt_id'], sub_term_entry['llt_term']):
66
- result += f"LLT ID: {llt_id}\nLLT Term: {llt_term}\n"
67
-
68
- pt_id = sub_term_entry['pt_id'][0]
69
- pt_term = sub_term_entry['pt_term'][0]
70
- result += f"PT ID: {pt_id}\nPT Term: {pt_term}\n"
71
- result += "---\n"
72
-
73
- # Case for valid_request = True (list of lists)
74
- else:
75
- for sub_list in encoded_term['encoded_term']:
76
- for sub_term_entry in sub_list:
77
- if 'llt_id' in sub_term_entry and 'llt_term' in sub_term_entry:
78
- for llt_id, llt_term in zip(sub_term_entry['llt_id'], sub_term_entry['llt_term']):
79
- result += f"LLT ID: {llt_id}\nLLT Term: {llt_term}\n"
80
-
81
- pt_id = sub_term_entry['pt_id'][0]
82
- pt_term = sub_term_entry['pt_term'][0]
83
- result += f"PT ID: {pt_id}\nPT Term: {pt_term}\n"
84
- result += "---\n"
85
-
86
- # Handle other entries like "is_validated" and "report"
87
- else:
88
- for key, value in sub_term_entry.items():
89
- result += f"{key}: {value}\n"
90
- result += "---\n"
91
-
92
- result += f"Status: {encoded_term['status']}\n\n"
93
- results.append(result)
94
-
95
- # Add the API messages at the end.
96
- api_message = data.get("messages", "No API message available")
97
- api_message = "OK" if api_message is None else api_message
98
- results.append(f"API Message: {api_message}")
99
-
100
- return "\n".join(results)
101
-
102
-
103
- def validate_caller(val_apikey, val_reported_terms, val_llt_terms):
104
- if not val_apikey:
105
- return "Please enter a valid API key!"
106
- url = "https://safeterm.proddis.com/meddra_validate"
107
-
108
- # Convert comma-separated strings into lists
109
- val_reported_terms_list = [term.strip() for term in val_reported_terms.split(",")]
110
- val_llt_terms_list = [term.strip() for term in val_llt_terms.split(",")]
111
-
112
- payload = json.dumps({
113
- "reported_terms": val_reported_terms_list,
114
- "llt_terms": val_llt_terms_list,
115
- "nmax": 1,
116
- "version": float("26.0")
117
- })
118
- headers = {
119
- 'Content-Type': 'application/json',
120
- 'Authorization': f'Bearer {val_apikey}'
121
- }
122
-
123
- response = requests.request("POST", url, headers=headers, data=payload, timeout=60)
124
-
125
- data = response.json()
126
-
127
- # Check if the response contains an error detail
128
- if "detail" in data:
129
- return data["detail"]
130
-
131
- results = []
132
- for validation_item in data["responses"]:
133
- report = validation_item.get("report", "No report")
134
-
135
- if validation_item["best_dict_term"]:
136
- llt_id = validation_item["best_dict_term"][0]["llt_id"][0]
137
- llt_term = validation_item["best_dict_term"][0]["llt_term"][0]
138
- pt_id = validation_item["best_dict_term"][0]["pt_id"][0]
139
- pt_term = validation_item["best_dict_term"][0]["pt_term"][0]
140
-
141
- result = f"Report: {report}\n"
142
- result += f"LLT ID: {llt_id}\n"
143
- result += f"LLT Term: {llt_term}\n"
144
- result += f"PT ID: {pt_id}\n"
145
- result += f"PT Term: {pt_term}\n\n"
146
- else:
147
- result = f"Report: {report}\nNo matching terms found.\n\n"
148
-
149
- results.append(result)
150
-
151
- # Add the API messages at the end.
152
- api_message = data.get("messages", "No API message available")
153
- api_message = "OK" if api_message is None else api_message
154
- results.append(f"API key status: {api_message}")
155
-
156
- return "\n".join(results)
157
-
158
-
159
- def upgrade_caller(api_key, upgrader_list_of_terms, version_upgrade):
160
- if not api_key:
161
- return "Please enter a valid API key!"
162
- url = "https://safeterm.proddis.com/meddra_version_upgrade"
163
-
164
- cleaned_terms = [term.strip() for term in upgrader_list_of_terms.split(",")]
165
-
166
- payload = json.dumps({
167
- "list_of_terms": cleaned_terms,
168
- "nmax": 1,
169
- "version": float(version_upgrade),
170
- "verbose": True
171
- })
172
- headers = {
173
- 'Content-Type': 'application/json',
174
- 'Authorization': f'Bearer {api_key}'
175
- }
176
- response = requests.request("POST", url, headers=headers, data=payload)
177
-
178
- data = response.json()
179
-
180
- # Check if the response contains an error detail
181
- if "detail" in data:
182
- return data["detail"]
183
-
184
- output = []
185
- results = data.get("result", [])
186
- for i, result in enumerate(results):
187
- input_term = cleaned_terms[i] # Assuming the order in 'results' and 'cleaned_terms' is the same
188
-
189
- if result['change_status'] is None or result['output_term'] is None:
190
- status_message = result.get('status', 'Unknown Status')
191
- output.append(f"Input Term: {input_term}\nStatus: {status_message}\n")
192
- else:
193
- status = "Unchanged" if not result['change_status'] else "Changed"
194
- output_term = result['output_term']
195
- output.append(f"Input Term: {input_term}\nStatus: {status}\nOutput Term: {output_term}\n")
196
-
197
- # Get the API message, set to "OK" if it's None
198
- api_message = data.get("messages", "No API message available")
199
- api_message = "OK" if api_message is None else api_message
200
-
201
- output.append(f"API status: {api_message}")
202
-
203
- return "\n".join(output).strip() # Removing any trailing whitespace
204
-
205
-
206
- def llt_current_caller(api_key, currency_list_of_terms, version_check):
207
- if not api_key:
208
- return "Please enter a valid API key!"
209
-
210
- url = "https://safeterm.proddis.com/meddra_llt_is_current"
211
- cleaned_terms_currency = [term.strip() for term in currency_list_of_terms.split(",")]
212
-
213
- payload = json.dumps({
214
- "list_of_terms": cleaned_terms_currency,
215
- "version": float(version_check)
216
- })
217
-
218
- headers = {
219
- 'Content-Type': 'application/json',
220
- 'Authorization': f'Bearer {api_key}'
221
- }
222
-
223
- response = requests.request("POST", url, headers=headers, data=payload)
224
- response_data = response.json()
225
-
226
- # Check if 'is_current_flag_results' key exists in the API response
227
- if "is_current_flag_results" not in response_data:
228
- # If 'detail' key exists in response_data, show the error detail, else show a generic error
229
- return response_data.get("detail", "An error occurred.")
230
-
231
- beautified_output = []
232
- for term, flag_data in zip(cleaned_terms_currency, response_data["is_current_flag_results"]):
233
- flag = flag_data.get('is_current_flag', None)
234
- status = flag_data.get('status', '')
235
-
236
- if isinstance(flag, bool):
237
- status_text = "Is Current" if flag else "Is not Current"
238
- beautified_output.append(f"{term}: {status_text}")
239
-
240
- else:
241
- beautified_output.append(f"Error {term}: {status}")
242
-
243
- # Get the API message, set to "OK" if it's None
244
- api_message = response_data.get("messages", None)
245
- api_message = "OK" if api_message is None else api_message
246
- beautified_output.append(f"API status: {api_message}")
247
-
248
- return "\n".join(beautified_output)
249
-
250
-
251
- with gr.Blocks(css=".gradio-container {background-color: lightgray}") as demo:
252
- # gr.Markdown("Safeterm is an automated AI system that extracts medical terms from patient narratives and
253
- # standardize these terms according to the medical dictionary for regulatory applications (MedDRA). ")
254
- gr.Markdown("### Safeterm: Translate Medical Narratives into Standardized Dictionaries")
255
- with gr.Row():
256
- with gr.Column():
257
- gr.HTML(
258
- """<p>Safeterm is an automated AI system that extracts medical terms from patient narratives and
259
- standardize these terms according to the medical dictionary for regulatory applications (MedDRA).
260
- </p>""")
261
- with gr.Column():
262
- universal_api_key_input = gr.Textbox(label="Paste your API Key", placeholder="Enter your API Key...",
263
- lines=1)
264
- with gr.Row():
265
- with gr.Tab("Safeterm Encode"):
266
- gr.Markdown("### Safeterm Encode")
267
-
268
- # Inputs
269
- encode_reported_terms = gr.Dropdown(
270
- ["Headache, Allergic to CAT scan", "Myocardial infarction in the fall of 2000",
271
- "Nurse miscalculated the dose and the patient received 40 mg instead of 20 mg of his medication. He "
272
- "experienced severe hypotension and heart attack."],
273
- label="Medical Narratives (comma-separated, max 5)",
274
- info="Enter your reported medical narratives (1 or more comma-separated statements, example: "
275
- "Headache, Allergic to CAT scan) here or choose from the presets.",
276
- allow_custom_value=True)
277
-
278
- encode_version = gr.Textbox(label="MedDRA Version", value="26.0")
279
-
280
- # New input boxes
281
- validation_request = gr.Radio(label="Validation Request", choices=["True", "False"])
282
- single_term = gr.Radio(label="Single Term", choices=["True", "False"])
283
-
284
- # Output
285
- api_response_encode = gr.Textbox(label="Standardized Medical Dictionary Outputs")
286
-
287
- # Button to trigger API call
288
- submit_button = gr.Button("Encode into MedDRA")
289
-
290
- # Binding API call function to button (Note: Assuming `universal_api_key_input` was defined somewhere
291
- # before this block)
292
- submit_button.click(encode_caller,
293
- inputs=[universal_api_key_input, encode_reported_terms, validation_request,
294
- single_term],
295
- outputs=api_response_encode)
296
-
297
- with gr.Tab("Safeterm Validate"):
298
- gr.Markdown('### Safeterm Validate')
299
- gr.Markdown(
300
- 'Checks an existing MedDRA encoding. Compares reported terms to MedDRA Lower Level Terms (LLT). '
301
- 'Provides an alternative LLT in case of discrepancy.')
302
- # Validator Inputs
303
- reported_terms_validate = gr.Dropdown(["Pain in the head, Feeling nauseous"]
304
- , label="Reported Terms (comma-separated, max 5)"
305
- ,
306
- info="Enter your reported terms here (example: pain in the "
307
- "head, Feeling nauseous) or choose from the dropdown preset",
308
- allow_custom_value=True)
309
- llt_terms_validate = gr.Dropdown(["Headache, Vomiting"]
310
- , label="LLT terms (comma-separated, max 5)"
311
- ,
312
- info="Enter the current LLTs here (example: Headache, Vomitting), "
313
- "or choose"
314
- "from the dropdown presets",
315
- allow_custom_value=True)
316
- version_validate = gr.Textbox(label="MedDRA Version", value="26.0")
317
-
318
- # Output
319
- api_response_validate = gr.Textbox(label="Validation Report")
320
-
321
- # Button to trigger API call and Binding API call function to button for Validator
322
- submit_button_validate = gr.Button("Validate Existing MedDRA Encoding")
323
- submit_button_validate.click(validate_caller,
324
- inputs=[universal_api_key_input, reported_terms_validate, llt_terms_validate],
325
- outputs=api_response_validate)
326
- with gr.Tab("Safeterm Version Upgrade"):
327
- gr.Markdown("### Safeterm Version Upgrade")
328
- gr.Markdown('Upgrade terms to the most up-to-date LLTs in a MedDRA version.')
329
- # Version Upgrade Inputs
330
- list_of_terms_upgrade = gr.Dropdown(
331
- ["Pain in the head", "Injection site joint inflammation", "Bone chip removal"]
332
- , label="LLTs (comma-separated, max 5)"
333
- , info="Enter your LLTs here (example: Injection site joint inflammation) "
334
- "or choose from the dropdown preset",
335
- allow_custom_value=True)
336
-
337
- version_upgrade = gr.Dropdown(label="To MedDRA Version", choices=["20.0", "26.0"])
338
-
339
- # Output
340
- api_response_upgrade = gr.Textbox(label="Version Upgrade Response")
341
-
342
- # Button to trigger API call and Binding API call function to button for Version Upgrade
343
- submit_button_upgrade = gr.Button("Upgrade to Selected MedDRA Version")
344
- submit_button_upgrade.click(upgrade_caller,
345
- inputs=[universal_api_key_input, list_of_terms_upgrade,
346
- version_upgrade], outputs=api_response_upgrade)
347
-
348
- with gr.Tab("Safeterm Current Check"): # Currency Checker section
349
- gr.Markdown("### Safeterm Current Version Check")
350
- gr.Markdown('Checks if LLTs are current or not in a particular MedDRA version')
351
- # No Change Version Check Inputs
352
- list_of_terms_validity = gr.Dropdown(["Anemia iron deficiency", "COVID-19"]
353
- , label="LLTs (comma-separated, max 5)"
354
- , info="Enter your LLTs here, e.g.: Injection site "
355
- "joint inflammation or choose from the dropdown preset",
356
- allow_custom_value=True)
357
- version_check = gr.Dropdown(label="To MedDRA Version", choices=["20.0", "26.0"])
358
-
359
- # Output for No Change Version Check
360
- api_response_current = gr.Textbox(label="Current Check Response")
361
-
362
- # Button to trigger API call and Binding API call function to button for No Change Check
363
- submit_button_currency = gr.Button("Check if LLT is current or not")
364
- submit_button_currency.click(llt_current_caller,
365
- inputs=[universal_api_key_input, list_of_terms_validity, version_check],
366
- outputs=api_response_current)
367
-
368
- with gr.Tab("Request an API key"):
369
- # gr.Markdown("### Safeterm Settings")
370
- gr.Markdown("### Request an API key")
371
- free_demo = gr.Markdown(
372
- "Submit your request for a free demo of our API (Expires in 30 days. 50 terms limit)")
373
- # gr.Markdown("### MedDRA Dictionary")
374
- version = gr.Markdown("Safeterm Model v-082023")
375
- language = gr.Markdown("Language: English") # Dropdown for language
376
-
377
- gr.Markdown("### Contact information")
378
- email = gr.Textbox(label="Email", placeholder="Enter your professional email address...")
379
- name = gr.Textbox(label="First and Last Name", placeholder="Enter your full name...")
380
- organization = gr.Textbox(label="Organization", placeholder="Enter your organization name and details...")
381
-
382
- gr.Markdown("### Terms of use")
383
- # MedDRA_license = gr.Checkbox(label="I confirm that my organization has a valid MedDRA license.")
384
- with gr.Row():
385
- MedDRA_license = gr.Checkbox(label="I confirm that my organization has a valid MedDRA license: ")
386
- gr.HTML("""<a href=https://www.meddra.org/subscription/process>[link]</a>""")
387
- with gr.Row():
388
- agree_terms = gr.Checkbox(label="I agree to Safeterm terms of use: ", min_width=1, scale=1)
389
- gr.HTML("""<a href=https://www.proddis.com/pdf/Proddis_Terms_of_Use.pdf>[link] </a>""")
390
-
391
- with gr.Row():
392
- save_data = gr.Checkbox(
393
- label="I consent to the storage of my personal data for training and communication purposes.")
394
- gr.HTML(""" """)
395
-
396
- feedback_textbox = gr.Markdown(label="Feedback")
397
-
398
- # Button for API key request and Binding function to button
399
- api_key_button = gr.Button("Submit request for API key")
400
- api_key_button.click(
401
- request_api_key_form,
402
- inputs=[email, name, organization, MedDRA_license, agree_terms, save_data],
403
- outputs=feedback_textbox
404
- )
405
- with gr.Row():
406
- gr.Markdown(
407
- "Safeterm API is distributed by ClinBAY Limited. \t For any enquiry, feel free to contact us at "
408
409
-
410
- demo.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Conner/IAPdemo/app.py DELETED
@@ -1,46 +0,0 @@
1
- from tensorflow import keras
2
- from keras.models import load_model
3
- from PIL import Image, ImageOps
4
- import numpy as np
5
- import gradio as gr
6
- import rasterio
7
- from rasterio.enums import Resampling
8
-
9
-
10
- # Load the model
11
- model = load_model('keras_model.h5')
12
-
13
-
14
-
15
- def greet(name):
16
- return "Hello " + prediction + "!!"
17
-
18
- def predict(image):
19
-
20
- # Create the array of the right shape to feed into the keras model
21
- # The 'length' or number of images you can put into the array is
22
- # determined by the first position in the shape tuple, in this case 1.
23
- data = np.ndarray(shape=(1, 224, 224, 3), dtype=np.float32)
24
- # Replace this with the path to your image
25
-
26
- #resize the image to a 224x224 with the same strategy as in TM2:
27
- #resizing the image to be at least 224x224 and then cropping from the center
28
- size = (224, 224)
29
- image = gr.inputs.Image()
30
- image = ImageOps.fit(image, size, Resampling.LANCZOS)
31
-
32
- #turn the image into a numpy array
33
- image_array = np.asarray(image)
34
- # Normalize the image
35
- normalized_image_array = (image_array.astype(np.float32) / 127.0) - 1
36
- # Load the image into the array
37
- data[0] = normalized_image_array
38
-
39
- # run the inference
40
- prediction = model.predict(data)
41
- gr.print(prediction)
42
- return prediction
43
-
44
-
45
- iface = gr.Interface(fn=predict, inputs="image", outputs="text")
46
- iface.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/Cyril666/ContourNet-ABI/maskrcnn_benchmark/csrc/cpu/vision.h DELETED
@@ -1,73 +0,0 @@
1
- // Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
2
- #pragma once
3
- #include <torch/extension.h>
4
-
5
-
6
- at::Tensor ROIAlign_forward_cpu(const at::Tensor& input,
7
- const at::Tensor& rois,
8
- const float spatial_scale,
9
- const int pooled_height,
10
- const int pooled_width,
11
- const int sampling_ratio);
12
-
13
-
14
- at::Tensor nms_cpu(const at::Tensor& dets,
15
- const at::Tensor& scores,
16
- const float threshold);
17
- at::Tensor
18
- dcn_v2_cpu_forward(const at::Tensor &input,
19
- const at::Tensor &weight,
20
- const at::Tensor &bias,
21
- const at::Tensor &offset,
22
- const at::Tensor &mask,
23
- const int kernel_h,
24
- const int kernel_w,
25
- const int stride_h,
26
- const int stride_w,
27
- const int pad_h,
28
- const int pad_w,
29
- const int dilation_h,
30
- const int dilation_w,
31
- const int deformable_group);
32
-
33
- std::vector<at::Tensor>
34
- dcn_v2_cpu_backward(const at::Tensor &input,
35
- const at::Tensor &weight,
36
- const at::Tensor &bias,
37
- const at::Tensor &offset,
38
- const at::Tensor &mask,
39
- const at::Tensor &grad_output,
40
- int kernel_h, int kernel_w,
41
- int stride_h, int stride_w,
42
- int pad_h, int pad_w,
43
- int dilation_h, int dilation_w,
44
- int deformable_group);
45
-
46
-
47
- std::tuple<at::Tensor, at::Tensor>
48
- dcn_v2_psroi_pooling_cpu_forward(const at::Tensor &input,
49
- const at::Tensor &bbox,
50
- const at::Tensor &trans,
51
- const int no_trans,
52
- const float spatial_scale,
53
- const int output_dim,
54
- const int group_size,
55
- const int pooled_size,
56
- const int part_size,
57
- const int sample_per_part,
58
- const float trans_std);
59
-
60
- std::tuple<at::Tensor, at::Tensor>
61
- dcn_v2_psroi_pooling_cpu_backward(const at::Tensor &out_grad,
62
- const at::Tensor &input,
63
- const at::Tensor &bbox,
64
- const at::Tensor &trans,
65
- const at::Tensor &top_count,
66
- const int no_trans,
67
- const float spatial_scale,
68
- const int output_dim,
69
- const int group_size,
70
- const int pooled_size,
71
- const int part_size,
72
- const int sample_per_part,
73
- const float trans_std);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/DQChoi/gpt-demo/venv/lib/python3.11/site-packages/altair/utils/plugin_registry.py DELETED
@@ -1,228 +0,0 @@
1
- import sys
2
- from typing import Any, Dict, List, Optional, Generic, TypeVar, cast
3
- from types import TracebackType
4
-
5
- if sys.version_info >= (3, 8):
6
- from importlib.metadata import entry_points
7
- else:
8
- from importlib_metadata import entry_points
9
-
10
- from toolz import curry
11
-
12
-
13
- PluginType = TypeVar("PluginType")
14
-
15
-
16
- class NoSuchEntryPoint(Exception):
17
- def __init__(self, group, name):
18
- self.group = group
19
- self.name = name
20
-
21
- def __str__(self):
22
- return f"No {self.name!r} entry point found in group {self.group!r}"
23
-
24
-
25
- class PluginEnabler:
26
- """Context manager for enabling plugins
27
-
28
- This object lets you use enable() as a context manager to
29
- temporarily enable a given plugin::
30
-
31
- with plugins.enable('name'):
32
- do_something() # 'name' plugin temporarily enabled
33
- # plugins back to original state
34
- """
35
-
36
- def __init__(self, registry: "PluginRegistry", name: str, **options):
37
- self.registry = registry # type: PluginRegistry
38
- self.name = name # type: str
39
- self.options = options # type: Dict[str, Any]
40
- self.original_state = registry._get_state() # type: Dict[str, Any]
41
- self.registry._enable(name, **options)
42
-
43
- def __enter__(self) -> "PluginEnabler":
44
- return self
45
-
46
- def __exit__(self, typ: type, value: Exception, traceback: TracebackType) -> None:
47
- self.registry._set_state(self.original_state)
48
-
49
- def __repr__(self) -> str:
50
- return "{}.enable({!r})".format(self.registry.__class__.__name__, self.name)
51
-
52
-
53
- class PluginRegistry(Generic[PluginType]):
54
- """A registry for plugins.
55
-
56
- This is a plugin registry that allows plugins to be loaded/registered
57
- in two ways:
58
-
59
- 1. Through an explicit call to ``.register(name, value)``.
60
- 2. By looking for other Python packages that are installed and provide
61
- a setuptools entry point group.
62
-
63
- When you create an instance of this class, provide the name of the
64
- entry point group to use::
65
-
66
- reg = PluginRegister('my_entrypoint_group')
67
-
68
- """
69
-
70
- # this is a mapping of name to error message to allow custom error messages
71
- # in case an entrypoint is not found
72
- entrypoint_err_messages = {} # type: Dict[str, str]
73
-
74
- # global settings is a key-value mapping of settings that are stored globally
75
- # in the registry rather than passed to the plugins
76
- _global_settings = {} # type: Dict[str, Any]
77
-
78
- def __init__(self, entry_point_group: str = "", plugin_type: type = object):
79
- """Create a PluginRegistry for a named entry point group.
80
-
81
- Parameters
82
- ==========
83
- entry_point_group: str
84
- The name of the entry point group.
85
- plugin_type: object
86
- A type that will optionally be used for runtime type checking of
87
- loaded plugins using isinstance.
88
- """
89
- self.entry_point_group = entry_point_group # type: str
90
- self.plugin_type = plugin_type # type: Optional[type]
91
- self._active = None # type: Optional[PluginType]
92
- self._active_name = "" # type: str
93
- self._plugins = {} # type: Dict[str, PluginType]
94
- self._options = {} # type: Dict[str, Any]
95
- self._global_settings = self.__class__._global_settings.copy() # type: dict
96
-
97
- def register(self, name: str, value: Optional[PluginType]) -> Optional[PluginType]:
98
- """Register a plugin by name and value.
99
-
100
- This method is used for explicit registration of a plugin and shouldn't be
101
- used to manage entry point managed plugins, which are auto-loaded.
102
-
103
- Parameters
104
- ==========
105
- name: str
106
- The name of the plugin.
107
- value: PluginType or None
108
- The actual plugin object to register or None to unregister that plugin.
109
-
110
- Returns
111
- =======
112
- plugin: PluginType or None
113
- The plugin that was registered or unregistered.
114
- """
115
- if value is None:
116
- return self._plugins.pop(name, None)
117
- else:
118
- assert isinstance(value, self.plugin_type) # type: ignore[arg-type] # Should ideally be fixed by better annotating plugin_type
119
- self._plugins[name] = value
120
- return value
121
-
122
- def names(self) -> List[str]:
123
- """List the names of the registered and entry points plugins."""
124
- exts = list(self._plugins.keys())
125
- e_points = importlib_metadata_get(self.entry_point_group)
126
- more_exts = [ep.name for ep in e_points]
127
- exts.extend(more_exts)
128
- return sorted(set(exts))
129
-
130
- def _get_state(self) -> Dict[str, Any]:
131
- """Return a dictionary representing the current state of the registry"""
132
- return {
133
- "_active": self._active,
134
- "_active_name": self._active_name,
135
- "_plugins": self._plugins.copy(),
136
- "_options": self._options.copy(),
137
- "_global_settings": self._global_settings.copy(),
138
- }
139
-
140
- def _set_state(self, state: Dict[str, Any]) -> None:
141
- """Reset the state of the registry"""
142
- assert set(state.keys()) == {
143
- "_active",
144
- "_active_name",
145
- "_plugins",
146
- "_options",
147
- "_global_settings",
148
- }
149
- for key, val in state.items():
150
- setattr(self, key, val)
151
-
152
- def _enable(self, name: str, **options) -> None:
153
- if name not in self._plugins:
154
- try:
155
- (ep,) = [
156
- ep
157
- for ep in importlib_metadata_get(self.entry_point_group)
158
- if ep.name == name
159
- ]
160
- except ValueError as err:
161
- if name in self.entrypoint_err_messages:
162
- raise ValueError(self.entrypoint_err_messages[name]) from err
163
- else:
164
- raise NoSuchEntryPoint(self.entry_point_group, name) from err
165
- value = cast(PluginType, ep.load())
166
- self.register(name, value)
167
- self._active_name = name
168
- self._active = self._plugins[name]
169
- for key in set(options.keys()) & set(self._global_settings.keys()):
170
- self._global_settings[key] = options.pop(key)
171
- self._options = options
172
-
173
- def enable(self, name: Optional[str] = None, **options) -> PluginEnabler:
174
- """Enable a plugin by name.
175
-
176
- This can be either called directly, or used as a context manager.
177
-
178
- Parameters
179
- ----------
180
- name : string (optional)
181
- The name of the plugin to enable. If not specified, then use the
182
- current active name.
183
- **options :
184
- Any additional parameters will be passed to the plugin as keyword
185
- arguments
186
-
187
- Returns
188
- -------
189
- PluginEnabler:
190
- An object that allows enable() to be used as a context manager
191
- """
192
- if name is None:
193
- name = self.active
194
- return PluginEnabler(self, name, **options)
195
-
196
- @property
197
- def active(self) -> str:
198
- """Return the name of the currently active plugin"""
199
- return self._active_name
200
-
201
- @property
202
- def options(self) -> Dict[str, Any]:
203
- """Return the current options dictionary"""
204
- return self._options
205
-
206
- def get(self) -> Optional[PluginType]:
207
- """Return the currently active plugin."""
208
- if self._options:
209
- return curry(self._active, **self._options)
210
- else:
211
- return self._active
212
-
213
- def __repr__(self) -> str:
214
- return "{}(active={!r}, registered={!r})" "".format(
215
- self.__class__.__name__, self._active_name, list(self.names())
216
- )
217
-
218
-
219
- def importlib_metadata_get(group):
220
- ep = entry_points()
221
- # 'select' was introduced in Python 3.10 and 'get' got deprecated
222
- # We don't check for Python version here as by checking with hasattr we
223
- # also get compatibility with the importlib_metadata package which had a different
224
- # deprecation cycle for 'get'
225
- if hasattr(ep, "select"):
226
- return ep.select(group=group)
227
- else:
228
- return ep.get(group, [])
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
spaces/DQChoi/gpt-demo/venv/lib/python3.11/site-packages/gradio/templates/cdn/assets/index-1e03cd90.css DELETED
@@ -1 +0,0 @@
1
- .preview.svelte-w0jac3.svelte-w0jac3{display:flex;position:absolute;inset:0;flex-direction:column;z-index:var(--layer-2);backdrop-filter:blur(8px);background:var(--background-fill-primary);height:var(--size-full)}.fixed-height.svelte-w0jac3.svelte-w0jac3{min-height:var(--size-80);max-height:55vh}@media (min-width: 1280px){.fixed-height.svelte-w0jac3.svelte-w0jac3{min-height:450px}}.preview.svelte-w0jac3 img.svelte-w0jac3{width:var(--size-full);height:calc(var(--size-full) - 60px);object-fit:contain}.preview.svelte-w0jac3 img.with-caption.svelte-w0jac3{height:calc(var(--size-full) - 80px)}.caption.svelte-w0jac3.svelte-w0jac3{padding:var(--size-2) var(--size-3);overflow:hidden;color:var(--block-label-text-color);font-weight:var(--weight-semibold);text-align:center;text-overflow:ellipsis;white-space:nowrap}.thumbnails.svelte-w0jac3.svelte-w0jac3{display:flex;position:absolute;bottom:0;justify-content:center;align-items:center;gap:var(--spacing-lg);width:var(--size-full);height:var(--size-14);overflow-x:scroll}.thumbnail-item.svelte-w0jac3.svelte-w0jac3{--ring-color:transparent;position:relative;box-shadow:0 0 0 2px var(--ring-color),var(--shadow-drop);border:1px solid var(--border-color-primary);border-radius:var(--button-small-radius);background:var(--background-fill-secondary);aspect-ratio:var(--ratio-square);width:var(--size-full);height:var(--size-full);overflow:clip}.thumbnail-item.svelte-w0jac3.svelte-w0jac3:hover{--ring-color:var(--color-accent);filter:brightness(1.1)}.thumbnail-item.selected.svelte-w0jac3.svelte-w0jac3{--ring-color:var(--color-accent)}.thumbnail-small.svelte-w0jac3.svelte-w0jac3{flex:none;transform:scale(.9);transition:75ms;width:var(--size-9);height:var(--size-9)}.thumbnail-small.selected.svelte-w0jac3.svelte-w0jac3{--ring-color:var(--color-accent);transform:scale(1);border-color:var(--color-accent)}.thumbnail-small.svelte-w0jac3>img.svelte-w0jac3{width:var(--size-full);height:var(--size-full);overflow:hidden;object-fit:var(--object-fit)}.grid-wrap.svelte-w0jac3.svelte-w0jac3{position:relative;padding:var(--size-2);height:var(--size-full);overflow-y:auto}.grid-container.svelte-w0jac3.svelte-w0jac3{display:grid;position:relative;grid-template-rows:var(--grid-rows);grid-template-columns:var(--grid-cols);gap:var(--spacing-lg)}@media (min-width: 640px){.grid-container.svelte-w0jac3.svelte-w0jac3{grid-template-columns:var(--sm-grid-cols)}}@media (min-width: 768px){.grid-container.svelte-w0jac3.svelte-w0jac3{grid-template-columns:var(--md-grid-cols)}}@media (min-width: 1024px){.grid-container.svelte-w0jac3.svelte-w0jac3{grid-template-columns:var(--lg-grid-cols)}}@media (min-width: 1280px){.grid-container.svelte-w0jac3.svelte-w0jac3{grid-template-columns:var(--xl-grid-cols)}}@media (min-width: 1536px){.grid-container.svelte-w0jac3.svelte-w0jac3{grid-template-columns:var(--2xl-grid-cols)}}.thumbnail-lg.svelte-w0jac3>img.svelte-w0jac3{width:var(--size-full);height:var(--size-full);overflow:hidden;object-fit:var(--object-fit)}.thumbnail-lg.svelte-w0jac3:hover .caption-label.svelte-w0jac3{opacity:.5}.caption-label.svelte-w0jac3.svelte-w0jac3{position:absolute;right:var(--block-label-margin);bottom:var(--block-label-margin);z-index:var(--layer-1);border-top:1px solid var(--border-color-primary);border-left:1px solid var(--border-color-primary);border-radius:var(--block-label-radius);background:var(--background-fill-secondary);padding:var(--block-label-padding);max-width:80%;overflow:hidden;font-size:var(--block-label-text-size);text-align:left;text-overflow:ellipsis;white-space:nowrap}.icon-button.svelte-w0jac3.svelte-w0jac3{position:absolute;top:0;right:0;z-index:var(--layer-1)}
 
 
spaces/DQChoi/gpt-demo/venv/lib/python3.11/site-packages/gradio/templates/cdn/assets/index-28bbfef4.js DELETED
@@ -1,3 +0,0 @@
1
- import{S as F,e as G,s as J,J as Z,K as _,p as k,M as w,n as A,A as v,N as T,B as oe,av as P,G as N,O as C,V as K,P as I,R as q,Q as S,a1 as ue,U as j,L,k as O,o as V,z as H,v as M,x as z,E as _e,ae as me,m as de,q as ge,r as he,u as Q,y as U,F as be}from"./index-1d65707a.js";import{g as ke}from"./color-90ab3aab.js";import{B as ve}from"./Button-f155035a.js";import{B as pe}from"./BlockLabel-66866176.js";import{E as we}from"./Empty-eec13822.js";function ye(t){let e,n,l;return{c(){e=Z("svg"),n=Z("path"),l=Z("path"),_(n,"fill","currentColor"),_(n,"d","M12 15H5a3 3 0 0 1-3-3v-2a3 3 0 0 1 3-3h5V5a1 1 0 0 0-1-1H3V2h6a3 3 0 0 1 3 3zM5 9a1 1 0 0 0-1 1v2a1 1 0 0 0 1 1h5V9zm15 14v2a1 1 0 0 0 1 1h5v-4h-5a1 1 0 0 0-1 1z"),_(l,"fill","currentColor"),_(l,"d","M2 30h28V2Zm26-2h-7a3 3 0 0 1-3-3v-2a3 3 0 0 1 3-3h5v-2a1 1 0 0 0-1-1h-6v-2h6a3 3 0 0 1 3 3Z"),_(e,"xmlns","http://www.w3.org/2000/svg"),_(e,"xmlns:xlink","http://www.w3.org/1999/xlink"),_(e,"aria-hidden","true"),_(e,"role","img"),_(e,"class","iconify iconify--carbon"),_(e,"width","100%"),_(e,"height","100%"),_(e,"preserveAspectRatio","xMidYMid meet"),_(e,"viewBox","0 0 32 32")},m(s,o){k(s,e,o),w(e,n),w(e,l)},p:A,i:A,o:A,d(s){s&&v(e)}}}class ae extends F{constructor(e){super(),G(this,e,null,ye,J,{})}}function Y(t,e,n){const l=t.slice();l[18]=e[n][0],l[24]=e[n][1];const s=typeof l[24]=="string"?parseInt(l[24]):l[24];return l[25]=s,l}function W(t,e,n){const l=t.slice();return l[18]=e[n][0],l[19]=e[n][1],l[21]=n,l}function X(t,e,n){const l=t.slice();return l[19]=e[n][0],l[22]=e[n][1],l[21]=n,l}function He(t){let e,n,l=t[1]&&x(),s=N(t[0]),o=[];for(let a=0;a<s.length;a+=1)o[a]=$(Y(t,s,a));return{c(){l&&l.c(),e=C(),n=T("div");for(let a=0;a<o.length;a+=1)o[a].c();_(n,"class","textfield svelte-19on2m6"),_(n,"data-testid","highlighted-text:textfield")},m(a,r){l&&l.m(a,r),k(a,e,r),k(a,n,r);for(let i=0;i<o.length;i+=1)o[i]&&o[i].m(n,null)},p(a,r){if(a[1]?l||(l=x(),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null),r&1){s=N(a[0]);let i;for(i=0;i<s.length;i+=1){const f=Y(a,s,i);o[i]?o[i].p(f,r):(o[i]=$(f),o[i].c(),o[i].m(n,null))}for(;i<o.length;i+=1)o[i].d(1);o.length=s.length}},d(a){a&&(v(e),v(n)),l&&l.d(a),K(o,a)}}}function Te(t){let e,n,l=t[1]&&ee(t),s=N(t[0]),o=[];for(let a=0;a<s.length;a+=1)o[a]=ne(W(t,s,a));return{c(){l&&l.c(),e=C(),n=T("div");for(let a=0;a<o.length;a+=1)o[a].c();_(n,"class","textfield svelte-19on2m6")},m(a,r){l&&l.m(a,r),k(a,e,r),k(a,n,r);for(let i=0;i<o.length;i+=1)o[i]&&o[i].m(n,null)},p(a,r){if(a[1]?l?l.p(a,r):(l=ee(a),l.c(),l.m(e.parentNode,e)):l&&(l.d(1),l=null),r&95){s=N(a[0]);let i;for(i=0;i<s.length;i+=1){const f=W(a,s,i);o[i]?o[i].p(f,r):(o[i]=ne(f),o[i].c(),o[i].m(n,null))}for(;i<o.length;i+=1)o[i].d(1);o.length=s.length}},d(a){a&&(v(e),v(n)),l&&l.d(a),K(o,a)}}}function x(t){let e;return{c(){e=T("div"),e.innerHTML="<span>-1</span> <span>0</span> <span>+1</span>",_(e,"class","color-legend svelte-19on2m6"),_(e,"data-testid","highlighted-text:color-legend")},m(n,l){k(n,e,l)},d(n){n&&v(e)}}}function $(t){let e,n,l=t[18]+"",s,o,a;return{c(){e=T("span"),n=T("span"),s=I(l),o=C(),_(n,"class","text svelte-19on2m6"),_(e,"class","textspan score-text svelte-19on2m6"),_(e,"style",a="background-color: rgba("+(t[25]<0?"128, 90, 213,"+-t[25]:"239, 68, 60,"+t[25])+")")},m(r,i){k(r,e,i),w(e,n),w(n,s),w(e,o)},p(r,i){i&1&&l!==(l=r[18]+"")&&q(s,l),i&1&&a!==(a="background-color: rgba("+(r[25]<0?"128, 90, 213,"+-r[25]:"239, 68, 60,"+r[25])+")")&&_(e,"style",a)},d(r){r&&v(e)}}}function ee(t){let e,n=N(Object.entries(t[3])),l=[];for(let s=0;s<n.length;s+=1)l[s]=le(X(t,n,s));return{c(){e=T("div");for(let s=0;s<l.length;s+=1)l[s].c();_(e,"class","category-legend svelte-19on2m6"),_(e,"data-testid","highlighted-text:category-legend")},m(s,o){k(s,e,o);for(let a=0;a<l.length;a+=1)l[a]&&l[a].m(e,null)},p(s,o){if(o&392){n=N(Object.entries(s[3]));let a;for(a=0;a<n.length;a+=1){const r=X(s,n,a);l[a]?l[a].p(r,o):(l[a]=le(r),l[a].c(),l[a].m(e,null))}for(;a<l.length;a+=1)l[a].d(1);l.length=n.length}},d(s){s&&v(e),K(l,s)}}}function le(t){let e,n=t[19]+"",l,s,o,a,r;function i(){return t[10](t[19])}function f(){return t[11](t[19])}return{c(){e=T("div"),l=I(n),s=C(),_(e,"class","category-label svelte-19on2m6"),_(e,"style",o="background-color:"+t[22].secondary)},m(u,b){k(u,e,b),w(e,l),w(e,s),a||(r=[S(e,"mouseover",i),S(e,"focus",f),S(e,"mouseout",t[12]),S(e,"blur",t[13])],a=!0)},p(u,b){t=u,b&8&&n!==(n=t[19]+"")&&q(l,n),b&8&&o!==(o="background-color:"+t[22].secondary)&&_(e,"style",o)},d(u){u&&v(e),a=!1,ue(r)}}}function te(t){let e,n,l=t[19]+"",s;return{c(){e=I(` 
2
- `),n=T("span"),s=I(l),_(n,"class","label svelte-19on2m6"),L(n,"background-color",t[19]===null||t[4]&&t[4]!==t[19]?"":t[3][t[19]].primary)},m(o,a){k(o,e,a),k(o,n,a),w(n,s)},p(o,a){a&1&&l!==(l=o[19]+"")&&q(s,l),a&25&&L(n,"background-color",o[19]===null||o[4]&&o[4]!==o[19]?"":o[3][o[19]].primary)},d(o){o&&(v(e),v(n))}}}function ne(t){let e,n,l=t[18]+"",s,o,a,r,i,f=!t[1]&&t[19]!==null&&te(t);function u(){return t[14](t[21],t[18],t[19])}return{c(){e=T("span"),n=T("span"),s=I(l),o=C(),f&&f.c(),a=C(),_(n,"class","text svelte-19on2m6"),j(n,"no-label",!t[3][t[19]]),_(e,"class","textspan svelte-19on2m6"),j(e,"no-cat",t[19]===null||t[4]&&t[4]!==t[19]),j(e,"hl",t[19]!==null),j(e,"selectable",t[2]),L(e,"background-color",t[19]===null||t[4]&&t[4]!==t[19]?"":t[3][t[19]].secondary)},m(b,d){k(b,e,d),w(e,n),w(n,s),w(e,o),f&&f.m(e,null),w(e,a),r||(i=S(e,"click",u),r=!0)},p(b,d){t=b,d&1&&l!==(l=t[18]+"")&&q(s,l),d&9&&j(n,"no-label",!t[3][t[19]]),!t[1]&&t[19]!==null?f?f.p(t,d):(f=te(t),f.c(),f.m(e,a)):f&&(f.d(1),f=null),d&17&&j(e,"no-cat",t[19]===null||t[4]&&t[4]!==t[19]),d&1&&j(e,"hl",t[19]!==null),d&4&&j(e,"selectable",t[2]),d&25&&L(e,"background-color",t[19]===null||t[4]&&t[4]!==t[19]?"":t[3][t[19]].secondary)},d(b){b&&v(e),f&&f.d(),r=!1,i()}}}function Me(t){let e;function n(o,a){return o[5]==="categories"?Te:He}let l=n(t),s=l(t);return{c(){e=T("div"),s.c(),_(e,"class","container svelte-19on2m6")},m(o,a){k(o,e,a),s.m(e,null)},p(o,[a]){l===(l=n(o))&&s?s.p(o,a):(s.d(1),s=l(o),s&&(s.c(),s.m(e,null)))},i:A,o:A,d(o){o&&v(e),s.d()}}}function Be(t,e,n){const l=typeof document<"u";let{value:s=[]}=e,{show_legend:o=!1}=e,{color_map:a={}}=e,{selectable:r=!1}=e,i,f={},u="";function b(h,p){if(!i){var y=document.createElement("canvas");i=y.getContext("2d")}i.fillStyle=h,i.fillRect(0,0,1,1);const[D,fe,ce]=i.getImageData(0,0,1,1).data;return i.clearRect(0,0,1,1),`rgba(${D}, ${fe}, ${ce}, ${255/p})`}const d=oe();let B;function c(h){n(4,u=h)}function g(){n(4,u="")}const R=h=>c(h),E=h=>c(h),m=()=>g(),ie=()=>g(),re=(h,p,y)=>{d("select",{index:h,value:[p,y]})};return t.$$set=h=>{"value"in h&&n(0,s=h.value),"show_legend"in h&&n(1,o=h.show_legend),"color_map"in h&&n(9,a=h.color_map),"selectable"in h&&n(2,r=h.selectable)},t.$$.update=()=>{if(t.$$.dirty&513){let h=function(){for(const p in a){const y=a[p].trim();y in P?n(3,f[p]=P[y],f):n(3,f[p]={primary:l?b(a[p],1):a[p],secondary:l?b(a[p],.5):a[p]},f)}};if(a||n(9,a={}),s.length>0){for(let[p,y]of s)if(y!==null)if(typeof y=="string"){if(n(5,B="categories"),!(y in a)){let D=ke(Object.keys(a).length);n(9,a[y]=D,a)}}else n(5,B="scores")}h()}},[s,o,r,f,u,B,d,c,g,a,R,E,m,ie,re]}class je extends F{constructor(e){super(),G(this,e,Be,Me,J,{value:0,show_legend:1,color_map:9,selectable:2})}}function se(t){let e,n;return e=new pe({props:{Icon:ae,label:t[6],float:!1,disable:t[7]===!1}}),{c(){O(e.$$.fragment)},m(l,s){V(e,l,s),n=!0},p(l,s){const o={};s&64&&(o.label=l[6]),s&128&&(o.disable=l[7]===!1),e.$set(o)},i(l){n||(H(e.$$.fragment,l),n=!0)},o(l){M(e.$$.fragment,l),n=!1},d(l){z(e,l)}}}function Ce(t){let e,n;return e=new we({props:{$$slots:{default:[Ne]},$$scope:{ctx:t}}}),{c(){O(e.$$.fragment)},m(l,s){V(e,l,s),n=!0},p(l,s){const o={};s&32768&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){n||(H(e.$$.fragment,l),n=!0)},o(l){M(e.$$.fragment,l),n=!1},d(l){z(e,l)}}}function Ee(t){let e,n;return e=new je({props:{selectable:t[10],value:t[4],show_legend:t[5],color_map:t[0]}}),e.$on("select",t[13]),{c(){O(e.$$.fragment)},m(l,s){V(e,l,s),n=!0},p(l,s){const o={};s&1024&&(o.selectable=l[10]),s&16&&(o.value=l[4]),s&32&&(o.show_legend=l[5]),s&1&&(o.color_map=l[0]),e.$set(o)},i(l){n||(H(e.$$.fragment,l),n=!0)},o(l){M(e.$$.fragment,l),n=!1},d(l){z(e,l)}}}function Ne(t){let e,n;return e=new ae({}),{c(){O(e.$$.fragment)},m(l,s){V(e,l,s),n=!0},i(l){n||(H(e.$$.fragment,l),n=!0)},o(l){M(e.$$.fragment,l),n=!1},d(l){z(e,l)}}}function Oe(t){let e,n,l,s,o,a,r;const i=[t[11]];let f={};for(let c=0;c<i.length;c+=1)f=_e(f,i[c]);e=new me({props:f});let u=t[6]&&se(t);const b=[Ee,Ce],d=[];function B(c,g){return c[4]?0:1}return s=B(t),o=d[s]=b[s](t),{c(){O(e.$$.fragment),n=C(),u&&u.c(),l=C(),o.c(),a=de()},m(c,g){V(e,c,g),k(c,n,g),u&&u.m(c,g),k(c,l,g),d[s].m(c,g),k(c,a,g),r=!0},p(c,g){const R=g&2048?ge(i,[he(c[11])]):{};e.$set(R),c[6]?u?(u.p(c,g),g&64&&H(u,1)):(u=se(c),u.c(),H(u,1),u.m(l.parentNode,l)):u&&(Q(),M(u,1,1,()=>{u=null}),U());let E=s;s=B(c),s===E?d[s].p(c,g):(Q(),M(d[E],1,1,()=>{d[E]=null}),U(),o=d[s],o?o.p(c,g):(o=d[s]=b[s](c),o.c()),H(o,1),o.m(a.parentNode,a))},i(c){r||(H(e.$$.fragment,c),H(u),H(o),r=!0)},o(c){M(e.$$.fragment,c),M(u),M(o),r=!1},d(c){c&&(v(n),v(l),v(a)),z(e,c),u&&u.d(c),d[s].d(c)}}}function Ve(t){let e,n;return e=new ve({props:{test_id:"highlighted-text",visible:t[3],elem_id:t[1],elem_classes:t[2],padding:!1,container:t[7],scale:t[8],min_width:t[9],$$slots:{default:[Oe]},$$scope:{ctx:t}}}),{c(){O(e.$$.fragment)},m(l,s){V(e,l,s),n=!0},p(l,[s]){const o={};s&8&&(o.visible=l[3]),s&2&&(o.elem_id=l[1]),s&4&&(o.elem_classes=l[2]),s&128&&(o.container=l[7]),s&256&&(o.scale=l[8]),s&512&&(o.min_width=l[9]),s&36081&&(o.$$scope={dirty:s,ctx:l}),e.$set(o)},i(l){n||(H(e.$$.fragment,l),n=!0)},o(l){M(e.$$.fragment,l),n=!1},d(l){z(e,l)}}}function ze(t,e,n){let{elem_id:l=""}=e,{elem_classes:s=[]}=e,{visible:o=!0}=e,{value:a}=e,r,{show_legend:i}=e,{color_map:f={}}=e,{label:u="Highlighted Text"}=e,{container:b=!0}=e,{scale:d=null}=e,{min_width:B=void 0}=e,{selectable:c=!1}=e,{loading_status:g}=e;const R=oe();function E(m){be.call(this,t,m)}return t.$$set=m=>{"elem_id"in m&&n(1,l=m.elem_id),"elem_classes"in m&&n(2,s=m.elem_classes),"visible"in m&&n(3,o=m.visible),"value"in m&&n(4,a=m.value),"show_legend"in m&&n(5,i=m.show_legend),"color_map"in m&&n(0,f=m.color_map),"label"in m&&n(6,u=m.label),"container"in m&&n(7,b=m.container),"scale"in m&&n(8,d=m.scale),"min_width"in m&&n(9,B=m.min_width),"selectable"in m&&n(10,c=m.selectable),"loading_status"in m&&n(11,g=m.loading_status)},t.$$.update=()=>{t.$$.dirty&1&&!f&&Object.keys(f).length&&n(0,f),t.$$.dirty&4112&&a!==r&&(n(12,r=a),R("change"))},[f,l,s,o,a,i,u,b,d,B,c,g,r,E]}class Re extends F{constructor(e){super(),G(this,e,ze,Ve,J,{elem_id:1,elem_classes:2,visible:3,value:4,show_legend:5,color_map:0,label:6,container:7,scale:8,min_width:9,selectable:10,loading_status:11})}}const De=Re,Ze=["static"],Fe=t=>({type:{payload:"Array<[string, string | number]>"},description:{payload:"list of text spans and corresponding label / value"}});export{De as Component,Fe as document,Ze as modes};
3
- //# sourceMappingURL=index-28bbfef4.js.map