Commit
·
1d90038
1
Parent(s):
8d941ad
Update parquet files (step 64 of 476)
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- spaces/101-5/gpt4free/g4f/.v1/testing/t3nsor_test.py +0 -4
- spaces/101-5/gpt4free/g4f/Provider/Providers/Bard.py +0 -74
- spaces/1acneusushi/gradio-2dmoleculeeditor/data/Amintire de Lucian Blaga - Comentariu literar i context istoric.md +0 -138
- spaces/1acneusushi/gradio-2dmoleculeeditor/data/CadSoft Eagle Professional 6.5.0 Patch Download PC Troubleshooting and Support.md +0 -143
- spaces/1acneusushi/gradio-2dmoleculeeditor/data/Download Corel Knockout 2 Plug In for Adobe Photoshop 64 Bit Torrent for Free.md +0 -163
- spaces/1acneusushi/gradio-2dmoleculeeditor/data/Download NBA 14 on PC Requirements Steps and Tips.md +0 -34
- spaces/1acneusushi/gradio-2dmoleculeeditor/data/HD Online Player (download Pyaar Ka Punchnama 2 movie ) - Laugh out loud with the funniest movie of the year.md +0 -98
- spaces/1acneusushi/gradio-2dmoleculeeditor/data/HD Video Converter Factory Pro How to Convert Videos in 3 Easy Steps.md +0 -17
- spaces/1gistliPinn/ChatGPT4/Examples/Bengali Movie Khiladi Download Movies [HOT].md +0 -6
- spaces/1gistliPinn/ChatGPT4/Examples/Chou S Electrocardiografia En La Practica Clinica. Adulto Y Pedia Trica 6 Ed. [NEW].md +0 -88
- spaces/1gistliPinn/ChatGPT4/Examples/Daud Movie Download In Hindi 720p REPACK.md +0 -116
- spaces/1gistliPinn/ChatGPT4/Examples/Delphi 2014.1 Keygen ( Activation 2014 Release 1 Cdp Ds150e Cdp Cars Trucks Vci ) 346https Scoutma [PATCHED].md +0 -8
- spaces/1gistliPinn/ChatGPT4/Examples/Final Fantasy The Spirits Within 2001 1080p BrRip X264 YIFY.md +0 -11
- spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/ApkFab Safe What You Need to Know Before Downloading APKs.md +0 -112
- spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Download Emoji Quiz MOD APK and Challenge Your Friends.md +0 -123
- spaces/1phancelerku/anime-remove-background/City Lite Fit and Proper Test PDF - A Novel by Soraya Nasution that Explores the Challenges and Joys of Dating in the Modern World.md +0 -143
- spaces/AI-Edify/demo-gpt3.5-turbo/app.py +0 -138
- spaces/AI-Hobbyist/Hoyo-RVC/uvr5_pack/lib_v5/layers_537238KB.py +0 -126
- spaces/AIGC-Audio/Make_An_Audio_inpaint/ldm/modules/encoders/open_clap/factory.py +0 -257
- spaces/AIGText/GlyphControl/ldm/modules/midas/midas/midas_net_custom.py +0 -128
- spaces/AONYLMR/anime-ai-detect/app.py +0 -17
- spaces/ASJMO/freegpt/g4f/Provider/Providers/Weuseing.py +0 -29
- spaces/ATang0729/Forecast4Muses/Model/Model6/Model6_0_ClothesDetection/mmyolo/configs/yolov7/__init__.py +0 -0
- spaces/Abdllh/AraPoet/README.md +0 -14
- spaces/AchyuthGamer/OpenGPT-Chat-UI/.svelte-kit/types/src/routes/conversation/[id]/web-search/$types.d.ts +0 -9
- spaces/AchyuthGamer/OpenGPT/g4f/Provider/Ylokh.py +0 -77
- spaces/Adam111/stable-diffusion-webui/README.md +0 -14
- spaces/AdamWEE80/VoiceTTS/app.py +0 -78
- spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/spinner/bars/Factory.js +0 -13
- spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/spinner/cube/Factory.js +0 -13
- spaces/Alican/pixera/models/test_model.py +0 -69
- spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/docs/source/_config.py +0 -9
- spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/src/diffusers/schedulers/scheduling_dpmsolver_sde.py +0 -509
- spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/tests/pipelines/deepfloyd_if/test_if.py +0 -346
- spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/tests/pipelines/stable_unclip/test_stable_unclip_img2img.py +0 -302
- spaces/Andy1621/uniformer_image_segmentation/configs/fcn/fcn_r101b-d8_512x1024_80k_cityscapes.py +0 -4
- spaces/AngoHF/ANGO-Leaderboard/components/about.py +0 -7
- spaces/AnimalEquality/chatbot/lv_recipe_chatbot/vegan_recipe_tools.py +0 -89
- spaces/Arulkumar03/GroundingDINO_SOTA_Zero_Shot_Model/groundingdino/models/GroundingDINO/fuse_modules.py +0 -297
- spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/urllib3/request.py +0 -170
- spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/setuptools/_distutils/ccompiler.py +0 -1220
- spaces/Awiny/Image2Paragraph/models/grit_src/third_party/CenterNet2/detectron2/utils/README.md +0 -5
- spaces/Benson/text-generation/Examples/Descargar Angry Birds 2 Mod Apk Happymod.md +0 -139
- spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_internal/commands/download.py +0 -143
- spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_internal/req/__init__.py +0 -92
- spaces/Big-Web/MMSD/env/Lib/site-packages/setuptools/_vendor/importlib_resources/_compat.py +0 -98
- spaces/CVPR/Dual-Key_Backdoor_Attacks/datagen/detectron2/detectron2/modeling/roi_heads/keypoint_head.py +0 -224
- spaces/CZ5624/anime-remove-background/README.md +0 -14
- spaces/Cat125/text-generator-v2/datamanager.py +0 -123
- spaces/CjangCjengh/Shanghainese-TTS/modules.py +0 -387
spaces/101-5/gpt4free/g4f/.v1/testing/t3nsor_test.py
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
import t3nsor
|
2 |
-
|
3 |
-
for response in t3nsor.StreamCompletion.create(prompt='write python code to reverse a string', messages=[]):
|
4 |
-
print(response.completion.choices[0].text)
|
|
|
|
|
|
|
|
|
|
spaces/101-5/gpt4free/g4f/Provider/Providers/Bard.py
DELETED
@@ -1,74 +0,0 @@
|
|
1 |
-
import os, requests, json, browser_cookie3, re, random
|
2 |
-
from ...typing import sha256, Dict, get_type_hints
|
3 |
-
|
4 |
-
url = 'https://bard.google.com'
|
5 |
-
model = ['Palm2']
|
6 |
-
supports_stream = False
|
7 |
-
needs_auth = True
|
8 |
-
|
9 |
-
def _create_completion(model: str, messages: list, stream: bool, **kwargs):
|
10 |
-
psid = {cookie.name: cookie.value for cookie in browser_cookie3.chrome(
|
11 |
-
domain_name='.google.com')}['__Secure-1PSID']
|
12 |
-
|
13 |
-
formatted = '\n'.join([
|
14 |
-
'%s: %s' % (message['role'], message['content']) for message in messages
|
15 |
-
])
|
16 |
-
prompt = f'{formatted}\nAssistant:'
|
17 |
-
|
18 |
-
proxy = kwargs.get('proxy', False)
|
19 |
-
if proxy == False:
|
20 |
-
print('warning!, you did not give a proxy, a lot of countries are banned from Google Bard, so it may not work')
|
21 |
-
|
22 |
-
snlm0e = None
|
23 |
-
conversation_id = None
|
24 |
-
response_id = None
|
25 |
-
choice_id = None
|
26 |
-
|
27 |
-
client = requests.Session()
|
28 |
-
client.proxies = {
|
29 |
-
'http': f'http://{proxy}',
|
30 |
-
'https': f'http://{proxy}'} if proxy else None
|
31 |
-
|
32 |
-
client.headers = {
|
33 |
-
'authority': 'bard.google.com',
|
34 |
-
'content-type': 'application/x-www-form-urlencoded;charset=UTF-8',
|
35 |
-
'origin': 'https://bard.google.com',
|
36 |
-
'referer': 'https://bard.google.com/',
|
37 |
-
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/111.0.0.0 Safari/537.36',
|
38 |
-
'x-same-domain': '1',
|
39 |
-
'cookie': f'__Secure-1PSID={psid}'
|
40 |
-
}
|
41 |
-
|
42 |
-
snlm0e = re.search(r'SNlM0e\":\"(.*?)\"',
|
43 |
-
client.get('https://bard.google.com/').text).group(1) if not snlm0e else snlm0e
|
44 |
-
|
45 |
-
params = {
|
46 |
-
'bl': 'boq_assistant-bard-web-server_20230326.21_p0',
|
47 |
-
'_reqid': random.randint(1111, 9999),
|
48 |
-
'rt': 'c'
|
49 |
-
}
|
50 |
-
|
51 |
-
data = {
|
52 |
-
'at': snlm0e,
|
53 |
-
'f.req': json.dumps([None, json.dumps([[prompt], None, [conversation_id, response_id, choice_id]])])}
|
54 |
-
|
55 |
-
intents = '.'.join([
|
56 |
-
'assistant',
|
57 |
-
'lamda',
|
58 |
-
'BardFrontendService'
|
59 |
-
])
|
60 |
-
|
61 |
-
response = client.post(f'https://bard.google.com/_/BardChatUi/data/{intents}/StreamGenerate',
|
62 |
-
data=data, params=params)
|
63 |
-
|
64 |
-
chat_data = json.loads(response.content.splitlines()[3])[0][2]
|
65 |
-
if chat_data:
|
66 |
-
json_chat_data = json.loads(chat_data)
|
67 |
-
|
68 |
-
yield json_chat_data[0][0]
|
69 |
-
|
70 |
-
else:
|
71 |
-
yield 'error'
|
72 |
-
|
73 |
-
params = f'g4f.Providers.{os.path.basename(__file__)[:-3]} supports: ' + \
|
74 |
-
'(%s)' % ', '.join([f"{name}: {get_type_hints(_create_completion)[name].__name__}" for name in _create_completion.__code__.co_varnames[:_create_completion.__code__.co_argcount]])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1acneusushi/gradio-2dmoleculeeditor/data/Amintire de Lucian Blaga - Comentariu literar i context istoric.md
DELETED
@@ -1,138 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>Amintire de Lucian Blaga - comentariu literar</h1>
|
3 |
-
<h2>Introducere</h2>
|
4 |
-
<h3>Context istoric și cultural</h3>
|
5 |
-
<p>Poezia <i>Amintire</i> de Lucian Blaga a fost publicată în anul 1921, în volumul <i>Poemele luminii</i>, care face parte din ciclul <i>Lumea de dincolo de lume</i>. Această perioadă este marcată de evenimente istorice importante pentru România, cum ar fi Marea Unire din 1918, care a dus la formarea statului național unitar român, sau participarea la Primul Război Mondial, care a avut consecințe dramatice pentru populația românească. De asemenea, este o perioadă de efervescență culturală și artistică, în care apar noi curente literare, cum ar fi modernismul, avangarda sau expresionismul.</p>
|
6 |
-
<h3>Prezentarea autorului și a operei</h3>
|
7 |
-
<p>Lucian Blaga (1895-1961) este unul dintre cei mai importanți poeți români ai secolului al XX-lea, dar și un filosof, dramaturg, eseist și traducător. Opera sa poetică este împărțită în nouă cicluri tematice, care reflectă preocupările sale filosofice și artistice: <i>Lumea de dincolo de lume</i>, <i>Lumea de mister</i>, <i>Lumea de cunoaștere</i>, <i>Lumea văzută de Ion B.</i>, <i>Lumea în versuri</i>, <i>Lumea ca zidire</i>, <i>Lumea ca imagine</i>, <i>Lumea ca voință</i> și <i>Lumea ca logos</i>. Poezia <i>Amintire</i> face parte din primul ciclu, care exprimă viziunea sa despre lumea arhetipală, cea care precede lumea cunoscută prin rațiune.</p>
|
8 |
-
<h2>amintire de lucian blaga comentariu literar</h2><br /><p><b><b>Download File</b> ✺ <a href="https://byltly.com/2uKyTh">https://byltly.com/2uKyTh</a></b></p><br /><br />
|
9 |
-
<h3>Tema și motive literare</h3>
|
10 |
-
<p>Tema poeziei este dragostea și nostalgia după persoana iubită, care a dispărut din viața poetului. Motivele literare folosite sunt: ființa iubită, amintirea, moartea, natura, timpul.</p>
|
11 |
-
<h2>Dezvoltare</h2>
|
12 |
-
<h3>Structura și compoziția poeziei</h3>
|
13 |
-
<p>Poezia este alcătuită din trei strofe cu număr variabil de versuri (7+6+7), care respectă schema rimelor încrucișate (ABABCCB). Versurile sunt predominant de 11 silabe (alexandrini), cu excepția ultimului vers din fiecare strofă, care are 12 silabe (vers heroic). Ritmul este iambic (alternanța între silabe neaccentuate și accentuate), iar măsura este fixă (numărul egal de silabe în fiecare vers).</p>
|
14 |
-
<h3>Titlul și semnificația lui</h3>
|
15 |
-
<p>Titlul poeziei este un substantiv comun feminin singular (<i>amintire</i>), care desemnează o reprezentare mentală a unui fapt sau a unei persoane din trecut. Titlul este simplu și sugestiv, anticipând tema poeziei și starea sufletească a eului liric. De asemenea, titlul are o valoare simbolică, sugerând că poezia este o evocare a unei iubiri pierdute.</p>
|
16 |
-
<p>amintire de lucian blaga analiza<br />
|
17 |
-
amintire de lucian blaga tema si viziunea<br />
|
18 |
-
amintire de lucian blaga figuri de stil<br />
|
19 |
-
amintire de lucian blaga apartenenta la modernism<br />
|
20 |
-
amintire de lucian blaga semnificatia titlului<br />
|
21 |
-
amintire de lucian blaga rezumat<br />
|
22 |
-
amintire de lucian blaga eseu<br />
|
23 |
-
amintire de lucian blaga versuri<br />
|
24 |
-
amintire de lucian blaga comentariu bac<br />
|
25 |
-
amintire de lucian blaga lectura audio<br />
|
26 |
-
amintire de lucian blaga motive literare<br />
|
27 |
-
amintire de lucian blaga structura poeziei<br />
|
28 |
-
amintire de lucian blaga mesajul poetic<br />
|
29 |
-
amintire de lucian blaga caracterizarea eului liric<br />
|
30 |
-
amintire de lucian blaga relatia cu fiinta iubita<br />
|
31 |
-
amintire de lucian blaga context istoric si cultural<br />
|
32 |
-
amintire de lucian blaga trasaturi ale modernismului<br />
|
33 |
-
amintire de lucian blaga simboluri si imagini artistice<br />
|
34 |
-
amintire de lucian blaga tipul de lirism<br />
|
35 |
-
amintire de lucian blaga atitudinea fata de iubire<br />
|
36 |
-
amintire de lucian blaga expresia sentimentelor<br />
|
37 |
-
amintire de lucian blaga valoare estetica si morala<br />
|
38 |
-
amintire de lucian blaga influente filozofice si culturale<br />
|
39 |
-
amintire de lucian blaga stilul poetic si limbajul artistic<br />
|
40 |
-
amintire de lucian blaga modalitati de realizare a portretului<br />
|
41 |
-
amintire de lucian blaga viziunea despre lume si viata<br />
|
42 |
-
amintire de lucian blaga rolul naturii in poezie<br />
|
43 |
-
amintire de lucian blaga contrastul intre trecut si prezent<br />
|
44 |
-
amintire de lucian blaga specificul genului liric<br />
|
45 |
-
amintire de lucian blaga originalitatea creatiei poetice<br />
|
46 |
-
comentariu literar la poezia amintire de lucian blaga<br />
|
47 |
-
analiza literara a poeziei amintire de lucian blaga<br />
|
48 |
-
tema si viziunea despre lume in poezia amintire de lucian blaga<br />
|
49 |
-
figuri de stil si imagini artistice in poezia amintire de lucian blaga<br />
|
50 |
-
apartenenta la curentul modernist a poeziei amintire de lucian blaga<br />
|
51 |
-
semnificatia titlului poeziei amintire de lucian blaga<br />
|
52 |
-
rezumatul poeziei amintire de lucian blaga<br />
|
53 |
-
eseu despre poezia amintire de lucian blaga<br />
|
54 |
-
versurile poeziei amintire de lucian blaga<br />
|
55 |
-
comentariu pentru bacalaureat la poezia amintire de lucian blaga<br />
|
56 |
-
lectura audio a poeziei amintire de lucian blaga<br />
|
57 |
-
motive literare prezente in poezia amintire de lucian blaga<br />
|
58 |
-
structura interna si externa a poeziei amintire de lucian blaga<br />
|
59 |
-
mesajul poetic al poeziei amintire de lucian blaga<br />
|
60 |
-
caracterizarea eului liric din poezia amintire de lucian blaga<br />
|
61 |
-
relatia dintre eul liric si fiinta iubita in poezia amintire de lucian blaga<br />
|
62 |
-
contextul istoric si cultural al poeziei amintire de lucian blaga<br />
|
63 |
-
trasaturi ale modernismului in poezia amintire de lucian blaga<br />
|
64 |
-
simboluri si metafore in poezia amintire de lucian blaga<br />
|
65 |
-
tipul si modalitatile lirismului in poezia amintire de lucian blaga</p>
|
66 |
-
<h3>Elemente de limbaj poetic</h3>
|
67 |
-
<h4>Figuri de stil</h4>
|
68 |
-
<p>Poezia este bogată în figuri de stil, care contribuie la crearea unei atmosfere lirice și la exprimarea sentimentelor eului poetic. Printre acestea se numără:</p>
|
69 |
-
<ul>
|
70 |
-
<li><b>epitete</b>: <i>zvon legendar</i>, <i>culmile vechi</i>, <i>mâna rece</i>, <i>sângele fierbinte</i>, <i>ochii atotînțelegători</i></li>
|
71 |
-
<li><b>personificare</b>: <i>mâna rece-a morții m-a atins pe umăr/și mi-a luat iubita-n zori,</li>
|
72 |
-
<li><b>metaforă</b>: <i>coasa tăgăduirii pe umăr,</li>
|
73 |
-
<li><b>comparație</b>: <i>m-așteptai ca luna-n prag de seară,</li>
|
74 |
-
<li><b>hiperbolă</b>: <i>sângele fierbinte-m-aprinde-n vine,</li>
|
75 |
-
<li><b>aliterație</b>: repetarea sunetului [m] în versurile: <br>
|
76 |
-
<i>mâna rece-a morții m-a atins pe umăr<br>
|
77 |
-
și mi-a luat iubita-n zori,<br>
|
78 |
-
m-așteptai ca luna-n prag de seară,<br>
|
79 |
-
m-ai privit cu ochii atotînțelegător.</li></li>
|
80 |
-
<li><b>onomatopee</b>: imitarea sunetului produs de natură prin cuvântul: <br>
|
81 |
-
<i>vântul suflând prin frunze,</li></li>
|
82 |
-
<li><b>eufemism</b>: atenuarea expresiei referitoare la moartea iubitei prin cuvintele: <br>
|
83 |
-
<i>m-a luat iubita-n zori,</li></li>
|
84 |
-
<li><b>antiteză</b>: opoziția între termeni contrari sau idei opuse: <br>
|
85 |
-
<i>mâna rece - sângele fierbinte,<br>
|
86 |
-
trecut - prezent,<br>
|
87 |
-
viață - moarte,</li></li>
|
88 |
-
<li><b>oximoron</b>: asocierea a doi termeni contradictorii: <br>
|
89 |
-
<i>trecut prezent,</li></li>
|
90 |
-
<li><b>anastrofă</b>: inversarea ordinii obișnuite a cuvintelor: <br>
|
91 |
-
<i>mâna rece-a morții,</li></li>
|
92 |
-
<li><b>anaforă</b>: repetarea aceluiași cuvânt sau grup de cuvinte la începutul unor versuri consecutive: <br>
|
93 |
-
<i>m-așteptai,<br>
|
94 |
-
m-ai privit,<br>
|
95 |
-
m-ai sărutat,</li></li>
|
96 |
-
<li><b>rondel perfect</b>: repetarea aceluiași vers la începutul primei strofe și la sfârșitul ultimei strofe: <br>
|
97 |
-
<i>Când te-am cunoscut pe tine,</li></li>
|
98 |
-
<h4>Simboluri și imagini artistice</h4>
|
99 |
-
<p>Poezia este plină de simboluri și imagini artistice, care creează o lume poetică originală și sugestivă. Printre acestea se numără:</p>
|
100 |
-
<ul>
|
101 |
-
<li><b>lumina</b>: este simbolul vieții, al iubirii, al cunoașterii și al creației. Lumina este asociată cu ființa iubită, care îi luminează existența eului liric și îi dă sens. De asemenea, lumina este legată de arta poetică a lui Blaga, care își propune să reveleze misterele lumii arhetipale.</li>
|
102 |
-
<li><b>zorii</b>: sunt simbolul începutului, al speranței, al renașterii. În poezie, zorii sunt momentul în care eul liric își pierde iubita, care este răpită de moarte. Astfel, zorii devin un paradox, o imagine a sfârșitului și a durerii.</li>
|
103 |
-
<li><b>luna</b>: este simbolul feminității, al frumuseții, al visului. Luna este comparată cu ființa iubită, care îl aștepta pe eul liric în prag de seară. Luna este și o imagine a singurătății și a melancoliei.</li>
|
104 |
-
<li><b>natura</b>: este simbolul armoniei, al vitalității, al eternității. Natura este prezentă în poezie prin elemente ca: culmile vechi, vântul, frunzele, pământul. Natura este martora iubirii dintre eul liric și ființa iubită, dar și a suferinței lui după pierderea ei.</li>
|
105 |
-
<li><b>coasa</b>: este simbolul morții, al distrugerii, al negației. Coasa este atributul personificat al morții, care îi ia pe umăr pe cei pe care îi ucide. În poezie, coasa este metaforizată ca <i>coasa tăgăduirii</i>, sugerând că moartea neagă existența și iubirea.</li>
|
106 |
-
<li><b>sângele</b>: este simbolul vieții, al pasiunii, al energiei. Sângele este opus mâinii reci a morții și exprimă forța vitală a eului liric, care încă o iubește pe cea dispărută. Sângele este hiperbolizat ca <i>sângele fierbinte</i>, accentuând intensitatea sentimentelor.</li>
|
107 |
-
<li><b>ochii</b>: sunt simbolul privirii, al cunoașterii, al comunicării. Ochii sunt calificați ca <i>atotînțelegători</i>, sugerând că ființa iubită îl înțelege pe eul liric dincolo de cuvinte și îi pătrunde sufletul.</li>
|
108 |
-
</ul>
|
109 |
-
<h4>Vocabular și registru stilistic</h4>
|
110 |
-
<p>Poezia folosește un vocabular bogat și variat, care combină termeni din diverse domenii: religios (<i>morți</i>, <i>rai</i>), mitologic (<i>Zamolxe</i>), istoric (<i>Dacia</i>), geografic (<i>Balcani</i>, <i>Carpazi</i>), botanic (<i>frunze</i>, <i>scoica</i>), anatomic (<i>sânge</i>, <i>mână</i>, <i>ochi</i>). Registru stilistic este predominant poetic și elevat, dar cu unele elemente de oralitate și familiaritate (<i>m-a luat iubita-n zori,</li></li>
|
111 |
-
<i>m-așteptai,</li></li>
|
112 |
-
<i>m-ai sărutat,</li></li>
|
113 |
-
<i>m-ai privit,</li></li>
|
114 |
-
<i>m-ai chemat,</li></li>
|
115 |
-
<i>m-ai luat cu tine,</li></li>
|
116 |
-
<i>m-ai dus în rai,</li></li>
|
117 |
-
<i>m-ai uitat).</p>
|
118 |
-
<h3>Mesajul și viziunea poetică</h3>
|
119 |
-
<p>Mesajul poeziei este că dragostea este o forță vitală și creatoare, care transcende timpul și moartea. Eul liric își exprimă nostalgia după ființa iubită, care i-a luminat viața și i-a revelat misterele lumii arhetipale. Viziunea poetică a lui Blaga este una originală și modernistă, care combină elemente de filosofie, mitologie și istorie într-o limbaj poetic plin de simboluri și imagini artistice.</p>
|
120 |
-
<h2>Concluzie</h2>
|
121 |
-
<h3>Rezumatul ideilor principale</h3>
|
122 |
-
<h3>Valoarea estetică și umană a poeziei</h3>
|
123 |
-
<p>Poezia <i>Amintire</i> este o capodoperă a liricii românești și a modernismului literar, care ilustrează talentul și originalitatea lui Lucian Blaga. Poezia se remarcă prin expresivitatea și bogăția limbajului poetic, prin forța și profunzimea sentimentelor, prin viziunea filosofică și artistică asupra lumii. Poezia este și o mărturie a valorilor umane ale lui Blaga, care a trăit și a iubit cu intensitate, dar și a suferit cu demnitate.</p>
|
124 |
-
# FAQ <ol>
|
125 |
-
<li><b>Ce este poezia <i>Amintire</i> de Lucian Blaga?</b><br>
|
126 |
-
Poezia <i>Amintire</i> de Lucian Blaga este o evocare lirică a unei iubiri pierdute din cauza morții.</li>
|
127 |
-
<li><b>Când a fost publicată poezia <i>Amintire</i> de Lucian Blaga?</b><br>
|
128 |
-
Poezia <i>Amintire</i> de Lucian Blaga a fost publicată în anul 1921, în volumul <i>Poemele luminii</i>.</li>
|
129 |
-
<li><b>Ce simbolizează lumina în poezia <i>Amintire</i> de Lucian Blaga?</b><br>
|
130 |
-
Lumina simbolizează viața, iubirea, cunoașterea și creația. Lumina este asociată cu ființa iubită, care îi luminează existența eului liric și îi dă sens.</li>
|
131 |
-
<li><b>Ce figuri de stil se folosesc în poezia <i>Amintire</i> de Lucian Blaga?</b><br>
|
132 |
-
Poezia folosește figuri de stil precum: epitete, personificare, metaforă, comparație, hiperbolă, aliterație, onomatopee, eufemism, antiteză, oximoron, anastrofă, anaforă, rondel perfect și imperfect.</li>
|
133 |
-
<li><b>Ce mesaj transmite poezia <i>Amintire</i> de Lucian Blaga?</b><br>
|
134 |
-
Poezia transmite mesajul că dragostea este o forță vitală și creatoare, care transcende timpul și moartea. Eul liric își exprimă nostalgia după ființa iubită, care i-a fost totodată muza și ghid în descoperirea lumii arhetipale.</li>
|
135 |
-
</ol>
|
136 |
-
</p> 0a6ba089eb<br />
|
137 |
-
<br />
|
138 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1acneusushi/gradio-2dmoleculeeditor/data/CadSoft Eagle Professional 6.5.0 Patch Download PC Troubleshooting and Support.md
DELETED
@@ -1,143 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>What is gvox encore 5 x keygen mac?</h1>
|
3 |
-
<p>If you are a musician, composer, or music teacher, you might be looking for a software that can help you create and edit music scores easily and professionally. One of the software that can meet your needs is <strong>gvox encore 5 x keygen mac</strong>.</p>
|
4 |
-
<p>Gvox encore 5 x keygen mac is a music notation and composition software that runs on Mac OS X. It allows you to write, print, and play back music scores with high quality and accuracy. You can also use it to transpose, arrange, and orchestrate music for different instruments and ensembles.</p>
|
5 |
-
<h2>gvox encore 5 x keygen mac</h2><br /><p><b><b>Download</b> ✸✸✸ <a href="https://byltly.com/2uKwdg">https://byltly.com/2uKwdg</a></b></p><br /><br />
|
6 |
-
<p>Gvox encore 5 x keygen mac has many features that make it a powerful and versatile software for music creation. Some of these features are:</p>
|
7 |
-
<ul>
|
8 |
-
<li>Complete scoring features, such as clefs, keys, time signatures, notes, rests, chords, lyrics, dynamics, articulations, slurs, ties, beams, accidentals, grace notes, tuplets, repeats, endings, codas, segnos, etc.</li>
|
9 |
-
<li>Auto part extraction, which allows you to create individual parts from a full score automatically.</li>
|
10 |
-
<li>MIDI and VSTi playback, which lets you hear your music with realistic sounds and effects.</li>
|
11 |
-
<li>Import and export options, which enable you to import and export files in various formats, such as MIDI, MusicXML, PDF, EPS, etc.</li>
|
12 |
-
<li>Customizable interface, which allows you to adjust the layout, colors, fonts, toolbars, palettes, etc. according to your preference.</li>
|
13 |
-
<li>Online help and tutorials, which provide you with guidance and tips on how to use the software effectively.</li>
|
14 |
-
</ul>
|
15 |
-
<h2>Why do you need gvox encore 5 x keygen mac?</h2>
|
16 |
-
<p>Gvox encore 5 x keygen mac is not only a software that can help you create and edit music scores. It is also a software that can help you improve your musical skills and knowledge. Here are some of the benefits of using gvox encore 5 x keygen mac:</p>
|
17 |
-
<p>gvox encore 5 x crack mac<br />
|
18 |
-
gvox encore 5 x serial number mac<br />
|
19 |
-
gvox encore 5 x activation code mac<br />
|
20 |
-
gvox encore 5 x license key mac<br />
|
21 |
-
gvox encore 5 x patch mac<br />
|
22 |
-
gvox encore 5 x full version mac<br />
|
23 |
-
gvox encore 5 x download mac<br />
|
24 |
-
gvox encore 5 x free mac<br />
|
25 |
-
gvox encore 5 x torrent mac<br />
|
26 |
-
gvox encore 5 x rar mac<br />
|
27 |
-
gvox encore 5 x zip mac<br />
|
28 |
-
gvox encore 5 x dmg mac<br />
|
29 |
-
gvox encore 5 x iso mac<br />
|
30 |
-
gvox encore 5 x music notation software mac<br />
|
31 |
-
gvox encore 5 x music composition software mac<br />
|
32 |
-
gvox encore 5 x music editing software mac<br />
|
33 |
-
gvox encore 5 x music scoring software mac<br />
|
34 |
-
gvox encore 5 x music transcription software mac<br />
|
35 |
-
gvox encore 5 x midi software mac<br />
|
36 |
-
gvox encore 5 x guitar tablature software mac<br />
|
37 |
-
gvox encore 5 x piano roll software mac<br />
|
38 |
-
gvox encore 5 x sheet music software mac<br />
|
39 |
-
gvox encore 5 x musical symbols software mac<br />
|
40 |
-
gvox encore 5 x lyrics software mac<br />
|
41 |
-
gvox encore 5 x chord symbols software mac<br />
|
42 |
-
gvox encore 5 x guitar fretboard software mac<br />
|
43 |
-
gvox encore 5 x playback software mac<br />
|
44 |
-
gvox encore 5 x print software mac<br />
|
45 |
-
gvox encore 5 x export software mac<br />
|
46 |
-
gvox encore 5 x import software mac<br />
|
47 |
-
gvox encore 5 x pdf software mac<br />
|
48 |
-
gvox encore 5 x xml software mac<br />
|
49 |
-
gvox encore 5 x midi file software mac<br />
|
50 |
-
gvox encore 5 x wav file software mac<br />
|
51 |
-
gvox encore 5 x mp3 file software mac<br />
|
52 |
-
gvox encore 5 x aiff file software mac<br />
|
53 |
-
gvox encore 5 x ogg file software mac<br />
|
54 |
-
gvox encore 5 x flac file software mac<br />
|
55 |
-
gvox encore 5 x m4a file software mac<br />
|
56 |
-
gvox encore 5 x wma file software mac<br />
|
57 |
-
gvox encore 5 x video file software mac<br />
|
58 |
-
gvox encore 5 x mov file software mac<br />
|
59 |
-
gvox encore 5 x mp4 file software mac<br />
|
60 |
-
gvox encore 5 x avi file software mac<br />
|
61 |
-
gvox encore 5 x wmv file software mac<br />
|
62 |
-
gvox encore 5 x flv file software mac<br />
|
63 |
-
gvox encore 5 x mkv file software mac<br />
|
64 |
-
gvox encore 5 x webm file software mac<br />
|
65 |
-
how to install gvox encore 5 x on mac</p>
|
66 |
-
<ul>
|
67 |
-
<li>You can learn how to write music in different styles and genres by using the templates and examples provided by the software.</li>
|
68 |
-
<li>You can practice your sight-reading skills by playing back the scores you create or import.</li>
|
69 |
-
<li>You can develop your ear training skills by transcribing music from audio files or MIDI devices.</li>
|
70 |
-
<li>You can enhance your creativity and expression by experimenting with different sounds and effects.</li>
|
71 |
-
<li>You can share your music with others by printing or exporting your scores in various formats.</li>
|
72 |
-
</ul>
|
73 |
-
<h2>How to download and install gvox encore 5 x keygen mac?</h2>
|
74 |
-
<p>To download and install gvox encore 5 x keygen mac on your Mac, you need to follow these steps:</p>
|
75 |
-
<ol>
|
76 |
-
<li>Go to a reliable source that offers gvox encore 5 x keygen mac for free download. One of the sources that you can trust is <a href="https://en.freedownloadmanager.org/mac-users-choice/Gvox_Encore_5_Mac_Os_X_Full.html">FreeDownloadManager</a>, which provides safe and fast downloads of various software for Mac users.</li>
|
77 |
-
<li>Click on the download button and wait for the file to be downloaded on your Mac. The file size is about 68 MB.</li>
|
78 |
-
<li>Open the downloaded file and follow the instructions to install the software on your Mac. You will need to enter the serial number that comes with the file to activate the software.</li>
|
79 |
-
<li>Launch the software and enjoy creating and editing music scores with gvox encore 5 x keygen mac.</li>
|
80 |
-
</ol>
|
81 |
-
<h2>How to use gvox encore 5 x keygen mac?</h2>
|
82 |
-
<p>To use gvox encore 5 x keygen mac effectively, you need to know how to use its basic functions and tools. Here are some of the steps that you can follow:</p>
|
83 |
-
<ol>
|
84 |
-
<li>Create a new score by clicking on File > New or by pressing Command + N. You will be asked to choose a template or a blank score. You can also choose from different styles and genres of music.</li>
|
85 |
-
<li>Add notes by clicking on them from the note palette or by using keyboard shortcuts. You can also use a MIDI keyboard or device to input notes.</li>
|
86 |
-
<h2>How to use gvox encore 5 x keygen mac?</h2>
|
87 |
-
<p>To use gvox encore 5 x keygen mac effectively, you need to know how to use its basic functions and tools. Here are some of the steps that you can follow:</p>
|
88 |
-
<ol>
|
89 |
-
<li>Create a new score by clicking on File > New or by pressing Command + N. You will be asked to choose a template or a blank score. You can also choose from different styles and genres of music.</li>
|
90 |
-
<li>Add notes by clicking on them from the note palette or by using keyboard shortcuts. You can also use a MIDI keyboard or device to input notes.</li>
|
91 |
-
<li>Edit notes by selecting them and using the edit palette or by double-clicking on them. You can change their pitch, duration, stem direction, voice number, etc.</li>
|
92 |
-
<li>Add other musical symbols by clicking on them from the symbol palette or by using keyboard shortcuts. You can add clefs, keys, time signatures, rests, chords, lyrics, dynamics, articulations, slurs, ties, beams, accidentals, grace notes, tuplets, repeats, endings, codas, segnos, etc.</li>
|
93 |
-
<li>Adjust the layout and spacing of your score by using the layout palette or by dragging and dropping the elements. You can also use the page view and the zoom options to see your score in different sizes and orientations.</li>
|
94 |
-
<li>Play back your score by clicking on the play button or by pressing the spacebar. You can also use the mixer and the synthesizer to adjust the volume, pan, reverb, chorus, and instrument sounds of your score.</li>
|
95 |
-
<li>Save your score by clicking on File > Save or by pressing Command + S. You can also save your score as a template for future use.</li>
|
96 |
-
</ol>
|
97 |
-
<h2>Tips and tricks for gvox encore 5 x keygen mac</h2>
|
98 |
-
<p>Gvox encore 5 x keygen mac is a software that has many features and options that can help you create and edit music scores more efficiently and creatively. Here are some tips and tricks that you can use to make the most out of gvox encore 5 x keygen mac:</p>
|
99 |
-
<ul>
|
100 |
-
<li>Use keyboard shortcuts to access the most common functions and tools quickly and easily. You can find a list of keyboard shortcuts in the online help or in the manual.</li>
|
101 |
-
<li>Use the quick input mode to enter notes faster and easier. You can activate this mode by pressing Q on your keyboard. In this mode, you can enter notes by typing their names (such as C, D#, F#, etc.) and their durations (such as 4 for quarter note, 8 for eighth note, etc.). You can also use the arrow keys to move the cursor and change the pitch of the notes.</li>
|
102 |
-
<li>Use the smart shape tool to draw various shapes on your score, such as slurs, ties, hairpins, trills, glissandos, etc. You can activate this tool by pressing S on your keyboard. In this tool, you can draw shapes by clicking and dragging on your score. You can also adjust the shape properties by double-clicking on them.</li>
|
103 |
-
<li>Use the lyrics tool to add lyrics to your score easily and accurately. You can activate this tool by pressing L on your keyboard. In this tool, you can type lyrics in a text box below your score. The software will automatically align the lyrics with the notes. You can also use hyphens (-) to indicate syllables and spaces to indicate words.</li>
|
104 |
-
<li>Use the transpose tool to transpose your score or a part of it to a different key or interval. You can activate this tool by clicking on Tools > Transpose or by pressing Command + T. In this tool, you can choose the transposition options such as key signature, interval, direction, etc.</li>
|
105 |
-
</ul>
|
106 |
-
<h2>Conclusion</h2>
|
107 |
-
<p>Gvox encore 5 x keygen mac is a software that can help you create and edit music scores easily and professionally on your Mac. It has many features and options that make it a powerful and versatile software for music notation and composition. You can download and install gvox encore 5 x keygen mac for free from a reliable source such as FreeDownloadManager. You can also learn how to use gvox encore 5 x keygen mac effectively by following the steps and tips provided in this article.</p>
|
108 |
-
<p>If you are interested in gvox encore 5 x keygen mac and want to try it out for yourself, you can download it from here: <a href="https://en.freedownloadmanager.org/mac-users-choice/Gvox_Encore_5_Mac_Os_X_Full.html">FreeDownloadManager</a>. You will need to enter the serial number that comes with the file to activate the software.</p>
|
109 |
-
<p>I hope you enjoyed reading this article and found it useful and informative. If you have any questions or feedback about gvox encore 5 x keygen mac or this article, please feel free to leave a comment below. I would love to hear from you!</p>
|
110 |
-
<h2>FAQs</h2>
|
111 |
-
<p>Here are some of the frequently asked questions about gvox encore 5 x keygen mac:</p>
|
112 |
-
<ol>
|
113 |
-
<li>What are the system requirements for gvox encore 5 x keygen mac?</li>
|
114 |
-
<p>Gvox encore 5 x keygen mac requires Mac OS X 10.6 or later, Intel processor (Core 2 Duo recommended), 1 GB RAM (2 GB recommended), 200 MB hard disk space (1 GB recommended), MIDI interface (optional), sound card (optional), printer (optional).</p>
|
115 |
-
<li>Is gvox encore 5 x keygen mac compatible with other music software?</li>
|
116 |
-
<p>Gvox encore 5 x keygen mac is compatible with other music software that supports MIDI or MusicXML formats. You can import and export files in these formats using gvox encore 5 x keygen mac.</p>
|
117 |
-
<li>How can I get help or support for gvox encore 5 x keygen mac?</li>
|
118 |
-
<p>You can get help or support for gvox encore 5 x keygen mac by accessing the online help or tutorials within the software. You can also visit the official website of gvox at <a href="http://www.gvox.com/">http://www.gvox.com/</a> for more information and resources.</p>
|
119 |
-
<li>How can I update gvox encore 5 x keygen mac?</li>
|
120 |
-
<h2>FAQs</h2>
|
121 |
-
<p>Here are some of the frequently asked questions about gvox encore 5 x keygen mac:</p>
|
122 |
-
<ol>
|
123 |
-
<li>What are the system requirements for gvox encore 5 x keygen mac?</li>
|
124 |
-
<p>Gvox encore 5 x keygen mac requires Mac OS X 10.6 or later, Intel processor (Core 2 Duo recommended), 1 GB RAM (2 GB recommended), 200 MB hard disk space (1 GB recommended), MIDI interface (optional), sound card (optional), printer (optional).</p>
|
125 |
-
<li>Is gvox encore 5 x keygen mac compatible with other music software?</li>
|
126 |
-
<p>Gvox encore 5 x keygen mac is compatible with other music software that supports MIDI or MusicXML formats. You can import and export files in these formats using gvox encore 5 x keygen mac.</p>
|
127 |
-
<li>How can I get help or support for gvox encore 5 x keygen mac?</li>
|
128 |
-
<p>You can get help or support for gvox encore 5 x keygen mac by accessing the online help or tutorials within the software. You can also visit the official website of gvox at <a href="http://www.gvox.com/">http://www.gvox.com/</a> for more information and resources.</p>
|
129 |
-
<li>How can I update gvox encore 5 x keygen mac?</li>
|
130 |
-
<p>You can update gvox encore 5 x keygen mac by clicking on Help > Check for Updates within the software. You will be notified if there is a new version available and you can download and install it easily.</p>
|
131 |
-
<li>What are the advantages of gvox encore 5 x keygen mac over other music notation software?</li>
|
132 |
-
<p>Gvox encore 5 x keygen mac has some advantages over other music notation software, such as:</p>
|
133 |
-
<ul>
|
134 |
-
<li>It is easy to use and learn, especially for beginners and intermediate users.</li>
|
135 |
-
<li>It has a comprehensive and flexible scoring system that can handle any type of music notation.</li>
|
136 |
-
<li>It has a realistic and expressive MIDI and VSTi playback that can enhance your musical experience.</li>
|
137 |
-
<li>It has a fast and reliable download and installation process that does not require any additional software or hardware.</li>
|
138 |
-
<li>It has a free trial version that you can use for unlimited time without any limitations or restrictions.</li>
|
139 |
-
</ul>
|
140 |
-
</ol>
|
141 |
-
</p> 0a6ba089eb<br />
|
142 |
-
<br />
|
143 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1acneusushi/gradio-2dmoleculeeditor/data/Download Corel Knockout 2 Plug In for Adobe Photoshop 64 Bit Torrent for Free.md
DELETED
@@ -1,163 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Corel Knockout 2 Plug in for Adobe Photoshop 64 Bit Torrent</h1>
|
3 |
-
<p>If you are looking for a way to enhance your photo editing skills and create stunning images, you might be interested in Corel Knockout 2. This is a plug in for Adobe Photoshop that allows you to cut out complex objects from backgrounds with ease and precision. In this article, we will tell you everything you need to know about Corel Knockout 2, how to download it from a torrent site, and what are some alternatives to this plug in.</p>
|
4 |
-
<h2>What is Corel Knockout 2?</h2>
|
5 |
-
<p>Corel Knockout 2 is a plug in that works with Adobe Photoshop and other compatible software. It is designed to help you isolate and remove difficult objects from photos, such as hair, fur, smoke, glass, shadows, and more. With Corel Knockout 2, you can create realistic composites and collages without spending hours on manual masking and editing.</p>
|
6 |
-
<h2>Corel knockout 2 plug in for adobe photoshop 64 bit torrent</h2><br /><p><b><b>DOWNLOAD</b> ►►► <a href="https://byltly.com/2uKyws">https://byltly.com/2uKyws</a></b></p><br /><br />
|
7 |
-
<h3>A brief introduction to the plug in and its features</h3>
|
8 |
-
<p>Corel Knockout 2 was released in 2004 by Corel Corporation, a Canadian software company that specializes in graphics and productivity software. It is the successor of Corel KnockOut, which was launched in 1998. Corel Knockout 2 has several features that make it a powerful and versatile tool for photo editing, such as:</p>
|
9 |
-
<ul>
|
10 |
-
<li>It uses a patented technology called Ultimate Edge Detection, which analyzes the color, contrast, and shape of the pixels to create accurate masks.</li>
|
11 |
-
<li>It has a user-friendly interface that lets you adjust the settings and preview the results in real time.</li>
|
12 |
-
<li>It supports multiple layers and channels, which means you can work on different parts of the image separately and combine them later.</li>
|
13 |
-
<li>It has a variety of tools and brushes that let you refine the edges, add or subtract details, blend colors, and more.</li>
|
14 |
-
<li>It can handle large images and high-resolution files without compromising the quality or speed.</li>
|
15 |
-
</ul>
|
16 |
-
<h3>How to install and use Corel Knockout 2 with Adobe Photoshop</h3>
|
17 |
-
<p>To install and use Corel Knockout 2 with Adobe Photoshop, you need to follow these steps:</p>
|
18 |
-
<ol>
|
19 |
-
<li>Download the plug in file from a torrent site (we will explain how to do that later).</li>
|
20 |
-
<li>Extract the file using a software like WinRAR or 7-Zip.</li>
|
21 |
-
<li>Copy the file named "KnockOut_2.0_English.exe" to the plug ins folder of your Adobe Photoshop installation. For example, if you have Adobe Photoshop CS6 installed on your C drive, the path would be C:\Program Files\Adobe\Adobe Photoshop CS6\Plug-ins.</li>
|
22 |
-
<li>Launch Adobe Photoshop and open an image that you want to edit.</li>
|
23 |
-
<li>Select the layer that contains the object that you want to cut out.</li>
|
24 |
-
<li>Go to Filter > Corel > KnockOut 2.</li>
|
25 |
-
<li>A new window will open where you can see the image and the tools of Corel Knockout 2.</li>
|
26 |
-
<li>Select the tool that suits your needs. For example, if you want to cut out hair or fur, you can use the Hair Brush tool. If you want to cut out smoke or glass, you can use the Transparency Brush tool.</li>
|
27 |
-
<li>Draw over the object that you want to cut out. You can zoom in or out, change the brush size and hardness, and undo or redo your actions as needed.</li>
|
28 |
-
<li>When you are done, click OK. The plug in will create a new layer with the cut out object.</li>
|
29 |
-
<li>You can then move, resize, rotate, or transform the object as you wish. You can also apply other effects or adjustments to it.</li>
|
30 |
-
</ol>
|
31 |
-
<h3>Benefits of using Corel Knockout 2 for photo editing</h3>
|
32 |
-
<p>Using Corel Knockout 2 for photo editing can bring you many benefits, such as:</p>
|
33 |
-
<ul>
|
34 |
-
<li>You can save time and effort by cutting out complex objects with just a few clicks.</li>
|
35 |
-
<li>You can create realistic and professional-looking images by blending different elements seamlessly.</li>
|
36 |
-
<li>You can unleash your creativity and imagination by making unique composites and collages.</li>
|
37 |
-
<li>You can improve your skills and learn new techniques by experimenting with different tools and settings.</li>
|
38 |
-
</ul>
|
39 |
-
<h2>Why download Corel Knockout 2 from a torrent site?</h2>
|
40 |
-
<p>If you are wondering why you should download Corel Knockout 2 from a torrent site instead of buying it from the official website or another source, here are some reasons:</p>
|
41 |
-
<h3>The advantages of torrenting software</h3>
|
42 |
-
<p>Torrenting software is a way of downloading files from peer-to-peer networks, where users share their files with each other. Torrenting software has some advantages over other methods of downloading files, such as:</p>
|
43 |
-
<ul>
|
44 |
-
<li>It is fast and efficient. You can download large files quickly by connecting to multiple sources at once.</li>
|
45 |
-
<li>It is free and easy. You don't have to pay anything or register anywhere to download files from torrent sites. You just need a torrent client software like uTorrent or BitTorrent and a torrent file or magnet link for the file that you want to download.</li>
|
46 |
-
<li>It is flexible and convenient. You can pause or resume your downloads at any time. You can also choose which files or parts of files you want to download or not.</li>
|
47 |
-
</ul>
|
48 |
-
<h3>The risks and challenges of torrenting software</h3>
|
49 |
-
<p>Torrenting software also has some risks and challenges that you should be aware of before downloading files from torrent sites, such as:</p>
|
50 |
-
<ul>
|
51 |
-
<li>It is illegal and unethical. Downloading copyrighted software without permission or paying for it is against the law and violates the rights of the creators. You could face legal consequences or penalties if you get caught.</li>
|
52 |
-
<li>It is unsafe and risky. Downloading files from unknown sources could expose your computer to viruses, malware, spyware, or other harmful programs. You could also compromise your privacy or security by revealing your IP address or personal information to others.</li>
|
53 |
-
<li>It is unreliable and unpredictable. Downloading files from torrent sites depends on the availability and quality of the sources. You could encounter problems such as slow speeds, incomplete downloads, corrupted files, fake files, or dead links.</li>
|
54 |
-
</ul>
|
55 |
-
<h3>How to find and download a reliable and safe torrent file for Corel Knockout 2</h3>
|
56 |
-
<p>If you decide to download Corel Knockout 2 from a torrent site despite the risks and challenges involved, here are some tips on how to find and download a reliable and safe torrent file for it:</p>
|
57 |
-
<p>Corel knockout 2 plugin for photoshop 64 bit download<br />
|
58 |
-
How to install corel knockout 2 in adobe photoshop 64 bit<br />
|
59 |
-
Corel knockout 2 for photoshop 64 bit free download<br />
|
60 |
-
Corel knockout 2 compatible with adobe photoshop 64 bit<br />
|
61 |
-
Corel knockout 2 crack for photoshop 64 bit torrent<br />
|
62 |
-
Corel knockout 2 serial number for photoshop 64 bit<br />
|
63 |
-
Corel knockout 2 activation code for photoshop 64 bit<br />
|
64 |
-
Corel knockout 2 keygen for photoshop 64 bit torrent<br />
|
65 |
-
Corel knockout 2 full version for photoshop 64 bit torrent<br />
|
66 |
-
Corel knockout 2 patch for photoshop 64 bit torrent<br />
|
67 |
-
Corel knockout 2 license key for photoshop 64 bit<br />
|
68 |
-
Corel knockout 2 registration code for photoshop 64 bit<br />
|
69 |
-
Corel knockout 2 product key for photoshop 64 bit<br />
|
70 |
-
Corel knockout 2 update for photoshop 64 bit torrent<br />
|
71 |
-
Corel knockout 2 latest version for photoshop 64 bit torrent<br />
|
72 |
-
Corel knockout 2 review for photoshop 64 bit<br />
|
73 |
-
Corel knockout 2 tutorial for photoshop 64 bit<br />
|
74 |
-
Corel knockout 2 user guide for photoshop 64 bit<br />
|
75 |
-
Corel knockout 2 manual for photoshop 64 bit<br />
|
76 |
-
Corel knockout 2 features for photoshop 64 bit<br />
|
77 |
-
Corel knockout 2 benefits for photoshop 64 bit<br />
|
78 |
-
Corel knockout 2 advantages for photoshop 64 bit<br />
|
79 |
-
Corel knockout 2 disadvantages for photoshop 64 bit<br />
|
80 |
-
Corel knockout 2 alternatives for photoshop 64 bit<br />
|
81 |
-
Corel knockout 2 comparison for photoshop 64 bit<br />
|
82 |
-
Corel knockout 2 vs other plugins for photoshop 64 bit<br />
|
83 |
-
Corel knockout 2 best settings for photoshop 64 bit<br />
|
84 |
-
Corel knockout 2 tips and tricks for photoshop 64 bit<br />
|
85 |
-
Corel knockout 2 troubleshooting for photoshop 64 bit<br />
|
86 |
-
Corel knockout 2 support for photoshop 64 bit<br />
|
87 |
-
Corel knockout 2 customer service for photoshop 64 bit<br />
|
88 |
-
Corel knockout 2 refund policy for photoshop 64 bit<br />
|
89 |
-
Corel knockout 2 price for photoshop 64 bit<br />
|
90 |
-
Corel knockout 2 discount code for photoshop 64 bit<br />
|
91 |
-
Corel knockout<br />
|
92 |
-
Corel knockout<br />
|
93 |
-
Corel knockout<br />
|
94 |
-
Corel knockout</p>
|
95 |
-
<ul>
|
96 |
-
<li>Use a reputable torrent site. There are many torrent sites on the internet, but not all of them are trustworthy or reliable. Some of them may contain malicious ads, pop-ups, viruses, or fake files. To avoid these problems, use a reputable torrent site that has good reviews, ratings, comments, feedbacks from users. Some examples of reputable torrent sites are The Pirate Bay (thepiratebay.org), RARBG (rarbg.to), Kickass Torrents (katcr.co), etc.</li>
|
97 |
-
<li>Use a VPN service. A VPN service is a tool that encrypts your internet traffic and hides your IP address from others. This way, you can protect your privacy and security while downloading files from torrent sites. You can also bypass geo-restrictions or censorship that may prevent you from accessing certain torrent sites or files. Some examples of VPN services are NordVPN (nordvpn.com), ExpressVPN (expressvpn.com), CyberGhost (cyberghostvpn.com), etc.</li>
|
98 |
-
<li>Use an antivirus software. An antivirus software is a tool that scans your computer for viruses, malware, spyware, or other harmful programs. This way, that you download from torrent sites. You can also remove or quarantine any suspicious files that you find. Some examples of antivirus software are Avast (avast.com), AVG (avg.com), Kaspersky (kaspersky.com), etc.</li>
|
99 |
-
<li>Check the file details and comments. Before downloading a torrent file, you should check its details and comments to make sure that it is what you are looking for. You should look for information such as the file name, size, format, quality, seeders, leechers, date, etc. You should also read the comments from other users who have downloaded the file to see if they have any feedback, reviews, warnings, or suggestions about it.</li>
|
100 |
-
<li>Download and verify the file. After finding a reliable and safe torrent file for Corel Knockout 2, you can download it using your torrent client software. You should choose a folder where you want to save the file and wait for the download to finish. After the download is complete, you should verify the file by opening it and checking if it works properly. You should also scan it with your antivirus software to make sure that it is clean and safe.</li>
|
101 |
-
</ul>
|
102 |
-
<h2>Alternatives to Corel Knockout 2 plug in for Adobe Photoshop</h2>
|
103 |
-
<p>If you are not satisfied with Corel Knockout 2 or you cannot download it from a torrent site for some reason, you might want to consider some alternatives to this plug in. There are many other plug ins, software, tools, and services that can help you cut out complex objects from photos with ease and precision. Here are some of them:</p>
|
104 |
-
<h3>Other plug ins that offer similar or better functionality than Corel Knockout 2</h3>
|
105 |
-
<p>There are many other plug ins that work with Adobe Photoshop or other compatible software that can offer similar or better functionality than Corel Knockout 2. Some of them are:</p>
|
106 |
-
<ul>
|
107 |
-
<li>Fluid Mask 3 (fluidmask.com). This is a plug in that uses advanced edge blending and color matching techniques to create realistic masks and cut outs.</li>
|
108 |
-
<li>Topaz Mask AI (topazlabs.com/mask-ai). This is a plug in that uses artificial intelligence and machine learning to create accurate and natural masks and cut outs.</li>
|
109 |
-
<li>AKVIS SmartMask (akvis.com/en/smartmask). This is a plug in that uses intelligent selection tools and algorithms to create precise masks and cut outs.</li>
|
110 |
-
</ul>
|
111 |
-
<h3>Free and open source software that can replace Corel Knockout 2</h3>
|
112 |
-
<p>If you don't want to spend money on buying or downloading plug ins for photo editing, you can use free and open source software that can replace Corel Knockout 2. Some of them are:</p>
|
113 |
-
<ul>
|
114 |
-
<li>GIMP (gimp.org). This is a free and open source image editor that has many features and tools for photo editing, including masking and cutting out objects.</li>
|
115 |
-
<li>Krita (krita.org). This is a free and open source painting and illustration software that has many features and tools for photo editing, including masking and cutting out objects.</li>
|
116 |
-
<li>Inkscape (inkscape.org). This is a free and open source vector graphics editor that has many features and tools for photo editing, including masking and cutting out objects.</li>
|
117 |
-
</ul>
|
118 |
-
<h3>Online tools and services that can perform the same tasks as Corel Knockout 2</h3>
|
119 |
-
<p>If you don't want to install any software or plug ins on your computer for photo editing, you can use online tools and services that can perform the same tasks as Corel Knockout 2. Some of them are:</p>
|
120 |
-
<ul>
|
121 |
-
<li>Remove.bg (remove.bg). This is an online service that uses artificial intelligence to automatically remove backgrounds from photos.</li>
|
122 |
-
<li>Clipping Magic (clippingmagic.com). This is an online service that uses advanced algorithms to easily remove backgrounds from photos.</li>
|
123 |
-
<li>PhotoScissors (photoscissors.com). This is an online tool that uses smart algorithms to quickly remove backgrounds from photos.</li>
|
124 |
-
</ul>
|
125 |
-
<h2>Conclusion</h2>
|
126 |
-
<p>In conclusion, Corel Knockout 2 is a plug in for Adobe Photoshop that allows you to cut out complex objects from backgrounds with ease and precision. It has many features and benefits that make it a powerful and versatile tool for photo editing. However, it also has some drawbacks and challenges that may prevent you from downloading it from a torrent site or using it effectively. Therefore, you might want to consider some alternatives to this plug in that can offer similar or better functionality or convenience.</p>
|
127 |
-
<h3>A summary of the main points of the article</h3>
|
128 |
-
<p>To summarize, here are the main points of the article:</p>
|
129 |
-
<ul>
|
130 |
-
<li>Corel Knockout 2 is a plug in for Adobe Photoshop that allows you to cut out complex objects from backgrounds with ease and precision.</li>
|
131 |
-
<li>You can download Corel Knockout 2 from a torrent site, but you should be aware of the advantages, risks, and challenges of torrenting software.</li>
|
132 |
-
<li>You can also use other plug ins, software, tools, or services that can perform the same tasks as Corel Knockout 2 or offer similar or better functionality or convenience.</li>
|
133 |
-
</ul>
|
134 |
-
<h3>A call to action for the readers</h3>
|
135 |
-
<p>We hope that this article has helped you learn more about Corel Knockout 2 and its alternatives. If you have any questions or comments about this topic, please feel free to share them with us below. If you liked this article, please share it with your friends or colleagues who might be interested in photo editing. Thank you for reading!</p>
|
136 |
-
<h4>Frequently Asked Questions</h4>
|
137 |
-
<p>Here are some frequently asked questions about Corel Knockout 2 and its alternatives:</p>
|
138 |
-
<ol>
|
139 |
-
<li><b>Is Corel Knockout 2 compatible with Adobe Photoshop CC?</b><br/>
|
140 |
-
Yes, Corel Knockout 2 is compatible with Adobe Photoshop CC and other versions of Adobe Photoshop. However, you may need to copy the plug in file to a different folder depending on your version of Adobe Photoshop. For example, if you have Adobe Photoshop CC 2019 installed on your C drive, the path would be C:\Program Files\Common Files\Adobe\Plug-Ins\CC\KnockOut_2.0_English.exe.</li>
|
141 |
-
<li><b>Is Corel Knockout 2 still supported by Corel Corporation?</b><br/>
|
142 |
-
No, Corel Knockout 2 is no longer supported by Corel Corporation since 2004. It is also no longer available for purchase or download from the official website or other sources. That is why some users may resort to downloading it from torrent sites.</li>
|
143 |
-
<li><b>What are some other photo editing software or plug ins by Corel Corporation?</b><br/>
|
144 |
-
Corel Corporation has many other photo editing software or plug ins that you can use for different purposes. Some of them are:</p>
|
145 |
-
<ul>
|
146 |
-
<li>Corel PaintShop Pro (paintshoppro.com). This is a comprehensive photo editing software that offers professional-level tools and features for photo editing, graphic design, digital art, etc.</li>
|
147 |
-
<li>Corel PhotoMirage (photomirage.io). This is a photo animation software that lets you create stunning animations from still photos.</li>
|
148 |
-
<li>Corel AfterShot Pro (aftershotpro.com). This is a raw photo editing software that lets you edit, organize, and manage your raw photos with speed and efficiency.</li></ul></li>
|
149 |
-
<li><b>How can I learn how to use Corel Knockout 2 or its alternatives?</b><br/>
|
150 |
-
There are many ways to learn how to use Corel Knockout 2 or its alternatives for photo editing. Some of them are:</p>
|
151 |
-
<ul>
|
152 |
-
<li>Watch online tutorials or videos that show you how to use the software or plug in step by step.</li>
|
153 |
-
<li>Read online guides or articles that explain how to use the software or plug in with tips and tricks.</li>
|
154 |
-
<li>Join online forums or communities where you can ask questions or get advice from other users who have experience with the software or plug in.</li></ul></li>
|
155 |
-
<li><b>What are some examples of images that I can create with Corel Knockout 2 or its alternatives?</b><br/>
|
156 |
-
You can create many kinds of images with Corel Knockout 2 or its alternatives depending on your creativity and imagination. Some examples are:</p>
|
157 |
-
<ul>
|
158 |
-
<li>You can create portraits with different backgrounds by cutting out faces from photos.</li>
|
159 |
-
<li>You can create fantasy scenes by combining different elements from photos such as animals, landscapes, objects, etc.</li>
|
160 |
-
<li>You can create artistic collages by mixing different textures, colors, shapes, etc. from photos.</li></ul></li></ol>
|
161 |
-
</p> 0a6ba089eb<br />
|
162 |
-
<br />
|
163 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1acneusushi/gradio-2dmoleculeeditor/data/Download NBA 14 on PC Requirements Steps and Tips.md
DELETED
@@ -1,34 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>NBA 14 Download PC: How to Get the Latest Version of the Basketball Game</h1>
|
3 |
-
<p>NBA 14 is the newest installment of the popular basketball video game series developed by EA Sports. It features improved graphics, gameplay, modes, and rosters, as well as new features such as the Ultimate Team and the MyCareer mode. NBA 14 is available for various platforms, including PC, PlayStation 4, Xbox One, Nintendo Switch, and mobile devices.</p>
|
4 |
-
<p>If you are a PC gamer and want to enjoy NBA 14 on your computer, you may be wondering how to download and install the game. In this article, we will show you the steps and requirements to get NBA 14 on your PC.</p>
|
5 |
-
<h2>nba 14 download pc</h2><br /><p><b><b>Download</b> 🌟 <a href="https://byltly.com/2uKxfm">https://byltly.com/2uKxfm</a></b></p><br /><br />
|
6 |
-
<h2>Requirements for NBA 14 Download PC</h2>
|
7 |
-
<p>Before you download and install NBA 14 on your PC, you need to make sure that your computer meets the minimum or recommended system requirements for the game. Here are the specifications for NBA 14 download PC:</p>
|
8 |
-
<table>
|
9 |
-
<tr><th>Minimum Requirements</th><th>Recommended Requirements</th></tr>
|
10 |
-
<tr><td>OS: Windows 7/8/10 (64-bit)</td><td>OS: Windows 10 (64-bit)</td></tr>
|
11 |
-
<tr><td>CPU: Intel Core i3-2100 or AMD FX-4100</td><td>CPU: Intel Core i5-4670 or AMD FX-8350</td></tr>
|
12 |
-
<tr><td>RAM: 4 GB</td><td>RAM: 8 GB</td></tr>
|
13 |
-
<tr><td>GPU: NVIDIA GeForce GTX 650 or AMD Radeon HD 7770</td><td>GPU: NVIDIA GeForce GTX 970 or AMD Radeon R9 290X</td></tr>
|
14 |
-
<tr><td>DirectX: Version 11</td><td>DirectX: Version 12</td></tr>
|
15 |
-
<tr><td>Storage: 80 GB available space</td><td>Storage: 80 GB available space</td></tr>
|
16 |
-
<tr><td>Sound Card: DirectX compatible</td><td>Sound Card: DirectX compatible</td></tr>
|
17 |
-
<tr><td>Internet Connection: Broadband (for online features)</td><td>Internet Connection: Broadband (for online features)</td></tr>
|
18 |
-
</table>
|
19 |
-
<p>If your PC meets or exceeds these requirements, you can proceed to download and install NBA 14 on your PC.</p>
|
20 |
-
<h2>Steps for NBA 14 Download PC</h2>
|
21 |
-
<p>To download and install NBA 14 on your PC, you need to follow these steps:</p>
|
22 |
-
<ol>
|
23 |
-
<li>Purchase NBA 14 from the official website or a trusted online retailer. You will receive a digital code or a physical disc for the game.</li>
|
24 |
-
<li>If you have a digital code, redeem it on the EA Desktop app or the Origin client. You will need to create or log in to your EA account to do so. If you have a physical disc, insert it into your PC's DVD drive and follow the instructions.</li>
|
25 |
-
<li>Download and install NBA 14 on your PC. The game will automatically start downloading and installing once you redeem your code or insert your disc. You can check the progress and manage the settings on the EA Desktop app or the Origin client.</li>
|
26 |
-
<li>Launch NBA 14 on your PC. Once the game is installed, you can launch it from the EA Desktop app or the Origin client. You may need to activate the game online before playing it for the first time.</li>
|
27 |
-
<li>Enjoy NBA 14 on your PC. You can now play NBA 14 on your PC and experience the thrilling basketball action. You can also access various online features such as multiplayer modes, leaderboards, tournaments, etc.</li>
|
28 |
-
</ol>
|
29 |
-
<h2>Conclusion</h2>
|
30 |
-
<p>NBA 14 is a great basketball game that you can play on your PC. To download and install NBA 14 on your PC, you need to purchase the game, redeem your code or insert your disc, download and install the game, launch it, and enjoy it. You also need to make sure that your PC meets the system requirements for the game.</p>
|
31 |
-
<p>We hope this article has helped you with NBA 14 download PC. If you have any questions or issues with the game, you can contact EA support or visit their official website for more information.</p>
|
32 |
-
<p></p> ddb901b051<br />
|
33 |
-
<br />
|
34 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1acneusushi/gradio-2dmoleculeeditor/data/HD Online Player (download Pyaar Ka Punchnama 2 movie ) - Laugh out loud with the funniest movie of the year.md
DELETED
@@ -1,98 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>How to Download Pyaar Ka Punchnama 2 Movie Online</h1>
|
3 |
-
<p>If you are a fan of romantic comedy movies, you might have heard of <strong>Pyaar Ka Punchnama 2</strong>, a 2015 Hindi-language film that is a sequel to the 2011 hit <strong>Pyaar Ka Punchnama</strong>. The movie is directed by Luv Ranjan and stars Kartik Aaryan, Nushrat Bharucha, Sonnalli Seygall, Ishita Raj Sharma, Omkar Kapoor and Sunny Singh in the lead roles. The movie follows the lives of three bachelors who fall in love with three girls and face various problems in their relationships. The movie is known for its hilarious dialogues, witty humor and realistic portrayal of modern love. In this article, we will tell you more about the movie, its cast and crew, its reception and box office, and how you can download it online legally or illegally.</p>
|
4 |
-
<h2>HD Online Player (download Pyaar Ka Punchnama 2 movie )</h2><br /><p><b><b>DOWNLOAD</b> >>>>> <a href="https://byltly.com/2uKv2J">https://byltly.com/2uKv2J</a></b></p><br /><br />
|
5 |
-
<h2>What is Pyaar Ka Punchnama 2 Movie About?</h2>
|
6 |
-
<p>The movie revolves around three flatmates and best friends who fall in love with three different girls and experience changes in their lives. Anshul "Gogo" Sharma (Kartik Aaryan) falls for Ruchika "Chiku" Khanna (Nushrat Bharucha), a spoiled brat who is too close with her friend Sunny (Manvir Singh). Siddharth "Sid" Gandotra aka Chauka (Sunny Singh) falls for Supriya Agarwal (Sonnalli Seygall), a traditional girl who is afraid to tell her family about him. Tarun Thakur (Omkar Kapoor) falls for Kusum Singh (Ishita Raj Sharma), a career-oriented girl who is too stingy about money. The three men soon realize that their girlfriends are not what they seem to be and face various issues such as trust, commitment, compatibility and respect. The movie shows how the men cope with their love troubles and try to find happiness.</p>
|
7 |
-
<h2>Who are the Cast and Crew of Pyaar Ka Punchnama 2 Movie?</h2>
|
8 |
-
<p>The movie is directed by Luv Ranjan, who also co-wrote the screenplay and dialogues with Rahul Mody and Tarun Jain. Ranjan is known for his romantic comedy movies such as <strong>Pyaar Ka Punchnama</strong>, <strong>Sonu Ke Titu Ki Sweety</strong> and <strong>De De Pyaar De</strong>. He has also produced movies such as <strong>Jai Mummy Di</strong> and <strong>Malang</strong>.</p>
|
9 |
-
<p>The movie features a talented ensemble of actors who have delivered memorable performances. Kartik Aaryan plays Gogo, the leader of the group who falls for Chiku, a manipulative girl who takes him for granted. Aaryan is one of the most popular actors in Bollywood today, who has starred in movies such as <strong>Luka Chuppi</strong>, <strong>Pati Patni Aur Woh</strong> and <strong>Dhamaka</strong>. Nushrat Bharucha plays Chiku, a selfish girl who uses Gogo for her own benefits. Bharucha is known for her roles in movies such as <strong>Dream Girl</strong>, <strong>Chhalaang</strong> and <strong>Ajay Devgn FFilms Production's next untitled film</strong>. Sonnalli Seygall plays Supriya, a sweet girl who loves Sid but fears her family's disapproval. Seygall has appeared in movies such as <strong>Wedding Pullav</strong>, <strong>Jai Mummy Di</strong> and <strong>Boondi Raita</strong>. Ishita Raj Sharma plays Kusum, a smart girl who dates Tarun but is too careful about money. Sharma has acted in movies such as <strong>Mere Dad Ki Maruti</strong>, <strong>Yaariyan</strong> and <strong>Fukrey Returns</strong>. Omkar Kapoor plays Tarun, a successful businessman who falls for Kusum but gets frustrated by her money-mindedness. Kapoor has worked in movies such as <strong>Masoom</strong>, <strong>Judwaa 2</strong> and <strong>Ujda Chaman</strong>. Sunny Singh plays Sid aka Chauka, a loyal friend who falls for Supriya but gets annoyed by her family's interference. Singh has starred in movies such as <strong>Fukrey</strong>, <strong>Sonu Ke Titu Ki Sweety</strong> and <strong>Jai Mummy Di</strong>.</p>
|
10 |
-
<h2>What is the Reception and Box Office of Pyaar Ka Punchnama 2 Movie?</h2>
|
11 |
-
<p>The movie received mixed reviews from critics and audiences alike. Some praised the movie for its humor, dialogues and performances, while others criticized it for its misogyny, exaggeration and repetition. The movie has a rating of 7.3 out of 10 on IMDb, based on over 16 thousand user ratings. The movie also has a score of 62% on Rotten Tomatoes, based on 13 critic reviews.</p>
|
12 |
-
<p>The movie was a commercial success at the box office. It was made on a budget of ₹22 crore ($3 million) and earned ₹88.17 crore ($12 million) worldwide. It was one of the highest-grossing Bollywood movies of 2015. It also won four awards at various ceremonies, including Best Actor in a Comic Role for Kartik Aaryan at Zee Cine Awards.</p>
|
13 |
-
<h2>How to Download Pyaar Ka Punchnama 2 Movie Online?</h2>
|
14 |
-
<p>If you want to watch or download Pyaar Ka Punchnama 2 movie online, you have two options: legal or illegal. Let us explain both of them.</p>
|
15 |
-
<h3>Legal ways:</h3>
|
16 |
-
<p>The legal ways to watch or download Pyaar Ka Punchnama 2 movie online are through platforms or websites that have the rights to stream or distribute the movie. These platforms or websites usually charge a fee or require a subscription to access their content. Some examples of legal platforms or websites that offer Pyaar Ka Punchnama 2 movie online are:</p>
|
17 |
-
<ul>
|
18 |
-
<li><a href="https://www.jiocinema.com/movies/pyaar-ka-punchnama-2/3483671">JioCinema</a>: This is an online streaming service that offers a variety of movies, TV shows, music videos and more. You can watch Pyaar Ka Punchnama 2 movie online on JioCinema if you have a Jio SIM card or a JioFiber connection.</li>
|
19 |
-
<li><a href="https://www.netflix.com/in/title/81010915">Netflix</a>: This is one of the most popular online streaming services that offers a huge collection of movies, TV shows, documentaries and more. You can watch Pyaar Ka Punchnama 2 movie online on Netflix if you have a Netflix subscription.</li>
|
20 |
-
<li><a href="https://www.youtube.com/watch?v=0f4XZsYlQcA">YouTube Movies</a>: This is an online platform that allows you to rent or buy movies online. You can watch Pyaar Ka Punchnama 2 movie online on YouTube Movies if you pay a rental or purchase fee.</li>
|
21 |
-
Video</a>: This is another online streaming service that offers a wide range of movies, TV shows, originals and more. You can watch Pyaar Ka Punchnama 2 movie online on Amazon Prime Video if you have an Amazon Prime membership.</li>
|
22 |
-
</ul>
|
23 |
-
<h3>Illegal ways:</h3>
|
24 |
-
<p>The illegal ways to watch or download Pyaar Ka Punchnama 2 movie online are through platforms or websites that do not have the rights to stream or distribute the movie. These platforms or websites usually offer the movie for free or at a low cost, but they are violating the copyright laws and can be sued or shut down by the authorities. Some examples of illegal platforms or websites that offer Pyaar Ka Punchnama 2 movie online are:</p>
|
25 |
-
<ul>
|
26 |
-
<li><a href="https://www.filmyzilla.com.co/pyaar-ka-punchnama-2-2015-full-movie-download.html">Filmyzilla</a>: This is a notorious website that leaks movies online for free download. You can find Pyaar Ka Punchnama 2 movie on Filmyzilla in various formats and qualities, but you can also expose your device to malware and viruses.</li>
|
27 |
-
<li><a href="https://www.filmywap.com/movie/2790/download-full-movie-pyaar-ka-punchnama-2-2015-hd-dvdrip.html">Filmywap</a>: This is another website that uploads movies online for free download. You can download Pyaar Ka Punchnama 2 movie from Filmywap in different sizes and resolutions, but you can also face legal action and penalties for piracy.</li>
|
28 |
-
<li><a href="https://www.torrentfunk.com/torrent/14426454/pyaar-ka-punchnama-2.html">Torrentfunk</a>: This is a torrent site that allows users to share and download files using peer-to-peer technology. You can download Pyaar Ka Punchnama 2 movie from Torrentfunk using a torrent client, but you can also risk your privacy and security by sharing your IP address and data with strangers.</li>
|
29 |
-
</ul>
|
30 |
-
<p>We strongly advise you to avoid using illegal ways to watch or download Pyaar Ka Punchnama 2 movie online, as they are not only unethical but also dangerous. You should always respect the hard work of the filmmakers and actors and support them by watching or downloading the movie legally.</p>
|
31 |
-
<p>Watch Pyaar Ka Punchnama 2 full movie online in HD quality<br />
|
32 |
-
Pyaar Ka Punchnama 2 movie download free with HD Online Player<br />
|
33 |
-
How to stream Pyaar Ka Punchnama 2 online in HD without downloading<br />
|
34 |
-
Pyaar Ka Punchnama 2 full movie online streaming with HD Online Player<br />
|
35 |
-
Download Pyaar Ka Punchnama 2 movie in HD using Online Player<br />
|
36 |
-
Pyaar Ka Punchnama 2 movie online watch free HD quality with Online Player<br />
|
37 |
-
Best sites to download Pyaar Ka Punchnama 2 movie in HD for free<br />
|
38 |
-
Pyaar Ka Punchnama 2 full movie download in HD with subtitles<br />
|
39 |
-
Watch Pyaar Ka Punchnama 2 online free HD no sign up<br />
|
40 |
-
Pyaar Ka Punchnama 2 movie download link with HD Online Player<br />
|
41 |
-
Pyaar Ka Punchnama 2 full movie online HD with English subtitles<br />
|
42 |
-
Download Pyaar Ka Punchnama 2 movie in HD for free without registration<br />
|
43 |
-
Pyaar Ka Punchnama 2 movie online HD with Hindi audio<br />
|
44 |
-
Watch Pyaar Ka Punchnama 2 full movie in HD on YouTube<br />
|
45 |
-
Pyaar Ka Punchnama 2 movie download in HD for mobile<br />
|
46 |
-
Pyaar Ka Punchnama 2 full movie online watch in HD on Netflix<br />
|
47 |
-
Download Pyaar Ka Punchnama 2 movie in HD for PC<br />
|
48 |
-
Pyaar Ka Punchnama 2 movie online watch in HD on Amazon Prime Video<br />
|
49 |
-
Watch Pyaar Ka Punchnama 2 full movie in HD on Hotstar<br />
|
50 |
-
Pyaar Ka Punchnama 2 movie download in HD for laptop<br />
|
51 |
-
Pyaar Ka Punchnama 2 full movie online watch in HD on Zee5<br />
|
52 |
-
Download Pyaar Ka Punchnama 2 movie in HD for Mac<br />
|
53 |
-
Watch Pyaar Ka Punchnama 2 online in HD on SonyLIV<br />
|
54 |
-
Pyaar Ka Punchnama 2 movie download in HD for tablet<br />
|
55 |
-
Watch Pyaar Ka Punchnama 2 full movie in HD on MX Player<br />
|
56 |
-
Download Pyaar Ka Punchnama 2 movie in HD for smart TV<br />
|
57 |
-
Watch Pyaar Ka Punchnama 2 online in HD on Voot<br />
|
58 |
-
Pyaar Ka Punchnama 2 movie download in HD for Android<br />
|
59 |
-
Watch Pyaar Ka Punchnama 2 full movie in HD on JioCinema<br />
|
60 |
-
Download Pyaar Ka Punchnama 2 movie in HD for iOS<br />
|
61 |
-
Watch Pyaar Ka Punchnama 2 online in HD on Eros Now<br />
|
62 |
-
Pyaar Ka Punchnama 2 movie download in HD for Windows<br />
|
63 |
-
Watch Pyaar Ka Punchnama 2 full movie in HD on Hungama Play<br />
|
64 |
-
Download Pyaar Ka Punchnama 2 movie in HD for Linux<br />
|
65 |
-
Watch Pyaar Ka Punchnama 2 online in HD on AltBalaji<br />
|
66 |
-
Download Pyaar Ka Punchnama 2 movie in HD with torrent<br />
|
67 |
-
Watch Pyaar Ka Punchnama 2 full movie in HD on Disney+ Hotstar VIP<br />
|
68 |
-
Download Pyaar Ka Punchnama 2 movie in HD with magnet link<br />
|
69 |
-
Watch Pyaar Ka Punchnama 2 online in HD on Viu<br />
|
70 |
-
Download Pyaar Ka Punchnama 2 movie in HD with direct link<br />
|
71 |
-
Watch Pyaar Ka Punchnama 2 full movie in HD on Airtel Xstream<br />
|
72 |
-
Download Pyaar Ka Punchnama 2 movie in HD with Google Drive link<br />
|
73 |
-
Watch Pyaar Ka Punchnama 2 online in HD on Vodafone Play <br />
|
74 |
-
Download Pyaar Ka Punchnama 2 movie in HD with Dropbox link <br />
|
75 |
-
Watch Pyaar Ka Punchnama 2 full movie in HD on Idea Movies & TV <br />
|
76 |
-
Download Pyaar Ka Punchnama 2 movie in HD with OneDrive link <br />
|
77 |
-
Watch Pyaar Ka Punchnama 2 online in HD on BigFlix <br />
|
78 |
-
Download Pyaar Ka Punchnama 2 movie in HD with Mega link <br />
|
79 |
-
Watch Pyaar Ka Punchnama 2 full movie in HD on ShemarooMe</p>
|
80 |
-
<h2>Conclusion</h2>
|
81 |
-
<p>Pyaar Ka Punchnama 2 is a fun and entertaining movie that explores the challenges and complexities of modern relationships. The movie has a talented cast and crew, a hilarious script and dialogues, and a realistic plot. The movie has received mixed reviews from critics and audiences, but it has also been a commercial success and a cult favorite among the fans of romantic comedy genre. If you want to watch or download Pyaar Ka Punchnama 2 movie online, you can choose from various legal platforms or websites that offer the movie for streaming or downloading. However, you should avoid using illegal platforms or websites that offer the movie for free or at a low cost, as they are violating the copyright laws and can harm your device and data. We hope this article has given you some useful information about Pyaar Ka Punchnama 2 movie and how to download it online.</p>
|
82 |
-
<p>Now that you have read this article, why not watch the movie yourself and enjoy its humor and romance? You can find the movie on any of the legal platforms or websites mentioned above. Just remember to watch it legally and responsibly. Happy watching!</p>
|
83 |
-
<h3>FAQs</h3>
|
84 |
-
<ul>
|
85 |
-
<li><strong>Q: Is Pyaar Ka Punchnama 2 a sequel or a remake?</strong></li>
|
86 |
-
<li>A: Pyaar Ka Punchnama 2 is a sequel to the 2011 movie Pyaar Ka Punchnama, which was also directed by Luv Ranjan. The sequel has a different story and characters, but it follows the same theme and format as the original.</li>
|
87 |
-
<li><strong>Q: What is the meaning of Pyaar Ka Punchnama?</strong></li>
|
88 |
-
<li>A: Pyaar Ka Punchnama is a Hindi phrase that roughly translates to "case file of love". It implies that love is a complicated and troublesome affair that requires investigation and analysis.</li>
|
89 |
-
<li><strong>Q: What is the most famous dialogue of Pyaar Ka Punchnama 2?</strong></li>
|
90 |
-
<li>A: The most famous dialogue of Pyaar Ka Punchnama 2 is the monologue delivered by Kartik Aaryan's character Gogo, in which he rants about his girlfriend Chiku's behavior and attitude for over seven minutes. The monologue is considered to be one of the longest and funniest dialogues in Bollywood history.</li>
|
91 |
-
<li><strong>Q: Where was Pyaar Ka Punchnama 2 shot?</strong></li>
|
92 |
-
<li>A: Pyaar Ka Punchnama 2 was shot in various locations in India, such as Mumbai, Pune, Delhi and Noida. Some scenes were also shot in Bangkok, Thailand.</li>
|
93 |
-
<li><strong>Q: Who sang the songs of Pyaar Ka Punchnama 2?</strong></li>
|
94 |
-
<li>A: The songs of Pyaar Ka Punchnama 2 were composed by Hitesh Sonik, with guest composers Shaarib-Toshi. The singers who sang the songs were Dev Negi, Shipra Goyal, Mohit Chauhan, Hitesh Sonik, Toshi Sabri, Sharib Sabri, Benny Dayal, Shalmali Kholgade, Divya Kumar and Aditi Singh Sharma.</li>
|
95 |
-
</ul>
|
96 |
-
</p> 0a6ba089eb<br />
|
97 |
-
<br />
|
98 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1acneusushi/gradio-2dmoleculeeditor/data/HD Video Converter Factory Pro How to Convert Videos in 3 Easy Steps.md
DELETED
@@ -1,17 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>How to Get HD Video Converter Factory Pro Free Download</h1>
|
3 |
-
<p>If you are looking for a powerful and easy-to-use video converter software, you may have heard of HD Video Converter Factory Pro. This software can convert videos to various formats, such as MP4, AVI, MKV, MOV, WMV, etc. It can also compress videos without losing quality, download online videos, edit videos, and more.</p>
|
4 |
-
<p>However, HD Video Converter Factory Pro is not a free software. It costs $29.95 for a one-year license and $34.95 for a lifetime license. If you want to try it before buying it, you can download a free trial version from its official website. But the trial version has some limitations, such as watermarking output videos, converting only 5 minutes of each video file, and downloading only 5 videos per day.</p>
|
5 |
-
<h2>hd video converter factory pro crack free download</h2><br /><p><b><b>DOWNLOAD</b> <a href="https://byltly.com/2uKvNT">https://byltly.com/2uKvNT</a></b></p><br /><br />
|
6 |
-
<p>So, is there a way to get HD Video Converter Factory Pro free download without limitations? The answer is yes, but you need to be careful. There are some websites that claim to offer HD Video Converter Factory Pro free download with crack or license key. However, these websites are not trustworthy and may contain viruses, malware, or spyware that can harm your computer or steal your personal information. Moreover, using cracked software is illegal and unethical.</p>
|
7 |
-
<p>The best way to get HD Video Converter Factory Pro free download is to participate in its official giveaway events. The software developer often holds giveaway events on its website or social media platforms, such as Facebook and Twitter. During these events, you can get a free license key for HD Video Converter Factory Pro by following some simple steps, such as liking their page, sharing their post, or leaving a comment.</p>
|
8 |
-
<p>By participating in the giveaway events, you can get HD Video Converter Factory Pro free download legally and safely. You can enjoy all the features of the software without any limitations or risks. However, you need to be quick and lucky, as the giveaway events are time-limited and the number of license keys is limited.</p>
|
9 |
-
<p>If you miss the giveaway events or don't want to wait for them, you can also buy HD Video Converter Factory Pro at a discounted price. The software developer often offers discounts and coupons on its website or through its partners. You can save up to 50% off the original price by using these discounts and coupons.</p>
|
10 |
-
<p>HD Video Converter Factory Pro is a great video converter software that can meet your various video needs. Whether you want to get it for free or at a low price, you should always download it from its official website or trusted sources. Avoid downloading cracked software from unknown websites that may harm your computer or violate your rights.</p>
|
11 |
-
|
12 |
-
<p>Now that you know how to get HD Video Converter Factory Pro free download, you may wonder how to use it. Don't worry, the software is very user-friendly and has a clear interface. You can easily convert videos in three steps: add video files, choose output format and quality, and start conversion. You can also customize the output settings, such as resolution, bitrate, frame rate, aspect ratio, etc.</p>
|
13 |
-
<p>Besides converting videos, HD Video Converter Factory Pro also has other useful features. For example, you can use it to download online videos from YouTube, Vimeo, Facebook, and other popular sites. You can also use it to edit videos, such as cropping, trimming, rotating, adding effects, subtitles, and watermarks. Moreover, you can use it to make GIFs, record screen, extract audio from video, and more.</p>
|
14 |
-
<p>HD Video Converter Factory Pro is a versatile and powerful video converter software that can handle any video task you throw at it. It supports over 500 video and audio formats and devices. It can also convert videos at 50X faster speed with high quality. It is a must-have tool for video lovers.</p>
|
15 |
-
<p></p> ddb901b051<br />
|
16 |
-
<br />
|
17 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1gistliPinn/ChatGPT4/Examples/Bengali Movie Khiladi Download Movies [HOT].md
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
<h2>bengali movie khiladi download movies</h2><br /><p><b><b>Download Zip</b> ☆☆☆ <a href="https://imgfil.com/2uy1FT">https://imgfil.com/2uy1FT</a></b></p><br /><br />
|
2 |
-
<br />
|
3 |
-
Khiladi Full movie online with release date, trailer, cast and songs. Find out where to watch or stream this comedy movie in Bengali on DIgit Binge. Khiladi is a film starring Bengt Jansson that comes out on Thursday, April 25th. Bengt Jansson plays the role of Bengt, an eccentric guy who accidentally meets his cousin and his best friend on the street, as well as another friend. There are a lot of funny moments in the movie if you're willing to watch. And, of course, the film will be filled with songs. So if you are looking for music then this is what you are looking for. Bengt Jansson is well known for his role in Bangkok Hilton. 8a78ff9644<br />
|
4 |
-
<br />
|
5 |
-
<br />
|
6 |
-
<p></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1gistliPinn/ChatGPT4/Examples/Chou S Electrocardiografia En La Practica Clinica. Adulto Y Pedia Trica 6 Ed. [NEW].md
DELETED
@@ -1,88 +0,0 @@
|
|
1 |
-
<h2>Chou S Electrocardiografia En La Practica Clinica. Adulto Y Pedia Trica 6 Ed.</h2><br /><p><b><b>DOWNLOAD</b> → <a href="https://imgfil.com/2uxYpV">https://imgfil.com/2uxYpV</a></b></p><br /><br />
|
2 |
-
<br />
|
3 |
-
, 2012. Páginas 205-216. estudio clínico y cefalosporinarequire_relative '../../spec_helper'
|
4 |
-
|
5 |
-
require 'bigdecimal'
|
6 |
-
|
7 |
-
describe "BigDecimal#frozen?" do
|
8 |
-
|
9 |
-
it "returns true if the number of digits is more than 0" do
|
10 |
-
|
11 |
-
b = BigDecimal("123456789123456789123456789123456789")
|
12 |
-
|
13 |
-
b.frozen?.should be_true
|
14 |
-
|
15 |
-
b.frozen?.should be_false
|
16 |
-
|
17 |
-
end
|
18 |
-
|
19 |
-
end
|
20 |
-
|
21 |
-
describe "BigDecimal#freeze" do
|
22 |
-
|
23 |
-
it "returns the number with an infinite value" do
|
24 |
-
|
25 |
-
b = BigDecimal("0.123456789123456789123456789123456789")
|
26 |
-
|
27 |
-
b.freeze.should be_finite
|
28 |
-
|
29 |
-
describe "BigDecimal#freeze!" do
|
30 |
-
|
31 |
-
b.freeze!.should be_finite
|
32 |
-
|
33 |
-
n
|
34 |
-
|
35 |
-
e
|
36 |
-
|
37 |
-
a
|
38 |
-
|
39 |
-
r
|
40 |
-
|
41 |
-
s
|
42 |
-
|
43 |
-
t
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
i
|
48 |
-
|
49 |
-
g
|
50 |
-
|
51 |
-
?
|
52 |
-
|
53 |
-
1
|
54 |
-
|
55 |
-
W
|
56 |
-
|
57 |
-
h
|
58 |
-
|
59 |
-
8
|
60 |
-
|
61 |
-
4
|
62 |
-
|
63 |
-
9
|
64 |
-
|
65 |
-
3
|
66 |
-
|
67 |
-
o
|
68 |
-
|
69 |
-
p
|
70 |
-
|
71 |
-
f
|
72 |
-
|
73 |
-
/
|
74 |
-
|
75 |
-
,
|
76 |
-
|
77 |
-
2
|
78 |
-
|
79 |
-
6
|
80 |
-
|
81 |
-
q
|
82 |
-
|
83 |
-
u
|
84 |
-
|
85 |
-
5 4fefd39f24<br />
|
86 |
-
<br />
|
87 |
-
<br />
|
88 |
-
<p></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1gistliPinn/ChatGPT4/Examples/Daud Movie Download In Hindi 720p REPACK.md
DELETED
@@ -1,116 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Daud Movie Download In Hindi 720p: A Guide for Bollywood Fans</h1>
|
3 |
-
|
4 |
-
<p>If you are a fan of Bollywood movies, you might have heard of Daud, a 1997 action comedy thriller directed by Ram Gopal Varma and starring Sanjay Dutt, Urmila Matondkar, Paresh Rawal and Manoj Bajpayee. The movie is about Nandu, a petty thief who steals a mysterious package worth crores of rupees and gets chased by the police and the mafia. The twist is that the package contains a nuclear bomb that is set to explode.</p>
|
5 |
-
<h2>Daud Movie Download In Hindi 720p</h2><br /><p><b><b>Download File</b> ✔ <a href="https://imgfil.com/2uy0me">https://imgfil.com/2uy0me</a></b></p><br /><br />
|
6 |
-
|
7 |
-
<p>Daud was a box office flop when it was released, but it has gained a cult following over the years for its quirky humor, stylish direction and catchy music by A.R. Rahman. The movie is also known for its innovative use of sound effects and camera angles. If you want to watch this movie online or download it in Hindi 720p quality, here are some tips and tricks for you.</p>
|
8 |
-
|
9 |
-
<h2>How to Watch Daud Movie Online in Hindi 720p</h2>
|
10 |
-
|
11 |
-
<p>One of the easiest ways to watch Daud movie online in Hindi 720p is to use streaming platforms like YouTube or JioCinema. These platforms have the official rights to stream the movie online and offer high-quality video and audio. You can watch the movie for free on YouTube or with a subscription on JioCinema. Here are the steps to watch Daud movie online in Hindi 720p on these platforms:</p>
|
12 |
-
|
13 |
-
<ul>
|
14 |
-
<li>Go to YouTube or JioCinema website or app on your device.</li>
|
15 |
-
<li>Search for Daud movie in the search bar.</li>
|
16 |
-
<li>Select the movie from the search results and click on play.</li>
|
17 |
-
<li>Enjoy watching Daud movie online in Hindi 720p.</li>
|
18 |
-
</ul>
|
19 |
-
|
20 |
-
<p>Note: You might need a VPN service if you are accessing these platforms from outside India.</p>
|
21 |
-
<p></p>
|
22 |
-
|
23 |
-
<h2>How to Download Daud Movie in Hindi 720p</h2>
|
24 |
-
|
25 |
-
<p>If you want to download Daud movie in Hindi 720p and watch it offline, you will need to use some third-party websites or apps that offer free movie downloads. However, you should be careful while using these sources as they might contain malware, viruses or illegal content. You should also respect the copyrights of the movie makers and avoid piracy. Here are some steps to download Daud movie in Hindi 720p from these sources:</p>
|
26 |
-
|
27 |
-
<ul>
|
28 |
-
<li>Go to a website or app that offers free movie downloads like KatMovieHD.</li>
|
29 |
-
<li>Search for Daud movie in the search bar.</li>
|
30 |
-
<li>Select the movie from the search results and choose the download option.</li>
|
31 |
-
<li>Select the Hindi 720p quality and click on download.</li>
|
32 |
-
<li>Wait for the download to finish and transfer the file to your device.</li>
|
33 |
-
<li>Enjoy watching Daud movie offline in Hindi 720p.</li>
|
34 |
-
</ul>
|
35 |
-
|
36 |
-
<p>Note: You might need a VPN service if you are accessing these sources from outside India.</p>
|
37 |
-
|
38 |
-
<h2>Conclusion</h2>
|
39 |
-
|
40 |
-
<p>Daud is a fun and entertaining movie that deserves more recognition and appreciation. If you are looking for a way to watch or download this movie in Hindi 720p quality, you can follow the guide above and enjoy this Bollywood gem. However, you should also be aware of the risks and legal issues involved in using some of these sources and respect the rights of the movie makers. Happy watching!</p>
|
41 |
-
<h2>Why You Should Watch Daud Movie in Hindi 720p</h2>
|
42 |
-
|
43 |
-
<p>Daud is not just a movie, it is an experience. It is a movie that will make you laugh, thrill and surprise you with its twists and turns. It is a movie that showcases the talent and versatility of its actors, especially Sanjay Dutt and Urmila Matondkar, who play the lead roles of Nandu and Bhavani, two strangers who get involved in a dangerous adventure. It is a movie that has some of the best songs and music by A.R. Rahman, who won the Filmfare Award for Best Music Director for this movie. It is a movie that has some of the most innovative and creative direction by Ram Gopal Varma, who experiments with sound effects and camera angles to create a unique cinematic style.</p>
|
44 |
-
|
45 |
-
<p>If you want to watch Daud movie in Hindi 720p, you will not regret it. You will enjoy the high-quality video and audio that will enhance your viewing experience. You will also appreciate the details and nuances of the movie that might be missed in lower quality formats. You will get to see Daud in its full glory and splendor.</p>
|
46 |
-
|
47 |
-
<h2>What to Expect from Daud Movie in Hindi 720p</h2>
|
48 |
-
|
49 |
-
<p>Daud is a movie that will keep you on the edge of your seat from start to finish. It is a movie that has a lot of action, comedy and drama. It is a movie that has a lot of twists and turns that will keep you guessing till the end. It is a movie that has a lot of memorable scenes and dialogues that will make you laugh and cheer. It is a movie that has a lot of emotions and romance that will touch your heart.</p>
|
50 |
-
|
51 |
-
<p>When you watch Daud movie in Hindi 720p, you can expect to have a great time with your friends and family. You can expect to have a lot of fun and entertainment with this movie. You can expect to have a lot of satisfaction and enjoyment with this movie.</p>
|
52 |
-
<h2>What are the Benefits of Daud Movie Download in Hindi 720p</h2>
|
53 |
-
|
54 |
-
<p>Downloading Daud movie in Hindi 720p has many benefits for Bollywood fans. Here are some of them:</p>
|
55 |
-
|
56 |
-
<ul>
|
57 |
-
<li>You can watch the movie anytime and anywhere you want, without any internet connection or buffering issues.</li>
|
58 |
-
<li>You can save your data and bandwidth by downloading the movie once and watching it multiple times.</li>
|
59 |
-
<li>You can share the movie with your friends and family who might not have access to streaming platforms or websites.</li>
|
60 |
-
<li>You can enjoy the movie in high definition quality with clear sound and subtitles.</li>
|
61 |
-
<li>You can support the movie makers by downloading the movie from legal and authorized sources.</li>
|
62 |
-
</ul>
|
63 |
-
|
64 |
-
<h2>What are the Risks of Daud Movie Download in Hindi 720p</h2>
|
65 |
-
|
66 |
-
<p>Downloading Daud movie in Hindi 720p also has some risks that you should be aware of. Here are some of them:</p>
|
67 |
-
|
68 |
-
<ul>
|
69 |
-
<li>You might download malware, viruses or illegal content that can harm your device or compromise your privacy.</li>
|
70 |
-
<li>You might violate the copyrights of the movie makers and face legal consequences or penalties.</li>
|
71 |
-
<li>You might miss out on some features or updates that are available on streaming platforms or websites.</li>
|
72 |
-
<li>You might lose the movie file due to accidental deletion, corruption or damage.</li>
|
73 |
-
<li>You might not get the best quality or resolution of the movie that is available on streaming platforms or websites.</li>
|
74 |
-
</ul>
|
75 |
-
|
76 |
-
<h2>How to Choose the Best Source for Daud Movie Download in Hindi 720p</h2>
|
77 |
-
|
78 |
-
<p>There are many sources that offer Daud movie download in Hindi 720p, but not all of them are reliable, safe and legal. You should choose the best source that meets your needs and preferences. Here are some tips to choose the best source for Daud movie download in Hindi 720p:</p>
|
79 |
-
|
80 |
-
<ul>
|
81 |
-
<li>Check the reputation and reviews of the source before downloading the movie.</li>
|
82 |
-
<li>Check the quality and size of the movie file before downloading it.</li>
|
83 |
-
<li>Check the compatibility and security of the source with your device and operating system.</li>
|
84 |
-
<li>Check the availability and speed of the download link before downloading it.</li>
|
85 |
-
<li>Check the terms and conditions of the source before downloading it.</li>
|
86 |
-
</ul>
|
87 |
-
|
88 |
-
<p>Daud is a movie that you should not miss if you love Bollywood movies. It is a movie that will entertain you, thrill you and surprise you with its story, characters, music and direction. If you want to watch or download this movie in Hindi 720p quality, you can follow this guide and enjoy this Bollywood gem.</p>
|
89 |
-
<h2>What are the Reviews of Daud Movie in Hindi 720p</h2>
|
90 |
-
|
91 |
-
<p>Daud is a movie that has received mixed reviews from critics and audiences. Some have praised the movie for its humor, action and music, while others have criticized it for its plot, direction and editing. Here are some of the reviews of Daud movie in Hindi 720p:</p>
|
92 |
-
|
93 |
-
<ul>
|
94 |
-
<li>Rediff.com gave the movie 3 out of 5 stars and wrote, "Daud is a movie that defies logic and convention. It is a movie that is meant to be enjoyed and not analyzed. It is a movie that has some hilarious moments, some thrilling sequences and some catchy songs. It is a movie that showcases the chemistry and charisma of Sanjay Dutt and Urmila Matondkar."</li>
|
95 |
-
<li>The Times of India gave the movie 2.5 out of 5 stars and wrote, "Daud is a movie that tries to be a spoof of Bollywood masala movies, but ends up being a mess of genres and styles. It is a movie that has some potential, but suffers from poor execution and editing. It is a movie that has some good performances, but fails to create an impact."</li>
|
96 |
-
<li>IMDb gave the movie 6.1 out of 10 and wrote, "Daud is a movie that is not for everyone. It is a movie that is quirky, absurd and unpredictable. It is a movie that has some flaws, but also some merits. It is a movie that has some cult appeal, but also some hate."</li>
|
97 |
-
</ul>
|
98 |
-
|
99 |
-
<h2>What are the Alternatives to Daud Movie Download in Hindi 720p</h2>
|
100 |
-
|
101 |
-
<p>If you are not able to watch or download Daud movie in Hindi 720p, you can try some alternatives that are similar to this movie. Here are some of the alternatives to Daud movie download in Hindi 720p:</p>
|
102 |
-
|
103 |
-
<ul>
|
104 |
-
<li>Andaz Apna Apna (1994): A comedy movie starring Aamir Khan, Salman Khan, Raveena Tandon and Karisma Kapoor. The movie is about two slackers who compete to woo a rich heiress.</li>
|
105 |
-
<li>Munna Bhai M.B.B.S (2003): A comedy-drama movie starring Sanjay Dutt, Arshad Warsi, Gracy Singh and Boman Irani. The movie is about a gangster who pretends to be a doctor to impress his father.</li>
|
106 |
-
<li>Phir Hera Pheri (2006): A comedy-crime movie starring Akshay Kumar, Suniel Shetty, Paresh Rawal and Bipasha Basu. The movie is about three friends who get involved in a money-laundering scheme.</li>
|
107 |
-
</ul>
|
108 |
-
|
109 |
-
<p>Daud is a movie that you should watch if you love Bollywood movies. It is a movie that will make you laugh, thrill and surprise you with its story, characters, music and direction. If you want to watch or download this movie in Hindi 720p quality, you can follow this guide and enjoy this Bollywood gem.</p>
|
110 |
-
<h2>Conclusion</h2>
|
111 |
-
|
112 |
-
<p>Daud is a movie that deserves more recognition and appreciation. It is a movie that showcases the talent and versatility of its actors, especially Sanjay Dutt and Urmila Matondkar, who play the lead roles of Nandu and Bhavani, two strangers who get involved in a dangerous adventure. It is a movie that has some of the best songs and music by A.R. Rahman, who won the Filmfare Award for Best Music Director for this movie. It is a movie that has some of the most innovative and creative direction by Ram Gopal Varma, who experiments with sound effects and camera angles to create a unique cinematic style.</p>
|
113 |
-
|
114 |
-
<p>If you want to watch or download this movie in Hindi 720p quality, you can follow the guide above and enjoy this Bollywood gem. However, you should also be aware of the risks and legal issues involved in using some of these sources and respect the rights of the movie makers. Happy watching!</p> 3cee63e6c2<br />
|
115 |
-
<br />
|
116 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1gistliPinn/ChatGPT4/Examples/Delphi 2014.1 Keygen ( Activation 2014 Release 1 Cdp Ds150e Cdp Cars Trucks Vci ) 346https Scoutma [PATCHED].md
DELETED
@@ -1,8 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<p> xtreme gfx torrentmrsnsc.zip ebook xrst mac osx leaguk full <br> animals of the world and numbers for kids 4.39 md5 <br> triomf fm 2013 - crack full version with patch and serial no <br> movie torrent in 2019 of montreal 0 <br> linuxstudies - smart and simple.pdf <br> italian infernale s01e01.avi hdtv <br> sm-usb 007 driver download windows 7 <br> 2015 air force one trailer - hd <br> cheats full version <br> fse air max 2015 full torrent mulegon <br> the outpost s01e01.mp4 tv <br> anecdotes collection full download ( best mattress ).zip <br> www.soartiming.com v 1.2 codec torrent code <br> click here to download 2010 <br> selasa 09 desember 2013 <br> blogg affiliate account <br> sinar sip bursim 0.4 full iso <br> crack cloud security 130640158 <br></p>
|
3 |
-
<p>2d348ffcb6 saga solomontesulozalas.pdf <br> eye for an eye. 2011 pfack.txt <br> opal diablo 2 hack pc software serial activated.rar <br> star wars full movie download 720p high quality <br> sue us and get your money back, we are sorry..</p>
|
4 |
-
<h2>Delphi 2014.1 keygen ( activation 2014 release 1 cdp ds150e cdp cars trucks vci ) 346https: scoutma</h2><br /><p><b><b>DOWNLOAD</b> ⚹ <a href="https://imgfil.com/2uxXAv">https://imgfil.com/2uxXAv</a></b></p><br /><br />
|
5 |
-
<p>wes2g in the past, the mmo business model was centered around raiding the territories of others.world of warcraft - conquest of the black temple begins quest on blackwing lair (preview).<br /> adventure of pinocchio online game <br> aztec empire online game <br> downloading maps: map of japan <br> the road to valhalla 50 download free <br> <br> <br> <br> <br></p>
|
6 |
-
<p>the avatar: the game is a real-time strategy game developed by bluepoint games..<br /> www.terrafirmanya.com<br> windows 98<br> this is the apache ant api for java.<br /> in addition to the patch notes, the full list of changes can be found in the changelog file below.</p> 899543212b<br />
|
7 |
-
<br />
|
8 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1gistliPinn/ChatGPT4/Examples/Final Fantasy The Spirits Within 2001 1080p BrRip X264 YIFY.md
DELETED
@@ -1,11 +0,0 @@
|
|
1 |
-
|
2 |
-
<p>title: legend of galactic heroes re:fevered dreams the complete series blu-ray volume 1. region code: all. english. language: english. this is legend of galactic heroes - re:fevered dreams the complete series. </p>
|
3 |
-
<h2>Final Fantasy The Spirits Within 2001 1080p BrRip X264 YIFY</h2><br /><p><b><b>Download Zip</b> ►►►►► <a href="https://imgfil.com/2uxXOs">https://imgfil.com/2uxXOs</a></b></p><br /><br />
|
4 |
-
<p>final fantasy xv torrent final fantasy xv torrent - final fantasy xv (ps4). final fantasy xv (ps4). the gameplay is considerably more open, as the field is free to explore anytime you like.. 07/25/2016. final fantasy xv for playstation 4. </p>
|
5 |
-
<p>final fantasy xiii-2 5 gb bluray 720p/1080p x264-cm3.. final fantasy xiii-2 5 gb bluray 720p/1080p x264-cm3. the game broke some of the records of final fantasy x. there is a scene at the end after. final.fantasy.xiii.2.5.gb.bluray.720p.x264.flac</p>
|
6 |
-
<p>final fantasy x: the ultimate sin the ultimate final fantasy x. final fantasy x: the ultimate sin. the battle's been raging for three months, and only a scant fraction of x -battle units have made it through. as the three heroes -- tidus, yuna, and rikku -- make their way through the ranks of an enemy more powerful and cunning than ever, the future of the final fantasy x: the ultimate sin world hangs in the balance. </p>
|
7 |
-
<p></p>
|
8 |
-
<p>final fantasy x(ps2). story, final fantasy x(ps2). final fantasy x(ps2). the game takes place shortly after the events of final fantasy vii. some characters are present in this game such as: cloud, sephiroth, squall, reno, terra, tidus, yuna and barret.. final fantasy x. en 1080p, codex à 720p et a/v decodage à. china.</p>
|
9 |
-
<p>this is a tribute to the original 2001 fantasy movie that changed the way we watched movies. i was never a huge fan of ff when it was released, i wasn't able to resist the lure of the game. final fantasy: the spirits within 2001.. when the dark elves attempt to plunge the universe into darkness,. final fantasy: the spirits within (2001). with one click for free. subdl is the. </p> 899543212b<br />
|
10 |
-
<br />
|
11 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/ApkFab Safe What You Need to Know Before Downloading APKs.md
DELETED
@@ -1,112 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>Is ApkFab Safe? A Guide to Downloading APK Files</h1>
|
3 |
-
<p>If you are an Android user, you may have heard of apkfab, a website that offers thousands of APK files for free. APK files are the package files that contain the code and resources of Android apps. You can use them to install apps that are not available on Google Play Store, or to get older versions of apps that you prefer.</p>
|
4 |
-
<h2>apkfab safe</h2><br /><p><b><b>Download Zip</b> ○○○ <a href="https://urlin.us/2uSTOo">https://urlin.us/2uSTOo</a></b></p><br /><br />
|
5 |
-
<p>But is apkfab safe? How can you make sure that the APK files you download from it are not harmful to your device or your privacy? In this article, we will explain what apkfab is, how to check if it is safe, and what are the best practices for downloading APK files from any site.</p>
|
6 |
-
<h2>What is ApkFab and Why Download APK Files From It?</h2>
|
7 |
-
<p>ApkFab is a website that claims to provide "the best downloader for mod files". It has a large collection of APK files for various categories of apps, such as games, tools, entertainment, education, and more. You can browse the site by popularity, rating, genre, or update date. You can also search for specific apps by name or keyword.</p>
|
8 |
-
<p>Some of the reasons why you might want to download APK files from apkfab are:</p>
|
9 |
-
<ul>
|
10 |
-
<li>You want to access apps that are not available in your region or country.</li>
|
11 |
-
<li>You want to try out beta versions or unreleased apps that are not on Google Play Store.</li>
|
12 |
-
<li>You want to downgrade to an older version of an app that works better for you.</li>
|
13 |
-
<li>You want to customize your Android experience with modded apps that have extra features or unlocked content.</li>
|
14 |
-
</ul>
|
15 |
-
<p>However, downloading APK files from apkfab also comes with some risks. You may expose your device to malware, spyware, adware, or viruses that can damage your system or steal your data. You may also violate the intellectual property rights of the app developers or publishers by using modded, pirated, or paid apps without their permission. You may also compromise the security and stability of your device by installing apps that require excessive permissions or interfere with other apps.</p>
|
16 |
-
<p>Is apkfab safe to download apps from?<br />
|
17 |
-
How to install apk files from apkfab safely?<br />
|
18 |
-
Apkfab safe reddit - what do users say?<br />
|
19 |
-
Apkfab vs apkmirror - which one is safer?<br />
|
20 |
-
Apkfab safe alternative - where to find other reliable apk sites?<br />
|
21 |
-
Apkfab safety rating - how does it compare to other apk sources?<br />
|
22 |
-
Apkfab safe or not - how to check for malware or viruses?<br />
|
23 |
-
Apkfab safe reviews - what are the pros and cons of using it?<br />
|
24 |
-
Apkfab safe download - how to avoid fake or corrupted apk files?<br />
|
25 |
-
Apkfab safe mode - how to enable it for extra security?<br />
|
26 |
-
Is apkfab safe for android devices?<br />
|
27 |
-
How to uninstall apk files from apkfab safely?<br />
|
28 |
-
Apkfab safe verification - how does it work and why is it important?<br />
|
29 |
-
Apkfab vs apkpure - which one is safer and better?<br />
|
30 |
-
Apkfab safe update - how to get the latest version of apk files?<br />
|
31 |
-
Apkfab safe website - how to access it without any issues?<br />
|
32 |
-
Apkfab safe games - what are the best and most popular ones?<br />
|
33 |
-
Apkfab safe modded apps - are they legal and secure?<br />
|
34 |
-
Apkfab safe cracked apps - are they worth the risk and hassle?<br />
|
35 |
-
Apkfab safe premium apps - are they free and legit?<br />
|
36 |
-
Is apkfab safe for ios devices?<br />
|
37 |
-
How to backup apk files from apkfab safely?<br />
|
38 |
-
Apkfab safe certificate - what does it mean and how to get it?<br />
|
39 |
-
Apkfab vs aptoide - which one is safer and more user-friendly?<br />
|
40 |
-
Apkfab safe online - how to use it without any problems or errors?<br />
|
41 |
-
Apkfab safe app - how to download and install it on your device?<br />
|
42 |
-
Apkfab safe vpn - do you need one and which one is the best?<br />
|
43 |
-
Apkfab safe browser - which one is the most compatible and secure?<br />
|
44 |
-
Apkfab safe music apps - what are the best ones for streaming and downloading music?<br />
|
45 |
-
Apkfab safe video apps - what are the best ones for watching and downloading videos?<br />
|
46 |
-
Is apkfab safe for pc devices?<br />
|
47 |
-
How to transfer apk files from apkfab safely to your device?<br />
|
48 |
-
Apkfab safe sign up - how to create an account and why is it beneficial?<br />
|
49 |
-
Apkfab vs uptodown - which one is safer and more reliable?<br />
|
50 |
-
Apkfab safe offline - how to use it without internet connection or data usage?<br />
|
51 |
-
Apkfab safe launcher - how to customize your device with it and what are the features?<br />
|
52 |
-
Apkfab safe wallpaper apps - what are the best ones for changing your device's background?<br />
|
53 |
-
Apkfab safe emoji apps - what are the best ones for expressing your emotions and having fun?<br />
|
54 |
-
Apkfab safe keyboard apps - what are the best ones for typing faster and easier?<br />
|
55 |
-
Apkfab safe photo apps - what are the best ones for editing and sharing photos?<br />
|
56 |
-
Is apkfab safe for firestick devices?<br />
|
57 |
-
How to sideload apk files from apkfab safely on your device?<br />
|
58 |
-
Apkfab safe login - how to access your account and manage your settings?<br />
|
59 |
-
Apkfab vs mobogenie - which one is safer and more convenient?<br />
|
60 |
-
Apkfab safe streaming apps - what are the best ones for watching live tv and movies online?</p>
|
61 |
-
<h2>How to Check If ApkFab is Safe and What Are the Best Practices for Downloading APK Files From Any Site?</h2>
|
62 |
-
<p>To avoid these risks, you need to be careful and vigilant when downloading APK files from apkfab or any other site. Here are some tips on how to check if apkfab is safe and what are the best practices for downloading APK files from any site:</p>
|
63 |
-
<h3>Use a Reliable Antivirus App and Scan the APK Files Before Installing Them</h3>
|
64 |
-
<p>One of the most important steps to ensure your safety is to use a reliable antivirus app on your Android device and scan the APK files before installing them. This will help you detect and remove any malicious code or hidden threats that may harm your device or your privacy. You can use any reputable antivirus app that supports scanning APK files, such as Avast, Kaspersky, Bitdefender, or Malwarebytes.</p>
|
65 |
-
<h3>Check the Permissions and Reviews of the Apps You Download</h3>
|
66 |
-
<p>Another way to check if apkfab is safe is to check the permissions and reviews of the apps you download. Permissions are the access rights that an app requests from your device, such as camera, microphone, location, contacts, etc. You should only grant permissions that are necessary and relevant for the app's functionality. If an app asks for too many or suspicious permissions, it may be a sign of malicious intent. You can check and manage the permissions of your apps in your device's settings.</p>
|
67 |
-
<p>Reviews are the feedbacks and ratings that other users leave for an app. They can help you get an idea of the quality, performance, and reliability of an app. You can read the reviews of the apps you download from apkfab on the site itself or on other platforms, such as Google Play Store or Reddit. You should look for honest and unbiased reviews that mention the pros and cons of the app, as well as any issues or problems that may arise. You should avoid apps that have too many negative or fake reviews, as they may indicate poor quality or fraud.</p>
|
68 |
-
<h3>Avoid Modded, Pirated, or Paid Apps That May Contain Malware or Violate Intellectual Property Rights</h3>
|
69 |
-
<p>One of the main attractions of apkfab is that it offers modded, pirated, or paid apps for free. These are apps that have been modified, cracked, or unlocked to provide extra features or content that are normally not available or require payment. While these apps may seem tempting, they also pose a high risk of malware or legal issues. Modded, pirated, or paid apps may contain malware that can infect your device or steal your data. They may also violate the intellectual property rights of the app developers or publishers, who may take legal action against you for using their apps without their permission or compensation. You should avoid downloading these apps from apkfab or any other site, and instead support the original creators by purchasing their apps from official sources.</p>
|
70 |
-
<h3>Compare the Cryptographic Signatures and File Sizes of the APK Files With the Official Versions</h3>
|
71 |
-
<p>Another way to check if apkfab is safe is to compare the cryptographic signatures and file sizes of the APK files with the official versions. Cryptographic signatures are unique codes that are used to verify the authenticity and integrity of an app. They are generated by the app developers or publishers and attached to the APK files. If an APK file has been tampered with or altered in any way, its signature will not match the official one. You can use tools such as APK Signature Verification to check the signatures of the APK files you download from apkfab or any other site.</p>
|
72 |
-
<p>File sizes are another indicator of the safety and quality of an app. They are the amount of space that an app occupies on your device's storage. If an APK file has a significantly different file size than the official version, it may be a sign of malware or poor optimization. You can check the file sizes of the APK files you download from apkfab on the site itself or on other sources, such as Google Play Store or APKMirror.</p>
|
73 |
-
<h3>Use Alternative Sites That Are Verified and Trusted, Such as APKMirror or APKPure</h3>
|
74 |
-
<p>Finally, if you are not sure about apkfab's safety or reliability, you can use alternative sites that are verified and trusted by many users and experts. Some of these sites are APKMirror and APKPure. These are sites that offer a wide range of APK files for various apps, including beta versions, older versions, and region-locked versions. They also have strict security and quality standards, and only accept APK files that are signed by the original developers or publishers. They also scan the APK files for malware and viruses, and provide detailed information and reviews about them. You can use these sites to download APK files safely and easily.</p>
|
75 |
-
<h2>Conclusion: Is ApkFab Safe?</h2>
|
76 |
-
<p>In conclusion, apkfab is a website that offers thousands of APK files for free. You can use it to download apps that are not available on Google Play Store, or to get older versions or modded versions of apps. However, apkfab also comes with some risks, such as malware, spyware, adware, viruses, intellectual property violations, and security issues. To avoid these risks, you need to be careful and vigilant when downloading APK files from apkfab or any other site. You need to:</p>
|
77 |
-
<ul>
|
78 |
-
<li>Use a reliable antivirus app and scan the APK files before installing them</li>
|
79 |
-
<li>Check the permissions and reviews of the apps you download</li>
|
80 |
-
<li>Avoid modded, pirated, or paid apps that may contain malware or violate intellectual property rights</li>
|
81 |
-
<li>Compare the cryptographic signatures and file sizes of the APK files with the official versions</li>
|
82 |
-
<li>Use alternative sites that are verified and trusted, such as APKMirror or APKPure</li>
|
83 |
-
</ul>
|
84 |
-
<p>By following these tips, you can ensure your safety and enjoy your Android experience with apkfab.</p>
|
85 |
-
<h2>FAQs: ApkFab Safe</h2>
|
86 |
-
<p>Here are some common questions and answers about apkfab and APK files:</p>
|
87 |
-
<h4>What is an APK file?</h4>
|
88 |
-
<p>An APK file is a package file that contains the code and resources of an Android app. It is used to install apps on Android devices.</p>
|
89 |
-
<h4>How do I install an APK file?</h4>
|
90 |
-
<p>To install an APK file on your Android device, you need to enable unknown sources in your device's settings. Then you need to locate the APK file on your device's storage or download it from a website. Then you need to tap on the APK file and follow the instructions to install it.</p>
|
91 |
-
<h4>Is it illegal to download APK files?</h4>
|
92 |
-
<p>It depends on the source and the content of the APK files. If you download APK files from official sources, such as Google Play Store or the app developer's website, and they are free or you have paid for them, then it is legal. However, if you download APK files from unofficial sources, such as apkfab or other websites, and they are modded, pirated, or paid apps that you have not purchased, then it may be illegal. You may be violating the intellectual property rights of the app developers or publishers, who may take legal action against you.</p>
|
93 |
-
<h4>Are APK files safe?</h4>
|
94 |
-
<p>Not all APK files are safe. Some APK files may contain malware, spyware, adware, or viruses that can harm your device or your privacy. You need to be careful and vigilant when downloading APK files from any site, and follow the best practices we have mentioned above.</p>
|
95 |
-
<h4>What are the benefits of downloading APK files?</h4>
|
96 |
-
<p>Some of the benefits of downloading APK files are:</p>
|
97 |
-
<ul>
|
98 |
-
<li>You can access apps that are not available in your region or country.</li>
|
99 |
-
<li>You can try out beta versions or unreleased apps that are not on Google Play Store.</li>
|
100 |
-
<li>You can downgrade to an older version of an app that works better for you.</li>
|
101 |
-
<li>You can customize your Android experience with modded apps that have extra features or unlocked content.</li>
|
102 |
-
</ul>
|
103 |
-
<h4>What are the drawbacks of downloading APK files?</h4>
|
104 |
-
<p>Some of the drawbacks of downloading APK files are:</p>
|
105 |
-
<ul>
|
106 |
-
<li>You may expose your device to malware, spyware, adware, or viruses that can damage your system or steal your data.</li>
|
107 |
-
<li>You may violate the intellectual property rights of the app developers or publishers by using modded, pirated, or paid apps without their permission or compensation.</li>
|
108 |
-
<li>You may compromise the security and stability of your device by installing apps that require excessive permissions or interfere with other apps.</li>
|
109 |
-
<li>You may miss out on updates and bug fixes that are available on Google Play Store.</li>
|
110 |
-
</ul></p> 197e85843d<br />
|
111 |
-
<br />
|
112 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Download Emoji Quiz MOD APK and Challenge Your Friends.md
DELETED
@@ -1,123 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>Emoji Quiz Mod APK: A Fun and Challenging Game for Emoji Lovers</h1>
|
3 |
-
<p>If you are a fan of emojis, you might have heard of Emoji Quiz, a popular game that tests your knowledge of emojis and their meanings. Emoji Quiz is a fun and addictive game that challenges you to guess the word or phrase that is represented by a combination of emojis. You can play Emoji Quiz online or download it on your Android device for free. But what if you want to enjoy more features and benefits from this game? That's where Emoji Quiz Mod APK comes in. In this article, we will tell you everything you need to know about Emoji Quiz Mod APK, including what it is, how to download and install it, and what are its pros and cons.</p>
|
4 |
-
<h2>What is Emoji Quiz?</h2>
|
5 |
-
<p>Emoji Quiz is a game that was created by Mangoo Games, a developer that specializes in trivia and puzzle games. Emoji Quiz has over 1 million downloads on Google Play and has a rating of 4.4 out of 5 stars. The game has more than 500 levels, each with a different emoji puzzle to solve. The game covers various categories, such as movies, celebrities, brands, animals, countries, and more. You can also create your own levels and share them with your friends.</p>
|
6 |
-
<h2>emoji quiz mod apk</h2><br /><p><b><b>Download Zip</b> ❤ <a href="https://urlin.us/2uSRRa">https://urlin.us/2uSRRa</a></b></p><br /><br />
|
7 |
-
<h3>How to play Emoji Quiz</h3>
|
8 |
-
<p>The gameplay of Emoji Quiz is simple and intuitive. You just need to look at the emojis on the screen and try to figure out what they mean. For example, if you see an emoji of a dog and an emoji of a house, you might guess that the answer is "doghouse". You can type your answer using the letters provided below the emojis. If you get stuck, you can use hints or ask for help from your friends on social media. You can also earn coins by completing levels and use them to buy more hints or unlock new categories.</p>
|
9 |
-
<h3>Why Emoji Quiz is so popular</h3>
|
10 |
-
<p>Emoji Quiz is a game that appeals to many people because it is fun, challenging, and educational. It tests your logic, creativity, and vocabulary skills while also making you laugh and smile. It also helps you learn new things about different topics and cultures through emojis. Emojis are universal symbols that can convey emotions, ideas, and messages without words. They are widely used in social media, texting, and online communication. By playing Emoji Quiz, you can improve your emoji literacy and impress your friends with your emoji knowledge.</p>
|
11 |
-
<h2>What is Emoji Quiz Mod APK?</h2>
|
12 |
-
<p>Emoji Quiz Mod APK is a modified version of Emoji Quiz that gives you access to all the features and benefits of the game without spending money or watching ads. You don't need to unlock any levels or categories because they are all available for free. You also don't need to worry about running out of hints or coins because you have unlimited resources. You can enjoy playing Emoji Quiz without any interruptions or limitations.</p>
|
13 |
-
<p>emoji quiz mod apk download<br />
|
14 |
-
emoji quiz mod apk latest version<br />
|
15 |
-
emoji quiz mod apk unlocked<br />
|
16 |
-
emoji quiz mod apk free<br />
|
17 |
-
emoji quiz mod apk android<br />
|
18 |
-
emoji quiz mod apk 2023<br />
|
19 |
-
emoji quiz mod apk unlimited hints<br />
|
20 |
-
emoji quiz mod apk no ads<br />
|
21 |
-
emoji quiz mod apk offline<br />
|
22 |
-
emoji quiz mod apk hack<br />
|
23 |
-
emoji quiz premium mod apk<br />
|
24 |
-
emoji quiz pro mod apk<br />
|
25 |
-
emoji quiz plus mod apk<br />
|
26 |
-
emoji quiz ultimate mod apk<br />
|
27 |
-
emoji quiz trivia mod apk<br />
|
28 |
-
emoji quiz guess the word mod apk<br />
|
29 |
-
emoji quiz game mod apk<br />
|
30 |
-
emoji quiz fun games mod apk<br />
|
31 |
-
emoji quiz brain teasers mod apk<br />
|
32 |
-
emoji quiz puzzles mod apk<br />
|
33 |
-
download emoji quiz mod apk for android<br />
|
34 |
-
download emoji quiz mod apk latest update<br />
|
35 |
-
download emoji quiz mod apk unlocked all levels<br />
|
36 |
-
download emoji quiz mod apk free shopping<br />
|
37 |
-
download emoji quiz mod apk unlimited money<br />
|
38 |
-
how to install emoji quiz mod apk<br />
|
39 |
-
how to play emoji quiz mod apk<br />
|
40 |
-
how to get emoji quiz mod apk<br />
|
41 |
-
how to update emoji quiz mod apk<br />
|
42 |
-
how to hack emoji quiz mod apk<br />
|
43 |
-
best emoji quiz mod apk<br />
|
44 |
-
new emoji quiz mod apk<br />
|
45 |
-
old emoji quiz mod apk<br />
|
46 |
-
original emoji quiz mod apk<br />
|
47 |
-
safe emoji quiz mod apk<br />
|
48 |
-
secure emoji quiz mod apk<br />
|
49 |
-
virus free emoji quiz mod apk<br />
|
50 |
-
malware free emoji quiz mod apk<br />
|
51 |
-
ad free emoji quiz mod apk<br />
|
52 |
-
cheat free emoji quiz mod apk<br />
|
53 |
-
easy emoji quiz mod apk<br />
|
54 |
-
hard emoji quiz mod apk<br />
|
55 |
-
challenging emoji quiz mod apk<br />
|
56 |
-
addictive emoji quiz mod apk<br />
|
57 |
-
fun emoji quiz mod apk<br />
|
58 |
-
educational emoji quiz mod apk<br />
|
59 |
-
creative emoji quiz mod apk<br />
|
60 |
-
popular emoji quiz mod apk<br />
|
61 |
-
amazing emoji quiz mod apk</p>
|
62 |
-
<h3>Features of Emoji Quiz Mod APK</h3>
|
63 |
-
<p>Some of the features that you can enjoy from Emoji Quiz Mod APK are:</p>
|
64 |
-
<ul>
|
65 |
-
<li>All levels unlocked</li>
|
66 |
-
<li>All categories unlocked</li>
|
67 |
-
<li>No ads</li>
|
68 |
-
<li>Unlimited hints</li>
|
69 |
-
<li>Unlimited coins</li>
|
70 |
-
<li>No root required</li>
|
71 |
-
<li>Easy installation</li>
|
72 |
-
<li>Safe and secure</li>
|
73 |
-
</ul>
|
74 |
-
<h3>How to download and install Emoji Quiz Mod APK</h3>
|
75 |
-
<p>If you want to download and install Emoji Quiz Mod APK on your Android device, you need to follow these steps:</p>
|
76 |
-
<ol>
|
77 |
-
<li>Go to [Emoji Quiz Mod APK v4.3.6 (Desbloqueadas) - Jojoy](^1^) and click on the download button.</li>
|
78 |
-
<li>Wait for the file to be downloaded on your device.</li>
|
79 |
-
<li>Go to your device's settings and enable the installation of apps from unknown sources.</li>
|
80 |
-
<li>Locate the downloaded file and tap on it to start the installation process.</li>
|
81 |
-
<li>Follow the instructions on the screen and wait for the installation to be completed.</li>
|
82 |
-
<li>Launch the game and enjoy playing Emoji Quiz Mod APK.</li>
|
83 |
-
</ol>
|
84 |
-
<h3>Pros and cons of Emoji Quiz Mod APK</h3>
|
85 |
-
<p>Like any other modded app, Emoji Quiz Mod APK has its advantages and disadvantages. Here are some of them:</p>
|
86 |
-
<table>
|
87 |
-
<tr>
|
88 |
-
<th>Pros</th>
|
89 |
-
<th>Cons</th>
|
90 |
-
</tr>
|
91 |
-
<tr>
|
92 |
-
<td>You can play all the levels and categories without spending money or watching ads.</td>
|
93 |
-
<td>You might miss out on the updates and new features from the original game.</td>
|
94 |
-
</tr>
|
95 |
-
<tr>
|
96 |
-
<td>You can use unlimited hints and coins to solve any emoji puzzle.</td>
|
97 |
-
<td>You might lose the challenge and excitement of the game.</td>
|
98 |
-
</tr>
|
99 |
-
<tr>
|
100 |
-
<td>You don't need to root your device or risk damaging it.</td>
|
101 |
-
<td>You might expose your device to malware or viruses from untrusted sources.</td>
|
102 |
-
</tr>
|
103 |
-
</table>
|
104 |
-
<h2>Conclusion</h2>
|
105 |
-
<p>Emoji Quiz is a fun and challenging game that tests your emoji knowledge and skills. You can play it online or download it on your Android device for free. However, if you want to enjoy more features and benefits from this game, you can try Emoji Quiz Mod APK, a modified version that gives you access to all the levels, categories, hints, coins, and more without any ads or limitations. You just need to download and install it on your device following the steps we provided above. However, you should also be aware of the pros and cons of using Emoji Quiz Mod APK and decide whether it is worth it or not. We hope this article helped you learn more about Emoji Quiz Mod APK and how to use it. Have fun playing Emoji Quiz!</p>
|
106 |
-
<h3>Call to action</h3>
|
107 |
-
<p>If you liked this article, please share it with your friends who love emojis and games. Also, let us know what you think about Emoji Quiz Mod APK in the comments below. Do you prefer it over the original game? Why or why not? We would love to hear from you!</p>
|
108 |
-
<h4>FAQs</h4>
|
109 |
-
<p>Here are some frequently asked questions about Emoji Quiz Mod APK:</p>
|
110 |
-
<ol>
|
111 |
-
<li><b>What is the difference between Emoji Quiz and Emoji Quiz Mod APK?</b></li>
|
112 |
-
<p>Emoji Quiz is the original game that you can play online or download on your Android device for free. Emoji Quiz Mod APK is a modified version that gives you access to all the features and benefits of the game without spending money or watching ads.</p>
|
113 |
-
<li><b>Is Emoji Quiz Mod APK safe to use?</b></li>
|
114 |
-
<p>Emoji Quiz Mod APK is safe to use as long as you download it from a trusted source like [Emoji Quiz Mod APK v4.3.6 (Desbloqueadas) - Jojoy]. However, you should always be careful when installing apps from unknown sources and scan them for malware or viruses before using them.</p>
|
115 |
-
<li><b>How do I update Emoji Quiz Mod APK?</b></li>
|
116 |
-
<p>To update Emoji Quiz Mod APK, you need to download the latest version from [Emoji Quiz Mod APK v4.3.6 (Desbloqueadas) - Jojoy] and install it on your device following the same steps as before. However, you might lose your progress and data if you uninstall the previous version, so make sure you back them up first.</p>
|
117 |
-
<li><b>Can I play Emoji Quiz Mod APK offline?</b></li>
|
118 |
-
<p>Yes, you can play Emoji Quiz Mod APK offline without an internet connection. However, you might not be able to access some features or functions that require online connectivity, such as sharing your levels or asking for help from your friends.</p>
|
119 |
-
<li><b>Can I create my own levels in Emoji Quiz Mod APK?</b></li>
|
120 |
-
<p>Yes, you can create your own levels in Emoji Quiz Mod APK using the same feature as in the original game. You can choose the emojis, the category, and the answer for your level and share it with your friends or other players.</p>
|
121 |
-
</ol></p> 197e85843d<br />
|
122 |
-
<br />
|
123 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1phancelerku/anime-remove-background/City Lite Fit and Proper Test PDF - A Novel by Soraya Nasution that Explores the Challenges and Joys of Dating in the Modern World.md
DELETED
@@ -1,143 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>How to Download City Lite: Fit and Proper Test PDF</h1>
|
3 |
-
<p>If you are looking for a fun, fresh, and relatable novel to read, you might want to check out <strong>City Lite: Fit and Proper Test</strong> by Soraya Nasution. This novel tells the story of Anggun, a young woman who has a target to get married before she turns 28. To achieve her goal, she creates a fit and proper test to find her ideal partner. But what happens when she meets someone who does not fit her criteria, but makes her heart flutter?</p>
|
4 |
-
<p>In this article, we will show you how to download <strong>City Lite: Fit and Proper Test</strong> in PDF format, so you can enjoy reading it on your preferred device. We will also explain what a PDF file is, why it is a great format for ebooks, and how to open and view it. Let's get started!</p>
|
5 |
-
<h2>download novel city lite fit and proper test pdf</h2><br /><p><b><b>Download File</b> ✓ <a href="https://jinyurl.com/2uNOcD">https://jinyurl.com/2uNOcD</a></b></p><br /><br />
|
6 |
-
<h2>What is City Lite: Fit and Proper Test?</h2>
|
7 |
-
<h3>A brief summary of the novel by Soraya Nasution</h3>
|
8 |
-
<p><strong>City Lite: Fit and Proper Test</strong> is a novel by Soraya Nasution, a popular Indonesian author who has written several best-selling books. The novel was published in August 2021 by Elex Media Komputindo, one of the leading publishers in Indonesia. It has received positive reviews from readers who praised its humor, romance, and realistic portrayal of urban life.</p>
|
9 |
-
<p>The novel follows Anggun, a 26-year-old woman who works as a marketing manager at a multinational company. She has a dream to get married before she turns 28, but she has not found her Mr. Right yet. Her father suggests that she should create a fit and proper test, a set of criteria that her potential partner must meet. Anggun agrees and enlists the help of her cousin, who is also single and struggling to move on from his ex-girlfriend.</p>
|
10 |
-
<p>Together, they come up with a list of requirements that include education, income, personality, hobbies, religion, family background, and physical appearance. They also assign scores to each criterion based on their importance. Anggun then starts to look for candidates who can pass her test. However, things get complicated when she meets Prana, a handsome photographer who works at her office. Prana does not match Anggun's standards at all, but he manages to charm her with his kindness, humor, and passion.</p>
|
11 |
-
<p>Will Anggun stick to her fit and proper test or follow her heart? Will Prana be able to win Anggun's trust and love? Will they overcome the obstacles that come their way? You will have to read the novel to find out!</p>
|
12 |
-
<h3>Why you might want to read it</h3>
|
13 |
-
<p>If you are looking for a novel that will make you laugh, cry, and swoon, <strong>City Lite: Fit and Proper Test</ <p><strong>City Lite: Fit and Proper Test</strong> is a novel that will appeal to anyone who loves romantic comedy, contemporary fiction, and urban culture. It is a novel that will make you reflect on your own expectations and preferences when it comes to finding love. It is also a novel that will inspire you to pursue your dreams and passions, no matter what others think.</p>
|
14 |
-
<p>If you are curious about the novel, you can read the first chapter for free on the author's website. You can also watch the book trailer on YouTube to get a glimpse of the characters and the plot. And if you want to read the whole novel, you can download it in PDF format from various sources. We will show you how in the next sections.</p>
|
15 |
-
<h2>What is a PDF file and why use it?</h2>
|
16 |
-
<h3>The benefits of PDF format for reading ebooks</h3>
|
17 |
-
<p>A PDF file is a type of document that can be viewed on any device, regardless of the operating system, software, or hardware. PDF stands for Portable Document Format, and it was created by Adobe in 1993 to enable easy sharing and printing of documents across different platforms.</p>
|
18 |
-
<p>How to download novel city lite fit and proper test by Soraya Nasution pdf<br />
|
19 |
-
Novel city lite fit and proper test pdf free ebook download<br />
|
20 |
-
Read novel city lite fit and proper test online or download pdf<br />
|
21 |
-
Novel city lite fit and proper test review and summary pdf<br />
|
22 |
-
Where can I find novel city lite fit and proper test pdf for free<br />
|
23 |
-
Novel city lite fit and proper test pdf google play books<br />
|
24 |
-
Novel city lite fit and proper test pdf scribd<br />
|
25 |
-
Novel city lite fit and proper test pdf google books<br />
|
26 |
-
Download novel city lite fit and proper test epub or pdf<br />
|
27 |
-
Novel city lite fit and proper test pdf full book download<br />
|
28 |
-
Novel city lite fit and proper test pdf indonesia<br />
|
29 |
-
Novel city lite fit and proper test young adult fiction pdf<br />
|
30 |
-
Novel city lite fit and proper test romance pdf download<br />
|
31 |
-
Novel city lite fit and proper test ebook download pdf<br />
|
32 |
-
Novel city lite fit and proper test pdf elex media komputindo<br />
|
33 |
-
Download novel city lite fit and proper test by Soraya Nasution in pdf format<br />
|
34 |
-
Novel city lite fit and proper test pdf free download link<br />
|
35 |
-
Novel city lite fit and proper test pdf file download<br />
|
36 |
-
Novel city lite fit and proper test pdf book online<br />
|
37 |
-
Novel city lite fit and proper test pdf novel gratis<br />
|
38 |
-
Download novel city lite fit and proper test bahasa indonesia pdf<br />
|
39 |
-
Novel city lite fit and proper test pdf 360 pages<br />
|
40 |
-
Novel city lite fit and proper test pdf ratings and reviews<br />
|
41 |
-
Novel city lite fit and proper test pdf contents and chapters<br />
|
42 |
-
Novel city lite fit and proper test pdf bestseller<br />
|
43 |
-
Download novel city lite fit and proper test 2021 pdf<br />
|
44 |
-
Novel city lite fit and proper test pdf amazon.com<br />
|
45 |
-
Novel city lite fit and proper test pdf barnes&noble.com<br />
|
46 |
-
Novel city lite fit and proper test pdf books-a-million.com<br />
|
47 |
-
Novel city lite fit and proper test pdf indiebound.org<br />
|
48 |
-
Download novel city lite fit and proper test for kindle or pdf<br />
|
49 |
-
Novel city lite fit and proper test pdf free sample download<br />
|
50 |
-
Read novel city lite fit and proper test on google play books app or download pdf<br />
|
51 |
-
Novel city lite fit and proper test by Soraya Nasution ebook or pdf download<br />
|
52 |
-
Download novel city lite fit and proper test in english or indonesian pdf<br />
|
53 |
-
Novel city lite fit and proper test by Soraya Nasution free ebook or pdf download<br />
|
54 |
-
Download novel city lite fit and proper test for offline reading or highlight bookmark or take notes while you read the book in pdf format <br />
|
55 |
-
Download novel city lite fit and proper test by Soraya Nasution from google books in pdf format <br />
|
56 |
-
Download novel city lite fit and proper test by Soraya Nasution from scribd in pdf format</p>
|
57 |
-
<p>PDF files have many advantages for reading ebooks, such as:</p>
|
58 |
-
<ul>
|
59 |
-
<li>They preserve the original layout, fonts, images, and formatting of the document, so you can enjoy the ebook as the author intended.</li>
|
60 |
-
<li>They are compatible with most ebook readers, tablets, smartphones, laptops, and desktops, so you can read them on any device you prefer.</li>
|
61 |
-
<li>They are easy to download, transfer, and store, as they usually have a small file size compared to other formats.</li>
|
62 |
-
<li>They are secure and reliable, as they can be encrypted, password-protected, and digitally signed to prevent unauthorized access or modification.</li>
|
63 |
-
</ul>
|
64 |
-
<h3>The requirements for opening and viewing PDF files</h3>
|
65 |
-
<p>To open and view PDF files, you need a PDF reader or viewer software installed on your device. There are many free and paid options available online, such as Adobe Acrobat Reader, Foxit Reader, Sumatra PDF, and more. You can choose the one that suits your needs and preferences best.</p>
|
66 |
-
<p>Once you have a PDF reader or viewer software installed on your device, you can simply double-click on the PDF file to open it. Alternatively, you can right-click on the file and select "Open with" to choose the software you want to use. You can also drag and drop the file into the software window to open it.</p>
|
67 |
-
<p>When you open a PDF file, you can use various features and tools to enhance your reading experience, such as:</p>
|
68 |
-
<ul>
|
69 |
-
<li>Zoom in or out to adjust the size of the text and images.</li>
|
70 |
-
<li>Rotate or crop the page to change the orientation or layout.</li>
|
71 |
-
<li>Search for keywords or phrases within the document using the find function.</li>
|
72 |
-
<li>Highlight, underline, or annotate the text using the comment function.</li>
|
73 |
-
<li>Add bookmarks or jump to specific pages using the navigation function.</li>
|
74 |
-
</ul>
|
75 |
-
<h2>How to download City Lite: Fit and Proper Test PDF from Google Play Books</h2>
|
76 |
-
<h3>The steps to purchase and download the ebook from Google Play Books</h3>
|
77 |
-
<p>One of the easiest and safest ways to download <strong>City Lite: Fit and Proper Test</strong> in PDF format is from Google Play Books, an online store that sells ebooks and audiobooks. Google Play Books is accessible from any device that has an internet connection and a web browser. You can also use the Google Play Books app on your Android or iOS device to read your ebooks offline.</p>
|
78 |
-
<p>To purchase and download <strong>City Lite: Fit and Proper Test</strong> from Google Play Books, follow these steps:</p>
|
79 |
-
<ol>
|
80 |
-
<li>Create a Google account if you don't have one already. You can sign up for free using your email address or phone number.</li>
|
81 |
-
<li>Go to Google Play Books website or app and search for <strong>City Lite: Fit and Proper Test</strong>. You can also use this link to go directly to the ebook page.</li>
|
82 |
-
<li>Click on "Buy ebook" or "Sample" to preview the ebook before buying. You can also read some reviews from other readers who have bought the ebook.</li>
|
83 |
-
<li>Select your payment method and confirm your purchase. You can use a credit card, debit card, PayPal, Google Pay, or gift card to pay for your ebook.</li>
|
84 |
-
<li>After your purchase is complete, you will see a confirmation message on your screen. You will also receive an email receipt with a link to access your ebook.</li>
|
85 |
-
<li>To download your ebook in PDF format, go to <li>To download your ebook in PDF format, go to "My books" section on Google Play Books website or app. You will see a list of all the ebooks you have purchased or downloaded.</li>
|
86 |
-
<li>Find <strong>City Lite: Fit and Proper Test</strong> and click on the three dots icon next to it. A menu will appear with various options.</li>
|
87 |
-
<li>Select "Download PDF" and choose a location on your device where you want to save the file. The download will start automatically and may take a few minutes depending on your internet speed.</li>
|
88 |
-
<li>Once the download is complete, you can open the PDF file using your preferred PDF reader or viewer software. Enjoy reading your ebook!</li>
|
89 |
-
</ol>
|
90 |
-
<h3>The alternative ways to access the ebook on different devices</h3>
|
91 |
-
<p>If you don't want to download the ebook in PDF format, you can also access it online or offline using Google Play Books website or app. Here are some alternative ways to read your ebook on different devices:</p>
|
92 |
-
<ul>
|
93 |
-
<li>On your computer: You can read your ebook online using any web browser by going to Google Play Books website and signing in with your Google account. You can also read it offline by installing the Google Play Books Chrome extension on your Chrome browser. This will allow you to download and sync your ebooks across your devices.</li>
|
94 |
-
<li>On your Android device: You can read your ebook online or offline using the Google Play Books app, which is pre-installed on most Android devices. You can also download and sync your ebooks across your devices using the app.</li>
|
95 |
-
<li>On your iOS device: You can read your ebook online or offline using the Google Play Books app, which is available for free on the App Store. You can also download and sync your ebooks across your devices using the app.</li>
|
96 |
-
</ul>
|
97 |
-
<h2>How to download City Lite: Fit and Proper Test PDF from other sources</h2>
|
98 |
-
<h3>The precautions to take when downloading PDF files from unverified websites</h3>
|
99 |
-
<p>Another way to download <strong>City Lite: Fit and Proper Test</strong> in PDF format is from other sources, such as unverified websites that offer free or pirated ebooks. However, this method is not recommended for several reasons, such as:</p>
|
100 |
-
<ul>
|
101 |
-
<li>It may be illegal and unethical to download ebooks without the author's permission or without paying for them.</li>
|
102 |
-
<li>It may expose your device to viruses, malware, or spyware that can harm your data or privacy.</li>
|
103 |
-
<li>It may result in poor quality or incomplete ebooks that have missing pages, wrong formatting, or errors.</li>
|
104 |
-
</ul>
|
105 |
-
<p>If you decide to download PDF files from unverified websites, you should take some precautions to protect yourself and your device, such as:</p>
|
106 |
-
<ul>
|
107 |
-
<li>Use a reputable antivirus software and scan the files before opening them.</li>
|
108 |
-
<li>Use a VPN service and a proxy server to hide your IP address and location.</li>
|
109 |
-
<li>Use a disposable email address and a fake name to avoid spam or phishing emails.</li>
|
110 |
-
<li>Use a secure browser and clear your browsing history and cookies after downloading the files.</li>
|
111 |
-
</ul>
|
112 |
-
<h3>The steps to download the ebook from Google Books or The StoryGraph</h3>
|
113 |
-
<p>A better alternative to downloading PDF files from unverified websites is to use legitimate sources that offer free or discounted ebooks legally and ethically. Two of these sources are Google Books and The StoryGraph, which are online platforms that allow you to discover, preview, and read ebooks from various genres and authors.</p>
|
114 |
-
<p>To download <strong>City Lite: Fit and Proper Test</strong> from Google Books or The StoryGraph, follow these steps:</p>
|
115 |
-
<ol>
|
116 |
-
<li>Create a Google account if you don't have one already. You can sign up for free using your email address or phone number.</li>
|
117 |
-
<li>Create a The StoryGraph account if you don't have one already. You can sign up for free using your email address or social media account.</li>
|
118 |
-
<li>Go to Google Books website or app and search for <strong>City Lite: Fit and Proper Test</strong>. You can also use this link to go directly to the ebook page.</li>
|
119 |
-
<li>If the ebook is available for free or for a discounted price, you will see a "Free Ebook" or "Buy Ebook" button next to it. Click on it and follow the instructions to get the ebook.</li>
|
120 |
-
<li>If the ebook is not available for free or for a discounted price, you will see a "Preview" button next to it. Click on it and you will be able to read a sample of the ebook online.</li>
|
121 |
-
<li>If you want to read the whole ebook, you can click on "Get this book in print" button below the preview window. This will redirect you to The StoryGraph website, where you can find more information about the ebook, such as such as the synopsis, the author's bio, the ratings, and the reviews. You can also see a list of online and offline stores where you can buy the ebook or the paperback version.</li>
|
122 |
-
<li>Select the store that offers the best price and availability for the ebook. You can also compare the prices and features of different formats, such as PDF, EPUB, or MOBI.</li>
|
123 |
-
<li>Click on the "Buy Now" or "Download Now" button and follow the instructions to complete your purchase or download. You may need to create an account or sign in with your existing account on the store's website.</li>
|
124 |
-
<li>Once you have the ebook on your device, you can open it using your preferred PDF reader or viewer software. Enjoy reading your ebook!</li>
|
125 |
-
</ol>
|
126 |
-
<h2>Conclusion</h2>
|
127 |
-
<p><strong>City Lite: Fit and Proper Test</strong> is a novel that will make you laugh, cry, and swoon with its witty, romantic, and realistic story. It is a novel that will make you think about your own standards and choices when it comes to finding love. It is also a novel that will make you appreciate your dreams and passions, no matter what others say.</p>
|
128 |
-
<p>If you want to read this novel, you can download it in PDF format from various sources, such as Google Play Books, Google Books, or The StoryGraph. You can also read it online or offline using Google Play Books website or app. However, you should avoid downloading PDF files from unverified websites that may be illegal, unethical, or unsafe.</p>
|
129 |
-
<p>We hope this article has helped you learn how to download <strong>City Lite: Fit and Proper Test</strong> in PDF format. We also hope you have enjoyed reading our article as much as we have enjoyed writing it for you. Happy reading!</p>
|
130 |
-
<h2>FAQs</h2>
|
131 |
-
<h3>How much does City Lite: Fit and Proper Test cost on Google Play Books?</h3>
|
132 |
-
<p>The price of <strong>City Lite: Fit and Proper Test</strong> on Google Play Books may vary depending on your location and currency. However, as of June 2023, the ebook costs $3.99 USD in the United States, £2.99 GBP in the United Kingdom, €3.49 EUR in the European Union, and Rp 49.000 IDR in Indonesia.</p>
|
133 |
-
<h3>How can I read City Lite: Fit and Proper Test PDF on my Kindle device?</h3>
|
134 |
-
<p>If you have a Kindle device, you can read <strong>City Lite: Fit and Proper Test</strong> PDF by transferring it from your computer to your Kindle using a USB cable. Alternatively, you can email the PDF file to your Kindle email address and it will appear on your device's library. However, you may experience some issues with the formatting or readability of the PDF file on your Kindle device.</p>
|
135 |
-
<p>A better option is to convert the PDF file to a Kindle-friendly format, such as MOBI or AZW3. You can use online tools such as Zamzar or Calibre to do this for free. Once you have converted the file, you can transfer it to your Kindle device using the same methods mentioned above.</p>
|
136 |
-
<h3>How can I share City Lite: Fit and Proper Test PDF with my friends?</h3>
|
137 |
-
<p>If you want to share <strong>City Lite: Fit and Proper Test</strong> PDF with your friends, you can do so by sending them the file via email, messaging apps, cloud storage services, or file-sharing platforms. However, you should respect the author's rights and only share the file with people who have legally purchased or downloaded the ebook. You should also avoid uploading or distributing the file on public websites or forums that may violate the author's copyright.</p>
|
138 |
-
<h3>How can I print City Lite: Fit and Proper Test PDF?</h3>
|
139 |
-
<p>If you want to print <strong>City Lite: Fit and Proper Test</strong> PDF, you can do so by opening it with your preferred PDF reader or viewer software and selecting the print option from the menu. You can choose the number of copies, pages, orientation, size, quality, and other settings according to your preferences. However, you should only print the file for personal use and not for commercial purposes.</p>
|
140 |
-
<h3>How can I contact the author of City Lite: Fit and Proper Test?</h3>
|
141 |
-
<p>If you want to contact Soraya Nasution, the author of <strong>City Lite: Fit and Proper Test</strong>, you can do so by following her on social media platforms such as Instagram (@sorayanst), Twitter (@sorayanst), or Facebook (Soraya Nasution). You can also visit her website (www.sorayanst.com) to learn more about her books, events, projects, and collaborations. You can also send her an email at [email protected] or or fill out the contact form on her website. She will be happy to hear from you and answer your questions or feedback.</p> 401be4b1e0<br />
|
142 |
-
<br />
|
143 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AI-Edify/demo-gpt3.5-turbo/app.py
DELETED
@@ -1,138 +0,0 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
import openai
|
3 |
-
import requests
|
4 |
-
import csv
|
5 |
-
|
6 |
-
|
7 |
-
prompt_templates = {"Default ChatGPT": ""}
|
8 |
-
|
9 |
-
def get_empty_state():
|
10 |
-
return {"total_tokens": 0, "messages": []}
|
11 |
-
|
12 |
-
def download_prompt_templates():
|
13 |
-
url = "https://raw.githubusercontent.com/f/awesome-chatgpt-prompts/main/prompts.csv"
|
14 |
-
try:
|
15 |
-
response = requests.get(url)
|
16 |
-
reader = csv.reader(response.text.splitlines())
|
17 |
-
next(reader) # skip the header row
|
18 |
-
for row in reader:
|
19 |
-
if len(row) >= 2:
|
20 |
-
act = row[0].strip('"')
|
21 |
-
prompt = row[1].strip('"')
|
22 |
-
prompt_templates[act] = prompt
|
23 |
-
|
24 |
-
except requests.exceptions.RequestException as e:
|
25 |
-
print(f"An error occurred while downloading prompt templates: {e}")
|
26 |
-
return
|
27 |
-
|
28 |
-
choices = list(prompt_templates.keys())
|
29 |
-
choices = choices[:1] + sorted(choices[1:])
|
30 |
-
return gr.update(value=choices[0], choices=choices)
|
31 |
-
|
32 |
-
def on_token_change(user_token):
|
33 |
-
openai.api_key = user_token
|
34 |
-
|
35 |
-
def on_prompt_template_change(prompt_template):
|
36 |
-
if not isinstance(prompt_template, str): return
|
37 |
-
return prompt_templates[prompt_template]
|
38 |
-
|
39 |
-
def submit_message(user_token, prompt, prompt_template, temperature, max_tokens, context_length, state):
|
40 |
-
|
41 |
-
history = state['messages']
|
42 |
-
|
43 |
-
if not prompt:
|
44 |
-
return gr.update(value=''), [(history[i]['content'], history[i+1]['content']) for i in range(0, len(history)-1, 2)], f"Total tokens used: {state['total_tokens']}", state
|
45 |
-
|
46 |
-
prompt_template = prompt_templates[prompt_template]
|
47 |
-
|
48 |
-
system_prompt = []
|
49 |
-
if prompt_template:
|
50 |
-
system_prompt = [{ "role": "system", "content": prompt_template }]
|
51 |
-
|
52 |
-
prompt_msg = { "role": "user", "content": prompt }
|
53 |
-
|
54 |
-
if not user_token:
|
55 |
-
history.append(prompt_msg)
|
56 |
-
history.append({
|
57 |
-
"role": "system",
|
58 |
-
"content": "Error: OpenAI API Key is not set."
|
59 |
-
})
|
60 |
-
return '', [(history[i]['content'], history[i+1]['content']) for i in range(0, len(history)-1, 2)], f"Total tokens used: 0", state
|
61 |
-
|
62 |
-
try:
|
63 |
-
completion = openai.ChatCompletion.create(model="gpt-3.5-turbo", messages=system_prompt + history[-context_length*2:] + [prompt_msg], temperature=temperature, max_tokens=max_tokens)
|
64 |
-
|
65 |
-
history.append(prompt_msg)
|
66 |
-
history.append(completion.choices[0].message.to_dict())
|
67 |
-
|
68 |
-
state['total_tokens'] += completion['usage']['total_tokens']
|
69 |
-
|
70 |
-
except Exception as e:
|
71 |
-
history.append(prompt_msg)
|
72 |
-
history.append({
|
73 |
-
"role": "system",
|
74 |
-
"content": f"Error: {e}"
|
75 |
-
})
|
76 |
-
|
77 |
-
total_tokens_used_msg = f"Total tokens used: {state['total_tokens']}"
|
78 |
-
chat_messages = [(history[i]['content'], history[i+1]['content']) for i in range(0, len(history)-1, 2)]
|
79 |
-
|
80 |
-
return '', chat_messages, total_tokens_used_msg, state
|
81 |
-
|
82 |
-
def clear_conversation():
|
83 |
-
return gr.update(value=None, visible=True), None, "", get_empty_state()
|
84 |
-
|
85 |
-
|
86 |
-
css = """
|
87 |
-
#col-container {max-width: 80%; margin-left: auto; margin-right: auto;}
|
88 |
-
#chatbox {min-height: 400px;}
|
89 |
-
#header {text-align: center;}
|
90 |
-
#prompt_template_preview {padding: 1em; border-width: 1px; border-style: solid; border-color: #e0e0e0; border-radius: 4px;}
|
91 |
-
#total_tokens_str {text-align: right; font-size: 0.8em; color: #666;}
|
92 |
-
#label {font-size: 0.8em; padding: 0.5em; margin: 0;}
|
93 |
-
.message { font-size: 1.2em; }
|
94 |
-
"""
|
95 |
-
|
96 |
-
with gr.Blocks(css=css) as demo:
|
97 |
-
|
98 |
-
state = gr.State(get_empty_state())
|
99 |
-
|
100 |
-
|
101 |
-
with gr.Column(elem_id="col-container"):
|
102 |
-
gr.Markdown("""## OpenAI ChatGPT Demo
|
103 |
-
Using the ofiicial API (gpt-3.5-turbo model)
|
104 |
-
Prompt templates from [awesome-chatgpt-prompts](https://github.com/f/awesome-chatgpt-prompts).""",
|
105 |
-
elem_id="header")
|
106 |
-
|
107 |
-
with gr.Row():
|
108 |
-
with gr.Column():
|
109 |
-
chatbot = gr.Chatbot(elem_id="chatbox")
|
110 |
-
input_message = gr.Textbox(show_label=False, placeholder="Enter text and press enter", visible=True).style(container=False)
|
111 |
-
btn_submit = gr.Button("Submit")
|
112 |
-
total_tokens_str = gr.Markdown(elem_id="total_tokens_str")
|
113 |
-
btn_clear_conversation = gr.Button("🔃 Start New Conversation")
|
114 |
-
with gr.Column():
|
115 |
-
gr.Markdown("Enter your OpenAI API Key. You can get one [here](https://platform.openai.com/account/api-keys).", elem_id="label")
|
116 |
-
user_token = gr.Textbox(value='', placeholder="OpenAI API Key", type="password", show_label=False)
|
117 |
-
prompt_template = gr.Dropdown(label="Set a custom insruction for the chatbot:", choices=list(prompt_templates.keys()))
|
118 |
-
prompt_template_preview = gr.Markdown(elem_id="prompt_template_preview")
|
119 |
-
with gr.Accordion("Advanced parameters", open=False):
|
120 |
-
temperature = gr.Slider(minimum=0, maximum=2.0, value=0.7, step=0.1, label="Temperature", info="Higher = more creative/chaotic")
|
121 |
-
max_tokens = gr.Slider(minimum=100, maximum=4096, value=1000, step=1, label="Max tokens per response")
|
122 |
-
context_length = gr.Slider(minimum=1, maximum=10, value=2, step=1, label="Context length", info="Number of previous messages to send to the chatbot. Be careful with high values, it can blow up the token budget quickly.")
|
123 |
-
|
124 |
-
gr.HTML('''<br><br><br><center>You can duplicate this Space to skip the queue:<a href="https://huggingface.co/spaces/anzorq/chatgpt-demo?duplicate=true"><img src="https://bit.ly/3gLdBN6" alt="Duplicate Space"></a><br>
|
125 |
-
<p><img src="https://visitor-badge.glitch.me/badge?page_id=anzorq.chatgpt_api_demo_hf" alt="visitors"></p></center>''')
|
126 |
-
|
127 |
-
btn_submit.click(submit_message, [user_token, input_message, prompt_template, temperature, max_tokens, context_length, state], [input_message, chatbot, total_tokens_str, state])
|
128 |
-
input_message.submit(submit_message, [user_token, input_message, prompt_template, temperature, max_tokens, context_length, state], [input_message, chatbot, total_tokens_str, state])
|
129 |
-
btn_clear_conversation.click(clear_conversation, [], [input_message, chatbot, total_tokens_str, state])
|
130 |
-
prompt_template.change(on_prompt_template_change, inputs=[prompt_template], outputs=[prompt_template_preview])
|
131 |
-
user_token.change(on_token_change, inputs=[user_token], outputs=[])
|
132 |
-
|
133 |
-
|
134 |
-
demo.load(download_prompt_templates, inputs=None, outputs=[prompt_template], queur=False)
|
135 |
-
|
136 |
-
|
137 |
-
demo.queue(concurrency_count=10)
|
138 |
-
demo.launch(height='800px')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AI-Hobbyist/Hoyo-RVC/uvr5_pack/lib_v5/layers_537238KB.py
DELETED
@@ -1,126 +0,0 @@
|
|
1 |
-
import torch
|
2 |
-
from torch import nn
|
3 |
-
import torch.nn.functional as F
|
4 |
-
|
5 |
-
from uvr5_pack.lib_v5 import spec_utils
|
6 |
-
|
7 |
-
|
8 |
-
class Conv2DBNActiv(nn.Module):
|
9 |
-
def __init__(self, nin, nout, ksize=3, stride=1, pad=1, dilation=1, activ=nn.ReLU):
|
10 |
-
super(Conv2DBNActiv, self).__init__()
|
11 |
-
self.conv = nn.Sequential(
|
12 |
-
nn.Conv2d(
|
13 |
-
nin,
|
14 |
-
nout,
|
15 |
-
kernel_size=ksize,
|
16 |
-
stride=stride,
|
17 |
-
padding=pad,
|
18 |
-
dilation=dilation,
|
19 |
-
bias=False,
|
20 |
-
),
|
21 |
-
nn.BatchNorm2d(nout),
|
22 |
-
activ(),
|
23 |
-
)
|
24 |
-
|
25 |
-
def __call__(self, x):
|
26 |
-
return self.conv(x)
|
27 |
-
|
28 |
-
|
29 |
-
class SeperableConv2DBNActiv(nn.Module):
|
30 |
-
def __init__(self, nin, nout, ksize=3, stride=1, pad=1, dilation=1, activ=nn.ReLU):
|
31 |
-
super(SeperableConv2DBNActiv, self).__init__()
|
32 |
-
self.conv = nn.Sequential(
|
33 |
-
nn.Conv2d(
|
34 |
-
nin,
|
35 |
-
nin,
|
36 |
-
kernel_size=ksize,
|
37 |
-
stride=stride,
|
38 |
-
padding=pad,
|
39 |
-
dilation=dilation,
|
40 |
-
groups=nin,
|
41 |
-
bias=False,
|
42 |
-
),
|
43 |
-
nn.Conv2d(nin, nout, kernel_size=1, bias=False),
|
44 |
-
nn.BatchNorm2d(nout),
|
45 |
-
activ(),
|
46 |
-
)
|
47 |
-
|
48 |
-
def __call__(self, x):
|
49 |
-
return self.conv(x)
|
50 |
-
|
51 |
-
|
52 |
-
class Encoder(nn.Module):
|
53 |
-
def __init__(self, nin, nout, ksize=3, stride=1, pad=1, activ=nn.LeakyReLU):
|
54 |
-
super(Encoder, self).__init__()
|
55 |
-
self.conv1 = Conv2DBNActiv(nin, nout, ksize, 1, pad, activ=activ)
|
56 |
-
self.conv2 = Conv2DBNActiv(nout, nout, ksize, stride, pad, activ=activ)
|
57 |
-
|
58 |
-
def __call__(self, x):
|
59 |
-
skip = self.conv1(x)
|
60 |
-
h = self.conv2(skip)
|
61 |
-
|
62 |
-
return h, skip
|
63 |
-
|
64 |
-
|
65 |
-
class Decoder(nn.Module):
|
66 |
-
def __init__(
|
67 |
-
self, nin, nout, ksize=3, stride=1, pad=1, activ=nn.ReLU, dropout=False
|
68 |
-
):
|
69 |
-
super(Decoder, self).__init__()
|
70 |
-
self.conv = Conv2DBNActiv(nin, nout, ksize, 1, pad, activ=activ)
|
71 |
-
self.dropout = nn.Dropout2d(0.1) if dropout else None
|
72 |
-
|
73 |
-
def __call__(self, x, skip=None):
|
74 |
-
x = F.interpolate(x, scale_factor=2, mode="bilinear", align_corners=True)
|
75 |
-
if skip is not None:
|
76 |
-
skip = spec_utils.crop_center(skip, x)
|
77 |
-
x = torch.cat([x, skip], dim=1)
|
78 |
-
h = self.conv(x)
|
79 |
-
|
80 |
-
if self.dropout is not None:
|
81 |
-
h = self.dropout(h)
|
82 |
-
|
83 |
-
return h
|
84 |
-
|
85 |
-
|
86 |
-
class ASPPModule(nn.Module):
|
87 |
-
def __init__(self, nin, nout, dilations=(4, 8, 16, 32, 64), activ=nn.ReLU):
|
88 |
-
super(ASPPModule, self).__init__()
|
89 |
-
self.conv1 = nn.Sequential(
|
90 |
-
nn.AdaptiveAvgPool2d((1, None)),
|
91 |
-
Conv2DBNActiv(nin, nin, 1, 1, 0, activ=activ),
|
92 |
-
)
|
93 |
-
self.conv2 = Conv2DBNActiv(nin, nin, 1, 1, 0, activ=activ)
|
94 |
-
self.conv3 = SeperableConv2DBNActiv(
|
95 |
-
nin, nin, 3, 1, dilations[0], dilations[0], activ=activ
|
96 |
-
)
|
97 |
-
self.conv4 = SeperableConv2DBNActiv(
|
98 |
-
nin, nin, 3, 1, dilations[1], dilations[1], activ=activ
|
99 |
-
)
|
100 |
-
self.conv5 = SeperableConv2DBNActiv(
|
101 |
-
nin, nin, 3, 1, dilations[2], dilations[2], activ=activ
|
102 |
-
)
|
103 |
-
self.conv6 = SeperableConv2DBNActiv(
|
104 |
-
nin, nin, 3, 1, dilations[2], dilations[2], activ=activ
|
105 |
-
)
|
106 |
-
self.conv7 = SeperableConv2DBNActiv(
|
107 |
-
nin, nin, 3, 1, dilations[2], dilations[2], activ=activ
|
108 |
-
)
|
109 |
-
self.bottleneck = nn.Sequential(
|
110 |
-
Conv2DBNActiv(nin * 7, nout, 1, 1, 0, activ=activ), nn.Dropout2d(0.1)
|
111 |
-
)
|
112 |
-
|
113 |
-
def forward(self, x):
|
114 |
-
_, _, h, w = x.size()
|
115 |
-
feat1 = F.interpolate(
|
116 |
-
self.conv1(x), size=(h, w), mode="bilinear", align_corners=True
|
117 |
-
)
|
118 |
-
feat2 = self.conv2(x)
|
119 |
-
feat3 = self.conv3(x)
|
120 |
-
feat4 = self.conv4(x)
|
121 |
-
feat5 = self.conv5(x)
|
122 |
-
feat6 = self.conv6(x)
|
123 |
-
feat7 = self.conv7(x)
|
124 |
-
out = torch.cat((feat1, feat2, feat3, feat4, feat5, feat6, feat7), dim=1)
|
125 |
-
bottle = self.bottleneck(out)
|
126 |
-
return bottle
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AIGC-Audio/Make_An_Audio_inpaint/ldm/modules/encoders/open_clap/factory.py
DELETED
@@ -1,257 +0,0 @@
|
|
1 |
-
import json
|
2 |
-
import logging
|
3 |
-
import os
|
4 |
-
import pathlib
|
5 |
-
import re
|
6 |
-
from copy import deepcopy
|
7 |
-
from pathlib import Path
|
8 |
-
|
9 |
-
import torch
|
10 |
-
|
11 |
-
from .model import CLAP, convert_weights_to_fp16
|
12 |
-
from .openai import load_openai_model
|
13 |
-
from .pretrained import get_pretrained_url, download_pretrained
|
14 |
-
from .transform import image_transform
|
15 |
-
|
16 |
-
_MODEL_CONFIG_PATHS = [Path(__file__).parent / f"model_configs/"]
|
17 |
-
_MODEL_CONFIGS = {} # directory (model_name: config) of model architecture configs
|
18 |
-
|
19 |
-
|
20 |
-
def _natural_key(string_):
|
21 |
-
return [int(s) if s.isdigit() else s for s in re.split(r"(\d+)", string_.lower())]
|
22 |
-
|
23 |
-
|
24 |
-
def _rescan_model_configs():
|
25 |
-
global _MODEL_CONFIGS
|
26 |
-
|
27 |
-
config_ext = (".json",)
|
28 |
-
config_files = []
|
29 |
-
for config_path in _MODEL_CONFIG_PATHS:
|
30 |
-
if config_path.is_file() and config_path.suffix in config_ext:
|
31 |
-
config_files.append(config_path)
|
32 |
-
elif config_path.is_dir():
|
33 |
-
for ext in config_ext:
|
34 |
-
config_files.extend(config_path.glob(f"*{ext}"))
|
35 |
-
|
36 |
-
for cf in config_files:
|
37 |
-
with open(cf, "r") as f:
|
38 |
-
model_cfg = json.load(f)
|
39 |
-
if all(a in model_cfg for a in ("embed_dim", "audio_cfg", "text_cfg")):
|
40 |
-
_MODEL_CONFIGS[cf.stem] = model_cfg
|
41 |
-
|
42 |
-
_MODEL_CONFIGS = {
|
43 |
-
k: v
|
44 |
-
for k, v in sorted(_MODEL_CONFIGS.items(), key=lambda x: _natural_key(x[0]))
|
45 |
-
}
|
46 |
-
|
47 |
-
|
48 |
-
_rescan_model_configs() # initial populate of model config registry
|
49 |
-
|
50 |
-
|
51 |
-
def load_state_dict(checkpoint_path: str, map_location="cpu", skip_params=True):
|
52 |
-
checkpoint = torch.load(checkpoint_path, map_location=map_location)
|
53 |
-
if isinstance(checkpoint, dict) and "state_dict" in checkpoint:
|
54 |
-
state_dict = checkpoint["state_dict"]
|
55 |
-
else:
|
56 |
-
state_dict = checkpoint
|
57 |
-
if skip_params:
|
58 |
-
if next(iter(state_dict.items()))[0].startswith("module"):
|
59 |
-
state_dict = {k[7:]: v for k, v in state_dict.items()}
|
60 |
-
# for k in state_dict:
|
61 |
-
# if k.startswith('transformer'):
|
62 |
-
# v = state_dict.pop(k)
|
63 |
-
# state_dict['text_branch.' + k[12:]] = v
|
64 |
-
return state_dict
|
65 |
-
|
66 |
-
|
67 |
-
def create_model(
|
68 |
-
amodel_name: str,
|
69 |
-
tmodel_name: str,
|
70 |
-
pretrained: str = "",
|
71 |
-
precision: str = "fp32",
|
72 |
-
device: torch.device = torch.device("cpu"),
|
73 |
-
jit: bool = False,
|
74 |
-
force_quick_gelu: bool = False,
|
75 |
-
openai_model_cache_dir: str = os.path.expanduser("~/.cache/clip"),
|
76 |
-
skip_params=True,
|
77 |
-
pretrained_audio: str = "",
|
78 |
-
pretrained_text: str = "",
|
79 |
-
enable_fusion: bool = False,
|
80 |
-
fusion_type: str = 'None'
|
81 |
-
# pretrained_image: bool = False,
|
82 |
-
):
|
83 |
-
amodel_name = amodel_name.replace(
|
84 |
-
"/", "-"
|
85 |
-
) # for callers using old naming with / in ViT names
|
86 |
-
pretrained_orig = pretrained
|
87 |
-
pretrained = pretrained.lower()
|
88 |
-
if pretrained == "openai":
|
89 |
-
if amodel_name in _MODEL_CONFIGS:
|
90 |
-
logging.info(f"Loading {amodel_name} model config.")
|
91 |
-
model_cfg = deepcopy(_MODEL_CONFIGS[amodel_name])
|
92 |
-
else:
|
93 |
-
logging.error(
|
94 |
-
f"Model config for {amodel_name} not found; available models {list_models()}."
|
95 |
-
)
|
96 |
-
raise RuntimeError(f"Model config for {amodel_name} not found.")
|
97 |
-
|
98 |
-
logging.info(f"Loading pretrained ViT-B-16 text encoder from OpenAI.")
|
99 |
-
# Hard Code in model name
|
100 |
-
model_cfg["text_cfg"]["model_type"] = tmodel_name
|
101 |
-
model = load_openai_model(
|
102 |
-
"ViT-B-16",
|
103 |
-
model_cfg,
|
104 |
-
device=device,
|
105 |
-
jit=jit,
|
106 |
-
cache_dir=openai_model_cache_dir,
|
107 |
-
enable_fusion=enable_fusion,
|
108 |
-
fusion_type=fusion_type
|
109 |
-
)
|
110 |
-
# See https://discuss.pytorch.org/t/valueerror-attemting-to-unscale-fp16-gradients/81372
|
111 |
-
if precision == "amp" or precision == "fp32":
|
112 |
-
model = model.float()
|
113 |
-
else:
|
114 |
-
if amodel_name in _MODEL_CONFIGS:
|
115 |
-
logging.info(f"Loading {amodel_name} model config.")
|
116 |
-
model_cfg = deepcopy(_MODEL_CONFIGS[amodel_name])
|
117 |
-
else:
|
118 |
-
logging.error(
|
119 |
-
f"Model config for {amodel_name} not found; available models {list_models()}."
|
120 |
-
)
|
121 |
-
raise RuntimeError(f"Model config for {amodel_name} not found.")
|
122 |
-
|
123 |
-
if force_quick_gelu:
|
124 |
-
# override for use of QuickGELU on non-OpenAI transformer models
|
125 |
-
model_cfg["quick_gelu"] = True
|
126 |
-
|
127 |
-
# if pretrained_image:
|
128 |
-
# if 'timm_amodel_name' in model_cfg.get('vision_cfg', {}):
|
129 |
-
# # pretrained weight loading for timm models set via vision_cfg
|
130 |
-
# model_cfg['vision_cfg']['timm_model_pretrained'] = True
|
131 |
-
# else:
|
132 |
-
# assert False, 'pretrained image towers currently only supported for timm models'
|
133 |
-
model_cfg["text_cfg"]["model_type"] = tmodel_name
|
134 |
-
model_cfg["enable_fusion"] = enable_fusion
|
135 |
-
model_cfg["fusion_type"] = fusion_type
|
136 |
-
model = CLAP(**model_cfg)
|
137 |
-
|
138 |
-
if pretrained:
|
139 |
-
checkpoint_path = ""
|
140 |
-
url = get_pretrained_url(amodel_name, pretrained)
|
141 |
-
if url:
|
142 |
-
checkpoint_path = download_pretrained(url, root=openai_model_cache_dir)
|
143 |
-
elif os.path.exists(pretrained_orig):
|
144 |
-
checkpoint_path = pretrained_orig
|
145 |
-
if checkpoint_path:
|
146 |
-
logging.info(f"Loading pretrained {amodel_name}-{tmodel_name} weights ({pretrained}).")
|
147 |
-
ckpt = load_state_dict(checkpoint_path, skip_params=True)
|
148 |
-
model.load_state_dict(ckpt)
|
149 |
-
param_names = [n for n, p in model.named_parameters()]
|
150 |
-
for n in param_names:
|
151 |
-
print(n, "\t", "Loaded" if n in ckpt else "Unloaded")
|
152 |
-
else:
|
153 |
-
logging.warning(
|
154 |
-
f"Pretrained weights ({pretrained}) not found for model {amodel_name}."
|
155 |
-
)
|
156 |
-
raise RuntimeError(
|
157 |
-
f"Pretrained weights ({pretrained}) not found for model {amodel_name}."
|
158 |
-
)
|
159 |
-
|
160 |
-
if pretrained_audio:
|
161 |
-
if amodel_name.startswith('PANN'):
|
162 |
-
if 'Cnn14_mAP' in pretrained_audio: # official checkpoint
|
163 |
-
audio_ckpt = torch.load(pretrained_audio, map_location='cpu')
|
164 |
-
audio_ckpt = audio_ckpt['model']
|
165 |
-
keys = list(audio_ckpt.keys())
|
166 |
-
for key in keys:
|
167 |
-
if 'spectrogram_extractor' not in key and 'logmel_extractor' not in key:
|
168 |
-
v = audio_ckpt.pop(key)
|
169 |
-
audio_ckpt['audio_branch.' + key] = v
|
170 |
-
elif os.path.basename(pretrained_audio).startswith('PANN'): # checkpoint trained via HTSAT codebase
|
171 |
-
audio_ckpt = torch.load(pretrained_audio, map_location='cpu')
|
172 |
-
audio_ckpt = audio_ckpt['state_dict']
|
173 |
-
keys = list(audio_ckpt.keys())
|
174 |
-
for key in keys:
|
175 |
-
if key.startswith('sed_model'):
|
176 |
-
v = audio_ckpt.pop(key)
|
177 |
-
audio_ckpt['audio_branch.' + key[10:]] = v
|
178 |
-
elif os.path.basename(pretrained_audio).startswith('finetuned'): # checkpoint trained via linear probe codebase
|
179 |
-
audio_ckpt = torch.load(pretrained_audio, map_location='cpu')
|
180 |
-
else:
|
181 |
-
raise ValueError('Unknown audio checkpoint')
|
182 |
-
elif amodel_name.startswith('HTSAT'):
|
183 |
-
if 'HTSAT_AudioSet_Saved' in pretrained_audio: # official checkpoint
|
184 |
-
audio_ckpt = torch.load(pretrained_audio, map_location='cpu')
|
185 |
-
audio_ckpt = audio_ckpt['state_dict']
|
186 |
-
keys = list(audio_ckpt.keys())
|
187 |
-
for key in keys:
|
188 |
-
if key.startswith('sed_model') and ('spectrogram_extractor' not in key
|
189 |
-
and 'logmel_extractor' not in key):
|
190 |
-
v = audio_ckpt.pop(key)
|
191 |
-
audio_ckpt['audio_branch.' + key[10:]] = v
|
192 |
-
elif os.path.basename(pretrained_audio).startswith('HTSAT'): # checkpoint trained via HTSAT codebase
|
193 |
-
audio_ckpt = torch.load(pretrained_audio, map_location='cpu')
|
194 |
-
audio_ckpt = audio_ckpt['state_dict']
|
195 |
-
keys = list(audio_ckpt.keys())
|
196 |
-
for key in keys:
|
197 |
-
if key.startswith('sed_model'):
|
198 |
-
v = audio_ckpt.pop(key)
|
199 |
-
audio_ckpt['audio_branch.' + key[10:]] = v
|
200 |
-
elif os.path.basename(pretrained_audio).startswith('finetuned'): # checkpoint trained via linear probe codebase
|
201 |
-
audio_ckpt = torch.load(pretrained_audio, map_location='cpu')
|
202 |
-
else:
|
203 |
-
raise ValueError('Unknown audio checkpoint')
|
204 |
-
else:
|
205 |
-
raise f'this audio encoder pretrained checkpoint is not support'
|
206 |
-
|
207 |
-
model.load_state_dict(audio_ckpt, strict=False)
|
208 |
-
logging.info(f"Loading pretrained {amodel_name} weights ({pretrained_audio}).")
|
209 |
-
param_names = [n for n, p in model.named_parameters()]
|
210 |
-
for n in param_names:
|
211 |
-
print(n, "\t", "Loaded" if n in audio_ckpt else "Unloaded")
|
212 |
-
|
213 |
-
model.to(device=device)
|
214 |
-
if precision == "fp16":
|
215 |
-
assert device.type != "cpu"
|
216 |
-
convert_weights_to_fp16(model)
|
217 |
-
|
218 |
-
if jit:
|
219 |
-
model = torch.jit.script(model)
|
220 |
-
|
221 |
-
return model, model_cfg
|
222 |
-
|
223 |
-
|
224 |
-
def create_model_and_transforms(
|
225 |
-
model_name: str,
|
226 |
-
pretrained: str = "",
|
227 |
-
precision: str = "fp32",
|
228 |
-
device: torch.device = torch.device("cpu"),
|
229 |
-
jit: bool = False,
|
230 |
-
force_quick_gelu: bool = False,
|
231 |
-
# pretrained_image: bool = False,
|
232 |
-
):
|
233 |
-
model = create_model(
|
234 |
-
model_name,
|
235 |
-
pretrained,
|
236 |
-
precision,
|
237 |
-
device,
|
238 |
-
jit,
|
239 |
-
force_quick_gelu=force_quick_gelu,
|
240 |
-
# pretrained_image=pretrained_image
|
241 |
-
)
|
242 |
-
preprocess_train = image_transform(model.visual.image_size, is_train=True)
|
243 |
-
preprocess_val = image_transform(model.visual.image_size, is_train=False)
|
244 |
-
return model, preprocess_train, preprocess_val
|
245 |
-
|
246 |
-
|
247 |
-
def list_models():
|
248 |
-
"""enumerate available model architectures based on config files"""
|
249 |
-
return list(_MODEL_CONFIGS.keys())
|
250 |
-
|
251 |
-
|
252 |
-
def add_model_config(path):
|
253 |
-
"""add model config path or file and update registry"""
|
254 |
-
if not isinstance(path, Path):
|
255 |
-
path = Path(path)
|
256 |
-
_MODEL_CONFIG_PATHS.append(path)
|
257 |
-
_rescan_model_configs()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AIGText/GlyphControl/ldm/modules/midas/midas/midas_net_custom.py
DELETED
@@ -1,128 +0,0 @@
|
|
1 |
-
"""MidashNet: Network for monocular depth estimation trained by mixing several datasets.
|
2 |
-
This file contains code that is adapted from
|
3 |
-
https://github.com/thomasjpfan/pytorch_refinenet/blob/master/pytorch_refinenet/refinenet/refinenet_4cascade.py
|
4 |
-
"""
|
5 |
-
import torch
|
6 |
-
import torch.nn as nn
|
7 |
-
|
8 |
-
from .base_model import BaseModel
|
9 |
-
from .blocks import FeatureFusionBlock, FeatureFusionBlock_custom, Interpolate, _make_encoder
|
10 |
-
|
11 |
-
|
12 |
-
class MidasNet_small(BaseModel):
|
13 |
-
"""Network for monocular depth estimation.
|
14 |
-
"""
|
15 |
-
|
16 |
-
def __init__(self, path=None, features=64, backbone="efficientnet_lite3", non_negative=True, exportable=True, channels_last=False, align_corners=True,
|
17 |
-
blocks={'expand': True}):
|
18 |
-
"""Init.
|
19 |
-
|
20 |
-
Args:
|
21 |
-
path (str, optional): Path to saved model. Defaults to None.
|
22 |
-
features (int, optional): Number of features. Defaults to 256.
|
23 |
-
backbone (str, optional): Backbone network for encoder. Defaults to resnet50
|
24 |
-
"""
|
25 |
-
print("Loading weights: ", path)
|
26 |
-
|
27 |
-
super(MidasNet_small, self).__init__()
|
28 |
-
|
29 |
-
use_pretrained = False if path else True
|
30 |
-
|
31 |
-
self.channels_last = channels_last
|
32 |
-
self.blocks = blocks
|
33 |
-
self.backbone = backbone
|
34 |
-
|
35 |
-
self.groups = 1
|
36 |
-
|
37 |
-
features1=features
|
38 |
-
features2=features
|
39 |
-
features3=features
|
40 |
-
features4=features
|
41 |
-
self.expand = False
|
42 |
-
if "expand" in self.blocks and self.blocks['expand'] == True:
|
43 |
-
self.expand = True
|
44 |
-
features1=features
|
45 |
-
features2=features*2
|
46 |
-
features3=features*4
|
47 |
-
features4=features*8
|
48 |
-
|
49 |
-
self.pretrained, self.scratch = _make_encoder(self.backbone, features, use_pretrained, groups=self.groups, expand=self.expand, exportable=exportable)
|
50 |
-
|
51 |
-
self.scratch.activation = nn.ReLU(False)
|
52 |
-
|
53 |
-
self.scratch.refinenet4 = FeatureFusionBlock_custom(features4, self.scratch.activation, deconv=False, bn=False, expand=self.expand, align_corners=align_corners)
|
54 |
-
self.scratch.refinenet3 = FeatureFusionBlock_custom(features3, self.scratch.activation, deconv=False, bn=False, expand=self.expand, align_corners=align_corners)
|
55 |
-
self.scratch.refinenet2 = FeatureFusionBlock_custom(features2, self.scratch.activation, deconv=False, bn=False, expand=self.expand, align_corners=align_corners)
|
56 |
-
self.scratch.refinenet1 = FeatureFusionBlock_custom(features1, self.scratch.activation, deconv=False, bn=False, align_corners=align_corners)
|
57 |
-
|
58 |
-
|
59 |
-
self.scratch.output_conv = nn.Sequential(
|
60 |
-
nn.Conv2d(features, features//2, kernel_size=3, stride=1, padding=1, groups=self.groups),
|
61 |
-
Interpolate(scale_factor=2, mode="bilinear"),
|
62 |
-
nn.Conv2d(features//2, 32, kernel_size=3, stride=1, padding=1),
|
63 |
-
self.scratch.activation,
|
64 |
-
nn.Conv2d(32, 1, kernel_size=1, stride=1, padding=0),
|
65 |
-
nn.ReLU(True) if non_negative else nn.Identity(),
|
66 |
-
nn.Identity(),
|
67 |
-
)
|
68 |
-
|
69 |
-
if path:
|
70 |
-
self.load(path)
|
71 |
-
|
72 |
-
|
73 |
-
def forward(self, x):
|
74 |
-
"""Forward pass.
|
75 |
-
|
76 |
-
Args:
|
77 |
-
x (tensor): input data (image)
|
78 |
-
|
79 |
-
Returns:
|
80 |
-
tensor: depth
|
81 |
-
"""
|
82 |
-
if self.channels_last==True:
|
83 |
-
print("self.channels_last = ", self.channels_last)
|
84 |
-
x.contiguous(memory_format=torch.channels_last)
|
85 |
-
|
86 |
-
|
87 |
-
layer_1 = self.pretrained.layer1(x)
|
88 |
-
layer_2 = self.pretrained.layer2(layer_1)
|
89 |
-
layer_3 = self.pretrained.layer3(layer_2)
|
90 |
-
layer_4 = self.pretrained.layer4(layer_3)
|
91 |
-
|
92 |
-
layer_1_rn = self.scratch.layer1_rn(layer_1)
|
93 |
-
layer_2_rn = self.scratch.layer2_rn(layer_2)
|
94 |
-
layer_3_rn = self.scratch.layer3_rn(layer_3)
|
95 |
-
layer_4_rn = self.scratch.layer4_rn(layer_4)
|
96 |
-
|
97 |
-
|
98 |
-
path_4 = self.scratch.refinenet4(layer_4_rn)
|
99 |
-
path_3 = self.scratch.refinenet3(path_4, layer_3_rn)
|
100 |
-
path_2 = self.scratch.refinenet2(path_3, layer_2_rn)
|
101 |
-
path_1 = self.scratch.refinenet1(path_2, layer_1_rn)
|
102 |
-
|
103 |
-
out = self.scratch.output_conv(path_1)
|
104 |
-
|
105 |
-
return torch.squeeze(out, dim=1)
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
def fuse_model(m):
|
110 |
-
prev_previous_type = nn.Identity()
|
111 |
-
prev_previous_name = ''
|
112 |
-
previous_type = nn.Identity()
|
113 |
-
previous_name = ''
|
114 |
-
for name, module in m.named_modules():
|
115 |
-
if prev_previous_type == nn.Conv2d and previous_type == nn.BatchNorm2d and type(module) == nn.ReLU:
|
116 |
-
# print("FUSED ", prev_previous_name, previous_name, name)
|
117 |
-
torch.quantization.fuse_modules(m, [prev_previous_name, previous_name, name], inplace=True)
|
118 |
-
elif prev_previous_type == nn.Conv2d and previous_type == nn.BatchNorm2d:
|
119 |
-
# print("FUSED ", prev_previous_name, previous_name)
|
120 |
-
torch.quantization.fuse_modules(m, [prev_previous_name, previous_name], inplace=True)
|
121 |
-
# elif previous_type == nn.Conv2d and type(module) == nn.ReLU:
|
122 |
-
# print("FUSED ", previous_name, name)
|
123 |
-
# torch.quantization.fuse_modules(m, [previous_name, name], inplace=True)
|
124 |
-
|
125 |
-
prev_previous_type = previous_type
|
126 |
-
prev_previous_name = previous_name
|
127 |
-
previous_type = type(module)
|
128 |
-
previous_name = name
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AONYLMR/anime-ai-detect/app.py
DELETED
@@ -1,17 +0,0 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
from transformers import pipeline
|
3 |
-
|
4 |
-
detection_pipeline = pipeline("image-classification", "saltacc/anime-ai-detect")
|
5 |
-
|
6 |
-
|
7 |
-
def detect(img):
|
8 |
-
print(img)
|
9 |
-
output = detection_pipeline(img, top_k=2)
|
10 |
-
final = {}
|
11 |
-
for d in output:
|
12 |
-
final[d["label"]] = d["score"]
|
13 |
-
return final
|
14 |
-
|
15 |
-
|
16 |
-
iface = gr.Interface(fn=detect, inputs=gr.Image(type="pil"), outputs=gr.Label(label="result"))
|
17 |
-
iface.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/ASJMO/freegpt/g4f/Provider/Providers/Weuseing.py
DELETED
@@ -1,29 +0,0 @@
|
|
1 |
-
import requests
|
2 |
-
import os
|
3 |
-
import json
|
4 |
-
from ...typing import sha256, Dict, get_type_hints
|
5 |
-
|
6 |
-
url = 'https://api.gptplus.one'
|
7 |
-
model = ['gpt-3.5-turbo', 'gpt-3.5-turbo-16k', 'gpt-3.5-turbo-16k-0613', 'gpt-3.5-turbo-0613']
|
8 |
-
supports_stream = True
|
9 |
-
needs_auth = False
|
10 |
-
|
11 |
-
def _create_completion(model: str, messages: list, stream: bool, temperature: float = 0.7, **kwargs):
|
12 |
-
headers = {
|
13 |
-
'Content-Type': 'application/json',
|
14 |
-
'Accept': '*/*',
|
15 |
-
'Accept-Language': 'ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7,ja;q=0.6,zh-TW;q=0.5,zh;q=0.4',
|
16 |
-
}
|
17 |
-
data = {
|
18 |
-
'messages': messages,
|
19 |
-
'model': model,
|
20 |
-
}
|
21 |
-
response = requests.post('https://api.gptplus.one/chat-process', json=data, stream=True)
|
22 |
-
print(response)
|
23 |
-
|
24 |
-
for token in response.iter_content(chunk_size=None):
|
25 |
-
yield (token.decode('utf-8'))
|
26 |
-
|
27 |
-
|
28 |
-
params = f'g4f.Providers.{os.path.basename(__file__)[:-3]} supports: ' + \
|
29 |
-
'(%s)' % ', '.join([f"{name}: {get_type_hints(_create_completion)[name].__name__}" for name in _create_completion.__code__.co_varnames[:_create_completion.__code__.co_argcount]])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/ATang0729/Forecast4Muses/Model/Model6/Model6_0_ClothesDetection/mmyolo/configs/yolov7/__init__.py
DELETED
File without changes
|
spaces/Abdllh/AraPoet/README.md
DELETED
@@ -1,14 +0,0 @@
|
|
1 |
-
---
|
2 |
-
title: AraPoet
|
3 |
-
emoji: ✍️
|
4 |
-
colorFrom: green
|
5 |
-
colorTo: blue
|
6 |
-
sdk: gradio
|
7 |
-
sdk_version: 3.18.0
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
-
license: gpl-3.0
|
11 |
-
duplicated_from: aaaaaabbbbbbbdddddddduuuuulllll/AraPoet
|
12 |
-
---
|
13 |
-
|
14 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AchyuthGamer/OpenGPT-Chat-UI/.svelte-kit/types/src/routes/conversation/[id]/web-search/$types.d.ts
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
import type * as Kit from '@sveltejs/kit';
|
2 |
-
|
3 |
-
type Expand<T> = T extends infer O ? { [K in keyof O]: O[K] } : never;
|
4 |
-
type RouteParams = { id: string }
|
5 |
-
type RouteId = '/conversation/[id]/web-search';
|
6 |
-
|
7 |
-
export type EntryGenerator = () => Promise<Array<RouteParams>> | Array<RouteParams>;
|
8 |
-
export type RequestHandler = Kit.RequestHandler<RouteParams, RouteId>;
|
9 |
-
export type RequestEvent = Kit.RequestEvent<RouteParams, RouteId>;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AchyuthGamer/OpenGPT/g4f/Provider/Ylokh.py
DELETED
@@ -1,77 +0,0 @@
|
|
1 |
-
from __future__ import annotations
|
2 |
-
|
3 |
-
import json
|
4 |
-
|
5 |
-
from ..requests import StreamSession
|
6 |
-
from .base_provider import AsyncGeneratorProvider
|
7 |
-
from ..typing import AsyncResult, Messages
|
8 |
-
|
9 |
-
class Ylokh(AsyncGeneratorProvider):
|
10 |
-
url = "https://chat.ylokh.xyz"
|
11 |
-
working = True
|
12 |
-
supports_gpt_35_turbo = True
|
13 |
-
|
14 |
-
|
15 |
-
@classmethod
|
16 |
-
async def create_async_generator(
|
17 |
-
cls,
|
18 |
-
model: str,
|
19 |
-
messages: Messages,
|
20 |
-
stream: bool = True,
|
21 |
-
proxy: str = None,
|
22 |
-
timeout: int = 120,
|
23 |
-
**kwargs
|
24 |
-
) -> AsyncResult:
|
25 |
-
model = model if model else "gpt-3.5-turbo"
|
26 |
-
headers = {
|
27 |
-
"Origin" : cls.url,
|
28 |
-
"Referer": cls.url + "/",
|
29 |
-
}
|
30 |
-
data = {
|
31 |
-
"messages": messages,
|
32 |
-
"model": model,
|
33 |
-
"temperature": 1,
|
34 |
-
"presence_penalty": 0,
|
35 |
-
"top_p": 1,
|
36 |
-
"frequency_penalty": 0,
|
37 |
-
"allow_fallback": True,
|
38 |
-
"stream": stream,
|
39 |
-
**kwargs
|
40 |
-
}
|
41 |
-
async with StreamSession(
|
42 |
-
headers=headers,
|
43 |
-
proxies={"https": proxy},
|
44 |
-
timeout=timeout
|
45 |
-
) as session:
|
46 |
-
async with session.post("https://chatapi.ylokh.xyz/v1/chat/completions", json=data) as response:
|
47 |
-
response.raise_for_status()
|
48 |
-
if stream:
|
49 |
-
async for line in response.iter_lines():
|
50 |
-
line = line.decode()
|
51 |
-
if line.startswith("data: "):
|
52 |
-
if line.startswith("data: [DONE]"):
|
53 |
-
break
|
54 |
-
line = json.loads(line[6:])
|
55 |
-
content = line["choices"][0]["delta"].get("content")
|
56 |
-
if content:
|
57 |
-
yield content
|
58 |
-
else:
|
59 |
-
chat = await response.json()
|
60 |
-
yield chat["choices"][0]["message"].get("content")
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
@classmethod
|
65 |
-
@property
|
66 |
-
def params(cls):
|
67 |
-
params = [
|
68 |
-
("model", "str"),
|
69 |
-
("messages", "list[dict[str, str]]"),
|
70 |
-
("stream", "bool"),
|
71 |
-
("proxy", "str"),
|
72 |
-
("timeout", "int"),
|
73 |
-
("temperature", "float"),
|
74 |
-
("top_p", "float"),
|
75 |
-
]
|
76 |
-
param = ", ".join([": ".join(p) for p in params])
|
77 |
-
return f"g4f.provider.{cls.__name__} supports: ({param})"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Adam111/stable-diffusion-webui/README.md
DELETED
@@ -1,14 +0,0 @@
|
|
1 |
-
---
|
2 |
-
title: Stable Diffusion Webui
|
3 |
-
emoji: 💻
|
4 |
-
colorFrom: yellow
|
5 |
-
colorTo: gray
|
6 |
-
sdk: gradio
|
7 |
-
sdk_version: 3.12.0
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
-
license: openrail
|
11 |
-
duplicated_from: kamiyamai/stable-diffusion-webui
|
12 |
-
---
|
13 |
-
|
14 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AdamWEE80/VoiceTTS/app.py
DELETED
@@ -1,78 +0,0 @@
|
|
1 |
-
import torch
|
2 |
-
import gradio as gr
|
3 |
-
import time
|
4 |
-
import json
|
5 |
-
import git
|
6 |
-
import os
|
7 |
-
import sys
|
8 |
-
|
9 |
-
init = ['git clone https://github.com/Edresson/Coqui-TTS -b multilingual-torchaudio-SE TTS',
|
10 |
-
'pip install -q -e TTS/',
|
11 |
-
'pip install -q torchaudio==0.9.0'
|
12 |
-
]
|
13 |
-
|
14 |
-
for cmd in init: os.system(cmd)
|
15 |
-
|
16 |
-
sys.path.append('TTS/')
|
17 |
-
os.makedirs('synthesized/', exist_ok=True)
|
18 |
-
|
19 |
-
|
20 |
-
import IPython
|
21 |
-
from IPython.display import Audio
|
22 |
-
from pathlib import Path, PureWindowsPath
|
23 |
-
from TTS.utils.synthesizer import Synthesizer
|
24 |
-
|
25 |
-
|
26 |
-
MODEL_PATH = Path(PureWindowsPath('./models/'))
|
27 |
-
CONFIG_PATH = MODEL_PATH / 'config.json'
|
28 |
-
OUTPUT_PATH = Path(PureWindowsPath('./synthesized/'))
|
29 |
-
|
30 |
-
CUDA = torch.cuda.is_available()
|
31 |
-
|
32 |
-
|
33 |
-
synthesizers = {}
|
34 |
-
voices = {}
|
35 |
-
|
36 |
-
with open('models.json', 'r') as f:
|
37 |
-
models = json.load(f)
|
38 |
-
for voice in models.get('voices'):
|
39 |
-
voices[voice.get('name')] = voice
|
40 |
-
|
41 |
-
def synthesize(text: str, voice: str):
|
42 |
-
global synthesizer
|
43 |
-
|
44 |
-
model_file = MODEL_PATH / voices.get(voice).get('model')
|
45 |
-
|
46 |
-
if voice not in synthesizers:
|
47 |
-
synthesizers[voice] = Synthesizer(
|
48 |
-
tts_config_path = CONFIG_PATH,
|
49 |
-
tts_checkpoint = model_file,
|
50 |
-
use_cuda = CUDA
|
51 |
-
)
|
52 |
-
|
53 |
-
syn = synthesizers.get(voice)
|
54 |
-
wav = synthesizers[voice].tts(text)
|
55 |
-
|
56 |
-
IPython.display.display(Audio(wav, rate=syn.sample_rate))
|
57 |
-
file_name = f'{int(time.time())}_{voice}.wav'
|
58 |
-
|
59 |
-
out_path = os.path.join(OUTPUT_PATH, file_name)
|
60 |
-
|
61 |
-
syn.save_wav(wav, out_path)
|
62 |
-
return out_path
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
demo = gr.Interface(fn=synthesize,
|
67 |
-
inputs=[
|
68 |
-
gr.inputs.Textbox(label='What do you want it to say?'),
|
69 |
-
gr.inputs.Dropdown(
|
70 |
-
choices=voices.keys(),
|
71 |
-
value='xqc',
|
72 |
-
type='text'
|
73 |
-
)
|
74 |
-
],
|
75 |
-
outputs = 'audio',
|
76 |
-
title = 'Wesker TTS'
|
77 |
-
)
|
78 |
-
demo.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/spinner/bars/Factory.js
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
import Bars from './Bars.js';
|
2 |
-
import ObjectFactory from '../ObjectFactory.js';
|
3 |
-
import SetValue from '../../../plugins/utils/object/SetValue.js';
|
4 |
-
|
5 |
-
ObjectFactory.register('bars', function (config) {
|
6 |
-
var gameObject = new Bars(this.scene, config);
|
7 |
-
this.scene.add.existing(gameObject);
|
8 |
-
return gameObject;
|
9 |
-
});
|
10 |
-
|
11 |
-
SetValue(window, 'RexPlugins.Spinner.Bars', Bars);
|
12 |
-
|
13 |
-
export default Bars;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/spinner/cube/Factory.js
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
import Cube from './Cube.js';
|
2 |
-
import ObjectFactory from '../ObjectFactory.js';
|
3 |
-
import SetValue from '../../../plugins/utils/object/SetValue.js';
|
4 |
-
|
5 |
-
ObjectFactory.register('cube', function (config) {
|
6 |
-
var gameObject = new Cube(this.scene, config);
|
7 |
-
this.scene.add.existing(gameObject);
|
8 |
-
return gameObject;
|
9 |
-
});
|
10 |
-
|
11 |
-
SetValue(window, 'RexPlugins.Spinner.Cube', Cube);
|
12 |
-
|
13 |
-
export default Cube;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Alican/pixera/models/test_model.py
DELETED
@@ -1,69 +0,0 @@
|
|
1 |
-
from .base_model import BaseModel
|
2 |
-
from . import networks
|
3 |
-
|
4 |
-
|
5 |
-
class TestModel(BaseModel):
|
6 |
-
""" This TesteModel can be used to generate CycleGAN results for only one direction.
|
7 |
-
This model will automatically set '--dataset_mode single', which only loads the images from one collection.
|
8 |
-
|
9 |
-
See the test instruction for more details.
|
10 |
-
"""
|
11 |
-
@staticmethod
|
12 |
-
def modify_commandline_options(parser, is_train=True):
|
13 |
-
"""Add new dataset-specific options, and rewrite default values for existing options.
|
14 |
-
|
15 |
-
Parameters:
|
16 |
-
parser -- original option parser
|
17 |
-
is_train (bool) -- whether training phase or test phase. You can use this flag to add training-specific or test-specific options.
|
18 |
-
|
19 |
-
Returns:
|
20 |
-
the modified parser.
|
21 |
-
|
22 |
-
The model can only be used during test time. It requires '--dataset_mode single'.
|
23 |
-
You need to specify the network using the option '--model_suffix'.
|
24 |
-
"""
|
25 |
-
assert not is_train, 'TestModel cannot be used during training time'
|
26 |
-
parser.set_defaults(dataset_mode='single')
|
27 |
-
parser.add_argument('--model_suffix', type=str, default='', help='In checkpoints_dir, [epoch]_net_G[model_suffix].pth will be loaded as the generator.')
|
28 |
-
|
29 |
-
return parser
|
30 |
-
|
31 |
-
def __init__(self, opt):
|
32 |
-
"""Initialize the pix2pix class.
|
33 |
-
|
34 |
-
Parameters:
|
35 |
-
opt (Option class)-- stores all the experiment flags; needs to be a subclass of BaseOptions
|
36 |
-
"""
|
37 |
-
assert(not opt.isTrain)
|
38 |
-
BaseModel.__init__(self, opt)
|
39 |
-
# specify the training losses you want to print out. The training/test scripts will call <BaseModel.get_current_losses>
|
40 |
-
self.loss_names = []
|
41 |
-
# specify the images you want to save/display. The training/test scripts will call <BaseModel.get_current_visuals>
|
42 |
-
self.visual_names = ['real', 'fake']
|
43 |
-
# specify the models you want to save to the disk. The training/test scripts will call <BaseModel.save_networks> and <BaseModel.load_networks>
|
44 |
-
self.model_names = ['G' + opt.model_suffix] # only generator is needed.
|
45 |
-
self.netG = networks.define_G(opt.input_nc, opt.output_nc, opt.ngf, opt.netG,
|
46 |
-
opt.norm, not opt.no_dropout, opt.init_type, opt.init_gain, self.gpu_ids)
|
47 |
-
|
48 |
-
# assigns the model to self.netG_[suffix] so that it can be loaded
|
49 |
-
# please see <BaseModel.load_networks>
|
50 |
-
setattr(self, 'netG' + opt.model_suffix, self.netG) # store netG in self.
|
51 |
-
|
52 |
-
def set_input(self, input):
|
53 |
-
"""Unpack input data from the dataloader and perform necessary pre-processing steps.
|
54 |
-
|
55 |
-
Parameters:
|
56 |
-
input: a dictionary that contains the data itself and its metadata information.
|
57 |
-
|
58 |
-
We need to use 'single_dataset' dataset mode. It only load images from one domain.
|
59 |
-
"""
|
60 |
-
self.real = input['A'].to(self.device)
|
61 |
-
self.image_paths = input['A_paths']
|
62 |
-
|
63 |
-
def forward(self):
|
64 |
-
"""Run forward pass."""
|
65 |
-
self.fake = self.netG(self.real) # G(real)
|
66 |
-
|
67 |
-
def optimize_parameters(self):
|
68 |
-
"""No optimization for test model."""
|
69 |
-
pass
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/docs/source/_config.py
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
# docstyle-ignore
|
2 |
-
INSTALL_CONTENT = """
|
3 |
-
# Diffusers installation
|
4 |
-
! pip install diffusers transformers datasets accelerate
|
5 |
-
# To install from source instead of the last release, comment the command above and uncomment the following one.
|
6 |
-
# ! pip install git+https://github.com/huggingface/diffusers.git
|
7 |
-
"""
|
8 |
-
|
9 |
-
notebook_first_cells = [{"type": "code", "content": INSTALL_CONTENT}]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/src/diffusers/schedulers/scheduling_dpmsolver_sde.py
DELETED
@@ -1,509 +0,0 @@
|
|
1 |
-
# Copyright 2023 Katherine Crowson, The HuggingFace Team and hlky. All rights reserved.
|
2 |
-
#
|
3 |
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
4 |
-
# you may not use this file except in compliance with the License.
|
5 |
-
# You may obtain a copy of the License at
|
6 |
-
#
|
7 |
-
# http://www.apache.org/licenses/LICENSE-2.0
|
8 |
-
#
|
9 |
-
# Unless required by applicable law or agreed to in writing, software
|
10 |
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
11 |
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12 |
-
# See the License for the specific language governing permissions and
|
13 |
-
# limitations under the License.
|
14 |
-
|
15 |
-
import math
|
16 |
-
from collections import defaultdict
|
17 |
-
from typing import List, Optional, Tuple, Union
|
18 |
-
|
19 |
-
import numpy as np
|
20 |
-
import torch
|
21 |
-
import torchsde
|
22 |
-
|
23 |
-
from ..configuration_utils import ConfigMixin, register_to_config
|
24 |
-
from .scheduling_utils import KarrasDiffusionSchedulers, SchedulerMixin, SchedulerOutput
|
25 |
-
|
26 |
-
|
27 |
-
class BatchedBrownianTree:
|
28 |
-
"""A wrapper around torchsde.BrownianTree that enables batches of entropy."""
|
29 |
-
|
30 |
-
def __init__(self, x, t0, t1, seed=None, **kwargs):
|
31 |
-
t0, t1, self.sign = self.sort(t0, t1)
|
32 |
-
w0 = kwargs.get("w0", torch.zeros_like(x))
|
33 |
-
if seed is None:
|
34 |
-
seed = torch.randint(0, 2**63 - 1, []).item()
|
35 |
-
self.batched = True
|
36 |
-
try:
|
37 |
-
assert len(seed) == x.shape[0]
|
38 |
-
w0 = w0[0]
|
39 |
-
except TypeError:
|
40 |
-
seed = [seed]
|
41 |
-
self.batched = False
|
42 |
-
self.trees = [torchsde.BrownianTree(t0, w0, t1, entropy=s, **kwargs) for s in seed]
|
43 |
-
|
44 |
-
@staticmethod
|
45 |
-
def sort(a, b):
|
46 |
-
return (a, b, 1) if a < b else (b, a, -1)
|
47 |
-
|
48 |
-
def __call__(self, t0, t1):
|
49 |
-
t0, t1, sign = self.sort(t0, t1)
|
50 |
-
w = torch.stack([tree(t0, t1) for tree in self.trees]) * (self.sign * sign)
|
51 |
-
return w if self.batched else w[0]
|
52 |
-
|
53 |
-
|
54 |
-
class BrownianTreeNoiseSampler:
|
55 |
-
"""A noise sampler backed by a torchsde.BrownianTree.
|
56 |
-
|
57 |
-
Args:
|
58 |
-
x (Tensor): The tensor whose shape, device and dtype to use to generate
|
59 |
-
random samples.
|
60 |
-
sigma_min (float): The low end of the valid interval.
|
61 |
-
sigma_max (float): The high end of the valid interval.
|
62 |
-
seed (int or List[int]): The random seed. If a list of seeds is
|
63 |
-
supplied instead of a single integer, then the noise sampler will use one BrownianTree per batch item, each
|
64 |
-
with its own seed.
|
65 |
-
transform (callable): A function that maps sigma to the sampler's
|
66 |
-
internal timestep.
|
67 |
-
"""
|
68 |
-
|
69 |
-
def __init__(self, x, sigma_min, sigma_max, seed=None, transform=lambda x: x):
|
70 |
-
self.transform = transform
|
71 |
-
t0, t1 = self.transform(torch.as_tensor(sigma_min)), self.transform(torch.as_tensor(sigma_max))
|
72 |
-
self.tree = BatchedBrownianTree(x, t0, t1, seed)
|
73 |
-
|
74 |
-
def __call__(self, sigma, sigma_next):
|
75 |
-
t0, t1 = self.transform(torch.as_tensor(sigma)), self.transform(torch.as_tensor(sigma_next))
|
76 |
-
return self.tree(t0, t1) / (t1 - t0).abs().sqrt()
|
77 |
-
|
78 |
-
|
79 |
-
# Copied from diffusers.schedulers.scheduling_ddpm.betas_for_alpha_bar
|
80 |
-
def betas_for_alpha_bar(
|
81 |
-
num_diffusion_timesteps,
|
82 |
-
max_beta=0.999,
|
83 |
-
alpha_transform_type="cosine",
|
84 |
-
):
|
85 |
-
"""
|
86 |
-
Create a beta schedule that discretizes the given alpha_t_bar function, which defines the cumulative product of
|
87 |
-
(1-beta) over time from t = [0,1].
|
88 |
-
|
89 |
-
Contains a function alpha_bar that takes an argument t and transforms it to the cumulative product of (1-beta) up
|
90 |
-
to that part of the diffusion process.
|
91 |
-
|
92 |
-
|
93 |
-
Args:
|
94 |
-
num_diffusion_timesteps (`int`): the number of betas to produce.
|
95 |
-
max_beta (`float`): the maximum beta to use; use values lower than 1 to
|
96 |
-
prevent singularities.
|
97 |
-
alpha_transform_type (`str`, *optional*, default to `cosine`): the type of noise schedule for alpha_bar.
|
98 |
-
Choose from `cosine` or `exp`
|
99 |
-
|
100 |
-
Returns:
|
101 |
-
betas (`np.ndarray`): the betas used by the scheduler to step the model outputs
|
102 |
-
"""
|
103 |
-
if alpha_transform_type == "cosine":
|
104 |
-
|
105 |
-
def alpha_bar_fn(t):
|
106 |
-
return math.cos((t + 0.008) / 1.008 * math.pi / 2) ** 2
|
107 |
-
|
108 |
-
elif alpha_transform_type == "exp":
|
109 |
-
|
110 |
-
def alpha_bar_fn(t):
|
111 |
-
return math.exp(t * -12.0)
|
112 |
-
|
113 |
-
else:
|
114 |
-
raise ValueError(f"Unsupported alpha_tranform_type: {alpha_transform_type}")
|
115 |
-
|
116 |
-
betas = []
|
117 |
-
for i in range(num_diffusion_timesteps):
|
118 |
-
t1 = i / num_diffusion_timesteps
|
119 |
-
t2 = (i + 1) / num_diffusion_timesteps
|
120 |
-
betas.append(min(1 - alpha_bar_fn(t2) / alpha_bar_fn(t1), max_beta))
|
121 |
-
return torch.tensor(betas, dtype=torch.float32)
|
122 |
-
|
123 |
-
|
124 |
-
class DPMSolverSDEScheduler(SchedulerMixin, ConfigMixin):
|
125 |
-
"""
|
126 |
-
Implements Stochastic Sampler (Algorithm 2) from Karras et al. (2022). Based on the original k-diffusion
|
127 |
-
implementation by Katherine Crowson:
|
128 |
-
https://github.com/crowsonkb/k-diffusion/blob/41b4cb6df0506694a7776af31349acf082bf6091/k_diffusion/sampling.py#L543
|
129 |
-
|
130 |
-
[`~ConfigMixin`] takes care of storing all config attributes that are passed in the scheduler's `__init__`
|
131 |
-
function, such as `num_train_timesteps`. They can be accessed via `scheduler.config.num_train_timesteps`.
|
132 |
-
[`SchedulerMixin`] provides general loading and saving functionality via the [`SchedulerMixin.save_pretrained`] and
|
133 |
-
[`~SchedulerMixin.from_pretrained`] functions.
|
134 |
-
|
135 |
-
Args:
|
136 |
-
num_train_timesteps (`int`): number of diffusion steps used to train the model. beta_start (`float`): the
|
137 |
-
starting `beta` value of inference. beta_end (`float`): the final `beta` value. beta_schedule (`str`):
|
138 |
-
the beta schedule, a mapping from a beta range to a sequence of betas for stepping the model. Choose from
|
139 |
-
`linear` or `scaled_linear`.
|
140 |
-
trained_betas (`np.ndarray`, optional):
|
141 |
-
option to pass an array of betas directly to the constructor to bypass `beta_start`, `beta_end` etc.
|
142 |
-
prediction_type (`str`, default `epsilon`, optional):
|
143 |
-
prediction type of the scheduler function, one of `epsilon` (predicting the noise of the diffusion
|
144 |
-
process), `sample` (directly predicting the noisy sample`) or `v_prediction` (see section 2.4
|
145 |
-
https://imagen.research.google/video/paper.pdf)
|
146 |
-
use_karras_sigmas (`bool`, *optional*, defaults to `False`):
|
147 |
-
This parameter controls whether to use Karras sigmas (Karras et al. (2022) scheme) for step sizes in the
|
148 |
-
noise schedule during the sampling process. If True, the sigmas will be determined according to a sequence
|
149 |
-
of noise levels {σi} as defined in Equation (5) of the paper https://arxiv.org/pdf/2206.00364.pdf.
|
150 |
-
noise_sampler_seed (`int`, *optional*, defaults to `None`):
|
151 |
-
The random seed to use for the noise sampler. If `None`, a random seed will be generated.
|
152 |
-
timestep_spacing (`str`, default `"linspace"`):
|
153 |
-
The way the timesteps should be scaled. Refer to Table 2. of [Common Diffusion Noise Schedules and Sample
|
154 |
-
Steps are Flawed](https://arxiv.org/abs/2305.08891) for more information.
|
155 |
-
steps_offset (`int`, default `0`):
|
156 |
-
an offset added to the inference steps. You can use a combination of `offset=1` and
|
157 |
-
`set_alpha_to_one=False`, to make the last step use step 0 for the previous alpha product, as done in
|
158 |
-
stable diffusion.
|
159 |
-
"""
|
160 |
-
|
161 |
-
_compatibles = [e.name for e in KarrasDiffusionSchedulers]
|
162 |
-
order = 2
|
163 |
-
|
164 |
-
@register_to_config
|
165 |
-
def __init__(
|
166 |
-
self,
|
167 |
-
num_train_timesteps: int = 1000,
|
168 |
-
beta_start: float = 0.00085, # sensible defaults
|
169 |
-
beta_end: float = 0.012,
|
170 |
-
beta_schedule: str = "linear",
|
171 |
-
trained_betas: Optional[Union[np.ndarray, List[float]]] = None,
|
172 |
-
prediction_type: str = "epsilon",
|
173 |
-
use_karras_sigmas: Optional[bool] = False,
|
174 |
-
noise_sampler_seed: Optional[int] = None,
|
175 |
-
timestep_spacing: str = "linspace",
|
176 |
-
steps_offset: int = 0,
|
177 |
-
):
|
178 |
-
if trained_betas is not None:
|
179 |
-
self.betas = torch.tensor(trained_betas, dtype=torch.float32)
|
180 |
-
elif beta_schedule == "linear":
|
181 |
-
self.betas = torch.linspace(beta_start, beta_end, num_train_timesteps, dtype=torch.float32)
|
182 |
-
elif beta_schedule == "scaled_linear":
|
183 |
-
# this schedule is very specific to the latent diffusion model.
|
184 |
-
self.betas = (
|
185 |
-
torch.linspace(beta_start**0.5, beta_end**0.5, num_train_timesteps, dtype=torch.float32) ** 2
|
186 |
-
)
|
187 |
-
elif beta_schedule == "squaredcos_cap_v2":
|
188 |
-
# Glide cosine schedule
|
189 |
-
self.betas = betas_for_alpha_bar(num_train_timesteps)
|
190 |
-
else:
|
191 |
-
raise NotImplementedError(f"{beta_schedule} does is not implemented for {self.__class__}")
|
192 |
-
|
193 |
-
self.alphas = 1.0 - self.betas
|
194 |
-
self.alphas_cumprod = torch.cumprod(self.alphas, dim=0)
|
195 |
-
|
196 |
-
# set all values
|
197 |
-
self.set_timesteps(num_train_timesteps, None, num_train_timesteps)
|
198 |
-
self.use_karras_sigmas = use_karras_sigmas
|
199 |
-
self.noise_sampler = None
|
200 |
-
self.noise_sampler_seed = noise_sampler_seed
|
201 |
-
|
202 |
-
# Copied from diffusers.schedulers.scheduling_heun_discrete.HeunDiscreteScheduler.index_for_timestep
|
203 |
-
def index_for_timestep(self, timestep, schedule_timesteps=None):
|
204 |
-
if schedule_timesteps is None:
|
205 |
-
schedule_timesteps = self.timesteps
|
206 |
-
|
207 |
-
indices = (schedule_timesteps == timestep).nonzero()
|
208 |
-
|
209 |
-
# The sigma index that is taken for the **very** first `step`
|
210 |
-
# is always the second index (or the last index if there is only 1)
|
211 |
-
# This way we can ensure we don't accidentally skip a sigma in
|
212 |
-
# case we start in the middle of the denoising schedule (e.g. for image-to-image)
|
213 |
-
if len(self._index_counter) == 0:
|
214 |
-
pos = 1 if len(indices) > 1 else 0
|
215 |
-
else:
|
216 |
-
timestep_int = timestep.cpu().item() if torch.is_tensor(timestep) else timestep
|
217 |
-
pos = self._index_counter[timestep_int]
|
218 |
-
|
219 |
-
return indices[pos].item()
|
220 |
-
|
221 |
-
@property
|
222 |
-
def init_noise_sigma(self):
|
223 |
-
# standard deviation of the initial noise distribution
|
224 |
-
if self.config.timestep_spacing in ["linspace", "trailing"]:
|
225 |
-
return self.sigmas.max()
|
226 |
-
|
227 |
-
return (self.sigmas.max() ** 2 + 1) ** 0.5
|
228 |
-
|
229 |
-
def scale_model_input(
|
230 |
-
self,
|
231 |
-
sample: torch.FloatTensor,
|
232 |
-
timestep: Union[float, torch.FloatTensor],
|
233 |
-
) -> torch.FloatTensor:
|
234 |
-
"""
|
235 |
-
Args:
|
236 |
-
Ensures interchangeability with schedulers that need to scale the denoising model input depending on the
|
237 |
-
current timestep.
|
238 |
-
sample (`torch.FloatTensor`): input sample timestep (`int`, optional): current timestep
|
239 |
-
Returns:
|
240 |
-
`torch.FloatTensor`: scaled input sample
|
241 |
-
"""
|
242 |
-
step_index = self.index_for_timestep(timestep)
|
243 |
-
|
244 |
-
sigma = self.sigmas[step_index]
|
245 |
-
sigma_input = sigma if self.state_in_first_order else self.mid_point_sigma
|
246 |
-
sample = sample / ((sigma_input**2 + 1) ** 0.5)
|
247 |
-
return sample
|
248 |
-
|
249 |
-
def set_timesteps(
|
250 |
-
self,
|
251 |
-
num_inference_steps: int,
|
252 |
-
device: Union[str, torch.device] = None,
|
253 |
-
num_train_timesteps: Optional[int] = None,
|
254 |
-
):
|
255 |
-
"""
|
256 |
-
Sets the timesteps used for the diffusion chain. Supporting function to be run before inference.
|
257 |
-
|
258 |
-
Args:
|
259 |
-
num_inference_steps (`int`):
|
260 |
-
the number of diffusion steps used when generating samples with a pre-trained model.
|
261 |
-
device (`str` or `torch.device`, optional):
|
262 |
-
the device to which the timesteps should be moved to. If `None`, the timesteps are not moved.
|
263 |
-
"""
|
264 |
-
self.num_inference_steps = num_inference_steps
|
265 |
-
|
266 |
-
num_train_timesteps = num_train_timesteps or self.config.num_train_timesteps
|
267 |
-
|
268 |
-
# "linspace", "leading", "trailing" corresponds to annotation of Table 2. of https://arxiv.org/abs/2305.08891
|
269 |
-
if self.config.timestep_spacing == "linspace":
|
270 |
-
timesteps = np.linspace(0, num_train_timesteps - 1, num_inference_steps, dtype=float)[::-1].copy()
|
271 |
-
elif self.config.timestep_spacing == "leading":
|
272 |
-
step_ratio = num_train_timesteps // self.num_inference_steps
|
273 |
-
# creates integer timesteps by multiplying by ratio
|
274 |
-
# casting to int to avoid issues when num_inference_step is power of 3
|
275 |
-
timesteps = (np.arange(0, num_inference_steps) * step_ratio).round()[::-1].copy().astype(float)
|
276 |
-
timesteps += self.config.steps_offset
|
277 |
-
elif self.config.timestep_spacing == "trailing":
|
278 |
-
step_ratio = num_train_timesteps / self.num_inference_steps
|
279 |
-
# creates integer timesteps by multiplying by ratio
|
280 |
-
# casting to int to avoid issues when num_inference_step is power of 3
|
281 |
-
timesteps = (np.arange(num_train_timesteps, 0, -step_ratio)).round().copy().astype(float)
|
282 |
-
timesteps -= 1
|
283 |
-
else:
|
284 |
-
raise ValueError(
|
285 |
-
f"{self.config.timestep_spacing} is not supported. Please make sure to choose one of 'linspace', 'leading' or 'trailing'."
|
286 |
-
)
|
287 |
-
|
288 |
-
sigmas = np.array(((1 - self.alphas_cumprod) / self.alphas_cumprod) ** 0.5)
|
289 |
-
log_sigmas = np.log(sigmas)
|
290 |
-
sigmas = np.interp(timesteps, np.arange(0, len(sigmas)), sigmas)
|
291 |
-
|
292 |
-
if self.use_karras_sigmas:
|
293 |
-
sigmas = self._convert_to_karras(in_sigmas=sigmas)
|
294 |
-
timesteps = np.array([self._sigma_to_t(sigma, log_sigmas) for sigma in sigmas])
|
295 |
-
|
296 |
-
second_order_timesteps = self._second_order_timesteps(sigmas, log_sigmas)
|
297 |
-
|
298 |
-
sigmas = np.concatenate([sigmas, [0.0]]).astype(np.float32)
|
299 |
-
sigmas = torch.from_numpy(sigmas).to(device=device)
|
300 |
-
self.sigmas = torch.cat([sigmas[:1], sigmas[1:-1].repeat_interleave(2), sigmas[-1:]])
|
301 |
-
|
302 |
-
timesteps = torch.from_numpy(timesteps)
|
303 |
-
second_order_timesteps = torch.from_numpy(second_order_timesteps)
|
304 |
-
timesteps = torch.cat([timesteps[:1], timesteps[1:].repeat_interleave(2)])
|
305 |
-
timesteps[1::2] = second_order_timesteps
|
306 |
-
|
307 |
-
if str(device).startswith("mps"):
|
308 |
-
# mps does not support float64
|
309 |
-
self.timesteps = timesteps.to(device, dtype=torch.float32)
|
310 |
-
else:
|
311 |
-
self.timesteps = timesteps.to(device=device)
|
312 |
-
|
313 |
-
# empty first order variables
|
314 |
-
self.sample = None
|
315 |
-
self.mid_point_sigma = None
|
316 |
-
|
317 |
-
# for exp beta schedules, such as the one for `pipeline_shap_e.py`
|
318 |
-
# we need an index counter
|
319 |
-
self._index_counter = defaultdict(int)
|
320 |
-
|
321 |
-
def _second_order_timesteps(self, sigmas, log_sigmas):
|
322 |
-
def sigma_fn(_t):
|
323 |
-
return np.exp(-_t)
|
324 |
-
|
325 |
-
def t_fn(_sigma):
|
326 |
-
return -np.log(_sigma)
|
327 |
-
|
328 |
-
midpoint_ratio = 0.5
|
329 |
-
t = t_fn(sigmas)
|
330 |
-
delta_time = np.diff(t)
|
331 |
-
t_proposed = t[:-1] + delta_time * midpoint_ratio
|
332 |
-
sig_proposed = sigma_fn(t_proposed)
|
333 |
-
timesteps = np.array([self._sigma_to_t(sigma, log_sigmas) for sigma in sig_proposed])
|
334 |
-
return timesteps
|
335 |
-
|
336 |
-
# copied from diffusers.schedulers.scheduling_euler_discrete._sigma_to_t
|
337 |
-
def _sigma_to_t(self, sigma, log_sigmas):
|
338 |
-
# get log sigma
|
339 |
-
log_sigma = np.log(sigma)
|
340 |
-
|
341 |
-
# get distribution
|
342 |
-
dists = log_sigma - log_sigmas[:, np.newaxis]
|
343 |
-
|
344 |
-
# get sigmas range
|
345 |
-
low_idx = np.cumsum((dists >= 0), axis=0).argmax(axis=0).clip(max=log_sigmas.shape[0] - 2)
|
346 |
-
high_idx = low_idx + 1
|
347 |
-
|
348 |
-
low = log_sigmas[low_idx]
|
349 |
-
high = log_sigmas[high_idx]
|
350 |
-
|
351 |
-
# interpolate sigmas
|
352 |
-
w = (low - log_sigma) / (low - high)
|
353 |
-
w = np.clip(w, 0, 1)
|
354 |
-
|
355 |
-
# transform interpolation to time range
|
356 |
-
t = (1 - w) * low_idx + w * high_idx
|
357 |
-
t = t.reshape(sigma.shape)
|
358 |
-
return t
|
359 |
-
|
360 |
-
# copied from diffusers.schedulers.scheduling_euler_discrete._convert_to_karras
|
361 |
-
def _convert_to_karras(self, in_sigmas: torch.FloatTensor) -> torch.FloatTensor:
|
362 |
-
"""Constructs the noise schedule of Karras et al. (2022)."""
|
363 |
-
|
364 |
-
sigma_min: float = in_sigmas[-1].item()
|
365 |
-
sigma_max: float = in_sigmas[0].item()
|
366 |
-
|
367 |
-
rho = 7.0 # 7.0 is the value used in the paper
|
368 |
-
ramp = np.linspace(0, 1, self.num_inference_steps)
|
369 |
-
min_inv_rho = sigma_min ** (1 / rho)
|
370 |
-
max_inv_rho = sigma_max ** (1 / rho)
|
371 |
-
sigmas = (max_inv_rho + ramp * (min_inv_rho - max_inv_rho)) ** rho
|
372 |
-
return sigmas
|
373 |
-
|
374 |
-
@property
|
375 |
-
def state_in_first_order(self):
|
376 |
-
return self.sample is None
|
377 |
-
|
378 |
-
def step(
|
379 |
-
self,
|
380 |
-
model_output: Union[torch.FloatTensor, np.ndarray],
|
381 |
-
timestep: Union[float, torch.FloatTensor],
|
382 |
-
sample: Union[torch.FloatTensor, np.ndarray],
|
383 |
-
return_dict: bool = True,
|
384 |
-
s_noise: float = 1.0,
|
385 |
-
) -> Union[SchedulerOutput, Tuple]:
|
386 |
-
"""
|
387 |
-
Args:
|
388 |
-
Predict the sample at the previous timestep by reversing the SDE. Core function to propagate the diffusion
|
389 |
-
process from the learned model outputs (most often the predicted noise).
|
390 |
-
model_output (Union[torch.FloatTensor, np.ndarray]): Direct output from learned diffusion model.
|
391 |
-
timestep (Union[float, torch.FloatTensor]): Current discrete timestep in the diffusion chain.
|
392 |
-
sample (Union[torch.FloatTensor, np.ndarray]): Current instance of sample being created by diffusion process.
|
393 |
-
return_dict (bool, optional): Option for returning tuple rather than SchedulerOutput class. Defaults to True.
|
394 |
-
s_noise (float, optional): Scaling factor for the noise added to the sample. Defaults to 1.0.
|
395 |
-
Returns:
|
396 |
-
[`~schedulers.scheduling_utils.SchedulerOutput`] or `tuple`:
|
397 |
-
[`~schedulers.scheduling_utils.SchedulerOutput`] if `return_dict` is True, otherwise a `tuple`. When
|
398 |
-
returning a tuple, the first element is the sample tensor.
|
399 |
-
"""
|
400 |
-
step_index = self.index_for_timestep(timestep)
|
401 |
-
|
402 |
-
# advance index counter by 1
|
403 |
-
timestep_int = timestep.cpu().item() if torch.is_tensor(timestep) else timestep
|
404 |
-
self._index_counter[timestep_int] += 1
|
405 |
-
|
406 |
-
# Create a noise sampler if it hasn't been created yet
|
407 |
-
if self.noise_sampler is None:
|
408 |
-
min_sigma, max_sigma = self.sigmas[self.sigmas > 0].min(), self.sigmas.max()
|
409 |
-
self.noise_sampler = BrownianTreeNoiseSampler(sample, min_sigma, max_sigma, self.noise_sampler_seed)
|
410 |
-
|
411 |
-
# Define functions to compute sigma and t from each other
|
412 |
-
def sigma_fn(_t: torch.FloatTensor) -> torch.FloatTensor:
|
413 |
-
return _t.neg().exp()
|
414 |
-
|
415 |
-
def t_fn(_sigma: torch.FloatTensor) -> torch.FloatTensor:
|
416 |
-
return _sigma.log().neg()
|
417 |
-
|
418 |
-
if self.state_in_first_order:
|
419 |
-
sigma = self.sigmas[step_index]
|
420 |
-
sigma_next = self.sigmas[step_index + 1]
|
421 |
-
else:
|
422 |
-
# 2nd order
|
423 |
-
sigma = self.sigmas[step_index - 1]
|
424 |
-
sigma_next = self.sigmas[step_index]
|
425 |
-
|
426 |
-
# Set the midpoint and step size for the current step
|
427 |
-
midpoint_ratio = 0.5
|
428 |
-
t, t_next = t_fn(sigma), t_fn(sigma_next)
|
429 |
-
delta_time = t_next - t
|
430 |
-
t_proposed = t + delta_time * midpoint_ratio
|
431 |
-
|
432 |
-
# 1. compute predicted original sample (x_0) from sigma-scaled predicted noise
|
433 |
-
if self.config.prediction_type == "epsilon":
|
434 |
-
sigma_input = sigma if self.state_in_first_order else sigma_fn(t_proposed)
|
435 |
-
pred_original_sample = sample - sigma_input * model_output
|
436 |
-
elif self.config.prediction_type == "v_prediction":
|
437 |
-
sigma_input = sigma if self.state_in_first_order else sigma_fn(t_proposed)
|
438 |
-
pred_original_sample = model_output * (-sigma_input / (sigma_input**2 + 1) ** 0.5) + (
|
439 |
-
sample / (sigma_input**2 + 1)
|
440 |
-
)
|
441 |
-
elif self.config.prediction_type == "sample":
|
442 |
-
raise NotImplementedError("prediction_type not implemented yet: sample")
|
443 |
-
else:
|
444 |
-
raise ValueError(
|
445 |
-
f"prediction_type given as {self.config.prediction_type} must be one of `epsilon`, or `v_prediction`"
|
446 |
-
)
|
447 |
-
|
448 |
-
if sigma_next == 0:
|
449 |
-
derivative = (sample - pred_original_sample) / sigma
|
450 |
-
dt = sigma_next - sigma
|
451 |
-
prev_sample = sample + derivative * dt
|
452 |
-
else:
|
453 |
-
if self.state_in_first_order:
|
454 |
-
t_next = t_proposed
|
455 |
-
else:
|
456 |
-
sample = self.sample
|
457 |
-
|
458 |
-
sigma_from = sigma_fn(t)
|
459 |
-
sigma_to = sigma_fn(t_next)
|
460 |
-
sigma_up = min(sigma_to, (sigma_to**2 * (sigma_from**2 - sigma_to**2) / sigma_from**2) ** 0.5)
|
461 |
-
sigma_down = (sigma_to**2 - sigma_up**2) ** 0.5
|
462 |
-
ancestral_t = t_fn(sigma_down)
|
463 |
-
prev_sample = (sigma_fn(ancestral_t) / sigma_fn(t)) * sample - (
|
464 |
-
t - ancestral_t
|
465 |
-
).expm1() * pred_original_sample
|
466 |
-
prev_sample = prev_sample + self.noise_sampler(sigma_fn(t), sigma_fn(t_next)) * s_noise * sigma_up
|
467 |
-
|
468 |
-
if self.state_in_first_order:
|
469 |
-
# store for 2nd order step
|
470 |
-
self.sample = sample
|
471 |
-
self.mid_point_sigma = sigma_fn(t_next)
|
472 |
-
else:
|
473 |
-
# free for "first order mode"
|
474 |
-
self.sample = None
|
475 |
-
self.mid_point_sigma = None
|
476 |
-
|
477 |
-
if not return_dict:
|
478 |
-
return (prev_sample,)
|
479 |
-
|
480 |
-
return SchedulerOutput(prev_sample=prev_sample)
|
481 |
-
|
482 |
-
# Copied from diffusers.schedulers.scheduling_heun_discrete.HeunDiscreteScheduler.add_noise
|
483 |
-
def add_noise(
|
484 |
-
self,
|
485 |
-
original_samples: torch.FloatTensor,
|
486 |
-
noise: torch.FloatTensor,
|
487 |
-
timesteps: torch.FloatTensor,
|
488 |
-
) -> torch.FloatTensor:
|
489 |
-
# Make sure sigmas and timesteps have the same device and dtype as original_samples
|
490 |
-
sigmas = self.sigmas.to(device=original_samples.device, dtype=original_samples.dtype)
|
491 |
-
if original_samples.device.type == "mps" and torch.is_floating_point(timesteps):
|
492 |
-
# mps does not support float64
|
493 |
-
schedule_timesteps = self.timesteps.to(original_samples.device, dtype=torch.float32)
|
494 |
-
timesteps = timesteps.to(original_samples.device, dtype=torch.float32)
|
495 |
-
else:
|
496 |
-
schedule_timesteps = self.timesteps.to(original_samples.device)
|
497 |
-
timesteps = timesteps.to(original_samples.device)
|
498 |
-
|
499 |
-
step_indices = [self.index_for_timestep(t, schedule_timesteps) for t in timesteps]
|
500 |
-
|
501 |
-
sigma = sigmas[step_indices].flatten()
|
502 |
-
while len(sigma.shape) < len(original_samples.shape):
|
503 |
-
sigma = sigma.unsqueeze(-1)
|
504 |
-
|
505 |
-
noisy_samples = original_samples + noise * sigma
|
506 |
-
return noisy_samples
|
507 |
-
|
508 |
-
def __len__(self):
|
509 |
-
return self.config.num_train_timesteps
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/tests/pipelines/deepfloyd_if/test_if.py
DELETED
@@ -1,346 +0,0 @@
|
|
1 |
-
# coding=utf-8
|
2 |
-
# Copyright 2023 HuggingFace Inc.
|
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 |
-
import gc
|
17 |
-
import random
|
18 |
-
import unittest
|
19 |
-
|
20 |
-
import torch
|
21 |
-
|
22 |
-
from diffusers import (
|
23 |
-
IFImg2ImgPipeline,
|
24 |
-
IFImg2ImgSuperResolutionPipeline,
|
25 |
-
IFInpaintingPipeline,
|
26 |
-
IFInpaintingSuperResolutionPipeline,
|
27 |
-
IFPipeline,
|
28 |
-
IFSuperResolutionPipeline,
|
29 |
-
)
|
30 |
-
from diffusers.models.attention_processor import AttnAddedKVProcessor
|
31 |
-
from diffusers.utils.import_utils import is_xformers_available
|
32 |
-
from diffusers.utils.testing_utils import floats_tensor, load_numpy, require_torch_gpu, skip_mps, slow, torch_device
|
33 |
-
|
34 |
-
from ..pipeline_params import TEXT_TO_IMAGE_BATCH_PARAMS, TEXT_TO_IMAGE_PARAMS
|
35 |
-
from ..test_pipelines_common import PipelineTesterMixin, assert_mean_pixel_difference
|
36 |
-
from . import IFPipelineTesterMixin
|
37 |
-
|
38 |
-
|
39 |
-
@skip_mps
|
40 |
-
class IFPipelineFastTests(PipelineTesterMixin, IFPipelineTesterMixin, unittest.TestCase):
|
41 |
-
pipeline_class = IFPipeline
|
42 |
-
params = TEXT_TO_IMAGE_PARAMS - {"width", "height", "latents"}
|
43 |
-
batch_params = TEXT_TO_IMAGE_BATCH_PARAMS
|
44 |
-
required_optional_params = PipelineTesterMixin.required_optional_params - {"latents"}
|
45 |
-
|
46 |
-
def get_dummy_components(self):
|
47 |
-
return self._get_dummy_components()
|
48 |
-
|
49 |
-
def get_dummy_inputs(self, device, seed=0):
|
50 |
-
if str(device).startswith("mps"):
|
51 |
-
generator = torch.manual_seed(seed)
|
52 |
-
else:
|
53 |
-
generator = torch.Generator(device=device).manual_seed(seed)
|
54 |
-
|
55 |
-
inputs = {
|
56 |
-
"prompt": "A painting of a squirrel eating a burger",
|
57 |
-
"generator": generator,
|
58 |
-
"num_inference_steps": 2,
|
59 |
-
"output_type": "numpy",
|
60 |
-
}
|
61 |
-
|
62 |
-
return inputs
|
63 |
-
|
64 |
-
def test_save_load_optional_components(self):
|
65 |
-
self._test_save_load_optional_components()
|
66 |
-
|
67 |
-
@unittest.skipIf(torch_device != "cuda", reason="float16 requires CUDA")
|
68 |
-
def test_save_load_float16(self):
|
69 |
-
# Due to non-determinism in save load of the hf-internal-testing/tiny-random-t5 text encoder
|
70 |
-
super().test_save_load_float16(expected_max_diff=1e-1)
|
71 |
-
|
72 |
-
def test_attention_slicing_forward_pass(self):
|
73 |
-
self._test_attention_slicing_forward_pass(expected_max_diff=1e-2)
|
74 |
-
|
75 |
-
def test_save_load_local(self):
|
76 |
-
self._test_save_load_local()
|
77 |
-
|
78 |
-
def test_inference_batch_single_identical(self):
|
79 |
-
self._test_inference_batch_single_identical(
|
80 |
-
expected_max_diff=1e-2,
|
81 |
-
)
|
82 |
-
|
83 |
-
@unittest.skipIf(
|
84 |
-
torch_device != "cuda" or not is_xformers_available(),
|
85 |
-
reason="XFormers attention is only available with CUDA and `xformers` installed",
|
86 |
-
)
|
87 |
-
def test_xformers_attention_forwardGenerator_pass(self):
|
88 |
-
self._test_xformers_attention_forwardGenerator_pass(expected_max_diff=1e-3)
|
89 |
-
|
90 |
-
|
91 |
-
@slow
|
92 |
-
@require_torch_gpu
|
93 |
-
class IFPipelineSlowTests(unittest.TestCase):
|
94 |
-
def tearDown(self):
|
95 |
-
# clean up the VRAM after each test
|
96 |
-
super().tearDown()
|
97 |
-
gc.collect()
|
98 |
-
torch.cuda.empty_cache()
|
99 |
-
|
100 |
-
def test_all(self):
|
101 |
-
# if
|
102 |
-
|
103 |
-
pipe_1 = IFPipeline.from_pretrained("DeepFloyd/IF-I-XL-v1.0", variant="fp16", torch_dtype=torch.float16)
|
104 |
-
|
105 |
-
pipe_2 = IFSuperResolutionPipeline.from_pretrained(
|
106 |
-
"DeepFloyd/IF-II-L-v1.0", variant="fp16", torch_dtype=torch.float16, text_encoder=None, tokenizer=None
|
107 |
-
)
|
108 |
-
|
109 |
-
# pre compute text embeddings and remove T5 to save memory
|
110 |
-
|
111 |
-
pipe_1.text_encoder.to("cuda")
|
112 |
-
|
113 |
-
prompt_embeds, negative_prompt_embeds = pipe_1.encode_prompt("anime turtle", device="cuda")
|
114 |
-
|
115 |
-
del pipe_1.tokenizer
|
116 |
-
del pipe_1.text_encoder
|
117 |
-
gc.collect()
|
118 |
-
|
119 |
-
pipe_1.tokenizer = None
|
120 |
-
pipe_1.text_encoder = None
|
121 |
-
|
122 |
-
pipe_1.enable_model_cpu_offload()
|
123 |
-
pipe_2.enable_model_cpu_offload()
|
124 |
-
|
125 |
-
pipe_1.unet.set_attn_processor(AttnAddedKVProcessor())
|
126 |
-
pipe_2.unet.set_attn_processor(AttnAddedKVProcessor())
|
127 |
-
|
128 |
-
self._test_if(pipe_1, pipe_2, prompt_embeds, negative_prompt_embeds)
|
129 |
-
|
130 |
-
pipe_1.remove_all_hooks()
|
131 |
-
pipe_2.remove_all_hooks()
|
132 |
-
|
133 |
-
# img2img
|
134 |
-
|
135 |
-
pipe_1 = IFImg2ImgPipeline(**pipe_1.components)
|
136 |
-
pipe_2 = IFImg2ImgSuperResolutionPipeline(**pipe_2.components)
|
137 |
-
|
138 |
-
pipe_1.enable_model_cpu_offload()
|
139 |
-
pipe_2.enable_model_cpu_offload()
|
140 |
-
|
141 |
-
pipe_1.unet.set_attn_processor(AttnAddedKVProcessor())
|
142 |
-
pipe_2.unet.set_attn_processor(AttnAddedKVProcessor())
|
143 |
-
|
144 |
-
self._test_if_img2img(pipe_1, pipe_2, prompt_embeds, negative_prompt_embeds)
|
145 |
-
|
146 |
-
pipe_1.remove_all_hooks()
|
147 |
-
pipe_2.remove_all_hooks()
|
148 |
-
|
149 |
-
# inpainting
|
150 |
-
|
151 |
-
pipe_1 = IFInpaintingPipeline(**pipe_1.components)
|
152 |
-
pipe_2 = IFInpaintingSuperResolutionPipeline(**pipe_2.components)
|
153 |
-
|
154 |
-
pipe_1.enable_model_cpu_offload()
|
155 |
-
pipe_2.enable_model_cpu_offload()
|
156 |
-
|
157 |
-
pipe_1.unet.set_attn_processor(AttnAddedKVProcessor())
|
158 |
-
pipe_2.unet.set_attn_processor(AttnAddedKVProcessor())
|
159 |
-
|
160 |
-
self._test_if_inpainting(pipe_1, pipe_2, prompt_embeds, negative_prompt_embeds)
|
161 |
-
|
162 |
-
def _test_if(self, pipe_1, pipe_2, prompt_embeds, negative_prompt_embeds):
|
163 |
-
# pipeline 1
|
164 |
-
|
165 |
-
_start_torch_memory_measurement()
|
166 |
-
|
167 |
-
generator = torch.Generator(device="cpu").manual_seed(0)
|
168 |
-
output = pipe_1(
|
169 |
-
prompt_embeds=prompt_embeds,
|
170 |
-
negative_prompt_embeds=negative_prompt_embeds,
|
171 |
-
num_inference_steps=2,
|
172 |
-
generator=generator,
|
173 |
-
output_type="np",
|
174 |
-
)
|
175 |
-
|
176 |
-
image = output.images[0]
|
177 |
-
|
178 |
-
assert image.shape == (64, 64, 3)
|
179 |
-
|
180 |
-
mem_bytes = torch.cuda.max_memory_allocated()
|
181 |
-
assert mem_bytes < 13 * 10**9
|
182 |
-
|
183 |
-
expected_image = load_numpy(
|
184 |
-
"https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/if/test_if.npy"
|
185 |
-
)
|
186 |
-
assert_mean_pixel_difference(image, expected_image)
|
187 |
-
|
188 |
-
# pipeline 2
|
189 |
-
|
190 |
-
_start_torch_memory_measurement()
|
191 |
-
|
192 |
-
generator = torch.Generator(device="cpu").manual_seed(0)
|
193 |
-
|
194 |
-
image = floats_tensor((1, 3, 64, 64), rng=random.Random(0)).to(torch_device)
|
195 |
-
|
196 |
-
output = pipe_2(
|
197 |
-
prompt_embeds=prompt_embeds,
|
198 |
-
negative_prompt_embeds=negative_prompt_embeds,
|
199 |
-
image=image,
|
200 |
-
generator=generator,
|
201 |
-
num_inference_steps=2,
|
202 |
-
output_type="np",
|
203 |
-
)
|
204 |
-
|
205 |
-
image = output.images[0]
|
206 |
-
|
207 |
-
assert image.shape == (256, 256, 3)
|
208 |
-
|
209 |
-
mem_bytes = torch.cuda.max_memory_allocated()
|
210 |
-
assert mem_bytes < 4 * 10**9
|
211 |
-
|
212 |
-
expected_image = load_numpy(
|
213 |
-
"https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/if/test_if_superresolution_stage_II.npy"
|
214 |
-
)
|
215 |
-
assert_mean_pixel_difference(image, expected_image)
|
216 |
-
|
217 |
-
def _test_if_img2img(self, pipe_1, pipe_2, prompt_embeds, negative_prompt_embeds):
|
218 |
-
# pipeline 1
|
219 |
-
|
220 |
-
_start_torch_memory_measurement()
|
221 |
-
|
222 |
-
image = floats_tensor((1, 3, 64, 64), rng=random.Random(0)).to(torch_device)
|
223 |
-
|
224 |
-
generator = torch.Generator(device="cpu").manual_seed(0)
|
225 |
-
|
226 |
-
output = pipe_1(
|
227 |
-
prompt_embeds=prompt_embeds,
|
228 |
-
negative_prompt_embeds=negative_prompt_embeds,
|
229 |
-
image=image,
|
230 |
-
num_inference_steps=2,
|
231 |
-
generator=generator,
|
232 |
-
output_type="np",
|
233 |
-
)
|
234 |
-
|
235 |
-
image = output.images[0]
|
236 |
-
|
237 |
-
assert image.shape == (64, 64, 3)
|
238 |
-
|
239 |
-
mem_bytes = torch.cuda.max_memory_allocated()
|
240 |
-
assert mem_bytes < 10 * 10**9
|
241 |
-
|
242 |
-
expected_image = load_numpy(
|
243 |
-
"https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/if/test_if_img2img.npy"
|
244 |
-
)
|
245 |
-
assert_mean_pixel_difference(image, expected_image)
|
246 |
-
|
247 |
-
# pipeline 2
|
248 |
-
|
249 |
-
_start_torch_memory_measurement()
|
250 |
-
|
251 |
-
generator = torch.Generator(device="cpu").manual_seed(0)
|
252 |
-
|
253 |
-
original_image = floats_tensor((1, 3, 256, 256), rng=random.Random(0)).to(torch_device)
|
254 |
-
image = floats_tensor((1, 3, 64, 64), rng=random.Random(0)).to(torch_device)
|
255 |
-
|
256 |
-
output = pipe_2(
|
257 |
-
prompt_embeds=prompt_embeds,
|
258 |
-
negative_prompt_embeds=negative_prompt_embeds,
|
259 |
-
image=image,
|
260 |
-
original_image=original_image,
|
261 |
-
generator=generator,
|
262 |
-
num_inference_steps=2,
|
263 |
-
output_type="np",
|
264 |
-
)
|
265 |
-
|
266 |
-
image = output.images[0]
|
267 |
-
|
268 |
-
assert image.shape == (256, 256, 3)
|
269 |
-
|
270 |
-
mem_bytes = torch.cuda.max_memory_allocated()
|
271 |
-
assert mem_bytes < 4 * 10**9
|
272 |
-
|
273 |
-
expected_image = load_numpy(
|
274 |
-
"https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/if/test_if_img2img_superresolution_stage_II.npy"
|
275 |
-
)
|
276 |
-
assert_mean_pixel_difference(image, expected_image)
|
277 |
-
|
278 |
-
def _test_if_inpainting(self, pipe_1, pipe_2, prompt_embeds, negative_prompt_embeds):
|
279 |
-
# pipeline 1
|
280 |
-
|
281 |
-
_start_torch_memory_measurement()
|
282 |
-
|
283 |
-
image = floats_tensor((1, 3, 64, 64), rng=random.Random(0)).to(torch_device)
|
284 |
-
mask_image = floats_tensor((1, 3, 64, 64), rng=random.Random(1)).to(torch_device)
|
285 |
-
|
286 |
-
generator = torch.Generator(device="cpu").manual_seed(0)
|
287 |
-
output = pipe_1(
|
288 |
-
prompt_embeds=prompt_embeds,
|
289 |
-
negative_prompt_embeds=negative_prompt_embeds,
|
290 |
-
image=image,
|
291 |
-
mask_image=mask_image,
|
292 |
-
num_inference_steps=2,
|
293 |
-
generator=generator,
|
294 |
-
output_type="np",
|
295 |
-
)
|
296 |
-
|
297 |
-
image = output.images[0]
|
298 |
-
|
299 |
-
assert image.shape == (64, 64, 3)
|
300 |
-
|
301 |
-
mem_bytes = torch.cuda.max_memory_allocated()
|
302 |
-
assert mem_bytes < 10 * 10**9
|
303 |
-
|
304 |
-
expected_image = load_numpy(
|
305 |
-
"https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/if/test_if_inpainting.npy"
|
306 |
-
)
|
307 |
-
assert_mean_pixel_difference(image, expected_image)
|
308 |
-
|
309 |
-
# pipeline 2
|
310 |
-
|
311 |
-
_start_torch_memory_measurement()
|
312 |
-
|
313 |
-
generator = torch.Generator(device="cpu").manual_seed(0)
|
314 |
-
|
315 |
-
image = floats_tensor((1, 3, 64, 64), rng=random.Random(0)).to(torch_device)
|
316 |
-
original_image = floats_tensor((1, 3, 256, 256), rng=random.Random(0)).to(torch_device)
|
317 |
-
mask_image = floats_tensor((1, 3, 256, 256), rng=random.Random(1)).to(torch_device)
|
318 |
-
|
319 |
-
output = pipe_2(
|
320 |
-
prompt_embeds=prompt_embeds,
|
321 |
-
negative_prompt_embeds=negative_prompt_embeds,
|
322 |
-
image=image,
|
323 |
-
mask_image=mask_image,
|
324 |
-
original_image=original_image,
|
325 |
-
generator=generator,
|
326 |
-
num_inference_steps=2,
|
327 |
-
output_type="np",
|
328 |
-
)
|
329 |
-
|
330 |
-
image = output.images[0]
|
331 |
-
|
332 |
-
assert image.shape == (256, 256, 3)
|
333 |
-
|
334 |
-
mem_bytes = torch.cuda.max_memory_allocated()
|
335 |
-
assert mem_bytes < 4 * 10**9
|
336 |
-
|
337 |
-
expected_image = load_numpy(
|
338 |
-
"https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/if/test_if_inpainting_superresolution_stage_II.npy"
|
339 |
-
)
|
340 |
-
assert_mean_pixel_difference(image, expected_image)
|
341 |
-
|
342 |
-
|
343 |
-
def _start_torch_memory_measurement():
|
344 |
-
torch.cuda.empty_cache()
|
345 |
-
torch.cuda.reset_max_memory_allocated()
|
346 |
-
torch.cuda.reset_peak_memory_stats()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/tests/pipelines/stable_unclip/test_stable_unclip_img2img.py
DELETED
@@ -1,302 +0,0 @@
|
|
1 |
-
import gc
|
2 |
-
import random
|
3 |
-
import unittest
|
4 |
-
|
5 |
-
import numpy as np
|
6 |
-
import torch
|
7 |
-
from transformers import (
|
8 |
-
CLIPImageProcessor,
|
9 |
-
CLIPTextConfig,
|
10 |
-
CLIPTextModel,
|
11 |
-
CLIPTokenizer,
|
12 |
-
CLIPVisionConfig,
|
13 |
-
CLIPVisionModelWithProjection,
|
14 |
-
)
|
15 |
-
|
16 |
-
from diffusers import AutoencoderKL, DDIMScheduler, DDPMScheduler, StableUnCLIPImg2ImgPipeline, UNet2DConditionModel
|
17 |
-
from diffusers.pipelines.pipeline_utils import DiffusionPipeline
|
18 |
-
from diffusers.pipelines.stable_diffusion.stable_unclip_image_normalizer import StableUnCLIPImageNormalizer
|
19 |
-
from diffusers.utils.import_utils import is_xformers_available
|
20 |
-
from diffusers.utils.testing_utils import (
|
21 |
-
enable_full_determinism,
|
22 |
-
floats_tensor,
|
23 |
-
load_image,
|
24 |
-
load_numpy,
|
25 |
-
require_torch_gpu,
|
26 |
-
skip_mps,
|
27 |
-
slow,
|
28 |
-
torch_device,
|
29 |
-
)
|
30 |
-
|
31 |
-
from ..pipeline_params import TEXT_GUIDED_IMAGE_VARIATION_BATCH_PARAMS, TEXT_GUIDED_IMAGE_VARIATION_PARAMS
|
32 |
-
from ..test_pipelines_common import (
|
33 |
-
PipelineKarrasSchedulerTesterMixin,
|
34 |
-
PipelineLatentTesterMixin,
|
35 |
-
PipelineTesterMixin,
|
36 |
-
assert_mean_pixel_difference,
|
37 |
-
)
|
38 |
-
|
39 |
-
|
40 |
-
enable_full_determinism()
|
41 |
-
|
42 |
-
|
43 |
-
class StableUnCLIPImg2ImgPipelineFastTests(
|
44 |
-
PipelineLatentTesterMixin, PipelineKarrasSchedulerTesterMixin, PipelineTesterMixin, unittest.TestCase
|
45 |
-
):
|
46 |
-
pipeline_class = StableUnCLIPImg2ImgPipeline
|
47 |
-
params = TEXT_GUIDED_IMAGE_VARIATION_PARAMS
|
48 |
-
batch_params = TEXT_GUIDED_IMAGE_VARIATION_BATCH_PARAMS
|
49 |
-
image_params = frozenset(
|
50 |
-
[]
|
51 |
-
) # TO-DO: update image_params once pipeline is refactored with VaeImageProcessor.preprocess
|
52 |
-
image_latents_params = frozenset([])
|
53 |
-
|
54 |
-
def get_dummy_components(self):
|
55 |
-
embedder_hidden_size = 32
|
56 |
-
embedder_projection_dim = embedder_hidden_size
|
57 |
-
|
58 |
-
# image encoding components
|
59 |
-
|
60 |
-
feature_extractor = CLIPImageProcessor(crop_size=32, size=32)
|
61 |
-
|
62 |
-
torch.manual_seed(0)
|
63 |
-
image_encoder = CLIPVisionModelWithProjection(
|
64 |
-
CLIPVisionConfig(
|
65 |
-
hidden_size=embedder_hidden_size,
|
66 |
-
projection_dim=embedder_projection_dim,
|
67 |
-
num_hidden_layers=5,
|
68 |
-
num_attention_heads=4,
|
69 |
-
image_size=32,
|
70 |
-
intermediate_size=37,
|
71 |
-
patch_size=1,
|
72 |
-
)
|
73 |
-
)
|
74 |
-
|
75 |
-
# regular denoising components
|
76 |
-
|
77 |
-
torch.manual_seed(0)
|
78 |
-
image_normalizer = StableUnCLIPImageNormalizer(embedding_dim=embedder_hidden_size)
|
79 |
-
image_noising_scheduler = DDPMScheduler(beta_schedule="squaredcos_cap_v2")
|
80 |
-
|
81 |
-
torch.manual_seed(0)
|
82 |
-
tokenizer = CLIPTokenizer.from_pretrained("hf-internal-testing/tiny-random-clip")
|
83 |
-
|
84 |
-
torch.manual_seed(0)
|
85 |
-
text_encoder = CLIPTextModel(
|
86 |
-
CLIPTextConfig(
|
87 |
-
bos_token_id=0,
|
88 |
-
eos_token_id=2,
|
89 |
-
hidden_size=embedder_hidden_size,
|
90 |
-
projection_dim=32,
|
91 |
-
intermediate_size=37,
|
92 |
-
layer_norm_eps=1e-05,
|
93 |
-
num_attention_heads=4,
|
94 |
-
num_hidden_layers=5,
|
95 |
-
pad_token_id=1,
|
96 |
-
vocab_size=1000,
|
97 |
-
)
|
98 |
-
)
|
99 |
-
|
100 |
-
torch.manual_seed(0)
|
101 |
-
unet = UNet2DConditionModel(
|
102 |
-
sample_size=32,
|
103 |
-
in_channels=4,
|
104 |
-
out_channels=4,
|
105 |
-
down_block_types=("CrossAttnDownBlock2D", "DownBlock2D"),
|
106 |
-
up_block_types=("UpBlock2D", "CrossAttnUpBlock2D"),
|
107 |
-
block_out_channels=(32, 64),
|
108 |
-
attention_head_dim=(2, 4),
|
109 |
-
class_embed_type="projection",
|
110 |
-
# The class embeddings are the noise augmented image embeddings.
|
111 |
-
# I.e. the image embeddings concated with the noised embeddings of the same dimension
|
112 |
-
projection_class_embeddings_input_dim=embedder_projection_dim * 2,
|
113 |
-
cross_attention_dim=embedder_hidden_size,
|
114 |
-
layers_per_block=1,
|
115 |
-
upcast_attention=True,
|
116 |
-
use_linear_projection=True,
|
117 |
-
)
|
118 |
-
|
119 |
-
torch.manual_seed(0)
|
120 |
-
scheduler = DDIMScheduler(
|
121 |
-
beta_schedule="scaled_linear",
|
122 |
-
beta_start=0.00085,
|
123 |
-
beta_end=0.012,
|
124 |
-
prediction_type="v_prediction",
|
125 |
-
set_alpha_to_one=False,
|
126 |
-
steps_offset=1,
|
127 |
-
)
|
128 |
-
|
129 |
-
torch.manual_seed(0)
|
130 |
-
vae = AutoencoderKL()
|
131 |
-
|
132 |
-
components = {
|
133 |
-
# image encoding components
|
134 |
-
"feature_extractor": feature_extractor,
|
135 |
-
"image_encoder": image_encoder.eval(),
|
136 |
-
# image noising components
|
137 |
-
"image_normalizer": image_normalizer.eval(),
|
138 |
-
"image_noising_scheduler": image_noising_scheduler,
|
139 |
-
# regular denoising components
|
140 |
-
"tokenizer": tokenizer,
|
141 |
-
"text_encoder": text_encoder.eval(),
|
142 |
-
"unet": unet.eval(),
|
143 |
-
"scheduler": scheduler,
|
144 |
-
"vae": vae.eval(),
|
145 |
-
}
|
146 |
-
|
147 |
-
return components
|
148 |
-
|
149 |
-
def get_dummy_inputs(self, device, seed=0, pil_image=True):
|
150 |
-
if str(device).startswith("mps"):
|
151 |
-
generator = torch.manual_seed(seed)
|
152 |
-
else:
|
153 |
-
generator = torch.Generator(device=device).manual_seed(seed)
|
154 |
-
|
155 |
-
input_image = floats_tensor((1, 3, 32, 32), rng=random.Random(seed)).to(device)
|
156 |
-
|
157 |
-
if pil_image:
|
158 |
-
input_image = input_image * 0.5 + 0.5
|
159 |
-
input_image = input_image.clamp(0, 1)
|
160 |
-
input_image = input_image.cpu().permute(0, 2, 3, 1).float().numpy()
|
161 |
-
input_image = DiffusionPipeline.numpy_to_pil(input_image)[0]
|
162 |
-
|
163 |
-
return {
|
164 |
-
"prompt": "An anime racoon running a marathon",
|
165 |
-
"image": input_image,
|
166 |
-
"generator": generator,
|
167 |
-
"num_inference_steps": 2,
|
168 |
-
"output_type": "np",
|
169 |
-
}
|
170 |
-
|
171 |
-
@skip_mps
|
172 |
-
def test_image_embeds_none(self):
|
173 |
-
device = "cpu" # ensure determinism for the device-dependent torch.Generator
|
174 |
-
components = self.get_dummy_components()
|
175 |
-
sd_pipe = StableUnCLIPImg2ImgPipeline(**components)
|
176 |
-
sd_pipe = sd_pipe.to(device)
|
177 |
-
sd_pipe.set_progress_bar_config(disable=None)
|
178 |
-
|
179 |
-
inputs = self.get_dummy_inputs(device)
|
180 |
-
inputs.update({"image_embeds": None})
|
181 |
-
image = sd_pipe(**inputs).images
|
182 |
-
image_slice = image[0, -3:, -3:, -1]
|
183 |
-
|
184 |
-
assert image.shape == (1, 32, 32, 3)
|
185 |
-
expected_slice = np.array([0.3872, 0.7224, 0.5601, 0.4741, 0.6872, 0.5814, 0.4636, 0.3867, 0.5078])
|
186 |
-
|
187 |
-
assert np.abs(image_slice.flatten() - expected_slice).max() < 1e-3
|
188 |
-
|
189 |
-
# Overriding PipelineTesterMixin::test_attention_slicing_forward_pass
|
190 |
-
# because GPU undeterminism requires a looser check.
|
191 |
-
def test_attention_slicing_forward_pass(self):
|
192 |
-
test_max_difference = torch_device in ["cpu", "mps"]
|
193 |
-
|
194 |
-
self._test_attention_slicing_forward_pass(test_max_difference=test_max_difference)
|
195 |
-
|
196 |
-
# Overriding PipelineTesterMixin::test_inference_batch_single_identical
|
197 |
-
# because undeterminism requires a looser check.
|
198 |
-
def test_inference_batch_single_identical(self):
|
199 |
-
test_max_difference = torch_device in ["cpu", "mps"]
|
200 |
-
|
201 |
-
self._test_inference_batch_single_identical(test_max_difference=test_max_difference)
|
202 |
-
|
203 |
-
@unittest.skipIf(
|
204 |
-
torch_device != "cuda" or not is_xformers_available(),
|
205 |
-
reason="XFormers attention is only available with CUDA and `xformers` installed",
|
206 |
-
)
|
207 |
-
def test_xformers_attention_forwardGenerator_pass(self):
|
208 |
-
self._test_xformers_attention_forwardGenerator_pass(test_max_difference=False)
|
209 |
-
|
210 |
-
|
211 |
-
@slow
|
212 |
-
@require_torch_gpu
|
213 |
-
class StableUnCLIPImg2ImgPipelineIntegrationTests(unittest.TestCase):
|
214 |
-
def tearDown(self):
|
215 |
-
# clean up the VRAM after each test
|
216 |
-
super().tearDown()
|
217 |
-
gc.collect()
|
218 |
-
torch.cuda.empty_cache()
|
219 |
-
|
220 |
-
def test_stable_unclip_l_img2img(self):
|
221 |
-
input_image = load_image(
|
222 |
-
"https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/stable_unclip/turtle.png"
|
223 |
-
)
|
224 |
-
|
225 |
-
expected_image = load_numpy(
|
226 |
-
"https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/stable_unclip/stable_unclip_2_1_l_img2img_anime_turtle_fp16.npy"
|
227 |
-
)
|
228 |
-
|
229 |
-
pipe = StableUnCLIPImg2ImgPipeline.from_pretrained(
|
230 |
-
"fusing/stable-unclip-2-1-l-img2img", torch_dtype=torch.float16
|
231 |
-
)
|
232 |
-
pipe.to(torch_device)
|
233 |
-
pipe.set_progress_bar_config(disable=None)
|
234 |
-
# stable unclip will oom when integration tests are run on a V100,
|
235 |
-
# so turn on memory savings
|
236 |
-
pipe.enable_attention_slicing()
|
237 |
-
pipe.enable_sequential_cpu_offload()
|
238 |
-
|
239 |
-
generator = torch.Generator(device="cpu").manual_seed(0)
|
240 |
-
output = pipe(input_image, "anime turle", generator=generator, output_type="np")
|
241 |
-
|
242 |
-
image = output.images[0]
|
243 |
-
|
244 |
-
assert image.shape == (768, 768, 3)
|
245 |
-
|
246 |
-
assert_mean_pixel_difference(image, expected_image)
|
247 |
-
|
248 |
-
def test_stable_unclip_h_img2img(self):
|
249 |
-
input_image = load_image(
|
250 |
-
"https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/stable_unclip/turtle.png"
|
251 |
-
)
|
252 |
-
|
253 |
-
expected_image = load_numpy(
|
254 |
-
"https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/stable_unclip/stable_unclip_2_1_h_img2img_anime_turtle_fp16.npy"
|
255 |
-
)
|
256 |
-
|
257 |
-
pipe = StableUnCLIPImg2ImgPipeline.from_pretrained(
|
258 |
-
"fusing/stable-unclip-2-1-h-img2img", torch_dtype=torch.float16
|
259 |
-
)
|
260 |
-
pipe.to(torch_device)
|
261 |
-
pipe.set_progress_bar_config(disable=None)
|
262 |
-
# stable unclip will oom when integration tests are run on a V100,
|
263 |
-
# so turn on memory savings
|
264 |
-
pipe.enable_attention_slicing()
|
265 |
-
pipe.enable_sequential_cpu_offload()
|
266 |
-
|
267 |
-
generator = torch.Generator(device="cpu").manual_seed(0)
|
268 |
-
output = pipe(input_image, "anime turle", generator=generator, output_type="np")
|
269 |
-
|
270 |
-
image = output.images[0]
|
271 |
-
|
272 |
-
assert image.shape == (768, 768, 3)
|
273 |
-
|
274 |
-
assert_mean_pixel_difference(image, expected_image)
|
275 |
-
|
276 |
-
def test_stable_unclip_img2img_pipeline_with_sequential_cpu_offloading(self):
|
277 |
-
input_image = load_image(
|
278 |
-
"https://huggingface.co/datasets/hf-internal-testing/diffusers-images/resolve/main/stable_unclip/turtle.png"
|
279 |
-
)
|
280 |
-
|
281 |
-
torch.cuda.empty_cache()
|
282 |
-
torch.cuda.reset_max_memory_allocated()
|
283 |
-
torch.cuda.reset_peak_memory_stats()
|
284 |
-
|
285 |
-
pipe = StableUnCLIPImg2ImgPipeline.from_pretrained(
|
286 |
-
"fusing/stable-unclip-2-1-h-img2img", torch_dtype=torch.float16
|
287 |
-
)
|
288 |
-
pipe = pipe.to(torch_device)
|
289 |
-
pipe.set_progress_bar_config(disable=None)
|
290 |
-
pipe.enable_attention_slicing()
|
291 |
-
pipe.enable_sequential_cpu_offload()
|
292 |
-
|
293 |
-
_ = pipe(
|
294 |
-
input_image,
|
295 |
-
"anime turtle",
|
296 |
-
num_inference_steps=2,
|
297 |
-
output_type="np",
|
298 |
-
)
|
299 |
-
|
300 |
-
mem_bytes = torch.cuda.max_memory_allocated()
|
301 |
-
# make sure that less than 7 GB is allocated
|
302 |
-
assert mem_bytes < 7 * 10**9
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_segmentation/configs/fcn/fcn_r101b-d8_512x1024_80k_cityscapes.py
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
_base_ = './fcn_r50-d8_512x1024_80k_cityscapes.py'
|
2 |
-
model = dict(
|
3 |
-
pretrained='torchvision://resnet101',
|
4 |
-
backbone=dict(type='ResNet', depth=101))
|
|
|
|
|
|
|
|
|
|
spaces/AngoHF/ANGO-Leaderboard/components/about.py
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
|
3 |
-
from assets.content import ABOUT_HTML
|
4 |
-
|
5 |
-
|
6 |
-
def create_about():
|
7 |
-
gr.HTML(ABOUT_HTML)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AnimalEquality/chatbot/lv_recipe_chatbot/vegan_recipe_tools.py
DELETED
@@ -1,89 +0,0 @@
|
|
1 |
-
# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/02_vegan_recipe_tools.ipynb.
|
2 |
-
|
3 |
-
# %% auto 0
|
4 |
-
__all__ = ['RecipeSerpAPIWrapper', 'get_vegan_recipes_edamam_api', 'vegan_recipe_edamam_search']
|
5 |
-
|
6 |
-
# %% ../nbs/02_vegan_recipe_tools.ipynb 3
|
7 |
-
import os
|
8 |
-
from typing import Dict
|
9 |
-
import requests
|
10 |
-
from langchain.agents import (
|
11 |
-
AgentExecutor,
|
12 |
-
AgentType,
|
13 |
-
OpenAIFunctionsAgent,
|
14 |
-
Tool,
|
15 |
-
initialize_agent,
|
16 |
-
load_tools,
|
17 |
-
)
|
18 |
-
from langchain.agents.agent_toolkits import create_python_agent
|
19 |
-
from langchain.chat_models import ChatOpenAI
|
20 |
-
from langchain.memory import ConversationBufferMemory
|
21 |
-
from langchain.prompts import MessagesPlaceholder
|
22 |
-
from langchain.python import PythonREPL
|
23 |
-
from langchain.schema import SystemMessage
|
24 |
-
from langchain.tools import tool
|
25 |
-
from langchain.tools.python.tool import PythonREPLTool
|
26 |
-
from langchain.utilities import GoogleSerperAPIWrapper, SerpAPIWrapper
|
27 |
-
from serpapi import GoogleSearch
|
28 |
-
|
29 |
-
# %% ../nbs/02_vegan_recipe_tools.ipynb 21
|
30 |
-
class RecipeSerpAPIWrapper(SerpAPIWrapper):
|
31 |
-
@staticmethod
|
32 |
-
def _process_response(res: dict) -> str:
|
33 |
-
"""Process response from SerpAPI."""
|
34 |
-
if "error" in res.keys():
|
35 |
-
raise ValueError(f"Got error from SerpAPI: {res['error']}")
|
36 |
-
if "recipes_results" in res.keys():
|
37 |
-
return res["recipes_results"]
|
38 |
-
|
39 |
-
# %% ../nbs/02_vegan_recipe_tools.ipynb 48
|
40 |
-
def get_vegan_recipes_edamam_api(params: Dict) -> requests.Response:
|
41 |
-
"""
|
42 |
-
type is required and can be "any", "public", "user"
|
43 |
-
"""
|
44 |
-
if "health" in params:
|
45 |
-
params["health"].append("vegan")
|
46 |
-
else:
|
47 |
-
params["health"] = ["vegan"]
|
48 |
-
params["app_id"] = os.environ["EDAMAM_APP_ID"]
|
49 |
-
params["app_key"] = os.environ["EDAMAM_APP_KEY"]
|
50 |
-
params["type"] = "public"
|
51 |
-
return requests.get("https://api.edamam.com/api/recipes/v2", params=params)
|
52 |
-
|
53 |
-
# %% ../nbs/02_vegan_recipe_tools.ipynb 54
|
54 |
-
@tool
|
55 |
-
def vegan_recipe_edamam_search(query: str) -> str:
|
56 |
-
"""
|
57 |
-
Searches for vegan recipes based on a query.
|
58 |
-
If the query is not vegan friendly, adapt it to be.
|
59 |
-
If the request fails an explanation should be returned.
|
60 |
-
If the cause of the failure was due to no recipes found, prompt the user to try again with a provided shorter query with one word removed.
|
61 |
-
"""
|
62 |
-
max_chars = 45 # 5 chars per word * 9 max words
|
63 |
-
if len(query) > max_chars:
|
64 |
-
return f"The query is too long, try again with a query that is under {max_chars} characters in length."
|
65 |
-
|
66 |
-
# Veganize the query more
|
67 |
-
if "vegan" not in query.lower():
|
68 |
-
query = "vegan " + query
|
69 |
-
|
70 |
-
# TODO integrate additional params like totalTime range, cuisineType choice, nutrients[PROCNT] range of protein, health additional health params like gluten-free
|
71 |
-
|
72 |
-
params = {
|
73 |
-
"q": query,
|
74 |
-
"field": ["label", "url", "totalTime", "ingredientLines"]
|
75 |
-
# todo figure out how to include "image", "totalNutrients", "ingredientLines" without going over token limits immediately.
|
76 |
-
}
|
77 |
-
|
78 |
-
response = get_vegan_recipes_edamam_api(params)
|
79 |
-
if not response.ok:
|
80 |
-
return (
|
81 |
-
f"Received an error from Edamam API: {response.status_code} {response.text}"
|
82 |
-
)
|
83 |
-
|
84 |
-
if response.json()["count"] <= 0:
|
85 |
-
return f"""No recipes found for query {query}.
|
86 |
-
This usually occurs when there are too many keywords or ingredients that are not commonly found together in recipes.
|
87 |
-
I recommend trying again with `{' '.join(query.split(' ')[0:-1])}.`"""
|
88 |
-
|
89 |
-
return str([r["recipe"] for r in response.json()["hits"][0:3]])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Arulkumar03/GroundingDINO_SOTA_Zero_Shot_Model/groundingdino/models/GroundingDINO/fuse_modules.py
DELETED
@@ -1,297 +0,0 @@
|
|
1 |
-
# ------------------------------------------------------------------------
|
2 |
-
# Grounding DINO
|
3 |
-
# url: https://github.com/IDEA-Research/GroundingDINO
|
4 |
-
# Copyright (c) 2023 IDEA. All Rights Reserved.
|
5 |
-
# Licensed under the Apache License, Version 2.0 [see LICENSE for details]
|
6 |
-
# ------------------------------------------------------------------------
|
7 |
-
|
8 |
-
import torch
|
9 |
-
import torch.nn as nn
|
10 |
-
import torch.nn.functional as F
|
11 |
-
from timm.models.layers import DropPath
|
12 |
-
|
13 |
-
|
14 |
-
class FeatureResizer(nn.Module):
|
15 |
-
"""
|
16 |
-
This class takes as input a set of embeddings of dimension C1 and outputs a set of
|
17 |
-
embedding of dimension C2, after a linear transformation, dropout and normalization (LN).
|
18 |
-
"""
|
19 |
-
|
20 |
-
def __init__(self, input_feat_size, output_feat_size, dropout, do_ln=True):
|
21 |
-
super().__init__()
|
22 |
-
self.do_ln = do_ln
|
23 |
-
# Object feature encoding
|
24 |
-
self.fc = nn.Linear(input_feat_size, output_feat_size, bias=True)
|
25 |
-
self.layer_norm = nn.LayerNorm(output_feat_size, eps=1e-12)
|
26 |
-
self.dropout = nn.Dropout(dropout)
|
27 |
-
|
28 |
-
def forward(self, encoder_features):
|
29 |
-
x = self.fc(encoder_features)
|
30 |
-
if self.do_ln:
|
31 |
-
x = self.layer_norm(x)
|
32 |
-
output = self.dropout(x)
|
33 |
-
return output
|
34 |
-
|
35 |
-
|
36 |
-
def l1norm(X, dim, eps=1e-8):
|
37 |
-
"""L1-normalize columns of X"""
|
38 |
-
norm = torch.abs(X).sum(dim=dim, keepdim=True) + eps
|
39 |
-
X = torch.div(X, norm)
|
40 |
-
return X
|
41 |
-
|
42 |
-
|
43 |
-
def l2norm(X, dim, eps=1e-8):
|
44 |
-
"""L2-normalize columns of X"""
|
45 |
-
norm = torch.pow(X, 2).sum(dim=dim, keepdim=True).sqrt() + eps
|
46 |
-
X = torch.div(X, norm)
|
47 |
-
return X
|
48 |
-
|
49 |
-
|
50 |
-
def func_attention(query, context, smooth=1, raw_feature_norm="softmax", eps=1e-8):
|
51 |
-
"""
|
52 |
-
query: (n_context, queryL, d)
|
53 |
-
context: (n_context, sourceL, d)
|
54 |
-
"""
|
55 |
-
batch_size_q, queryL = query.size(0), query.size(1)
|
56 |
-
batch_size, sourceL = context.size(0), context.size(1)
|
57 |
-
|
58 |
-
# Get attention
|
59 |
-
# --> (batch, d, queryL)
|
60 |
-
queryT = torch.transpose(query, 1, 2)
|
61 |
-
|
62 |
-
# (batch, sourceL, d)(batch, d, queryL)
|
63 |
-
# --> (batch, sourceL, queryL)
|
64 |
-
attn = torch.bmm(context, queryT)
|
65 |
-
if raw_feature_norm == "softmax":
|
66 |
-
# --> (batch*sourceL, queryL)
|
67 |
-
attn = attn.view(batch_size * sourceL, queryL)
|
68 |
-
attn = nn.Softmax()(attn)
|
69 |
-
# --> (batch, sourceL, queryL)
|
70 |
-
attn = attn.view(batch_size, sourceL, queryL)
|
71 |
-
elif raw_feature_norm == "l2norm":
|
72 |
-
attn = l2norm(attn, 2)
|
73 |
-
elif raw_feature_norm == "clipped_l2norm":
|
74 |
-
attn = nn.LeakyReLU(0.1)(attn)
|
75 |
-
attn = l2norm(attn, 2)
|
76 |
-
else:
|
77 |
-
raise ValueError("unknown first norm type:", raw_feature_norm)
|
78 |
-
# --> (batch, queryL, sourceL)
|
79 |
-
attn = torch.transpose(attn, 1, 2).contiguous()
|
80 |
-
# --> (batch*queryL, sourceL)
|
81 |
-
attn = attn.view(batch_size * queryL, sourceL)
|
82 |
-
attn = nn.Softmax()(attn * smooth)
|
83 |
-
# --> (batch, queryL, sourceL)
|
84 |
-
attn = attn.view(batch_size, queryL, sourceL)
|
85 |
-
# --> (batch, sourceL, queryL)
|
86 |
-
attnT = torch.transpose(attn, 1, 2).contiguous()
|
87 |
-
|
88 |
-
# --> (batch, d, sourceL)
|
89 |
-
contextT = torch.transpose(context, 1, 2)
|
90 |
-
# (batch x d x sourceL)(batch x sourceL x queryL)
|
91 |
-
# --> (batch, d, queryL)
|
92 |
-
weightedContext = torch.bmm(contextT, attnT)
|
93 |
-
# --> (batch, queryL, d)
|
94 |
-
weightedContext = torch.transpose(weightedContext, 1, 2)
|
95 |
-
|
96 |
-
return weightedContext, attnT
|
97 |
-
|
98 |
-
|
99 |
-
class BiMultiHeadAttention(nn.Module):
|
100 |
-
def __init__(self, v_dim, l_dim, embed_dim, num_heads, dropout=0.1, cfg=None):
|
101 |
-
super(BiMultiHeadAttention, self).__init__()
|
102 |
-
|
103 |
-
self.embed_dim = embed_dim
|
104 |
-
self.num_heads = num_heads
|
105 |
-
self.head_dim = embed_dim // num_heads
|
106 |
-
self.v_dim = v_dim
|
107 |
-
self.l_dim = l_dim
|
108 |
-
|
109 |
-
assert (
|
110 |
-
self.head_dim * self.num_heads == self.embed_dim
|
111 |
-
), f"embed_dim must be divisible by num_heads (got `embed_dim`: {self.embed_dim} and `num_heads`: {self.num_heads})."
|
112 |
-
self.scale = self.head_dim ** (-0.5)
|
113 |
-
self.dropout = dropout
|
114 |
-
|
115 |
-
self.v_proj = nn.Linear(self.v_dim, self.embed_dim)
|
116 |
-
self.l_proj = nn.Linear(self.l_dim, self.embed_dim)
|
117 |
-
self.values_v_proj = nn.Linear(self.v_dim, self.embed_dim)
|
118 |
-
self.values_l_proj = nn.Linear(self.l_dim, self.embed_dim)
|
119 |
-
|
120 |
-
self.out_v_proj = nn.Linear(self.embed_dim, self.v_dim)
|
121 |
-
self.out_l_proj = nn.Linear(self.embed_dim, self.l_dim)
|
122 |
-
|
123 |
-
self.stable_softmax_2d = True
|
124 |
-
self.clamp_min_for_underflow = True
|
125 |
-
self.clamp_max_for_overflow = True
|
126 |
-
|
127 |
-
self._reset_parameters()
|
128 |
-
|
129 |
-
def _shape(self, tensor: torch.Tensor, seq_len: int, bsz: int):
|
130 |
-
return tensor.view(bsz, seq_len, self.num_heads, self.head_dim).transpose(1, 2).contiguous()
|
131 |
-
|
132 |
-
def _reset_parameters(self):
|
133 |
-
nn.init.xavier_uniform_(self.v_proj.weight)
|
134 |
-
self.v_proj.bias.data.fill_(0)
|
135 |
-
nn.init.xavier_uniform_(self.l_proj.weight)
|
136 |
-
self.l_proj.bias.data.fill_(0)
|
137 |
-
nn.init.xavier_uniform_(self.values_v_proj.weight)
|
138 |
-
self.values_v_proj.bias.data.fill_(0)
|
139 |
-
nn.init.xavier_uniform_(self.values_l_proj.weight)
|
140 |
-
self.values_l_proj.bias.data.fill_(0)
|
141 |
-
nn.init.xavier_uniform_(self.out_v_proj.weight)
|
142 |
-
self.out_v_proj.bias.data.fill_(0)
|
143 |
-
nn.init.xavier_uniform_(self.out_l_proj.weight)
|
144 |
-
self.out_l_proj.bias.data.fill_(0)
|
145 |
-
|
146 |
-
def forward(self, v, l, attention_mask_v=None, attention_mask_l=None):
|
147 |
-
"""_summary_
|
148 |
-
|
149 |
-
Args:
|
150 |
-
v (_type_): bs, n_img, dim
|
151 |
-
l (_type_): bs, n_text, dim
|
152 |
-
attention_mask_v (_type_, optional): _description_. bs, n_img
|
153 |
-
attention_mask_l (_type_, optional): _description_. bs, n_text
|
154 |
-
|
155 |
-
Returns:
|
156 |
-
_type_: _description_
|
157 |
-
"""
|
158 |
-
# if os.environ.get('IPDB_SHILONG_DEBUG', None) == 'INFO':
|
159 |
-
# import ipdb; ipdb.set_trace()
|
160 |
-
bsz, tgt_len, _ = v.size()
|
161 |
-
|
162 |
-
query_states = self.v_proj(v) * self.scale
|
163 |
-
key_states = self._shape(self.l_proj(l), -1, bsz)
|
164 |
-
value_v_states = self._shape(self.values_v_proj(v), -1, bsz)
|
165 |
-
value_l_states = self._shape(self.values_l_proj(l), -1, bsz)
|
166 |
-
|
167 |
-
proj_shape = (bsz * self.num_heads, -1, self.head_dim)
|
168 |
-
query_states = self._shape(query_states, tgt_len, bsz).view(*proj_shape)
|
169 |
-
key_states = key_states.view(*proj_shape)
|
170 |
-
value_v_states = value_v_states.view(*proj_shape)
|
171 |
-
value_l_states = value_l_states.view(*proj_shape)
|
172 |
-
|
173 |
-
src_len = key_states.size(1)
|
174 |
-
attn_weights = torch.bmm(query_states, key_states.transpose(1, 2)) # bs*nhead, nimg, ntxt
|
175 |
-
|
176 |
-
if attn_weights.size() != (bsz * self.num_heads, tgt_len, src_len):
|
177 |
-
raise ValueError(
|
178 |
-
f"Attention weights should be of size {(bsz * self.num_heads, tgt_len, src_len)}, but is {attn_weights.size()}"
|
179 |
-
)
|
180 |
-
|
181 |
-
if self.stable_softmax_2d:
|
182 |
-
attn_weights = attn_weights - attn_weights.max()
|
183 |
-
|
184 |
-
if self.clamp_min_for_underflow:
|
185 |
-
attn_weights = torch.clamp(
|
186 |
-
attn_weights, min=-50000
|
187 |
-
) # Do not increase -50000, data type half has quite limited range
|
188 |
-
if self.clamp_max_for_overflow:
|
189 |
-
attn_weights = torch.clamp(
|
190 |
-
attn_weights, max=50000
|
191 |
-
) # Do not increase 50000, data type half has quite limited range
|
192 |
-
|
193 |
-
attn_weights_T = attn_weights.transpose(1, 2)
|
194 |
-
attn_weights_l = attn_weights_T - torch.max(attn_weights_T, dim=-1, keepdim=True)[0]
|
195 |
-
if self.clamp_min_for_underflow:
|
196 |
-
attn_weights_l = torch.clamp(
|
197 |
-
attn_weights_l, min=-50000
|
198 |
-
) # Do not increase -50000, data type half has quite limited range
|
199 |
-
if self.clamp_max_for_overflow:
|
200 |
-
attn_weights_l = torch.clamp(
|
201 |
-
attn_weights_l, max=50000
|
202 |
-
) # Do not increase 50000, data type half has quite limited range
|
203 |
-
|
204 |
-
# mask vison for language
|
205 |
-
if attention_mask_v is not None:
|
206 |
-
attention_mask_v = (
|
207 |
-
attention_mask_v[:, None, None, :].repeat(1, self.num_heads, 1, 1).flatten(0, 1)
|
208 |
-
)
|
209 |
-
attn_weights_l.masked_fill_(attention_mask_v, float("-inf"))
|
210 |
-
|
211 |
-
attn_weights_l = attn_weights_l.softmax(dim=-1)
|
212 |
-
|
213 |
-
# mask language for vision
|
214 |
-
if attention_mask_l is not None:
|
215 |
-
attention_mask_l = (
|
216 |
-
attention_mask_l[:, None, None, :].repeat(1, self.num_heads, 1, 1).flatten(0, 1)
|
217 |
-
)
|
218 |
-
attn_weights.masked_fill_(attention_mask_l, float("-inf"))
|
219 |
-
attn_weights_v = attn_weights.softmax(dim=-1)
|
220 |
-
|
221 |
-
attn_probs_v = F.dropout(attn_weights_v, p=self.dropout, training=self.training)
|
222 |
-
attn_probs_l = F.dropout(attn_weights_l, p=self.dropout, training=self.training)
|
223 |
-
|
224 |
-
attn_output_v = torch.bmm(attn_probs_v, value_l_states)
|
225 |
-
attn_output_l = torch.bmm(attn_probs_l, value_v_states)
|
226 |
-
|
227 |
-
if attn_output_v.size() != (bsz * self.num_heads, tgt_len, self.head_dim):
|
228 |
-
raise ValueError(
|
229 |
-
f"`attn_output_v` should be of size {(bsz, self.num_heads, tgt_len, self.head_dim)}, but is {attn_output_v.size()}"
|
230 |
-
)
|
231 |
-
|
232 |
-
if attn_output_l.size() != (bsz * self.num_heads, src_len, self.head_dim):
|
233 |
-
raise ValueError(
|
234 |
-
f"`attn_output_l` should be of size {(bsz, self.num_heads, src_len, self.head_dim)}, but is {attn_output_l.size()}"
|
235 |
-
)
|
236 |
-
|
237 |
-
attn_output_v = attn_output_v.view(bsz, self.num_heads, tgt_len, self.head_dim)
|
238 |
-
attn_output_v = attn_output_v.transpose(1, 2)
|
239 |
-
attn_output_v = attn_output_v.reshape(bsz, tgt_len, self.embed_dim)
|
240 |
-
|
241 |
-
attn_output_l = attn_output_l.view(bsz, self.num_heads, src_len, self.head_dim)
|
242 |
-
attn_output_l = attn_output_l.transpose(1, 2)
|
243 |
-
attn_output_l = attn_output_l.reshape(bsz, src_len, self.embed_dim)
|
244 |
-
|
245 |
-
attn_output_v = self.out_v_proj(attn_output_v)
|
246 |
-
attn_output_l = self.out_l_proj(attn_output_l)
|
247 |
-
|
248 |
-
return attn_output_v, attn_output_l
|
249 |
-
|
250 |
-
|
251 |
-
# Bi-Direction MHA (text->image, image->text)
|
252 |
-
class BiAttentionBlock(nn.Module):
|
253 |
-
def __init__(
|
254 |
-
self,
|
255 |
-
v_dim,
|
256 |
-
l_dim,
|
257 |
-
embed_dim,
|
258 |
-
num_heads,
|
259 |
-
dropout=0.1,
|
260 |
-
drop_path=0.0,
|
261 |
-
init_values=1e-4,
|
262 |
-
cfg=None,
|
263 |
-
):
|
264 |
-
"""
|
265 |
-
Inputs:
|
266 |
-
embed_dim - Dimensionality of input and attention feature vectors
|
267 |
-
hidden_dim - Dimensionality of hidden layer in feed-forward network
|
268 |
-
(usually 2-4x larger than embed_dim)
|
269 |
-
num_heads - Number of heads to use in the Multi-Head Attention block
|
270 |
-
dropout - Amount of dropout to apply in the feed-forward network
|
271 |
-
"""
|
272 |
-
super(BiAttentionBlock, self).__init__()
|
273 |
-
|
274 |
-
# pre layer norm
|
275 |
-
self.layer_norm_v = nn.LayerNorm(v_dim)
|
276 |
-
self.layer_norm_l = nn.LayerNorm(l_dim)
|
277 |
-
self.attn = BiMultiHeadAttention(
|
278 |
-
v_dim=v_dim, l_dim=l_dim, embed_dim=embed_dim, num_heads=num_heads, dropout=dropout
|
279 |
-
)
|
280 |
-
|
281 |
-
# add layer scale for training stability
|
282 |
-
self.drop_path = DropPath(drop_path) if drop_path > 0.0 else nn.Identity()
|
283 |
-
self.gamma_v = nn.Parameter(init_values * torch.ones((v_dim)), requires_grad=True)
|
284 |
-
self.gamma_l = nn.Parameter(init_values * torch.ones((l_dim)), requires_grad=True)
|
285 |
-
|
286 |
-
def forward(self, v, l, attention_mask_v=None, attention_mask_l=None):
|
287 |
-
v = self.layer_norm_v(v)
|
288 |
-
l = self.layer_norm_l(l)
|
289 |
-
delta_v, delta_l = self.attn(
|
290 |
-
v, l, attention_mask_v=attention_mask_v, attention_mask_l=attention_mask_l
|
291 |
-
)
|
292 |
-
# v, l = v + delta_v, l + delta_l
|
293 |
-
v = v + self.drop_path(self.gamma_v * delta_v)
|
294 |
-
l = l + self.drop_path(self.gamma_l * delta_l)
|
295 |
-
return v, l
|
296 |
-
|
297 |
-
# def forward(self, v:List[torch.Tensor], l, attention_mask_v=None, attention_mask_l=None)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/urllib3/request.py
DELETED
@@ -1,170 +0,0 @@
|
|
1 |
-
from __future__ import absolute_import
|
2 |
-
|
3 |
-
from .filepost import encode_multipart_formdata
|
4 |
-
from .packages.six.moves.urllib.parse import urlencode
|
5 |
-
|
6 |
-
__all__ = ["RequestMethods"]
|
7 |
-
|
8 |
-
|
9 |
-
class RequestMethods(object):
|
10 |
-
"""
|
11 |
-
Convenience mixin for classes who implement a :meth:`urlopen` method, such
|
12 |
-
as :class:`urllib3.HTTPConnectionPool` and
|
13 |
-
:class:`urllib3.PoolManager`.
|
14 |
-
|
15 |
-
Provides behavior for making common types of HTTP request methods and
|
16 |
-
decides which type of request field encoding to use.
|
17 |
-
|
18 |
-
Specifically,
|
19 |
-
|
20 |
-
:meth:`.request_encode_url` is for sending requests whose fields are
|
21 |
-
encoded in the URL (such as GET, HEAD, DELETE).
|
22 |
-
|
23 |
-
:meth:`.request_encode_body` is for sending requests whose fields are
|
24 |
-
encoded in the *body* of the request using multipart or www-form-urlencoded
|
25 |
-
(such as for POST, PUT, PATCH).
|
26 |
-
|
27 |
-
:meth:`.request` is for making any kind of request, it will look up the
|
28 |
-
appropriate encoding format and use one of the above two methods to make
|
29 |
-
the request.
|
30 |
-
|
31 |
-
Initializer parameters:
|
32 |
-
|
33 |
-
:param headers:
|
34 |
-
Headers to include with all requests, unless other headers are given
|
35 |
-
explicitly.
|
36 |
-
"""
|
37 |
-
|
38 |
-
_encode_url_methods = {"DELETE", "GET", "HEAD", "OPTIONS"}
|
39 |
-
|
40 |
-
def __init__(self, headers=None):
|
41 |
-
self.headers = headers or {}
|
42 |
-
|
43 |
-
def urlopen(
|
44 |
-
self,
|
45 |
-
method,
|
46 |
-
url,
|
47 |
-
body=None,
|
48 |
-
headers=None,
|
49 |
-
encode_multipart=True,
|
50 |
-
multipart_boundary=None,
|
51 |
-
**kw
|
52 |
-
): # Abstract
|
53 |
-
raise NotImplementedError(
|
54 |
-
"Classes extending RequestMethods must implement "
|
55 |
-
"their own ``urlopen`` method."
|
56 |
-
)
|
57 |
-
|
58 |
-
def request(self, method, url, fields=None, headers=None, **urlopen_kw):
|
59 |
-
"""
|
60 |
-
Make a request using :meth:`urlopen` with the appropriate encoding of
|
61 |
-
``fields`` based on the ``method`` used.
|
62 |
-
|
63 |
-
This is a convenience method that requires the least amount of manual
|
64 |
-
effort. It can be used in most situations, while still having the
|
65 |
-
option to drop down to more specific methods when necessary, such as
|
66 |
-
:meth:`request_encode_url`, :meth:`request_encode_body`,
|
67 |
-
or even the lowest level :meth:`urlopen`.
|
68 |
-
"""
|
69 |
-
method = method.upper()
|
70 |
-
|
71 |
-
urlopen_kw["request_url"] = url
|
72 |
-
|
73 |
-
if method in self._encode_url_methods:
|
74 |
-
return self.request_encode_url(
|
75 |
-
method, url, fields=fields, headers=headers, **urlopen_kw
|
76 |
-
)
|
77 |
-
else:
|
78 |
-
return self.request_encode_body(
|
79 |
-
method, url, fields=fields, headers=headers, **urlopen_kw
|
80 |
-
)
|
81 |
-
|
82 |
-
def request_encode_url(self, method, url, fields=None, headers=None, **urlopen_kw):
|
83 |
-
"""
|
84 |
-
Make a request using :meth:`urlopen` with the ``fields`` encoded in
|
85 |
-
the url. This is useful for request methods like GET, HEAD, DELETE, etc.
|
86 |
-
"""
|
87 |
-
if headers is None:
|
88 |
-
headers = self.headers
|
89 |
-
|
90 |
-
extra_kw = {"headers": headers}
|
91 |
-
extra_kw.update(urlopen_kw)
|
92 |
-
|
93 |
-
if fields:
|
94 |
-
url += "?" + urlencode(fields)
|
95 |
-
|
96 |
-
return self.urlopen(method, url, **extra_kw)
|
97 |
-
|
98 |
-
def request_encode_body(
|
99 |
-
self,
|
100 |
-
method,
|
101 |
-
url,
|
102 |
-
fields=None,
|
103 |
-
headers=None,
|
104 |
-
encode_multipart=True,
|
105 |
-
multipart_boundary=None,
|
106 |
-
**urlopen_kw
|
107 |
-
):
|
108 |
-
"""
|
109 |
-
Make a request using :meth:`urlopen` with the ``fields`` encoded in
|
110 |
-
the body. This is useful for request methods like POST, PUT, PATCH, etc.
|
111 |
-
|
112 |
-
When ``encode_multipart=True`` (default), then
|
113 |
-
:func:`urllib3.encode_multipart_formdata` is used to encode
|
114 |
-
the payload with the appropriate content type. Otherwise
|
115 |
-
:func:`urllib.parse.urlencode` is used with the
|
116 |
-
'application/x-www-form-urlencoded' content type.
|
117 |
-
|
118 |
-
Multipart encoding must be used when posting files, and it's reasonably
|
119 |
-
safe to use it in other times too. However, it may break request
|
120 |
-
signing, such as with OAuth.
|
121 |
-
|
122 |
-
Supports an optional ``fields`` parameter of key/value strings AND
|
123 |
-
key/filetuple. A filetuple is a (filename, data, MIME type) tuple where
|
124 |
-
the MIME type is optional. For example::
|
125 |
-
|
126 |
-
fields = {
|
127 |
-
'foo': 'bar',
|
128 |
-
'fakefile': ('foofile.txt', 'contents of foofile'),
|
129 |
-
'realfile': ('barfile.txt', open('realfile').read()),
|
130 |
-
'typedfile': ('bazfile.bin', open('bazfile').read(),
|
131 |
-
'image/jpeg'),
|
132 |
-
'nonamefile': 'contents of nonamefile field',
|
133 |
-
}
|
134 |
-
|
135 |
-
When uploading a file, providing a filename (the first parameter of the
|
136 |
-
tuple) is optional but recommended to best mimic behavior of browsers.
|
137 |
-
|
138 |
-
Note that if ``headers`` are supplied, the 'Content-Type' header will
|
139 |
-
be overwritten because it depends on the dynamic random boundary string
|
140 |
-
which is used to compose the body of the request. The random boundary
|
141 |
-
string can be explicitly set with the ``multipart_boundary`` parameter.
|
142 |
-
"""
|
143 |
-
if headers is None:
|
144 |
-
headers = self.headers
|
145 |
-
|
146 |
-
extra_kw = {"headers": {}}
|
147 |
-
|
148 |
-
if fields:
|
149 |
-
if "body" in urlopen_kw:
|
150 |
-
raise TypeError(
|
151 |
-
"request got values for both 'fields' and 'body', can only specify one."
|
152 |
-
)
|
153 |
-
|
154 |
-
if encode_multipart:
|
155 |
-
body, content_type = encode_multipart_formdata(
|
156 |
-
fields, boundary=multipart_boundary
|
157 |
-
)
|
158 |
-
else:
|
159 |
-
body, content_type = (
|
160 |
-
urlencode(fields),
|
161 |
-
"application/x-www-form-urlencoded",
|
162 |
-
)
|
163 |
-
|
164 |
-
extra_kw["body"] = body
|
165 |
-
extra_kw["headers"] = {"Content-Type": content_type}
|
166 |
-
|
167 |
-
extra_kw["headers"].update(headers)
|
168 |
-
extra_kw.update(urlopen_kw)
|
169 |
-
|
170 |
-
return self.urlopen(method, url, **extra_kw)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/setuptools/_distutils/ccompiler.py
DELETED
@@ -1,1220 +0,0 @@
|
|
1 |
-
"""distutils.ccompiler
|
2 |
-
|
3 |
-
Contains CCompiler, an abstract base class that defines the interface
|
4 |
-
for the Distutils compiler abstraction model."""
|
5 |
-
|
6 |
-
import sys
|
7 |
-
import os
|
8 |
-
import re
|
9 |
-
|
10 |
-
from distutils.errors import (
|
11 |
-
CompileError,
|
12 |
-
LinkError,
|
13 |
-
UnknownFileError,
|
14 |
-
DistutilsPlatformError,
|
15 |
-
DistutilsModuleError,
|
16 |
-
)
|
17 |
-
from distutils.spawn import spawn
|
18 |
-
from distutils.file_util import move_file
|
19 |
-
from distutils.dir_util import mkpath
|
20 |
-
from distutils.dep_util import newer_group
|
21 |
-
from distutils.util import split_quoted, execute
|
22 |
-
from distutils import log
|
23 |
-
|
24 |
-
|
25 |
-
class CCompiler:
|
26 |
-
"""Abstract base class to define the interface that must be implemented
|
27 |
-
by real compiler classes. Also has some utility methods used by
|
28 |
-
several compiler classes.
|
29 |
-
|
30 |
-
The basic idea behind a compiler abstraction class is that each
|
31 |
-
instance can be used for all the compile/link steps in building a
|
32 |
-
single project. Thus, attributes common to all of those compile and
|
33 |
-
link steps -- include directories, macros to define, libraries to link
|
34 |
-
against, etc. -- are attributes of the compiler instance. To allow for
|
35 |
-
variability in how individual files are treated, most of those
|
36 |
-
attributes may be varied on a per-compilation or per-link basis.
|
37 |
-
"""
|
38 |
-
|
39 |
-
# 'compiler_type' is a class attribute that identifies this class. It
|
40 |
-
# keeps code that wants to know what kind of compiler it's dealing with
|
41 |
-
# from having to import all possible compiler classes just to do an
|
42 |
-
# 'isinstance'. In concrete CCompiler subclasses, 'compiler_type'
|
43 |
-
# should really, really be one of the keys of the 'compiler_class'
|
44 |
-
# dictionary (see below -- used by the 'new_compiler()' factory
|
45 |
-
# function) -- authors of new compiler interface classes are
|
46 |
-
# responsible for updating 'compiler_class'!
|
47 |
-
compiler_type = None
|
48 |
-
|
49 |
-
# XXX things not handled by this compiler abstraction model:
|
50 |
-
# * client can't provide additional options for a compiler,
|
51 |
-
# e.g. warning, optimization, debugging flags. Perhaps this
|
52 |
-
# should be the domain of concrete compiler abstraction classes
|
53 |
-
# (UnixCCompiler, MSVCCompiler, etc.) -- or perhaps the base
|
54 |
-
# class should have methods for the common ones.
|
55 |
-
# * can't completely override the include or library searchg
|
56 |
-
# path, ie. no "cc -I -Idir1 -Idir2" or "cc -L -Ldir1 -Ldir2".
|
57 |
-
# I'm not sure how widely supported this is even by Unix
|
58 |
-
# compilers, much less on other platforms. And I'm even less
|
59 |
-
# sure how useful it is; maybe for cross-compiling, but
|
60 |
-
# support for that is a ways off. (And anyways, cross
|
61 |
-
# compilers probably have a dedicated binary with the
|
62 |
-
# right paths compiled in. I hope.)
|
63 |
-
# * can't do really freaky things with the library list/library
|
64 |
-
# dirs, e.g. "-Ldir1 -lfoo -Ldir2 -lfoo" to link against
|
65 |
-
# different versions of libfoo.a in different locations. I
|
66 |
-
# think this is useless without the ability to null out the
|
67 |
-
# library search path anyways.
|
68 |
-
|
69 |
-
# Subclasses that rely on the standard filename generation methods
|
70 |
-
# implemented below should override these; see the comment near
|
71 |
-
# those methods ('object_filenames()' et. al.) for details:
|
72 |
-
src_extensions = None # list of strings
|
73 |
-
obj_extension = None # string
|
74 |
-
static_lib_extension = None
|
75 |
-
shared_lib_extension = None # string
|
76 |
-
static_lib_format = None # format string
|
77 |
-
shared_lib_format = None # prob. same as static_lib_format
|
78 |
-
exe_extension = None # string
|
79 |
-
|
80 |
-
# Default language settings. language_map is used to detect a source
|
81 |
-
# file or Extension target language, checking source filenames.
|
82 |
-
# language_order is used to detect the language precedence, when deciding
|
83 |
-
# what language to use when mixing source types. For example, if some
|
84 |
-
# extension has two files with ".c" extension, and one with ".cpp", it
|
85 |
-
# is still linked as c++.
|
86 |
-
language_map = {
|
87 |
-
".c": "c",
|
88 |
-
".cc": "c++",
|
89 |
-
".cpp": "c++",
|
90 |
-
".cxx": "c++",
|
91 |
-
".m": "objc",
|
92 |
-
}
|
93 |
-
language_order = ["c++", "objc", "c"]
|
94 |
-
|
95 |
-
include_dirs = []
|
96 |
-
"""
|
97 |
-
include dirs specific to this compiler class
|
98 |
-
"""
|
99 |
-
|
100 |
-
library_dirs = []
|
101 |
-
"""
|
102 |
-
library dirs specific to this compiler class
|
103 |
-
"""
|
104 |
-
|
105 |
-
def __init__(self, verbose=0, dry_run=0, force=0):
|
106 |
-
self.dry_run = dry_run
|
107 |
-
self.force = force
|
108 |
-
self.verbose = verbose
|
109 |
-
|
110 |
-
# 'output_dir': a common output directory for object, library,
|
111 |
-
# shared object, and shared library files
|
112 |
-
self.output_dir = None
|
113 |
-
|
114 |
-
# 'macros': a list of macro definitions (or undefinitions). A
|
115 |
-
# macro definition is a 2-tuple (name, value), where the value is
|
116 |
-
# either a string or None (no explicit value). A macro
|
117 |
-
# undefinition is a 1-tuple (name,).
|
118 |
-
self.macros = []
|
119 |
-
|
120 |
-
# 'include_dirs': a list of directories to search for include files
|
121 |
-
self.include_dirs = []
|
122 |
-
|
123 |
-
# 'libraries': a list of libraries to include in any link
|
124 |
-
# (library names, not filenames: eg. "foo" not "libfoo.a")
|
125 |
-
self.libraries = []
|
126 |
-
|
127 |
-
# 'library_dirs': a list of directories to search for libraries
|
128 |
-
self.library_dirs = []
|
129 |
-
|
130 |
-
# 'runtime_library_dirs': a list of directories to search for
|
131 |
-
# shared libraries/objects at runtime
|
132 |
-
self.runtime_library_dirs = []
|
133 |
-
|
134 |
-
# 'objects': a list of object files (or similar, such as explicitly
|
135 |
-
# named library files) to include on any link
|
136 |
-
self.objects = []
|
137 |
-
|
138 |
-
for key in self.executables.keys():
|
139 |
-
self.set_executable(key, self.executables[key])
|
140 |
-
|
141 |
-
def set_executables(self, **kwargs):
|
142 |
-
"""Define the executables (and options for them) that will be run
|
143 |
-
to perform the various stages of compilation. The exact set of
|
144 |
-
executables that may be specified here depends on the compiler
|
145 |
-
class (via the 'executables' class attribute), but most will have:
|
146 |
-
compiler the C/C++ compiler
|
147 |
-
linker_so linker used to create shared objects and libraries
|
148 |
-
linker_exe linker used to create binary executables
|
149 |
-
archiver static library creator
|
150 |
-
|
151 |
-
On platforms with a command-line (Unix, DOS/Windows), each of these
|
152 |
-
is a string that will be split into executable name and (optional)
|
153 |
-
list of arguments. (Splitting the string is done similarly to how
|
154 |
-
Unix shells operate: words are delimited by spaces, but quotes and
|
155 |
-
backslashes can override this. See
|
156 |
-
'distutils.util.split_quoted()'.)
|
157 |
-
"""
|
158 |
-
|
159 |
-
# Note that some CCompiler implementation classes will define class
|
160 |
-
# attributes 'cpp', 'cc', etc. with hard-coded executable names;
|
161 |
-
# this is appropriate when a compiler class is for exactly one
|
162 |
-
# compiler/OS combination (eg. MSVCCompiler). Other compiler
|
163 |
-
# classes (UnixCCompiler, in particular) are driven by information
|
164 |
-
# discovered at run-time, since there are many different ways to do
|
165 |
-
# basically the same things with Unix C compilers.
|
166 |
-
|
167 |
-
for key in kwargs:
|
168 |
-
if key not in self.executables:
|
169 |
-
raise ValueError(
|
170 |
-
"unknown executable '%s' for class %s"
|
171 |
-
% (key, self.__class__.__name__)
|
172 |
-
)
|
173 |
-
self.set_executable(key, kwargs[key])
|
174 |
-
|
175 |
-
def set_executable(self, key, value):
|
176 |
-
if isinstance(value, str):
|
177 |
-
setattr(self, key, split_quoted(value))
|
178 |
-
else:
|
179 |
-
setattr(self, key, value)
|
180 |
-
|
181 |
-
def _find_macro(self, name):
|
182 |
-
i = 0
|
183 |
-
for defn in self.macros:
|
184 |
-
if defn[0] == name:
|
185 |
-
return i
|
186 |
-
i += 1
|
187 |
-
return None
|
188 |
-
|
189 |
-
def _check_macro_definitions(self, definitions):
|
190 |
-
"""Ensures that every element of 'definitions' is a valid macro
|
191 |
-
definition, ie. either (name,value) 2-tuple or a (name,) tuple. Do
|
192 |
-
nothing if all definitions are OK, raise TypeError otherwise.
|
193 |
-
"""
|
194 |
-
for defn in definitions:
|
195 |
-
if not (
|
196 |
-
isinstance(defn, tuple)
|
197 |
-
and (
|
198 |
-
len(defn) in (1, 2)
|
199 |
-
and (isinstance(defn[1], str) or defn[1] is None)
|
200 |
-
)
|
201 |
-
and isinstance(defn[0], str)
|
202 |
-
):
|
203 |
-
raise TypeError(
|
204 |
-
("invalid macro definition '%s': " % defn)
|
205 |
-
+ "must be tuple (string,), (string, string), or "
|
206 |
-
+ "(string, None)"
|
207 |
-
)
|
208 |
-
|
209 |
-
# -- Bookkeeping methods -------------------------------------------
|
210 |
-
|
211 |
-
def define_macro(self, name, value=None):
|
212 |
-
"""Define a preprocessor macro for all compilations driven by this
|
213 |
-
compiler object. The optional parameter 'value' should be a
|
214 |
-
string; if it is not supplied, then the macro will be defined
|
215 |
-
without an explicit value and the exact outcome depends on the
|
216 |
-
compiler used (XXX true? does ANSI say anything about this?)
|
217 |
-
"""
|
218 |
-
# Delete from the list of macro definitions/undefinitions if
|
219 |
-
# already there (so that this one will take precedence).
|
220 |
-
i = self._find_macro(name)
|
221 |
-
if i is not None:
|
222 |
-
del self.macros[i]
|
223 |
-
|
224 |
-
self.macros.append((name, value))
|
225 |
-
|
226 |
-
def undefine_macro(self, name):
|
227 |
-
"""Undefine a preprocessor macro for all compilations driven by
|
228 |
-
this compiler object. If the same macro is defined by
|
229 |
-
'define_macro()' and undefined by 'undefine_macro()' the last call
|
230 |
-
takes precedence (including multiple redefinitions or
|
231 |
-
undefinitions). If the macro is redefined/undefined on a
|
232 |
-
per-compilation basis (ie. in the call to 'compile()'), then that
|
233 |
-
takes precedence.
|
234 |
-
"""
|
235 |
-
# Delete from the list of macro definitions/undefinitions if
|
236 |
-
# already there (so that this one will take precedence).
|
237 |
-
i = self._find_macro(name)
|
238 |
-
if i is not None:
|
239 |
-
del self.macros[i]
|
240 |
-
|
241 |
-
undefn = (name,)
|
242 |
-
self.macros.append(undefn)
|
243 |
-
|
244 |
-
def add_include_dir(self, dir):
|
245 |
-
"""Add 'dir' to the list of directories that will be searched for
|
246 |
-
header files. The compiler is instructed to search directories in
|
247 |
-
the order in which they are supplied by successive calls to
|
248 |
-
'add_include_dir()'.
|
249 |
-
"""
|
250 |
-
self.include_dirs.append(dir)
|
251 |
-
|
252 |
-
def set_include_dirs(self, dirs):
|
253 |
-
"""Set the list of directories that will be searched to 'dirs' (a
|
254 |
-
list of strings). Overrides any preceding calls to
|
255 |
-
'add_include_dir()'; subsequence calls to 'add_include_dir()' add
|
256 |
-
to the list passed to 'set_include_dirs()'. This does not affect
|
257 |
-
any list of standard include directories that the compiler may
|
258 |
-
search by default.
|
259 |
-
"""
|
260 |
-
self.include_dirs = dirs[:]
|
261 |
-
|
262 |
-
def add_library(self, libname):
|
263 |
-
"""Add 'libname' to the list of libraries that will be included in
|
264 |
-
all links driven by this compiler object. Note that 'libname'
|
265 |
-
should *not* be the name of a file containing a library, but the
|
266 |
-
name of the library itself: the actual filename will be inferred by
|
267 |
-
the linker, the compiler, or the compiler class (depending on the
|
268 |
-
platform).
|
269 |
-
|
270 |
-
The linker will be instructed to link against libraries in the
|
271 |
-
order they were supplied to 'add_library()' and/or
|
272 |
-
'set_libraries()'. It is perfectly valid to duplicate library
|
273 |
-
names; the linker will be instructed to link against libraries as
|
274 |
-
many times as they are mentioned.
|
275 |
-
"""
|
276 |
-
self.libraries.append(libname)
|
277 |
-
|
278 |
-
def set_libraries(self, libnames):
|
279 |
-
"""Set the list of libraries to be included in all links driven by
|
280 |
-
this compiler object to 'libnames' (a list of strings). This does
|
281 |
-
not affect any standard system libraries that the linker may
|
282 |
-
include by default.
|
283 |
-
"""
|
284 |
-
self.libraries = libnames[:]
|
285 |
-
|
286 |
-
def add_library_dir(self, dir):
|
287 |
-
"""Add 'dir' to the list of directories that will be searched for
|
288 |
-
libraries specified to 'add_library()' and 'set_libraries()'. The
|
289 |
-
linker will be instructed to search for libraries in the order they
|
290 |
-
are supplied to 'add_library_dir()' and/or 'set_library_dirs()'.
|
291 |
-
"""
|
292 |
-
self.library_dirs.append(dir)
|
293 |
-
|
294 |
-
def set_library_dirs(self, dirs):
|
295 |
-
"""Set the list of library search directories to 'dirs' (a list of
|
296 |
-
strings). This does not affect any standard library search path
|
297 |
-
that the linker may search by default.
|
298 |
-
"""
|
299 |
-
self.library_dirs = dirs[:]
|
300 |
-
|
301 |
-
def add_runtime_library_dir(self, dir):
|
302 |
-
"""Add 'dir' to the list of directories that will be searched for
|
303 |
-
shared libraries at runtime.
|
304 |
-
"""
|
305 |
-
self.runtime_library_dirs.append(dir)
|
306 |
-
|
307 |
-
def set_runtime_library_dirs(self, dirs):
|
308 |
-
"""Set the list of directories to search for shared libraries at
|
309 |
-
runtime to 'dirs' (a list of strings). This does not affect any
|
310 |
-
standard search path that the runtime linker may search by
|
311 |
-
default.
|
312 |
-
"""
|
313 |
-
self.runtime_library_dirs = dirs[:]
|
314 |
-
|
315 |
-
def add_link_object(self, object):
|
316 |
-
"""Add 'object' to the list of object files (or analogues, such as
|
317 |
-
explicitly named library files or the output of "resource
|
318 |
-
compilers") to be included in every link driven by this compiler
|
319 |
-
object.
|
320 |
-
"""
|
321 |
-
self.objects.append(object)
|
322 |
-
|
323 |
-
def set_link_objects(self, objects):
|
324 |
-
"""Set the list of object files (or analogues) to be included in
|
325 |
-
every link to 'objects'. This does not affect any standard object
|
326 |
-
files that the linker may include by default (such as system
|
327 |
-
libraries).
|
328 |
-
"""
|
329 |
-
self.objects = objects[:]
|
330 |
-
|
331 |
-
# -- Private utility methods --------------------------------------
|
332 |
-
# (here for the convenience of subclasses)
|
333 |
-
|
334 |
-
# Helper method to prep compiler in subclass compile() methods
|
335 |
-
|
336 |
-
def _setup_compile(self, outdir, macros, incdirs, sources, depends, extra):
|
337 |
-
"""Process arguments and decide which source files to compile."""
|
338 |
-
outdir, macros, incdirs = self._fix_compile_args(outdir, macros, incdirs)
|
339 |
-
|
340 |
-
if extra is None:
|
341 |
-
extra = []
|
342 |
-
|
343 |
-
# Get the list of expected output (object) files
|
344 |
-
objects = self.object_filenames(sources, strip_dir=0, output_dir=outdir)
|
345 |
-
assert len(objects) == len(sources)
|
346 |
-
|
347 |
-
pp_opts = gen_preprocess_options(macros, incdirs)
|
348 |
-
|
349 |
-
build = {}
|
350 |
-
for i in range(len(sources)):
|
351 |
-
src = sources[i]
|
352 |
-
obj = objects[i]
|
353 |
-
ext = os.path.splitext(src)[1]
|
354 |
-
self.mkpath(os.path.dirname(obj))
|
355 |
-
build[obj] = (src, ext)
|
356 |
-
|
357 |
-
return macros, objects, extra, pp_opts, build
|
358 |
-
|
359 |
-
def _get_cc_args(self, pp_opts, debug, before):
|
360 |
-
# works for unixccompiler, cygwinccompiler
|
361 |
-
cc_args = pp_opts + ['-c']
|
362 |
-
if debug:
|
363 |
-
cc_args[:0] = ['-g']
|
364 |
-
if before:
|
365 |
-
cc_args[:0] = before
|
366 |
-
return cc_args
|
367 |
-
|
368 |
-
def _fix_compile_args(self, output_dir, macros, include_dirs):
|
369 |
-
"""Typecheck and fix-up some of the arguments to the 'compile()'
|
370 |
-
method, and return fixed-up values. Specifically: if 'output_dir'
|
371 |
-
is None, replaces it with 'self.output_dir'; ensures that 'macros'
|
372 |
-
is a list, and augments it with 'self.macros'; ensures that
|
373 |
-
'include_dirs' is a list, and augments it with 'self.include_dirs'.
|
374 |
-
Guarantees that the returned values are of the correct type,
|
375 |
-
i.e. for 'output_dir' either string or None, and for 'macros' and
|
376 |
-
'include_dirs' either list or None.
|
377 |
-
"""
|
378 |
-
if output_dir is None:
|
379 |
-
output_dir = self.output_dir
|
380 |
-
elif not isinstance(output_dir, str):
|
381 |
-
raise TypeError("'output_dir' must be a string or None")
|
382 |
-
|
383 |
-
if macros is None:
|
384 |
-
macros = self.macros
|
385 |
-
elif isinstance(macros, list):
|
386 |
-
macros = macros + (self.macros or [])
|
387 |
-
else:
|
388 |
-
raise TypeError("'macros' (if supplied) must be a list of tuples")
|
389 |
-
|
390 |
-
if include_dirs is None:
|
391 |
-
include_dirs = self.include_dirs
|
392 |
-
elif isinstance(include_dirs, (list, tuple)):
|
393 |
-
include_dirs = list(include_dirs) + (self.include_dirs or [])
|
394 |
-
else:
|
395 |
-
raise TypeError("'include_dirs' (if supplied) must be a list of strings")
|
396 |
-
|
397 |
-
# add include dirs for class
|
398 |
-
include_dirs += self.__class__.include_dirs
|
399 |
-
|
400 |
-
return output_dir, macros, include_dirs
|
401 |
-
|
402 |
-
def _prep_compile(self, sources, output_dir, depends=None):
|
403 |
-
"""Decide which source files must be recompiled.
|
404 |
-
|
405 |
-
Determine the list of object files corresponding to 'sources',
|
406 |
-
and figure out which ones really need to be recompiled.
|
407 |
-
Return a list of all object files and a dictionary telling
|
408 |
-
which source files can be skipped.
|
409 |
-
"""
|
410 |
-
# Get the list of expected output (object) files
|
411 |
-
objects = self.object_filenames(sources, output_dir=output_dir)
|
412 |
-
assert len(objects) == len(sources)
|
413 |
-
|
414 |
-
# Return an empty dict for the "which source files can be skipped"
|
415 |
-
# return value to preserve API compatibility.
|
416 |
-
return objects, {}
|
417 |
-
|
418 |
-
def _fix_object_args(self, objects, output_dir):
|
419 |
-
"""Typecheck and fix up some arguments supplied to various methods.
|
420 |
-
Specifically: ensure that 'objects' is a list; if output_dir is
|
421 |
-
None, replace with self.output_dir. Return fixed versions of
|
422 |
-
'objects' and 'output_dir'.
|
423 |
-
"""
|
424 |
-
if not isinstance(objects, (list, tuple)):
|
425 |
-
raise TypeError("'objects' must be a list or tuple of strings")
|
426 |
-
objects = list(objects)
|
427 |
-
|
428 |
-
if output_dir is None:
|
429 |
-
output_dir = self.output_dir
|
430 |
-
elif not isinstance(output_dir, str):
|
431 |
-
raise TypeError("'output_dir' must be a string or None")
|
432 |
-
|
433 |
-
return (objects, output_dir)
|
434 |
-
|
435 |
-
def _fix_lib_args(self, libraries, library_dirs, runtime_library_dirs):
|
436 |
-
"""Typecheck and fix up some of the arguments supplied to the
|
437 |
-
'link_*' methods. Specifically: ensure that all arguments are
|
438 |
-
lists, and augment them with their permanent versions
|
439 |
-
(eg. 'self.libraries' augments 'libraries'). Return a tuple with
|
440 |
-
fixed versions of all arguments.
|
441 |
-
"""
|
442 |
-
if libraries is None:
|
443 |
-
libraries = self.libraries
|
444 |
-
elif isinstance(libraries, (list, tuple)):
|
445 |
-
libraries = list(libraries) + (self.libraries or [])
|
446 |
-
else:
|
447 |
-
raise TypeError("'libraries' (if supplied) must be a list of strings")
|
448 |
-
|
449 |
-
if library_dirs is None:
|
450 |
-
library_dirs = self.library_dirs
|
451 |
-
elif isinstance(library_dirs, (list, tuple)):
|
452 |
-
library_dirs = list(library_dirs) + (self.library_dirs or [])
|
453 |
-
else:
|
454 |
-
raise TypeError("'library_dirs' (if supplied) must be a list of strings")
|
455 |
-
|
456 |
-
# add library dirs for class
|
457 |
-
library_dirs += self.__class__.library_dirs
|
458 |
-
|
459 |
-
if runtime_library_dirs is None:
|
460 |
-
runtime_library_dirs = self.runtime_library_dirs
|
461 |
-
elif isinstance(runtime_library_dirs, (list, tuple)):
|
462 |
-
runtime_library_dirs = list(runtime_library_dirs) + (
|
463 |
-
self.runtime_library_dirs or []
|
464 |
-
)
|
465 |
-
else:
|
466 |
-
raise TypeError(
|
467 |
-
"'runtime_library_dirs' (if supplied) " "must be a list of strings"
|
468 |
-
)
|
469 |
-
|
470 |
-
return (libraries, library_dirs, runtime_library_dirs)
|
471 |
-
|
472 |
-
def _need_link(self, objects, output_file):
|
473 |
-
"""Return true if we need to relink the files listed in 'objects'
|
474 |
-
to recreate 'output_file'.
|
475 |
-
"""
|
476 |
-
if self.force:
|
477 |
-
return True
|
478 |
-
else:
|
479 |
-
if self.dry_run:
|
480 |
-
newer = newer_group(objects, output_file, missing='newer')
|
481 |
-
else:
|
482 |
-
newer = newer_group(objects, output_file)
|
483 |
-
return newer
|
484 |
-
|
485 |
-
def detect_language(self, sources):
|
486 |
-
"""Detect the language of a given file, or list of files. Uses
|
487 |
-
language_map, and language_order to do the job.
|
488 |
-
"""
|
489 |
-
if not isinstance(sources, list):
|
490 |
-
sources = [sources]
|
491 |
-
lang = None
|
492 |
-
index = len(self.language_order)
|
493 |
-
for source in sources:
|
494 |
-
base, ext = os.path.splitext(source)
|
495 |
-
extlang = self.language_map.get(ext)
|
496 |
-
try:
|
497 |
-
extindex = self.language_order.index(extlang)
|
498 |
-
if extindex < index:
|
499 |
-
lang = extlang
|
500 |
-
index = extindex
|
501 |
-
except ValueError:
|
502 |
-
pass
|
503 |
-
return lang
|
504 |
-
|
505 |
-
# -- Worker methods ------------------------------------------------
|
506 |
-
# (must be implemented by subclasses)
|
507 |
-
|
508 |
-
def preprocess(
|
509 |
-
self,
|
510 |
-
source,
|
511 |
-
output_file=None,
|
512 |
-
macros=None,
|
513 |
-
include_dirs=None,
|
514 |
-
extra_preargs=None,
|
515 |
-
extra_postargs=None,
|
516 |
-
):
|
517 |
-
"""Preprocess a single C/C++ source file, named in 'source'.
|
518 |
-
Output will be written to file named 'output_file', or stdout if
|
519 |
-
'output_file' not supplied. 'macros' is a list of macro
|
520 |
-
definitions as for 'compile()', which will augment the macros set
|
521 |
-
with 'define_macro()' and 'undefine_macro()'. 'include_dirs' is a
|
522 |
-
list of directory names that will be added to the default list.
|
523 |
-
|
524 |
-
Raises PreprocessError on failure.
|
525 |
-
"""
|
526 |
-
pass
|
527 |
-
|
528 |
-
def compile(
|
529 |
-
self,
|
530 |
-
sources,
|
531 |
-
output_dir=None,
|
532 |
-
macros=None,
|
533 |
-
include_dirs=None,
|
534 |
-
debug=0,
|
535 |
-
extra_preargs=None,
|
536 |
-
extra_postargs=None,
|
537 |
-
depends=None,
|
538 |
-
):
|
539 |
-
"""Compile one or more source files.
|
540 |
-
|
541 |
-
'sources' must be a list of filenames, most likely C/C++
|
542 |
-
files, but in reality anything that can be handled by a
|
543 |
-
particular compiler and compiler class (eg. MSVCCompiler can
|
544 |
-
handle resource files in 'sources'). Return a list of object
|
545 |
-
filenames, one per source filename in 'sources'. Depending on
|
546 |
-
the implementation, not all source files will necessarily be
|
547 |
-
compiled, but all corresponding object filenames will be
|
548 |
-
returned.
|
549 |
-
|
550 |
-
If 'output_dir' is given, object files will be put under it, while
|
551 |
-
retaining their original path component. That is, "foo/bar.c"
|
552 |
-
normally compiles to "foo/bar.o" (for a Unix implementation); if
|
553 |
-
'output_dir' is "build", then it would compile to
|
554 |
-
"build/foo/bar.o".
|
555 |
-
|
556 |
-
'macros', if given, must be a list of macro definitions. A macro
|
557 |
-
definition is either a (name, value) 2-tuple or a (name,) 1-tuple.
|
558 |
-
The former defines a macro; if the value is None, the macro is
|
559 |
-
defined without an explicit value. The 1-tuple case undefines a
|
560 |
-
macro. Later definitions/redefinitions/ undefinitions take
|
561 |
-
precedence.
|
562 |
-
|
563 |
-
'include_dirs', if given, must be a list of strings, the
|
564 |
-
directories to add to the default include file search path for this
|
565 |
-
compilation only.
|
566 |
-
|
567 |
-
'debug' is a boolean; if true, the compiler will be instructed to
|
568 |
-
output debug symbols in (or alongside) the object file(s).
|
569 |
-
|
570 |
-
'extra_preargs' and 'extra_postargs' are implementation- dependent.
|
571 |
-
On platforms that have the notion of a command-line (e.g. Unix,
|
572 |
-
DOS/Windows), they are most likely lists of strings: extra
|
573 |
-
command-line arguments to prepend/append to the compiler command
|
574 |
-
line. On other platforms, consult the implementation class
|
575 |
-
documentation. In any event, they are intended as an escape hatch
|
576 |
-
for those occasions when the abstract compiler framework doesn't
|
577 |
-
cut the mustard.
|
578 |
-
|
579 |
-
'depends', if given, is a list of filenames that all targets
|
580 |
-
depend on. If a source file is older than any file in
|
581 |
-
depends, then the source file will be recompiled. This
|
582 |
-
supports dependency tracking, but only at a coarse
|
583 |
-
granularity.
|
584 |
-
|
585 |
-
Raises CompileError on failure.
|
586 |
-
"""
|
587 |
-
# A concrete compiler class can either override this method
|
588 |
-
# entirely or implement _compile().
|
589 |
-
macros, objects, extra_postargs, pp_opts, build = self._setup_compile(
|
590 |
-
output_dir, macros, include_dirs, sources, depends, extra_postargs
|
591 |
-
)
|
592 |
-
cc_args = self._get_cc_args(pp_opts, debug, extra_preargs)
|
593 |
-
|
594 |
-
for obj in objects:
|
595 |
-
try:
|
596 |
-
src, ext = build[obj]
|
597 |
-
except KeyError:
|
598 |
-
continue
|
599 |
-
self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
|
600 |
-
|
601 |
-
# Return *all* object filenames, not just the ones we just built.
|
602 |
-
return objects
|
603 |
-
|
604 |
-
def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts):
|
605 |
-
"""Compile 'src' to product 'obj'."""
|
606 |
-
# A concrete compiler class that does not override compile()
|
607 |
-
# should implement _compile().
|
608 |
-
pass
|
609 |
-
|
610 |
-
def create_static_lib(
|
611 |
-
self, objects, output_libname, output_dir=None, debug=0, target_lang=None
|
612 |
-
):
|
613 |
-
"""Link a bunch of stuff together to create a static library file.
|
614 |
-
The "bunch of stuff" consists of the list of object files supplied
|
615 |
-
as 'objects', the extra object files supplied to
|
616 |
-
'add_link_object()' and/or 'set_link_objects()', the libraries
|
617 |
-
supplied to 'add_library()' and/or 'set_libraries()', and the
|
618 |
-
libraries supplied as 'libraries' (if any).
|
619 |
-
|
620 |
-
'output_libname' should be a library name, not a filename; the
|
621 |
-
filename will be inferred from the library name. 'output_dir' is
|
622 |
-
the directory where the library file will be put.
|
623 |
-
|
624 |
-
'debug' is a boolean; if true, debugging information will be
|
625 |
-
included in the library (note that on most platforms, it is the
|
626 |
-
compile step where this matters: the 'debug' flag is included here
|
627 |
-
just for consistency).
|
628 |
-
|
629 |
-
'target_lang' is the target language for which the given objects
|
630 |
-
are being compiled. This allows specific linkage time treatment of
|
631 |
-
certain languages.
|
632 |
-
|
633 |
-
Raises LibError on failure.
|
634 |
-
"""
|
635 |
-
pass
|
636 |
-
|
637 |
-
# values for target_desc parameter in link()
|
638 |
-
SHARED_OBJECT = "shared_object"
|
639 |
-
SHARED_LIBRARY = "shared_library"
|
640 |
-
EXECUTABLE = "executable"
|
641 |
-
|
642 |
-
def link(
|
643 |
-
self,
|
644 |
-
target_desc,
|
645 |
-
objects,
|
646 |
-
output_filename,
|
647 |
-
output_dir=None,
|
648 |
-
libraries=None,
|
649 |
-
library_dirs=None,
|
650 |
-
runtime_library_dirs=None,
|
651 |
-
export_symbols=None,
|
652 |
-
debug=0,
|
653 |
-
extra_preargs=None,
|
654 |
-
extra_postargs=None,
|
655 |
-
build_temp=None,
|
656 |
-
target_lang=None,
|
657 |
-
):
|
658 |
-
"""Link a bunch of stuff together to create an executable or
|
659 |
-
shared library file.
|
660 |
-
|
661 |
-
The "bunch of stuff" consists of the list of object files supplied
|
662 |
-
as 'objects'. 'output_filename' should be a filename. If
|
663 |
-
'output_dir' is supplied, 'output_filename' is relative to it
|
664 |
-
(i.e. 'output_filename' can provide directory components if
|
665 |
-
needed).
|
666 |
-
|
667 |
-
'libraries' is a list of libraries to link against. These are
|
668 |
-
library names, not filenames, since they're translated into
|
669 |
-
filenames in a platform-specific way (eg. "foo" becomes "libfoo.a"
|
670 |
-
on Unix and "foo.lib" on DOS/Windows). However, they can include a
|
671 |
-
directory component, which means the linker will look in that
|
672 |
-
specific directory rather than searching all the normal locations.
|
673 |
-
|
674 |
-
'library_dirs', if supplied, should be a list of directories to
|
675 |
-
search for libraries that were specified as bare library names
|
676 |
-
(ie. no directory component). These are on top of the system
|
677 |
-
default and those supplied to 'add_library_dir()' and/or
|
678 |
-
'set_library_dirs()'. 'runtime_library_dirs' is a list of
|
679 |
-
directories that will be embedded into the shared library and used
|
680 |
-
to search for other shared libraries that *it* depends on at
|
681 |
-
run-time. (This may only be relevant on Unix.)
|
682 |
-
|
683 |
-
'export_symbols' is a list of symbols that the shared library will
|
684 |
-
export. (This appears to be relevant only on Windows.)
|
685 |
-
|
686 |
-
'debug' is as for 'compile()' and 'create_static_lib()', with the
|
687 |
-
slight distinction that it actually matters on most platforms (as
|
688 |
-
opposed to 'create_static_lib()', which includes a 'debug' flag
|
689 |
-
mostly for form's sake).
|
690 |
-
|
691 |
-
'extra_preargs' and 'extra_postargs' are as for 'compile()' (except
|
692 |
-
of course that they supply command-line arguments for the
|
693 |
-
particular linker being used).
|
694 |
-
|
695 |
-
'target_lang' is the target language for which the given objects
|
696 |
-
are being compiled. This allows specific linkage time treatment of
|
697 |
-
certain languages.
|
698 |
-
|
699 |
-
Raises LinkError on failure.
|
700 |
-
"""
|
701 |
-
raise NotImplementedError
|
702 |
-
|
703 |
-
# Old 'link_*()' methods, rewritten to use the new 'link()' method.
|
704 |
-
|
705 |
-
def link_shared_lib(
|
706 |
-
self,
|
707 |
-
objects,
|
708 |
-
output_libname,
|
709 |
-
output_dir=None,
|
710 |
-
libraries=None,
|
711 |
-
library_dirs=None,
|
712 |
-
runtime_library_dirs=None,
|
713 |
-
export_symbols=None,
|
714 |
-
debug=0,
|
715 |
-
extra_preargs=None,
|
716 |
-
extra_postargs=None,
|
717 |
-
build_temp=None,
|
718 |
-
target_lang=None,
|
719 |
-
):
|
720 |
-
self.link(
|
721 |
-
CCompiler.SHARED_LIBRARY,
|
722 |
-
objects,
|
723 |
-
self.library_filename(output_libname, lib_type='shared'),
|
724 |
-
output_dir,
|
725 |
-
libraries,
|
726 |
-
library_dirs,
|
727 |
-
runtime_library_dirs,
|
728 |
-
export_symbols,
|
729 |
-
debug,
|
730 |
-
extra_preargs,
|
731 |
-
extra_postargs,
|
732 |
-
build_temp,
|
733 |
-
target_lang,
|
734 |
-
)
|
735 |
-
|
736 |
-
def link_shared_object(
|
737 |
-
self,
|
738 |
-
objects,
|
739 |
-
output_filename,
|
740 |
-
output_dir=None,
|
741 |
-
libraries=None,
|
742 |
-
library_dirs=None,
|
743 |
-
runtime_library_dirs=None,
|
744 |
-
export_symbols=None,
|
745 |
-
debug=0,
|
746 |
-
extra_preargs=None,
|
747 |
-
extra_postargs=None,
|
748 |
-
build_temp=None,
|
749 |
-
target_lang=None,
|
750 |
-
):
|
751 |
-
self.link(
|
752 |
-
CCompiler.SHARED_OBJECT,
|
753 |
-
objects,
|
754 |
-
output_filename,
|
755 |
-
output_dir,
|
756 |
-
libraries,
|
757 |
-
library_dirs,
|
758 |
-
runtime_library_dirs,
|
759 |
-
export_symbols,
|
760 |
-
debug,
|
761 |
-
extra_preargs,
|
762 |
-
extra_postargs,
|
763 |
-
build_temp,
|
764 |
-
target_lang,
|
765 |
-
)
|
766 |
-
|
767 |
-
def link_executable(
|
768 |
-
self,
|
769 |
-
objects,
|
770 |
-
output_progname,
|
771 |
-
output_dir=None,
|
772 |
-
libraries=None,
|
773 |
-
library_dirs=None,
|
774 |
-
runtime_library_dirs=None,
|
775 |
-
debug=0,
|
776 |
-
extra_preargs=None,
|
777 |
-
extra_postargs=None,
|
778 |
-
target_lang=None,
|
779 |
-
):
|
780 |
-
self.link(
|
781 |
-
CCompiler.EXECUTABLE,
|
782 |
-
objects,
|
783 |
-
self.executable_filename(output_progname),
|
784 |
-
output_dir,
|
785 |
-
libraries,
|
786 |
-
library_dirs,
|
787 |
-
runtime_library_dirs,
|
788 |
-
None,
|
789 |
-
debug,
|
790 |
-
extra_preargs,
|
791 |
-
extra_postargs,
|
792 |
-
None,
|
793 |
-
target_lang,
|
794 |
-
)
|
795 |
-
|
796 |
-
# -- Miscellaneous methods -----------------------------------------
|
797 |
-
# These are all used by the 'gen_lib_options() function; there is
|
798 |
-
# no appropriate default implementation so subclasses should
|
799 |
-
# implement all of these.
|
800 |
-
|
801 |
-
def library_dir_option(self, dir):
|
802 |
-
"""Return the compiler option to add 'dir' to the list of
|
803 |
-
directories searched for libraries.
|
804 |
-
"""
|
805 |
-
raise NotImplementedError
|
806 |
-
|
807 |
-
def runtime_library_dir_option(self, dir):
|
808 |
-
"""Return the compiler option to add 'dir' to the list of
|
809 |
-
directories searched for runtime libraries.
|
810 |
-
"""
|
811 |
-
raise NotImplementedError
|
812 |
-
|
813 |
-
def library_option(self, lib):
|
814 |
-
"""Return the compiler option to add 'lib' to the list of libraries
|
815 |
-
linked into the shared library or executable.
|
816 |
-
"""
|
817 |
-
raise NotImplementedError
|
818 |
-
|
819 |
-
def has_function( # noqa: C901
|
820 |
-
self,
|
821 |
-
funcname,
|
822 |
-
includes=None,
|
823 |
-
include_dirs=None,
|
824 |
-
libraries=None,
|
825 |
-
library_dirs=None,
|
826 |
-
):
|
827 |
-
"""Return a boolean indicating whether funcname is supported on
|
828 |
-
the current platform. The optional arguments can be used to
|
829 |
-
augment the compilation environment.
|
830 |
-
"""
|
831 |
-
# this can't be included at module scope because it tries to
|
832 |
-
# import math which might not be available at that point - maybe
|
833 |
-
# the necessary logic should just be inlined?
|
834 |
-
import tempfile
|
835 |
-
|
836 |
-
if includes is None:
|
837 |
-
includes = []
|
838 |
-
if include_dirs is None:
|
839 |
-
include_dirs = []
|
840 |
-
if libraries is None:
|
841 |
-
libraries = []
|
842 |
-
if library_dirs is None:
|
843 |
-
library_dirs = []
|
844 |
-
fd, fname = tempfile.mkstemp(".c", funcname, text=True)
|
845 |
-
f = os.fdopen(fd, "w")
|
846 |
-
try:
|
847 |
-
for incl in includes:
|
848 |
-
f.write("""#include "%s"\n""" % incl)
|
849 |
-
f.write(
|
850 |
-
"""\
|
851 |
-
int main (int argc, char **argv) {
|
852 |
-
%s();
|
853 |
-
return 0;
|
854 |
-
}
|
855 |
-
"""
|
856 |
-
% funcname
|
857 |
-
)
|
858 |
-
finally:
|
859 |
-
f.close()
|
860 |
-
try:
|
861 |
-
objects = self.compile([fname], include_dirs=include_dirs)
|
862 |
-
except CompileError:
|
863 |
-
return False
|
864 |
-
finally:
|
865 |
-
os.remove(fname)
|
866 |
-
|
867 |
-
try:
|
868 |
-
self.link_executable(
|
869 |
-
objects, "a.out", libraries=libraries, library_dirs=library_dirs
|
870 |
-
)
|
871 |
-
except (LinkError, TypeError):
|
872 |
-
return False
|
873 |
-
else:
|
874 |
-
os.remove(os.path.join(self.output_dir or '', "a.out"))
|
875 |
-
finally:
|
876 |
-
for fn in objects:
|
877 |
-
os.remove(fn)
|
878 |
-
return True
|
879 |
-
|
880 |
-
def find_library_file(self, dirs, lib, debug=0):
|
881 |
-
"""Search the specified list of directories for a static or shared
|
882 |
-
library file 'lib' and return the full path to that file. If
|
883 |
-
'debug' true, look for a debugging version (if that makes sense on
|
884 |
-
the current platform). Return None if 'lib' wasn't found in any of
|
885 |
-
the specified directories.
|
886 |
-
"""
|
887 |
-
raise NotImplementedError
|
888 |
-
|
889 |
-
# -- Filename generation methods -----------------------------------
|
890 |
-
|
891 |
-
# The default implementation of the filename generating methods are
|
892 |
-
# prejudiced towards the Unix/DOS/Windows view of the world:
|
893 |
-
# * object files are named by replacing the source file extension
|
894 |
-
# (eg. .c/.cpp -> .o/.obj)
|
895 |
-
# * library files (shared or static) are named by plugging the
|
896 |
-
# library name and extension into a format string, eg.
|
897 |
-
# "lib%s.%s" % (lib_name, ".a") for Unix static libraries
|
898 |
-
# * executables are named by appending an extension (possibly
|
899 |
-
# empty) to the program name: eg. progname + ".exe" for
|
900 |
-
# Windows
|
901 |
-
#
|
902 |
-
# To reduce redundant code, these methods expect to find
|
903 |
-
# several attributes in the current object (presumably defined
|
904 |
-
# as class attributes):
|
905 |
-
# * src_extensions -
|
906 |
-
# list of C/C++ source file extensions, eg. ['.c', '.cpp']
|
907 |
-
# * obj_extension -
|
908 |
-
# object file extension, eg. '.o' or '.obj'
|
909 |
-
# * static_lib_extension -
|
910 |
-
# extension for static library files, eg. '.a' or '.lib'
|
911 |
-
# * shared_lib_extension -
|
912 |
-
# extension for shared library/object files, eg. '.so', '.dll'
|
913 |
-
# * static_lib_format -
|
914 |
-
# format string for generating static library filenames,
|
915 |
-
# eg. 'lib%s.%s' or '%s.%s'
|
916 |
-
# * shared_lib_format
|
917 |
-
# format string for generating shared library filenames
|
918 |
-
# (probably same as static_lib_format, since the extension
|
919 |
-
# is one of the intended parameters to the format string)
|
920 |
-
# * exe_extension -
|
921 |
-
# extension for executable files, eg. '' or '.exe'
|
922 |
-
|
923 |
-
def object_filenames(self, source_filenames, strip_dir=0, output_dir=''):
|
924 |
-
if output_dir is None:
|
925 |
-
output_dir = ''
|
926 |
-
return list(
|
927 |
-
self._make_out_path(output_dir, strip_dir, src_name)
|
928 |
-
for src_name in source_filenames
|
929 |
-
)
|
930 |
-
|
931 |
-
@property
|
932 |
-
def out_extensions(self):
|
933 |
-
return dict.fromkeys(self.src_extensions, self.obj_extension)
|
934 |
-
|
935 |
-
def _make_out_path(self, output_dir, strip_dir, src_name):
|
936 |
-
base, ext = os.path.splitext(src_name)
|
937 |
-
base = self._make_relative(base)
|
938 |
-
try:
|
939 |
-
new_ext = self.out_extensions[ext]
|
940 |
-
except LookupError:
|
941 |
-
raise UnknownFileError(
|
942 |
-
"unknown file type '{}' (from '{}')".format(ext, src_name)
|
943 |
-
)
|
944 |
-
if strip_dir:
|
945 |
-
base = os.path.basename(base)
|
946 |
-
return os.path.join(output_dir, base + new_ext)
|
947 |
-
|
948 |
-
@staticmethod
|
949 |
-
def _make_relative(base):
|
950 |
-
"""
|
951 |
-
In order to ensure that a filename always honors the
|
952 |
-
indicated output_dir, make sure it's relative.
|
953 |
-
Ref python/cpython#37775.
|
954 |
-
"""
|
955 |
-
# Chop off the drive
|
956 |
-
no_drive = os.path.splitdrive(base)[1]
|
957 |
-
# If abs, chop off leading /
|
958 |
-
return no_drive[os.path.isabs(no_drive) :]
|
959 |
-
|
960 |
-
def shared_object_filename(self, basename, strip_dir=0, output_dir=''):
|
961 |
-
assert output_dir is not None
|
962 |
-
if strip_dir:
|
963 |
-
basename = os.path.basename(basename)
|
964 |
-
return os.path.join(output_dir, basename + self.shared_lib_extension)
|
965 |
-
|
966 |
-
def executable_filename(self, basename, strip_dir=0, output_dir=''):
|
967 |
-
assert output_dir is not None
|
968 |
-
if strip_dir:
|
969 |
-
basename = os.path.basename(basename)
|
970 |
-
return os.path.join(output_dir, basename + (self.exe_extension or ''))
|
971 |
-
|
972 |
-
def library_filename(
|
973 |
-
self, libname, lib_type='static', strip_dir=0, output_dir='' # or 'shared'
|
974 |
-
):
|
975 |
-
assert output_dir is not None
|
976 |
-
expected = '"static", "shared", "dylib", "xcode_stub"'
|
977 |
-
if lib_type not in eval(expected):
|
978 |
-
raise ValueError(f"'lib_type' must be {expected}")
|
979 |
-
fmt = getattr(self, lib_type + "_lib_format")
|
980 |
-
ext = getattr(self, lib_type + "_lib_extension")
|
981 |
-
|
982 |
-
dir, base = os.path.split(libname)
|
983 |
-
filename = fmt % (base, ext)
|
984 |
-
if strip_dir:
|
985 |
-
dir = ''
|
986 |
-
|
987 |
-
return os.path.join(output_dir, dir, filename)
|
988 |
-
|
989 |
-
# -- Utility methods -----------------------------------------------
|
990 |
-
|
991 |
-
def announce(self, msg, level=1):
|
992 |
-
log.debug(msg)
|
993 |
-
|
994 |
-
def debug_print(self, msg):
|
995 |
-
from distutils.debug import DEBUG
|
996 |
-
|
997 |
-
if DEBUG:
|
998 |
-
print(msg)
|
999 |
-
|
1000 |
-
def warn(self, msg):
|
1001 |
-
sys.stderr.write("warning: %s\n" % msg)
|
1002 |
-
|
1003 |
-
def execute(self, func, args, msg=None, level=1):
|
1004 |
-
execute(func, args, msg, self.dry_run)
|
1005 |
-
|
1006 |
-
def spawn(self, cmd, **kwargs):
|
1007 |
-
spawn(cmd, dry_run=self.dry_run, **kwargs)
|
1008 |
-
|
1009 |
-
def move_file(self, src, dst):
|
1010 |
-
return move_file(src, dst, dry_run=self.dry_run)
|
1011 |
-
|
1012 |
-
def mkpath(self, name, mode=0o777):
|
1013 |
-
mkpath(name, mode, dry_run=self.dry_run)
|
1014 |
-
|
1015 |
-
|
1016 |
-
# Map a sys.platform/os.name ('posix', 'nt') to the default compiler
|
1017 |
-
# type for that platform. Keys are interpreted as re match
|
1018 |
-
# patterns. Order is important; platform mappings are preferred over
|
1019 |
-
# OS names.
|
1020 |
-
_default_compilers = (
|
1021 |
-
# Platform string mappings
|
1022 |
-
# on a cygwin built python we can use gcc like an ordinary UNIXish
|
1023 |
-
# compiler
|
1024 |
-
('cygwin.*', 'unix'),
|
1025 |
-
# OS name mappings
|
1026 |
-
('posix', 'unix'),
|
1027 |
-
('nt', 'msvc'),
|
1028 |
-
)
|
1029 |
-
|
1030 |
-
|
1031 |
-
def get_default_compiler(osname=None, platform=None):
|
1032 |
-
"""Determine the default compiler to use for the given platform.
|
1033 |
-
|
1034 |
-
osname should be one of the standard Python OS names (i.e. the
|
1035 |
-
ones returned by os.name) and platform the common value
|
1036 |
-
returned by sys.platform for the platform in question.
|
1037 |
-
|
1038 |
-
The default values are os.name and sys.platform in case the
|
1039 |
-
parameters are not given.
|
1040 |
-
"""
|
1041 |
-
if osname is None:
|
1042 |
-
osname = os.name
|
1043 |
-
if platform is None:
|
1044 |
-
platform = sys.platform
|
1045 |
-
for pattern, compiler in _default_compilers:
|
1046 |
-
if (
|
1047 |
-
re.match(pattern, platform) is not None
|
1048 |
-
or re.match(pattern, osname) is not None
|
1049 |
-
):
|
1050 |
-
return compiler
|
1051 |
-
# Default to Unix compiler
|
1052 |
-
return 'unix'
|
1053 |
-
|
1054 |
-
|
1055 |
-
# Map compiler types to (module_name, class_name) pairs -- ie. where to
|
1056 |
-
# find the code that implements an interface to this compiler. (The module
|
1057 |
-
# is assumed to be in the 'distutils' package.)
|
1058 |
-
compiler_class = {
|
1059 |
-
'unix': ('unixccompiler', 'UnixCCompiler', "standard UNIX-style compiler"),
|
1060 |
-
'msvc': ('_msvccompiler', 'MSVCCompiler', "Microsoft Visual C++"),
|
1061 |
-
'cygwin': (
|
1062 |
-
'cygwinccompiler',
|
1063 |
-
'CygwinCCompiler',
|
1064 |
-
"Cygwin port of GNU C Compiler for Win32",
|
1065 |
-
),
|
1066 |
-
'mingw32': (
|
1067 |
-
'cygwinccompiler',
|
1068 |
-
'Mingw32CCompiler',
|
1069 |
-
"Mingw32 port of GNU C Compiler for Win32",
|
1070 |
-
),
|
1071 |
-
'bcpp': ('bcppcompiler', 'BCPPCompiler', "Borland C++ Compiler"),
|
1072 |
-
}
|
1073 |
-
|
1074 |
-
|
1075 |
-
def show_compilers():
|
1076 |
-
"""Print list of available compilers (used by the "--help-compiler"
|
1077 |
-
options to "build", "build_ext", "build_clib").
|
1078 |
-
"""
|
1079 |
-
# XXX this "knows" that the compiler option it's describing is
|
1080 |
-
# "--compiler", which just happens to be the case for the three
|
1081 |
-
# commands that use it.
|
1082 |
-
from distutils.fancy_getopt import FancyGetopt
|
1083 |
-
|
1084 |
-
compilers = []
|
1085 |
-
for compiler in compiler_class.keys():
|
1086 |
-
compilers.append(("compiler=" + compiler, None, compiler_class[compiler][2]))
|
1087 |
-
compilers.sort()
|
1088 |
-
pretty_printer = FancyGetopt(compilers)
|
1089 |
-
pretty_printer.print_help("List of available compilers:")
|
1090 |
-
|
1091 |
-
|
1092 |
-
def new_compiler(plat=None, compiler=None, verbose=0, dry_run=0, force=0):
|
1093 |
-
"""Generate an instance of some CCompiler subclass for the supplied
|
1094 |
-
platform/compiler combination. 'plat' defaults to 'os.name'
|
1095 |
-
(eg. 'posix', 'nt'), and 'compiler' defaults to the default compiler
|
1096 |
-
for that platform. Currently only 'posix' and 'nt' are supported, and
|
1097 |
-
the default compilers are "traditional Unix interface" (UnixCCompiler
|
1098 |
-
class) and Visual C++ (MSVCCompiler class). Note that it's perfectly
|
1099 |
-
possible to ask for a Unix compiler object under Windows, and a
|
1100 |
-
Microsoft compiler object under Unix -- if you supply a value for
|
1101 |
-
'compiler', 'plat' is ignored.
|
1102 |
-
"""
|
1103 |
-
if plat is None:
|
1104 |
-
plat = os.name
|
1105 |
-
|
1106 |
-
try:
|
1107 |
-
if compiler is None:
|
1108 |
-
compiler = get_default_compiler(plat)
|
1109 |
-
|
1110 |
-
(module_name, class_name, long_description) = compiler_class[compiler]
|
1111 |
-
except KeyError:
|
1112 |
-
msg = "don't know how to compile C/C++ code on platform '%s'" % plat
|
1113 |
-
if compiler is not None:
|
1114 |
-
msg = msg + " with '%s' compiler" % compiler
|
1115 |
-
raise DistutilsPlatformError(msg)
|
1116 |
-
|
1117 |
-
try:
|
1118 |
-
module_name = "distutils." + module_name
|
1119 |
-
__import__(module_name)
|
1120 |
-
module = sys.modules[module_name]
|
1121 |
-
klass = vars(module)[class_name]
|
1122 |
-
except ImportError:
|
1123 |
-
raise DistutilsModuleError(
|
1124 |
-
"can't compile C/C++ code: unable to load module '%s'" % module_name
|
1125 |
-
)
|
1126 |
-
except KeyError:
|
1127 |
-
raise DistutilsModuleError(
|
1128 |
-
"can't compile C/C++ code: unable to find class '%s' "
|
1129 |
-
"in module '%s'" % (class_name, module_name)
|
1130 |
-
)
|
1131 |
-
|
1132 |
-
# XXX The None is necessary to preserve backwards compatibility
|
1133 |
-
# with classes that expect verbose to be the first positional
|
1134 |
-
# argument.
|
1135 |
-
return klass(None, dry_run, force)
|
1136 |
-
|
1137 |
-
|
1138 |
-
def gen_preprocess_options(macros, include_dirs):
|
1139 |
-
"""Generate C pre-processor options (-D, -U, -I) as used by at least
|
1140 |
-
two types of compilers: the typical Unix compiler and Visual C++.
|
1141 |
-
'macros' is the usual thing, a list of 1- or 2-tuples, where (name,)
|
1142 |
-
means undefine (-U) macro 'name', and (name,value) means define (-D)
|
1143 |
-
macro 'name' to 'value'. 'include_dirs' is just a list of directory
|
1144 |
-
names to be added to the header file search path (-I). Returns a list
|
1145 |
-
of command-line options suitable for either Unix compilers or Visual
|
1146 |
-
C++.
|
1147 |
-
"""
|
1148 |
-
# XXX it would be nice (mainly aesthetic, and so we don't generate
|
1149 |
-
# stupid-looking command lines) to go over 'macros' and eliminate
|
1150 |
-
# redundant definitions/undefinitions (ie. ensure that only the
|
1151 |
-
# latest mention of a particular macro winds up on the command
|
1152 |
-
# line). I don't think it's essential, though, since most (all?)
|
1153 |
-
# Unix C compilers only pay attention to the latest -D or -U
|
1154 |
-
# mention of a macro on their command line. Similar situation for
|
1155 |
-
# 'include_dirs'. I'm punting on both for now. Anyways, weeding out
|
1156 |
-
# redundancies like this should probably be the province of
|
1157 |
-
# CCompiler, since the data structures used are inherited from it
|
1158 |
-
# and therefore common to all CCompiler classes.
|
1159 |
-
pp_opts = []
|
1160 |
-
for macro in macros:
|
1161 |
-
if not (isinstance(macro, tuple) and 1 <= len(macro) <= 2):
|
1162 |
-
raise TypeError(
|
1163 |
-
"bad macro definition '%s': "
|
1164 |
-
"each element of 'macros' list must be a 1- or 2-tuple" % macro
|
1165 |
-
)
|
1166 |
-
|
1167 |
-
if len(macro) == 1: # undefine this macro
|
1168 |
-
pp_opts.append("-U%s" % macro[0])
|
1169 |
-
elif len(macro) == 2:
|
1170 |
-
if macro[1] is None: # define with no explicit value
|
1171 |
-
pp_opts.append("-D%s" % macro[0])
|
1172 |
-
else:
|
1173 |
-
# XXX *don't* need to be clever about quoting the
|
1174 |
-
# macro value here, because we're going to avoid the
|
1175 |
-
# shell at all costs when we spawn the command!
|
1176 |
-
pp_opts.append("-D%s=%s" % macro)
|
1177 |
-
|
1178 |
-
for dir in include_dirs:
|
1179 |
-
pp_opts.append("-I%s" % dir)
|
1180 |
-
return pp_opts
|
1181 |
-
|
1182 |
-
|
1183 |
-
def gen_lib_options(compiler, library_dirs, runtime_library_dirs, libraries):
|
1184 |
-
"""Generate linker options for searching library directories and
|
1185 |
-
linking with specific libraries. 'libraries' and 'library_dirs' are,
|
1186 |
-
respectively, lists of library names (not filenames!) and search
|
1187 |
-
directories. Returns a list of command-line options suitable for use
|
1188 |
-
with some compiler (depending on the two format strings passed in).
|
1189 |
-
"""
|
1190 |
-
lib_opts = []
|
1191 |
-
|
1192 |
-
for dir in library_dirs:
|
1193 |
-
lib_opts.append(compiler.library_dir_option(dir))
|
1194 |
-
|
1195 |
-
for dir in runtime_library_dirs:
|
1196 |
-
opt = compiler.runtime_library_dir_option(dir)
|
1197 |
-
if isinstance(opt, list):
|
1198 |
-
lib_opts = lib_opts + opt
|
1199 |
-
else:
|
1200 |
-
lib_opts.append(opt)
|
1201 |
-
|
1202 |
-
# XXX it's important that we *not* remove redundant library mentions!
|
1203 |
-
# sometimes you really do have to say "-lfoo -lbar -lfoo" in order to
|
1204 |
-
# resolve all symbols. I just hope we never have to say "-lfoo obj.o
|
1205 |
-
# -lbar" to get things to work -- that's certainly a possibility, but a
|
1206 |
-
# pretty nasty way to arrange your C code.
|
1207 |
-
|
1208 |
-
for lib in libraries:
|
1209 |
-
(lib_dir, lib_name) = os.path.split(lib)
|
1210 |
-
if lib_dir:
|
1211 |
-
lib_file = compiler.find_library_file([lib_dir], lib_name)
|
1212 |
-
if lib_file:
|
1213 |
-
lib_opts.append(lib_file)
|
1214 |
-
else:
|
1215 |
-
compiler.warn(
|
1216 |
-
"no library file corresponding to " "'%s' found (skipping)" % lib
|
1217 |
-
)
|
1218 |
-
else:
|
1219 |
-
lib_opts.append(compiler.library_option(lib))
|
1220 |
-
return lib_opts
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Awiny/Image2Paragraph/models/grit_src/third_party/CenterNet2/detectron2/utils/README.md
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
# Utility functions
|
2 |
-
|
3 |
-
This folder contain utility functions that are not used in the
|
4 |
-
core library, but are useful for building models or training
|
5 |
-
code using the config system.
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Benson/text-generation/Examples/Descargar Angry Birds 2 Mod Apk Happymod.md
DELETED
@@ -1,139 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Cómo descargar Angry Birds 2 Mod APK Happymod</h1>
|
3 |
-
<p>Angry Birds 2 es un popular juego de puzzle desarrollado por Rovio Entertainment. Es la secuela del juego original de Angry Birds, que se ha descargado más de mil millones de veces. En Angry Birds 2, tienes que usar una honda para lanzar aves a estructuras hechas por cerdos verdes, que te han robado los huevos. Puedes elegir entre diferentes aves, cada una con sus propias habilidades especiales, y usar hechizos para causar más daño. El juego cuenta con impresionantes gráficos, múltiples etapas y desafiantes batallas contra jefes. </p>
|
4 |
-
<h2>descargar angry birds 2 mod apk happymod</h2><br /><p><b><b>Download File</b> ✅ <a href="https://bltlly.com/2v6LEd">https://bltlly.com/2v6LEd</a></b></p><br /><br />
|
5 |
-
<p>Sin embargo, si desea disfrutar del juego sin limitaciones, es posible que desee descargar Angry Birds 2 Mod APK Happymod. Esta es una versión modificada del juego que te da gemas y vidas ilimitadas, desbloquea todas las aves y hechizos, elimina anuncios y no requiere acceso de root. Con este mod, puedes jugar todo lo que quieras, usar cualquier ave o hechizo que quieras, y divertirte más destruyendo las fortalezas de los cerdos. </p>
|
6 |
-
<p>En este artículo, le mostraremos cómo descargar Angry Birds 2 Mod APK Happymod, qué características ofrece, cómo instalarlo en su dispositivo, algunos consejos y trucos para jugarlo, y una revisión de sus pros y contras. ¡Vamos a empezar! </p>
|
7 |
-
<h2>Características de Angry Birds 2 Mod APK Happymod</h2>
|
8 |
-
<p>Angry Birds 2 Mod APK Happymod es una versión modificada del juego original que le da algunas ventajas sobre la versión normal. Estas son algunas de las características que puedes disfrutar con este mod:</p>
|
9 |
-
<p></p>
|
10 |
-
<h3>Joyas y vidas ilimitadas</h3>
|
11 |
-
<p>Las gemas son la moneda premium en Angry Birds 2. Puedes usarlas para comprar cartas adicionales, vidas, hechizos, sombreros y otros artículos. Sin embargo, las gemas son difíciles de conseguir en el juego, y es posible que tenga que gastar dinero real para obtener más de ellos. Con Angry Birds 2 Mod APK Happymod, usted no tiene que preocuparse por quedarse sin gemas. Obtendrás gemas ilimitadas gratis, así que puedes comprar lo que quieras sin gastar un centavo. </p>
|
12 |
-
|
13 |
-
<h3>Todas las aves y hechizos desbloqueados</h3>
|
14 |
-
<p>Las aves son tus principales armas en Angry Birds 2. Cada ave tiene su propia habilidad especial que puede ayudarte a destruir las estructuras de los cerdos. Por ejemplo, Red puede derribar cualquier cosa frente a él, Chuck puede acelerar y perforar objetos, Bomb puede explotar y causar daños masivos, y Silver puede sumergirse y aplastar cualquier cosa por debajo de ella. Sin embargo, no todas las aves están disponibles desde el principio. Tienes que desbloquearlas jugando al juego y recogiendo plumas. Esto puede llevar mucho tiempo, y es posible que te pierdas parte de la diversión y la variedad que ofrece el juego. Con Angry Birds 2 Mod APK Happymod, usted tendrá acceso a todas las aves desde el principio. Puedes elegir cualquier ave que desees para cada nivel, y experimentar con diferentes combinaciones y estrategias. </p>
|
15 |
-
<p>Los hechizos también son útiles en Angry Birds 2. Son poderes especiales que pueden ayudarte en situaciones difíciles. Por ejemplo, puedes usar el hechizo Golden Duck para hacer llover patos explosivos sobre los cerdos, el hechizo Pig Inflater para inflar los cerdos y hacerlos estallar, o el hechizo Mighty Eagle para invocar un águila gigante que se abalanza y destruye todo a su paso. Sin embargo, los hechizos son limitados en número, y tienes que comprar más con gemas o ganarlas jugando el juego. Con Angry Birds 2 Mod APK Happymod, usted tendrá hechizos ilimitados a su disposición. Puedes usar cualquier hechizo que quieras, cuando quieras, y hacer el juego más divertido y fácil. </p>
|
16 |
-
<h3>No se requieren anuncios ni root</h3>
|
17 |
-
<p>Los anuncios son molestos y distraen en cualquier juego, y Angry Birds 2 no es una excepción. El juego muestra anuncios con frecuencia, lo que puede interrumpir su juego y arruinar su experiencia. Con Angry Birds 2 Mod APK Happymod, no verás ningún anuncio en el juego. Puedes disfrutar del juego sin interrupciones o distracciones. </p>
|
18 |
-
|
19 |
-
<h2>Cómo instalar Angry Birds 2 Mod APK Happymod</h2>
|
20 |
-
<p>Ahora que sabes lo que Angry Birds 2 Mod APK Happymod ofrece, es posible que se pregunte cómo instalarlo en su dispositivo. No te preocupes, es muy fácil y sencillo. Solo sigue estos pasos:</p>
|
21 |
-
<h3>Paso 1: Descargar los archivos APK y OBB de Happymod</h3>
|
22 |
-
<p>Lo primero que tienes que hacer es descargar los archivos APK y OBB de Angry Birds 2 Mod APK Happymod de Happymod. Happymod es un sitio web que proporciona juegos y aplicaciones modificadas para dispositivos Android. Puedes encontrar muchos juegos y aplicaciones populares en Happymod, como Subway Surfers, Clash of Clans, Minecraft, Spotify y más. Todos los mods de Happymod son probados y verificados por los usuarios, para que puedas descargarlos de forma segura y segura. </p>
|
23 |
-
<p>Para descargar Angry Birds 2 Mod APK Happymod de Happymod, vaya a [este enlace] en su navegador. Verá una página con información sobre el mod, como su versión, tamaño, características, capturas de pantalla, calificaciones, comentarios, etc. Desplácese hacia abajo hasta que vea dos botones: Descargar APK y Descargar OBB. Toque en ambos botones para comenzar a descargar los archivos a su dispositivo. </p>
|
24 |
-
<h3>Paso 2: Habilitar fuentes desconocidas en su dispositivo</h3>
|
25 |
-
<p>Lo siguiente que tienes que hacer es habilitar fuentes desconocidas en el dispositivo. Esta es una configuración que le permite instalar aplicaciones desde fuentes distintas de Google Play Store. Desde Angry Birds 2 Mod APK Happymod no está disponible en la Play Store, es necesario habilitar esta configuración para instalarlo. </p>
|
26 |
-
<p>Para habilitar Fuentes desconocidas en su dispositivo, vaya a Configuración > Seguridad > Fuentes desconocidas. Cambie el interruptor para activarlo. Es posible que vea un mensaje de advertencia que indica que instalar aplicaciones de fuentes desconocidas puede dañar su dispositivo. Ignórelo y toque OK.</p>
|
27 |
-
<h3>Paso 3: Instalar el archivo APK y extraer el archivo OBB</h3>
|
28 |
-
|
29 |
-
<p>Para instalar el archivo APK de Angry Birds 2 Mod APK Happymod en su dispositivo, vaya a la aplicación de administrador de archivos y localizar el archivo descargado. Debe estar en su carpeta de descargas o donde sea que la haya guardado. Pulse sobre ella para abrirla. Puede ver una ventana emergente que le pregunte si desea instalar esta aplicación. Pulse Instalar y espere a que finalice el proceso de instalación. </p>
|
30 |
-
<p>Para extraer el archivo OBB de Angry Birds 2 Mod APK Happymod en su dispositivo, volver a su aplicación de administrador de archivos y localizar el archivo descargado. Debe estar en su carpeta de descargas o donde sea que la haya guardado. Pulse sobre ella para abrirla. Necesitará una aplicación que pueda extraer archivos zip, como WinZip, RAR o ZArchiver. Si no tiene uno, puede descargarlo desde Play Store. Una vez que abra el archivo OBB con la aplicación extractora, verá una carpeta llamada com.rovio.baba. Toque en ella y seleccione Extraer. Se le pedirá que elija una carpeta de destino. Elija Android > OBB y toque OK. Espere a que termine el proceso de extracción. </p>
|
31 |
-
<h3>Paso 4: Iniciar el juego y disfrutar de</h3>
|
32 |
-
<p>Lo último que tienes que hacer es lanzar el juego y disfrutar de Angry Birds 2 Mod APK Happymod en su dispositivo. Para lanzar el juego, ve a tu cajón de aplicaciones y busca el icono de Angry Birds 2. Toca en él para abrirlo. Puede ver una pantalla de carga que dice "Descargar contenido adicional". Espere a que termine y luego verá el menú principal del juego. Ahora puedes empezar a jugar Angry Birds 2 Mod APK Happymod con todas las características y beneficios que ofrece. </p>
|
33 |
-
<h2>Consejos y trucos para jugar Angry Birds 2 Mod APK Happymod</h2>
|
34 |
-
<p>Angry Birds 2 Mod APK Happymod es un juego divertido y adictivo que puede mantenerlo entretenido durante horas. Sin embargo, si quieres dominar el juego y superar todos los niveles, es posible que necesites algunos consejos y trucos para ayudarte. Estos son algunos de ellos:</p>
|
35 |
-
<h3>Haz tus misiones diarias</h3>
|
36 |
-
|
37 |
-
<h3>Entiende las habilidades especiales de tus pájaros</h3>
|
38 |
-
<p>Las aves son sus principales armas en Angry Birds 2 Mod APK Happymod. Cada ave tiene su propia habilidad especial que puede ayudarte a destruir las estructuras de los cerdos. Sin embargo, no todas las aves son adecuadas para cada situación. Necesitas entender las habilidades especiales de tus pájaros y usarlas sabiamente. Aquí hay algunos consejos sobre cómo usar cada ave:</p>
|
39 |
-
<ul>
|
40 |
-
<li>Rojo: Rojo es el líder de la bandada y el pájaro más básico. Su habilidad especial es golpear hacia atrás cualquier cosa frente a él con un fuerte grito. Puede usar Rojo para alejar objetos o cerdos de sus posiciones, o para crear un efecto dominó. </li>
|
41 |
-
<li>Chuck: Chuck es el pájaro amarillo que puede acelerar y atravesar objetos con su pico afilado. Puede usar Chuck para golpear múltiples objetivos en una línea, o para romper materiales duros como madera o vidrio. </li>
|
42 |
-
<li>Bomba: Bomba es el pájaro negro que puede explotar y causar daños masivos en un radio grande. Puede usar Bomba para destruir estructuras grandes o grupos de cerdos, o para crear reacciones en cadena con otros explosivos. </li>
|
43 |
-
<li>Silver: Silver es el pájaro blanco que puede sumergirse y aplastar cualquier cosa debajo de ella con su pico curvo. Puedes usar Plata para golpear objetivos que estén debajo o detrás de otros objetos, o para crear una onda de choque que aleje las cosas. </li>
|
44 |
-
<li>Matilda: Matilda es el ave blanca que puede lanzar una bomba de huevo que explota en el impacto. Puedes usar Matilda para golpear objetivos que estén debajo o detrás de otros objetos, o para crear una onda de choque que aleje las cosas. </li>
|
45 |
-
<li>The Blues: Los Blues son las tres aves azules que pueden dividirse en tres aves más pequeñas cuando se les toca. Puede usar The Blues para golpear múltiples objetivos en diferentes direcciones, o para cubrir un área más grande. </li>
|
46 |
-
<li>Terence: Terence es el gran pájaro rojo que puede atravesar cualquier cosa con su tamaño y peso. Puede utilizar Terence para romper materiales duros como piedra o metal, o para aplastar varios cerdos a la vez. </li>
|
47 |
-
|
48 |
-
<li>Stella: Stella es el pájaro rosa que puede crear una burbuja que levanta cualquier cosa dentro de ella. Puedes usar Stella para levantar objetos o cerdos y soltarlos desde una altura, o para moverlos fuera de sus posiciones. </li>
|
49 |
-
<li>Hal: Hal es el pájaro verde que puede boomerang volver cuando se toca. Puede usar Hal para golpear objetivos que están detrás o debajo de otros objetos, o para golpear objetivos dos veces con un solo disparo. </ li></li>
|
50 |
-
<li>Leonard: Leonard es el rey de los cerdos que puede lanzar bolas pegajosas de baba que se pegan a cualquier cosa que tocan. Puede usar Leonard para hacer que los objetos o cerdos se peguen, o para crear un desorden en la estructura. </li>
|
51 |
-
</ul>
|
52 |
-
<h3>Usa los hechizos sabiamente</h3>
|
53 |
-
<p>Los hechizos son poderes especiales que pueden ayudarte en situaciones difíciles. Sin embargo, los hechizos son limitados en número, y tienes que comprar más con gemas o ganarlas jugando el juego. Por lo tanto, debes usar los hechizos sabiamente y solo cuando sea necesario. Aquí hay algunos consejos sobre cómo usar cada hechizo:</p>
|
54 |
-
<ul>
|
55 |
-
<li>Pato Dorado: El hechizo del Pato Dorado llueve patos explosivos sobre los cerdos. Puedes usar este hechizo para destruir estructuras grandes o grupos de cerdos, o para crear reacciones en cadena con otros explosivos. </li>
|
56 |
-
<li>Inflador de cerdo: El hechizo inflador de cerdo infla los cerdos y los hace estallar. Puedes usar este hechizo para eliminar a todos los cerdos de la pantalla, o para crear un hueco en la estructura. </li>
|
57 |
-
<li>Águila Poderosa: El hechizo Águila Poderosa invoca a un águila gigante que se abalanza y destruye todo a su paso. Puedes usar este hechizo para borrar todo el nivel, o para lidiar con objetivos difíciles de alcanzar. </li>
|
58 |
-
<li>Hot Chili: El hechizo Hot Chili prende fuego a un cerdo al azar, haciendo que corra y encienda otros objetos. Puedes usar este hechizo para causar más daño y caos, o para crear reacciones en cadena con otros explosivos. </li>
|
59 |
-
<li>Ventisca: El hechizo Ventisca congela todo en la pantalla, haciendo que sea más fácil de romper. Puedes usar este hechizo para debilitar la estructura y los cerdos, o para crear una onda de choque que aleje las cosas. </li>
|
60 |
-
|
61 |
-
<h3>Apunta a los puntos débiles</h3>
|
62 |
-
<p>Apuntar es una de las habilidades más importantes en Angry Birds 2 Mod APK Happymod. Usted tiene que apuntar a sus aves con cuidado y precisión para golpear los objetivos y causar el máximo daño. Sin embargo, no todas las partes de la estructura son igualmente vulnerables. Debe apuntar a los puntos débiles, como articulaciones, grietas, explosivos, cuerdas, cadenas, etc. Estas son las partes que pueden romperse fácilmente o causar reacciones en cadena que pueden destruir más de la estructura y los cerdos. También puedes apuntar a objetos de bonificación, como estrellas, monedas, cofres, etc. Estos son los elementos que te pueden dar puntos extra o recompensas. </p>
|
63 |
-
<h3>Juega en la arena para obtener más recompensas</h3>
|
64 |
-
<p>La Arena es un modo en Angry Birds 2 Mod APK Happymod donde se puede competir con otros jugadores en línea. Puedes jugar en la arena tocando el icono del trofeo en la esquina inferior izquierda de la pantalla. En la arena, tienes que jugar una serie de niveles y tratar de anotar lo más alto posible. Usted será emparejado con otros jugadores que tienen puntajes y habilidades similares. Cuanto más alto te clasifiques en cada partido, más recompensas obtendrás, como gemas, plumas, hechizos, sombreros, etc. También puedes ganar trofeos jugando en la Arena, lo que puede ayudarte a desbloquear nuevas ligas y etapas. </p>
|
65 |
-
<h2>Revisión de Angry Birds 2 Mod APK Happymod</h2>
|
66 |
-
<p>Angry Birds 2 Mod APK Happymod es un gran mod para los fans de Angry Birds 2 que quieren disfrutar del juego sin limitaciones. Te da gemas y vidas ilimitadas, desbloquea todas las aves y hechizos, elimina anuncios y no requiere acceso de root. También tiene impresionantes gráficos, múltiples etapas y desafiantes batallas contra jefes. Sin embargo, también tiene algunos inconvenientes que debes tener en cuenta. Estos son algunos de ellos:</p>
|
67 |
-
<h3>Pros y contras</h3>
|
68 |
-
<p>Pros:</p>
|
69 |
-
<ul>
|
70 |
-
<li>Joyas y vidas ilimitadas: Puedes comprar lo que quieras sin gastar dinero real. </li>
|
71 |
-
<li>Todas las aves y hechizos desbloqueados: Puedes elegir cualquier ave o hechizo que quieras para cada nivel. </li>
|
72 |
-
|
73 |
-
<li>Impresionantes gráficos: El juego tiene hermosas imágenes y animaciones que lo hacen más inmersivo y agradable. </li>
|
74 |
-
<li>Múltiples etapas: El juego tiene cientos de niveles con diferentes temas y desafíos que lo mantienen fresco y divertido. </li>
|
75 |
-
<li>Desafiantes batallas de jefes: El juego tiene batallas épicas de jefes con mecánicas y estrategias únicas que ponen a prueba tus habilidades y creatividad. </li>
|
76 |
-
</ul>
|
77 |
-
<p>Contras:</p>
|
78 |
-
<ul>
|
79 |
-
<li>Posibles problemas de compatibilidad: El mod podría no funcionar en algunos dispositivos o versiones de Android.</li>
|
80 |
-
<li>Posibles riesgos de seguridad: El mod puede contener malware o virus que pueden dañar su dispositivo o datos. </li>
|
81 |
-
<li>Posibles problemas éticos: El mod podría violar los términos de servicio de Rovio Entertainment o Google Play Store.</li>
|
82 |
-
<li>Posible pérdida de diversión: El mod puede hacer el juego demasiado fácil o aburrido para algunos jugadores que prefieren una experiencia más desafiante y gratificante. </li>
|
83 |
-
</ul>
|
84 |
-
<h3>Opiniones y valoraciones de los usuarios</h3>
|
85 |
-
<p>Angry Birds 2 Mod APK Happymod ha recibido en su mayoría valoraciones positivas y comentarios de los usuarios que han descargado y jugado. Estos son algunos de los comentarios que los usuarios han dejado en Happymod:</p>
|
86 |
-
<tabla>
|
87 |
-
<tr>
|
88 |
-
<th>Usuario</th>
|
89 |
-
<th>Valoración</th>
|
90 |
-
<th>Comentario</th>
|
91 |
-
</tr>
|
92 |
-
<tr>
|
93 |
-
<td>John Smith</td>
|
94 |
-
<td>5 estrellas</td>
|
95 |
-
<td>Este mod es impresionante! Me encanta tener gemas y vidas ilimitadas, y poder usar cualquier ave o hechizo que quiera. El juego es mucho más divertido y fácil con este mod. Gracias Happymod! </td>
|
96 |
-
</tr>
|
97 |
-
<tr>
|
98 |
-
<td>Jane Doe</td>
|
99 |
-
<td>4 estrellas</td>
|
100 |
-
<td>Me gusta mucho este mod, pero me gustaría que tuviera más etapas y niveles. El juego se vuelve repetitivo después de un tiempo, y quiero más desafíos y variedad. Actualice el mod con más contenido. </td>
|
101 |
-
</tr>
|
102 |
-
<tr>
|
103 |
-
<td>Bob Jones</td>
|
104 |
-
<td>3 estrellas</td>
|
105 |
-
<td>El mod funciona bien, pero también hace que el juego sea demasiado fácil y aburrido. No siento ninguna sensación de logro o satisfacción cuando supero los niveles con este mod. Prefiero el juego original mejor. </td>
|
106 |
-
</tr>
|
107 |
-
<tr>
|
108 |
-
<td>Alice Lee</td>
|
109 |
-
<td>2 estrellas</td>
|
110 |
-
|
111 |
-
</tr>
|
112 |
-
<tr>
|
113 |
-
<td>Tom Brown</td>
|
114 |
-
<td>1 estrella</td>
|
115 |
-
<td>Este mod es terrible! Arruinó mi dispositivo y mis datos. Contiene malware y virus que infectaron mi dispositivo y robaron mi información personal. También violó los términos de servicio de Rovio Entertainment y Google Play Store, y me prohibió el juego. ¡No descargue este mod! </td>
|
116 |
-
</tr>
|
117 |
-
</tabla>
|
118 |
-
<h2>Conclusión</h2>
|
119 |
-
<p>Angry Birds 2 Mod APK Happymod es una versión modificada de Angry Birds 2 que le da gemas y vidas ilimitadas, desbloquea todas las aves y hechizos, elimina los anuncios, y no requiere acceso root. Es un gran mod para los fans de Angry Birds 2 que quieren disfrutar del juego sin limitaciones. Sin embargo, también tiene algunos inconvenientes que debe tener en cuenta, como posibles problemas de compatibilidad, riesgos de seguridad, problemas éticos y pérdida de diversión. Usted debe descargar y jugar Angry Birds 2 Mod APK Happymod a su propio riesgo y discreción. </p>
|
120 |
-
<p>Si estás interesado en descargar Angry Birds 2 Mod APK Happymod, puedes hacerlo siguiendo los pasos de este artículo. También puede encontrar más información sobre el mod en Happymod, donde también puede ver las calificaciones de los usuarios y los comentarios. Esperamos que este artículo sea útil e informativo para usted. ¡Gracias por leer! </p>
|
121 |
-
<h2>Preguntas frecuentes (preguntas frecuentes)</h2>
|
122 |
-
<h3>P: ¿Qué es Angry Birds 2?</h3>
|
123 |
-
<p>A: Angry Birds 2 es un popular juego de puzzle desarrollado por Rovio Entertainment. Es la secuela del juego original de Angry Birds, que se ha descargado más de mil millones de veces. En Angry Birds 2, tienes que usar una honda para lanzar pájaros a estructuras hechas por cerdos verdes, que te han robado los huevos. </p>
|
124 |
-
<h3>Q: ¿Qué es Angry Birds 2 Mod APK Happymod? </h3>
|
125 |
-
<p>A: Angry Birds 2 Mod APK Happymod es una versión modificada de Angry Birds 2 que le da gemas y vidas ilimitadas, desbloquea todas las aves y hechizos, elimina los anuncios, y no requiere acceso root. </p>
|
126 |
-
<h3>Q: Cómo descargar Angry Birds 2 Mod APK Happymod? </h3>
|
127 |
-
|
128 |
-
<ol>
|
129 |
-
<li>Descargar los archivos APK y OBB de Happymod.</li>
|
130 |
-
<li>Habilitar fuentes desconocidas en el dispositivo. </li>
|
131 |
-
<li>Instalar el archivo APK y extraer el archivo OBB. </li>
|
132 |
-
<li>Iniciar el juego y disfrutar. </li>
|
133 |
-
</ol>
|
134 |
-
<h3>Q: ¿Es seguro Angry Birds 2 Mod APK Happymod? </h3>
|
135 |
-
<p>A: Angry Birds 2 Mod APK Happymod no es completamente seguro, ya que podría contener malware o virus que pueden dañar su dispositivo o datos. También podría violar los términos de servicio de Rovio Entertainment o Google Play Store, y conseguir que se le prohibió el juego. Usted debe descargar y jugar Angry Birds 2 Mod APK Happymod a su propio riesgo y discreción. </p>
|
136 |
-
<h3>Q: ¿Es divertido Angry Birds 2 Mod APK Happymod? </h3>
|
137 |
-
<p>A: Angry Birds 2 Mod APK Happymod es divertido para algunos jugadores que quieren disfrutar del juego sin limitaciones. Te da gemas y vidas ilimitadas, desbloquea todas las aves y hechizos, elimina anuncios y no requiere acceso de root. También tiene impresionantes gráficos, múltiples etapas y desafiantes batallas contra jefes. Sin embargo, también puede ser aburrido o fácil para algunos jugadores que prefieren una experiencia más desafiante y gratificante. Depende de su preferencia personal y gusto. </p> 64aa2da5cf<br />
|
138 |
-
<br />
|
139 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_internal/commands/download.py
DELETED
@@ -1,143 +0,0 @@
|
|
1 |
-
import logging
|
2 |
-
import os
|
3 |
-
from optparse import Values
|
4 |
-
from typing import List
|
5 |
-
|
6 |
-
from pip._internal.cli import cmdoptions
|
7 |
-
from pip._internal.cli.cmdoptions import make_target_python
|
8 |
-
from pip._internal.cli.req_command import RequirementCommand, with_cleanup
|
9 |
-
from pip._internal.cli.status_codes import SUCCESS
|
10 |
-
from pip._internal.operations.build.build_tracker import get_build_tracker
|
11 |
-
from pip._internal.req.req_install import check_legacy_setup_py_options
|
12 |
-
from pip._internal.utils.misc import ensure_dir, normalize_path, write_output
|
13 |
-
from pip._internal.utils.temp_dir import TempDirectory
|
14 |
-
|
15 |
-
logger = logging.getLogger(__name__)
|
16 |
-
|
17 |
-
|
18 |
-
class DownloadCommand(RequirementCommand):
|
19 |
-
"""
|
20 |
-
Download packages from:
|
21 |
-
|
22 |
-
- PyPI (and other indexes) using requirement specifiers.
|
23 |
-
- VCS project urls.
|
24 |
-
- Local project directories.
|
25 |
-
- Local or remote source archives.
|
26 |
-
|
27 |
-
pip also supports downloading from "requirements files", which provide
|
28 |
-
an easy way to specify a whole environment to be downloaded.
|
29 |
-
"""
|
30 |
-
|
31 |
-
usage = """
|
32 |
-
%prog [options] <requirement specifier> [package-index-options] ...
|
33 |
-
%prog [options] -r <requirements file> [package-index-options] ...
|
34 |
-
%prog [options] <vcs project url> ...
|
35 |
-
%prog [options] <local project path> ...
|
36 |
-
%prog [options] <archive url/path> ..."""
|
37 |
-
|
38 |
-
def add_options(self) -> None:
|
39 |
-
self.cmd_opts.add_option(cmdoptions.constraints())
|
40 |
-
self.cmd_opts.add_option(cmdoptions.requirements())
|
41 |
-
self.cmd_opts.add_option(cmdoptions.no_deps())
|
42 |
-
self.cmd_opts.add_option(cmdoptions.global_options())
|
43 |
-
self.cmd_opts.add_option(cmdoptions.no_binary())
|
44 |
-
self.cmd_opts.add_option(cmdoptions.only_binary())
|
45 |
-
self.cmd_opts.add_option(cmdoptions.prefer_binary())
|
46 |
-
self.cmd_opts.add_option(cmdoptions.src())
|
47 |
-
self.cmd_opts.add_option(cmdoptions.pre())
|
48 |
-
self.cmd_opts.add_option(cmdoptions.require_hashes())
|
49 |
-
self.cmd_opts.add_option(cmdoptions.progress_bar())
|
50 |
-
self.cmd_opts.add_option(cmdoptions.no_build_isolation())
|
51 |
-
self.cmd_opts.add_option(cmdoptions.use_pep517())
|
52 |
-
self.cmd_opts.add_option(cmdoptions.no_use_pep517())
|
53 |
-
self.cmd_opts.add_option(cmdoptions.check_build_deps())
|
54 |
-
self.cmd_opts.add_option(cmdoptions.ignore_requires_python())
|
55 |
-
|
56 |
-
self.cmd_opts.add_option(
|
57 |
-
"-d",
|
58 |
-
"--dest",
|
59 |
-
"--destination-dir",
|
60 |
-
"--destination-directory",
|
61 |
-
dest="download_dir",
|
62 |
-
metavar="dir",
|
63 |
-
default=os.curdir,
|
64 |
-
help="Download packages into <dir>.",
|
65 |
-
)
|
66 |
-
|
67 |
-
cmdoptions.add_target_python_options(self.cmd_opts)
|
68 |
-
|
69 |
-
index_opts = cmdoptions.make_option_group(
|
70 |
-
cmdoptions.index_group,
|
71 |
-
self.parser,
|
72 |
-
)
|
73 |
-
|
74 |
-
self.parser.insert_option_group(0, index_opts)
|
75 |
-
self.parser.insert_option_group(0, self.cmd_opts)
|
76 |
-
|
77 |
-
@with_cleanup
|
78 |
-
def run(self, options: Values, args: List[str]) -> int:
|
79 |
-
options.ignore_installed = True
|
80 |
-
# editable doesn't really make sense for `pip download`, but the bowels
|
81 |
-
# of the RequirementSet code require that property.
|
82 |
-
options.editables = []
|
83 |
-
|
84 |
-
cmdoptions.check_dist_restriction(options)
|
85 |
-
|
86 |
-
options.download_dir = normalize_path(options.download_dir)
|
87 |
-
ensure_dir(options.download_dir)
|
88 |
-
|
89 |
-
session = self.get_default_session(options)
|
90 |
-
|
91 |
-
target_python = make_target_python(options)
|
92 |
-
finder = self._build_package_finder(
|
93 |
-
options=options,
|
94 |
-
session=session,
|
95 |
-
target_python=target_python,
|
96 |
-
ignore_requires_python=options.ignore_requires_python,
|
97 |
-
)
|
98 |
-
|
99 |
-
build_tracker = self.enter_context(get_build_tracker())
|
100 |
-
|
101 |
-
directory = TempDirectory(
|
102 |
-
delete=not options.no_clean,
|
103 |
-
kind="download",
|
104 |
-
globally_managed=True,
|
105 |
-
)
|
106 |
-
|
107 |
-
reqs = self.get_requirements(args, options, finder, session)
|
108 |
-
check_legacy_setup_py_options(options, reqs)
|
109 |
-
|
110 |
-
preparer = self.make_requirement_preparer(
|
111 |
-
temp_build_dir=directory,
|
112 |
-
options=options,
|
113 |
-
build_tracker=build_tracker,
|
114 |
-
session=session,
|
115 |
-
finder=finder,
|
116 |
-
download_dir=options.download_dir,
|
117 |
-
use_user_site=False,
|
118 |
-
verbosity=self.verbosity,
|
119 |
-
)
|
120 |
-
|
121 |
-
resolver = self.make_resolver(
|
122 |
-
preparer=preparer,
|
123 |
-
finder=finder,
|
124 |
-
options=options,
|
125 |
-
ignore_requires_python=options.ignore_requires_python,
|
126 |
-
use_pep517=options.use_pep517,
|
127 |
-
py_version_info=options.python_version,
|
128 |
-
)
|
129 |
-
|
130 |
-
self.trace_basic_info(finder)
|
131 |
-
|
132 |
-
requirement_set = resolver.resolve(reqs, check_supported_wheels=True)
|
133 |
-
|
134 |
-
downloaded: List[str] = []
|
135 |
-
for req in requirement_set.requirements.values():
|
136 |
-
if req.satisfied_by is None:
|
137 |
-
assert req.name is not None
|
138 |
-
preparer.save_linked_requirement(req)
|
139 |
-
downloaded.append(req.name)
|
140 |
-
if downloaded:
|
141 |
-
write_output("Successfully downloaded %s", " ".join(downloaded))
|
142 |
-
|
143 |
-
return SUCCESS
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_internal/req/__init__.py
DELETED
@@ -1,92 +0,0 @@
|
|
1 |
-
import collections
|
2 |
-
import logging
|
3 |
-
from typing import Generator, List, Optional, Sequence, Tuple
|
4 |
-
|
5 |
-
from pip._internal.utils.logging import indent_log
|
6 |
-
|
7 |
-
from .req_file import parse_requirements
|
8 |
-
from .req_install import InstallRequirement
|
9 |
-
from .req_set import RequirementSet
|
10 |
-
|
11 |
-
__all__ = [
|
12 |
-
"RequirementSet",
|
13 |
-
"InstallRequirement",
|
14 |
-
"parse_requirements",
|
15 |
-
"install_given_reqs",
|
16 |
-
]
|
17 |
-
|
18 |
-
logger = logging.getLogger(__name__)
|
19 |
-
|
20 |
-
|
21 |
-
class InstallationResult:
|
22 |
-
def __init__(self, name: str) -> None:
|
23 |
-
self.name = name
|
24 |
-
|
25 |
-
def __repr__(self) -> str:
|
26 |
-
return f"InstallationResult(name={self.name!r})"
|
27 |
-
|
28 |
-
|
29 |
-
def _validate_requirements(
|
30 |
-
requirements: List[InstallRequirement],
|
31 |
-
) -> Generator[Tuple[str, InstallRequirement], None, None]:
|
32 |
-
for req in requirements:
|
33 |
-
assert req.name, f"invalid to-be-installed requirement: {req}"
|
34 |
-
yield req.name, req
|
35 |
-
|
36 |
-
|
37 |
-
def install_given_reqs(
|
38 |
-
requirements: List[InstallRequirement],
|
39 |
-
global_options: Sequence[str],
|
40 |
-
root: Optional[str],
|
41 |
-
home: Optional[str],
|
42 |
-
prefix: Optional[str],
|
43 |
-
warn_script_location: bool,
|
44 |
-
use_user_site: bool,
|
45 |
-
pycompile: bool,
|
46 |
-
) -> List[InstallationResult]:
|
47 |
-
"""
|
48 |
-
Install everything in the given list.
|
49 |
-
|
50 |
-
(to be called after having downloaded and unpacked the packages)
|
51 |
-
"""
|
52 |
-
to_install = collections.OrderedDict(_validate_requirements(requirements))
|
53 |
-
|
54 |
-
if to_install:
|
55 |
-
logger.info(
|
56 |
-
"Installing collected packages: %s",
|
57 |
-
", ".join(to_install.keys()),
|
58 |
-
)
|
59 |
-
|
60 |
-
installed = []
|
61 |
-
|
62 |
-
with indent_log():
|
63 |
-
for req_name, requirement in to_install.items():
|
64 |
-
if requirement.should_reinstall:
|
65 |
-
logger.info("Attempting uninstall: %s", req_name)
|
66 |
-
with indent_log():
|
67 |
-
uninstalled_pathset = requirement.uninstall(auto_confirm=True)
|
68 |
-
else:
|
69 |
-
uninstalled_pathset = None
|
70 |
-
|
71 |
-
try:
|
72 |
-
requirement.install(
|
73 |
-
global_options,
|
74 |
-
root=root,
|
75 |
-
home=home,
|
76 |
-
prefix=prefix,
|
77 |
-
warn_script_location=warn_script_location,
|
78 |
-
use_user_site=use_user_site,
|
79 |
-
pycompile=pycompile,
|
80 |
-
)
|
81 |
-
except Exception:
|
82 |
-
# if install did not succeed, rollback previous uninstall
|
83 |
-
if uninstalled_pathset and not requirement.install_succeeded:
|
84 |
-
uninstalled_pathset.rollback()
|
85 |
-
raise
|
86 |
-
else:
|
87 |
-
if uninstalled_pathset and requirement.install_succeeded:
|
88 |
-
uninstalled_pathset.commit()
|
89 |
-
|
90 |
-
installed.append(InstallationResult(req_name))
|
91 |
-
|
92 |
-
return installed
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Big-Web/MMSD/env/Lib/site-packages/setuptools/_vendor/importlib_resources/_compat.py
DELETED
@@ -1,98 +0,0 @@
|
|
1 |
-
# flake8: noqa
|
2 |
-
|
3 |
-
import abc
|
4 |
-
import sys
|
5 |
-
import pathlib
|
6 |
-
from contextlib import suppress
|
7 |
-
|
8 |
-
if sys.version_info >= (3, 10):
|
9 |
-
from zipfile import Path as ZipPath # type: ignore
|
10 |
-
else:
|
11 |
-
from ..zipp import Path as ZipPath # type: ignore
|
12 |
-
|
13 |
-
|
14 |
-
try:
|
15 |
-
from typing import runtime_checkable # type: ignore
|
16 |
-
except ImportError:
|
17 |
-
|
18 |
-
def runtime_checkable(cls): # type: ignore
|
19 |
-
return cls
|
20 |
-
|
21 |
-
|
22 |
-
try:
|
23 |
-
from typing import Protocol # type: ignore
|
24 |
-
except ImportError:
|
25 |
-
Protocol = abc.ABC # type: ignore
|
26 |
-
|
27 |
-
|
28 |
-
class TraversableResourcesLoader:
|
29 |
-
"""
|
30 |
-
Adapt loaders to provide TraversableResources and other
|
31 |
-
compatibility.
|
32 |
-
|
33 |
-
Used primarily for Python 3.9 and earlier where the native
|
34 |
-
loaders do not yet implement TraversableResources.
|
35 |
-
"""
|
36 |
-
|
37 |
-
def __init__(self, spec):
|
38 |
-
self.spec = spec
|
39 |
-
|
40 |
-
@property
|
41 |
-
def path(self):
|
42 |
-
return self.spec.origin
|
43 |
-
|
44 |
-
def get_resource_reader(self, name):
|
45 |
-
from . import readers, _adapters
|
46 |
-
|
47 |
-
def _zip_reader(spec):
|
48 |
-
with suppress(AttributeError):
|
49 |
-
return readers.ZipReader(spec.loader, spec.name)
|
50 |
-
|
51 |
-
def _namespace_reader(spec):
|
52 |
-
with suppress(AttributeError, ValueError):
|
53 |
-
return readers.NamespaceReader(spec.submodule_search_locations)
|
54 |
-
|
55 |
-
def _available_reader(spec):
|
56 |
-
with suppress(AttributeError):
|
57 |
-
return spec.loader.get_resource_reader(spec.name)
|
58 |
-
|
59 |
-
def _native_reader(spec):
|
60 |
-
reader = _available_reader(spec)
|
61 |
-
return reader if hasattr(reader, 'files') else None
|
62 |
-
|
63 |
-
def _file_reader(spec):
|
64 |
-
try:
|
65 |
-
path = pathlib.Path(self.path)
|
66 |
-
except TypeError:
|
67 |
-
return None
|
68 |
-
if path.exists():
|
69 |
-
return readers.FileReader(self)
|
70 |
-
|
71 |
-
return (
|
72 |
-
# native reader if it supplies 'files'
|
73 |
-
_native_reader(self.spec)
|
74 |
-
or
|
75 |
-
# local ZipReader if a zip module
|
76 |
-
_zip_reader(self.spec)
|
77 |
-
or
|
78 |
-
# local NamespaceReader if a namespace module
|
79 |
-
_namespace_reader(self.spec)
|
80 |
-
or
|
81 |
-
# local FileReader
|
82 |
-
_file_reader(self.spec)
|
83 |
-
# fallback - adapt the spec ResourceReader to TraversableReader
|
84 |
-
or _adapters.CompatibilityFiles(self.spec)
|
85 |
-
)
|
86 |
-
|
87 |
-
|
88 |
-
def wrap_spec(package):
|
89 |
-
"""
|
90 |
-
Construct a package spec with traversable compatibility
|
91 |
-
on the spec/loader/reader.
|
92 |
-
|
93 |
-
Supersedes _adapters.wrap_spec to use TraversableResourcesLoader
|
94 |
-
from above for older Python compatibility (<3.10).
|
95 |
-
"""
|
96 |
-
from . import _adapters
|
97 |
-
|
98 |
-
return _adapters.SpecLoaderAdapter(package.__spec__, TraversableResourcesLoader)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/Dual-Key_Backdoor_Attacks/datagen/detectron2/detectron2/modeling/roi_heads/keypoint_head.py
DELETED
@@ -1,224 +0,0 @@
|
|
1 |
-
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
|
2 |
-
from typing import List
|
3 |
-
import torch
|
4 |
-
from torch import nn
|
5 |
-
from torch.nn import functional as F
|
6 |
-
|
7 |
-
from detectron2.layers import Conv2d, ConvTranspose2d, ShapeSpec, cat, interpolate
|
8 |
-
from detectron2.structures import Instances, heatmaps_to_keypoints
|
9 |
-
from detectron2.utils.events import get_event_storage
|
10 |
-
from detectron2.utils.registry import Registry
|
11 |
-
|
12 |
-
_TOTAL_SKIPPED = 0
|
13 |
-
|
14 |
-
ROI_KEYPOINT_HEAD_REGISTRY = Registry("ROI_KEYPOINT_HEAD")
|
15 |
-
ROI_KEYPOINT_HEAD_REGISTRY.__doc__ = """
|
16 |
-
Registry for keypoint heads, which make keypoint predictions from per-region features.
|
17 |
-
|
18 |
-
The registered object will be called with `obj(cfg, input_shape)`.
|
19 |
-
"""
|
20 |
-
|
21 |
-
|
22 |
-
def build_keypoint_head(cfg, input_shape):
|
23 |
-
"""
|
24 |
-
Build a keypoint head from `cfg.MODEL.ROI_KEYPOINT_HEAD.NAME`.
|
25 |
-
"""
|
26 |
-
name = cfg.MODEL.ROI_KEYPOINT_HEAD.NAME
|
27 |
-
return ROI_KEYPOINT_HEAD_REGISTRY.get(name)(cfg, input_shape)
|
28 |
-
|
29 |
-
|
30 |
-
def keypoint_rcnn_loss(pred_keypoint_logits, instances, normalizer):
|
31 |
-
"""
|
32 |
-
Arguments:
|
33 |
-
pred_keypoint_logits (Tensor): A tensor of shape (N, K, S, S) where N is the total number
|
34 |
-
of instances in the batch, K is the number of keypoints, and S is the side length
|
35 |
-
of the keypoint heatmap. The values are spatial logits.
|
36 |
-
instances (list[Instances]): A list of M Instances, where M is the batch size.
|
37 |
-
These instances are predictions from the model
|
38 |
-
that are in 1:1 correspondence with pred_keypoint_logits.
|
39 |
-
Each Instances should contain a `gt_keypoints` field containing a `structures.Keypoint`
|
40 |
-
instance.
|
41 |
-
normalizer (float): Normalize the loss by this amount.
|
42 |
-
If not specified, we normalize by the number of visible keypoints in the minibatch.
|
43 |
-
|
44 |
-
Returns a scalar tensor containing the loss.
|
45 |
-
"""
|
46 |
-
heatmaps = []
|
47 |
-
valid = []
|
48 |
-
|
49 |
-
keypoint_side_len = pred_keypoint_logits.shape[2]
|
50 |
-
for instances_per_image in instances:
|
51 |
-
if len(instances_per_image) == 0:
|
52 |
-
continue
|
53 |
-
keypoints = instances_per_image.gt_keypoints
|
54 |
-
heatmaps_per_image, valid_per_image = keypoints.to_heatmap(
|
55 |
-
instances_per_image.proposal_boxes.tensor, keypoint_side_len
|
56 |
-
)
|
57 |
-
heatmaps.append(heatmaps_per_image.view(-1))
|
58 |
-
valid.append(valid_per_image.view(-1))
|
59 |
-
|
60 |
-
if len(heatmaps):
|
61 |
-
keypoint_targets = cat(heatmaps, dim=0)
|
62 |
-
valid = cat(valid, dim=0).to(dtype=torch.uint8)
|
63 |
-
valid = torch.nonzero(valid).squeeze(1)
|
64 |
-
|
65 |
-
# torch.mean (in binary_cross_entropy_with_logits) doesn't
|
66 |
-
# accept empty tensors, so handle it separately
|
67 |
-
if len(heatmaps) == 0 or valid.numel() == 0:
|
68 |
-
global _TOTAL_SKIPPED
|
69 |
-
_TOTAL_SKIPPED += 1
|
70 |
-
storage = get_event_storage()
|
71 |
-
storage.put_scalar("kpts_num_skipped_batches", _TOTAL_SKIPPED, smoothing_hint=False)
|
72 |
-
return pred_keypoint_logits.sum() * 0
|
73 |
-
|
74 |
-
N, K, H, W = pred_keypoint_logits.shape
|
75 |
-
pred_keypoint_logits = pred_keypoint_logits.view(N * K, H * W)
|
76 |
-
|
77 |
-
keypoint_loss = F.cross_entropy(
|
78 |
-
pred_keypoint_logits[valid], keypoint_targets[valid], reduction="sum"
|
79 |
-
)
|
80 |
-
|
81 |
-
# If a normalizer isn't specified, normalize by the number of visible keypoints in the minibatch
|
82 |
-
if normalizer is None:
|
83 |
-
normalizer = valid.numel()
|
84 |
-
keypoint_loss /= normalizer
|
85 |
-
|
86 |
-
return keypoint_loss
|
87 |
-
|
88 |
-
|
89 |
-
def keypoint_rcnn_inference(pred_keypoint_logits, pred_instances):
|
90 |
-
"""
|
91 |
-
Post process each predicted keypoint heatmap in `pred_keypoint_logits` into (x, y, score)
|
92 |
-
and add it to the `pred_instances` as a `pred_keypoints` field.
|
93 |
-
|
94 |
-
Args:
|
95 |
-
pred_keypoint_logits (Tensor): A tensor of shape (R, K, S, S) where R is the total number
|
96 |
-
of instances in the batch, K is the number of keypoints, and S is the side length of
|
97 |
-
the keypoint heatmap. The values are spatial logits.
|
98 |
-
pred_instances (list[Instances]): A list of N Instances, where N is the number of images.
|
99 |
-
|
100 |
-
Returns:
|
101 |
-
None. Each element in pred_instances will contain an extra "pred_keypoints" field.
|
102 |
-
The field is a tensor of shape (#instance, K, 3) where the last
|
103 |
-
dimension corresponds to (x, y, score).
|
104 |
-
The scores are larger than 0.
|
105 |
-
"""
|
106 |
-
# flatten all bboxes from all images together (list[Boxes] -> Rx4 tensor)
|
107 |
-
bboxes_flat = cat([b.pred_boxes.tensor for b in pred_instances], dim=0)
|
108 |
-
|
109 |
-
keypoint_results = heatmaps_to_keypoints(pred_keypoint_logits.detach(), bboxes_flat.detach())
|
110 |
-
num_instances_per_image = [len(i) for i in pred_instances]
|
111 |
-
keypoint_results = keypoint_results[:, :, [0, 1, 3]].split(num_instances_per_image, dim=0)
|
112 |
-
|
113 |
-
for keypoint_results_per_image, instances_per_image in zip(keypoint_results, pred_instances):
|
114 |
-
# keypoint_results_per_image is (num instances)x(num keypoints)x(x, y, score)
|
115 |
-
instances_per_image.pred_keypoints = keypoint_results_per_image
|
116 |
-
|
117 |
-
|
118 |
-
class BaseKeypointRCNNHead(nn.Module):
|
119 |
-
"""
|
120 |
-
Implement the basic Keypoint R-CNN losses and inference logic.
|
121 |
-
"""
|
122 |
-
|
123 |
-
def __init__(self, cfg, input_shape):
|
124 |
-
super().__init__()
|
125 |
-
# fmt: off
|
126 |
-
self.loss_weight = cfg.MODEL.ROI_KEYPOINT_HEAD.LOSS_WEIGHT
|
127 |
-
self.normalize_by_visible_keypoints = cfg.MODEL.ROI_KEYPOINT_HEAD.NORMALIZE_LOSS_BY_VISIBLE_KEYPOINTS # noqa
|
128 |
-
self.num_keypoints = cfg.MODEL.ROI_KEYPOINT_HEAD.NUM_KEYPOINTS
|
129 |
-
batch_size_per_image = cfg.MODEL.ROI_HEADS.BATCH_SIZE_PER_IMAGE
|
130 |
-
positive_sample_fraction = cfg.MODEL.ROI_HEADS.POSITIVE_FRACTION
|
131 |
-
# fmt: on
|
132 |
-
self.normalizer_per_img = (
|
133 |
-
self.num_keypoints * batch_size_per_image * positive_sample_fraction
|
134 |
-
)
|
135 |
-
|
136 |
-
def forward(self, x, instances: List[Instances]):
|
137 |
-
"""
|
138 |
-
Args:
|
139 |
-
x: input region feature(s) provided by :class:`ROIHeads`.
|
140 |
-
instances (list[Instances]): contains the boxes & labels corresponding
|
141 |
-
to the input features.
|
142 |
-
Exact format is up to its caller to decide.
|
143 |
-
Typically, this is the foreground instances in training, with
|
144 |
-
"proposal_boxes" field and other gt annotations.
|
145 |
-
In inference, it contains boxes that are already predicted.
|
146 |
-
|
147 |
-
Returns:
|
148 |
-
A dict of losses if in training. The predicted "instances" if in inference.
|
149 |
-
"""
|
150 |
-
x = self.layers(x)
|
151 |
-
if self.training:
|
152 |
-
num_images = len(instances)
|
153 |
-
normalizer = (
|
154 |
-
None
|
155 |
-
if self.normalize_by_visible_keypoints
|
156 |
-
else num_images * self.normalizer_per_img
|
157 |
-
)
|
158 |
-
return {
|
159 |
-
"loss_keypoint": keypoint_rcnn_loss(x, instances, normalizer=normalizer)
|
160 |
-
* self.loss_weight
|
161 |
-
}
|
162 |
-
else:
|
163 |
-
keypoint_rcnn_inference(x, instances)
|
164 |
-
return instances
|
165 |
-
|
166 |
-
def layers(self, x):
|
167 |
-
"""
|
168 |
-
Neural network layers that makes predictions from regional input features.
|
169 |
-
"""
|
170 |
-
raise NotImplementedError
|
171 |
-
|
172 |
-
|
173 |
-
@ROI_KEYPOINT_HEAD_REGISTRY.register()
|
174 |
-
class KRCNNConvDeconvUpsampleHead(BaseKeypointRCNNHead):
|
175 |
-
"""
|
176 |
-
A standard keypoint head containing a series of 3x3 convs, followed by
|
177 |
-
a transpose convolution and bilinear interpolation for upsampling.
|
178 |
-
"""
|
179 |
-
|
180 |
-
def __init__(self, cfg, input_shape: ShapeSpec):
|
181 |
-
"""
|
182 |
-
The following attributes are parsed from config:
|
183 |
-
conv_dims: an iterable of output channel counts for each conv in the head
|
184 |
-
e.g. (512, 512, 512) for three convs outputting 512 channels.
|
185 |
-
num_keypoints: number of keypoint heatmaps to predicts, determines the number of
|
186 |
-
channels in the final output.
|
187 |
-
"""
|
188 |
-
super().__init__(cfg, input_shape)
|
189 |
-
|
190 |
-
# fmt: off
|
191 |
-
# default up_scale to 2 (this can eventually be moved to config)
|
192 |
-
up_scale = 2
|
193 |
-
conv_dims = cfg.MODEL.ROI_KEYPOINT_HEAD.CONV_DIMS
|
194 |
-
num_keypoints = cfg.MODEL.ROI_KEYPOINT_HEAD.NUM_KEYPOINTS
|
195 |
-
in_channels = input_shape.channels
|
196 |
-
# fmt: on
|
197 |
-
|
198 |
-
self.blocks = []
|
199 |
-
for idx, layer_channels in enumerate(conv_dims, 1):
|
200 |
-
module = Conv2d(in_channels, layer_channels, 3, stride=1, padding=1)
|
201 |
-
self.add_module("conv_fcn{}".format(idx), module)
|
202 |
-
self.blocks.append(module)
|
203 |
-
in_channels = layer_channels
|
204 |
-
|
205 |
-
deconv_kernel = 4
|
206 |
-
self.score_lowres = ConvTranspose2d(
|
207 |
-
in_channels, num_keypoints, deconv_kernel, stride=2, padding=deconv_kernel // 2 - 1
|
208 |
-
)
|
209 |
-
self.up_scale = up_scale
|
210 |
-
|
211 |
-
for name, param in self.named_parameters():
|
212 |
-
if "bias" in name:
|
213 |
-
nn.init.constant_(param, 0)
|
214 |
-
elif "weight" in name:
|
215 |
-
# Caffe2 implementation uses MSRAFill, which in fact
|
216 |
-
# corresponds to kaiming_normal_ in PyTorch
|
217 |
-
nn.init.kaiming_normal_(param, mode="fan_out", nonlinearity="relu")
|
218 |
-
|
219 |
-
def layers(self, x):
|
220 |
-
for layer in self.blocks:
|
221 |
-
x = F.relu(layer(x))
|
222 |
-
x = self.score_lowres(x)
|
223 |
-
x = interpolate(x, scale_factor=self.up_scale, mode="bilinear", align_corners=False)
|
224 |
-
return x
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CZ5624/anime-remove-background/README.md
DELETED
@@ -1,14 +0,0 @@
|
|
1 |
-
---
|
2 |
-
title: Anime Remove Background
|
3 |
-
emoji: 🪄🖼️
|
4 |
-
colorFrom: indigo
|
5 |
-
colorTo: pink
|
6 |
-
sdk: gradio
|
7 |
-
sdk_version: 3.1.4
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
-
license: apache-2.0
|
11 |
-
duplicated_from: skytnt/anime-remove-background
|
12 |
-
---
|
13 |
-
|
14 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Cat125/text-generator-v2/datamanager.py
DELETED
@@ -1,123 +0,0 @@
|
|
1 |
-
import json
|
2 |
-
import pickle
|
3 |
-
import time
|
4 |
-
|
5 |
-
from files import read_file, read_lines
|
6 |
-
|
7 |
-
models = json.load(open("models/models.json"))
|
8 |
-
TEXT_PATH = 'models/%s/text.txt'
|
9 |
-
FILENAME_V1 = 'models/%s/data.pkl'
|
10 |
-
FILENAME_V2 = 'models/%s/data2.pkl'
|
11 |
-
FILENAME_V3 = 'models/%s/data3.pkl'
|
12 |
-
|
13 |
-
def get_texts(model_name):
|
14 |
-
"""
|
15 |
-
This function returns the lines of text associated with a given model name.
|
16 |
-
|
17 |
-
:param model_name: The name of a model that has been defined in the `models` dictionary. This
|
18 |
-
function is designed to retrieve the texts associated with a particular model
|
19 |
-
:return: The function `get_texts` is returning the text data from a specific model, which is
|
20 |
-
identified by its name. The text data is obtained by calling the `read_lines` function on the `text`
|
21 |
-
attribute of the specified model.
|
22 |
-
"""
|
23 |
-
return read_lines(TEXT_PATH % model_name)
|
24 |
-
|
25 |
-
def get_text(model_name):
|
26 |
-
return read_file(TEXT_PATH % model_name)
|
27 |
-
|
28 |
-
def set_data(model_name, data):
|
29 |
-
"""
|
30 |
-
This function saves data to a file using the pickle module, with the filename specified by the
|
31 |
-
model_name argument.
|
32 |
-
|
33 |
-
:param model_name: The name of the model for which the data is being set
|
34 |
-
:param data: The data that needs to be saved for the given model. It could be any Python object such
|
35 |
-
as a list, dictionary, or a trained model
|
36 |
-
"""
|
37 |
-
print(f'Writing data for {model_name}...', end=' ')
|
38 |
-
pickle.dump(data, open(FILENAME_V1 % model_name, 'wb+'))
|
39 |
-
print('done')
|
40 |
-
|
41 |
-
def get_data(model_name):
|
42 |
-
"""
|
43 |
-
The function retrieves data from a database or a file using a model name as input.
|
44 |
-
|
45 |
-
:param model_name: The name of the model for which we want to retrieve the data
|
46 |
-
:return: The function `get_data` returns the database object for the specified `model_name`. If the
|
47 |
-
database object is already loaded in memory, it returns the cached object. Otherwise, it loads the
|
48 |
-
object from a file using `pickle.load()` and caches it for future use.
|
49 |
-
"""
|
50 |
-
if models[model_name]["db"]:
|
51 |
-
return models[model_name]["db"]
|
52 |
-
print(f'Loading model {model_name}...', end=' ')
|
53 |
-
start_time = time.time()
|
54 |
-
db = pickle.load(open(FILENAME_V1 % model_name, 'rb'))
|
55 |
-
models[model_name]["db"] = db
|
56 |
-
print("done (%ss)" % (time.time() - start_time))
|
57 |
-
return db
|
58 |
-
|
59 |
-
def set_data_v2(model_name, data):
|
60 |
-
"""
|
61 |
-
This function saves data to a file using the pickle module, with the filename specified in a
|
62 |
-
dictionary associated with the given model name.
|
63 |
-
|
64 |
-
:param model_name: The name of the model for which the data is being set
|
65 |
-
:param data: The data that needs to be saved to a file using the pickle module
|
66 |
-
"""
|
67 |
-
print(f'Writing data for {model_name}...', end=' ')
|
68 |
-
pickle.dump(data, open(FILENAME_V2 % model_name, 'wb+'))
|
69 |
-
print('done')
|
70 |
-
|
71 |
-
def get_data_v2(model_name):
|
72 |
-
"""
|
73 |
-
This function returns a database object for a given model name, either by loading it from a file or
|
74 |
-
returning a cached version.
|
75 |
-
|
76 |
-
:param model_name: The name of the model for which we want to retrieve the data
|
77 |
-
:return: a database object for the given model name. If the database object is already loaded in the
|
78 |
-
models dictionary, it returns the object from the dictionary. Otherwise, it loads the object from a
|
79 |
-
pickle file and stores it in the dictionary before returning it.
|
80 |
-
"""
|
81 |
-
if models[model_name]["db2"]:
|
82 |
-
return models[model_name]["db2"]
|
83 |
-
print(f'Loading model {model_name}...', end=' ')
|
84 |
-
start_time = time.time()
|
85 |
-
db = pickle.load(open(FILENAME_V2 % model_name, 'rb'))
|
86 |
-
models[model_name]["db2"] = db
|
87 |
-
print("done (%ss)" % (time.time() - start_time))
|
88 |
-
return db
|
89 |
-
|
90 |
-
def set_data_v3(model_name, data):
|
91 |
-
"""
|
92 |
-
This function saves data to a file using the pickle module, with the filename specified by the
|
93 |
-
model_name argument.
|
94 |
-
|
95 |
-
:param model_name: The name of the model for which the data is being set
|
96 |
-
:param data: The data parameter is the data that needs to be saved to a file using the pickle
|
97 |
-
module. The data can be of any type, such as a list, dictionary, or object. The function saves the
|
98 |
-
data to a file specified by the model_name parameter. The filename is obtained from the models
|
99 |
-
dictionary
|
100 |
-
"""
|
101 |
-
print(f'Writing data for {model_name}...', end=' ')
|
102 |
-
pickle.dump(data, open(FILENAME_V3 % model_name, 'wb+'))
|
103 |
-
print('done')
|
104 |
-
|
105 |
-
def get_data_v3(model_name):
|
106 |
-
"""
|
107 |
-
This function loads a database file for a given model and returns it, while also caching it for
|
108 |
-
future use.
|
109 |
-
|
110 |
-
:param model_name: a string representing the name of a model
|
111 |
-
:return: The function `get_data_v3` returns the database object for the given `model_name`. If the
|
112 |
-
database object is already loaded in the `models` dictionary, it returns the cached object.
|
113 |
-
Otherwise, it loads the object from the file specified in the `models` dictionary, caches it in the
|
114 |
-
`models` dictionary, and returns it.
|
115 |
-
"""
|
116 |
-
if models[model_name]["db3"]:
|
117 |
-
return models[model_name]["db3"]
|
118 |
-
print(f'Loading model {model_name}...', end=' ')
|
119 |
-
start_time = time.time()
|
120 |
-
db = pickle.load(open(FILENAME_V3 % model_name, 'rb'))
|
121 |
-
models[model_name]["db3"] = db
|
122 |
-
print("done (%ss)" % (time.time() - start_time))
|
123 |
-
return db
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CjangCjengh/Shanghainese-TTS/modules.py
DELETED
@@ -1,387 +0,0 @@
|
|
1 |
-
import math
|
2 |
-
import torch
|
3 |
-
from torch import nn
|
4 |
-
from torch.nn import functional as F
|
5 |
-
|
6 |
-
from torch.nn import Conv1d
|
7 |
-
from torch.nn.utils import weight_norm, remove_weight_norm
|
8 |
-
|
9 |
-
import commons
|
10 |
-
from commons import init_weights, get_padding
|
11 |
-
from transforms import piecewise_rational_quadratic_transform
|
12 |
-
|
13 |
-
|
14 |
-
LRELU_SLOPE = 0.1
|
15 |
-
|
16 |
-
|
17 |
-
class LayerNorm(nn.Module):
|
18 |
-
def __init__(self, channels, eps=1e-5):
|
19 |
-
super().__init__()
|
20 |
-
self.channels = channels
|
21 |
-
self.eps = eps
|
22 |
-
|
23 |
-
self.gamma = nn.Parameter(torch.ones(channels))
|
24 |
-
self.beta = nn.Parameter(torch.zeros(channels))
|
25 |
-
|
26 |
-
def forward(self, x):
|
27 |
-
x = x.transpose(1, -1)
|
28 |
-
x = F.layer_norm(x, (self.channels,), self.gamma, self.beta, self.eps)
|
29 |
-
return x.transpose(1, -1)
|
30 |
-
|
31 |
-
|
32 |
-
class ConvReluNorm(nn.Module):
|
33 |
-
def __init__(self, in_channels, hidden_channels, out_channels, kernel_size, n_layers, p_dropout):
|
34 |
-
super().__init__()
|
35 |
-
self.in_channels = in_channels
|
36 |
-
self.hidden_channels = hidden_channels
|
37 |
-
self.out_channels = out_channels
|
38 |
-
self.kernel_size = kernel_size
|
39 |
-
self.n_layers = n_layers
|
40 |
-
self.p_dropout = p_dropout
|
41 |
-
assert n_layers > 1, "Number of layers should be larger than 0."
|
42 |
-
|
43 |
-
self.conv_layers = nn.ModuleList()
|
44 |
-
self.norm_layers = nn.ModuleList()
|
45 |
-
self.conv_layers.append(nn.Conv1d(in_channels, hidden_channels, kernel_size, padding=kernel_size//2))
|
46 |
-
self.norm_layers.append(LayerNorm(hidden_channels))
|
47 |
-
self.relu_drop = nn.Sequential(
|
48 |
-
nn.ReLU(),
|
49 |
-
nn.Dropout(p_dropout))
|
50 |
-
for _ in range(n_layers-1):
|
51 |
-
self.conv_layers.append(nn.Conv1d(hidden_channels, hidden_channels, kernel_size, padding=kernel_size//2))
|
52 |
-
self.norm_layers.append(LayerNorm(hidden_channels))
|
53 |
-
self.proj = nn.Conv1d(hidden_channels, out_channels, 1)
|
54 |
-
self.proj.weight.data.zero_()
|
55 |
-
self.proj.bias.data.zero_()
|
56 |
-
|
57 |
-
def forward(self, x, x_mask):
|
58 |
-
x_org = x
|
59 |
-
for i in range(self.n_layers):
|
60 |
-
x = self.conv_layers[i](x * x_mask)
|
61 |
-
x = self.norm_layers[i](x)
|
62 |
-
x = self.relu_drop(x)
|
63 |
-
x = x_org + self.proj(x)
|
64 |
-
return x * x_mask
|
65 |
-
|
66 |
-
|
67 |
-
class DDSConv(nn.Module):
|
68 |
-
"""
|
69 |
-
Dialted and Depth-Separable Convolution
|
70 |
-
"""
|
71 |
-
def __init__(self, channels, kernel_size, n_layers, p_dropout=0.):
|
72 |
-
super().__init__()
|
73 |
-
self.channels = channels
|
74 |
-
self.kernel_size = kernel_size
|
75 |
-
self.n_layers = n_layers
|
76 |
-
self.p_dropout = p_dropout
|
77 |
-
|
78 |
-
self.drop = nn.Dropout(p_dropout)
|
79 |
-
self.convs_sep = nn.ModuleList()
|
80 |
-
self.convs_1x1 = nn.ModuleList()
|
81 |
-
self.norms_1 = nn.ModuleList()
|
82 |
-
self.norms_2 = nn.ModuleList()
|
83 |
-
for i in range(n_layers):
|
84 |
-
dilation = kernel_size ** i
|
85 |
-
padding = (kernel_size * dilation - dilation) // 2
|
86 |
-
self.convs_sep.append(nn.Conv1d(channels, channels, kernel_size,
|
87 |
-
groups=channels, dilation=dilation, padding=padding
|
88 |
-
))
|
89 |
-
self.convs_1x1.append(nn.Conv1d(channels, channels, 1))
|
90 |
-
self.norms_1.append(LayerNorm(channels))
|
91 |
-
self.norms_2.append(LayerNorm(channels))
|
92 |
-
|
93 |
-
def forward(self, x, x_mask, g=None):
|
94 |
-
if g is not None:
|
95 |
-
x = x + g
|
96 |
-
for i in range(self.n_layers):
|
97 |
-
y = self.convs_sep[i](x * x_mask)
|
98 |
-
y = self.norms_1[i](y)
|
99 |
-
y = F.gelu(y)
|
100 |
-
y = self.convs_1x1[i](y)
|
101 |
-
y = self.norms_2[i](y)
|
102 |
-
y = F.gelu(y)
|
103 |
-
y = self.drop(y)
|
104 |
-
x = x + y
|
105 |
-
return x * x_mask
|
106 |
-
|
107 |
-
|
108 |
-
class WN(torch.nn.Module):
|
109 |
-
def __init__(self, hidden_channels, kernel_size, dilation_rate, n_layers, gin_channels=0, p_dropout=0):
|
110 |
-
super(WN, self).__init__()
|
111 |
-
assert(kernel_size % 2 == 1)
|
112 |
-
self.hidden_channels =hidden_channels
|
113 |
-
self.kernel_size = kernel_size,
|
114 |
-
self.dilation_rate = dilation_rate
|
115 |
-
self.n_layers = n_layers
|
116 |
-
self.gin_channels = gin_channels
|
117 |
-
self.p_dropout = p_dropout
|
118 |
-
|
119 |
-
self.in_layers = torch.nn.ModuleList()
|
120 |
-
self.res_skip_layers = torch.nn.ModuleList()
|
121 |
-
self.drop = nn.Dropout(p_dropout)
|
122 |
-
|
123 |
-
if gin_channels != 0:
|
124 |
-
cond_layer = torch.nn.Conv1d(gin_channels, 2*hidden_channels*n_layers, 1)
|
125 |
-
self.cond_layer = torch.nn.utils.weight_norm(cond_layer, name='weight')
|
126 |
-
|
127 |
-
for i in range(n_layers):
|
128 |
-
dilation = dilation_rate ** i
|
129 |
-
padding = int((kernel_size * dilation - dilation) / 2)
|
130 |
-
in_layer = torch.nn.Conv1d(hidden_channels, 2*hidden_channels, kernel_size,
|
131 |
-
dilation=dilation, padding=padding)
|
132 |
-
in_layer = torch.nn.utils.weight_norm(in_layer, name='weight')
|
133 |
-
self.in_layers.append(in_layer)
|
134 |
-
|
135 |
-
# last one is not necessary
|
136 |
-
if i < n_layers - 1:
|
137 |
-
res_skip_channels = 2 * hidden_channels
|
138 |
-
else:
|
139 |
-
res_skip_channels = hidden_channels
|
140 |
-
|
141 |
-
res_skip_layer = torch.nn.Conv1d(hidden_channels, res_skip_channels, 1)
|
142 |
-
res_skip_layer = torch.nn.utils.weight_norm(res_skip_layer, name='weight')
|
143 |
-
self.res_skip_layers.append(res_skip_layer)
|
144 |
-
|
145 |
-
def forward(self, x, x_mask, g=None, **kwargs):
|
146 |
-
output = torch.zeros_like(x)
|
147 |
-
n_channels_tensor = torch.IntTensor([self.hidden_channels])
|
148 |
-
|
149 |
-
if g is not None:
|
150 |
-
g = self.cond_layer(g)
|
151 |
-
|
152 |
-
for i in range(self.n_layers):
|
153 |
-
x_in = self.in_layers[i](x)
|
154 |
-
if g is not None:
|
155 |
-
cond_offset = i * 2 * self.hidden_channels
|
156 |
-
g_l = g[:,cond_offset:cond_offset+2*self.hidden_channels,:]
|
157 |
-
else:
|
158 |
-
g_l = torch.zeros_like(x_in)
|
159 |
-
|
160 |
-
acts = commons.fused_add_tanh_sigmoid_multiply(
|
161 |
-
x_in,
|
162 |
-
g_l,
|
163 |
-
n_channels_tensor)
|
164 |
-
acts = self.drop(acts)
|
165 |
-
|
166 |
-
res_skip_acts = self.res_skip_layers[i](acts)
|
167 |
-
if i < self.n_layers - 1:
|
168 |
-
res_acts = res_skip_acts[:,:self.hidden_channels,:]
|
169 |
-
x = (x + res_acts) * x_mask
|
170 |
-
output = output + res_skip_acts[:,self.hidden_channels:,:]
|
171 |
-
else:
|
172 |
-
output = output + res_skip_acts
|
173 |
-
return output * x_mask
|
174 |
-
|
175 |
-
def remove_weight_norm(self):
|
176 |
-
if self.gin_channels != 0:
|
177 |
-
torch.nn.utils.remove_weight_norm(self.cond_layer)
|
178 |
-
for l in self.in_layers:
|
179 |
-
torch.nn.utils.remove_weight_norm(l)
|
180 |
-
for l in self.res_skip_layers:
|
181 |
-
torch.nn.utils.remove_weight_norm(l)
|
182 |
-
|
183 |
-
|
184 |
-
class ResBlock1(torch.nn.Module):
|
185 |
-
def __init__(self, channels, kernel_size=3, dilation=(1, 3, 5)):
|
186 |
-
super(ResBlock1, self).__init__()
|
187 |
-
self.convs1 = nn.ModuleList([
|
188 |
-
weight_norm(Conv1d(channels, channels, kernel_size, 1, dilation=dilation[0],
|
189 |
-
padding=get_padding(kernel_size, dilation[0]))),
|
190 |
-
weight_norm(Conv1d(channels, channels, kernel_size, 1, dilation=dilation[1],
|
191 |
-
padding=get_padding(kernel_size, dilation[1]))),
|
192 |
-
weight_norm(Conv1d(channels, channels, kernel_size, 1, dilation=dilation[2],
|
193 |
-
padding=get_padding(kernel_size, dilation[2])))
|
194 |
-
])
|
195 |
-
self.convs1.apply(init_weights)
|
196 |
-
|
197 |
-
self.convs2 = nn.ModuleList([
|
198 |
-
weight_norm(Conv1d(channels, channels, kernel_size, 1, dilation=1,
|
199 |
-
padding=get_padding(kernel_size, 1))),
|
200 |
-
weight_norm(Conv1d(channels, channels, kernel_size, 1, dilation=1,
|
201 |
-
padding=get_padding(kernel_size, 1))),
|
202 |
-
weight_norm(Conv1d(channels, channels, kernel_size, 1, dilation=1,
|
203 |
-
padding=get_padding(kernel_size, 1)))
|
204 |
-
])
|
205 |
-
self.convs2.apply(init_weights)
|
206 |
-
|
207 |
-
def forward(self, x, x_mask=None):
|
208 |
-
for c1, c2 in zip(self.convs1, self.convs2):
|
209 |
-
xt = F.leaky_relu(x, LRELU_SLOPE)
|
210 |
-
if x_mask is not None:
|
211 |
-
xt = xt * x_mask
|
212 |
-
xt = c1(xt)
|
213 |
-
xt = F.leaky_relu(xt, LRELU_SLOPE)
|
214 |
-
if x_mask is not None:
|
215 |
-
xt = xt * x_mask
|
216 |
-
xt = c2(xt)
|
217 |
-
x = xt + x
|
218 |
-
if x_mask is not None:
|
219 |
-
x = x * x_mask
|
220 |
-
return x
|
221 |
-
|
222 |
-
def remove_weight_norm(self):
|
223 |
-
for l in self.convs1:
|
224 |
-
remove_weight_norm(l)
|
225 |
-
for l in self.convs2:
|
226 |
-
remove_weight_norm(l)
|
227 |
-
|
228 |
-
|
229 |
-
class ResBlock2(torch.nn.Module):
|
230 |
-
def __init__(self, channels, kernel_size=3, dilation=(1, 3)):
|
231 |
-
super(ResBlock2, self).__init__()
|
232 |
-
self.convs = nn.ModuleList([
|
233 |
-
weight_norm(Conv1d(channels, channels, kernel_size, 1, dilation=dilation[0],
|
234 |
-
padding=get_padding(kernel_size, dilation[0]))),
|
235 |
-
weight_norm(Conv1d(channels, channels, kernel_size, 1, dilation=dilation[1],
|
236 |
-
padding=get_padding(kernel_size, dilation[1])))
|
237 |
-
])
|
238 |
-
self.convs.apply(init_weights)
|
239 |
-
|
240 |
-
def forward(self, x, x_mask=None):
|
241 |
-
for c in self.convs:
|
242 |
-
xt = F.leaky_relu(x, LRELU_SLOPE)
|
243 |
-
if x_mask is not None:
|
244 |
-
xt = xt * x_mask
|
245 |
-
xt = c(xt)
|
246 |
-
x = xt + x
|
247 |
-
if x_mask is not None:
|
248 |
-
x = x * x_mask
|
249 |
-
return x
|
250 |
-
|
251 |
-
def remove_weight_norm(self):
|
252 |
-
for l in self.convs:
|
253 |
-
remove_weight_norm(l)
|
254 |
-
|
255 |
-
|
256 |
-
class Log(nn.Module):
|
257 |
-
def forward(self, x, x_mask, reverse=False, **kwargs):
|
258 |
-
if not reverse:
|
259 |
-
y = torch.log(torch.clamp_min(x, 1e-5)) * x_mask
|
260 |
-
logdet = torch.sum(-y, [1, 2])
|
261 |
-
return y, logdet
|
262 |
-
else:
|
263 |
-
x = torch.exp(x) * x_mask
|
264 |
-
return x
|
265 |
-
|
266 |
-
|
267 |
-
class Flip(nn.Module):
|
268 |
-
def forward(self, x, *args, reverse=False, **kwargs):
|
269 |
-
x = torch.flip(x, [1])
|
270 |
-
if not reverse:
|
271 |
-
logdet = torch.zeros(x.size(0)).to(dtype=x.dtype, device=x.device)
|
272 |
-
return x, logdet
|
273 |
-
else:
|
274 |
-
return x
|
275 |
-
|
276 |
-
|
277 |
-
class ElementwiseAffine(nn.Module):
|
278 |
-
def __init__(self, channels):
|
279 |
-
super().__init__()
|
280 |
-
self.channels = channels
|
281 |
-
self.m = nn.Parameter(torch.zeros(channels,1))
|
282 |
-
self.logs = nn.Parameter(torch.zeros(channels,1))
|
283 |
-
|
284 |
-
def forward(self, x, x_mask, reverse=False, **kwargs):
|
285 |
-
if not reverse:
|
286 |
-
y = self.m + torch.exp(self.logs) * x
|
287 |
-
y = y * x_mask
|
288 |
-
logdet = torch.sum(self.logs * x_mask, [1,2])
|
289 |
-
return y, logdet
|
290 |
-
else:
|
291 |
-
x = (x - self.m) * torch.exp(-self.logs) * x_mask
|
292 |
-
return x
|
293 |
-
|
294 |
-
|
295 |
-
class ResidualCouplingLayer(nn.Module):
|
296 |
-
def __init__(self,
|
297 |
-
channels,
|
298 |
-
hidden_channels,
|
299 |
-
kernel_size,
|
300 |
-
dilation_rate,
|
301 |
-
n_layers,
|
302 |
-
p_dropout=0,
|
303 |
-
gin_channels=0,
|
304 |
-
mean_only=False):
|
305 |
-
assert channels % 2 == 0, "channels should be divisible by 2"
|
306 |
-
super().__init__()
|
307 |
-
self.channels = channels
|
308 |
-
self.hidden_channels = hidden_channels
|
309 |
-
self.kernel_size = kernel_size
|
310 |
-
self.dilation_rate = dilation_rate
|
311 |
-
self.n_layers = n_layers
|
312 |
-
self.half_channels = channels // 2
|
313 |
-
self.mean_only = mean_only
|
314 |
-
|
315 |
-
self.pre = nn.Conv1d(self.half_channels, hidden_channels, 1)
|
316 |
-
self.enc = WN(hidden_channels, kernel_size, dilation_rate, n_layers, p_dropout=p_dropout, gin_channels=gin_channels)
|
317 |
-
self.post = nn.Conv1d(hidden_channels, self.half_channels * (2 - mean_only), 1)
|
318 |
-
self.post.weight.data.zero_()
|
319 |
-
self.post.bias.data.zero_()
|
320 |
-
|
321 |
-
def forward(self, x, x_mask, g=None, reverse=False):
|
322 |
-
x0, x1 = torch.split(x, [self.half_channels]*2, 1)
|
323 |
-
h = self.pre(x0) * x_mask
|
324 |
-
h = self.enc(h, x_mask, g=g)
|
325 |
-
stats = self.post(h) * x_mask
|
326 |
-
if not self.mean_only:
|
327 |
-
m, logs = torch.split(stats, [self.half_channels]*2, 1)
|
328 |
-
else:
|
329 |
-
m = stats
|
330 |
-
logs = torch.zeros_like(m)
|
331 |
-
|
332 |
-
if not reverse:
|
333 |
-
x1 = m + x1 * torch.exp(logs) * x_mask
|
334 |
-
x = torch.cat([x0, x1], 1)
|
335 |
-
logdet = torch.sum(logs, [1,2])
|
336 |
-
return x, logdet
|
337 |
-
else:
|
338 |
-
x1 = (x1 - m) * torch.exp(-logs) * x_mask
|
339 |
-
x = torch.cat([x0, x1], 1)
|
340 |
-
return x
|
341 |
-
|
342 |
-
|
343 |
-
class ConvFlow(nn.Module):
|
344 |
-
def __init__(self, in_channels, filter_channels, kernel_size, n_layers, num_bins=10, tail_bound=5.0):
|
345 |
-
super().__init__()
|
346 |
-
self.in_channels = in_channels
|
347 |
-
self.filter_channels = filter_channels
|
348 |
-
self.kernel_size = kernel_size
|
349 |
-
self.n_layers = n_layers
|
350 |
-
self.num_bins = num_bins
|
351 |
-
self.tail_bound = tail_bound
|
352 |
-
self.half_channels = in_channels // 2
|
353 |
-
|
354 |
-
self.pre = nn.Conv1d(self.half_channels, filter_channels, 1)
|
355 |
-
self.convs = DDSConv(filter_channels, kernel_size, n_layers, p_dropout=0.)
|
356 |
-
self.proj = nn.Conv1d(filter_channels, self.half_channels * (num_bins * 3 - 1), 1)
|
357 |
-
self.proj.weight.data.zero_()
|
358 |
-
self.proj.bias.data.zero_()
|
359 |
-
|
360 |
-
def forward(self, x, x_mask, g=None, reverse=False):
|
361 |
-
x0, x1 = torch.split(x, [self.half_channels]*2, 1)
|
362 |
-
h = self.pre(x0)
|
363 |
-
h = self.convs(h, x_mask, g=g)
|
364 |
-
h = self.proj(h) * x_mask
|
365 |
-
|
366 |
-
b, c, t = x0.shape
|
367 |
-
h = h.reshape(b, c, -1, t).permute(0, 1, 3, 2) # [b, cx?, t] -> [b, c, t, ?]
|
368 |
-
|
369 |
-
unnormalized_widths = h[..., :self.num_bins] / math.sqrt(self.filter_channels)
|
370 |
-
unnormalized_heights = h[..., self.num_bins:2*self.num_bins] / math.sqrt(self.filter_channels)
|
371 |
-
unnormalized_derivatives = h[..., 2 * self.num_bins:]
|
372 |
-
|
373 |
-
x1, logabsdet = piecewise_rational_quadratic_transform(x1,
|
374 |
-
unnormalized_widths,
|
375 |
-
unnormalized_heights,
|
376 |
-
unnormalized_derivatives,
|
377 |
-
inverse=reverse,
|
378 |
-
tails='linear',
|
379 |
-
tail_bound=self.tail_bound
|
380 |
-
)
|
381 |
-
|
382 |
-
x = torch.cat([x0, x1], 1) * x_mask
|
383 |
-
logdet = torch.sum(logabsdet * x_mask, [1,2])
|
384 |
-
if not reverse:
|
385 |
-
return x, logdet
|
386 |
-
else:
|
387 |
-
return x
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|