Commit
·
1ded444
1
Parent(s):
942ccad
Update parquet files (step 84 of 249)
Browse filesThis view is limited to 50 files because it contains too many changes.
See raw diff
- spaces/0xrk/gpt2/app.py +0 -3
- spaces/101-5/gpt4free/g4f/Provider/Providers/ChatgptLogin.py +0 -96
- spaces/17TheWord/vits-models/attentions.py +0 -300
- spaces/1acneusushi/gradio-2dmoleculeeditor/data/Acronis True Image 2013 Crack The Ultimate Guide to Backup and Recovery.md +0 -29
- spaces/1acneusushi/gradio-2dmoleculeeditor/data/Dishonored.Real.Proper-Crack Only-RELOADED The Complete Tutorial to Download and Run the Game on Your PC.md +0 -90
- spaces/1gistliPinn/ChatGPT4/Examples/ESET NOD32 LICENSE KEY 2021 Newest Key Update Nod32 Key 2020.md +0 -31
- spaces/1gistliPinn/ChatGPT4/Examples/Family Obsession Full ((EXCLUSIVE)) Rachel Steele Videol.md +0 -5
- spaces/1gistliPinn/ChatGPT4/Examples/Football Manager 2009 Language Superpack Update.md +0 -25
- spaces/1gistliPinn/ChatGPT4/Examples/Fukrey Returns [BETTER] Full Movie Download In Hindi 1080p.md +0 -6
- spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Afk Arena Mod Apk The Best Way to Play Afk Arena with Unlimited Money and Gems.md +0 -81
- spaces/1phancelerku/anime-remove-background/CBSE 10th Marksheet 2017 Online and Offline Modes of Downloading.md +0 -89
- spaces/1phancelerku/anime-remove-background/Download Solar Smash from the Google Play Store and Enjoy the Realistic Graphics and Physics.md +0 -132
- spaces/1phancelerku/anime-remove-background/Free APK Download for Telegram App - The Fastest and Most Secure Messaging App in 2021.md +0 -105
- spaces/1toTree/lora_test/ppdiffusers/pipelines/audio_diffusion/__init__.py +0 -17
- spaces/2023Liu2023/bingo/src/components/settings.tsx +0 -141
- spaces/AIConsultant/MusicGen/audiocraft/utils/checkpoint.py +0 -161
- spaces/AIFILMS/generate_human_motion/pyrender/pyrender/material.py +0 -707
- spaces/AIGC-Audio/Make_An_Audio/ldm/modules/encoders/open_clap/model.py +0 -913
- spaces/AchyuthGamer/OpenGPT-Chat-UI/src/lib/stores/errors.ts +0 -9
- spaces/Adapter/T2I-Adapter/ldm/data/dataset_depth.py +0 -35
- spaces/AeroXi/english-ai/README.md +0 -13
- spaces/AgentVerse/agentVerse/agentverse/agents/base.py +0 -101
- spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/maker/builders/CreateDialog.js +0 -31
- spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/numberbar/NumberBar.d.ts +0 -71
- spaces/AlekseyKorshuk/thin-plate-spline-motion-model/checkpoints/README.md +0 -1
- spaces/Aloento/9Nine-VITS/text/symbols.py +0 -18
- spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/src/diffusers/pipelines/deepfloyd_if/__init__.py +0 -54
- spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/tests/pipelines/audioldm/test_audioldm.py +0 -426
- spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/tests/schedulers/test_scheduler_deis.py +0 -237
- spaces/Andy1621/uniformer_image_detection/configs/lvis/mask_rcnn_r50_fpn_sample1e-3_mstrain_2x_lvis_v0.5.py +0 -31
- spaces/Andy1621/uniformer_image_detection/configs/mask_rcnn/mask_rcnn_r101_caffe_fpn_1x_coco.py +0 -4
- spaces/Andy1621/uniformer_image_detection/configs/reppoints/reppoints_moment_r50_fpn_gn-neck+head_1x_coco.py +0 -4
- spaces/Andy1621/uniformer_image_detection/configs/rpn/rpn_r101_caffe_fpn_1x_coco.py +0 -4
- spaces/Andy1621/uniformer_image_detection/mmdet/core/bbox/builder.py +0 -20
- spaces/Andy1621/uniformer_image_segmentation/configs/fcn/fcn_r50-d8_512x1024_40k_cityscapes.py +0 -4
- spaces/Andy1621/uniformer_image_segmentation/configs/mobilenet_v2/fcn_m-v2-d8_512x512_160k_ade20k.py +0 -12
- spaces/Aniquel/bert-large-uncased-whole-word-masking/app.py +0 -3
- spaces/AnishKumbhar/ChatBot/text-generation-webui-main/css/chat_style-TheEncrypted777.css +0 -133
- spaces/ArtGAN/Video-Diffusion-WebUI/video_diffusion/damo/damo_text2_video.py +0 -126
- spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/platformdirs/unix.py +0 -194
- spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/setuptools/_distutils/command/bdist_rpm.py +0 -615
- spaces/Awiny/Image2Paragraph/models/grit_src/third_party/CenterNet2/detectron2/utils/file_io.py +0 -37
- spaces/Benson/text-generation/Examples/Ao Nuevo Deseos 2023 Imgenes.md +0 -80
- spaces/Benson/text-generation/Examples/Descargar Cancin De Conquista.md +0 -153
- spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_vendor/pyparsing/actions.py +0 -207
- spaces/Borpos/openchat-openchat/app.py +0 -3
- spaces/CForGETaass/vits-uma-genshin-honkai/Docker/vits.sh +0 -20
- spaces/CVPR/Dual-Key_Backdoor_Attacks/weight_analysis/get_wt_features.py +0 -85
- spaces/CVPR/LIVE/thrust/thrust/system/detail/errno.h +0 -120
- spaces/CVPR/WALT/mmdet/models/roi_heads/bbox_heads/scnet_bbox_head.py +0 -76
spaces/0xrk/gpt2/app.py
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
|
3 |
-
gr.Interface.load("models/gpt2").launch()
|
|
|
|
|
|
|
|
spaces/101-5/gpt4free/g4f/Provider/Providers/ChatgptLogin.py
DELETED
@@ -1,96 +0,0 @@
|
|
1 |
-
import os
|
2 |
-
from ...typing import sha256, Dict, get_type_hints
|
3 |
-
import requests
|
4 |
-
import re
|
5 |
-
import base64
|
6 |
-
|
7 |
-
url = 'https://chatgptlogin.ac'
|
8 |
-
model = ['gpt-3.5-turbo']
|
9 |
-
supports_stream = False
|
10 |
-
needs_auth = False
|
11 |
-
|
12 |
-
|
13 |
-
def _create_completion(model: str, messages: list, stream: bool, **kwargs):
|
14 |
-
def get_nonce():
|
15 |
-
res = requests.get('https://chatgptlogin.ac/use-chatgpt-free/', headers={
|
16 |
-
"Referer": "https://chatgptlogin.ac/use-chatgpt-free/",
|
17 |
-
"User-Agent": 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36'
|
18 |
-
})
|
19 |
-
|
20 |
-
src = re.search(r'class="mwai-chat mwai-chatgpt">.*<span>Send</span></button></div></div></div> <script defer src="(.*?)">', res.text).group(1)
|
21 |
-
decoded_string = base64.b64decode(src.split(",")[-1]).decode('utf-8')
|
22 |
-
return re.search(r"let restNonce = '(.*?)';", decoded_string).group(1)
|
23 |
-
|
24 |
-
def transform(messages: list) -> list:
|
25 |
-
def html_encode(string: str) -> str:
|
26 |
-
table = {
|
27 |
-
'"': '"',
|
28 |
-
"'": ''',
|
29 |
-
'&': '&',
|
30 |
-
'>': '>',
|
31 |
-
'<': '<',
|
32 |
-
'\n': '<br>',
|
33 |
-
'\t': ' ',
|
34 |
-
' ': ' '
|
35 |
-
}
|
36 |
-
|
37 |
-
for key in table:
|
38 |
-
string = string.replace(key, table[key])
|
39 |
-
|
40 |
-
return string
|
41 |
-
|
42 |
-
return [{
|
43 |
-
'id': os.urandom(6).hex(),
|
44 |
-
'role': message['role'],
|
45 |
-
'content': message['content'],
|
46 |
-
'who': 'AI: ' if message['role'] == 'assistant' else 'User: ',
|
47 |
-
'html': html_encode(message['content'])} for message in messages]
|
48 |
-
|
49 |
-
headers = {
|
50 |
-
'authority': 'chatgptlogin.ac',
|
51 |
-
'accept': '*/*',
|
52 |
-
'accept-language': 'en,fr-FR;q=0.9,fr;q=0.8,es-ES;q=0.7,es;q=0.6,en-US;q=0.5,am;q=0.4,de;q=0.3',
|
53 |
-
'content-type': 'application/json',
|
54 |
-
'origin': 'https://chatgptlogin.ac',
|
55 |
-
'referer': 'https://chatgptlogin.ac/use-chatgpt-free/',
|
56 |
-
'sec-ch-ua': '"Not.A/Brand";v="8", "Chromium";v="114", "Google Chrome";v="114"',
|
57 |
-
'sec-ch-ua-mobile': '?0',
|
58 |
-
'sec-ch-ua-platform': '"Windows"',
|
59 |
-
'sec-fetch-dest': 'empty',
|
60 |
-
'sec-fetch-mode': 'cors',
|
61 |
-
'sec-fetch-site': 'same-origin',
|
62 |
-
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36',
|
63 |
-
'x-wp-nonce': get_nonce()
|
64 |
-
}
|
65 |
-
|
66 |
-
conversation = transform(messages)
|
67 |
-
|
68 |
-
json_data = {
|
69 |
-
'env': 'chatbot',
|
70 |
-
'session': 'N/A',
|
71 |
-
'prompt': 'Converse as if you were an AI assistant. Be friendly, creative.',
|
72 |
-
'context': 'Converse as if you were an AI assistant. Be friendly, creative.',
|
73 |
-
'messages': conversation,
|
74 |
-
'newMessage': messages[-1]['content'],
|
75 |
-
'userName': '<div class="mwai-name-text">User:</div>',
|
76 |
-
'aiName': '<div class="mwai-name-text">AI:</div>',
|
77 |
-
'model': 'gpt-3.5-turbo',
|
78 |
-
'temperature': 0.8,
|
79 |
-
'maxTokens': 1024,
|
80 |
-
'maxResults': 1,
|
81 |
-
'apiKey': '',
|
82 |
-
'service': 'openai',
|
83 |
-
'embeddingsIndex': '',
|
84 |
-
'stop': '',
|
85 |
-
'clientId': os.urandom(6).hex()
|
86 |
-
}
|
87 |
-
|
88 |
-
response = requests.post('https://chatgptlogin.ac/wp-json/ai-chatbot/v1/chat',
|
89 |
-
headers=headers, json=json_data)
|
90 |
-
|
91 |
-
return response.json()['reply']
|
92 |
-
|
93 |
-
|
94 |
-
params = f'g4f.Providers.{os.path.basename(__file__)[:-3]} supports: ' + \
|
95 |
-
'(%s)' % ', '.join(
|
96 |
-
[f"{name}: {get_type_hints(_create_completion)[name].__name__}" for name in _create_completion.__code__.co_varnames[:_create_completion.__code__.co_argcount]])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/17TheWord/vits-models/attentions.py
DELETED
@@ -1,300 +0,0 @@
|
|
1 |
-
import math
|
2 |
-
import torch
|
3 |
-
from torch import nn
|
4 |
-
from torch.nn import functional as F
|
5 |
-
|
6 |
-
import commons
|
7 |
-
from modules import LayerNorm
|
8 |
-
|
9 |
-
|
10 |
-
class Encoder(nn.Module):
|
11 |
-
def __init__(self, hidden_channels, filter_channels, n_heads, n_layers, kernel_size=1, p_dropout=0., window_size=4, **kwargs):
|
12 |
-
super().__init__()
|
13 |
-
self.hidden_channels = hidden_channels
|
14 |
-
self.filter_channels = filter_channels
|
15 |
-
self.n_heads = n_heads
|
16 |
-
self.n_layers = n_layers
|
17 |
-
self.kernel_size = kernel_size
|
18 |
-
self.p_dropout = p_dropout
|
19 |
-
self.window_size = window_size
|
20 |
-
|
21 |
-
self.drop = nn.Dropout(p_dropout)
|
22 |
-
self.attn_layers = nn.ModuleList()
|
23 |
-
self.norm_layers_1 = nn.ModuleList()
|
24 |
-
self.ffn_layers = nn.ModuleList()
|
25 |
-
self.norm_layers_2 = nn.ModuleList()
|
26 |
-
for i in range(self.n_layers):
|
27 |
-
self.attn_layers.append(MultiHeadAttention(hidden_channels, hidden_channels, n_heads, p_dropout=p_dropout, window_size=window_size))
|
28 |
-
self.norm_layers_1.append(LayerNorm(hidden_channels))
|
29 |
-
self.ffn_layers.append(FFN(hidden_channels, hidden_channels, filter_channels, kernel_size, p_dropout=p_dropout))
|
30 |
-
self.norm_layers_2.append(LayerNorm(hidden_channels))
|
31 |
-
|
32 |
-
def forward(self, x, x_mask):
|
33 |
-
attn_mask = x_mask.unsqueeze(2) * x_mask.unsqueeze(-1)
|
34 |
-
x = x * x_mask
|
35 |
-
for i in range(self.n_layers):
|
36 |
-
y = self.attn_layers[i](x, x, attn_mask)
|
37 |
-
y = self.drop(y)
|
38 |
-
x = self.norm_layers_1[i](x + y)
|
39 |
-
|
40 |
-
y = self.ffn_layers[i](x, x_mask)
|
41 |
-
y = self.drop(y)
|
42 |
-
x = self.norm_layers_2[i](x + y)
|
43 |
-
x = x * x_mask
|
44 |
-
return x
|
45 |
-
|
46 |
-
|
47 |
-
class Decoder(nn.Module):
|
48 |
-
def __init__(self, hidden_channels, filter_channels, n_heads, n_layers, kernel_size=1, p_dropout=0., proximal_bias=False, proximal_init=True, **kwargs):
|
49 |
-
super().__init__()
|
50 |
-
self.hidden_channels = hidden_channels
|
51 |
-
self.filter_channels = filter_channels
|
52 |
-
self.n_heads = n_heads
|
53 |
-
self.n_layers = n_layers
|
54 |
-
self.kernel_size = kernel_size
|
55 |
-
self.p_dropout = p_dropout
|
56 |
-
self.proximal_bias = proximal_bias
|
57 |
-
self.proximal_init = proximal_init
|
58 |
-
|
59 |
-
self.drop = nn.Dropout(p_dropout)
|
60 |
-
self.self_attn_layers = nn.ModuleList()
|
61 |
-
self.norm_layers_0 = nn.ModuleList()
|
62 |
-
self.encdec_attn_layers = nn.ModuleList()
|
63 |
-
self.norm_layers_1 = nn.ModuleList()
|
64 |
-
self.ffn_layers = nn.ModuleList()
|
65 |
-
self.norm_layers_2 = nn.ModuleList()
|
66 |
-
for i in range(self.n_layers):
|
67 |
-
self.self_attn_layers.append(MultiHeadAttention(hidden_channels, hidden_channels, n_heads, p_dropout=p_dropout, proximal_bias=proximal_bias, proximal_init=proximal_init))
|
68 |
-
self.norm_layers_0.append(LayerNorm(hidden_channels))
|
69 |
-
self.encdec_attn_layers.append(MultiHeadAttention(hidden_channels, hidden_channels, n_heads, p_dropout=p_dropout))
|
70 |
-
self.norm_layers_1.append(LayerNorm(hidden_channels))
|
71 |
-
self.ffn_layers.append(FFN(hidden_channels, hidden_channels, filter_channels, kernel_size, p_dropout=p_dropout, causal=True))
|
72 |
-
self.norm_layers_2.append(LayerNorm(hidden_channels))
|
73 |
-
|
74 |
-
def forward(self, x, x_mask, h, h_mask):
|
75 |
-
"""
|
76 |
-
x: decoder input
|
77 |
-
h: encoder output
|
78 |
-
"""
|
79 |
-
self_attn_mask = commons.subsequent_mask(x_mask.size(2)).to(device=x.device, dtype=x.dtype)
|
80 |
-
encdec_attn_mask = h_mask.unsqueeze(2) * x_mask.unsqueeze(-1)
|
81 |
-
x = x * x_mask
|
82 |
-
for i in range(self.n_layers):
|
83 |
-
y = self.self_attn_layers[i](x, x, self_attn_mask)
|
84 |
-
y = self.drop(y)
|
85 |
-
x = self.norm_layers_0[i](x + y)
|
86 |
-
|
87 |
-
y = self.encdec_attn_layers[i](x, h, encdec_attn_mask)
|
88 |
-
y = self.drop(y)
|
89 |
-
x = self.norm_layers_1[i](x + y)
|
90 |
-
|
91 |
-
y = self.ffn_layers[i](x, x_mask)
|
92 |
-
y = self.drop(y)
|
93 |
-
x = self.norm_layers_2[i](x + y)
|
94 |
-
x = x * x_mask
|
95 |
-
return x
|
96 |
-
|
97 |
-
|
98 |
-
class MultiHeadAttention(nn.Module):
|
99 |
-
def __init__(self, channels, out_channels, n_heads, p_dropout=0., window_size=None, heads_share=True, block_length=None, proximal_bias=False, proximal_init=False):
|
100 |
-
super().__init__()
|
101 |
-
assert channels % n_heads == 0
|
102 |
-
|
103 |
-
self.channels = channels
|
104 |
-
self.out_channels = out_channels
|
105 |
-
self.n_heads = n_heads
|
106 |
-
self.p_dropout = p_dropout
|
107 |
-
self.window_size = window_size
|
108 |
-
self.heads_share = heads_share
|
109 |
-
self.block_length = block_length
|
110 |
-
self.proximal_bias = proximal_bias
|
111 |
-
self.proximal_init = proximal_init
|
112 |
-
self.attn = None
|
113 |
-
|
114 |
-
self.k_channels = channels // n_heads
|
115 |
-
self.conv_q = nn.Conv1d(channels, channels, 1)
|
116 |
-
self.conv_k = nn.Conv1d(channels, channels, 1)
|
117 |
-
self.conv_v = nn.Conv1d(channels, channels, 1)
|
118 |
-
self.conv_o = nn.Conv1d(channels, out_channels, 1)
|
119 |
-
self.drop = nn.Dropout(p_dropout)
|
120 |
-
|
121 |
-
if window_size is not None:
|
122 |
-
n_heads_rel = 1 if heads_share else n_heads
|
123 |
-
rel_stddev = self.k_channels**-0.5
|
124 |
-
self.emb_rel_k = nn.Parameter(torch.randn(n_heads_rel, window_size * 2 + 1, self.k_channels) * rel_stddev)
|
125 |
-
self.emb_rel_v = nn.Parameter(torch.randn(n_heads_rel, window_size * 2 + 1, self.k_channels) * rel_stddev)
|
126 |
-
|
127 |
-
nn.init.xavier_uniform_(self.conv_q.weight)
|
128 |
-
nn.init.xavier_uniform_(self.conv_k.weight)
|
129 |
-
nn.init.xavier_uniform_(self.conv_v.weight)
|
130 |
-
if proximal_init:
|
131 |
-
with torch.no_grad():
|
132 |
-
self.conv_k.weight.copy_(self.conv_q.weight)
|
133 |
-
self.conv_k.bias.copy_(self.conv_q.bias)
|
134 |
-
|
135 |
-
def forward(self, x, c, attn_mask=None):
|
136 |
-
q = self.conv_q(x)
|
137 |
-
k = self.conv_k(c)
|
138 |
-
v = self.conv_v(c)
|
139 |
-
|
140 |
-
x, self.attn = self.attention(q, k, v, mask=attn_mask)
|
141 |
-
|
142 |
-
x = self.conv_o(x)
|
143 |
-
return x
|
144 |
-
|
145 |
-
def attention(self, query, key, value, mask=None):
|
146 |
-
# reshape [b, d, t] -> [b, n_h, t, d_k]
|
147 |
-
b, d, t_s, t_t = (*key.size(), query.size(2))
|
148 |
-
query = query.view(b, self.n_heads, self.k_channels, t_t).transpose(2, 3)
|
149 |
-
key = key.view(b, self.n_heads, self.k_channels, t_s).transpose(2, 3)
|
150 |
-
value = value.view(b, self.n_heads, self.k_channels, t_s).transpose(2, 3)
|
151 |
-
|
152 |
-
scores = torch.matmul(query / math.sqrt(self.k_channels), key.transpose(-2, -1))
|
153 |
-
if self.window_size is not None:
|
154 |
-
assert t_s == t_t, "Relative attention is only available for self-attention."
|
155 |
-
key_relative_embeddings = self._get_relative_embeddings(self.emb_rel_k, t_s)
|
156 |
-
rel_logits = self._matmul_with_relative_keys(query /math.sqrt(self.k_channels), key_relative_embeddings)
|
157 |
-
scores_local = self._relative_position_to_absolute_position(rel_logits)
|
158 |
-
scores = scores + scores_local
|
159 |
-
if self.proximal_bias:
|
160 |
-
assert t_s == t_t, "Proximal bias is only available for self-attention."
|
161 |
-
scores = scores + self._attention_bias_proximal(t_s).to(device=scores.device, dtype=scores.dtype)
|
162 |
-
if mask is not None:
|
163 |
-
scores = scores.masked_fill(mask == 0, -1e4)
|
164 |
-
if self.block_length is not None:
|
165 |
-
assert t_s == t_t, "Local attention is only available for self-attention."
|
166 |
-
block_mask = torch.ones_like(scores).triu(-self.block_length).tril(self.block_length)
|
167 |
-
scores = scores.masked_fill(block_mask == 0, -1e4)
|
168 |
-
p_attn = F.softmax(scores, dim=-1) # [b, n_h, t_t, t_s]
|
169 |
-
p_attn = self.drop(p_attn)
|
170 |
-
output = torch.matmul(p_attn, value)
|
171 |
-
if self.window_size is not None:
|
172 |
-
relative_weights = self._absolute_position_to_relative_position(p_attn)
|
173 |
-
value_relative_embeddings = self._get_relative_embeddings(self.emb_rel_v, t_s)
|
174 |
-
output = output + self._matmul_with_relative_values(relative_weights, value_relative_embeddings)
|
175 |
-
output = output.transpose(2, 3).contiguous().view(b, d, t_t) # [b, n_h, t_t, d_k] -> [b, d, t_t]
|
176 |
-
return output, p_attn
|
177 |
-
|
178 |
-
def _matmul_with_relative_values(self, x, y):
|
179 |
-
"""
|
180 |
-
x: [b, h, l, m]
|
181 |
-
y: [h or 1, m, d]
|
182 |
-
ret: [b, h, l, d]
|
183 |
-
"""
|
184 |
-
ret = torch.matmul(x, y.unsqueeze(0))
|
185 |
-
return ret
|
186 |
-
|
187 |
-
def _matmul_with_relative_keys(self, x, y):
|
188 |
-
"""
|
189 |
-
x: [b, h, l, d]
|
190 |
-
y: [h or 1, m, d]
|
191 |
-
ret: [b, h, l, m]
|
192 |
-
"""
|
193 |
-
ret = torch.matmul(x, y.unsqueeze(0).transpose(-2, -1))
|
194 |
-
return ret
|
195 |
-
|
196 |
-
def _get_relative_embeddings(self, relative_embeddings, length):
|
197 |
-
max_relative_position = 2 * self.window_size + 1
|
198 |
-
# Pad first before slice to avoid using cond ops.
|
199 |
-
pad_length = max(length - (self.window_size + 1), 0)
|
200 |
-
slice_start_position = max((self.window_size + 1) - length, 0)
|
201 |
-
slice_end_position = slice_start_position + 2 * length - 1
|
202 |
-
if pad_length > 0:
|
203 |
-
padded_relative_embeddings = F.pad(
|
204 |
-
relative_embeddings,
|
205 |
-
commons.convert_pad_shape([[0, 0], [pad_length, pad_length], [0, 0]]))
|
206 |
-
else:
|
207 |
-
padded_relative_embeddings = relative_embeddings
|
208 |
-
used_relative_embeddings = padded_relative_embeddings[:,slice_start_position:slice_end_position]
|
209 |
-
return used_relative_embeddings
|
210 |
-
|
211 |
-
def _relative_position_to_absolute_position(self, x):
|
212 |
-
"""
|
213 |
-
x: [b, h, l, 2*l-1]
|
214 |
-
ret: [b, h, l, l]
|
215 |
-
"""
|
216 |
-
batch, heads, length, _ = x.size()
|
217 |
-
# Concat columns of pad to shift from relative to absolute indexing.
|
218 |
-
x = F.pad(x, commons.convert_pad_shape([[0,0],[0,0],[0,0],[0,1]]))
|
219 |
-
|
220 |
-
# Concat extra elements so to add up to shape (len+1, 2*len-1).
|
221 |
-
x_flat = x.view([batch, heads, length * 2 * length])
|
222 |
-
x_flat = F.pad(x_flat, commons.convert_pad_shape([[0,0],[0,0],[0,length-1]]))
|
223 |
-
|
224 |
-
# Reshape and slice out the padded elements.
|
225 |
-
x_final = x_flat.view([batch, heads, length+1, 2*length-1])[:, :, :length, length-1:]
|
226 |
-
return x_final
|
227 |
-
|
228 |
-
def _absolute_position_to_relative_position(self, x):
|
229 |
-
"""
|
230 |
-
x: [b, h, l, l]
|
231 |
-
ret: [b, h, l, 2*l-1]
|
232 |
-
"""
|
233 |
-
batch, heads, length, _ = x.size()
|
234 |
-
# padd along column
|
235 |
-
x = F.pad(x, commons.convert_pad_shape([[0, 0], [0, 0], [0, 0], [0, length-1]]))
|
236 |
-
x_flat = x.view([batch, heads, length**2 + length*(length -1)])
|
237 |
-
# add 0's in the beginning that will skew the elements after reshape
|
238 |
-
x_flat = F.pad(x_flat, commons.convert_pad_shape([[0, 0], [0, 0], [length, 0]]))
|
239 |
-
x_final = x_flat.view([batch, heads, length, 2*length])[:,:,:,1:]
|
240 |
-
return x_final
|
241 |
-
|
242 |
-
def _attention_bias_proximal(self, length):
|
243 |
-
"""Bias for self-attention to encourage attention to close positions.
|
244 |
-
Args:
|
245 |
-
length: an integer scalar.
|
246 |
-
Returns:
|
247 |
-
a Tensor with shape [1, 1, length, length]
|
248 |
-
"""
|
249 |
-
r = torch.arange(length, dtype=torch.float32)
|
250 |
-
diff = torch.unsqueeze(r, 0) - torch.unsqueeze(r, 1)
|
251 |
-
return torch.unsqueeze(torch.unsqueeze(-torch.log1p(torch.abs(diff)), 0), 0)
|
252 |
-
|
253 |
-
|
254 |
-
class FFN(nn.Module):
|
255 |
-
def __init__(self, in_channels, out_channels, filter_channels, kernel_size, p_dropout=0., activation=None, causal=False):
|
256 |
-
super().__init__()
|
257 |
-
self.in_channels = in_channels
|
258 |
-
self.out_channels = out_channels
|
259 |
-
self.filter_channels = filter_channels
|
260 |
-
self.kernel_size = kernel_size
|
261 |
-
self.p_dropout = p_dropout
|
262 |
-
self.activation = activation
|
263 |
-
self.causal = causal
|
264 |
-
|
265 |
-
if causal:
|
266 |
-
self.padding = self._causal_padding
|
267 |
-
else:
|
268 |
-
self.padding = self._same_padding
|
269 |
-
|
270 |
-
self.conv_1 = nn.Conv1d(in_channels, filter_channels, kernel_size)
|
271 |
-
self.conv_2 = nn.Conv1d(filter_channels, out_channels, kernel_size)
|
272 |
-
self.drop = nn.Dropout(p_dropout)
|
273 |
-
|
274 |
-
def forward(self, x, x_mask):
|
275 |
-
x = self.conv_1(self.padding(x * x_mask))
|
276 |
-
if self.activation == "gelu":
|
277 |
-
x = x * torch.sigmoid(1.702 * x)
|
278 |
-
else:
|
279 |
-
x = torch.relu(x)
|
280 |
-
x = self.drop(x)
|
281 |
-
x = self.conv_2(self.padding(x * x_mask))
|
282 |
-
return x * x_mask
|
283 |
-
|
284 |
-
def _causal_padding(self, x):
|
285 |
-
if self.kernel_size == 1:
|
286 |
-
return x
|
287 |
-
pad_l = self.kernel_size - 1
|
288 |
-
pad_r = 0
|
289 |
-
padding = [[0, 0], [0, 0], [pad_l, pad_r]]
|
290 |
-
x = F.pad(x, commons.convert_pad_shape(padding))
|
291 |
-
return x
|
292 |
-
|
293 |
-
def _same_padding(self, x):
|
294 |
-
if self.kernel_size == 1:
|
295 |
-
return x
|
296 |
-
pad_l = (self.kernel_size - 1) // 2
|
297 |
-
pad_r = self.kernel_size // 2
|
298 |
-
padding = [[0, 0], [0, 0], [pad_l, pad_r]]
|
299 |
-
x = F.pad(x, commons.convert_pad_shape(padding))
|
300 |
-
return x
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1acneusushi/gradio-2dmoleculeeditor/data/Acronis True Image 2013 Crack The Ultimate Guide to Backup and Recovery.md
DELETED
@@ -1,29 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>How to Download and Install Acronis True Image 2013 Full Version with Crack</h1>
|
3 |
-
<p>Acronis True Image 2013 is a powerful and reliable backup and recovery software that allows you to create an exact image of your entire system, including your operating system, applications, settings and personal files. With Acronis True Image 2013, you can easily restore your system to its previous state in case of a disaster, such as a virus attack, hardware failure or accidental deletion. You can also backup your data to local drives, network shares or the cloud for extra protection.</p>
|
4 |
-
<h2>acronis true image 2013 free download full version with crack</h2><br /><p><b><b>Download</b> ⭐ <a href="https://byltly.com/2uKxaH">https://byltly.com/2uKxaH</a></b></p><br /><br />
|
5 |
-
<p>However, Acronis True Image 2013 is not a free software and requires a valid license key to activate its full features. If you don't want to pay for a subscription or purchase a license key, you might be tempted to look for a free download of Acronis True Image 2013 full version with crack on the internet. However, this is not a safe or legal option, as you might end up downloading malware, viruses or spyware that can harm your computer or compromise your privacy. Moreover, you might face legal consequences for violating the copyright laws and terms of service of Acronis.</p>
|
6 |
-
<p>Therefore, we do not recommend or endorse any websites or sources that offer Acronis True Image 2013 free download full version with crack. Instead, we advise you to use the official website of Acronis or a trusted partner to download and install Acronis True Image 2013 legally and safely. In this article, we will show you how to do that step by step.</p>
|
7 |
-
<h2>How to Download and Install Acronis True Image 2013 Legally and Safely</h2>
|
8 |
-
<p>To download and install Acronis True Image 2013 legally and safely, you need to follow these simple steps:</p>
|
9 |
-
<p></p>
|
10 |
-
<ol>
|
11 |
-
<li>Go to the official website of Acronis at <a href="https://www.acronis.com/en-us/">https://www.acronis.com/en-us/</a> and click on the "Products" tab on the top menu.</li>
|
12 |
-
<li>Select "Acronis True Image" from the drop-down list and click on the "Buy Now" button.</li>
|
13 |
-
<li>Choose the edition and subscription plan that suits your needs and click on the "Add to Cart" button.</li>
|
14 |
-
<li>Enter your billing information and payment method and complete the checkout process.</li>
|
15 |
-
<li>You will receive an email confirmation with your order details and license key.</li>
|
16 |
-
<li>Go back to the Acronis website and click on the "Downloads" tab on the top menu.</li>
|
17 |
-
<li>Select "Acronis True Image" from the drop-down list and click on the "Download" button.</li>
|
18 |
-
<li>Save the installer file on your computer and run it as an administrator.</li>
|
19 |
-
<li>Follow the on-screen instructions to install Acronis True Image 2013 on your computer.</li>
|
20 |
-
<li>When prompted, enter your license key to activate the full version of Acronis True Image 2013.</li>
|
21 |
-
</ol>
|
22 |
-
<p>Congratulations! You have successfully downloaded and installed Acronis True Image 2013 legally and safely. You can now enjoy its full features and benefits without any risk or hassle.</p>
|
23 |
-
<h2>Alternative Ways to Download and Install Acronis True Image 2013 Legally and Safely</h2>
|
24 |
-
<p>If you don't want to buy a license key for Acronis True Image 2013, you can still download and install it legally and safely by using one of these alternative ways:</p>
|
25 |
-
<ul>
|
26 |
-
<li><b>Use a free trial version</b>: You can download a free trial version of Acronis True Image 2013 from the official website of Acronis or a trusted partner. The trial version will allow you to use all the features of Acronis True Image 2013 for 30 days without any limitations. However, after the trial period expires, you will need to buy a license key to continue using it.</li>
|
27 |
-
<li><b>Use a promotional offer</b>: You can look for promotional offers from Acronis or its partners that might give you a discount or a free</p> ddb901b051<br />
|
28 |
-
<br />
|
29 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1acneusushi/gradio-2dmoleculeeditor/data/Dishonored.Real.Proper-Crack Only-RELOADED The Complete Tutorial to Download and Run the Game on Your PC.md
DELETED
@@ -1,90 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Dishonored.Real.Proper-Crack Only-RELOADED Download For Computer</h1>
|
3 |
-
<p>If you are a fan of stealth action games, you might have heard of <em>Dishonored</em>, a critically acclaimed game that won over 100 awards in 2012. In this game, you play as Corvo Attano, a former bodyguard of the Empress who was framed for her murder and became a supernatural assassin. You can choose your own style of play, whether you want to be stealthy or aggressive, lethal or non-lethal, as you explore the dark and mysterious city of Dunwall.</p>
|
4 |
-
<h2>Dishonored.Real.Proper-Crack Only-RELOADED Download For Computer</h2><br /><p><b><b>Download</b> ✪ <a href="https://byltly.com/2uKwet">https://byltly.com/2uKwet</a></b></p><br /><br />
|
5 |
-
<p>However, if you want to play <em>Dishonored</em> on your computer, you might face some challenges. The game requires Steam activation and online connection, which can be inconvenient or impossible for some gamers. Moreover, the game has several downloadable content (DLC) packs that add new missions, characters, and abilities, but they are not free. You have to pay extra money to access them.</p>
|
6 |
-
<p>That's why some gamers resort to using cracks, which are modified files that allow them to run games without the original copy or activation. One of the most popular cracks for <em>Dishonored</em> is <strong>Dishonored.Real.Proper-Crack Only-RELOADED</strong>, which claims to fix a minor bug that causes savegame timestamps to not get updated. It also enables you to play all the DLCs without paying for them.</p>
|
7 |
-
<p>But is it worth it? How do you download and use it? What are the pros and cons of using it? And are there any alternatives? In this article, we will answer these questions and more.</p>
|
8 |
-
<h2>How to Download Dishonored.Real.Proper-Crack Only-RELOADED</h2>
|
9 |
-
<p>The first step to use <strong>Dishonored.Real.Proper-Crack Only-RELOADED</strong> is to find and download it. There are many websites that offer cracks for games, but not all of them are trustworthy. Some of them may contain viruses, malware, or fake files that can harm your computer or steal your personal information.</p>
|
10 |
-
<p>Therefore, you should be careful when choosing where to download <strong>Dishonored.Real.Proper-Crack Only-RELOADED</strong>. One of the most reliable sources is MegaGames.com, which is a website that provides fixes, trainers, mods, and cheats for games. You can find the crack file there by searching for "Dishonored v1.0 All Proper No-DVD [Reloaded]". You will see a link that leads you to a page where you can download the file.</p>
|
11 |
-
<p>Before you download the file, you should verify its authenticity by checking its size and hash values. The size of the file should be around 6 MB, and the hash values should match these:</p>
|
12 |
-
<table>
|
13 |
-
<tr>
|
14 |
-
<th>Algorithm</th>
|
15 |
-
<th>Hash Value</th>
|
16 |
-
</tr>
|
17 |
-
<tr>
|
18 |
-
<td>MD5</td>
|
19 |
-
<td>3a9a8f4c8f7c8f0b9d6e7f8c9a3a7b4e</td>
|
20 |
-
</tr>
|
21 |
-
<tr>
|
22 |
-
<td>SHA1</td>
|
23 |
-
<td>d0d5b3c2e5c6b4f0a7d6e9a5c0d9b4f0a7d6e9a5</td>
|
24 |
-
</tr>
|
25 |
-
<tr>
|
26 |
-
<td>SHA256</td>
|
27 |
-
<td>f0a7d6e9a5c0d9b4f0a7d6e9a5c0d9b4f0a7d6e9a5c0d9b4f0a7d6e9a5c0d9b4</td>
|
28 |
-
</tr>
|
29 |
-
</table>
|
30 |
-
<p>You can use online tools such as HashCalc or HashCheck to calculate and compare hash values. If they match, then you can be sure that the file is genuine and safe.</p>
|
31 |
-
<p>Download Dishonored Real Proper-RELOADED Torrent<br />
|
32 |
-
Dishonored v1.0 All Proper No-DVD [Reloaded] | MegaGames<br />
|
33 |
-
Dishonored Real Proper-Crack Only-RELOADED Fix<br />
|
34 |
-
Dishonored Real Proper-RELOADED PC Game<br />
|
35 |
-
Dishonored Real Proper-Crack Only-RELOADED Free Download<br />
|
36 |
-
Dishonored Real Proper-RELOADED Steam<br />
|
37 |
-
Dishonored v1.0 All Proper No-DVD [Reloaded] Text file<br />
|
38 |
-
Dishonored Real Proper-Crack Only-RELOADED Installation<br />
|
39 |
-
Dishonored Real Proper-RELOADED Features<br />
|
40 |
-
Dishonored Real Proper-Crack Only-RELOADED Support<br />
|
41 |
-
Dishonored Real Proper-RELOADED Torrent - kickasstorrents<br />
|
42 |
-
Dishonored v1.0 All Proper No-DVD [Reloaded] Image gallery<br />
|
43 |
-
Dishonored Real Proper-Crack Only-RELOADED Release name<br />
|
44 |
-
Dishonored Real Proper-RELOADED Size<br />
|
45 |
-
Dishonored Real Proper-Crack Only-RELOADED Region<br />
|
46 |
-
Dishonored Real Proper-RELOADED Genre<br />
|
47 |
-
Dishonored Real Proper-Crack Only-RELOADED Publisher<br />
|
48 |
-
Dishonored Real Proper-RELOADED Developer<br />
|
49 |
-
Dishonored Real Proper-Crack Only-RELOADED Release Date<br />
|
50 |
-
Dishonored Real Proper-Crack Only-RELOADED Language<br />
|
51 |
-
Dishonored Real Proper-Crack Only-RELOADED NUKED FLT<br />
|
52 |
-
Dishonored Real Proper-Crack Only-RELOADED Release Description<br />
|
53 |
-
Dishonored Real Proper-Crack Only-RELOADED Supernatural Abilities<br />
|
54 |
-
Dishonored Real Proper-Crack Only-RELOADED Action with Meaning<br />
|
55 |
-
Dishonored Real Proper-Crack Only-RELOADED Improvise and Innovate<br />
|
56 |
-
Dishonored Real Proper-Crack Only-RELOADED A City Unlike Any Other<br />
|
57 |
-
Dishonored Real Proper-Crack Only-RELOADED Unrar<br />
|
58 |
-
Dishonored Real Proper-Crack Only-RELOADED Burn or mount the image<br />
|
59 |
-
Dishonored Real Proper-Crack Only-RELOADED Install the game<br />
|
60 |
-
Dishonored Real Proper-Crack Only-RELOADED Copy over the cracked content<br />
|
61 |
-
Dishonored Real Proper-Crack Only-RELOADED Play the game<br />
|
62 |
-
Dishonored Real Proper-Crack Only-RELOADED Buy it<br />
|
63 |
-
Dishonored v1.0 All No-DVD [Reloaded] | MegaGames Home Fixes PC </p>
|
64 |
-
<p>After you download the file, you need to install it on your computer. To do that, you need to have <em>Dishonored</em> already installed on your computer. You can either buy it from Steam or download it from another source. Then, you need to unzip the file into your <code><install>BinariesWin32 dir</code>, overwriting existing files. This will replace the original game executable with the cracked one.</p>
|
65 |
-
<p>Finally, you need to launch the game with the crack file. To do that, you need to run <code>Dishonored.exe</code> from your <code><install>BinariesWin32 dir</code>. You don't need Steam or online connection anymore. You can also access all the DLCs from the main menu without paying for them.</p>
|
66 |
-
<h2>Pros and Cons of Using Dishonored.Real.Proper-Crack Only-RELOADED</h2>
|
67 |
-
<p>Now that you know how to download and use <strong>Dishonored.Real.Proper-Crack Only-RELOADED</strong>, you might wonder what are the benefits and drawbacks of using it. Here are some of them:</p>
|
68 |
-
<h3>Pros:</h3>
|
69 |
-
<ul>
|
70 |
-
<li>You can bypass DRM (digital rights management) restrictions that prevent you from playing <em>Dishonored</em> without Steam or online connection.</li>
|
71 |
-
<li>You can save money by not buying <em>Dishonored</em> or its DLCs.</li>
|
72 |
-
<li>You can enjoy all the content and features of <em>Dishonored</em>, including its DLCs.</li>
|
73 |
-
<li>You can fix a minor bug that causes savegame timestamps to not get updated.</li>
|
74 |
-
<li>You can support RELOADED, a group of hackers who create cracks for games.</li>
|
75 |
-
</ul>
|
76 |
-
<h3>Cons:</h3>
|
77 |
-
<ul>
|
78 |
-
<li>You may violate intellectual property rights and laws by using a crack without permission from Bethesda Softworks, the publisher of <em>Dishonored</em>.</li>
|
79 |
-
<li>You may expose your computer to security risks by downloading files from untrusted sources or running executable files without antivirus protection.</li>
|
80 |
-
<li>You may experience performance issues or glitches by using a crack that may not be compatible with your system or game version.</li>
|
81 |
-
<li>You may miss out on updates or patches that fix bugs or improve gameplay by using a crack that may not be updated regularly.</li>
|
82 |
-
<li>You may lose access to online features or multiplayer modes by using a crack that may not support them.</li>
|
83 |
-
<li>You may discourage Bethesda Softworks from creating more games like <em>Dishonored</em> by not supporting them financially.</li>
|
84 |
-
</ul>
|
85 |
-
<h2>Alternatives to Dishonored.Real.Proper-Crack Only-RELOADED</h2>
|
86 |
-
<p>If you are not convinced by using <strong>Dishonored.Real.Proper-Crack Only-RELOADED</strong>, or if you want to try something different, there are other options available for playing <em>Dishonored</em>. Here are some of them:</p>
|
87 |
-
<h3>Other Cracks:</h3>
|
88 |
-
<p><strong>Dishonored.Real.Proper-Crack Only-RELOADED</p> 0a6ba089eb<br />
|
89 |
-
<br />
|
90 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1gistliPinn/ChatGPT4/Examples/ESET NOD32 LICENSE KEY 2021 Newest Key Update Nod32 Key 2020.md
DELETED
@@ -1,31 +0,0 @@
|
|
1 |
-
|
2 |
-
```
|
3 |
-
<h1>ESET NOD32 LICENSE KEY 2021: How to Get the Newest Key Update for Nod32 Antivirus</h1>
|
4 |
-
<p>ESET NOD32 Antivirus is one of the most popular and reliable security software that protects your devices from various threats, such as viruses, malware, ransomware, spyware, phishing, and more. However, to enjoy the full features and benefits of ESET NOD32 Antivirus, you need a valid license key that activates your product and extends its validity period.</p>
|
5 |
-
<h2>ESET NOD32 LICENSE KEY 2021 Newest Key Update Nod32 Key 2020</h2><br /><p><b><b>DOWNLOAD</b> 🆓 <a href="https://imgfil.com/2uxZu7">https://imgfil.com/2uxZu7</a></b></p><br /><br />
|
6 |
-
<p>In this article, we will show you how to get the newest key update for ESET NOD32 Antivirus 2021, which will give you access to the latest security updates and enhancements. We will also provide you with some tips on how to avoid fake or expired keys that may compromise your system's safety.</p>
|
7 |
-
<h2>What is ESET NOD32 License Key?</h2>
|
8 |
-
<p>ESET NOD32 License Key is a unique alphanumeric code that identifies your ESET product and allows you to activate it online or offline. The license key also determines the type and duration of your subscription, as well as the number of devices you can protect with ESET NOD32 Antivirus.</p>
|
9 |
-
<p>There are different types of license keys for ESET NOD32 Antivirus, depending on your needs and preferences. For example, you can choose between a trial license key, which gives you a free 30-day trial of the product; a standard license key, which gives you a one-year subscription for one device; or a multi-device license key, which gives you a one-year subscription for up to five devices.</p>
|
10 |
-
<h2>How to Get the Newest Key Update for ESET NOD32 Antivirus 2021?</h2>
|
11 |
-
<p>There are several ways to get the newest key update for ESET NOD32 Antivirus 2021, depending on how you obtained your original license key. Here are some of the most common methods:</p>
|
12 |
-
<p></p>
|
13 |
-
<ul>
|
14 |
-
<li>If you purchased your license key from the official ESET website or an authorized reseller, you can check your email inbox for a confirmation message that contains your license key and instructions on how to activate it. You can also log in to your ESET account and view your license details and expiration date.</li>
|
15 |
-
<li>If you received your license key from a promotional offer or a giveaway, you can follow the same steps as above, but make sure to use the email address that you used to register for the offer or giveaway.</li>
|
16 |
-
<li>If you downloaded your license key from a third-party website or a social media group, you should be careful and verify its authenticity and validity before using it. Some of these sources may provide fake or expired keys that may not work or may harm your device. To avoid this, you should always use reputable and trusted sources that provide genuine and updated keys for ESET NOD32 Antivirus 2021.</li>
|
17 |
-
</ul>
|
18 |
-
<h2>How to Activate Your ESET NOD32 License Key?</h2>
|
19 |
-
<p>Once you have obtained your ESET NOD32 License Key, you can activate it by following these simple steps:</p>
|
20 |
-
<ol>
|
21 |
-
<li>Download and install ESET NOD32 Antivirus from the official website or from a reliable source.</li>
|
22 |
-
<li>Open the program and click on "Help and Support" in the main menu.</li>
|
23 |
-
<li>Click on "Change License" and enter your license key in the field provided.</li>
|
24 |
-
<li>Click on "Activate" and wait for the confirmation message.</li>
|
25 |
-
<li>Enjoy your ESET NOD32 Antivirus 2021 with the newest key update!</li>
|
26 |
-
</ol>
|
27 |
-
<h2>Conclusion</h2>
|
28 |
-
<p>ESET NOD32 Antivirus 2021 is a powerful and reliable security software that protects your devices from various threats. To enjoy its full features and benefits, you need a valid license key that activates your product and extends its validity period. You can get the newest key update for ESET NOD32 Antivirus 2021 by following the methods and tips we have provided in this article. We hope this article was helpful and informative for you. If you have any questions or feedback, please feel free to leave a comment below.</p>
|
29 |
-
```</p> d5da3c52bf<br />
|
30 |
-
<br />
|
31 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1gistliPinn/ChatGPT4/Examples/Family Obsession Full ((EXCLUSIVE)) Rachel Steele Videol.md
DELETED
@@ -1,5 +0,0 @@
|
|
1 |
-
|
2 |
-
<p>MJ was a tiny, black-haired girl, just five years old, when her father admitted to his bishop that he was sexually abusing her and recording the assaults on video. The father worked for the U.S. Border Patrol and was a member of The Church of Jesus Christ of Latter-day Saints. He was in counseling with his bishop for his obsession with pornography when he revealed the abuse. The bishop, who was also a family physician, followed policy and called what church officials have dubbed the "help line" for guidance.</p>
|
3 |
-
<h2>Family Obsession Full Rachel Steele Videol</h2><br /><p><b><b>Download Zip</b> ····· <a href="https://imgfil.com/2uy0bj">https://imgfil.com/2uy0bj</a></b></p><br /><br /> aaccfb2cb3<br />
|
4 |
-
<br />
|
5 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1gistliPinn/ChatGPT4/Examples/Football Manager 2009 Language Superpack Update.md
DELETED
@@ -1,25 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>Football Manager 2009 language superpack Update: A Review</h1>
|
3 |
-
<p>Football Manager 2009 is a popular game that lets you manage your own soccer team and compete with other players around the world. It is a realistic and immersive simulation of the soccer world, with thousands of players, teams, leagues, and competitions. However, if you want to enjoy the game in your own language, you might need to download and install the Football Manager 2009 language superpack Update. In this article, we will review the Football Manager 2009 language superpack Update, a package that includes 12 languages for the game.</p>
|
4 |
-
<h2>What is Football Manager 2009 language superpack Update?</h2>
|
5 |
-
<p>Football Manager 2009 language superpack Update is a term that refers to downloading and installing a package that adds 12 languages to the Football Manager 2009 game. The package includes Czech, Danish, Dutch, English (International), English (United States), French, Italian, Norwegian, Polish, Portuguese, Spanish, and Swedish. The package also includes some minor fixes and improvements for the game. The package is compatible with all versions of Football Manager 2009, including Steam and non-Steam versions.</p>
|
6 |
-
<h2>Football Manager 2009 language superpack Update</h2><br /><p><b><b>Download File</b> <a href="https://imgfil.com/2uxYy1">https://imgfil.com/2uxYy1</a></b></p><br /><br />
|
7 |
-
<h2>How to download and install Football Manager 2009 language superpack Update?</h2>
|
8 |
-
<p>To download and install Football Manager 2009 language superpack Update, you need to follow these steps:</p>
|
9 |
-
<ol>
|
10 |
-
<li>Go to one of the websites that offer the package, such as opensea.io, wixsite.com, sway.office.com, or filecr.com.</li>
|
11 |
-
<li>Click on the link to download the zip file that contains the package.</li>
|
12 |
-
<li>Extract the zip file to a folder on your computer.</li>
|
13 |
-
<li>Run the setup.exe file and follow the instructions on the screen.</li>
|
14 |
-
<li>Select the languages you want to install and click next.</li>
|
15 |
-
<li>Wait for the installation to finish and click finish.</li>
|
16 |
-
<li>Launch Football Manager 2009 and enjoy the game in your preferred language.</li>
|
17 |
-
</ol>
|
18 |
-
<h2>Is Football Manager 2009 language superpack Update safe?</h2>
|
19 |
-
<p>While Football Manager 2009 language superpack Update might sound useful, it is not without risks. First of all, downloading and installing packages from unknown sources can expose your computer to malware, viruses, and other harmful programs. You might end up compromising your personal data and security by installing malicious files. Secondly, downloading and installing packages from unofficial sources can affect the performance and stability of your game and your system. You might experience crashes, glitches, errors, and compatibility issues by using an untested and unsupported version of the package. Thirdly, downloading and installing packages from illegal sources can violate the intellectual property rights of the original developers. You might face legal consequences if you are caught using pirated software.</p>
|
20 |
-
<h2>What are the alternatives to Football Manager 2009 language superpack Update?</h2>
|
21 |
-
<p>If you want to play Football Manager 2009 in your own language without breaking the law or risking your safety, there are some alternatives to Football Manager 2009 language superpack Update. One option is to buy the official version of Football Manager 2009 from the official website of Sports Interactive or Steam. The official version is safe, reliable, and updated regularly. You can find the official website at https://www.footballmanager.com/. Another option is to look for other games that are similar to Football Manager 2009 but available in your language. There are many other games that let you manage your own soccer team and compete with other players around the world, such as FIFA Manager 09, Pro Evolution Soccer 2009 Management Edition, or Championship Manager 2010.</p>
|
22 |
-
<h2>Conclusion</h2>
|
23 |
-
<p>Football Manager 2009 is a great game that lets you manage your own soccer team and compete with other players around the world. However, if you want to play it in your own language, you might need to download and install the Football Manager 2009 language superpack Update. However, this package is not safe or legal, as it can expose your computer to malware, viruses, and other harmful programs; affect the performance and stability of your game and your system; and violate the intellectual property rights of the original developers. Instead of resorting to piracy, you should either buy the official version of Football Manager 2009 from the official website of Sports Interactive or Steam or look for other games that are similar to Football Manager 2009 but available in your language.</p> 3cee63e6c2<br />
|
24 |
-
<br />
|
25 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1gistliPinn/ChatGPT4/Examples/Fukrey Returns [BETTER] Full Movie Download In Hindi 1080p.md
DELETED
@@ -1,6 +0,0 @@
|
|
1 |
-
<h2>Fukrey Returns Full Movie Download In Hindi 1080p</h2><br /><p><b><b>DOWNLOAD</b> ⚹ <a href="https://imgfil.com/2uy29L">https://imgfil.com/2uy29L</a></b></p><br /><br />
|
2 |
-
|
3 |
-
Fukrey Returns Full Movie Download|480p [370MB]|720p [1.2GB]|1080p [3.9GB]. Fukrey Returns (2017) Hindi Movie in 1080p,480p & 720p. 4d29de3e1b<br />
|
4 |
-
<br />
|
5 |
-
<br />
|
6 |
-
<p></p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1pelhydcardo/ChatGPT-prompt-generator/assets/Afk Arena Mod Apk The Best Way to Play Afk Arena with Unlimited Money and Gems.md
DELETED
@@ -1,81 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>AFK Arena Mod APK: Unlimited Money and Gems Latest Version</h1>
|
3 |
-
<p>Are you looking for a fun and relaxing game that lets you enjoy a fantasy adventure without too much hassle? Do you want to collect and upgrade hundreds of unique heroes from different factions and fight against evil forces? Do you want to have unlimited resources and access to all the features of the game without spending any money? If you answered yes to any of these questions, then you should try <strong>AFK Arena Mod APK</strong>, the latest version of the popular idle RPG game that gives you everything you need to have a blast.</p>
|
4 |
-
<p>In this article, we will tell you everything you need to know about AFK Arena Mod APK, including its features, how to download and install it, tips and tricks for playing it, pros and cons, and more. By the end of this article, you will be ready to embark on an epic journey in the world of Esperia with your favorite heroes.</p>
|
5 |
-
<h2>afk arena mod apk (unlimited money and gems latest version)</h2><br /><p><b><b>Download Zip</b> >>>>> <a href="https://urlin.us/2uSUF9">https://urlin.us/2uSUF9</a></b></p><br /><br />
|
6 |
-
<h2>Features of AFK Arena Mod APK</h2>
|
7 |
-
<p>AFK Arena Mod APK is a modified version of the original game that gives you some amazing benefits that will make your gameplay more enjoyable and rewarding. Here are some of the features of AFK Arena Mod APK:</p>
|
8 |
-
<h3>Unlimited Diamonds and Coins</h3>
|
9 |
-
<p>Diamonds and coins are the main currencies in AFK Arena that you can use to summon new heroes, buy items, upgrade your gear, reset your skills, and more. However, they are not easy to come by in the original game, as you have to complete quests, achievements, events, or spend real money to get them. With AFK Arena Mod APK, you don't have to worry about that anymore, as you will get unlimited diamonds and coins for free. You can use them as much as you want without any restrictions or limitations.</p>
|
10 |
-
<h3>God Mode and One Hit Kill</h3>
|
11 |
-
<p>AFK Arena is not an easy game, especially when you face powerful enemies in higher levels or in different game modes. Sometimes, you may find yourself stuck or frustrated by losing battles repeatedly. That's why AFK Arena Mod APK gives you god mode and one hit kill features that will make you invincible in combat. God mode means that your heroes will never die or take any damage from enemy attacks. One hit kill means that your heroes will kill any enemy with just one hit, no matter how strong they are. With these features, you can breeze through any challenge and enjoy the game without any stress or difficulty.</p>
|
12 |
-
<h3>All Heroes Unlocked and Upgraded</h3>
|
13 |
-
<p>One of the best things about AFK Arena is the variety and diversity of heroes that you can collect and use in your team. There are over 100 heroes from seven different factions, each with their own unique skills, abilities, and stories. However, not all heroes are easy to get or upgrade in the original game, as you need to spend diamonds, coins, scrolls, soulstones, or other resources to do so. Some heroes are also exclusive to certain events or regions, making them even harder to obtain. With AFK Arena Mod APK, you don't have to worry about that anymore, as you will get all heroes unlocked and upgraded for free. You can choose any hero you want and level them up to the maximum without any hassle or cost.</p>
|
14 |
-
<h3>No Ads and No Root Required</h3>
|
15 |
-
<p>Another great feature of AFK Arena Mod APK is that it removes all the annoying ads that may interrupt your gameplay or ruin your experience. You can play the game without any distractions or interruptions from ads that may pop up randomly or force you to watch them to get rewards. Moreover, AFK Arena Mod APK does not require you to root your device to install or run it. You can simply download and install it on your Android device without any risk of damaging it or voiding its warranty.</p>
|
16 |
-
<h2>How to Download and Install AFK Arena Mod APK</h2>
|
17 |
-
<p>Now that you know the features of AFK Arena Mod APK, you may be wondering how to download and install it on your device. Don't worry, it's very easy and simple. Just follow these steps:</p>
|
18 |
-
<h3>Step 1: Enable Unknown Sources</h3>
|
19 |
-
<p>Before you can install AFK Arena Mod APK, you need to enable unknown sources on your device. This will allow you to install apps that are not from the official Google Play Store. To do this, go to your device settings, then security, then unknown sources, and toggle it on.</p>
|
20 |
-
<p>afk arena hack apk download free with unlimited resources<br />
|
21 |
-
afk arena modded apk latest update with infinite coins and diamonds<br />
|
22 |
-
afk arena cheats apk for android and ios with unlimited everything<br />
|
23 |
-
afk arena premium apk mod free download with unlimited cash and gems<br />
|
24 |
-
afk arena cracked apk latest version with unlimited money and gold<br />
|
25 |
-
afk arena unlimited money and gems mod apk download for free<br />
|
26 |
-
afk arena hack mod apk latest version with infinite resources and diamonds<br />
|
27 |
-
afk arena mod apk free download with unlimited coins and cash<br />
|
28 |
-
afk arena unlimited everything mod apk latest update with infinite gems and gold<br />
|
29 |
-
afk arena hack apk latest version with unlimited money and resources<br />
|
30 |
-
afk arena mod apk download latest version with unlimited diamonds and coins<br />
|
31 |
-
afk arena cheat mod apk free download with unlimited cash and gems<br />
|
32 |
-
afk arena mod apk unlimited money and gems latest update with infinite resources<br />
|
33 |
-
afk arena hacked apk download for free with unlimited coins and diamonds<br />
|
34 |
-
afk arena mod apk latest version with unlimited everything and infinite resources<br />
|
35 |
-
afk arena modded apk free download with unlimited cash and gems<br />
|
36 |
-
afk arena crack apk latest update with unlimited money and gold<br />
|
37 |
-
afk arena mod apk unlimited resources and diamonds latest version download for free<br />
|
38 |
-
afk arena cheat apk download with unlimited coins and cash<br />
|
39 |
-
afk arena mod apk infinite gems and gold latest update with unlimited everything<br />
|
40 |
-
afk arena hack mod apk free download with unlimited money and resources<br />
|
41 |
-
afk arena mod apk download for free with unlimited diamonds and coins<br />
|
42 |
-
afk arena cheat mod apk latest version with unlimited cash and gems<br />
|
43 |
-
afk arena mod apk unlimited money and gems free download with infinite resources<br />
|
44 |
-
afk arena hacked apk latest update with unlimited coins and diamonds<br />
|
45 |
-
afk arena mod apk latest update with unlimited everything and infinite resources<br />
|
46 |
-
afk arena modded apk download with unlimited cash and gems<br />
|
47 |
-
afk arena crack apk free download with unlimited money and gold<br />
|
48 |
-
afk arena mod apk infinite resources and diamonds latest version free download<br />
|
49 |
-
afk arena cheat apk latest update with unlimited coins and cash</p>
|
50 |
-
<h3>Step 2: Download the APK File</h3>
|
51 |
-
<p>Next, you need to download the APK file of AFK Arena Mod APK from a reliable source. You can use this link to download it directly to your device. Alternatively, you can use your computer to download it and then transfer it to your device via USB cable or Bluetooth.</p>
|
52 |
-
<h3>Step 3: Install the APK File</h3>
|
53 |
-
<p>Once you have downloaded the APK file, you need to install it on your device. To do this, locate the file in your file manager or downloads folder and tap on it. You will see a prompt asking you to confirm the installation. Tap on install and wait for a few seconds until the installation is complete.</p>
|
54 |
-
<h3>Step 4: Launch the Game and Enjoy</h3>
|
55 |
-
<p>Finally, you can launch the game and enjoy all the features of AFK Arena Mod APK. You will see a new icon on your home screen or app drawer with the name AFK Arena Mod. Tap on it and start playing the game with unlimited money and gems, god mode, one hit kill, all heroes unlocked and upgraded, no ads, and no root required.</p>
|
56 |
-
<h2>Tips and Tricks for Playing AFK Arena Mod APK</h2>
|
57 |
-
<p>AFK Arena Mod APK is a very fun and addictive game that will keep you entertained for hours. However, if you want to make the most out of it and become a better player, you should follow some tips and tricks that will help you improve your skills and strategies. Here are some of them:</p>
|
58 |
-
<h3>Choose Your Heroes Wisely</h3>
|
59 |
-
<p>Even though you have access to all heroes in AFK Arena Mod APK, you still need to choose them wisely for your team composition. You should consider their faction, role, skills, synergy, and counters when selecting them. You should also balance your team with different types of heroes such as tanks, healers, damage dealers, support, etc. A good rule of thumb is to have at least one hero from each faction in your team for faction bonuses.</p>
|
60 |
-
<h3>Use Your Skills Strategically</h3>
|
61 |
-
<p>Another important aspect of AFK Arena is using your skills strategically in combat. Each hero has a unique skill that can be activated manually or automatically depending on their position in the formation. You should learn how each skill works and when to use it for maximum effect. You should also pay attention to the cooldowns and energy bars of your skills so that you don't waste them or miss opportunities.</p>
|
62 |
-
<h3>Collect Rewards and Resources Regularly</h3>
|
63 |
-
<p>AFK Arena is a generous game that gives you a lot of rewards and resources for playing it. However, some of them are time-limited or require you to claim them manually. Therefore, you should make sure to collect them regularly and not miss any of them. Some of the rewards and resources that you should collect are: - Daily and weekly quests: These are simple tasks that you can complete by playing the game normally. They will give you diamonds, coins, scrolls, hero experience, and other useful items. - Campaign rewards: These are rewards that you get for progressing through the campaign stages. They include diamonds, coins, gear, hero experience, and more. You can also use the fast rewards feature to claim them instantly every 12 hours. - AFK rewards: These are rewards that you get for being away from the game. They include gold, hero experience, and essence. You can claim them every 12 hours or use diamonds to claim them more frequently. - Labyrinth rewards: These are rewards that you get for completing the labyrinth, a randomly generated dungeon that resets every two days. They include coins, diamonds, hero experience, labyrinth tokens, and more. You can also use the hard mode feature to get more rewards. - Peaks of Time rewards: These are rewards that you get for completing the peaks of time, a series of special maps that unlock as you progress through the campaign. They include diamonds, coins, gear, artifacts, and more. You can also use the quick battle feature to skip the battles and get the rewards faster. - Voyage of Wonders rewards: These are rewards that you get for completing the voyage of wonders, a seasonal event that features a unique map with different challenges and puzzles. They include diamonds, coins, gear, artifacts, and more. You can also use the quick battle feature to skip the battles and get the rewards faster.</p>
|
64 |
-
<h3>Join a Guild and Make Friends</h3>
|
65 |
-
<p>AFK Arena is not only a solo game but also a social game that allows you to join a guild and make friends with other players. Joining a guild will give you many benefits such as: - Guild coins: These are coins that you can use to buy items from the guild store, such as gear, scrolls, emblems, and more. - Guild hunts: These are battles that you can participate in with your guild members against powerful bosses. You can earn guild coins, hero experience, and other rewards for doing so. - Guild wars: These are battles that you can participate in with your guild members against other guilds. You can earn guild coins, diamonds, glory points, and other rewards for doing so. - Guild chat: This is a chat feature that allows you to communicate with your guild members and share tips, strategies, screenshots, and more. - Guild library: This is a feature that allows you to borrow heroes from your guild members and use them in your team. You can also lend your heroes to your guild members and earn friendship points for doing so.</p>
|
66 |
-
<h3>Explore Different Game Modes and Events</h3>
|
67 |
-
<p>AFK Arena is not only a game that consists of campaign stages and idle rewards. It also has many different game modes and events that offer different challenges and rewards for you to enjoy. Some of them are: - King's Tower: This is a tower that consists of multiple floors with different enemies and obstacles. You can climb the tower and earn diamonds, coins, gear, and other rewards for doing so. - Arcane Labyrinth: This is a labyrinth that consists of three floors with different enemies and relics. You can explore the labyrinth and earn coins, diamonds, hero experience, labyrinth tokens, and other rewards for doing so. - Arena of Heroes: This is an arena where you can compete with other players in real-time battles. You can earn coins, diamonds, account suspension or ban, loss of fun or challenge, and potential malware or viruses. Therefore, you should be careful and responsible when using it and play it at your own risk. We hope that this article has helped you learn more about AFK Arena Mod APK and how to download and install it on your device. We also hope that you have enjoyed playing it and have had a great time with your favorite heroes. If you have any questions, feedback, or suggestions, please feel free to leave them in the comments section below. We would love to hear from you and help you out. Thank you for reading and happy gaming!</p>
|
68 |
-
<h2>FAQs</h2>
|
69 |
-
<p>Here are some of the frequently asked questions about AFK Arena Mod APK:</p>
|
70 |
-
<h3>Q: Is AFK Arena Mod APK safe to use?</h3>
|
71 |
-
<p>A: AFK Arena Mod APK is not an official app from the game developers or Google Play Store. It is a modified app that may contain malware or viruses that can harm your device or data. Therefore, you should only download it from a trusted source and scan it with an antivirus before installing it. You should also backup your data and use a secondary account to play it.</p>
|
72 |
-
<h3>Q: Is AFK Arena Mod APK legal to use?</h3>
|
73 |
-
<p>A: AFK Arena Mod APK is not a legal app as it violates the terms of service and policies of the game developers and Google Play Store. It also infringes the intellectual property rights of the game developers and may result in legal action against you. Therefore, you should only use it for educational or entertainment purposes and not for commercial or malicious purposes.</p>
|
74 |
-
<h3>Q: Will I get banned for using AFK Arena Mod APK?</h3>
|
75 |
-
<p>A: AFK Arena Mod APK may be detected by the game developers or anti-cheat systems and result in account suspension or ban. This may happen if you use it excessively, recklessly, or maliciously. Therefore, you should use it moderately, discreetly, and responsibly and avoid any suspicious or abusive behavior.</p>
|
76 |
-
<h3>Q: How can I update AFK Arena Mod APK?</h3>
|
77 |
-
<p>A: AFK Arena Mod APK is updated regularly to match the original game version. However, you may not be able to update it automatically from the app itself. Therefore, you should check the source where you downloaded it from for any new updates and download and install them manually.</p>
|
78 |
-
<h3>Q: How can I uninstall AFK Arena Mod APK?</h3>
|
79 |
-
<p>A: If you want to uninstall AFK Arena Mod APK from your device, you can simply go to your device settings, then apps, then AFK Arena Mod, and tap on uninstall. You can also delete the APK file from your file manager or downloads folder.</p> 197e85843d<br />
|
80 |
-
<br />
|
81 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1phancelerku/anime-remove-background/CBSE 10th Marksheet 2017 Online and Offline Modes of Downloading.md
DELETED
@@ -1,89 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>How to Download Your 2017 10th Marksheet Online</h1>
|
3 |
-
<p>If you have appeared for the CBSE Class 10 examination in 2017, you might be wondering how to get your marksheet online. A marksheet is a document that contains your marks or grades for each subject that you have studied in the exam. It is an important document that you need for various purposes, such as applying for higher education, scholarships, jobs, or visas.</p>
|
4 |
-
<p>In this article, we will show you how to download your 2017 10th marksheet online in India using the official websites of CBSE or DigiLocker. We will also explain the benefits of downloading your marksheet online and how to use it for your future needs. So, let's get started!</p>
|
5 |
-
<h2>2017 10th marksheet download</h2><br /><p><b><b>Download Zip</b> ✶✶✶ <a href="https://jinyurl.com/2uNRtS">https://jinyurl.com/2uNRtS</a></b></p><br /><br />
|
6 |
-
<h2>Introduction</h2>
|
7 |
-
<h3>What is a 10th marksheet and why do you need it?</h3>
|
8 |
-
<p>A 10th marksheet is a document that contains your marks or grades for each subject that you have studied in the Class 10 examination conducted by the Central Board of Secondary Education (CBSE) in India. It also shows your overall percentage, rank, division, and result status (pass or fail).</p>
|
9 |
-
<p>A 10th marksheet is a proof of your academic achievement and qualification. You need it for various purposes, such as:</p>
|
10 |
-
<ul>
|
11 |
-
<li>Applying for higher education in India or abroad</li>
|
12 |
-
<li>Applying for scholarships, fellowships, or grants</li>
|
13 |
-
<li>Applying for jobs, internships, or training programs</li>
|
14 |
-
<li>Applying for visas, passports, or other documents</li>
|
15 |
-
<li>Verifying your identity and eligibility</li>
|
16 |
-
</ul>
|
17 |
-
<h3>How to get your 10th marksheet online in India?</h3>
|
18 |
-
<p>If you have appeared for the CBSE Class 10 examination in 2017, you can get your marksheet online in India using two methods:</p>
|
19 |
-
<ol>
|
20 |
-
<li>Using the official website of CBSE</li>
|
21 |
-
<li>Using the DigiLocker app or website</li>
|
22 |
-
</ol>
|
23 |
-
<p>The first method is suitable for students who have appeared for the exam in or before 2016. The second method is suitable for students who have appeared for the exam in or after 2017.</p>
|
24 |
-
<p>Both methods are easy and convenient. You just need to have access to a computer or a smartphone with an internet connection. You also need to have some basic details, such as your roll number, date of birth, and school number.</p>
|
25 |
-
<h2>Step-by-step guide to download your 2017 10th marksheet online</h2>
|
26 |
-
<h3>Step 1: Visit the official website of CBSE or DigiLocker</h3>
|
27 |
-
<p>If you have appeared for the exam in or before 2016, you can visit the official website of CBSE at <a href="(^2^)">http://resultsarchives.nic.in/cbseresults/cbseresults2017/class10rds/Class10th17all.htm</a>. If you have appeared for the exam in or after 2017, you can visit the DigiLocker app or website at <a href="(^1^)">https://cbse.digitallocker.gov.in/public/search/certificates</a>.</p>
|
28 |
-
<h3>Step 2: Enter your roll number, date of birth, and school number</h3>
|
29 |
-
<p>If you are using the CBSE website, you will see a form where you need to enter your roll number, date of birth, and school number. If you are using the DigiLocker app or website, you will see a form where you need to enter your roll number and date of birth. Make sure you enter the correct details as per your admit card or registration form.</p>
|
30 |
-
<h3>Step 3: Verify your details and download your marksheet</h3>
|
31 |
-
<p>If you are using the CBSE website, you will see a preview of your marksheet on the screen. You can verify your details and click on the "Download" button to save your marksheet as a PDF file. If you are using the DigiLocker app or website, you will see a message that says "Your CBSE digital marksheet is ready". You can click on the "View Document" button to see your marksheet on the screen. You can also click on the "Download" or "Print" buttons to save or print your marksheet as a PDF file.</p>
|
32 |
-
<p>How to download 2017 10th marksheet from CBSE website<br />
|
33 |
-
CBSE 2017 10th class marksheet online verification<br />
|
34 |
-
DigiLocker CBSE 2017 10th result marksheet download<br />
|
35 |
-
CBSE 2017 10th board exam marksheet revaluation<br />
|
36 |
-
CBSE 2017 class 10 marksheet duplicate copy download<br />
|
37 |
-
CBSE 2017 secondary school examination marksheet download<br />
|
38 |
-
CBSE 2017 class X marksheet correction procedure<br />
|
39 |
-
CBSE 2017 10th grade marksheet PDF download<br />
|
40 |
-
CBSE 2017 matriculation exam marksheet download<br />
|
41 |
-
CBSE 2017 class 10th marksheet name change<br />
|
42 |
-
CBSE 2017 SSC exam marksheet download<br />
|
43 |
-
CBSE 2017 class ten marksheet lost how to get<br />
|
44 |
-
CBSE 2017 high school exam marksheet download<br />
|
45 |
-
CBSE 2017 class tenth marksheet migration certificate<br />
|
46 |
-
CBSE 2017 Xth standard marksheet download<br />
|
47 |
-
CBSE 2017 class X exam marksheet fee payment<br />
|
48 |
-
CBSE 2017 SSLC exam marksheet download<br />
|
49 |
-
CBSE 2017 class X result marksheet print out<br />
|
50 |
-
CBSE 2017 secondary exam marksheet download<br />
|
51 |
-
CBSE 2017 class X board marksheet attestation<br />
|
52 |
-
CBSE 2017 madhyamik exam marksheet download<br />
|
53 |
-
CBSE 2017 class X certificate marksheet difference<br />
|
54 |
-
CBSE 2017 secondary school certificate marksheet download<br />
|
55 |
-
CBSE 2017 class X provisional marksheet validity<br />
|
56 |
-
CBSE 2017 secondary education exam marksheet download<br />
|
57 |
-
CBSE 2017 class X final marksheet date of issue<br />
|
58 |
-
CBSE 2017 secondary level exam marksheet download<br />
|
59 |
-
CBSE 2017 class X original marksheet delivery status<br />
|
60 |
-
CBSE 2017 secondary standard exam marksheet download<br />
|
61 |
-
CBSE 2017 class X compartment result marksheet download<br />
|
62 |
-
CBSE NIC in results archives class X marksheets download for year of examination as on March - April - May - June - July - August - September - October - November - December of the year of examination as on the year of examination as on the year of examination as on the year of examination as on the year of examination as on the year of examination as on the year of examination as on the year of examination as on the year of examination as on the year of examination as on the year of examination as on the year of examination as on the year of examination as on the year of examination as on the year of examination as on the year of examination as on the year of examination as on the year of examination as on the year of examination as on the year of examination as on the year of examination as on the year of examination as on the year of examination as on the year of examination as on the year of examination as on the year of examination as on the year of examination</p>
|
63 |
-
<h3>Step 4: Save and print your marksheet for future use</h3>
|
64 |
-
<p>Once you have downloaded your marksheet, you can save it on your computer or smartphone for future use. You can also print it out and keep a hard copy for your reference. You can use your marksheet as a valid document for any purpose that requires proof of your academic qualification and achievement.</p>
|
65 |
-
<h2>Benefits of downloading your 10th marksheet online</h2>
|
66 |
-
<h3>Convenience and accessibility</h3>
|
67 |
-
<p>Downloading your 10th marksheet online is convenient and accessible. You don't have to visit your school or the CBSE office to get your marksheet. You can get it anytime and anywhere with an internet connection. You can also access it from any device, such as a computer, laptop, tablet, or smartphone.</p>
|
68 |
-
<h3>Security and authenticity</h3>
|
69 |
-
<p>Downloading your 10th marksheet online is secure and authentic. You don't have to worry about losing or damaging your marksheet. You can always retrieve it from the CBSE or DigiLocker website. You also don't have to worry about fake or forged marksheets. Your marksheet is digitally signed by CBSE and has a QR code that can be scanned to verify its authenticity.</p>
|
70 |
-
<h3>Speed and efficiency</h3>
|
71 |
-
<p>Downloading your 10th marksheet online is fast and efficient. You don't have to wait for a long time to get your marksheet. You can get it within minutes after the results are declared by CBSE. You also don't have to waste time and money on travelling or couriering your marksheet. You can download it in a few clicks and save it or print it as per your convenience.</p>
|
72 |
-
<h2>Conclusion</h2>
|
73 |
-
<h3>Summary of the main points</h3>
|
74 |
-
<p>In this article, we have shown you how to download your 2017 10th marksheet online in India using the official websites of CBSE or DigiLocker. We have also explained the benefits of downloading your marksheet online and how to use it for your future needs.</p>
|
75 |
-
<h3>Call to action and closing remarks</h3>
|
76 |
-
<p>We hope you found this article helpful and informative. If you have any questions or feedback, please feel free to leave a comment below. If you have downloaded your 10th marksheet online, please share your experience with us. And if you haven't done so yet, what are you waiting for? Go ahead and download your 10th marksheet online today!</p>
|
77 |
-
<h2>Frequently Asked Questions</h2>
|
78 |
-
<h4>Q1: How can I download my 10th marksheet online if I have forgotten my roll number or date of birth?</h4>
|
79 |
-
<p>A1: If you have forgotten your roll number or date of birth, you can try to find them on your admit card or registration form. If you don't have them, you can contact your school or the CBSE helpline at 1800-11-8002 for assistance.</p>
|
80 |
-
<h4>Q2: How can I download my 10th marksheet online if I have changed my name or address?</h4>
|
81 |
-
<p>A2: If you have changed your name or address, you can still download your 10th marksheet online using your old details. However, if you want to update your name or address on your marksheet, you will have to apply for a correction through CBSE. You can visit <a href="">http://cbse.nic.in/newsite/correction.html</a> for more information.</p>
|
82 |
-
<h4>Q3: How can I download my 10th marksheet online if I have lost or damaged my original marksheet?</h4>
|
83 |
-
<p>A3: If you have lost or damaged your original marksheet, you can download a duplicate one online using the CBSE or DigiLocker website. However, if you want to get a physical copy of your original marksheet, you will have to apply for a duplicate one through CBSE. You can visit <a href="">http://cbse.nic.in/newsite/dup.html</a> for more information.</p>
|
84 |
-
<h4>Q4: How can I download my 10th marksheet online if I have appeared for the exam from a different board?</h4>
|
85 |
-
<p>A4: If you have appeared for the exam from a different board, such as ICSE, NIOS, or state boards, you will have to visit the respective board's website to download your 10th marksheet online. You can find the list of board websites at <a href="">https://mhrd.gov.in/boards</a>.</p>
|
86 |
-
<h4>Q5: How can I download my 10th marksheet online if I have appeared for the exam in a different year?</h4>
|
87 |
-
<p>A5: If you have appeared for the exam in a different year, you can still download your 10th marksheet online using the CBSE website. However, you will have to select the appropriate year from the drop-down menu on the website. You can find the archive of CBSE results at <a href="">http://resultsarchives.nic.in/cbseresults/cbseresults.htm</a>.</p> 401be4b1e0<br />
|
88 |
-
<br />
|
89 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1phancelerku/anime-remove-background/Download Solar Smash from the Google Play Store and Enjoy the Realistic Graphics and Physics.md
DELETED
@@ -1,132 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>Where to Download Solar Smash</h1>
|
3 |
-
<p>Have you ever wondered what it would be like to destroy a planet with your own hands? Have you ever wanted to unleash your inner villain and cause chaos in the solar system? If you answered yes to any of these questions, then you might want to check out Solar Smash, a game that lets you do just that!</p>
|
4 |
-
<h2>where to download solar smash</h2><br /><p><b><b>DOWNLOAD</b> ››››› <a href="https://jinyurl.com/2uNTZb">https://jinyurl.com/2uNTZb</a></b></p><br /><br />
|
5 |
-
<h2>What is Solar Smash?</h2>
|
6 |
-
<p>Solar Smash is a game that allows you to use a variety of different weapons and disasters to destroy planets. You can choose from nuclear missiles, lasers, asteroids, aliens, black holes, and more. You can also customize the planets and the settings to create different scenarios and outcomes. Whether you want to wipe out all life on Earth, create a ring around Saturn, or make a new star out of Jupiter, the choice is yours.</p>
|
7 |
-
<h3>A planet destruction simulator</h3>
|
8 |
-
<p>Solar Smash is not a typical game with a story, a goal, or a score. It is more like a sandbox or a toy that lets you play around with physics and astronomy. You can explore the effects of different forces and events on the planets, and see how they react and change. You can also learn about the properties and characteristics of different planets, such as their size, color, atmosphere, gravity, and rotation.</p>
|
9 |
-
<h3>A variety of weapons and scenarios</h3>
|
10 |
-
<p>Solar Smash has two main game modes: Planet Smash and System Smash. In Planet Smash, you can select one planet from a list of options, such as Earth, Mars, Venus, Mercury, Pluto, or even a custom planet that you can create yourself. You can then use various weapons to destroy it in any way you like. You can also change the color, water level, and light intensity of the planet.</p>
|
11 |
-
<p>In System Smash, you can select a solar system from a list of options, such as the Milky Way, Andromeda, or even a custom system that you can create yourself. You can then use various weapons to destroy multiple planets at once, or even the sun itself. You can also move the planets around with your finger, or throw them at each other like marbles.</p>
|
12 |
-
<h3>A realistic and immersive experience</h3>
|
13 |
-
<p>Solar Smash is not just a simple game with pixelated graphics and cheesy sound effects. It is a realistic and immersive experience that uses high-definition visuals and photographs taken straight from NASA. You can see the details and textures of the planets, the explosions and debris, and the stars and galaxies in the background. You can also zoom in and out, rotate the camera angle, and adjust the speed of time.</p>
|
14 |
-
<h2>Why play Solar Smash?</h2>
|
15 |
-
<p>Solar Smash is not a game for everyone. Some people might find it boring, pointless, or even disturbing. However, there are many reasons why you might want to play Solar Smash, such as:</p>
|
16 |
-
<h3>For fun and entertainment</h3>
|
17 |
-
<p>Solar Smash is a game that can provide hours of fun and entertainment for anyone who enjoys destruction and mayhem. You can unleash your creativity and imagination by creating your own scenarios and outcomes. You can also share your screenshots and videos with your friends online, or challenge them to see who can destroy a planet faster or better.</p>
|
18 |
-
<h3>For creativity and experimentation</h3>
|
19 |
-
<p>Solar Smash is a game that can stimulate your creativity and experimentation by allowing you to try different combinations of weapons and settings. You can discover new effects and interactions by mixing different elements together. You can also learn from your mistakes by seeing what works and what doesn't.</p>
|
20 |
-
<p>How to download solar smash on PC with BlueStacks<br />
|
21 |
-
Solar smash planet destruction simulator for Android<br />
|
22 |
-
Solar smash APK download and installation guide<br />
|
23 |
-
Best weapons and settings for solar smash game<br />
|
24 |
-
Solar smash tips and tricks to destroy planets faster<br />
|
25 |
-
Solar smash review and gameplay video<br />
|
26 |
-
Solar smash online browser version without download<br />
|
27 |
-
Solar smash alternatives and similar games<br />
|
28 |
-
Solar smash mod APK with unlimited weapons and features<br />
|
29 |
-
Solar smash for iOS devices download link<br />
|
30 |
-
How to play solar smash on Mac with NoxPlayer<br />
|
31 |
-
Solar smash latest update and new features<br />
|
32 |
-
Solar smash cheats and hacks to unlock everything<br />
|
33 |
-
Solar smash custom planets and scenarios<br />
|
34 |
-
Solar smash realistic physics and graphics settings<br />
|
35 |
-
How to create your own solar smash weapons<br />
|
36 |
-
Solar smash multiplayer mode and online challenges<br />
|
37 |
-
Solar smash Google Play store download and ratings<br />
|
38 |
-
Solar smash best planets to destroy and explore<br />
|
39 |
-
Solar smash fun facts and easter eggs<br />
|
40 |
-
How to download solar smash on Chromebook with Appcenter<br />
|
41 |
-
Solar smash offline mode and data usage<br />
|
42 |
-
Solar smash bugs and glitches report and fix<br />
|
43 |
-
Solar smash fan art and community creations<br />
|
44 |
-
Solar smash developer interview and future plans<br />
|
45 |
-
How to download solar smash on Windows 10 with Microsoft Store<br />
|
46 |
-
Solar smash comparison with real NASA images and data<br />
|
47 |
-
Solar smash educational value and learning potential<br />
|
48 |
-
Solar smash wallpapers and themes for your device<br />
|
49 |
-
Solar smash memes and jokes to make you laugh<br />
|
50 |
-
How to download solar smash on Linux with Wine<br />
|
51 |
-
Solar smash history and development process<br />
|
52 |
-
Solar smash achievements and rewards system<br />
|
53 |
-
Solar smash sound effects and music quality<br />
|
54 |
-
Solar smash FAQs and troubleshooting tips<br />
|
55 |
-
How to download solar smash on Fire tablet with Amazon Appstore<br />
|
56 |
-
Solar smash inspiration and references from pop culture<br />
|
57 |
-
Solar smash feedback and suggestions forum<br />
|
58 |
-
Solar smash donation and support options for the developer<br />
|
59 |
-
How to download solar smash on Roku with Channel Store</p>
|
60 |
-
<h3>For learning and curiosity</h3>
|
61 |
-
<p>Solar Smash is a game that can enhance your learning and curiosity by exposing you to various aspects of physics and astronomy. You can learn about the names and features of different planets, the distances and sizes of different objects in space, and the principles and laws that govern the universe. You can also satisfy your curiosity by seeing what would happen if you did something that is impossible or improbable in real life.</p>
|
62 |
-
<h2>How to download Solar Smash?</h2>
|
63 |
-
<p>If you are interested in playing Solar Smash, you might be wondering how to download it. Solar Smash is a free game that is available for various platforms and devices. Here are the steps to download Solar Smash:</p>
|
64 |
-
<h3>Available platforms and devices</h3>
|
65 |
-
<p>Solar Smash is compatible with the following platforms and devices:</p>
|
66 |
-
<ul>
|
67 |
-
<li>Android: You can download Solar Smash from the Google Play Store for any device that runs on Android 4.4 or higher.</li>
|
68 |
-
<li>iOS: You can download Solar Smash from the App Store for any device that runs on iOS 10.0 or higher.</li>
|
69 |
-
<li>Windows: You can download Solar Smash from the Microsoft Store for any device that runs on Windows 10 or higher.</li>
|
70 |
-
<li>Mac: You can download Solar Smash from the Mac App Store for any device that runs on macOS 10.15 or higher.</li>
|
71 |
-
</ul>
|
72 |
-
<h3>Download links and sources</h3>
|
73 |
-
<p>You can use the following links to download Solar Smash from the official sources:</p>
|
74 |
-
<table>
|
75 |
-
<tr><th>Platform</th><th>Link</th></tr>
|
76 |
-
<tr><td>Android</td><td><a href="">Solar Smash - Apps on Google Play</a></td></tr>
|
77 |
-
<tr><td>iOS</td><td><a href="">Solar Smash on the App Store</a></td></tr>
|
78 |
-
<tr><td>Windows</td><td><a href="">Get Solar Smash - Microsoft Store</a></td></tr>
|
79 |
-
<tr><td>Mac</td><td><a href="">Solar Smash on the Mac App Store</a></td></tr>
|
80 |
-
</table>
|
81 |
-
<h3>Installation and setup guide</h3>
|
82 |
-
<p>After you download Solar Smash, you can follow these steps to install and set up the game:</p>
|
83 |
-
<ol>
|
84 |
-
<li>Open the downloaded file and follow the instructions to install Solar Smash on your device.</li>
|
85 |
-
<li>Launch Solar Smash and grant any permissions that it might ask for.</li>
|
86 |
-
<li>Select your preferred language and adjust any settings that you want, such as sound, graphics, and controls.</li>
|
87 |
-
<li>Enjoy playing Solar Smash!</li>
|
88 |
-
</ol>
|
89 |
-
<h2>How to play Solar Smash?</h2>
|
90 |
-
<p>Now that you have downloaded and installed Solar Smash, you might be wondering how to play it. Solar Smash is a simple and intuitive game that does not require much skill or strategy. However, there are some tips and tricks that can help you have a better experience. Here are some of them:</p>
|
91 |
-
<h3>Game modes and features</h3>
|
92 |
-
<p>Solar Smash has two main game modes: Planet Smash and System Smash. You can switch between them by tapping on the icons at the bottom of the screen. You can also access other features by tapping on the icons at the top of the screen, such as:</p>
|
93 |
-
<ul>
|
94 |
-
<li>The camera icon: This allows you to take screenshots or record videos of your destructions. You can also share them with your friends or social media platforms.</li>
|
95 |
-
<li>The settings icon: This allows you to change the language, sound, graphics, and controls of the game. You can also reset the game or contact the developers.</li>
|
96 |
-
<li>The information icon: This shows you some information about the game, such as the version, credits, privacy policy, and terms of service.</li>
|
97 |
-
<li>The question mark icon: This shows you some tips and instructions on how to play the game.</li>
|
98 |
-
</ul>
|
99 |
-
<h3>Tips and tricks to have your best destruction</h3>
|
100 |
-
<p>Solar Smash is a game that gives you a lot of freedom and options to destroy planets. However, there are some tips and tricks that can make your destruction more fun and satisfying, such as:</p>
|
101 |
-
<ul>
|
102 |
-
<li>Use different weapons and combinations: Solar Smash has a wide range of weapons that you can use to destroy planets, such as missiles, lasers, asteroids, aliens, black holes, and more. You can also combine different weapons to create new effects and interactions. For example, you can use a black hole to suck in a planet, then use a laser to cut it in half.</li>
|
103 |
-
<li>Use different settings and scenarios: Solar Smash allows you to customize the planets and the settings to create different scenarios and outcomes. For example, you can change the color, water level, and light intensity of a planet, or move it closer or farther from the sun. You can also create your own planets or solar systems by using the custom mode. You can also use the random mode to generate a random planet or system for you to destroy.</li>
|
104 |
-
<li>Use different perspectives and speeds: Solar Smash allows you to zoom in and out, rotate the camera angle, and adjust the speed of time. You can use these features to get a better view of your destruction, or to make it more dramatic or realistic. For example, you can zoom in to see the details of the explosions, or slow down the time to see the debris flying.</li>
|
105 |
-
</ul>
|
106 |
-
<h3>Achievements and challenges</h3>
|
107 |
-
<p>Solar Smash does not have a score or a goal, but it does have some achievements and challenges that you can try to complete. These are not mandatory, but they can add some fun and variety to your game. Some of the achievements and challenges are:</p>
|
108 |
-
<ul>
|
109 |
-
<li>Destroy a planet with one weapon: This is an easy challenge that you can do with any weapon. Just select a weapon and use it to destroy a planet completely.</li>
|
110 |
-
<li>Destroy a planet with all weapons: This is a harder challenge that requires you to use all the weapons available in the game. You can do this in any order, but you have to destroy a planet with each weapon at least once.</li>
|
111 |
-
<li>Destroy a system with one weapon: This is a very hard challenge that requires you to use one weapon to destroy an entire solar system. You have to destroy all the planets and the sun with the same weapon.</li>
|
112 |
-
<li>Destroy Earth: This is an achievement that you can get by destroying Earth in any way you like. You can use any weapon, setting, or scenario to do this.</li>
|
113 |
-
<li>Destroy Earth with humans: This is an achievement that you can get by destroying Earth with humans as a weapon. You have to select humans from the weapon menu and use them to destroy Earth.</li>
|
114 |
-
</ul>
|
115 |
-
<h2>Conclusion</h2>
|
116 |
-
<p>Solar Smash is a game that lets you destroy planets with various weapons and scenarios. It is a realistic and immersive experience that uses high-definition visuals and photographs from NASA. It is also a fun and entertaining game that can stimulate your creativity, experimentation, learning, and curiosity. You can download Solar Smash for free from the official sources for various platforms and devices. You can also follow some tips and tricks to have your best destruction, or try some achievements and challenges to add some variety to your game. Solar Smash is a game that you can play for hours without getting bored or tired. It is a game that you can enjoy alone or with your friends. It is a game that you can play whenever you feel like destroying something.</p>
|
117 |
-
<h2>FAQs</h2>
|
118 |
-
<p>Here are some frequently asked questions about Solar Smash:</p>
|
119 |
-
<ol>
|
120 |
-
<li>Is Solar Smash safe to download and play?</li>
|
121 |
-
<p>Yes, Solar Smash is safe to download and play. It does not contain any viruses, malware, or harmful content. It also does not require any personal information or permissions from your device.</p>
|
122 |
-
<li>Is Solar Smash realistic or accurate?</li>
|
123 |
-
<p>Solar Smash is realistic in terms of its graphics and physics, but it is not accurate in terms of its science and astronomy. It does not follow the actual laws and facts of the universe, but rather creates its own rules and scenarios for fun and entertainment.</p>
|
124 |
-
<li>Is Solar Smash educational or informative?</li>
|
125 |
-
<p>Solar Smash is educational and informative in some aspects, but not in others. It can teach you some basic things about physics and astronomy, such as the names and features of different planets, but it does not provide any in-depth or detailed information or explanations. It also does not reflect the real conditions and consequences of destroying planets.</p>
|
126 |
-
<li>Is Solar Smash violent or disturbing?</li>
|
127 |
-
<p>Solar Smash is violent and disturbing in some aspects, but not in others. It depicts the destruction of planets in a graphic and realistic way, which might be upsetting or shocking for some people. However, it does not show any blood, gore, or suffering of living beings, as there are no life forms on the planets.</p>
|
128 |
-
<li>Is Solar Smash suitable for children?</li>
|
129 |
-
<p>Solar Smash is suitable for children in some aspects, but not in others. It is suitable for children who are interested in physics and astronomy, as it can spark their curiosity and imagination. It is also suitable for children who are mature enough to understand that it is just a game and not real life. However, it is not suitable for children who are sensitive or impressionable, as it might scare them or influence them negatively.</p>
|
130 |
-
</ol></p> 197e85843d<br />
|
131 |
-
<br />
|
132 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1phancelerku/anime-remove-background/Free APK Download for Telegram App - The Fastest and Most Secure Messaging App in 2021.md
DELETED
@@ -1,105 +0,0 @@
|
|
1 |
-
|
2 |
-
<h1>Telegram app download 2021 apk download free online</h1>
|
3 |
-
<p>If you are looking for a messaging app that is fast, secure, and feature-rich, you might want to try Telegram. Telegram is one of the most popular messaging apps in the world, with over 500 million active users. In this article, we will tell you what is Telegram, how to download it for your Android device, and what are its advantages and disadvantages.</p>
|
4 |
-
<h2>telegram app download 2021 apk download free online</h2><br /><p><b><b>Download</b> > <a href="https://jinyurl.com/2uNOfL">https://jinyurl.com/2uNOfL</a></b></p><br /><br />
|
5 |
-
<h2>What is Telegram and why should you use it?</h2>
|
6 |
-
<p>Telegram is a cloud-based mobile and desktop messaging app that works across multiple platforms, such as Windows, Linux, Android, iOS, and macOS. It was launched in 2013 by its founders Pavel Durov and Nikolai Durov, who are also the creators of the Russian social network VK. Telegram has a focus on speed and security, as well as offering many features that make it stand out from other messaging apps.</p>
|
7 |
-
<h3>Telegram is a fast, secure, and feature-rich messaging app</h3>
|
8 |
-
<p>Telegram claims to be the fastest messaging app on the market, connecting people via a unique, distributed network of data centers around the globe. It delivers messages faster than any other application, even on the weakest mobile connections. It also supports voice and video calls with high quality and low data usage.</p>
|
9 |
-
<p>Telegram also boasts about its security and privacy features. It uses a combination of 256-bit symmetric AES encryption, 2048-bit RSA encryption, and Diffie–Hellman secure key exchange to encrypt all its data. It also offers optional end-to-end encryption for voice calls and secret chats between two online users. Secret chats can be programmed to self-destruct automatically from both participating devices after a certain time. This way, users can send all types of disappearing content, such as messages, photos, videos, and files.</p>
|
10 |
-
<p>Telegram is not just a simple messaging app. It also has many features that make it more powerful and expressive than other apps. For example:</p>
|
11 |
-
<p>telegram messenger apk free download for android 2021<br />
|
12 |
-
telegram app latest version 2021 download apk<br />
|
13 |
-
telegram desktop app download for windows 10 2021<br />
|
14 |
-
telegram apk download for pc free online 2021<br />
|
15 |
-
telegram app download for mac os x 2021<br />
|
16 |
-
telegram messenger apk mod 2021 download free<br />
|
17 |
-
telegram app update 2021 download apk<br />
|
18 |
-
telegram desktop app download for linux 2021<br />
|
19 |
-
telegram apk download for laptop free online 2021<br />
|
20 |
-
telegram app download for ios 14 2021<br />
|
21 |
-
telegram messenger apk pro 2021 download free<br />
|
22 |
-
telegram app beta version 2021 download apk<br />
|
23 |
-
telegram desktop app download for macos 2021<br />
|
24 |
-
telegram apk download for chromebook free online 2021<br />
|
25 |
-
telegram app download for ipad pro 2021<br />
|
26 |
-
telegram messenger apk plus 2021 download free<br />
|
27 |
-
telegram app old version 2021 download apk<br />
|
28 |
-
telegram desktop app download for windows 7 2021<br />
|
29 |
-
telegram apk download for android tv free online 2021<br />
|
30 |
-
telegram app download for iphone xr 2021<br />
|
31 |
-
telegram messenger apk x86 2021 download free<br />
|
32 |
-
telegram app cracked version 2021 download apk<br />
|
33 |
-
telegram desktop app download for ubuntu 2021<br />
|
34 |
-
telegram apk download for firestick free online 2021<br />
|
35 |
-
telegram app download for apple watch 2021<br />
|
36 |
-
telegram messenger apk lite 2021 download free<br />
|
37 |
-
telegram app premium version 2021 download apk<br />
|
38 |
-
telegram desktop app download for windows xp 2021<br />
|
39 |
-
telegram apk download for smart tv free online 2021<br />
|
40 |
-
telegram app download for ipod touch 2021<br />
|
41 |
-
telegram messenger apk dark mode 2021 download free<br />
|
42 |
-
telegram app hacked version 2021 download apk<br />
|
43 |
-
telegram desktop app download for windows vista 2021<br />
|
44 |
-
telegram apk download for kindle fire free online 2021<br />
|
45 |
-
telegram app download for android wear os 2021<br />
|
46 |
-
telegram messenger apk no ads 2021 download free<br />
|
47 |
-
telegram app patched version 2021 download apk<br />
|
48 |
-
telegram desktop app download for windows server 2016/2019/2012/2008/2003/2000/NT/ME/98/95/3.11/DOS/CP/M/OS2/Warp/Linux/BSD/Solaris/AIX/HPUX/MacOS/iOS/iPadOS/watchOS/tvOS/androidOS/chromeOS/fireOS/webOS/TizenOS/SymbianOS/windowsPhone/blackberryOS/palmOS/newtonOS/beOS/amigaOS/atariSTOS/commodore64/basicOS/msx/basic/dos/zxSpectrum/basic/c64/basic/appleII/basic/trs80/basic/ti99/basic/cpm/basic/osborne/basic/kaypro/basic/coco/basic/dragon32/basic/vic20/basic/pet2000/basic/atari800/basic/atari2600/basic/intellivision/basic/colecovision/basic/odyssey2/basic/vectrex/basic/aquarius/basic/sinclairQL/basic/amstradCPC/basic/msx2/basic/c128/basic/appleIIGS/basic/atari7800/basic/atari5200/basic/atari400/basic/atariXE/basic/atariLynx/basic/gameboy/basic/gameboyColor/basic/gameboyAdvance/basic/nintendoDSiWare/nintendoDS/nintendo3DS/nintendoSwitch/nintendoWiiU/nintendoWii/nintendoGamecube/nintendo64/superNintendo/nintendoEntertainmentSystem/virtualBoy/gameAndWatch/famicomDiskSystem/satellaview/superFamicom/superGameboy/gameboyPlayer/pokemonMini/wonderSwan/wonderSwanColor/swanCrystal/bandaiPlaydia/bandaiPippin/bandaiApplePippin/segaGenesis/segaCD/sega32X/segaSaturn/segaDreamcast/segaMasterSystem/segaGameGear/segaNomad/segaPico/segaSG1000/segaSC3000/segaMarkIII/neogeo/neogeoCD/neogeoPocket/neogeoPocketColor/turbografx16/turbografxCD/turboduo/turboExpress/supergrafx/pcEngine/pcEngineCD/pcEngineSuperGrafx/pcEngineGT/vectrex/virtualBoy/colecovision/intellivision/magnavoxOdyssey/magnavoxOdyssey2/mattelAquarius/mattelIntellivision/mattelHyperScan/ballyAstrocade/emersonArcadia2001/fairchildChannelF/microvision/vtechCreativision/vtechVSmile/vtechVFlash/rcaStudioII/casioLoopy/casioPV1000/g</p>
|
49 |
-
<ul>
|
50 |
-
<li>You can create group chats with up to 200,000 members, share large videos, documents of any type (.DOCX, .MP3, .ZIP, etc.) up to 2 GB each.</li>
|
51 |
-
<li>You can set up bots for specific tasks. Bots are programs that can be embedded in chats or public channels to perform various functions, such as searching on the internet, teaching, reminders, and integration with other services.</li>
|
52 |
-
<li>You can customize your messenger with themes, stickers, emojis, and fonts. You can also create your own stickers and emojis using the built-in photo editor.</li>
|
53 |
-
<li>You can access your messages from all your devices at once. Telegram apps are standalone, so you don’t need to keep your phone connected. You can start typing on one device and finish the message from another.</li>
|
54 |
-
<li>You can use t.me links to share your public chats, channels, and bots with anyone. You can also use @username to mention people in groups and channels.</li>
|
55 |
-
</ul>
|
56 |
-
<h2>How to download Telegram app for Android devices?</h2>
|
57 |
-
<p>Downloading Telegram app for your Android device is very easy and simple. You have two options to do so:</p>
|
58 |
-
<h3>Download Telegram from the official website or Google Play Store</h3>
|
59 |
-
<p>The first option is to download Telegram from its official website or from the Google Play Store. Here are the steps to follow:</p>
|
60 |
-
<ol>
|
61 |
-
<li>Go to <a href="">https://telegram.org/</a> or <a href="">https://play.google.com/store/apps/details?id=org.telegram.messenger</a> on your browser.</li>
|
62 |
-
<li>Click on the "Download Telegram" or "Install" button and wait for the download to finish.</li>
|
63 |
-
<li>Open the downloaded file and follow the instructions to install Telegram on your device.</li>
|
64 |
-
<li>Launch Telegram and enter your phone number to create an account. You will receive a verification code via SMS or a phone call.</li>
|
65 |
-
<li>Enter the verification code and set up your profile name and photo.</li>
|
66 |
-
<li>Congratulations! You have successfully downloaded and installed Telegram on your Android device.</li>
|
67 |
-
</ol>
|
68 |
-
<h3>Download Telegram apk file from a third-party source</h3>
|
69 |
-
<p>The second option is to download Telegram apk file from a third-party source. This is useful if you want to install an older version of Telegram or if you cannot access the official website or the Google Play Store. However, this option is riskier as you might download a malicious or corrupted file that can harm your device. Therefore, you should only download apk files from trusted and reputable sources. Here are the steps to follow:</p>
|
70 |
-
<ol>
|
71 |
-
<li>Go to a website that offers Telegram apk files, such as <a href="">https://apkpure.com/telegram/org.telegram.messenger</a> or <a href="">https://apkfab.com/telegram/org.telegram.messenger</a>.</li>
|
72 |
-
<li>Select the version of Telegram that you want to download and click on the "Download APK" button.</li>
|
73 |
-
<li>Wait for the download to finish and open the downloaded file.</li>
|
74 |
-
<li>If you see a warning message that says "For your security, your phone is not allowed to install unknown apps from this source", go to your device settings and enable the option to install apps from unknown sources.</li>
|
75 |
-
<li>Follow the instructions to install Telegram on your device.</li>
|
76 |
-
<li>Launch Telegram and create an account using your phone number as explained above.</li>
|
77 |
-
<li>Congratulations! You have successfully downloaded and installed Telegram on your Android device using an apk file.</li>
|
78 |
-
</ol>
|
79 |
-
<h2>What are the advantages and disadvantages of Telegram app?</h2>
|
80 |
-
<p>Telegram app has many advantages and disadvantages that you should consider before using it. Here are some of them:</p>
|
81 |
-
<h3>Advantages of Telegram app include privacy, speed, power, and customization</h3>
|
82 |
-
<p>As we mentioned earlier, Telegram app offers a high level of privacy and security for its users. It encrypts all its data and allows users to create secret chats that self-destruct after a certain time. It also does not collect or share any personal information with third parties. It respects the user's right to delete their account and data at any time.</p>
|
83 |
-
<p>Telegram app is also very fast and reliable. It delivers messages faster than any other app, even on slow or unstable connections. It supports voice and video calls with high quality and low data usage. It also has a cloud-based architecture that allows users to access their messages from any device without losing any data.</p>
|
84 |
-
<p>Telegram app is also very powerful and expressive. It has many features that make it more than just a messaging app. It allows users to create large groups, share large files, set up bots, customize their app, and use links to share their content. It also supports various types of media, such as photos, videos, audio, documents, GIFs, stickers, emojis, and more.</p>
|
85 |
-
<p>Telegram app is also very customizable and user-friendly. It allows users to change their theme, font, language, notification sound, and privacy settings. It also has a simple and intuitive interface that is easy to use and navigate. It also has a dark mode that reduces eye strain and saves battery life.</p>
|
86 |
-
<h3>Disadvantages of Telegram app include technical complexity, legal issues, and content moderation</h3>
|
87 |
-
<p>However, Telegram app also has some disadvantages that users should be aware of before using it. One of them is its technical complexity. Telegram app uses advanced encryption algorithms and protocols that might be difficult for some users to understand or trust. It also requires users to have a phone number to create an account and verify it. It also does not have a backup or restore option for users who lose their device or data. Another disadvantage of Telegram app is its legal issues. Telegram app has faced several bans and restrictions in some countries, such as Russia, Iran, China, and India, due to its encryption and privacy policies. It has also been accused of facilitating illegal activities, such as terrorism, extremism, and child pornography, by allowing users to create secret chats and channels that are hard to monitor or trace. It has also been involved in some controversies, such as the Telegram Open Network (TON) project and the Gram cryptocurrency. A third disadvantage of Telegram app is its content moderation. Telegram app does not have a clear or consistent policy on how to deal with harmful or offensive content on its platform. It relies on users to report and block such content, but it does not have a dedicated team or mechanism to review or remove it. It also does not have any age verification or parental control features to protect minors from inappropriate or dangerous content. <h2>Conclusion</h2>
|
88 |
-
<p>Telegram app is one of the best messaging apps in 2021 that offers a lot of benefits to its users. It is fast, secure, powerful, and customizable. It allows users to communicate and share content with their friends, family, and colleagues in a convenient and fun way. It also has many features that make it more than just a messaging app, such as groups, channels, bots, themes, stickers, and more.</p>
|
89 |
-
<p>Telegram app is easy to download and install on Android devices from various sources. Users can download it from the official website or the Google Play Store, or they can download an apk file from a third-party source. However, users should be careful when downloading apk files from unknown sources, as they might contain malware or viruses.</p>
|
90 |
-
<p>Telegram app has some drawbacks that users should be aware of before using it. It has a technical complexity that might confuse some users or make them distrustful of its encryption and security. It also has some legal issues that might affect its availability or functionality in some countries or regions. It also has some content moderation issues that might expose users to harmful or offensive content on its platform.</p>
|
91 |
-
<h2>FAQs</h2>
|
92 |
-
<h4>Is Telegram safe and secure?</h4>
|
93 |
-
<p>Telegram is safe and secure as long as you use it properly and responsibly. It encrypts all its data and offers optional end-to-end encryption for voice calls and secret chats. It also does not collect or share any personal information with third parties. However, you should be careful when chatting with strangers or joining unknown groups or channels, as they might contain malicious or fraudulent content.</p>
|
94 |
-
<h4>How can I use Telegram on multiple devices?</h4>
|
95 |
-
<p>You can use Telegram on multiple devices at once by logging in with your phone number on each device. You can use Telegram on your phone, tablet, laptop, desktop, or web browser. You can also switch between devices seamlessly without losing any data.</p>
|
96 |
-
<h4>What are the differences between Telegram groups, channels, and bots?</h4>
|
97 |
-
<p>Telegram groups are chat rooms where you can communicate with up to 200,000 members. You can create public or private groups for different purposes, such as family, friends, work, hobbies, etc. You can also assign admins to manage the group settings and members.</p>
|
98 |
-
<p>Telegram channels are broadcast platforms where you can share messages with unlimited subscribers. You can create public or private channels for different topics, such as news, entertainment, education, etc. You can also assign admins to post messages on behalf of the channel.</p>
|
99 |
-
<p>Telegram bots are programs that can be embedded in chats or public channels to perform various functions, such as searching on the internet, teaching, reminders, and integration with other services. You can create your own bots using the Telegram Bot API or use existing bots from the Bot Store.</p>
|
100 |
-
<h4>How can I customize my Telegram app with themes, stickers, and emojis?</h4>
|
101 |
-
<p>You can customize your Telegram app with themes, stickers, and emojis to make it more personal and expressive. You can change your theme by going to Settings > Chat Settings > Theme and choosing from the available options or creating your own theme. You can also download or create stickers and emojis by going to Settings > Chat Settings > Stickers and Emojis and browsing or searching for the ones you like. You can also use the built-in photo editor to create your own stickers and emojis.</p>
|
102 |
-
<h4>How can I delete my Telegram account and data?</h4>
|
103 |
-
<p>You can delete your Telegram account and data by going to Settings > Privacy and Security > Delete My Account. You can choose to delete your account immediately or after a certain period of inactivity. You can also delete individual chats, messages, or media by selecting them and tapping on the delete icon. However, you should note that deleting your account or data does not guarantee that they will be completely erased from Telegram servers or other users' devices.</p> 401be4b1e0<br />
|
104 |
-
<br />
|
105 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/1toTree/lora_test/ppdiffusers/pipelines/audio_diffusion/__init__.py
DELETED
@@ -1,17 +0,0 @@
|
|
1 |
-
# Copyright (c) 2022 PaddlePaddle Authors. 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 |
-
# flake8: noqa
|
16 |
-
from .mel import Mel
|
17 |
-
from .pipeline_audio_diffusion import AudioDiffusionPipeline
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/2023Liu2023/bingo/src/components/settings.tsx
DELETED
@@ -1,141 +0,0 @@
|
|
1 |
-
import { useEffect, useState } from 'react'
|
2 |
-
import { useAtom } from 'jotai'
|
3 |
-
import { Switch } from '@headlessui/react'
|
4 |
-
import { toast } from 'react-hot-toast'
|
5 |
-
import { hashAtom, voiceAtom } from '@/state'
|
6 |
-
import {
|
7 |
-
Dialog,
|
8 |
-
DialogContent,
|
9 |
-
DialogDescription,
|
10 |
-
DialogFooter,
|
11 |
-
DialogHeader,
|
12 |
-
DialogTitle
|
13 |
-
} from '@/components/ui/dialog'
|
14 |
-
import { Button } from './ui/button'
|
15 |
-
import { Input } from './ui/input'
|
16 |
-
import { ChunkKeys, parseCookies, extraCurlFromCookie, randomIP, encodeHeadersToCookie } from '@/lib/utils'
|
17 |
-
import { ExternalLink } from './external-link'
|
18 |
-
import { useCopyToClipboard } from '@/lib/hooks/use-copy-to-clipboard'
|
19 |
-
|
20 |
-
export function Settings() {
|
21 |
-
const { isCopied, copyToClipboard } = useCopyToClipboard({ timeout: 2000 })
|
22 |
-
const [loc, setLoc] = useAtom(hashAtom)
|
23 |
-
const [curlValue, setCurlValue] = useState(extraCurlFromCookie(parseCookies(document.cookie, ChunkKeys)))
|
24 |
-
const [enableTTS, setEnableTTS] = useAtom(voiceAtom)
|
25 |
-
|
26 |
-
useEffect(() => {
|
27 |
-
if (isCopied) {
|
28 |
-
toast.success('复制成功')
|
29 |
-
}
|
30 |
-
}, [isCopied])
|
31 |
-
|
32 |
-
if (loc === 'settings') {
|
33 |
-
return (
|
34 |
-
<Dialog open onOpenChange={() => setLoc('')} modal>
|
35 |
-
<DialogContent>
|
36 |
-
<DialogHeader>
|
37 |
-
<DialogTitle>设置你的用户信息</DialogTitle>
|
38 |
-
<DialogDescription>
|
39 |
-
请使用 Edge 浏览器
|
40 |
-
<ExternalLink
|
41 |
-
href="https://www.bing.com/turing/captcha/challenge"
|
42 |
-
>
|
43 |
-
打开并登录 Bing
|
44 |
-
</ExternalLink>
|
45 |
-
,然后再打开
|
46 |
-
<ExternalLink href="https://www.bing.com/turing/captcha/challenge">Challenge 接口</ExternalLink>
|
47 |
-
右键 》检查。打开开发者工具,在网络里面找到 Create 接口 》右键复制》复制为 cURL(bash),粘贴到此处,然后保存。
|
48 |
-
<div className="h-2" />
|
49 |
-
图文示例:
|
50 |
-
<ExternalLink href="https://github.com/weaigc/bingo#如何获取%20BING_HEADER">如何获取 BING_HEADER</ExternalLink>
|
51 |
-
</DialogDescription>
|
52 |
-
</DialogHeader>
|
53 |
-
<div className="flex gap-4">
|
54 |
-
|
55 |
-
</div>
|
56 |
-
<Input
|
57 |
-
value={curlValue}
|
58 |
-
placeholder="在此填写用户信息,格式: curl 'https://www.bing.com/turing/captcha/challenge' ..."
|
59 |
-
onChange={e => setCurlValue(e.target.value)}
|
60 |
-
/>
|
61 |
-
<Button variant="ghost" className="bg-[#F5F5F5] hover:bg-[#F2F2F2]" onClick={() => copyToClipboard(btoa(curlValue))}>
|
62 |
-
转成 BING_HEADER 并复制
|
63 |
-
</Button>
|
64 |
-
|
65 |
-
<DialogFooter className="items-center">
|
66 |
-
<Button
|
67 |
-
variant="secondary"
|
68 |
-
className="bg-[#c7f3ff] hover:bg-[#fdc7ff]"
|
69 |
-
onClick={() => {
|
70 |
-
let headerValue = curlValue
|
71 |
-
if (headerValue) {
|
72 |
-
try {
|
73 |
-
headerValue = atob(headerValue)
|
74 |
-
} catch (e) {}
|
75 |
-
if (!/^\s*curl ['"]https:\/\/www\.bing\.com\/turing\/captcha\/challenge['"]/.test(headerValue)) {
|
76 |
-
toast.error('格式不正确')
|
77 |
-
return
|
78 |
-
}
|
79 |
-
const maxAge = 86400 * 30
|
80 |
-
encodeHeadersToCookie(headerValue).forEach(cookie => document.cookie = `${cookie}; Max-Age=${maxAge}; Path=/; SameSite=None; Secure`)
|
81 |
-
} else {
|
82 |
-
[...ChunkKeys, 'BING_COOKIE', 'BING_UA', 'BING_IP'].forEach(key => document.cookie = `${key}=; Path=/; SameSite=None; Secure`)
|
83 |
-
}
|
84 |
-
|
85 |
-
toast.success('保存成功')
|
86 |
-
setLoc('')
|
87 |
-
setTimeout(() => {
|
88 |
-
location.href = './'
|
89 |
-
}, 2000)
|
90 |
-
}}
|
91 |
-
>
|
92 |
-
保存
|
93 |
-
</Button>
|
94 |
-
</DialogFooter>
|
95 |
-
</DialogContent>
|
96 |
-
</Dialog>
|
97 |
-
)
|
98 |
-
} else if (loc === 'voice') {
|
99 |
-
return (
|
100 |
-
<Dialog open onOpenChange={() => setLoc('')} modal>
|
101 |
-
<DialogContent>
|
102 |
-
<DialogHeader>
|
103 |
-
<DialogTitle>语音设置</DialogTitle>
|
104 |
-
<DialogDescription>
|
105 |
-
目前仅支持 PC 端 Edge 及 Chrome 浏览器
|
106 |
-
</DialogDescription>
|
107 |
-
</DialogHeader>
|
108 |
-
|
109 |
-
<div className="flex gap-2">
|
110 |
-
启用语音回答
|
111 |
-
<Switch
|
112 |
-
checked={enableTTS}
|
113 |
-
className={`${enableTTS ? 'bg-blue-600' : 'bg-gray-200'} relative inline-flex h-6 w-11 items-center rounded-full`}
|
114 |
-
onChange={(checked: boolean) => setEnableTTS(checked)}
|
115 |
-
>
|
116 |
-
<span
|
117 |
-
className={`${enableTTS ? 'translate-x-6' : 'translate-x-1'} inline-block h-4 w-4 transform rounded-full bg-white transition`}
|
118 |
-
/>
|
119 |
-
</Switch>
|
120 |
-
</div>
|
121 |
-
|
122 |
-
<DialogFooter className="items-center">
|
123 |
-
<Button
|
124 |
-
variant="secondary"
|
125 |
-
onClick={() => {
|
126 |
-
toast.success('保存成功')
|
127 |
-
setLoc('')
|
128 |
-
setTimeout(() => {
|
129 |
-
location.href = './'
|
130 |
-
}, 2000)
|
131 |
-
}}
|
132 |
-
>
|
133 |
-
保存
|
134 |
-
</Button>
|
135 |
-
</DialogFooter>
|
136 |
-
</DialogContent>
|
137 |
-
</Dialog>
|
138 |
-
)
|
139 |
-
}
|
140 |
-
return null
|
141 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AIConsultant/MusicGen/audiocraft/utils/checkpoint.py
DELETED
@@ -1,161 +0,0 @@
|
|
1 |
-
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
2 |
-
# All rights reserved.
|
3 |
-
#
|
4 |
-
# This source code is licensed under the license found in the
|
5 |
-
# LICENSE file in the root directory of this source tree.
|
6 |
-
|
7 |
-
from enum import Enum
|
8 |
-
import logging
|
9 |
-
from pathlib import Path
|
10 |
-
import re
|
11 |
-
import typing as tp
|
12 |
-
|
13 |
-
import flashy
|
14 |
-
import torch
|
15 |
-
|
16 |
-
from ..environment import AudioCraftEnvironment
|
17 |
-
|
18 |
-
|
19 |
-
logger = logging.getLogger(__name__)
|
20 |
-
|
21 |
-
|
22 |
-
class CheckpointSource(Enum):
|
23 |
-
CURRENT_XP = "current_xp"
|
24 |
-
PRETRAINED = "pretrained"
|
25 |
-
OTHER = "other"
|
26 |
-
|
27 |
-
|
28 |
-
def checkpoint_name(name: tp.Optional[str] = None, rank: tp.Optional[int] = None, use_fsdp: bool = False) -> str:
|
29 |
-
"""Checkpoint name formatted for all use in AudioCraft codebase and has the following format:
|
30 |
-
`checkpoint_<name>.th(.<rank>)`. By convention, name is expected to be empty for last checkpoint,
|
31 |
-
'best' for the best checkpoint or the epoch number.
|
32 |
-
|
33 |
-
Args:
|
34 |
-
name (str, optional): Name suffix for the checkpoint file stem.
|
35 |
-
rank (optional, int): Rank for distributed processing, retrieved with flashy if not provided.
|
36 |
-
use_fsdp (bool): Whether the calling solver relies on FSDP.
|
37 |
-
Returns:
|
38 |
-
str: The checkpoint name.
|
39 |
-
"""
|
40 |
-
suffix = ''
|
41 |
-
if rank is None:
|
42 |
-
rank = flashy.distrib.rank()
|
43 |
-
if rank > 0 and use_fsdp:
|
44 |
-
suffix = '.' + str(rank)
|
45 |
-
name_part = ''
|
46 |
-
if name is not None:
|
47 |
-
name_part = f'_{name}'
|
48 |
-
return f'checkpoint{name_part}.th{suffix}'
|
49 |
-
|
50 |
-
|
51 |
-
def is_sharded_checkpoint(path: Path) -> bool:
|
52 |
-
"""Whether the checkpoint at the given path corresponds to a sharded checkpoint across rank."""
|
53 |
-
return re.search(r'\.th\.\d+$', path.name) is not None
|
54 |
-
|
55 |
-
|
56 |
-
def resolve_checkpoint_path(sig_or_path: tp.Union[Path, str], name: tp.Optional[str] = None,
|
57 |
-
use_fsdp: bool = False) -> tp.Optional[Path]:
|
58 |
-
"""Resolve a given checkpoint path for a provided dora sig or path.
|
59 |
-
|
60 |
-
Args:
|
61 |
-
sig_or_path (Path or str): Checkpoint path or dora signature.
|
62 |
-
name (str, optional): Name suffix for the checkpoint file stem.
|
63 |
-
rank (optional, int): Rank for distributed processing, retrieved with flashy if not provided.
|
64 |
-
use_fsdp (bool): Whether the calling solver relies on FSDP.
|
65 |
-
Returns:
|
66 |
-
Path, optional: Resolved checkpoint path, if it exists.
|
67 |
-
"""
|
68 |
-
from audiocraft import train
|
69 |
-
xps_root = train.main.dora.dir / 'xps'
|
70 |
-
sig_or_path = str(sig_or_path)
|
71 |
-
if sig_or_path.startswith('//sig/'):
|
72 |
-
sig = sig_or_path[len('//sig/'):]
|
73 |
-
path = xps_root / sig
|
74 |
-
else:
|
75 |
-
path = Path(sig_or_path)
|
76 |
-
path = AudioCraftEnvironment.resolve_reference_path(path)
|
77 |
-
|
78 |
-
if path.is_dir():
|
79 |
-
path = path / checkpoint_name(name, use_fsdp=use_fsdp)
|
80 |
-
|
81 |
-
if path.exists():
|
82 |
-
return path
|
83 |
-
else:
|
84 |
-
return None
|
85 |
-
|
86 |
-
|
87 |
-
def load_checkpoint(checkpoint_path: Path, is_sharded: bool = False) -> tp.Any:
|
88 |
-
"""Load state from checkpoints at the specified checkpoint path."""
|
89 |
-
if is_sharded:
|
90 |
-
rank0_checkpoint_path = checkpoint_path.parent / checkpoint_name(use_fsdp=False)
|
91 |
-
if rank0_checkpoint_path.exists():
|
92 |
-
check_sharded_checkpoint(checkpoint_path, rank0_checkpoint_path)
|
93 |
-
state = torch.load(checkpoint_path, 'cpu')
|
94 |
-
logger.info("Checkpoint loaded from %s", checkpoint_path)
|
95 |
-
return state
|
96 |
-
|
97 |
-
|
98 |
-
def save_checkpoint(state: tp.Any, checkpoint_path: Path, is_sharded: bool = False) -> None:
|
99 |
-
"""Save state to disk to the specified checkpoint_path."""
|
100 |
-
_safe_save_checkpoint(state, checkpoint_path, is_sharded)
|
101 |
-
logger.info("Checkpoint saved to %s", checkpoint_path)
|
102 |
-
|
103 |
-
|
104 |
-
def flush_stale_checkpoints(checkpoint_path: Path, keep_last: tp.Optional[int] = None) -> None:
|
105 |
-
"""Flush checkpoints to only keep last N checkpoints."""
|
106 |
-
if keep_last is None or keep_last <= 0:
|
107 |
-
return
|
108 |
-
checkpoint_dir = checkpoint_path.parent
|
109 |
-
suffix = ''
|
110 |
-
if flashy.distrib.rank() > 0:
|
111 |
-
suffix = f'.{flashy.distrib.rank()}'
|
112 |
-
checkpoint_files_with_epoch = []
|
113 |
-
for path in Path(checkpoint_dir).glob(f'checkpoint_*.th{suffix}'):
|
114 |
-
epoch_part = path.name.split('.', 1)[0].split('_', 1)[1]
|
115 |
-
if epoch_part.isdigit():
|
116 |
-
checkpoint_files_with_epoch.append((path, int(epoch_part)))
|
117 |
-
checkpoint_files = [path for path, _ in list(sorted(checkpoint_files_with_epoch, key=lambda t: t[1]))]
|
118 |
-
total_to_flush = max(0, len(checkpoint_files) - keep_last)
|
119 |
-
files_to_flush = checkpoint_files[:total_to_flush]
|
120 |
-
for path in files_to_flush:
|
121 |
-
logger.debug("Removing checkpoint: %s", str(path))
|
122 |
-
path.unlink(missing_ok=True)
|
123 |
-
|
124 |
-
|
125 |
-
def check_sharded_checkpoint(checkpoint_path: Path, rank0_checkpoint_path: Path) -> None:
|
126 |
-
"""Check sharded checkpoint state, ensuring the checkpoints are not corrupted."""
|
127 |
-
# Finish the work of a previous run that got interrupted while dumping.
|
128 |
-
old_path = Path(str(checkpoint_path) + '.old')
|
129 |
-
if old_path.exists():
|
130 |
-
raise RuntimeError(
|
131 |
-
f"Old checkpoint {old_path} from previous version of this code exist, cannot safely proceed.")
|
132 |
-
token = Path(str(rank0_checkpoint_path) + '.tmp.done')
|
133 |
-
tmp_path = Path(str(checkpoint_path) + '.tmp')
|
134 |
-
if token.exists():
|
135 |
-
if tmp_path.exists():
|
136 |
-
tmp_path.rename(checkpoint_path)
|
137 |
-
flashy.distrib.barrier()
|
138 |
-
if flashy.distrib.is_rank_zero() and token.exists():
|
139 |
-
token.unlink()
|
140 |
-
|
141 |
-
|
142 |
-
def _safe_save_checkpoint(state: tp.Any, checkpoint_path: Path, is_sharded: bool = False) -> None:
|
143 |
-
"""Save checkpoints in a safe manner even with when sharded checkpoints across nodes."""
|
144 |
-
def _barrier_if_sharded():
|
145 |
-
if is_sharded:
|
146 |
-
flashy.distrib.barrier()
|
147 |
-
|
148 |
-
if flashy.distrib.is_rank_zero():
|
149 |
-
token = Path(str(checkpoint_path) + '.tmp.done')
|
150 |
-
if token.exists():
|
151 |
-
token.unlink()
|
152 |
-
_barrier_if_sharded()
|
153 |
-
with flashy.utils.write_and_rename(checkpoint_path) as f:
|
154 |
-
torch.save(state, f)
|
155 |
-
_barrier_if_sharded()
|
156 |
-
if flashy.distrib.is_rank_zero():
|
157 |
-
token.touch()
|
158 |
-
_barrier_if_sharded()
|
159 |
-
_barrier_if_sharded()
|
160 |
-
if flashy.distrib.rank() == 0:
|
161 |
-
token.unlink()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AIFILMS/generate_human_motion/pyrender/pyrender/material.py
DELETED
@@ -1,707 +0,0 @@
|
|
1 |
-
"""Material properties, conforming to the glTF 2.0 standards as specified in
|
2 |
-
https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#reference-material
|
3 |
-
and
|
4 |
-
https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_materials_pbrSpecularGlossiness
|
5 |
-
|
6 |
-
Author: Matthew Matl
|
7 |
-
"""
|
8 |
-
import abc
|
9 |
-
import numpy as np
|
10 |
-
import six
|
11 |
-
|
12 |
-
from .constants import TexFlags
|
13 |
-
from .utils import format_color_vector, format_texture_source
|
14 |
-
from .texture import Texture
|
15 |
-
|
16 |
-
|
17 |
-
@six.add_metaclass(abc.ABCMeta)
|
18 |
-
class Material(object):
|
19 |
-
"""Base for standard glTF 2.0 materials.
|
20 |
-
|
21 |
-
Parameters
|
22 |
-
----------
|
23 |
-
name : str, optional
|
24 |
-
The user-defined name of this object.
|
25 |
-
normalTexture : (n,n,3) float or :class:`Texture`, optional
|
26 |
-
A tangent space normal map. The texture contains RGB components in
|
27 |
-
linear space. Each texel represents the XYZ components of a normal
|
28 |
-
vector in tangent space. Red [0 to 255] maps to X [-1 to 1]. Green
|
29 |
-
[0 to 255] maps to Y [-1 to 1]. Blue [128 to 255] maps to Z
|
30 |
-
[1/255 to 1]. The normal vectors use OpenGL conventions where +X is
|
31 |
-
right and +Y is up. +Z points toward the viewer.
|
32 |
-
occlusionTexture : (n,n,1) float or :class:`Texture`, optional
|
33 |
-
The occlusion map texture. The occlusion values are sampled from the R
|
34 |
-
channel. Higher values indicate areas that should receive full indirect
|
35 |
-
lighting and lower values indicate no indirect lighting. These values
|
36 |
-
are linear. If other channels are present (GBA), they are ignored for
|
37 |
-
occlusion calculations.
|
38 |
-
emissiveTexture : (n,n,3) float or :class:`Texture`, optional
|
39 |
-
The emissive map controls the color and intensity of the light being
|
40 |
-
emitted by the material. This texture contains RGB components in sRGB
|
41 |
-
color space. If a fourth component (A) is present, it is ignored.
|
42 |
-
emissiveFactor : (3,) float, optional
|
43 |
-
The RGB components of the emissive color of the material. These values
|
44 |
-
are linear. If an emissiveTexture is specified, this value is
|
45 |
-
multiplied with the texel values.
|
46 |
-
alphaMode : str, optional
|
47 |
-
The material's alpha rendering mode enumeration specifying the
|
48 |
-
interpretation of the alpha value of the main factor and texture.
|
49 |
-
Allowed Values:
|
50 |
-
|
51 |
-
- `"OPAQUE"` The alpha value is ignored and the rendered output is
|
52 |
-
fully opaque.
|
53 |
-
- `"MASK"` The rendered output is either fully opaque or fully
|
54 |
-
transparent depending on the alpha value and the specified alpha
|
55 |
-
cutoff value.
|
56 |
-
- `"BLEND"` The alpha value is used to composite the source and
|
57 |
-
destination areas. The rendered output is combined with the
|
58 |
-
background using the normal painting operation (i.e. the Porter
|
59 |
-
and Duff over operator).
|
60 |
-
|
61 |
-
alphaCutoff : float, optional
|
62 |
-
Specifies the cutoff threshold when in MASK mode. If the alpha value is
|
63 |
-
greater than or equal to this value then it is rendered as fully
|
64 |
-
opaque, otherwise, it is rendered as fully transparent.
|
65 |
-
A value greater than 1.0 will render the entire material as fully
|
66 |
-
transparent. This value is ignored for other modes.
|
67 |
-
doubleSided : bool, optional
|
68 |
-
Specifies whether the material is double sided. When this value is
|
69 |
-
false, back-face culling is enabled. When this value is true,
|
70 |
-
back-face culling is disabled and double sided lighting is enabled.
|
71 |
-
smooth : bool, optional
|
72 |
-
If True, the material is rendered smoothly by using only one normal
|
73 |
-
per vertex and face indexing.
|
74 |
-
wireframe : bool, optional
|
75 |
-
If True, the material is rendered in wireframe mode.
|
76 |
-
"""
|
77 |
-
|
78 |
-
def __init__(self,
|
79 |
-
name=None,
|
80 |
-
normalTexture=None,
|
81 |
-
occlusionTexture=None,
|
82 |
-
emissiveTexture=None,
|
83 |
-
emissiveFactor=None,
|
84 |
-
alphaMode=None,
|
85 |
-
alphaCutoff=None,
|
86 |
-
doubleSided=False,
|
87 |
-
smooth=True,
|
88 |
-
wireframe=False):
|
89 |
-
|
90 |
-
# Set defaults
|
91 |
-
if alphaMode is None:
|
92 |
-
alphaMode = 'OPAQUE'
|
93 |
-
|
94 |
-
if alphaCutoff is None:
|
95 |
-
alphaCutoff = 0.5
|
96 |
-
|
97 |
-
if emissiveFactor is None:
|
98 |
-
emissiveFactor = np.zeros(3).astype(np.float32)
|
99 |
-
|
100 |
-
self.name = name
|
101 |
-
self.normalTexture = normalTexture
|
102 |
-
self.occlusionTexture = occlusionTexture
|
103 |
-
self.emissiveTexture = emissiveTexture
|
104 |
-
self.emissiveFactor = emissiveFactor
|
105 |
-
self.alphaMode = alphaMode
|
106 |
-
self.alphaCutoff = alphaCutoff
|
107 |
-
self.doubleSided = doubleSided
|
108 |
-
self.smooth = smooth
|
109 |
-
self.wireframe = wireframe
|
110 |
-
|
111 |
-
self._tex_flags = None
|
112 |
-
|
113 |
-
@property
|
114 |
-
def name(self):
|
115 |
-
"""str : The user-defined name of this object.
|
116 |
-
"""
|
117 |
-
return self._name
|
118 |
-
|
119 |
-
@name.setter
|
120 |
-
def name(self, value):
|
121 |
-
if value is not None:
|
122 |
-
value = str(value)
|
123 |
-
self._name = value
|
124 |
-
|
125 |
-
@property
|
126 |
-
def normalTexture(self):
|
127 |
-
"""(n,n,3) float or :class:`Texture` : The tangent-space normal map.
|
128 |
-
"""
|
129 |
-
return self._normalTexture
|
130 |
-
|
131 |
-
@normalTexture.setter
|
132 |
-
def normalTexture(self, value):
|
133 |
-
# TODO TMP
|
134 |
-
self._normalTexture = self._format_texture(value, 'RGB')
|
135 |
-
self._tex_flags = None
|
136 |
-
|
137 |
-
@property
|
138 |
-
def occlusionTexture(self):
|
139 |
-
"""(n,n,1) float or :class:`Texture` : The ambient occlusion map.
|
140 |
-
"""
|
141 |
-
return self._occlusionTexture
|
142 |
-
|
143 |
-
@occlusionTexture.setter
|
144 |
-
def occlusionTexture(self, value):
|
145 |
-
self._occlusionTexture = self._format_texture(value, 'R')
|
146 |
-
self._tex_flags = None
|
147 |
-
|
148 |
-
@property
|
149 |
-
def emissiveTexture(self):
|
150 |
-
"""(n,n,3) float or :class:`Texture` : The emission map.
|
151 |
-
"""
|
152 |
-
return self._emissiveTexture
|
153 |
-
|
154 |
-
@emissiveTexture.setter
|
155 |
-
def emissiveTexture(self, value):
|
156 |
-
self._emissiveTexture = self._format_texture(value, 'RGB')
|
157 |
-
self._tex_flags = None
|
158 |
-
|
159 |
-
@property
|
160 |
-
def emissiveFactor(self):
|
161 |
-
"""(3,) float : Base multiplier for emission colors.
|
162 |
-
"""
|
163 |
-
return self._emissiveFactor
|
164 |
-
|
165 |
-
@emissiveFactor.setter
|
166 |
-
def emissiveFactor(self, value):
|
167 |
-
if value is None:
|
168 |
-
value = np.zeros(3)
|
169 |
-
self._emissiveFactor = format_color_vector(value, 3)
|
170 |
-
|
171 |
-
@property
|
172 |
-
def alphaMode(self):
|
173 |
-
"""str : The mode for blending.
|
174 |
-
"""
|
175 |
-
return self._alphaMode
|
176 |
-
|
177 |
-
@alphaMode.setter
|
178 |
-
def alphaMode(self, value):
|
179 |
-
if value not in set(['OPAQUE', 'MASK', 'BLEND']):
|
180 |
-
raise ValueError('Invalid alpha mode {}'.format(value))
|
181 |
-
self._alphaMode = value
|
182 |
-
|
183 |
-
@property
|
184 |
-
def alphaCutoff(self):
|
185 |
-
"""float : The cutoff threshold in MASK mode.
|
186 |
-
"""
|
187 |
-
return self._alphaCutoff
|
188 |
-
|
189 |
-
@alphaCutoff.setter
|
190 |
-
def alphaCutoff(self, value):
|
191 |
-
if value < 0 or value > 1:
|
192 |
-
raise ValueError('Alpha cutoff must be in range [0,1]')
|
193 |
-
self._alphaCutoff = float(value)
|
194 |
-
|
195 |
-
@property
|
196 |
-
def doubleSided(self):
|
197 |
-
"""bool : Whether the material is double-sided.
|
198 |
-
"""
|
199 |
-
return self._doubleSided
|
200 |
-
|
201 |
-
@doubleSided.setter
|
202 |
-
def doubleSided(self, value):
|
203 |
-
if not isinstance(value, bool):
|
204 |
-
raise TypeError('Double sided must be a boolean value')
|
205 |
-
self._doubleSided = value
|
206 |
-
|
207 |
-
@property
|
208 |
-
def smooth(self):
|
209 |
-
"""bool : Whether to render the mesh smoothly by
|
210 |
-
interpolating vertex normals.
|
211 |
-
"""
|
212 |
-
return self._smooth
|
213 |
-
|
214 |
-
@smooth.setter
|
215 |
-
def smooth(self, value):
|
216 |
-
if not isinstance(value, bool):
|
217 |
-
raise TypeError('Double sided must be a boolean value')
|
218 |
-
self._smooth = value
|
219 |
-
|
220 |
-
@property
|
221 |
-
def wireframe(self):
|
222 |
-
"""bool : Whether to render the mesh in wireframe mode.
|
223 |
-
"""
|
224 |
-
return self._wireframe
|
225 |
-
|
226 |
-
@wireframe.setter
|
227 |
-
def wireframe(self, value):
|
228 |
-
if not isinstance(value, bool):
|
229 |
-
raise TypeError('Wireframe must be a boolean value')
|
230 |
-
self._wireframe = value
|
231 |
-
|
232 |
-
@property
|
233 |
-
def is_transparent(self):
|
234 |
-
"""bool : If True, the object is partially transparent.
|
235 |
-
"""
|
236 |
-
return self._compute_transparency()
|
237 |
-
|
238 |
-
@property
|
239 |
-
def tex_flags(self):
|
240 |
-
"""int : Texture availability flags.
|
241 |
-
"""
|
242 |
-
if self._tex_flags is None:
|
243 |
-
self._tex_flags = self._compute_tex_flags()
|
244 |
-
return self._tex_flags
|
245 |
-
|
246 |
-
@property
|
247 |
-
def textures(self):
|
248 |
-
"""list of :class:`Texture` : The textures associated with this
|
249 |
-
material.
|
250 |
-
"""
|
251 |
-
return self._compute_textures()
|
252 |
-
|
253 |
-
def _compute_transparency(self):
|
254 |
-
return False
|
255 |
-
|
256 |
-
def _compute_tex_flags(self):
|
257 |
-
tex_flags = TexFlags.NONE
|
258 |
-
if self.normalTexture is not None:
|
259 |
-
tex_flags |= TexFlags.NORMAL
|
260 |
-
if self.occlusionTexture is not None:
|
261 |
-
tex_flags |= TexFlags.OCCLUSION
|
262 |
-
if self.emissiveTexture is not None:
|
263 |
-
tex_flags |= TexFlags.EMISSIVE
|
264 |
-
return tex_flags
|
265 |
-
|
266 |
-
def _compute_textures(self):
|
267 |
-
all_textures = [
|
268 |
-
self.normalTexture, self.occlusionTexture, self.emissiveTexture
|
269 |
-
]
|
270 |
-
textures = set([t for t in all_textures if t is not None])
|
271 |
-
return textures
|
272 |
-
|
273 |
-
def _format_texture(self, texture, target_channels='RGB'):
|
274 |
-
"""Format a texture as a float32 np array.
|
275 |
-
"""
|
276 |
-
if isinstance(texture, Texture) or texture is None:
|
277 |
-
return texture
|
278 |
-
else:
|
279 |
-
source = format_texture_source(texture, target_channels)
|
280 |
-
return Texture(source=source, source_channels=target_channels)
|
281 |
-
|
282 |
-
|
283 |
-
class MetallicRoughnessMaterial(Material):
|
284 |
-
"""A material based on the metallic-roughness material model from
|
285 |
-
Physically-Based Rendering (PBR) methodology.
|
286 |
-
|
287 |
-
Parameters
|
288 |
-
----------
|
289 |
-
name : str, optional
|
290 |
-
The user-defined name of this object.
|
291 |
-
normalTexture : (n,n,3) float or :class:`Texture`, optional
|
292 |
-
A tangent space normal map. The texture contains RGB components in
|
293 |
-
linear space. Each texel represents the XYZ components of a normal
|
294 |
-
vector in tangent space. Red [0 to 255] maps to X [-1 to 1]. Green
|
295 |
-
[0 to 255] maps to Y [-1 to 1]. Blue [128 to 255] maps to Z
|
296 |
-
[1/255 to 1]. The normal vectors use OpenGL conventions where +X is
|
297 |
-
right and +Y is up. +Z points toward the viewer.
|
298 |
-
occlusionTexture : (n,n,1) float or :class:`Texture`, optional
|
299 |
-
The occlusion map texture. The occlusion values are sampled from the R
|
300 |
-
channel. Higher values indicate areas that should receive full indirect
|
301 |
-
lighting and lower values indicate no indirect lighting. These values
|
302 |
-
are linear. If other channels are present (GBA), they are ignored for
|
303 |
-
occlusion calculations.
|
304 |
-
emissiveTexture : (n,n,3) float or :class:`Texture`, optional
|
305 |
-
The emissive map controls the color and intensity of the light being
|
306 |
-
emitted by the material. This texture contains RGB components in sRGB
|
307 |
-
color space. If a fourth component (A) is present, it is ignored.
|
308 |
-
emissiveFactor : (3,) float, optional
|
309 |
-
The RGB components of the emissive color of the material. These values
|
310 |
-
are linear. If an emissiveTexture is specified, this value is
|
311 |
-
multiplied with the texel values.
|
312 |
-
alphaMode : str, optional
|
313 |
-
The material's alpha rendering mode enumeration specifying the
|
314 |
-
interpretation of the alpha value of the main factor and texture.
|
315 |
-
Allowed Values:
|
316 |
-
|
317 |
-
- `"OPAQUE"` The alpha value is ignored and the rendered output is
|
318 |
-
fully opaque.
|
319 |
-
- `"MASK"` The rendered output is either fully opaque or fully
|
320 |
-
transparent depending on the alpha value and the specified alpha
|
321 |
-
cutoff value.
|
322 |
-
- `"BLEND"` The alpha value is used to composite the source and
|
323 |
-
destination areas. The rendered output is combined with the
|
324 |
-
background using the normal painting operation (i.e. the Porter
|
325 |
-
and Duff over operator).
|
326 |
-
|
327 |
-
alphaCutoff : float, optional
|
328 |
-
Specifies the cutoff threshold when in MASK mode. If the alpha value is
|
329 |
-
greater than or equal to this value then it is rendered as fully
|
330 |
-
opaque, otherwise, it is rendered as fully transparent.
|
331 |
-
A value greater than 1.0 will render the entire material as fully
|
332 |
-
transparent. This value is ignored for other modes.
|
333 |
-
doubleSided : bool, optional
|
334 |
-
Specifies whether the material is double sided. When this value is
|
335 |
-
false, back-face culling is enabled. When this value is true,
|
336 |
-
back-face culling is disabled and double sided lighting is enabled.
|
337 |
-
smooth : bool, optional
|
338 |
-
If True, the material is rendered smoothly by using only one normal
|
339 |
-
per vertex and face indexing.
|
340 |
-
wireframe : bool, optional
|
341 |
-
If True, the material is rendered in wireframe mode.
|
342 |
-
baseColorFactor : (4,) float, optional
|
343 |
-
The RGBA components of the base color of the material. The fourth
|
344 |
-
component (A) is the alpha coverage of the material. The alphaMode
|
345 |
-
property specifies how alpha is interpreted. These values are linear.
|
346 |
-
If a baseColorTexture is specified, this value is multiplied with the
|
347 |
-
texel values.
|
348 |
-
baseColorTexture : (n,n,4) float or :class:`Texture`, optional
|
349 |
-
The base color texture. This texture contains RGB(A) components in sRGB
|
350 |
-
color space. The first three components (RGB) specify the base color of
|
351 |
-
the material. If the fourth component (A) is present, it represents the
|
352 |
-
alpha coverage of the material. Otherwise, an alpha of 1.0 is assumed.
|
353 |
-
The alphaMode property specifies how alpha is interpreted.
|
354 |
-
The stored texels must not be premultiplied.
|
355 |
-
metallicFactor : float
|
356 |
-
The metalness of the material. A value of 1.0 means the material is a
|
357 |
-
metal. A value of 0.0 means the material is a dielectric. Values in
|
358 |
-
between are for blending between metals and dielectrics such as dirty
|
359 |
-
metallic surfaces. This value is linear. If a metallicRoughnessTexture
|
360 |
-
is specified, this value is multiplied with the metallic texel values.
|
361 |
-
roughnessFactor : float
|
362 |
-
The roughness of the material. A value of 1.0 means the material is
|
363 |
-
completely rough. A value of 0.0 means the material is completely
|
364 |
-
smooth. This value is linear. If a metallicRoughnessTexture is
|
365 |
-
specified, this value is multiplied with the roughness texel values.
|
366 |
-
metallicRoughnessTexture : (n,n,2) float or :class:`Texture`, optional
|
367 |
-
The metallic-roughness texture. The metalness values are sampled from
|
368 |
-
the B channel. The roughness values are sampled from the G channel.
|
369 |
-
These values are linear. If other channels are present (R or A), they
|
370 |
-
are ignored for metallic-roughness calculations.
|
371 |
-
"""
|
372 |
-
|
373 |
-
def __init__(self,
|
374 |
-
name=None,
|
375 |
-
normalTexture=None,
|
376 |
-
occlusionTexture=None,
|
377 |
-
emissiveTexture=None,
|
378 |
-
emissiveFactor=None,
|
379 |
-
alphaMode=None,
|
380 |
-
alphaCutoff=None,
|
381 |
-
doubleSided=False,
|
382 |
-
smooth=True,
|
383 |
-
wireframe=False,
|
384 |
-
baseColorFactor=None,
|
385 |
-
baseColorTexture=None,
|
386 |
-
metallicFactor=1.0,
|
387 |
-
roughnessFactor=1.0,
|
388 |
-
metallicRoughnessTexture=None):
|
389 |
-
super(MetallicRoughnessMaterial, self).__init__(
|
390 |
-
name=name,
|
391 |
-
normalTexture=normalTexture,
|
392 |
-
occlusionTexture=occlusionTexture,
|
393 |
-
emissiveTexture=emissiveTexture,
|
394 |
-
emissiveFactor=emissiveFactor,
|
395 |
-
alphaMode=alphaMode,
|
396 |
-
alphaCutoff=alphaCutoff,
|
397 |
-
doubleSided=doubleSided,
|
398 |
-
smooth=smooth,
|
399 |
-
wireframe=wireframe
|
400 |
-
)
|
401 |
-
|
402 |
-
# Set defaults
|
403 |
-
if baseColorFactor is None:
|
404 |
-
baseColorFactor = np.ones(4).astype(np.float32)
|
405 |
-
|
406 |
-
self.baseColorFactor = baseColorFactor
|
407 |
-
self.baseColorTexture = baseColorTexture
|
408 |
-
self.metallicFactor = metallicFactor
|
409 |
-
self.roughnessFactor = roughnessFactor
|
410 |
-
self.metallicRoughnessTexture = metallicRoughnessTexture
|
411 |
-
|
412 |
-
@property
|
413 |
-
def baseColorFactor(self):
|
414 |
-
"""(4,) float or :class:`Texture` : The RGBA base color multiplier.
|
415 |
-
"""
|
416 |
-
return self._baseColorFactor
|
417 |
-
|
418 |
-
@baseColorFactor.setter
|
419 |
-
def baseColorFactor(self, value):
|
420 |
-
if value is None:
|
421 |
-
value = np.ones(4)
|
422 |
-
self._baseColorFactor = format_color_vector(value, 4)
|
423 |
-
|
424 |
-
@property
|
425 |
-
def baseColorTexture(self):
|
426 |
-
"""(n,n,4) float or :class:`Texture` : The diffuse texture.
|
427 |
-
"""
|
428 |
-
return self._baseColorTexture
|
429 |
-
|
430 |
-
@baseColorTexture.setter
|
431 |
-
def baseColorTexture(self, value):
|
432 |
-
self._baseColorTexture = self._format_texture(value, 'RGBA')
|
433 |
-
self._tex_flags = None
|
434 |
-
|
435 |
-
@property
|
436 |
-
def metallicFactor(self):
|
437 |
-
"""float : The metalness of the material.
|
438 |
-
"""
|
439 |
-
return self._metallicFactor
|
440 |
-
|
441 |
-
@metallicFactor.setter
|
442 |
-
def metallicFactor(self, value):
|
443 |
-
if value is None:
|
444 |
-
value = 1.0
|
445 |
-
if value < 0 or value > 1:
|
446 |
-
raise ValueError('Metallic factor must be in range [0,1]')
|
447 |
-
self._metallicFactor = float(value)
|
448 |
-
|
449 |
-
@property
|
450 |
-
def roughnessFactor(self):
|
451 |
-
"""float : The roughness of the material.
|
452 |
-
"""
|
453 |
-
return self.RoughnessFactor
|
454 |
-
|
455 |
-
@roughnessFactor.setter
|
456 |
-
def roughnessFactor(self, value):
|
457 |
-
if value is None:
|
458 |
-
value = 1.0
|
459 |
-
if value < 0 or value > 1:
|
460 |
-
raise ValueError('Roughness factor must be in range [0,1]')
|
461 |
-
self.RoughnessFactor = float(value)
|
462 |
-
|
463 |
-
@property
|
464 |
-
def metallicRoughnessTexture(self):
|
465 |
-
"""(n,n,2) float or :class:`Texture` : The metallic-roughness texture.
|
466 |
-
"""
|
467 |
-
return self._metallicRoughnessTexture
|
468 |
-
|
469 |
-
@metallicRoughnessTexture.setter
|
470 |
-
def metallicRoughnessTexture(self, value):
|
471 |
-
self._metallicRoughnessTexture = self._format_texture(value, 'GB')
|
472 |
-
self._tex_flags = None
|
473 |
-
|
474 |
-
def _compute_tex_flags(self):
|
475 |
-
tex_flags = super(MetallicRoughnessMaterial, self)._compute_tex_flags()
|
476 |
-
if self.baseColorTexture is not None:
|
477 |
-
tex_flags |= TexFlags.BASE_COLOR
|
478 |
-
if self.metallicRoughnessTexture is not None:
|
479 |
-
tex_flags |= TexFlags.METALLIC_ROUGHNESS
|
480 |
-
return tex_flags
|
481 |
-
|
482 |
-
def _compute_transparency(self):
|
483 |
-
if self.alphaMode == 'OPAQUE':
|
484 |
-
return False
|
485 |
-
cutoff = self.alphaCutoff
|
486 |
-
if self.alphaMode == 'BLEND':
|
487 |
-
cutoff = 1.0
|
488 |
-
if self.baseColorFactor[3] < cutoff:
|
489 |
-
return True
|
490 |
-
if (self.baseColorTexture is not None and
|
491 |
-
self.baseColorTexture.is_transparent(cutoff)):
|
492 |
-
return True
|
493 |
-
return False
|
494 |
-
|
495 |
-
def _compute_textures(self):
|
496 |
-
textures = super(MetallicRoughnessMaterial, self)._compute_textures()
|
497 |
-
all_textures = [self.baseColorTexture, self.metallicRoughnessTexture]
|
498 |
-
all_textures = {t for t in all_textures if t is not None}
|
499 |
-
textures |= all_textures
|
500 |
-
return textures
|
501 |
-
|
502 |
-
|
503 |
-
class SpecularGlossinessMaterial(Material):
|
504 |
-
"""A material based on the specular-glossiness material model from
|
505 |
-
Physically-Based Rendering (PBR) methodology.
|
506 |
-
|
507 |
-
Parameters
|
508 |
-
----------
|
509 |
-
name : str, optional
|
510 |
-
The user-defined name of this object.
|
511 |
-
normalTexture : (n,n,3) float or :class:`Texture`, optional
|
512 |
-
A tangent space normal map. The texture contains RGB components in
|
513 |
-
linear space. Each texel represents the XYZ components of a normal
|
514 |
-
vector in tangent space. Red [0 to 255] maps to X [-1 to 1]. Green
|
515 |
-
[0 to 255] maps to Y [-1 to 1]. Blue [128 to 255] maps to Z
|
516 |
-
[1/255 to 1]. The normal vectors use OpenGL conventions where +X is
|
517 |
-
right and +Y is up. +Z points toward the viewer.
|
518 |
-
occlusionTexture : (n,n,1) float or :class:`Texture`, optional
|
519 |
-
The occlusion map texture. The occlusion values are sampled from the R
|
520 |
-
channel. Higher values indicate areas that should receive full indirect
|
521 |
-
lighting and lower values indicate no indirect lighting. These values
|
522 |
-
are linear. If other channels are present (GBA), they are ignored for
|
523 |
-
occlusion calculations.
|
524 |
-
emissiveTexture : (n,n,3) float or :class:`Texture`, optional
|
525 |
-
The emissive map controls the color and intensity of the light being
|
526 |
-
emitted by the material. This texture contains RGB components in sRGB
|
527 |
-
color space. If a fourth component (A) is present, it is ignored.
|
528 |
-
emissiveFactor : (3,) float, optional
|
529 |
-
The RGB components of the emissive color of the material. These values
|
530 |
-
are linear. If an emissiveTexture is specified, this value is
|
531 |
-
multiplied with the texel values.
|
532 |
-
alphaMode : str, optional
|
533 |
-
The material's alpha rendering mode enumeration specifying the
|
534 |
-
interpretation of the alpha value of the main factor and texture.
|
535 |
-
Allowed Values:
|
536 |
-
|
537 |
-
- `"OPAQUE"` The alpha value is ignored and the rendered output is
|
538 |
-
fully opaque.
|
539 |
-
- `"MASK"` The rendered output is either fully opaque or fully
|
540 |
-
transparent depending on the alpha value and the specified alpha
|
541 |
-
cutoff value.
|
542 |
-
- `"BLEND"` The alpha value is used to composite the source and
|
543 |
-
destination areas. The rendered output is combined with the
|
544 |
-
background using the normal painting operation (i.e. the Porter
|
545 |
-
and Duff over operator).
|
546 |
-
|
547 |
-
alphaCutoff : float, optional
|
548 |
-
Specifies the cutoff threshold when in MASK mode. If the alpha value is
|
549 |
-
greater than or equal to this value then it is rendered as fully
|
550 |
-
opaque, otherwise, it is rendered as fully transparent.
|
551 |
-
A value greater than 1.0 will render the entire material as fully
|
552 |
-
transparent. This value is ignored for other modes.
|
553 |
-
doubleSided : bool, optional
|
554 |
-
Specifies whether the material is double sided. When this value is
|
555 |
-
false, back-face culling is enabled. When this value is true,
|
556 |
-
back-face culling is disabled and double sided lighting is enabled.
|
557 |
-
smooth : bool, optional
|
558 |
-
If True, the material is rendered smoothly by using only one normal
|
559 |
-
per vertex and face indexing.
|
560 |
-
wireframe : bool, optional
|
561 |
-
If True, the material is rendered in wireframe mode.
|
562 |
-
diffuseFactor : (4,) float
|
563 |
-
The RGBA components of the reflected diffuse color of the material.
|
564 |
-
Metals have a diffuse value of [0.0, 0.0, 0.0]. The fourth component
|
565 |
-
(A) is the opacity of the material. The values are linear.
|
566 |
-
diffuseTexture : (n,n,4) float or :class:`Texture`, optional
|
567 |
-
The diffuse texture. This texture contains RGB(A) components of the
|
568 |
-
reflected diffuse color of the material in sRGB color space. If the
|
569 |
-
fourth component (A) is present, it represents the alpha coverage of
|
570 |
-
the material. Otherwise, an alpha of 1.0 is assumed.
|
571 |
-
The alphaMode property specifies how alpha is interpreted.
|
572 |
-
The stored texels must not be premultiplied.
|
573 |
-
specularFactor : (3,) float
|
574 |
-
The specular RGB color of the material. This value is linear.
|
575 |
-
glossinessFactor : float
|
576 |
-
The glossiness or smoothness of the material. A value of 1.0 means the
|
577 |
-
material has full glossiness or is perfectly smooth. A value of 0.0
|
578 |
-
means the material has no glossiness or is perfectly rough. This value
|
579 |
-
is linear.
|
580 |
-
specularGlossinessTexture : (n,n,4) or :class:`Texture`, optional
|
581 |
-
The specular-glossiness texture is a RGBA texture, containing the
|
582 |
-
specular color (RGB) in sRGB space and the glossiness value (A) in
|
583 |
-
linear space.
|
584 |
-
"""
|
585 |
-
|
586 |
-
def __init__(self,
|
587 |
-
name=None,
|
588 |
-
normalTexture=None,
|
589 |
-
occlusionTexture=None,
|
590 |
-
emissiveTexture=None,
|
591 |
-
emissiveFactor=None,
|
592 |
-
alphaMode=None,
|
593 |
-
alphaCutoff=None,
|
594 |
-
doubleSided=False,
|
595 |
-
smooth=True,
|
596 |
-
wireframe=False,
|
597 |
-
diffuseFactor=None,
|
598 |
-
diffuseTexture=None,
|
599 |
-
specularFactor=None,
|
600 |
-
glossinessFactor=1.0,
|
601 |
-
specularGlossinessTexture=None):
|
602 |
-
super(SpecularGlossinessMaterial, self).__init__(
|
603 |
-
name=name,
|
604 |
-
normalTexture=normalTexture,
|
605 |
-
occlusionTexture=occlusionTexture,
|
606 |
-
emissiveTexture=emissiveTexture,
|
607 |
-
emissiveFactor=emissiveFactor,
|
608 |
-
alphaMode=alphaMode,
|
609 |
-
alphaCutoff=alphaCutoff,
|
610 |
-
doubleSided=doubleSided,
|
611 |
-
smooth=smooth,
|
612 |
-
wireframe=wireframe
|
613 |
-
)
|
614 |
-
|
615 |
-
# Set defaults
|
616 |
-
if diffuseFactor is None:
|
617 |
-
diffuseFactor = np.ones(4).astype(np.float32)
|
618 |
-
if specularFactor is None:
|
619 |
-
specularFactor = np.ones(3).astype(np.float32)
|
620 |
-
|
621 |
-
self.diffuseFactor = diffuseFactor
|
622 |
-
self.diffuseTexture = diffuseTexture
|
623 |
-
self.specularFactor = specularFactor
|
624 |
-
self.glossinessFactor = glossinessFactor
|
625 |
-
self.specularGlossinessTexture = specularGlossinessTexture
|
626 |
-
|
627 |
-
@property
|
628 |
-
def diffuseFactor(self):
|
629 |
-
"""(4,) float : The diffuse base color.
|
630 |
-
"""
|
631 |
-
return self._diffuseFactor
|
632 |
-
|
633 |
-
@diffuseFactor.setter
|
634 |
-
def diffuseFactor(self, value):
|
635 |
-
self._diffuseFactor = format_color_vector(value, 4)
|
636 |
-
|
637 |
-
@property
|
638 |
-
def diffuseTexture(self):
|
639 |
-
"""(n,n,4) float or :class:`Texture` : The diffuse map.
|
640 |
-
"""
|
641 |
-
return self._diffuseTexture
|
642 |
-
|
643 |
-
@diffuseTexture.setter
|
644 |
-
def diffuseTexture(self, value):
|
645 |
-
self._diffuseTexture = self._format_texture(value, 'RGBA')
|
646 |
-
self._tex_flags = None
|
647 |
-
|
648 |
-
@property
|
649 |
-
def specularFactor(self):
|
650 |
-
"""(3,) float : The specular color of the material.
|
651 |
-
"""
|
652 |
-
return self._specularFactor
|
653 |
-
|
654 |
-
@specularFactor.setter
|
655 |
-
def specularFactor(self, value):
|
656 |
-
self._specularFactor = format_color_vector(value, 3)
|
657 |
-
|
658 |
-
@property
|
659 |
-
def glossinessFactor(self):
|
660 |
-
"""float : The glossiness of the material.
|
661 |
-
"""
|
662 |
-
return self.glossinessFactor
|
663 |
-
|
664 |
-
@glossinessFactor.setter
|
665 |
-
def glossinessFactor(self, value):
|
666 |
-
if value < 0 or value > 1:
|
667 |
-
raise ValueError('glossiness factor must be in range [0,1]')
|
668 |
-
self._glossinessFactor = float(value)
|
669 |
-
|
670 |
-
@property
|
671 |
-
def specularGlossinessTexture(self):
|
672 |
-
"""(n,n,4) or :class:`Texture` : The specular-glossiness texture.
|
673 |
-
"""
|
674 |
-
return self._specularGlossinessTexture
|
675 |
-
|
676 |
-
@specularGlossinessTexture.setter
|
677 |
-
def specularGlossinessTexture(self, value):
|
678 |
-
self._specularGlossinessTexture = self._format_texture(value, 'GB')
|
679 |
-
self._tex_flags = None
|
680 |
-
|
681 |
-
def _compute_tex_flags(self):
|
682 |
-
flags = super(SpecularGlossinessMaterial, self)._compute_tex_flags()
|
683 |
-
if self.diffuseTexture is not None:
|
684 |
-
flags |= TexFlags.DIFFUSE
|
685 |
-
if self.specularGlossinessTexture is not None:
|
686 |
-
flags |= TexFlags.SPECULAR_GLOSSINESS
|
687 |
-
return flags
|
688 |
-
|
689 |
-
def _compute_transparency(self):
|
690 |
-
if self.alphaMode == 'OPAQUE':
|
691 |
-
return False
|
692 |
-
cutoff = self.alphaCutoff
|
693 |
-
if self.alphaMode == 'BLEND':
|
694 |
-
cutoff = 1.0
|
695 |
-
if self.diffuseFactor[3] < cutoff:
|
696 |
-
return True
|
697 |
-
if (self.diffuseTexture is not None and
|
698 |
-
self.diffuseTexture.is_transparent(cutoff)):
|
699 |
-
return True
|
700 |
-
return False
|
701 |
-
|
702 |
-
def _compute_textures(self):
|
703 |
-
textures = super(SpecularGlossinessMaterial, self)._compute_textures()
|
704 |
-
all_textures = [self.diffuseTexture, self.specularGlossinessTexture]
|
705 |
-
all_textures = {t for t in all_textures if t is not None}
|
706 |
-
textures |= all_textures
|
707 |
-
return textures
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AIGC-Audio/Make_An_Audio/ldm/modules/encoders/open_clap/model.py
DELETED
@@ -1,913 +0,0 @@
|
|
1 |
-
""" CLAP Model
|
2 |
-
|
3 |
-
Adapted from CLIP: https://github.com/openai/CLIP. Originally MIT License, Copyright (c) 2021 OpenAI.
|
4 |
-
Adapted to the Audio Task.
|
5 |
-
"""
|
6 |
-
|
7 |
-
from collections import OrderedDict
|
8 |
-
from dataclasses import dataclass
|
9 |
-
from email.mime import audio
|
10 |
-
from typing import Tuple, Union, Callable, Optional
|
11 |
-
|
12 |
-
import numpy as np
|
13 |
-
import torch
|
14 |
-
import torch.nn.functional as F
|
15 |
-
from torch import nn
|
16 |
-
|
17 |
-
from .timm_model import TimmModel
|
18 |
-
import logging
|
19 |
-
from .utils import freeze_batch_norm_2d
|
20 |
-
|
21 |
-
from .pann_model import create_pann_model
|
22 |
-
from .htsat import create_htsat_model
|
23 |
-
from transformers import BertModel, RobertaModel, BartModel
|
24 |
-
from transformers.tokenization_utils_base import BatchEncoding
|
25 |
-
|
26 |
-
|
27 |
-
class MLPLayers(nn.Module):
|
28 |
-
def __init__(self, units=[512, 512, 512], nonlin=nn.ReLU(), dropout=0.1):
|
29 |
-
super(MLPLayers, self).__init__()
|
30 |
-
self.nonlin = nonlin
|
31 |
-
self.dropout = dropout
|
32 |
-
|
33 |
-
sequence = []
|
34 |
-
for u0, u1 in zip(units[:-1], units[1:]):
|
35 |
-
sequence.append(nn.Linear(u0, u1))
|
36 |
-
sequence.append(self.nonlin)
|
37 |
-
sequence.append(nn.Dropout(self.dropout))
|
38 |
-
sequence = sequence[:-2]
|
39 |
-
|
40 |
-
self.sequential = nn.Sequential(*sequence)
|
41 |
-
|
42 |
-
def forward(self, X):
|
43 |
-
X = self.sequential(X)
|
44 |
-
return X
|
45 |
-
|
46 |
-
|
47 |
-
class Bottleneck(nn.Module):
|
48 |
-
expansion = 4
|
49 |
-
|
50 |
-
def __init__(self, inplanes, planes, stride=1):
|
51 |
-
super().__init__()
|
52 |
-
|
53 |
-
# all conv layers have stride 1. an avgpool is performed after the second convolution when stride > 1
|
54 |
-
self.conv1 = nn.Conv2d(inplanes, planes, 1, bias=False)
|
55 |
-
self.bn1 = nn.BatchNorm2d(planes)
|
56 |
-
|
57 |
-
self.conv2 = nn.Conv2d(planes, planes, 3, padding=1, bias=False)
|
58 |
-
self.bn2 = nn.BatchNorm2d(planes)
|
59 |
-
|
60 |
-
self.avgpool = nn.AvgPool2d(stride) if stride > 1 else nn.Identity()
|
61 |
-
|
62 |
-
self.conv3 = nn.Conv2d(planes, planes * self.expansion, 1, bias=False)
|
63 |
-
self.bn3 = nn.BatchNorm2d(planes * self.expansion)
|
64 |
-
|
65 |
-
self.relu = nn.ReLU(inplace=True)
|
66 |
-
self.downsample = None
|
67 |
-
self.stride = stride
|
68 |
-
|
69 |
-
if stride > 1 or inplanes != planes * Bottleneck.expansion:
|
70 |
-
# downsampling layer is prepended with an avgpool, and the subsequent convolution has stride 1
|
71 |
-
self.downsample = nn.Sequential(
|
72 |
-
OrderedDict(
|
73 |
-
[
|
74 |
-
("-1", nn.AvgPool2d(stride)),
|
75 |
-
(
|
76 |
-
"0",
|
77 |
-
nn.Conv2d(
|
78 |
-
inplanes,
|
79 |
-
planes * self.expansion,
|
80 |
-
1,
|
81 |
-
stride=1,
|
82 |
-
bias=False,
|
83 |
-
),
|
84 |
-
),
|
85 |
-
("1", nn.BatchNorm2d(planes * self.expansion)),
|
86 |
-
]
|
87 |
-
)
|
88 |
-
)
|
89 |
-
|
90 |
-
def forward(self, x: torch.Tensor):
|
91 |
-
identity = x
|
92 |
-
|
93 |
-
out = self.relu(self.bn1(self.conv1(x)))
|
94 |
-
out = self.relu(self.bn2(self.conv2(out)))
|
95 |
-
out = self.avgpool(out)
|
96 |
-
out = self.bn3(self.conv3(out))
|
97 |
-
|
98 |
-
if self.downsample is not None:
|
99 |
-
identity = self.downsample(x)
|
100 |
-
|
101 |
-
out += identity
|
102 |
-
out = self.relu(out)
|
103 |
-
return out
|
104 |
-
|
105 |
-
|
106 |
-
class AttentionPool2d(nn.Module):
|
107 |
-
def __init__(
|
108 |
-
self, spacial_dim: int, embed_dim: int, num_heads: int, output_dim: int = None
|
109 |
-
):
|
110 |
-
super().__init__()
|
111 |
-
self.positional_embedding = nn.Parameter(
|
112 |
-
torch.randn(spacial_dim**2 + 1, embed_dim) / embed_dim**0.5
|
113 |
-
)
|
114 |
-
self.k_proj = nn.Linear(embed_dim, embed_dim)
|
115 |
-
self.q_proj = nn.Linear(embed_dim, embed_dim)
|
116 |
-
self.v_proj = nn.Linear(embed_dim, embed_dim)
|
117 |
-
self.c_proj = nn.Linear(embed_dim, output_dim or embed_dim)
|
118 |
-
self.num_heads = num_heads
|
119 |
-
|
120 |
-
def forward(self, x):
|
121 |
-
x = x.reshape(x.shape[0], x.shape[1], x.shape[2] * x.shape[3]).permute(
|
122 |
-
2, 0, 1
|
123 |
-
) # NCHW -> (HW)NC
|
124 |
-
x = torch.cat([x.mean(dim=0, keepdim=True), x], dim=0) # (HW+1)NC
|
125 |
-
x = x + self.positional_embedding[:, None, :].to(x.dtype) # (HW+1)NC
|
126 |
-
x, _ = F.multi_head_attention_forward(
|
127 |
-
query=x,
|
128 |
-
key=x,
|
129 |
-
value=x,
|
130 |
-
embed_dim_to_check=x.shape[-1],
|
131 |
-
num_heads=self.num_heads,
|
132 |
-
q_proj_weight=self.q_proj.weight,
|
133 |
-
k_proj_weight=self.k_proj.weight,
|
134 |
-
v_proj_weight=self.v_proj.weight,
|
135 |
-
in_proj_weight=None,
|
136 |
-
in_proj_bias=torch.cat(
|
137 |
-
[self.q_proj.bias, self.k_proj.bias, self.v_proj.bias]
|
138 |
-
),
|
139 |
-
bias_k=None,
|
140 |
-
bias_v=None,
|
141 |
-
add_zero_attn=False,
|
142 |
-
dropout_p=0,
|
143 |
-
out_proj_weight=self.c_proj.weight,
|
144 |
-
out_proj_bias=self.c_proj.bias,
|
145 |
-
use_separate_proj_weight=True,
|
146 |
-
training=self.training,
|
147 |
-
need_weights=False,
|
148 |
-
)
|
149 |
-
|
150 |
-
return x[0]
|
151 |
-
|
152 |
-
|
153 |
-
class ModifiedResNet(nn.Module):
|
154 |
-
"""
|
155 |
-
A ResNet class that is similar to torchvision's but contains the following changes:
|
156 |
-
- There are now 3 "stem" convolutions as opposed to 1, with an average pool instead of a max pool.
|
157 |
-
- Performs anti-aliasing strided convolutions, where an avgpool is prepended to convolutions with stride > 1
|
158 |
-
- The final pooling layer is a QKV attention instead of an average pool
|
159 |
-
"""
|
160 |
-
|
161 |
-
def __init__(self, layers, output_dim, heads, image_size=224, width=64):
|
162 |
-
super().__init__()
|
163 |
-
self.output_dim = output_dim
|
164 |
-
self.image_size = image_size
|
165 |
-
|
166 |
-
# the 3-layer stem
|
167 |
-
self.conv1 = nn.Conv2d(
|
168 |
-
3, width // 2, kernel_size=3, stride=2, padding=1, bias=False
|
169 |
-
)
|
170 |
-
self.bn1 = nn.BatchNorm2d(width // 2)
|
171 |
-
self.conv2 = nn.Conv2d(
|
172 |
-
width // 2, width // 2, kernel_size=3, padding=1, bias=False
|
173 |
-
)
|
174 |
-
self.bn2 = nn.BatchNorm2d(width // 2)
|
175 |
-
self.conv3 = nn.Conv2d(width // 2, width, kernel_size=3, padding=1, bias=False)
|
176 |
-
self.bn3 = nn.BatchNorm2d(width)
|
177 |
-
self.avgpool = nn.AvgPool2d(2)
|
178 |
-
self.relu = nn.ReLU(inplace=True)
|
179 |
-
|
180 |
-
# residual layers
|
181 |
-
self._inplanes = width # this is a *mutable* variable used during construction
|
182 |
-
self.layer1 = self._make_layer(width, layers[0])
|
183 |
-
self.layer2 = self._make_layer(width * 2, layers[1], stride=2)
|
184 |
-
self.layer3 = self._make_layer(width * 4, layers[2], stride=2)
|
185 |
-
self.layer4 = self._make_layer(width * 8, layers[3], stride=2)
|
186 |
-
|
187 |
-
embed_dim = width * 32 # the ResNet feature dimension
|
188 |
-
self.attnpool = AttentionPool2d(image_size // 32, embed_dim, heads, output_dim)
|
189 |
-
|
190 |
-
self.init_parameters()
|
191 |
-
|
192 |
-
def _make_layer(self, planes, blocks, stride=1):
|
193 |
-
layers = [Bottleneck(self._inplanes, planes, stride)]
|
194 |
-
|
195 |
-
self._inplanes = planes * Bottleneck.expansion
|
196 |
-
for _ in range(1, blocks):
|
197 |
-
layers.append(Bottleneck(self._inplanes, planes))
|
198 |
-
|
199 |
-
return nn.Sequential(*layers)
|
200 |
-
|
201 |
-
def init_parameters(self):
|
202 |
-
if self.attnpool is not None:
|
203 |
-
std = self.attnpool.c_proj.in_features**-0.5
|
204 |
-
nn.init.normal_(self.attnpool.q_proj.weight, std=std)
|
205 |
-
nn.init.normal_(self.attnpool.k_proj.weight, std=std)
|
206 |
-
nn.init.normal_(self.attnpool.v_proj.weight, std=std)
|
207 |
-
nn.init.normal_(self.attnpool.c_proj.weight, std=std)
|
208 |
-
|
209 |
-
for resnet_block in [self.layer1, self.layer2, self.layer3, self.layer4]:
|
210 |
-
for name, param in resnet_block.named_parameters():
|
211 |
-
if name.endswith("bn3.weight"):
|
212 |
-
nn.init.zeros_(param)
|
213 |
-
|
214 |
-
def lock(self, unlocked_groups=0, freeze_bn_stats=False):
|
215 |
-
assert (
|
216 |
-
unlocked_groups == 0
|
217 |
-
), "partial locking not currently supported for this model"
|
218 |
-
for param in self.parameters():
|
219 |
-
param.requires_grad = False
|
220 |
-
if freeze_bn_stats:
|
221 |
-
freeze_batch_norm_2d(self)
|
222 |
-
|
223 |
-
def stem(self, x):
|
224 |
-
for conv, bn in [
|
225 |
-
(self.conv1, self.bn1),
|
226 |
-
(self.conv2, self.bn2),
|
227 |
-
(self.conv3, self.bn3),
|
228 |
-
]:
|
229 |
-
x = self.relu(bn(conv(x)))
|
230 |
-
x = self.avgpool(x)
|
231 |
-
return x
|
232 |
-
|
233 |
-
def forward(self, x):
|
234 |
-
x = self.stem(x)
|
235 |
-
x = self.layer1(x)
|
236 |
-
x = self.layer2(x)
|
237 |
-
x = self.layer3(x)
|
238 |
-
x = self.layer4(x)
|
239 |
-
x = self.attnpool(x)
|
240 |
-
|
241 |
-
return x
|
242 |
-
|
243 |
-
|
244 |
-
class LayerNorm(nn.LayerNorm):
|
245 |
-
"""Subclass torch's LayerNorm to handle fp16."""
|
246 |
-
|
247 |
-
def forward(self, x: torch.Tensor):
|
248 |
-
orig_type = x.dtype
|
249 |
-
x = F.layer_norm(x, self.normalized_shape, self.weight, self.bias, self.eps)
|
250 |
-
return x.to(orig_type)
|
251 |
-
|
252 |
-
|
253 |
-
class QuickGELU(nn.Module):
|
254 |
-
# NOTE This is slower than nn.GELU or nn.SiLU and uses more GPU memory
|
255 |
-
def forward(self, x: torch.Tensor):
|
256 |
-
return x * torch.sigmoid(1.702 * x)
|
257 |
-
|
258 |
-
|
259 |
-
class ResidualAttentionBlock(nn.Module):
|
260 |
-
def __init__(self, d_model: int, n_head: int, act_layer: Callable = nn.GELU):
|
261 |
-
super().__init__()
|
262 |
-
|
263 |
-
self.attn = nn.MultiheadAttention(d_model, n_head)
|
264 |
-
self.ln_1 = LayerNorm(d_model)
|
265 |
-
self.mlp = nn.Sequential(
|
266 |
-
OrderedDict(
|
267 |
-
[
|
268 |
-
("c_fc", nn.Linear(d_model, d_model * 4)),
|
269 |
-
("gelu", act_layer()),
|
270 |
-
("c_proj", nn.Linear(d_model * 4, d_model)),
|
271 |
-
]
|
272 |
-
)
|
273 |
-
)
|
274 |
-
self.ln_2 = LayerNorm(d_model)
|
275 |
-
|
276 |
-
def attention(self, x: torch.Tensor, attn_mask: Optional[torch.Tensor] = None):
|
277 |
-
return self.attn(x, x, x, need_weights=False, attn_mask=attn_mask)[0]
|
278 |
-
|
279 |
-
def forward(self, x: torch.Tensor, attn_mask: Optional[torch.Tensor] = None):
|
280 |
-
x = x + self.attention(self.ln_1(x), attn_mask=attn_mask)
|
281 |
-
x = x + self.mlp(self.ln_2(x))
|
282 |
-
return x
|
283 |
-
|
284 |
-
|
285 |
-
class Transformer(nn.Module):
|
286 |
-
def __init__(
|
287 |
-
self, width: int, layers: int, heads: int, act_layer: Callable = nn.GELU
|
288 |
-
):
|
289 |
-
super().__init__()
|
290 |
-
self.width = width
|
291 |
-
self.layers = layers
|
292 |
-
self.resblocks = nn.ModuleList(
|
293 |
-
[
|
294 |
-
ResidualAttentionBlock(width, heads, act_layer=act_layer)
|
295 |
-
for _ in range(layers)
|
296 |
-
]
|
297 |
-
)
|
298 |
-
|
299 |
-
def forward(self, x: torch.Tensor, attn_mask: Optional[torch.Tensor] = None):
|
300 |
-
for r in self.resblocks:
|
301 |
-
x = r(x, attn_mask=attn_mask)
|
302 |
-
return x
|
303 |
-
|
304 |
-
|
305 |
-
class VisualTransformer(nn.Module):
|
306 |
-
def __init__(
|
307 |
-
self,
|
308 |
-
image_size: int,
|
309 |
-
patch_size: int,
|
310 |
-
width: int,
|
311 |
-
layers: int,
|
312 |
-
heads: int,
|
313 |
-
output_dim: int,
|
314 |
-
act_layer: Callable = nn.GELU,
|
315 |
-
):
|
316 |
-
super().__init__()
|
317 |
-
self.image_size = image_size
|
318 |
-
self.output_dim = output_dim
|
319 |
-
self.conv1 = nn.Conv2d(
|
320 |
-
in_channels=3,
|
321 |
-
out_channels=width,
|
322 |
-
kernel_size=patch_size,
|
323 |
-
stride=patch_size,
|
324 |
-
bias=False,
|
325 |
-
)
|
326 |
-
|
327 |
-
scale = width**-0.5
|
328 |
-
self.class_embedding = nn.Parameter(scale * torch.randn(width))
|
329 |
-
self.positional_embedding = nn.Parameter(
|
330 |
-
scale * torch.randn((image_size // patch_size) ** 2 + 1, width)
|
331 |
-
)
|
332 |
-
self.ln_pre = LayerNorm(width)
|
333 |
-
|
334 |
-
self.text_branch = Transformer(width, layers, heads, act_layer=act_layer)
|
335 |
-
|
336 |
-
self.ln_post = LayerNorm(width)
|
337 |
-
self.proj = nn.Parameter(scale * torch.randn(width, output_dim))
|
338 |
-
|
339 |
-
def lock(self, unlocked_groups=0, freeze_bn_stats=False):
|
340 |
-
assert (
|
341 |
-
unlocked_groups == 0
|
342 |
-
), "partial locking not currently supported for this model"
|
343 |
-
for param in self.parameters():
|
344 |
-
param.requires_grad = False
|
345 |
-
|
346 |
-
def forward(self, x: torch.Tensor):
|
347 |
-
x = self.conv1(x) # shape = [*, width, grid, grid]
|
348 |
-
x = x.reshape(x.shape[0], x.shape[1], -1) # shape = [*, width, grid ** 2]
|
349 |
-
x = x.permute(0, 2, 1) # shape = [*, grid ** 2, width]
|
350 |
-
x = torch.cat(
|
351 |
-
[
|
352 |
-
self.class_embedding.to(x.dtype)
|
353 |
-
+ torch.zeros(
|
354 |
-
x.shape[0], 1, x.shape[-1], dtype=x.dtype, device=x.device
|
355 |
-
),
|
356 |
-
x,
|
357 |
-
],
|
358 |
-
dim=1,
|
359 |
-
) # shape = [*, grid ** 2 + 1, width]
|
360 |
-
x = x + self.positional_embedding.to(x.dtype)
|
361 |
-
x = self.ln_pre(x)
|
362 |
-
|
363 |
-
x = x.permute(1, 0, 2) # NLD -> LND
|
364 |
-
x = self.text_branch(x)
|
365 |
-
x = x.permute(1, 0, 2) # LND -> NLD
|
366 |
-
|
367 |
-
x = self.ln_post(x[:, 0, :])
|
368 |
-
|
369 |
-
if self.proj is not None:
|
370 |
-
x = x @ self.proj
|
371 |
-
|
372 |
-
return x
|
373 |
-
|
374 |
-
|
375 |
-
@dataclass
|
376 |
-
class CLAPVisionCfg:
|
377 |
-
layers: Union[Tuple[int, int, int, int], int] = 12
|
378 |
-
width: int = 768
|
379 |
-
patch_size: int = 16
|
380 |
-
image_size: Union[Tuple[int, int], int] = 224
|
381 |
-
timm_model_name: str = (
|
382 |
-
None # a valid model name overrides layers, width, patch_size
|
383 |
-
)
|
384 |
-
timm_model_pretrained: bool = (
|
385 |
-
False # use (imagenet) pretrained weights for named model
|
386 |
-
)
|
387 |
-
timm_pool: str = (
|
388 |
-
"avg" # feature pooling for timm model ('abs_attn', 'rot_attn', 'avg', '')
|
389 |
-
)
|
390 |
-
timm_proj: str = (
|
391 |
-
"linear" # linear projection for timm model output ('linear', 'mlp', '')
|
392 |
-
)
|
393 |
-
|
394 |
-
|
395 |
-
# Audio Config Class
|
396 |
-
@dataclass
|
397 |
-
class CLAPAudioCfp:
|
398 |
-
model_type: str = "PANN"
|
399 |
-
model_name: str = "Cnn14"
|
400 |
-
sample_rate: int = 48000
|
401 |
-
# Param
|
402 |
-
audio_length: int = 1024
|
403 |
-
window_size: int = 1024
|
404 |
-
hop_size: int = 1024
|
405 |
-
fmin: int = 50
|
406 |
-
fmax: int = 14000
|
407 |
-
class_num: int = 527
|
408 |
-
mel_bins: int = 64
|
409 |
-
clip_samples: int = 480000
|
410 |
-
|
411 |
-
|
412 |
-
@dataclass
|
413 |
-
class CLAPTextCfg:
|
414 |
-
context_length: int
|
415 |
-
vocab_size: int
|
416 |
-
width: int
|
417 |
-
heads: int
|
418 |
-
layers: int
|
419 |
-
model_type: str
|
420 |
-
|
421 |
-
|
422 |
-
class CLAP(nn.Module):
|
423 |
-
def __init__(
|
424 |
-
self,
|
425 |
-
embed_dim: int,
|
426 |
-
audio_cfg: CLAPAudioCfp,
|
427 |
-
text_cfg: CLAPTextCfg,
|
428 |
-
quick_gelu: bool = False,
|
429 |
-
enable_fusion: bool = False,
|
430 |
-
fusion_type: str = 'None',
|
431 |
-
joint_embed_shape: int = 512,
|
432 |
-
mlp_act: str = 'relu',
|
433 |
-
):
|
434 |
-
super().__init__()
|
435 |
-
if isinstance(audio_cfg, dict):
|
436 |
-
audio_cfg = CLAPAudioCfp(**audio_cfg)
|
437 |
-
if isinstance(text_cfg, dict):
|
438 |
-
text_cfg = CLAPTextCfg(**text_cfg)
|
439 |
-
|
440 |
-
self.audio_cfg = audio_cfg
|
441 |
-
self.text_cfg = text_cfg
|
442 |
-
self.enable_fusion = enable_fusion
|
443 |
-
self.fusion_type = fusion_type
|
444 |
-
self.joint_embed_shape = joint_embed_shape
|
445 |
-
self.mlp_act = mlp_act
|
446 |
-
|
447 |
-
|
448 |
-
self.context_length = text_cfg.context_length
|
449 |
-
|
450 |
-
# OpenAI models are pretrained w/ QuickGELU but native nn.GELU is both faster and more
|
451 |
-
# memory efficient in recent PyTorch releases (>= 1.10).
|
452 |
-
# NOTE: timm models always use native GELU regardless of quick_gelu flag.
|
453 |
-
act_layer = QuickGELU if quick_gelu else nn.GELU
|
454 |
-
|
455 |
-
if mlp_act == 'relu':
|
456 |
-
mlp_act_layer = nn.ReLU()
|
457 |
-
elif mlp_act == 'gelu':
|
458 |
-
mlp_act_layer = nn.GELU()
|
459 |
-
else:
|
460 |
-
raise NotImplementedError
|
461 |
-
|
462 |
-
# audio branch
|
463 |
-
# audio branch parameters
|
464 |
-
if audio_cfg.model_type == "PANN":
|
465 |
-
self.audio_branch = create_pann_model(audio_cfg, enable_fusion, fusion_type)
|
466 |
-
elif audio_cfg.model_type == "HTSAT":
|
467 |
-
self.audio_branch = create_htsat_model(audio_cfg, enable_fusion, fusion_type)
|
468 |
-
else:
|
469 |
-
logging.error(f"Model config for {audio_cfg.model_type} not found")
|
470 |
-
raise RuntimeError(f"Model config for {audio_cfg.model_type} not found.")
|
471 |
-
|
472 |
-
|
473 |
-
# text branch
|
474 |
-
# text branch parameters
|
475 |
-
if text_cfg.model_type == "transformer":
|
476 |
-
self.text_branch = Transformer(
|
477 |
-
width=text_cfg.width,
|
478 |
-
layers=text_cfg.layers,
|
479 |
-
heads=text_cfg.heads,
|
480 |
-
act_layer=act_layer,
|
481 |
-
)
|
482 |
-
self.vocab_size = text_cfg.vocab_size
|
483 |
-
self.token_embedding = nn.Embedding(text_cfg.vocab_size, text_cfg.width)
|
484 |
-
self.positional_embedding = nn.Parameter(
|
485 |
-
torch.empty(self.context_length, text_cfg.width)
|
486 |
-
)
|
487 |
-
self.ln_final = LayerNorm(text_cfg.width)
|
488 |
-
self.text_transform = MLPLayers(units=[self.joint_embed_shape,
|
489 |
-
self.joint_embed_shape,
|
490 |
-
self.joint_embed_shape], dropout=0.1)
|
491 |
-
self.text_projection = nn.Sequential(
|
492 |
-
nn.Linear(text_cfg.width, self.joint_embed_shape),
|
493 |
-
mlp_act_layer,
|
494 |
-
nn.Linear(self.joint_embed_shape, self.joint_embed_shape)
|
495 |
-
)
|
496 |
-
elif text_cfg.model_type == "bert":
|
497 |
-
self.text_branch = BertModel.from_pretrained("bert-base-uncased")
|
498 |
-
self.text_transform = MLPLayers(units=[self.joint_embed_shape,
|
499 |
-
self.joint_embed_shape,
|
500 |
-
self.joint_embed_shape], dropout=0.1)
|
501 |
-
self.text_projection = nn.Sequential(
|
502 |
-
nn.Linear(768, self.joint_embed_shape),
|
503 |
-
mlp_act_layer,
|
504 |
-
nn.Linear(self.joint_embed_shape, self.joint_embed_shape)
|
505 |
-
)
|
506 |
-
elif text_cfg.model_type == "roberta":
|
507 |
-
self.text_branch = RobertaModel.from_pretrained('roberta-base')
|
508 |
-
self.text_transform = MLPLayers(units=[self.joint_embed_shape,
|
509 |
-
self.joint_embed_shape,
|
510 |
-
self.joint_embed_shape], dropout=0.1)
|
511 |
-
self.text_projection = nn.Sequential(
|
512 |
-
nn.Linear(768, self.joint_embed_shape),
|
513 |
-
mlp_act_layer,
|
514 |
-
nn.Linear(self.joint_embed_shape, self.joint_embed_shape)
|
515 |
-
)
|
516 |
-
elif text_cfg.model_type == "bart":
|
517 |
-
self.text_branch = BartModel.from_pretrained('facebook/bart-base')
|
518 |
-
self.text_transform = MLPLayers(units=[self.joint_embed_shape,
|
519 |
-
self.joint_embed_shape,
|
520 |
-
self.joint_embed_shape], dropout=0.1)
|
521 |
-
self.text_projection = nn.Sequential(
|
522 |
-
nn.Linear(768, self.joint_embed_shape),
|
523 |
-
mlp_act_layer,
|
524 |
-
nn.Linear(self.joint_embed_shape, self.joint_embed_shape)
|
525 |
-
)
|
526 |
-
else:
|
527 |
-
logging.error(f"Model config for {text_cfg.model_type} not found")
|
528 |
-
raise RuntimeError(f"Model config for {text_cfg.model_type} not found.")
|
529 |
-
self.text_branch_type = text_cfg.model_type
|
530 |
-
# text branch parameters
|
531 |
-
|
532 |
-
# audio branch parameters
|
533 |
-
self.audio_transform = MLPLayers(units=[self.joint_embed_shape,
|
534 |
-
self.joint_embed_shape,
|
535 |
-
self.joint_embed_shape], dropout=0.1)
|
536 |
-
|
537 |
-
# below here is text branch parameters
|
538 |
-
|
539 |
-
# ============================================================================================================
|
540 |
-
self.audio_projection = nn.Sequential(
|
541 |
-
nn.Linear(embed_dim, self.joint_embed_shape),
|
542 |
-
mlp_act_layer,
|
543 |
-
nn.Linear(self.joint_embed_shape, self.joint_embed_shape)
|
544 |
-
)
|
545 |
-
|
546 |
-
self.logit_scale_a = nn.Parameter(torch.ones([]) * np.log(1 / 0.07))
|
547 |
-
self.logit_scale_t = nn.Parameter(torch.ones([]) * np.log(1 / 0.07))
|
548 |
-
self.register_buffer("attn_mask", self.build_attention_mask(), persistent=False)
|
549 |
-
|
550 |
-
self.init_text_branch_parameters()
|
551 |
-
|
552 |
-
def init_text_branch_parameters(self):
|
553 |
-
if self.text_branch_type == "transformer":
|
554 |
-
nn.init.normal_(self.token_embedding.weight, std=0.02)
|
555 |
-
nn.init.normal_(self.positional_embedding, std=0.01)
|
556 |
-
proj_std = (self.text_branch.width**-0.5) * (
|
557 |
-
(2 * self.text_branch.layers) ** -0.5
|
558 |
-
)
|
559 |
-
attn_std = self.text_branch.width**-0.5
|
560 |
-
fc_std = (2 * self.text_branch.width) ** -0.5
|
561 |
-
for block in self.text_branch.resblocks:
|
562 |
-
nn.init.normal_(block.attn.in_proj_weight, std=attn_std)
|
563 |
-
nn.init.normal_(block.attn.out_proj.weight, std=proj_std)
|
564 |
-
nn.init.normal_(block.mlp.c_fc.weight, std=fc_std)
|
565 |
-
nn.init.normal_(block.mlp.c_proj.weight, std=proj_std)
|
566 |
-
if self.text_branch_type == "bert" or self.text_branch_type == "roberta":
|
567 |
-
width = self.text_branch.embeddings.word_embeddings.weight.shape[-1]
|
568 |
-
elif self.text_branch_type == "bart":
|
569 |
-
width = self.text_branch.shared.weight.shape[-1]
|
570 |
-
else:
|
571 |
-
width = self.text_branch.width
|
572 |
-
nn.init.constant_(self.logit_scale_a, np.log(1 / 0.07))
|
573 |
-
nn.init.constant_(self.logit_scale_t, np.log(1 / 0.07))
|
574 |
-
|
575 |
-
# deprecated
|
576 |
-
# if hasattr(self.visual, 'init_parameters'):
|
577 |
-
# self.visual.init_parameters()
|
578 |
-
|
579 |
-
# if self.text_projection is not None:
|
580 |
-
# nn.init.normal_(self.text_projection, std=width**-0.5)
|
581 |
-
|
582 |
-
def build_attention_mask(self):
|
583 |
-
# lazily create causal attention mask, with full attention between the vision tokens
|
584 |
-
# pytorch uses additive attention mask; fill with -inf
|
585 |
-
mask = torch.empty(self.context_length, self.context_length)
|
586 |
-
mask.fill_(float("-inf"))
|
587 |
-
mask.triu_(1) # zero out the lower diagonal
|
588 |
-
return mask
|
589 |
-
|
590 |
-
def encode_audio(self, audio, device):
|
591 |
-
return self.audio_branch(audio, mixup_lambda=None, device=device) # mix lambda needs to add
|
592 |
-
|
593 |
-
# def list_of_dict_of_tensor2dict_of_tensor(self, x, device):
|
594 |
-
# tmp = {}
|
595 |
-
# for k in x[0].keys():
|
596 |
-
# tmp[k] = []
|
597 |
-
# for i in range(len(x)):
|
598 |
-
# tmp[k].append(x[i][k][:77])
|
599 |
-
# for k in x[0].keys():
|
600 |
-
# tmp[k] = torch.tensor(tmp[k]).to(device=device, non_blocking=True)
|
601 |
-
# return tmp
|
602 |
-
|
603 |
-
def encode_text(self, text, device):
|
604 |
-
if self.text_branch_type == "transformer":
|
605 |
-
text = text.to(device=device, non_blocking=True)
|
606 |
-
x = self.token_embedding(text) # [batch_size, n_ctx, d_model]
|
607 |
-
|
608 |
-
x = x + self.positional_embedding
|
609 |
-
x = x.permute(1, 0, 2) # NLD -> LND
|
610 |
-
x = self.text_branch(x, attn_mask=self.attn_mask)
|
611 |
-
x = x.permute(1, 0, 2) # LND -> NLD
|
612 |
-
x = self.ln_final(x)
|
613 |
-
|
614 |
-
# x.shape = [batch_size, n_ctx, transformer.width]
|
615 |
-
# take features from the eot embedding (eot_token is the highest number in each sequence)
|
616 |
-
x = self.text_projection(x[torch.arange(x.shape[0]), text.argmax(dim=-1)])
|
617 |
-
elif self.text_branch_type == "bert":
|
618 |
-
# text = self.list_of_dict_of_tensor2dict_of_tensor(text, device)
|
619 |
-
# text = BatchEncoding(text)
|
620 |
-
x = self.text_branch(
|
621 |
-
input_ids=text["input_ids"].to(device=device, non_blocking=True),
|
622 |
-
attention_mask=text["attention_mask"].to(
|
623 |
-
device=device, non_blocking=True
|
624 |
-
),
|
625 |
-
token_type_ids=text["token_type_ids"].to(
|
626 |
-
device=device, non_blocking=True
|
627 |
-
),
|
628 |
-
)["pooler_output"]
|
629 |
-
x = self.text_projection(x)
|
630 |
-
elif self.text_branch_type == "roberta":
|
631 |
-
x = self.text_branch(
|
632 |
-
input_ids=text["input_ids"].to(device=device, non_blocking=True),
|
633 |
-
attention_mask=text["attention_mask"].to(
|
634 |
-
device=device, non_blocking=True
|
635 |
-
),
|
636 |
-
)["pooler_output"]
|
637 |
-
|
638 |
-
x = self.text_projection(x)
|
639 |
-
elif self.text_branch_type == "bart":
|
640 |
-
x = torch.mean(self.text_branch(
|
641 |
-
input_ids=text["input_ids"].to(device=device, non_blocking=True),
|
642 |
-
attention_mask=text["attention_mask"].to(
|
643 |
-
device=device, non_blocking=True
|
644 |
-
),
|
645 |
-
)["encoder_last_hidden_state"],axis=1)
|
646 |
-
x = self.text_projection(x)
|
647 |
-
else:
|
648 |
-
logging.error(f"Model type {self.text_branch_type} not found")
|
649 |
-
raise RuntimeError(f"Model type {self.text_branch_type} not found.")
|
650 |
-
return x
|
651 |
-
|
652 |
-
def forward(self, audio, text, device=None):
|
653 |
-
"""Forward audio and text into the CLAP
|
654 |
-
|
655 |
-
Parameters
|
656 |
-
----------
|
657 |
-
audio: torch.Tensor (batch_size, audio_length)
|
658 |
-
the time-domain audio input / the batch of mel_spec and longer list.
|
659 |
-
text: torch.Tensor () // need to add
|
660 |
-
the text token input
|
661 |
-
"""
|
662 |
-
if device is None:
|
663 |
-
if audio is not None:
|
664 |
-
device = audio.device
|
665 |
-
elif text is not None:
|
666 |
-
device = text.device
|
667 |
-
if audio is None and text is None:
|
668 |
-
# a hack to get the logit scale
|
669 |
-
return self.logit_scale_a.exp(), self.logit_scale_t.exp()
|
670 |
-
elif audio is None:
|
671 |
-
return self.encode_text(text, device=device)
|
672 |
-
elif text is None:
|
673 |
-
return self.audio_projection(self.encode_audio(audio, device=device)["embedding"])
|
674 |
-
audio_features = self.audio_projection(self.encode_audio(audio, device=device)["embedding"])
|
675 |
-
audio_features = F.normalize(audio_features, dim=-1)
|
676 |
-
|
677 |
-
text_features = self.encode_text(
|
678 |
-
text, device=device
|
679 |
-
)
|
680 |
-
# print("text_features", text_features)
|
681 |
-
# print("text_features.shape", text_features.shape)
|
682 |
-
# print("text_features.type", type(text_features))
|
683 |
-
text_features = F.normalize(text_features, dim=-1)
|
684 |
-
|
685 |
-
audio_features_mlp = self.audio_transform(audio_features)
|
686 |
-
text_features_mlp = self.text_transform(text_features)
|
687 |
-
# Four outputs: audio features (basic & MLP), text features (basic & MLP)
|
688 |
-
return (
|
689 |
-
audio_features,
|
690 |
-
text_features,
|
691 |
-
audio_features_mlp,
|
692 |
-
text_features_mlp,
|
693 |
-
self.logit_scale_a.exp(),
|
694 |
-
self.logit_scale_t.exp(),
|
695 |
-
)
|
696 |
-
|
697 |
-
def get_logit_scale(self):
|
698 |
-
return self.logit_scale_a.exp(), self.logit_scale_t.exp()
|
699 |
-
|
700 |
-
def get_textual_embedding(self, data):
|
701 |
-
|
702 |
-
device = next(self.parameters()).device
|
703 |
-
for k in data:
|
704 |
-
data[k] = data[k].to(device)
|
705 |
-
|
706 |
-
# if self.text_branch_type == "roberta":
|
707 |
-
text_embeds = self.text_branch(
|
708 |
-
input_ids=data["input_ids"].to(device=device, non_blocking=True),
|
709 |
-
attention_mask=data["attention_mask"].to(device=device, non_blocking=True),
|
710 |
-
)["last_hidden_state"]
|
711 |
-
|
712 |
-
text_embeds = self.text_projection(text_embeds)
|
713 |
-
|
714 |
-
text_embeds = F.normalize(text_embeds, dim=-1)
|
715 |
-
|
716 |
-
return text_embeds
|
717 |
-
|
718 |
-
def get_text_embedding(self, data):
|
719 |
-
"""Get the text embedding from the model
|
720 |
-
|
721 |
-
Parameters
|
722 |
-
----------
|
723 |
-
data: torch.Tensor
|
724 |
-
a tensor of text embedding
|
725 |
-
|
726 |
-
Returns
|
727 |
-
----------
|
728 |
-
text_embed: torch.Tensor
|
729 |
-
a tensor of text_embeds (N, D)
|
730 |
-
|
731 |
-
"""
|
732 |
-
device = next(self.parameters()).device
|
733 |
-
for k in data:
|
734 |
-
data[k] = data[k].to(device)
|
735 |
-
text_embeds = self.encode_text(data, device=device)
|
736 |
-
text_embeds = F.normalize(text_embeds, dim=-1)
|
737 |
-
|
738 |
-
return text_embeds
|
739 |
-
|
740 |
-
def get_audio_embedding(self, data):
|
741 |
-
"""Get the audio embedding from the model
|
742 |
-
|
743 |
-
Parameters
|
744 |
-
----------
|
745 |
-
data: a list of dict
|
746 |
-
the audio input dict list from 'get_audio_feature' method
|
747 |
-
|
748 |
-
Returns
|
749 |
-
----------
|
750 |
-
audio_embed: torch.Tensor
|
751 |
-
a tensor of audio_embeds (N, D)
|
752 |
-
|
753 |
-
"""
|
754 |
-
device = next(self.parameters()).device
|
755 |
-
input_dict = {}
|
756 |
-
keys = data[0].keys()
|
757 |
-
for k in keys:
|
758 |
-
input_dict[k] = torch.cat([d[k].unsqueeze(0) for d in data], dim=0).to(device)
|
759 |
-
|
760 |
-
audio_embeds = self.audio_projection(self.encode_audio(input_dict, device=device)["embedding"])
|
761 |
-
audio_embeds = F.normalize(audio_embeds, dim=-1)
|
762 |
-
|
763 |
-
return audio_embeds
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
def audio_infer(self, audio, hopsize=None, device=None):
|
768 |
-
"""Forward one audio and produce the audio embedding
|
769 |
-
|
770 |
-
Parameters
|
771 |
-
----------
|
772 |
-
audio: (audio_length)
|
773 |
-
the time-domain audio input, notice that it must be only one input
|
774 |
-
hopsize: int
|
775 |
-
the overlap hopsize as the sliding window
|
776 |
-
|
777 |
-
Returns
|
778 |
-
----------
|
779 |
-
output_dict: {
|
780 |
-
key: [n, (embedding_shape)] if "HTS-AT"
|
781 |
-
or
|
782 |
-
key: [(embedding_shape)] if "PANN"
|
783 |
-
}
|
784 |
-
the list of key values of the audio branch
|
785 |
-
|
786 |
-
"""
|
787 |
-
|
788 |
-
assert not self.training, "the inference mode must be run at eval stage"
|
789 |
-
output_dict = {}
|
790 |
-
# PANN
|
791 |
-
if self.audio_cfg.model_type == "PANN":
|
792 |
-
audio_input = audio.unsqueeze(dim=0)
|
793 |
-
output_dict[key] = self.encode_audio(audio_input, device=device)[key].squeeze(dim=0)
|
794 |
-
elif self.audio_cfg.model_type == "HTSAT":
|
795 |
-
# repeat
|
796 |
-
audio_len = len(audio)
|
797 |
-
k = self.audio_cfg.clip_samples // audio_len
|
798 |
-
if k > 1:
|
799 |
-
audio = audio.repeat(k)
|
800 |
-
audio_len = len(audio)
|
801 |
-
|
802 |
-
if hopsize is None:
|
803 |
-
hopsize = min(hopsize, audio_len)
|
804 |
-
|
805 |
-
if audio_len > self.audio_cfg.clip_samples:
|
806 |
-
audio_input = [
|
807 |
-
audio[pos : pos + self.audio_cfg.clip_samples].clone()
|
808 |
-
for pos in range(
|
809 |
-
0, audio_len - self.audio_cfg.clip_samples, hopsize
|
810 |
-
)
|
811 |
-
]
|
812 |
-
audio_input.append(audio[-self.audio_cfg.clip_samples :].clone())
|
813 |
-
audio_input = torch.stack(audio_input)
|
814 |
-
output_dict[key] = self.encode_audio(audio_input, device=device)[key]
|
815 |
-
else:
|
816 |
-
audio_input = audio.unsqueeze(dim=0)
|
817 |
-
output_dict[key] = self.encode_audio(audio_input, device=device)[key].squeeze(dim=0)
|
818 |
-
|
819 |
-
return output_dict
|
820 |
-
|
821 |
-
|
822 |
-
def convert_weights_to_fp16(model: nn.Module):
|
823 |
-
"""Convert applicable model parameters to fp16"""
|
824 |
-
|
825 |
-
def _convert_weights_to_fp16(l):
|
826 |
-
if isinstance(l, (nn.Conv1d, nn.Conv2d, nn.Linear)):
|
827 |
-
l.weight.data = l.weight.data.half()
|
828 |
-
if l.bias is not None:
|
829 |
-
l.bias.data = l.bias.data.half()
|
830 |
-
|
831 |
-
if isinstance(l, nn.MultiheadAttention):
|
832 |
-
for attr in [
|
833 |
-
*[f"{s}_proj_weight" for s in ["in", "q", "k", "v"]],
|
834 |
-
"in_proj_bias",
|
835 |
-
"bias_k",
|
836 |
-
"bias_v",
|
837 |
-
]:
|
838 |
-
tensor = getattr(l, attr)
|
839 |
-
if tensor is not None:
|
840 |
-
tensor.data = tensor.data.half()
|
841 |
-
|
842 |
-
for name in ["text_projection", "proj"]:
|
843 |
-
if hasattr(l, name):
|
844 |
-
attr = getattr(l, name)
|
845 |
-
if attr is not None:
|
846 |
-
attr.data = attr.data.half()
|
847 |
-
|
848 |
-
model.apply(_convert_weights_to_fp16)
|
849 |
-
|
850 |
-
|
851 |
-
# Ignore the state dict of the vision part
|
852 |
-
def build_model_from_openai_state_dict(state_dict: dict, model_cfg, enable_fusion: bool = False, fusion_type: str = 'None'):
|
853 |
-
|
854 |
-
embed_dim = model_cfg["embed_dim"]
|
855 |
-
audio_cfg = model_cfg["audio_cfg"]
|
856 |
-
text_cfg = model_cfg["text_cfg"]
|
857 |
-
context_length = state_dict["positional_embedding"].shape[0]
|
858 |
-
vocab_size = state_dict["token_embedding.weight"].shape[0]
|
859 |
-
transformer_width = state_dict["ln_final.weight"].shape[0]
|
860 |
-
transformer_heads = transformer_width // 64
|
861 |
-
transformer_layers = len(
|
862 |
-
set(
|
863 |
-
k.split(".")[2]
|
864 |
-
for k in state_dict
|
865 |
-
if k.startswith(f"transformer.resblocks")
|
866 |
-
)
|
867 |
-
)
|
868 |
-
|
869 |
-
audio_cfg = CLAPAudioCfp(**audio_cfg)
|
870 |
-
text_cfg = CLAPTextCfg(**text_cfg)
|
871 |
-
|
872 |
-
model = CLAP(
|
873 |
-
embed_dim,
|
874 |
-
audio_cfg=audio_cfg,
|
875 |
-
text_cfg=text_cfg,
|
876 |
-
quick_gelu=True, # OpenAI models were trained with QuickGELU
|
877 |
-
enable_fusion=enable_fusion,
|
878 |
-
fusion_type=fusion_type
|
879 |
-
)
|
880 |
-
state_dict["logit_scale_a"] = state_dict["logit_scale"]
|
881 |
-
state_dict["logit_scale_t"] = state_dict["logit_scale"]
|
882 |
-
pop_keys = list(state_dict.keys())[::]
|
883 |
-
# pop the visual branch saved weights
|
884 |
-
for key in pop_keys:
|
885 |
-
if key.startswith("visual."):
|
886 |
-
state_dict.pop(key, None)
|
887 |
-
|
888 |
-
for key in ["logit_scale", "input_resolution", "context_length", "vocab_size"]:
|
889 |
-
state_dict.pop(key, None)
|
890 |
-
|
891 |
-
# not use fp16
|
892 |
-
# convert_weights_to_fp16(model)
|
893 |
-
model.load_state_dict(state_dict, strict=False)
|
894 |
-
return model.eval()
|
895 |
-
|
896 |
-
|
897 |
-
def trace_model(model, batch_size=256, device=torch.device("cpu")):
|
898 |
-
model.eval()
|
899 |
-
audio_length = model.audio_cfg.audio_length
|
900 |
-
example_audio = torch.ones((batch_size, audio_length), device=device)
|
901 |
-
example_text = torch.zeros(
|
902 |
-
(batch_size, model.context_length), dtype=torch.int, device=device
|
903 |
-
)
|
904 |
-
model = torch.jit.trace_module(
|
905 |
-
model,
|
906 |
-
inputs=dict(
|
907 |
-
forward=(example_audio, example_text),
|
908 |
-
encode_text=(example_text,),
|
909 |
-
encode_image=(example_audio,),
|
910 |
-
),
|
911 |
-
)
|
912 |
-
model.audio_cfg.audio_length = audio_length # Question: what does this do?
|
913 |
-
return model
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AchyuthGamer/OpenGPT-Chat-UI/src/lib/stores/errors.ts
DELETED
@@ -1,9 +0,0 @@
|
|
1 |
-
import { writable } from "svelte/store";
|
2 |
-
|
3 |
-
export const ERROR_MESSAGES = {
|
4 |
-
default: "Oops, something went wrong.",
|
5 |
-
authOnly: "You have to be logged in.",
|
6 |
-
rateLimited: "You are sending too many messages. Try again later.",
|
7 |
-
};
|
8 |
-
|
9 |
-
export const error = writable<string | null>(null);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Adapter/T2I-Adapter/ldm/data/dataset_depth.py
DELETED
@@ -1,35 +0,0 @@
|
|
1 |
-
import json
|
2 |
-
import cv2
|
3 |
-
import os
|
4 |
-
from basicsr.utils import img2tensor
|
5 |
-
|
6 |
-
|
7 |
-
class DepthDataset():
|
8 |
-
def __init__(self, meta_file):
|
9 |
-
super(DepthDataset, self).__init__()
|
10 |
-
|
11 |
-
self.files = []
|
12 |
-
with open(meta_file, 'r') as f:
|
13 |
-
lines = f.readlines()
|
14 |
-
for line in lines:
|
15 |
-
img_path = line.strip()
|
16 |
-
depth_img_path = img_path.rsplit('.', 1)[0] + '.depth.png'
|
17 |
-
txt_path = img_path.rsplit('.', 1)[0] + '.txt'
|
18 |
-
self.files.append({'img_path': img_path, 'depth_img_path': depth_img_path, 'txt_path': txt_path})
|
19 |
-
|
20 |
-
def __getitem__(self, idx):
|
21 |
-
file = self.files[idx]
|
22 |
-
|
23 |
-
im = cv2.imread(file['img_path'])
|
24 |
-
im = img2tensor(im, bgr2rgb=True, float32=True) / 255.
|
25 |
-
|
26 |
-
depth = cv2.imread(file['depth_img_path']) # [:,:,0]
|
27 |
-
depth = img2tensor(depth, bgr2rgb=True, float32=True) / 255. # [0].unsqueeze(0)#/255.
|
28 |
-
|
29 |
-
with open(file['txt_path'], 'r') as fs:
|
30 |
-
sentence = fs.readline().strip()
|
31 |
-
|
32 |
-
return {'im': im, 'depth': depth, 'sentence': sentence}
|
33 |
-
|
34 |
-
def __len__(self):
|
35 |
-
return len(self.files)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AeroXi/english-ai/README.md
DELETED
@@ -1,13 +0,0 @@
|
|
1 |
-
---
|
2 |
-
title: English Ai
|
3 |
-
emoji: ⚡
|
4 |
-
colorFrom: green
|
5 |
-
colorTo: purple
|
6 |
-
sdk: gradio
|
7 |
-
sdk_version: 3.24.1
|
8 |
-
app_file: app.py
|
9 |
-
pinned: false
|
10 |
-
license: mit
|
11 |
-
---
|
12 |
-
|
13 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AgentVerse/agentVerse/agentverse/agents/base.py
DELETED
@@ -1,101 +0,0 @@
|
|
1 |
-
import logging
|
2 |
-
from abc import abstractmethod
|
3 |
-
from typing import List, NamedTuple, Set, Union
|
4 |
-
from string import Template
|
5 |
-
|
6 |
-
from pydantic import BaseModel, Field
|
7 |
-
|
8 |
-
from agentverse.llms import BaseLLM
|
9 |
-
from agentverse.memory import BaseMemory, ChatHistoryMemory
|
10 |
-
from agentverse.message import Message
|
11 |
-
from agentverse.output_parser import OutputParser
|
12 |
-
from agentverse.memory_manipulator import BaseMemoryManipulator
|
13 |
-
|
14 |
-
|
15 |
-
class BaseAgent(BaseModel):
|
16 |
-
name: str
|
17 |
-
llm: BaseLLM
|
18 |
-
output_parser: OutputParser
|
19 |
-
prepend_prompt_template: str = Field(default="")
|
20 |
-
append_prompt_template: str = Field(default="")
|
21 |
-
prompt_template: str = Field(default="")
|
22 |
-
role_description: str = Field(default="")
|
23 |
-
memory: BaseMemory = Field(default_factory=ChatHistoryMemory)
|
24 |
-
memory_manipulator: BaseMemoryManipulator = Field(
|
25 |
-
default_factory=BaseMemoryManipulator
|
26 |
-
)
|
27 |
-
max_retry: int = Field(default=3)
|
28 |
-
receiver: Set[str] = Field(default=set({"all"}))
|
29 |
-
async_mode: bool = Field(default=True)
|
30 |
-
|
31 |
-
@abstractmethod
|
32 |
-
def step(self, env_description: str = "") -> Message:
|
33 |
-
"""Get one step response"""
|
34 |
-
pass
|
35 |
-
|
36 |
-
@abstractmethod
|
37 |
-
def astep(self, env_description: str = "") -> Message:
|
38 |
-
"""Asynchronous version of step"""
|
39 |
-
pass
|
40 |
-
|
41 |
-
@abstractmethod
|
42 |
-
def reset(self) -> None:
|
43 |
-
"""Reset the agent"""
|
44 |
-
pass
|
45 |
-
|
46 |
-
@abstractmethod
|
47 |
-
def add_message_to_memory(self, messages: List[Message]) -> None:
|
48 |
-
"""Add a message to the memory"""
|
49 |
-
pass
|
50 |
-
|
51 |
-
def get_spend(self) -> float:
|
52 |
-
return self.llm.get_spend()
|
53 |
-
|
54 |
-
def get_spend_formatted(self) -> str:
|
55 |
-
two_trailing = f"${self.get_spend():.2f}"
|
56 |
-
if two_trailing == "$0.00":
|
57 |
-
return f"${self.get_spend():.6f}"
|
58 |
-
return two_trailing
|
59 |
-
|
60 |
-
def get_all_prompts(self, **kwargs):
|
61 |
-
prepend_prompt = Template(self.prepend_prompt_template).safe_substitute(
|
62 |
-
**kwargs
|
63 |
-
)
|
64 |
-
append_prompt = Template(self.append_prompt_template).safe_substitute(**kwargs)
|
65 |
-
return prepend_prompt, append_prompt
|
66 |
-
|
67 |
-
def get_receiver(self) -> Set[str]:
|
68 |
-
return self.receiver
|
69 |
-
|
70 |
-
def set_receiver(self, receiver: Union[Set[str], str]) -> None:
|
71 |
-
if isinstance(receiver, str):
|
72 |
-
self.receiver = set({receiver})
|
73 |
-
elif isinstance(receiver, set):
|
74 |
-
self.receiver = receiver
|
75 |
-
else:
|
76 |
-
raise ValueError(
|
77 |
-
"input argument `receiver` must be a string or a set of string"
|
78 |
-
)
|
79 |
-
|
80 |
-
def add_receiver(self, receiver: Union[Set[str], str]) -> None:
|
81 |
-
if isinstance(receiver, str):
|
82 |
-
self.receiver.add(receiver)
|
83 |
-
elif isinstance(receiver, set):
|
84 |
-
self.receiver = self.receiver.union(receiver)
|
85 |
-
else:
|
86 |
-
raise ValueError(
|
87 |
-
"input argument `receiver` must be a string or a set of string"
|
88 |
-
)
|
89 |
-
|
90 |
-
def remove_receiver(self, receiver: Union[Set[str], str]) -> None:
|
91 |
-
if isinstance(receiver, str):
|
92 |
-
try:
|
93 |
-
self.receiver.remove(receiver)
|
94 |
-
except KeyError as e:
|
95 |
-
logging.warning(f"Receiver {receiver} not found.")
|
96 |
-
elif isinstance(receiver, set):
|
97 |
-
self.receiver = self.receiver.difference(receiver)
|
98 |
-
else:
|
99 |
-
raise ValueError(
|
100 |
-
"input argument `receiver` must be a string or a set of string"
|
101 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/maker/builders/CreateDialog.js
DELETED
@@ -1,31 +0,0 @@
|
|
1 |
-
import MergeStyle from './utils/MergeStyle.js';
|
2 |
-
import Dialog from '../../dialog/Dialog.js';
|
3 |
-
import CreateChild from './utils/CreateChild.js';
|
4 |
-
import CreateChildren from './utils/CreateChildren.js';
|
5 |
-
|
6 |
-
var CreateDialog = function (scene, data, view, styles, customBuilders) {
|
7 |
-
data = MergeStyle(data, styles);
|
8 |
-
|
9 |
-
// Replace data by child game object
|
10 |
-
CreateChild(scene, data, 'background', view, styles, customBuilders);
|
11 |
-
CreateChild(scene, data, 'toolbarBackground', view, styles, customBuilders);
|
12 |
-
CreateChild(scene, data, 'leftToolbarBackground', view, styles, customBuilders);
|
13 |
-
CreateChild(scene, data, 'choicesBackground', view, styles, customBuilders);
|
14 |
-
CreateChild(scene, data, 'actionsBackground', view, styles, customBuilders);
|
15 |
-
|
16 |
-
CreateChild(scene, data, 'title', view, styles, customBuilders);
|
17 |
-
CreateChildren(scene, data, 'toolbar', view, styles, customBuilders);
|
18 |
-
CreateChildren(scene, data, 'leftToolbar', view, styles, customBuilders);
|
19 |
-
|
20 |
-
CreateChild(scene, data, 'content', view, styles, customBuilders);
|
21 |
-
CreateChild(scene, data, 'description', view, styles, customBuilders);
|
22 |
-
|
23 |
-
CreateChildren(scene, data, 'choices', view, styles, customBuilders);
|
24 |
-
CreateChildren(scene, data, 'actions', view, styles, customBuilders);
|
25 |
-
|
26 |
-
var gameObject = new Dialog(scene, data);
|
27 |
-
scene.add.existing(gameObject);
|
28 |
-
return gameObject;
|
29 |
-
};
|
30 |
-
|
31 |
-
export default CreateDialog;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AgentVerse/agentVerse/ui/src/phaser3-rex-plugins/templates/ui/numberbar/NumberBar.d.ts
DELETED
@@ -1,71 +0,0 @@
|
|
1 |
-
// import * as Phaser from 'phaser';
|
2 |
-
import Sizer from '../sizer/Sizer';
|
3 |
-
import RoundRecrangle from '../../../plugins/roundrectangle';
|
4 |
-
|
5 |
-
export default NumberBar;
|
6 |
-
|
7 |
-
declare namespace NumberBar {
|
8 |
-
|
9 |
-
type SliderInputTypes = 0 | 1 | -1 | 'drag' | 'pan' | 'click' | 'none';
|
10 |
-
|
11 |
-
interface IConfig extends Sizer.IConfig {
|
12 |
-
space?: {
|
13 |
-
left?: number,
|
14 |
-
right?: number,
|
15 |
-
top?: number,
|
16 |
-
bottom?: number,
|
17 |
-
|
18 |
-
icon?: number,
|
19 |
-
slider?: number,
|
20 |
-
},
|
21 |
-
|
22 |
-
background?: Phaser.GameObjects.GameObject,
|
23 |
-
|
24 |
-
icon?: Phaser.GameObjects.GameObject,
|
25 |
-
|
26 |
-
iconMask?: boolean,
|
27 |
-
|
28 |
-
slider?: {
|
29 |
-
background?: Phaser.GameObjects.GameObject | RoundRecrangle.IConfig,
|
30 |
-
track?: Phaser.GameObjects.GameObject | RoundRecrangle.IConfig,
|
31 |
-
indicator?: Phaser.GameObjects.GameObject | RoundRecrangle.IConfig,
|
32 |
-
thumb?: Phaser.GameObjects.GameObject | RoundRecrangle.IConfig,
|
33 |
-
input?: SliderInputTypes,
|
34 |
-
gap?: number,
|
35 |
-
easeValue?: {
|
36 |
-
duration?: number,
|
37 |
-
ease?: string
|
38 |
-
},
|
39 |
-
}
|
40 |
-
|
41 |
-
text?: Phaser.GameObjects.GameObject,
|
42 |
-
|
43 |
-
valuechangeCallback?: (newValue: number, oldValue: number, numberBar: NumberBar) => void,
|
44 |
-
|
45 |
-
enable?: boolean,
|
46 |
-
}
|
47 |
-
}
|
48 |
-
|
49 |
-
declare class NumberBar extends Sizer {
|
50 |
-
constructor(
|
51 |
-
scene: Phaser.Scene,
|
52 |
-
config?: NumberBar.IConfig
|
53 |
-
);
|
54 |
-
|
55 |
-
value: number;
|
56 |
-
getValue(min?: number, max?: number): number;
|
57 |
-
setValue(value?: number, min?: number, max?: number): this;
|
58 |
-
addValue(inc?: number, min?: number, max?: number): this;
|
59 |
-
|
60 |
-
easeValueTo(value?: number, min?: number, max?: number): this;
|
61 |
-
stopEaseValue(): this;
|
62 |
-
setEaseValueDuration(duration: number): this;
|
63 |
-
setEaseValueFunction(ease: string): this;
|
64 |
-
|
65 |
-
setEnable(enable?: boolean): this;
|
66 |
-
enable: boolean;
|
67 |
-
|
68 |
-
text: string;
|
69 |
-
setText(text: string): this;
|
70 |
-
|
71 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/AlekseyKorshuk/thin-plate-spline-motion-model/checkpoints/README.md
DELETED
@@ -1 +0,0 @@
|
|
1 |
-
# Checkpoints
|
|
|
|
spaces/Aloento/9Nine-VITS/text/symbols.py
DELETED
@@ -1,18 +0,0 @@
|
|
1 |
-
""" from https://github.com/keithito/tacotron """
|
2 |
-
|
3 |
-
'''
|
4 |
-
Defines the set of symbols used in text input to the model.
|
5 |
-
'''
|
6 |
-
|
7 |
-
|
8 |
-
# japanese_cleaners
|
9 |
-
_pad = '_'
|
10 |
-
_punctuation = ',.!?-~…'
|
11 |
-
_letters = 'AEINOQUabdefghijkmnoprstuvwyzʃʧʦ↓↑ '
|
12 |
-
|
13 |
-
|
14 |
-
# Export all symbols:
|
15 |
-
symbols = [_pad] + list(_punctuation) + list(_letters)
|
16 |
-
|
17 |
-
# Special symbol ids
|
18 |
-
SPACE_ID = symbols.index(" ")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/src/diffusers/pipelines/deepfloyd_if/__init__.py
DELETED
@@ -1,54 +0,0 @@
|
|
1 |
-
from dataclasses import dataclass
|
2 |
-
from typing import List, Optional, Union
|
3 |
-
|
4 |
-
import numpy as np
|
5 |
-
import PIL
|
6 |
-
|
7 |
-
from ...utils import BaseOutput, OptionalDependencyNotAvailable, is_torch_available, is_transformers_available
|
8 |
-
from .timesteps import (
|
9 |
-
fast27_timesteps,
|
10 |
-
smart27_timesteps,
|
11 |
-
smart50_timesteps,
|
12 |
-
smart100_timesteps,
|
13 |
-
smart185_timesteps,
|
14 |
-
super27_timesteps,
|
15 |
-
super40_timesteps,
|
16 |
-
super100_timesteps,
|
17 |
-
)
|
18 |
-
|
19 |
-
|
20 |
-
@dataclass
|
21 |
-
class IFPipelineOutput(BaseOutput):
|
22 |
-
"""
|
23 |
-
Args:
|
24 |
-
Output class for Stable Diffusion pipelines.
|
25 |
-
images (`List[PIL.Image.Image]` or `np.ndarray`)
|
26 |
-
List of denoised PIL images of length `batch_size` or numpy array of shape `(batch_size, height, width,
|
27 |
-
num_channels)`. PIL images or numpy array present the denoised images of the diffusion pipeline.
|
28 |
-
nsfw_detected (`List[bool]`)
|
29 |
-
List of flags denoting whether the corresponding generated image likely represents "not-safe-for-work"
|
30 |
-
(nsfw) content or a watermark. `None` if safety checking could not be performed.
|
31 |
-
watermark_detected (`List[bool]`)
|
32 |
-
List of flags denoting whether the corresponding generated image likely has a watermark. `None` if safety
|
33 |
-
checking could not be performed.
|
34 |
-
"""
|
35 |
-
|
36 |
-
images: Union[List[PIL.Image.Image], np.ndarray]
|
37 |
-
nsfw_detected: Optional[List[bool]]
|
38 |
-
watermark_detected: Optional[List[bool]]
|
39 |
-
|
40 |
-
|
41 |
-
try:
|
42 |
-
if not (is_transformers_available() and is_torch_available()):
|
43 |
-
raise OptionalDependencyNotAvailable()
|
44 |
-
except OptionalDependencyNotAvailable:
|
45 |
-
from ...utils.dummy_torch_and_transformers_objects import * # noqa F403
|
46 |
-
else:
|
47 |
-
from .pipeline_if import IFPipeline
|
48 |
-
from .pipeline_if_img2img import IFImg2ImgPipeline
|
49 |
-
from .pipeline_if_img2img_superresolution import IFImg2ImgSuperResolutionPipeline
|
50 |
-
from .pipeline_if_inpainting import IFInpaintingPipeline
|
51 |
-
from .pipeline_if_inpainting_superresolution import IFInpaintingSuperResolutionPipeline
|
52 |
-
from .pipeline_if_superresolution import IFSuperResolutionPipeline
|
53 |
-
from .safety_checker import IFSafetyChecker
|
54 |
-
from .watermark import IFWatermarker
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/tests/pipelines/audioldm/test_audioldm.py
DELETED
@@ -1,426 +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 |
-
|
17 |
-
import gc
|
18 |
-
import unittest
|
19 |
-
|
20 |
-
import numpy as np
|
21 |
-
import torch
|
22 |
-
import torch.nn.functional as F
|
23 |
-
from transformers import (
|
24 |
-
ClapTextConfig,
|
25 |
-
ClapTextModelWithProjection,
|
26 |
-
RobertaTokenizer,
|
27 |
-
SpeechT5HifiGan,
|
28 |
-
SpeechT5HifiGanConfig,
|
29 |
-
)
|
30 |
-
|
31 |
-
from diffusers import (
|
32 |
-
AudioLDMPipeline,
|
33 |
-
AutoencoderKL,
|
34 |
-
DDIMScheduler,
|
35 |
-
LMSDiscreteScheduler,
|
36 |
-
PNDMScheduler,
|
37 |
-
UNet2DConditionModel,
|
38 |
-
)
|
39 |
-
from diffusers.utils import is_xformers_available, slow, torch_device
|
40 |
-
from diffusers.utils.testing_utils import enable_full_determinism
|
41 |
-
|
42 |
-
from ..pipeline_params import TEXT_TO_AUDIO_BATCH_PARAMS, TEXT_TO_AUDIO_PARAMS
|
43 |
-
from ..test_pipelines_common import PipelineTesterMixin
|
44 |
-
|
45 |
-
|
46 |
-
enable_full_determinism()
|
47 |
-
|
48 |
-
|
49 |
-
class AudioLDMPipelineFastTests(PipelineTesterMixin, unittest.TestCase):
|
50 |
-
pipeline_class = AudioLDMPipeline
|
51 |
-
params = TEXT_TO_AUDIO_PARAMS
|
52 |
-
batch_params = TEXT_TO_AUDIO_BATCH_PARAMS
|
53 |
-
required_optional_params = frozenset(
|
54 |
-
[
|
55 |
-
"num_inference_steps",
|
56 |
-
"num_waveforms_per_prompt",
|
57 |
-
"generator",
|
58 |
-
"latents",
|
59 |
-
"output_type",
|
60 |
-
"return_dict",
|
61 |
-
"callback",
|
62 |
-
"callback_steps",
|
63 |
-
]
|
64 |
-
)
|
65 |
-
|
66 |
-
def get_dummy_components(self):
|
67 |
-
torch.manual_seed(0)
|
68 |
-
unet = UNet2DConditionModel(
|
69 |
-
block_out_channels=(32, 64),
|
70 |
-
layers_per_block=2,
|
71 |
-
sample_size=32,
|
72 |
-
in_channels=4,
|
73 |
-
out_channels=4,
|
74 |
-
down_block_types=("DownBlock2D", "CrossAttnDownBlock2D"),
|
75 |
-
up_block_types=("CrossAttnUpBlock2D", "UpBlock2D"),
|
76 |
-
cross_attention_dim=(32, 64),
|
77 |
-
class_embed_type="simple_projection",
|
78 |
-
projection_class_embeddings_input_dim=32,
|
79 |
-
class_embeddings_concat=True,
|
80 |
-
)
|
81 |
-
scheduler = DDIMScheduler(
|
82 |
-
beta_start=0.00085,
|
83 |
-
beta_end=0.012,
|
84 |
-
beta_schedule="scaled_linear",
|
85 |
-
clip_sample=False,
|
86 |
-
set_alpha_to_one=False,
|
87 |
-
)
|
88 |
-
torch.manual_seed(0)
|
89 |
-
vae = AutoencoderKL(
|
90 |
-
block_out_channels=[32, 64],
|
91 |
-
in_channels=1,
|
92 |
-
out_channels=1,
|
93 |
-
down_block_types=["DownEncoderBlock2D", "DownEncoderBlock2D"],
|
94 |
-
up_block_types=["UpDecoderBlock2D", "UpDecoderBlock2D"],
|
95 |
-
latent_channels=4,
|
96 |
-
)
|
97 |
-
torch.manual_seed(0)
|
98 |
-
text_encoder_config = ClapTextConfig(
|
99 |
-
bos_token_id=0,
|
100 |
-
eos_token_id=2,
|
101 |
-
hidden_size=32,
|
102 |
-
intermediate_size=37,
|
103 |
-
layer_norm_eps=1e-05,
|
104 |
-
num_attention_heads=4,
|
105 |
-
num_hidden_layers=5,
|
106 |
-
pad_token_id=1,
|
107 |
-
vocab_size=1000,
|
108 |
-
projection_dim=32,
|
109 |
-
)
|
110 |
-
text_encoder = ClapTextModelWithProjection(text_encoder_config)
|
111 |
-
tokenizer = RobertaTokenizer.from_pretrained("hf-internal-testing/tiny-random-roberta", model_max_length=77)
|
112 |
-
|
113 |
-
vocoder_config = SpeechT5HifiGanConfig(
|
114 |
-
model_in_dim=8,
|
115 |
-
sampling_rate=16000,
|
116 |
-
upsample_initial_channel=16,
|
117 |
-
upsample_rates=[2, 2],
|
118 |
-
upsample_kernel_sizes=[4, 4],
|
119 |
-
resblock_kernel_sizes=[3, 7],
|
120 |
-
resblock_dilation_sizes=[[1, 3, 5], [1, 3, 5]],
|
121 |
-
normalize_before=False,
|
122 |
-
)
|
123 |
-
|
124 |
-
vocoder = SpeechT5HifiGan(vocoder_config)
|
125 |
-
|
126 |
-
components = {
|
127 |
-
"unet": unet,
|
128 |
-
"scheduler": scheduler,
|
129 |
-
"vae": vae,
|
130 |
-
"text_encoder": text_encoder,
|
131 |
-
"tokenizer": tokenizer,
|
132 |
-
"vocoder": vocoder,
|
133 |
-
}
|
134 |
-
return components
|
135 |
-
|
136 |
-
def get_dummy_inputs(self, device, seed=0):
|
137 |
-
if str(device).startswith("mps"):
|
138 |
-
generator = torch.manual_seed(seed)
|
139 |
-
else:
|
140 |
-
generator = torch.Generator(device=device).manual_seed(seed)
|
141 |
-
inputs = {
|
142 |
-
"prompt": "A hammer hitting a wooden surface",
|
143 |
-
"generator": generator,
|
144 |
-
"num_inference_steps": 2,
|
145 |
-
"guidance_scale": 6.0,
|
146 |
-
}
|
147 |
-
return inputs
|
148 |
-
|
149 |
-
def test_audioldm_ddim(self):
|
150 |
-
device = "cpu" # ensure determinism for the device-dependent torch.Generator
|
151 |
-
|
152 |
-
components = self.get_dummy_components()
|
153 |
-
audioldm_pipe = AudioLDMPipeline(**components)
|
154 |
-
audioldm_pipe = audioldm_pipe.to(torch_device)
|
155 |
-
audioldm_pipe.set_progress_bar_config(disable=None)
|
156 |
-
|
157 |
-
inputs = self.get_dummy_inputs(device)
|
158 |
-
output = audioldm_pipe(**inputs)
|
159 |
-
audio = output.audios[0]
|
160 |
-
|
161 |
-
assert audio.ndim == 1
|
162 |
-
assert len(audio) == 256
|
163 |
-
|
164 |
-
audio_slice = audio[:10]
|
165 |
-
expected_slice = np.array(
|
166 |
-
[-0.0050, 0.0050, -0.0060, 0.0033, -0.0026, 0.0033, -0.0027, 0.0033, -0.0028, 0.0033]
|
167 |
-
)
|
168 |
-
|
169 |
-
assert np.abs(audio_slice - expected_slice).max() < 1e-2
|
170 |
-
|
171 |
-
def test_audioldm_prompt_embeds(self):
|
172 |
-
components = self.get_dummy_components()
|
173 |
-
audioldm_pipe = AudioLDMPipeline(**components)
|
174 |
-
audioldm_pipe = audioldm_pipe.to(torch_device)
|
175 |
-
audioldm_pipe = audioldm_pipe.to(torch_device)
|
176 |
-
audioldm_pipe.set_progress_bar_config(disable=None)
|
177 |
-
|
178 |
-
inputs = self.get_dummy_inputs(torch_device)
|
179 |
-
inputs["prompt"] = 3 * [inputs["prompt"]]
|
180 |
-
|
181 |
-
# forward
|
182 |
-
output = audioldm_pipe(**inputs)
|
183 |
-
audio_1 = output.audios[0]
|
184 |
-
|
185 |
-
inputs = self.get_dummy_inputs(torch_device)
|
186 |
-
prompt = 3 * [inputs.pop("prompt")]
|
187 |
-
|
188 |
-
text_inputs = audioldm_pipe.tokenizer(
|
189 |
-
prompt,
|
190 |
-
padding="max_length",
|
191 |
-
max_length=audioldm_pipe.tokenizer.model_max_length,
|
192 |
-
truncation=True,
|
193 |
-
return_tensors="pt",
|
194 |
-
)
|
195 |
-
text_inputs = text_inputs["input_ids"].to(torch_device)
|
196 |
-
|
197 |
-
prompt_embeds = audioldm_pipe.text_encoder(
|
198 |
-
text_inputs,
|
199 |
-
)
|
200 |
-
prompt_embeds = prompt_embeds.text_embeds
|
201 |
-
# additional L_2 normalization over each hidden-state
|
202 |
-
prompt_embeds = F.normalize(prompt_embeds, dim=-1)
|
203 |
-
|
204 |
-
inputs["prompt_embeds"] = prompt_embeds
|
205 |
-
|
206 |
-
# forward
|
207 |
-
output = audioldm_pipe(**inputs)
|
208 |
-
audio_2 = output.audios[0]
|
209 |
-
|
210 |
-
assert np.abs(audio_1 - audio_2).max() < 1e-2
|
211 |
-
|
212 |
-
def test_audioldm_negative_prompt_embeds(self):
|
213 |
-
components = self.get_dummy_components()
|
214 |
-
audioldm_pipe = AudioLDMPipeline(**components)
|
215 |
-
audioldm_pipe = audioldm_pipe.to(torch_device)
|
216 |
-
audioldm_pipe = audioldm_pipe.to(torch_device)
|
217 |
-
audioldm_pipe.set_progress_bar_config(disable=None)
|
218 |
-
|
219 |
-
inputs = self.get_dummy_inputs(torch_device)
|
220 |
-
negative_prompt = 3 * ["this is a negative prompt"]
|
221 |
-
inputs["negative_prompt"] = negative_prompt
|
222 |
-
inputs["prompt"] = 3 * [inputs["prompt"]]
|
223 |
-
|
224 |
-
# forward
|
225 |
-
output = audioldm_pipe(**inputs)
|
226 |
-
audio_1 = output.audios[0]
|
227 |
-
|
228 |
-
inputs = self.get_dummy_inputs(torch_device)
|
229 |
-
prompt = 3 * [inputs.pop("prompt")]
|
230 |
-
|
231 |
-
embeds = []
|
232 |
-
for p in [prompt, negative_prompt]:
|
233 |
-
text_inputs = audioldm_pipe.tokenizer(
|
234 |
-
p,
|
235 |
-
padding="max_length",
|
236 |
-
max_length=audioldm_pipe.tokenizer.model_max_length,
|
237 |
-
truncation=True,
|
238 |
-
return_tensors="pt",
|
239 |
-
)
|
240 |
-
text_inputs = text_inputs["input_ids"].to(torch_device)
|
241 |
-
|
242 |
-
text_embeds = audioldm_pipe.text_encoder(
|
243 |
-
text_inputs,
|
244 |
-
)
|
245 |
-
text_embeds = text_embeds.text_embeds
|
246 |
-
# additional L_2 normalization over each hidden-state
|
247 |
-
text_embeds = F.normalize(text_embeds, dim=-1)
|
248 |
-
|
249 |
-
embeds.append(text_embeds)
|
250 |
-
|
251 |
-
inputs["prompt_embeds"], inputs["negative_prompt_embeds"] = embeds
|
252 |
-
|
253 |
-
# forward
|
254 |
-
output = audioldm_pipe(**inputs)
|
255 |
-
audio_2 = output.audios[0]
|
256 |
-
|
257 |
-
assert np.abs(audio_1 - audio_2).max() < 1e-2
|
258 |
-
|
259 |
-
def test_audioldm_negative_prompt(self):
|
260 |
-
device = "cpu" # ensure determinism for the device-dependent torch.Generator
|
261 |
-
components = self.get_dummy_components()
|
262 |
-
components["scheduler"] = PNDMScheduler(skip_prk_steps=True)
|
263 |
-
audioldm_pipe = AudioLDMPipeline(**components)
|
264 |
-
audioldm_pipe = audioldm_pipe.to(device)
|
265 |
-
audioldm_pipe.set_progress_bar_config(disable=None)
|
266 |
-
|
267 |
-
inputs = self.get_dummy_inputs(device)
|
268 |
-
negative_prompt = "egg cracking"
|
269 |
-
output = audioldm_pipe(**inputs, negative_prompt=negative_prompt)
|
270 |
-
audio = output.audios[0]
|
271 |
-
|
272 |
-
assert audio.ndim == 1
|
273 |
-
assert len(audio) == 256
|
274 |
-
|
275 |
-
audio_slice = audio[:10]
|
276 |
-
expected_slice = np.array(
|
277 |
-
[-0.0051, 0.0050, -0.0060, 0.0034, -0.0026, 0.0033, -0.0027, 0.0033, -0.0028, 0.0032]
|
278 |
-
)
|
279 |
-
|
280 |
-
assert np.abs(audio_slice - expected_slice).max() < 1e-2
|
281 |
-
|
282 |
-
def test_audioldm_num_waveforms_per_prompt(self):
|
283 |
-
device = "cpu" # ensure determinism for the device-dependent torch.Generator
|
284 |
-
components = self.get_dummy_components()
|
285 |
-
components["scheduler"] = PNDMScheduler(skip_prk_steps=True)
|
286 |
-
audioldm_pipe = AudioLDMPipeline(**components)
|
287 |
-
audioldm_pipe = audioldm_pipe.to(device)
|
288 |
-
audioldm_pipe.set_progress_bar_config(disable=None)
|
289 |
-
|
290 |
-
prompt = "A hammer hitting a wooden surface"
|
291 |
-
|
292 |
-
# test num_waveforms_per_prompt=1 (default)
|
293 |
-
audios = audioldm_pipe(prompt, num_inference_steps=2).audios
|
294 |
-
|
295 |
-
assert audios.shape == (1, 256)
|
296 |
-
|
297 |
-
# test num_waveforms_per_prompt=1 (default) for batch of prompts
|
298 |
-
batch_size = 2
|
299 |
-
audios = audioldm_pipe([prompt] * batch_size, num_inference_steps=2).audios
|
300 |
-
|
301 |
-
assert audios.shape == (batch_size, 256)
|
302 |
-
|
303 |
-
# test num_waveforms_per_prompt for single prompt
|
304 |
-
num_waveforms_per_prompt = 2
|
305 |
-
audios = audioldm_pipe(prompt, num_inference_steps=2, num_waveforms_per_prompt=num_waveforms_per_prompt).audios
|
306 |
-
|
307 |
-
assert audios.shape == (num_waveforms_per_prompt, 256)
|
308 |
-
|
309 |
-
# test num_waveforms_per_prompt for batch of prompts
|
310 |
-
batch_size = 2
|
311 |
-
audios = audioldm_pipe(
|
312 |
-
[prompt] * batch_size, num_inference_steps=2, num_waveforms_per_prompt=num_waveforms_per_prompt
|
313 |
-
).audios
|
314 |
-
|
315 |
-
assert audios.shape == (batch_size * num_waveforms_per_prompt, 256)
|
316 |
-
|
317 |
-
def test_audioldm_audio_length_in_s(self):
|
318 |
-
device = "cpu" # ensure determinism for the device-dependent torch.Generator
|
319 |
-
components = self.get_dummy_components()
|
320 |
-
audioldm_pipe = AudioLDMPipeline(**components)
|
321 |
-
audioldm_pipe = audioldm_pipe.to(torch_device)
|
322 |
-
audioldm_pipe.set_progress_bar_config(disable=None)
|
323 |
-
vocoder_sampling_rate = audioldm_pipe.vocoder.config.sampling_rate
|
324 |
-
|
325 |
-
inputs = self.get_dummy_inputs(device)
|
326 |
-
output = audioldm_pipe(audio_length_in_s=0.016, **inputs)
|
327 |
-
audio = output.audios[0]
|
328 |
-
|
329 |
-
assert audio.ndim == 1
|
330 |
-
assert len(audio) / vocoder_sampling_rate == 0.016
|
331 |
-
|
332 |
-
output = audioldm_pipe(audio_length_in_s=0.032, **inputs)
|
333 |
-
audio = output.audios[0]
|
334 |
-
|
335 |
-
assert audio.ndim == 1
|
336 |
-
assert len(audio) / vocoder_sampling_rate == 0.032
|
337 |
-
|
338 |
-
def test_audioldm_vocoder_model_in_dim(self):
|
339 |
-
components = self.get_dummy_components()
|
340 |
-
audioldm_pipe = AudioLDMPipeline(**components)
|
341 |
-
audioldm_pipe = audioldm_pipe.to(torch_device)
|
342 |
-
audioldm_pipe.set_progress_bar_config(disable=None)
|
343 |
-
|
344 |
-
prompt = ["hey"]
|
345 |
-
|
346 |
-
output = audioldm_pipe(prompt, num_inference_steps=1)
|
347 |
-
audio_shape = output.audios.shape
|
348 |
-
assert audio_shape == (1, 256)
|
349 |
-
|
350 |
-
config = audioldm_pipe.vocoder.config
|
351 |
-
config.model_in_dim *= 2
|
352 |
-
audioldm_pipe.vocoder = SpeechT5HifiGan(config).to(torch_device)
|
353 |
-
output = audioldm_pipe(prompt, num_inference_steps=1)
|
354 |
-
audio_shape = output.audios.shape
|
355 |
-
# waveform shape is unchanged, we just have 2x the number of mel channels in the spectrogram
|
356 |
-
assert audio_shape == (1, 256)
|
357 |
-
|
358 |
-
def test_attention_slicing_forward_pass(self):
|
359 |
-
self._test_attention_slicing_forward_pass(test_mean_pixel_difference=False)
|
360 |
-
|
361 |
-
def test_inference_batch_single_identical(self):
|
362 |
-
self._test_inference_batch_single_identical(test_mean_pixel_difference=False)
|
363 |
-
|
364 |
-
@unittest.skipIf(
|
365 |
-
torch_device != "cuda" or not is_xformers_available(),
|
366 |
-
reason="XFormers attention is only available with CUDA and `xformers` installed",
|
367 |
-
)
|
368 |
-
def test_xformers_attention_forwardGenerator_pass(self):
|
369 |
-
self._test_xformers_attention_forwardGenerator_pass(test_mean_pixel_difference=False)
|
370 |
-
|
371 |
-
|
372 |
-
@slow
|
373 |
-
class AudioLDMPipelineSlowTests(unittest.TestCase):
|
374 |
-
def tearDown(self):
|
375 |
-
super().tearDown()
|
376 |
-
gc.collect()
|
377 |
-
torch.cuda.empty_cache()
|
378 |
-
|
379 |
-
def get_inputs(self, device, generator_device="cpu", dtype=torch.float32, seed=0):
|
380 |
-
generator = torch.Generator(device=generator_device).manual_seed(seed)
|
381 |
-
latents = np.random.RandomState(seed).standard_normal((1, 8, 128, 16))
|
382 |
-
latents = torch.from_numpy(latents).to(device=device, dtype=dtype)
|
383 |
-
inputs = {
|
384 |
-
"prompt": "A hammer hitting a wooden surface",
|
385 |
-
"latents": latents,
|
386 |
-
"generator": generator,
|
387 |
-
"num_inference_steps": 3,
|
388 |
-
"guidance_scale": 2.5,
|
389 |
-
}
|
390 |
-
return inputs
|
391 |
-
|
392 |
-
def test_audioldm(self):
|
393 |
-
audioldm_pipe = AudioLDMPipeline.from_pretrained("cvssp/audioldm")
|
394 |
-
audioldm_pipe = audioldm_pipe.to(torch_device)
|
395 |
-
audioldm_pipe.set_progress_bar_config(disable=None)
|
396 |
-
|
397 |
-
inputs = self.get_inputs(torch_device)
|
398 |
-
inputs["num_inference_steps"] = 25
|
399 |
-
audio = audioldm_pipe(**inputs).audios[0]
|
400 |
-
|
401 |
-
assert audio.ndim == 1
|
402 |
-
assert len(audio) == 81920
|
403 |
-
|
404 |
-
audio_slice = audio[77230:77240]
|
405 |
-
expected_slice = np.array(
|
406 |
-
[-0.4884, -0.4607, 0.0023, 0.5007, 0.5896, 0.5151, 0.3813, -0.0208, -0.3687, -0.4315]
|
407 |
-
)
|
408 |
-
max_diff = np.abs(expected_slice - audio_slice).max()
|
409 |
-
assert max_diff < 1e-2
|
410 |
-
|
411 |
-
def test_audioldm_lms(self):
|
412 |
-
audioldm_pipe = AudioLDMPipeline.from_pretrained("cvssp/audioldm")
|
413 |
-
audioldm_pipe.scheduler = LMSDiscreteScheduler.from_config(audioldm_pipe.scheduler.config)
|
414 |
-
audioldm_pipe = audioldm_pipe.to(torch_device)
|
415 |
-
audioldm_pipe.set_progress_bar_config(disable=None)
|
416 |
-
|
417 |
-
inputs = self.get_inputs(torch_device)
|
418 |
-
audio = audioldm_pipe(**inputs).audios[0]
|
419 |
-
|
420 |
-
assert audio.ndim == 1
|
421 |
-
assert len(audio) == 81920
|
422 |
-
|
423 |
-
audio_slice = audio[27780:27790]
|
424 |
-
expected_slice = np.array([-0.2131, -0.0873, -0.0124, -0.0189, 0.0569, 0.1373, 0.1883, 0.2886, 0.3297, 0.2212])
|
425 |
-
max_diff = np.abs(expected_slice - audio_slice).max()
|
426 |
-
assert max_diff < 3e-2
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Androidonnxfork/CivitAi-to-Diffusers/diffusers/tests/schedulers/test_scheduler_deis.py
DELETED
@@ -1,237 +0,0 @@
|
|
1 |
-
import tempfile
|
2 |
-
|
3 |
-
import torch
|
4 |
-
|
5 |
-
from diffusers import (
|
6 |
-
DEISMultistepScheduler,
|
7 |
-
DPMSolverMultistepScheduler,
|
8 |
-
DPMSolverSinglestepScheduler,
|
9 |
-
UniPCMultistepScheduler,
|
10 |
-
)
|
11 |
-
|
12 |
-
from .test_schedulers import SchedulerCommonTest
|
13 |
-
|
14 |
-
|
15 |
-
class DEISMultistepSchedulerTest(SchedulerCommonTest):
|
16 |
-
scheduler_classes = (DEISMultistepScheduler,)
|
17 |
-
forward_default_kwargs = (("num_inference_steps", 25),)
|
18 |
-
|
19 |
-
def get_scheduler_config(self, **kwargs):
|
20 |
-
config = {
|
21 |
-
"num_train_timesteps": 1000,
|
22 |
-
"beta_start": 0.0001,
|
23 |
-
"beta_end": 0.02,
|
24 |
-
"beta_schedule": "linear",
|
25 |
-
"solver_order": 2,
|
26 |
-
}
|
27 |
-
|
28 |
-
config.update(**kwargs)
|
29 |
-
return config
|
30 |
-
|
31 |
-
def check_over_configs(self, time_step=0, **config):
|
32 |
-
kwargs = dict(self.forward_default_kwargs)
|
33 |
-
num_inference_steps = kwargs.pop("num_inference_steps", None)
|
34 |
-
sample = self.dummy_sample
|
35 |
-
residual = 0.1 * sample
|
36 |
-
dummy_past_residuals = [residual + 0.2, residual + 0.15, residual + 0.10]
|
37 |
-
|
38 |
-
for scheduler_class in self.scheduler_classes:
|
39 |
-
scheduler_config = self.get_scheduler_config(**config)
|
40 |
-
scheduler = scheduler_class(**scheduler_config)
|
41 |
-
scheduler.set_timesteps(num_inference_steps)
|
42 |
-
# copy over dummy past residuals
|
43 |
-
scheduler.model_outputs = dummy_past_residuals[: scheduler.config.solver_order]
|
44 |
-
|
45 |
-
with tempfile.TemporaryDirectory() as tmpdirname:
|
46 |
-
scheduler.save_config(tmpdirname)
|
47 |
-
new_scheduler = scheduler_class.from_pretrained(tmpdirname)
|
48 |
-
new_scheduler.set_timesteps(num_inference_steps)
|
49 |
-
# copy over dummy past residuals
|
50 |
-
new_scheduler.model_outputs = dummy_past_residuals[: new_scheduler.config.solver_order]
|
51 |
-
|
52 |
-
output, new_output = sample, sample
|
53 |
-
for t in range(time_step, time_step + scheduler.config.solver_order + 1):
|
54 |
-
output = scheduler.step(residual, t, output, **kwargs).prev_sample
|
55 |
-
new_output = new_scheduler.step(residual, t, new_output, **kwargs).prev_sample
|
56 |
-
|
57 |
-
assert torch.sum(torch.abs(output - new_output)) < 1e-5, "Scheduler outputs are not identical"
|
58 |
-
|
59 |
-
def test_from_save_pretrained(self):
|
60 |
-
pass
|
61 |
-
|
62 |
-
def check_over_forward(self, time_step=0, **forward_kwargs):
|
63 |
-
kwargs = dict(self.forward_default_kwargs)
|
64 |
-
num_inference_steps = kwargs.pop("num_inference_steps", None)
|
65 |
-
sample = self.dummy_sample
|
66 |
-
residual = 0.1 * sample
|
67 |
-
dummy_past_residuals = [residual + 0.2, residual + 0.15, residual + 0.10]
|
68 |
-
|
69 |
-
for scheduler_class in self.scheduler_classes:
|
70 |
-
scheduler_config = self.get_scheduler_config()
|
71 |
-
scheduler = scheduler_class(**scheduler_config)
|
72 |
-
scheduler.set_timesteps(num_inference_steps)
|
73 |
-
|
74 |
-
# copy over dummy past residuals (must be after setting timesteps)
|
75 |
-
scheduler.model_outputs = dummy_past_residuals[: scheduler.config.solver_order]
|
76 |
-
|
77 |
-
with tempfile.TemporaryDirectory() as tmpdirname:
|
78 |
-
scheduler.save_config(tmpdirname)
|
79 |
-
new_scheduler = scheduler_class.from_pretrained(tmpdirname)
|
80 |
-
# copy over dummy past residuals
|
81 |
-
new_scheduler.set_timesteps(num_inference_steps)
|
82 |
-
|
83 |
-
# copy over dummy past residual (must be after setting timesteps)
|
84 |
-
new_scheduler.model_outputs = dummy_past_residuals[: new_scheduler.config.solver_order]
|
85 |
-
|
86 |
-
output = scheduler.step(residual, time_step, sample, **kwargs).prev_sample
|
87 |
-
new_output = new_scheduler.step(residual, time_step, sample, **kwargs).prev_sample
|
88 |
-
|
89 |
-
assert torch.sum(torch.abs(output - new_output)) < 1e-5, "Scheduler outputs are not identical"
|
90 |
-
|
91 |
-
def full_loop(self, scheduler=None, **config):
|
92 |
-
if scheduler is None:
|
93 |
-
scheduler_class = self.scheduler_classes[0]
|
94 |
-
scheduler_config = self.get_scheduler_config(**config)
|
95 |
-
scheduler = scheduler_class(**scheduler_config)
|
96 |
-
|
97 |
-
scheduler_class = self.scheduler_classes[0]
|
98 |
-
scheduler_config = self.get_scheduler_config(**config)
|
99 |
-
scheduler = scheduler_class(**scheduler_config)
|
100 |
-
|
101 |
-
num_inference_steps = 10
|
102 |
-
model = self.dummy_model()
|
103 |
-
sample = self.dummy_sample_deter
|
104 |
-
scheduler.set_timesteps(num_inference_steps)
|
105 |
-
|
106 |
-
for i, t in enumerate(scheduler.timesteps):
|
107 |
-
residual = model(sample, t)
|
108 |
-
sample = scheduler.step(residual, t, sample).prev_sample
|
109 |
-
|
110 |
-
return sample
|
111 |
-
|
112 |
-
def test_step_shape(self):
|
113 |
-
kwargs = dict(self.forward_default_kwargs)
|
114 |
-
|
115 |
-
num_inference_steps = kwargs.pop("num_inference_steps", None)
|
116 |
-
|
117 |
-
for scheduler_class in self.scheduler_classes:
|
118 |
-
scheduler_config = self.get_scheduler_config()
|
119 |
-
scheduler = scheduler_class(**scheduler_config)
|
120 |
-
|
121 |
-
sample = self.dummy_sample
|
122 |
-
residual = 0.1 * sample
|
123 |
-
|
124 |
-
if num_inference_steps is not None and hasattr(scheduler, "set_timesteps"):
|
125 |
-
scheduler.set_timesteps(num_inference_steps)
|
126 |
-
elif num_inference_steps is not None and not hasattr(scheduler, "set_timesteps"):
|
127 |
-
kwargs["num_inference_steps"] = num_inference_steps
|
128 |
-
|
129 |
-
# copy over dummy past residuals (must be done after set_timesteps)
|
130 |
-
dummy_past_residuals = [residual + 0.2, residual + 0.15, residual + 0.10]
|
131 |
-
scheduler.model_outputs = dummy_past_residuals[: scheduler.config.solver_order]
|
132 |
-
|
133 |
-
time_step_0 = scheduler.timesteps[5]
|
134 |
-
time_step_1 = scheduler.timesteps[6]
|
135 |
-
|
136 |
-
output_0 = scheduler.step(residual, time_step_0, sample, **kwargs).prev_sample
|
137 |
-
output_1 = scheduler.step(residual, time_step_1, sample, **kwargs).prev_sample
|
138 |
-
|
139 |
-
self.assertEqual(output_0.shape, sample.shape)
|
140 |
-
self.assertEqual(output_0.shape, output_1.shape)
|
141 |
-
|
142 |
-
def test_switch(self):
|
143 |
-
# make sure that iterating over schedulers with same config names gives same results
|
144 |
-
# for defaults
|
145 |
-
scheduler = DEISMultistepScheduler(**self.get_scheduler_config())
|
146 |
-
sample = self.full_loop(scheduler=scheduler)
|
147 |
-
result_mean = torch.mean(torch.abs(sample))
|
148 |
-
|
149 |
-
assert abs(result_mean.item() - 0.23916) < 1e-3
|
150 |
-
|
151 |
-
scheduler = DPMSolverSinglestepScheduler.from_config(scheduler.config)
|
152 |
-
scheduler = DPMSolverMultistepScheduler.from_config(scheduler.config)
|
153 |
-
scheduler = UniPCMultistepScheduler.from_config(scheduler.config)
|
154 |
-
scheduler = DEISMultistepScheduler.from_config(scheduler.config)
|
155 |
-
|
156 |
-
sample = self.full_loop(scheduler=scheduler)
|
157 |
-
result_mean = torch.mean(torch.abs(sample))
|
158 |
-
|
159 |
-
assert abs(result_mean.item() - 0.23916) < 1e-3
|
160 |
-
|
161 |
-
def test_timesteps(self):
|
162 |
-
for timesteps in [25, 50, 100, 999, 1000]:
|
163 |
-
self.check_over_configs(num_train_timesteps=timesteps)
|
164 |
-
|
165 |
-
def test_thresholding(self):
|
166 |
-
self.check_over_configs(thresholding=False)
|
167 |
-
for order in [1, 2, 3]:
|
168 |
-
for solver_type in ["logrho"]:
|
169 |
-
for threshold in [0.5, 1.0, 2.0]:
|
170 |
-
for prediction_type in ["epsilon", "sample"]:
|
171 |
-
self.check_over_configs(
|
172 |
-
thresholding=True,
|
173 |
-
prediction_type=prediction_type,
|
174 |
-
sample_max_value=threshold,
|
175 |
-
algorithm_type="deis",
|
176 |
-
solver_order=order,
|
177 |
-
solver_type=solver_type,
|
178 |
-
)
|
179 |
-
|
180 |
-
def test_prediction_type(self):
|
181 |
-
for prediction_type in ["epsilon", "v_prediction"]:
|
182 |
-
self.check_over_configs(prediction_type=prediction_type)
|
183 |
-
|
184 |
-
def test_solver_order_and_type(self):
|
185 |
-
for algorithm_type in ["deis"]:
|
186 |
-
for solver_type in ["logrho"]:
|
187 |
-
for order in [1, 2, 3]:
|
188 |
-
for prediction_type in ["epsilon", "sample"]:
|
189 |
-
self.check_over_configs(
|
190 |
-
solver_order=order,
|
191 |
-
solver_type=solver_type,
|
192 |
-
prediction_type=prediction_type,
|
193 |
-
algorithm_type=algorithm_type,
|
194 |
-
)
|
195 |
-
sample = self.full_loop(
|
196 |
-
solver_order=order,
|
197 |
-
solver_type=solver_type,
|
198 |
-
prediction_type=prediction_type,
|
199 |
-
algorithm_type=algorithm_type,
|
200 |
-
)
|
201 |
-
assert not torch.isnan(sample).any(), "Samples have nan numbers"
|
202 |
-
|
203 |
-
def test_lower_order_final(self):
|
204 |
-
self.check_over_configs(lower_order_final=True)
|
205 |
-
self.check_over_configs(lower_order_final=False)
|
206 |
-
|
207 |
-
def test_inference_steps(self):
|
208 |
-
for num_inference_steps in [1, 2, 3, 5, 10, 50, 100, 999, 1000]:
|
209 |
-
self.check_over_forward(num_inference_steps=num_inference_steps, time_step=0)
|
210 |
-
|
211 |
-
def test_full_loop_no_noise(self):
|
212 |
-
sample = self.full_loop()
|
213 |
-
result_mean = torch.mean(torch.abs(sample))
|
214 |
-
|
215 |
-
assert abs(result_mean.item() - 0.23916) < 1e-3
|
216 |
-
|
217 |
-
def test_full_loop_with_v_prediction(self):
|
218 |
-
sample = self.full_loop(prediction_type="v_prediction")
|
219 |
-
result_mean = torch.mean(torch.abs(sample))
|
220 |
-
|
221 |
-
assert abs(result_mean.item() - 0.091) < 1e-3
|
222 |
-
|
223 |
-
def test_fp16_support(self):
|
224 |
-
scheduler_class = self.scheduler_classes[0]
|
225 |
-
scheduler_config = self.get_scheduler_config(thresholding=True, dynamic_thresholding_ratio=0)
|
226 |
-
scheduler = scheduler_class(**scheduler_config)
|
227 |
-
|
228 |
-
num_inference_steps = 10
|
229 |
-
model = self.dummy_model()
|
230 |
-
sample = self.dummy_sample_deter.half()
|
231 |
-
scheduler.set_timesteps(num_inference_steps)
|
232 |
-
|
233 |
-
for i, t in enumerate(scheduler.timesteps):
|
234 |
-
residual = model(sample, t)
|
235 |
-
sample = scheduler.step(residual, t, sample).prev_sample
|
236 |
-
|
237 |
-
assert sample.dtype == torch.float16
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_detection/configs/lvis/mask_rcnn_r50_fpn_sample1e-3_mstrain_2x_lvis_v0.5.py
DELETED
@@ -1,31 +0,0 @@
|
|
1 |
-
_base_ = [
|
2 |
-
'../_base_/models/mask_rcnn_r50_fpn.py',
|
3 |
-
'../_base_/datasets/lvis_v0.5_instance.py',
|
4 |
-
'../_base_/schedules/schedule_2x.py', '../_base_/default_runtime.py'
|
5 |
-
]
|
6 |
-
model = dict(
|
7 |
-
roi_head=dict(
|
8 |
-
bbox_head=dict(num_classes=1230), mask_head=dict(num_classes=1230)),
|
9 |
-
test_cfg=dict(
|
10 |
-
rcnn=dict(
|
11 |
-
score_thr=0.0001,
|
12 |
-
# LVIS allows up to 300
|
13 |
-
max_per_img=300)))
|
14 |
-
img_norm_cfg = dict(
|
15 |
-
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
|
16 |
-
train_pipeline = [
|
17 |
-
dict(type='LoadImageFromFile'),
|
18 |
-
dict(type='LoadAnnotations', with_bbox=True, with_mask=True),
|
19 |
-
dict(
|
20 |
-
type='Resize',
|
21 |
-
img_scale=[(1333, 640), (1333, 672), (1333, 704), (1333, 736),
|
22 |
-
(1333, 768), (1333, 800)],
|
23 |
-
multiscale_mode='value',
|
24 |
-
keep_ratio=True),
|
25 |
-
dict(type='RandomFlip', flip_ratio=0.5),
|
26 |
-
dict(type='Normalize', **img_norm_cfg),
|
27 |
-
dict(type='Pad', size_divisor=32),
|
28 |
-
dict(type='DefaultFormatBundle'),
|
29 |
-
dict(type='Collect', keys=['img', 'gt_bboxes', 'gt_labels', 'gt_masks']),
|
30 |
-
]
|
31 |
-
data = dict(train=dict(dataset=dict(pipeline=train_pipeline)))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_detection/configs/mask_rcnn/mask_rcnn_r101_caffe_fpn_1x_coco.py
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
_base_ = './mask_rcnn_r50_caffe_fpn_1x_coco.py'
|
2 |
-
model = dict(
|
3 |
-
pretrained='open-mmlab://detectron2/resnet101_caffe',
|
4 |
-
backbone=dict(depth=101))
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_detection/configs/reppoints/reppoints_moment_r50_fpn_gn-neck+head_1x_coco.py
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
_base_ = './reppoints_moment_r50_fpn_1x_coco.py'
|
2 |
-
norm_cfg = dict(type='GN', num_groups=32, requires_grad=True)
|
3 |
-
model = dict(neck=dict(norm_cfg=norm_cfg), bbox_head=dict(norm_cfg=norm_cfg))
|
4 |
-
optimizer = dict(lr=0.01)
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_detection/configs/rpn/rpn_r101_caffe_fpn_1x_coco.py
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
_base_ = './rpn_r50_caffe_fpn_1x_coco.py'
|
2 |
-
model = dict(
|
3 |
-
pretrained='open-mmlab://detectron2/resnet101_caffe',
|
4 |
-
backbone=dict(depth=101))
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_detection/mmdet/core/bbox/builder.py
DELETED
@@ -1,20 +0,0 @@
|
|
1 |
-
from mmcv.utils import Registry, build_from_cfg
|
2 |
-
|
3 |
-
BBOX_ASSIGNERS = Registry('bbox_assigner')
|
4 |
-
BBOX_SAMPLERS = Registry('bbox_sampler')
|
5 |
-
BBOX_CODERS = Registry('bbox_coder')
|
6 |
-
|
7 |
-
|
8 |
-
def build_assigner(cfg, **default_args):
|
9 |
-
"""Builder of box assigner."""
|
10 |
-
return build_from_cfg(cfg, BBOX_ASSIGNERS, default_args)
|
11 |
-
|
12 |
-
|
13 |
-
def build_sampler(cfg, **default_args):
|
14 |
-
"""Builder of box sampler."""
|
15 |
-
return build_from_cfg(cfg, BBOX_SAMPLERS, default_args)
|
16 |
-
|
17 |
-
|
18 |
-
def build_bbox_coder(cfg, **default_args):
|
19 |
-
"""Builder of box coder."""
|
20 |
-
return build_from_cfg(cfg, BBOX_CODERS, default_args)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_segmentation/configs/fcn/fcn_r50-d8_512x1024_40k_cityscapes.py
DELETED
@@ -1,4 +0,0 @@
|
|
1 |
-
_base_ = [
|
2 |
-
'../_base_/models/fcn_r50-d8.py', '../_base_/datasets/cityscapes.py',
|
3 |
-
'../_base_/default_runtime.py', '../_base_/schedules/schedule_40k.py'
|
4 |
-
]
|
|
|
|
|
|
|
|
|
|
spaces/Andy1621/uniformer_image_segmentation/configs/mobilenet_v2/fcn_m-v2-d8_512x512_160k_ade20k.py
DELETED
@@ -1,12 +0,0 @@
|
|
1 |
-
_base_ = '../fcn/fcn_r101-d8_512x512_160k_ade20k.py'
|
2 |
-
model = dict(
|
3 |
-
pretrained='mmcls://mobilenet_v2',
|
4 |
-
backbone=dict(
|
5 |
-
_delete_=True,
|
6 |
-
type='MobileNetV2',
|
7 |
-
widen_factor=1.,
|
8 |
-
strides=(1, 2, 2, 1, 1, 1, 1),
|
9 |
-
dilations=(1, 1, 1, 2, 2, 4, 4),
|
10 |
-
out_indices=(1, 2, 4, 6)),
|
11 |
-
decode_head=dict(in_channels=320),
|
12 |
-
auxiliary_head=dict(in_channels=96))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Aniquel/bert-large-uncased-whole-word-masking/app.py
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
|
3 |
-
gr.Interface.load("models/bert-large-uncased-whole-word-masking").launch()
|
|
|
|
|
|
|
|
spaces/AnishKumbhar/ChatBot/text-generation-webui-main/css/chat_style-TheEncrypted777.css
DELETED
@@ -1,133 +0,0 @@
|
|
1 |
-
/* All credits to TheEncrypted777: https://www.reddit.com/r/Oobabooga/comments/12xe6vq/updated_css_styling_with_color_customization_for/ */
|
2 |
-
|
3 |
-
.message {
|
4 |
-
display: grid;
|
5 |
-
grid-template-columns: 60px minmax(0, 1fr);
|
6 |
-
padding-bottom: 28px;
|
7 |
-
font-size: 18px;
|
8 |
-
font-family: 'Noto Sans', Arial, sans-serif;
|
9 |
-
line-height: 1.428571429;
|
10 |
-
}
|
11 |
-
|
12 |
-
.circle-you,
|
13 |
-
.circle-bot {
|
14 |
-
background-color: gray;
|
15 |
-
border-radius: 1rem;
|
16 |
-
border: 2px solid white;
|
17 |
-
}
|
18 |
-
|
19 |
-
.circle-bot img,
|
20 |
-
.circle-you img {
|
21 |
-
border-radius: 10%;
|
22 |
-
width: 100%;
|
23 |
-
height: 100%;
|
24 |
-
object-fit: cover;
|
25 |
-
}
|
26 |
-
|
27 |
-
.circle-you, .circle-bot {
|
28 |
-
/*You can set the size of the profile images here, but if you do, you have to also adjust the .text{padding-left: 90px} to a different number according to the width of the image which is right below here*/
|
29 |
-
width: 135px;
|
30 |
-
height: 175px;
|
31 |
-
}
|
32 |
-
|
33 |
-
.text {
|
34 |
-
/*Change this to move the message box further left or right depending on the size of your profile pic*/
|
35 |
-
padding-left: 90px;
|
36 |
-
text-shadow: 2px 2px 2px rgb(0, 0, 0, 0.4);
|
37 |
-
}
|
38 |
-
|
39 |
-
.text p {
|
40 |
-
margin-top: 2px;
|
41 |
-
}
|
42 |
-
|
43 |
-
.username {
|
44 |
-
padding-left: 10px;
|
45 |
-
font-size: 22px;
|
46 |
-
font-weight: bold;
|
47 |
-
border-top: 1px solid rgb(51, 64, 90);
|
48 |
-
padding: 3px;
|
49 |
-
}
|
50 |
-
|
51 |
-
.message-body {
|
52 |
-
position: relative;
|
53 |
-
border-radius: 1rem;
|
54 |
-
border: 1px solid rgba(255, 255, 255, 0.459);
|
55 |
-
border-radius: 10px;
|
56 |
-
padding: 10px;
|
57 |
-
padding-top: 5px;
|
58 |
-
/*Message gradient background color - remove the line bellow if you don't want a background color or gradient*/
|
59 |
-
background: linear-gradient(to bottom, #171730, #1b263f);
|
60 |
-
}
|
61 |
-
|
62 |
-
/*Adds 2 extra lines at the top and bottom of the message*/
|
63 |
-
.message-body:before,
|
64 |
-
.message-body:after {
|
65 |
-
content: "";
|
66 |
-
position: absolute;
|
67 |
-
left: 10px;
|
68 |
-
right: 10px;
|
69 |
-
height: 1px;
|
70 |
-
background-color: rgba(255, 255, 255, 0.13);
|
71 |
-
}
|
72 |
-
|
73 |
-
.message-body:before {
|
74 |
-
top: 6px;
|
75 |
-
}
|
76 |
-
|
77 |
-
.message-body:after {
|
78 |
-
bottom: 6px;
|
79 |
-
}
|
80 |
-
|
81 |
-
.message-body img {
|
82 |
-
max-width: 300px;
|
83 |
-
max-height: 300px;
|
84 |
-
border-radius: 20px;
|
85 |
-
}
|
86 |
-
|
87 |
-
.message-body p {
|
88 |
-
margin-bottom: 0 !important;
|
89 |
-
font-size: 18px !important;
|
90 |
-
line-height: 1.428571429 !important;
|
91 |
-
color: rgb(243, 244, 246) !important;
|
92 |
-
text-shadow: 2px 2px 2px rgb(0, 0, 0);
|
93 |
-
}
|
94 |
-
|
95 |
-
.message-body p em {
|
96 |
-
color: rgb(138, 138, 138) !important;
|
97 |
-
}
|
98 |
-
|
99 |
-
@media screen and (max-width: 688px) {
|
100 |
-
.message {
|
101 |
-
display: grid;
|
102 |
-
grid-template-columns: 60px minmax(0, 1fr);
|
103 |
-
padding-bottom: 25px;
|
104 |
-
font-size: 15px;
|
105 |
-
font-family: 'Noto Sans', Helvetica, Arial, sans-serif;
|
106 |
-
line-height: 1.428571429;
|
107 |
-
}
|
108 |
-
|
109 |
-
.circle-you, .circle-bot {
|
110 |
-
width: 50px;
|
111 |
-
height: 73px;
|
112 |
-
border-radius: 0.5rem;
|
113 |
-
}
|
114 |
-
|
115 |
-
.circle-bot img,
|
116 |
-
.circle-you img {
|
117 |
-
width: 100%;
|
118 |
-
height: 100%;
|
119 |
-
object-fit: cover;
|
120 |
-
}
|
121 |
-
|
122 |
-
.text {
|
123 |
-
padding-left: 0px;
|
124 |
-
}
|
125 |
-
|
126 |
-
.message-body p {
|
127 |
-
font-size: 16px !important;
|
128 |
-
}
|
129 |
-
|
130 |
-
.username {
|
131 |
-
font-size: 20px;
|
132 |
-
}
|
133 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/ArtGAN/Video-Diffusion-WebUI/video_diffusion/damo/damo_text2_video.py
DELETED
@@ -1,126 +0,0 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
import torch
|
3 |
-
from diffusers import DiffusionPipeline, DPMSolverMultistepScheduler
|
4 |
-
from diffusers.utils import export_to_video
|
5 |
-
|
6 |
-
from video_diffusion.utils.scheduler_list import diff_scheduler_list, get_scheduler_list
|
7 |
-
|
8 |
-
stable_model_list =["damo-vilab/text-to-video-ms-1.7b","cerspense/zeroscope_v2_576w"]
|
9 |
-
|
10 |
-
class DamoText2VideoGenerator:
|
11 |
-
def __init__(self):
|
12 |
-
self.pipe = None
|
13 |
-
|
14 |
-
def load_model(self, stable_model, scheduler):
|
15 |
-
if self.pipe is None:
|
16 |
-
self.pipe = DiffusionPipeline.from_pretrained(
|
17 |
-
stable_model, torch_dtype=torch.float16, variant="fp16"
|
18 |
-
)
|
19 |
-
self.pipe = get_scheduler_list(pipe=self.pipe, scheduler=scheduler)
|
20 |
-
self.pipe.to("cuda")
|
21 |
-
self.pipe.enable_xformers_memory_efficient_attention()
|
22 |
-
return self.pipe
|
23 |
-
|
24 |
-
def generate_video(
|
25 |
-
self,
|
26 |
-
prompt: str,
|
27 |
-
negative_prompt: str,
|
28 |
-
stable_model:str,
|
29 |
-
num_frames: int,
|
30 |
-
num_inference_steps: int,
|
31 |
-
guidance_scale: int,
|
32 |
-
height: int,
|
33 |
-
width: int,
|
34 |
-
scheduler: str,
|
35 |
-
):
|
36 |
-
pipe = self.load_model(stable_model=stable_model, scheduler=scheduler)
|
37 |
-
video = pipe(
|
38 |
-
prompt,
|
39 |
-
negative_prompt=negative_prompt,
|
40 |
-
num_frames=int(num_frames),
|
41 |
-
height=height,
|
42 |
-
width=width,
|
43 |
-
num_inference_steps=num_inference_steps,
|
44 |
-
guidance_scale=guidance_scale,
|
45 |
-
).frames
|
46 |
-
|
47 |
-
video_path = export_to_video(video)
|
48 |
-
return video_path
|
49 |
-
|
50 |
-
def app():
|
51 |
-
with gr.Blocks():
|
52 |
-
with gr.Row():
|
53 |
-
with gr.Column():
|
54 |
-
dano_text2video_prompt = gr.Textbox(lines=1, placeholder="Prompt", show_label=False)
|
55 |
-
dano_text2video_negative_prompt = gr.Textbox(
|
56 |
-
lines=1, placeholder="Negative Prompt", show_label=False
|
57 |
-
)
|
58 |
-
with gr.Row():
|
59 |
-
with gr.Column():
|
60 |
-
dano_text2video_model_list = gr.Dropdown(
|
61 |
-
choices=stable_model_list,
|
62 |
-
label="Model List",
|
63 |
-
value=stable_model_list[0],
|
64 |
-
)
|
65 |
-
|
66 |
-
dano_text2video_num_inference_steps = gr.Slider(
|
67 |
-
minimum=1,
|
68 |
-
maximum=100,
|
69 |
-
value=50,
|
70 |
-
step=1,
|
71 |
-
label="Inference Steps",
|
72 |
-
)
|
73 |
-
dano_text2video_guidance_scale = gr.Slider(
|
74 |
-
minimum=1,
|
75 |
-
maximum=15,
|
76 |
-
value=7,
|
77 |
-
step=1,
|
78 |
-
label="Guidance Scale",
|
79 |
-
)
|
80 |
-
dano_text2video_num_frames = gr.Slider(
|
81 |
-
minimum=1,
|
82 |
-
maximum=50,
|
83 |
-
value=16,
|
84 |
-
step=1,
|
85 |
-
label="Number of Frames",
|
86 |
-
)
|
87 |
-
with gr.Row():
|
88 |
-
with gr.Column():
|
89 |
-
dano_text2video_height = gr.Slider(
|
90 |
-
minimum=128,
|
91 |
-
maximum=1280,
|
92 |
-
value=512,
|
93 |
-
step=32,
|
94 |
-
label="Height",
|
95 |
-
)
|
96 |
-
dano_text2video_width = gr.Slider(
|
97 |
-
minimum=128,
|
98 |
-
maximum=1280,
|
99 |
-
value=512,
|
100 |
-
step=32,
|
101 |
-
label="Width",
|
102 |
-
)
|
103 |
-
damo_text2video_scheduler = gr.Dropdown(
|
104 |
-
choices=diff_scheduler_list,
|
105 |
-
label="Scheduler",
|
106 |
-
value=diff_scheduler_list[6],
|
107 |
-
)
|
108 |
-
dano_text2video_generate = gr.Button(value="Generator")
|
109 |
-
with gr.Column():
|
110 |
-
dano_output = gr.Video(label="Output")
|
111 |
-
|
112 |
-
dano_text2video_generate.click(
|
113 |
-
fn=DamoText2VideoGenerator().generate_video,
|
114 |
-
inputs=[
|
115 |
-
dano_text2video_prompt,
|
116 |
-
dano_text2video_negative_prompt,
|
117 |
-
dano_text2video_model_list,
|
118 |
-
dano_text2video_num_frames,
|
119 |
-
dano_text2video_num_inference_steps,
|
120 |
-
dano_text2video_guidance_scale,
|
121 |
-
dano_text2video_height,
|
122 |
-
dano_text2video_width,
|
123 |
-
damo_text2video_scheduler,
|
124 |
-
],
|
125 |
-
outputs=dano_output,
|
126 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/pip/_vendor/platformdirs/unix.py
DELETED
@@ -1,194 +0,0 @@
|
|
1 |
-
from __future__ import annotations
|
2 |
-
|
3 |
-
import os
|
4 |
-
import sys
|
5 |
-
from configparser import ConfigParser
|
6 |
-
from pathlib import Path
|
7 |
-
|
8 |
-
from .api import PlatformDirsABC
|
9 |
-
|
10 |
-
if sys.platform.startswith("linux"): # pragma: no branch # no op check, only to please the type checker
|
11 |
-
from os import getuid
|
12 |
-
else:
|
13 |
-
|
14 |
-
def getuid() -> int:
|
15 |
-
raise RuntimeError("should only be used on Linux")
|
16 |
-
|
17 |
-
|
18 |
-
class Unix(PlatformDirsABC):
|
19 |
-
"""
|
20 |
-
On Unix/Linux, we follow the
|
21 |
-
`XDG Basedir Spec <https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html>`_. The spec allows
|
22 |
-
overriding directories with environment variables. The examples show are the default values, alongside the name of
|
23 |
-
the environment variable that overrides them. Makes use of the
|
24 |
-
`appname <platformdirs.api.PlatformDirsABC.appname>`,
|
25 |
-
`version <platformdirs.api.PlatformDirsABC.version>`,
|
26 |
-
`multipath <platformdirs.api.PlatformDirsABC.multipath>`,
|
27 |
-
`opinion <platformdirs.api.PlatformDirsABC.opinion>`,
|
28 |
-
`ensure_exists <platformdirs.api.PlatformDirsABC.ensure_exists>`.
|
29 |
-
"""
|
30 |
-
|
31 |
-
@property
|
32 |
-
def user_data_dir(self) -> str:
|
33 |
-
"""
|
34 |
-
:return: data directory tied to the user, e.g. ``~/.local/share/$appname/$version`` or
|
35 |
-
``$XDG_DATA_HOME/$appname/$version``
|
36 |
-
"""
|
37 |
-
path = os.environ.get("XDG_DATA_HOME", "")
|
38 |
-
if not path.strip():
|
39 |
-
path = os.path.expanduser("~/.local/share")
|
40 |
-
return self._append_app_name_and_version(path)
|
41 |
-
|
42 |
-
@property
|
43 |
-
def site_data_dir(self) -> str:
|
44 |
-
"""
|
45 |
-
:return: data directories shared by users (if `multipath <platformdirs.api.PlatformDirsABC.multipath>` is
|
46 |
-
enabled and ``XDG_DATA_DIR`` is set and a multi path the response is also a multi path separated by the OS
|
47 |
-
path separator), e.g. ``/usr/local/share/$appname/$version`` or ``/usr/share/$appname/$version``
|
48 |
-
"""
|
49 |
-
# XDG default for $XDG_DATA_DIRS; only first, if multipath is False
|
50 |
-
path = os.environ.get("XDG_DATA_DIRS", "")
|
51 |
-
if not path.strip():
|
52 |
-
path = f"/usr/local/share{os.pathsep}/usr/share"
|
53 |
-
return self._with_multi_path(path)
|
54 |
-
|
55 |
-
def _with_multi_path(self, path: str) -> str:
|
56 |
-
path_list = path.split(os.pathsep)
|
57 |
-
if not self.multipath:
|
58 |
-
path_list = path_list[0:1]
|
59 |
-
path_list = [self._append_app_name_and_version(os.path.expanduser(p)) for p in path_list]
|
60 |
-
return os.pathsep.join(path_list)
|
61 |
-
|
62 |
-
@property
|
63 |
-
def user_config_dir(self) -> str:
|
64 |
-
"""
|
65 |
-
:return: config directory tied to the user, e.g. ``~/.config/$appname/$version`` or
|
66 |
-
``$XDG_CONFIG_HOME/$appname/$version``
|
67 |
-
"""
|
68 |
-
path = os.environ.get("XDG_CONFIG_HOME", "")
|
69 |
-
if not path.strip():
|
70 |
-
path = os.path.expanduser("~/.config")
|
71 |
-
return self._append_app_name_and_version(path)
|
72 |
-
|
73 |
-
@property
|
74 |
-
def site_config_dir(self) -> str:
|
75 |
-
"""
|
76 |
-
:return: config directories shared by users (if `multipath <platformdirs.api.PlatformDirsABC.multipath>`
|
77 |
-
is enabled and ``XDG_DATA_DIR`` is set and a multi path the response is also a multi path separated by the OS
|
78 |
-
path separator), e.g. ``/etc/xdg/$appname/$version``
|
79 |
-
"""
|
80 |
-
# XDG default for $XDG_CONFIG_DIRS only first, if multipath is False
|
81 |
-
path = os.environ.get("XDG_CONFIG_DIRS", "")
|
82 |
-
if not path.strip():
|
83 |
-
path = "/etc/xdg"
|
84 |
-
return self._with_multi_path(path)
|
85 |
-
|
86 |
-
@property
|
87 |
-
def user_cache_dir(self) -> str:
|
88 |
-
"""
|
89 |
-
:return: cache directory tied to the user, e.g. ``~/.cache/$appname/$version`` or
|
90 |
-
``~/$XDG_CACHE_HOME/$appname/$version``
|
91 |
-
"""
|
92 |
-
path = os.environ.get("XDG_CACHE_HOME", "")
|
93 |
-
if not path.strip():
|
94 |
-
path = os.path.expanduser("~/.cache")
|
95 |
-
return self._append_app_name_and_version(path)
|
96 |
-
|
97 |
-
@property
|
98 |
-
def site_cache_dir(self) -> str:
|
99 |
-
"""
|
100 |
-
:return: cache directory shared by users, e.g. ``/var/tmp/$appname/$version``
|
101 |
-
"""
|
102 |
-
return self._append_app_name_and_version("/var/tmp")
|
103 |
-
|
104 |
-
@property
|
105 |
-
def user_state_dir(self) -> str:
|
106 |
-
"""
|
107 |
-
:return: state directory tied to the user, e.g. ``~/.local/state/$appname/$version`` or
|
108 |
-
``$XDG_STATE_HOME/$appname/$version``
|
109 |
-
"""
|
110 |
-
path = os.environ.get("XDG_STATE_HOME", "")
|
111 |
-
if not path.strip():
|
112 |
-
path = os.path.expanduser("~/.local/state")
|
113 |
-
return self._append_app_name_and_version(path)
|
114 |
-
|
115 |
-
@property
|
116 |
-
def user_log_dir(self) -> str:
|
117 |
-
"""
|
118 |
-
:return: log directory tied to the user, same as `user_state_dir` if not opinionated else ``log`` in it
|
119 |
-
"""
|
120 |
-
path = self.user_state_dir
|
121 |
-
if self.opinion:
|
122 |
-
path = os.path.join(path, "log")
|
123 |
-
return path
|
124 |
-
|
125 |
-
@property
|
126 |
-
def user_documents_dir(self) -> str:
|
127 |
-
"""
|
128 |
-
:return: documents directory tied to the user, e.g. ``~/Documents``
|
129 |
-
"""
|
130 |
-
documents_dir = _get_user_dirs_folder("XDG_DOCUMENTS_DIR")
|
131 |
-
if documents_dir is None:
|
132 |
-
documents_dir = os.environ.get("XDG_DOCUMENTS_DIR", "").strip()
|
133 |
-
if not documents_dir:
|
134 |
-
documents_dir = os.path.expanduser("~/Documents")
|
135 |
-
|
136 |
-
return documents_dir
|
137 |
-
|
138 |
-
@property
|
139 |
-
def user_runtime_dir(self) -> str:
|
140 |
-
"""
|
141 |
-
:return: runtime directory tied to the user, e.g. ``/run/user/$(id -u)/$appname/$version`` or
|
142 |
-
``$XDG_RUNTIME_DIR/$appname/$version``
|
143 |
-
"""
|
144 |
-
path = os.environ.get("XDG_RUNTIME_DIR", "")
|
145 |
-
if not path.strip():
|
146 |
-
path = f"/run/user/{getuid()}"
|
147 |
-
return self._append_app_name_and_version(path)
|
148 |
-
|
149 |
-
@property
|
150 |
-
def site_data_path(self) -> Path:
|
151 |
-
""":return: data path shared by users. Only return first item, even if ``multipath`` is set to ``True``"""
|
152 |
-
return self._first_item_as_path_if_multipath(self.site_data_dir)
|
153 |
-
|
154 |
-
@property
|
155 |
-
def site_config_path(self) -> Path:
|
156 |
-
""":return: config path shared by the users. Only return first item, even if ``multipath`` is set to ``True``"""
|
157 |
-
return self._first_item_as_path_if_multipath(self.site_config_dir)
|
158 |
-
|
159 |
-
@property
|
160 |
-
def site_cache_path(self) -> Path:
|
161 |
-
""":return: cache path shared by users. Only return first item, even if ``multipath`` is set to ``True``"""
|
162 |
-
return self._first_item_as_path_if_multipath(self.site_cache_dir)
|
163 |
-
|
164 |
-
def _first_item_as_path_if_multipath(self, directory: str) -> Path:
|
165 |
-
if self.multipath:
|
166 |
-
# If multipath is True, the first path is returned.
|
167 |
-
directory = directory.split(os.pathsep)[0]
|
168 |
-
return Path(directory)
|
169 |
-
|
170 |
-
|
171 |
-
def _get_user_dirs_folder(key: str) -> str | None:
|
172 |
-
"""Return directory from user-dirs.dirs config file. See https://freedesktop.org/wiki/Software/xdg-user-dirs/"""
|
173 |
-
user_dirs_config_path = os.path.join(Unix().user_config_dir, "user-dirs.dirs")
|
174 |
-
if os.path.exists(user_dirs_config_path):
|
175 |
-
parser = ConfigParser()
|
176 |
-
|
177 |
-
with open(user_dirs_config_path) as stream:
|
178 |
-
# Add fake section header, so ConfigParser doesn't complain
|
179 |
-
parser.read_string(f"[top]\n{stream.read()}")
|
180 |
-
|
181 |
-
if key not in parser["top"]:
|
182 |
-
return None
|
183 |
-
|
184 |
-
path = parser["top"][key].strip('"')
|
185 |
-
# Handle relative home paths
|
186 |
-
path = path.replace("$HOME", os.path.expanduser("~"))
|
187 |
-
return path
|
188 |
-
|
189 |
-
return None
|
190 |
-
|
191 |
-
|
192 |
-
__all__ = [
|
193 |
-
"Unix",
|
194 |
-
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Ataturk-Chatbot/HuggingFaceChat/venv/lib/python3.11/site-packages/setuptools/_distutils/command/bdist_rpm.py
DELETED
@@ -1,615 +0,0 @@
|
|
1 |
-
"""distutils.command.bdist_rpm
|
2 |
-
|
3 |
-
Implements the Distutils 'bdist_rpm' command (create RPM source and binary
|
4 |
-
distributions)."""
|
5 |
-
|
6 |
-
import subprocess
|
7 |
-
import sys
|
8 |
-
import os
|
9 |
-
|
10 |
-
from distutils.core import Command
|
11 |
-
from distutils.debug import DEBUG
|
12 |
-
from distutils.file_util import write_file
|
13 |
-
from distutils.errors import (
|
14 |
-
DistutilsOptionError,
|
15 |
-
DistutilsPlatformError,
|
16 |
-
DistutilsFileError,
|
17 |
-
DistutilsExecError,
|
18 |
-
)
|
19 |
-
from distutils.sysconfig import get_python_version
|
20 |
-
from distutils import log
|
21 |
-
|
22 |
-
|
23 |
-
class bdist_rpm(Command):
|
24 |
-
|
25 |
-
description = "create an RPM distribution"
|
26 |
-
|
27 |
-
user_options = [
|
28 |
-
('bdist-base=', None, "base directory for creating built distributions"),
|
29 |
-
(
|
30 |
-
'rpm-base=',
|
31 |
-
None,
|
32 |
-
"base directory for creating RPMs (defaults to \"rpm\" under "
|
33 |
-
"--bdist-base; must be specified for RPM 2)",
|
34 |
-
),
|
35 |
-
(
|
36 |
-
'dist-dir=',
|
37 |
-
'd',
|
38 |
-
"directory to put final RPM files in " "(and .spec files if --spec-only)",
|
39 |
-
),
|
40 |
-
(
|
41 |
-
'python=',
|
42 |
-
None,
|
43 |
-
"path to Python interpreter to hard-code in the .spec file "
|
44 |
-
"(default: \"python\")",
|
45 |
-
),
|
46 |
-
(
|
47 |
-
'fix-python',
|
48 |
-
None,
|
49 |
-
"hard-code the exact path to the current Python interpreter in "
|
50 |
-
"the .spec file",
|
51 |
-
),
|
52 |
-
('spec-only', None, "only regenerate spec file"),
|
53 |
-
('source-only', None, "only generate source RPM"),
|
54 |
-
('binary-only', None, "only generate binary RPM"),
|
55 |
-
('use-bzip2', None, "use bzip2 instead of gzip to create source distribution"),
|
56 |
-
# More meta-data: too RPM-specific to put in the setup script,
|
57 |
-
# but needs to go in the .spec file -- so we make these options
|
58 |
-
# to "bdist_rpm". The idea is that packagers would put this
|
59 |
-
# info in setup.cfg, although they are of course free to
|
60 |
-
# supply it on the command line.
|
61 |
-
(
|
62 |
-
'distribution-name=',
|
63 |
-
None,
|
64 |
-
"name of the (Linux) distribution to which this "
|
65 |
-
"RPM applies (*not* the name of the module distribution!)",
|
66 |
-
),
|
67 |
-
('group=', None, "package classification [default: \"Development/Libraries\"]"),
|
68 |
-
('release=', None, "RPM release number"),
|
69 |
-
('serial=', None, "RPM serial number"),
|
70 |
-
(
|
71 |
-
'vendor=',
|
72 |
-
None,
|
73 |
-
"RPM \"vendor\" (eg. \"Joe Blow <[email protected]>\") "
|
74 |
-
"[default: maintainer or author from setup script]",
|
75 |
-
),
|
76 |
-
(
|
77 |
-
'packager=',
|
78 |
-
None,
|
79 |
-
"RPM packager (eg. \"Jane Doe <[email protected]>\") " "[default: vendor]",
|
80 |
-
),
|
81 |
-
('doc-files=', None, "list of documentation files (space or comma-separated)"),
|
82 |
-
('changelog=', None, "RPM changelog"),
|
83 |
-
('icon=', None, "name of icon file"),
|
84 |
-
('provides=', None, "capabilities provided by this package"),
|
85 |
-
('requires=', None, "capabilities required by this package"),
|
86 |
-
('conflicts=', None, "capabilities which conflict with this package"),
|
87 |
-
('build-requires=', None, "capabilities required to build this package"),
|
88 |
-
('obsoletes=', None, "capabilities made obsolete by this package"),
|
89 |
-
('no-autoreq', None, "do not automatically calculate dependencies"),
|
90 |
-
# Actions to take when building RPM
|
91 |
-
('keep-temp', 'k', "don't clean up RPM build directory"),
|
92 |
-
('no-keep-temp', None, "clean up RPM build directory [default]"),
|
93 |
-
(
|
94 |
-
'use-rpm-opt-flags',
|
95 |
-
None,
|
96 |
-
"compile with RPM_OPT_FLAGS when building from source RPM",
|
97 |
-
),
|
98 |
-
('no-rpm-opt-flags', None, "do not pass any RPM CFLAGS to compiler"),
|
99 |
-
('rpm3-mode', None, "RPM 3 compatibility mode (default)"),
|
100 |
-
('rpm2-mode', None, "RPM 2 compatibility mode"),
|
101 |
-
# Add the hooks necessary for specifying custom scripts
|
102 |
-
('prep-script=', None, "Specify a script for the PREP phase of RPM building"),
|
103 |
-
('build-script=', None, "Specify a script for the BUILD phase of RPM building"),
|
104 |
-
(
|
105 |
-
'pre-install=',
|
106 |
-
None,
|
107 |
-
"Specify a script for the pre-INSTALL phase of RPM building",
|
108 |
-
),
|
109 |
-
(
|
110 |
-
'install-script=',
|
111 |
-
None,
|
112 |
-
"Specify a script for the INSTALL phase of RPM building",
|
113 |
-
),
|
114 |
-
(
|
115 |
-
'post-install=',
|
116 |
-
None,
|
117 |
-
"Specify a script for the post-INSTALL phase of RPM building",
|
118 |
-
),
|
119 |
-
(
|
120 |
-
'pre-uninstall=',
|
121 |
-
None,
|
122 |
-
"Specify a script for the pre-UNINSTALL phase of RPM building",
|
123 |
-
),
|
124 |
-
(
|
125 |
-
'post-uninstall=',
|
126 |
-
None,
|
127 |
-
"Specify a script for the post-UNINSTALL phase of RPM building",
|
128 |
-
),
|
129 |
-
('clean-script=', None, "Specify a script for the CLEAN phase of RPM building"),
|
130 |
-
(
|
131 |
-
'verify-script=',
|
132 |
-
None,
|
133 |
-
"Specify a script for the VERIFY phase of the RPM build",
|
134 |
-
),
|
135 |
-
# Allow a packager to explicitly force an architecture
|
136 |
-
('force-arch=', None, "Force an architecture onto the RPM build process"),
|
137 |
-
('quiet', 'q', "Run the INSTALL phase of RPM building in quiet mode"),
|
138 |
-
]
|
139 |
-
|
140 |
-
boolean_options = [
|
141 |
-
'keep-temp',
|
142 |
-
'use-rpm-opt-flags',
|
143 |
-
'rpm3-mode',
|
144 |
-
'no-autoreq',
|
145 |
-
'quiet',
|
146 |
-
]
|
147 |
-
|
148 |
-
negative_opt = {
|
149 |
-
'no-keep-temp': 'keep-temp',
|
150 |
-
'no-rpm-opt-flags': 'use-rpm-opt-flags',
|
151 |
-
'rpm2-mode': 'rpm3-mode',
|
152 |
-
}
|
153 |
-
|
154 |
-
def initialize_options(self):
|
155 |
-
self.bdist_base = None
|
156 |
-
self.rpm_base = None
|
157 |
-
self.dist_dir = None
|
158 |
-
self.python = None
|
159 |
-
self.fix_python = None
|
160 |
-
self.spec_only = None
|
161 |
-
self.binary_only = None
|
162 |
-
self.source_only = None
|
163 |
-
self.use_bzip2 = None
|
164 |
-
|
165 |
-
self.distribution_name = None
|
166 |
-
self.group = None
|
167 |
-
self.release = None
|
168 |
-
self.serial = None
|
169 |
-
self.vendor = None
|
170 |
-
self.packager = None
|
171 |
-
self.doc_files = None
|
172 |
-
self.changelog = None
|
173 |
-
self.icon = None
|
174 |
-
|
175 |
-
self.prep_script = None
|
176 |
-
self.build_script = None
|
177 |
-
self.install_script = None
|
178 |
-
self.clean_script = None
|
179 |
-
self.verify_script = None
|
180 |
-
self.pre_install = None
|
181 |
-
self.post_install = None
|
182 |
-
self.pre_uninstall = None
|
183 |
-
self.post_uninstall = None
|
184 |
-
self.prep = None
|
185 |
-
self.provides = None
|
186 |
-
self.requires = None
|
187 |
-
self.conflicts = None
|
188 |
-
self.build_requires = None
|
189 |
-
self.obsoletes = None
|
190 |
-
|
191 |
-
self.keep_temp = 0
|
192 |
-
self.use_rpm_opt_flags = 1
|
193 |
-
self.rpm3_mode = 1
|
194 |
-
self.no_autoreq = 0
|
195 |
-
|
196 |
-
self.force_arch = None
|
197 |
-
self.quiet = 0
|
198 |
-
|
199 |
-
def finalize_options(self):
|
200 |
-
self.set_undefined_options('bdist', ('bdist_base', 'bdist_base'))
|
201 |
-
if self.rpm_base is None:
|
202 |
-
if not self.rpm3_mode:
|
203 |
-
raise DistutilsOptionError("you must specify --rpm-base in RPM 2 mode")
|
204 |
-
self.rpm_base = os.path.join(self.bdist_base, "rpm")
|
205 |
-
|
206 |
-
if self.python is None:
|
207 |
-
if self.fix_python:
|
208 |
-
self.python = sys.executable
|
209 |
-
else:
|
210 |
-
self.python = "python3"
|
211 |
-
elif self.fix_python:
|
212 |
-
raise DistutilsOptionError(
|
213 |
-
"--python and --fix-python are mutually exclusive options"
|
214 |
-
)
|
215 |
-
|
216 |
-
if os.name != 'posix':
|
217 |
-
raise DistutilsPlatformError(
|
218 |
-
"don't know how to create RPM " "distributions on platform %s" % os.name
|
219 |
-
)
|
220 |
-
if self.binary_only and self.source_only:
|
221 |
-
raise DistutilsOptionError(
|
222 |
-
"cannot supply both '--source-only' and '--binary-only'"
|
223 |
-
)
|
224 |
-
|
225 |
-
# don't pass CFLAGS to pure python distributions
|
226 |
-
if not self.distribution.has_ext_modules():
|
227 |
-
self.use_rpm_opt_flags = 0
|
228 |
-
|
229 |
-
self.set_undefined_options('bdist', ('dist_dir', 'dist_dir'))
|
230 |
-
self.finalize_package_data()
|
231 |
-
|
232 |
-
def finalize_package_data(self):
|
233 |
-
self.ensure_string('group', "Development/Libraries")
|
234 |
-
self.ensure_string(
|
235 |
-
'vendor',
|
236 |
-
"%s <%s>"
|
237 |
-
% (self.distribution.get_contact(), self.distribution.get_contact_email()),
|
238 |
-
)
|
239 |
-
self.ensure_string('packager')
|
240 |
-
self.ensure_string_list('doc_files')
|
241 |
-
if isinstance(self.doc_files, list):
|
242 |
-
for readme in ('README', 'README.txt'):
|
243 |
-
if os.path.exists(readme) and readme not in self.doc_files:
|
244 |
-
self.doc_files.append(readme)
|
245 |
-
|
246 |
-
self.ensure_string('release', "1")
|
247 |
-
self.ensure_string('serial') # should it be an int?
|
248 |
-
|
249 |
-
self.ensure_string('distribution_name')
|
250 |
-
|
251 |
-
self.ensure_string('changelog')
|
252 |
-
# Format changelog correctly
|
253 |
-
self.changelog = self._format_changelog(self.changelog)
|
254 |
-
|
255 |
-
self.ensure_filename('icon')
|
256 |
-
|
257 |
-
self.ensure_filename('prep_script')
|
258 |
-
self.ensure_filename('build_script')
|
259 |
-
self.ensure_filename('install_script')
|
260 |
-
self.ensure_filename('clean_script')
|
261 |
-
self.ensure_filename('verify_script')
|
262 |
-
self.ensure_filename('pre_install')
|
263 |
-
self.ensure_filename('post_install')
|
264 |
-
self.ensure_filename('pre_uninstall')
|
265 |
-
self.ensure_filename('post_uninstall')
|
266 |
-
|
267 |
-
# XXX don't forget we punted on summaries and descriptions -- they
|
268 |
-
# should be handled here eventually!
|
269 |
-
|
270 |
-
# Now *this* is some meta-data that belongs in the setup script...
|
271 |
-
self.ensure_string_list('provides')
|
272 |
-
self.ensure_string_list('requires')
|
273 |
-
self.ensure_string_list('conflicts')
|
274 |
-
self.ensure_string_list('build_requires')
|
275 |
-
self.ensure_string_list('obsoletes')
|
276 |
-
|
277 |
-
self.ensure_string('force_arch')
|
278 |
-
|
279 |
-
def run(self): # noqa: C901
|
280 |
-
if DEBUG:
|
281 |
-
print("before _get_package_data():")
|
282 |
-
print("vendor =", self.vendor)
|
283 |
-
print("packager =", self.packager)
|
284 |
-
print("doc_files =", self.doc_files)
|
285 |
-
print("changelog =", self.changelog)
|
286 |
-
|
287 |
-
# make directories
|
288 |
-
if self.spec_only:
|
289 |
-
spec_dir = self.dist_dir
|
290 |
-
self.mkpath(spec_dir)
|
291 |
-
else:
|
292 |
-
rpm_dir = {}
|
293 |
-
for d in ('SOURCES', 'SPECS', 'BUILD', 'RPMS', 'SRPMS'):
|
294 |
-
rpm_dir[d] = os.path.join(self.rpm_base, d)
|
295 |
-
self.mkpath(rpm_dir[d])
|
296 |
-
spec_dir = rpm_dir['SPECS']
|
297 |
-
|
298 |
-
# Spec file goes into 'dist_dir' if '--spec-only specified',
|
299 |
-
# build/rpm.<plat> otherwise.
|
300 |
-
spec_path = os.path.join(spec_dir, "%s.spec" % self.distribution.get_name())
|
301 |
-
self.execute(
|
302 |
-
write_file, (spec_path, self._make_spec_file()), "writing '%s'" % spec_path
|
303 |
-
)
|
304 |
-
|
305 |
-
if self.spec_only: # stop if requested
|
306 |
-
return
|
307 |
-
|
308 |
-
# Make a source distribution and copy to SOURCES directory with
|
309 |
-
# optional icon.
|
310 |
-
saved_dist_files = self.distribution.dist_files[:]
|
311 |
-
sdist = self.reinitialize_command('sdist')
|
312 |
-
if self.use_bzip2:
|
313 |
-
sdist.formats = ['bztar']
|
314 |
-
else:
|
315 |
-
sdist.formats = ['gztar']
|
316 |
-
self.run_command('sdist')
|
317 |
-
self.distribution.dist_files = saved_dist_files
|
318 |
-
|
319 |
-
source = sdist.get_archive_files()[0]
|
320 |
-
source_dir = rpm_dir['SOURCES']
|
321 |
-
self.copy_file(source, source_dir)
|
322 |
-
|
323 |
-
if self.icon:
|
324 |
-
if os.path.exists(self.icon):
|
325 |
-
self.copy_file(self.icon, source_dir)
|
326 |
-
else:
|
327 |
-
raise DistutilsFileError("icon file '%s' does not exist" % self.icon)
|
328 |
-
|
329 |
-
# build package
|
330 |
-
log.info("building RPMs")
|
331 |
-
rpm_cmd = ['rpmbuild']
|
332 |
-
|
333 |
-
if self.source_only: # what kind of RPMs?
|
334 |
-
rpm_cmd.append('-bs')
|
335 |
-
elif self.binary_only:
|
336 |
-
rpm_cmd.append('-bb')
|
337 |
-
else:
|
338 |
-
rpm_cmd.append('-ba')
|
339 |
-
rpm_cmd.extend(['--define', '__python %s' % self.python])
|
340 |
-
if self.rpm3_mode:
|
341 |
-
rpm_cmd.extend(['--define', '_topdir %s' % os.path.abspath(self.rpm_base)])
|
342 |
-
if not self.keep_temp:
|
343 |
-
rpm_cmd.append('--clean')
|
344 |
-
|
345 |
-
if self.quiet:
|
346 |
-
rpm_cmd.append('--quiet')
|
347 |
-
|
348 |
-
rpm_cmd.append(spec_path)
|
349 |
-
# Determine the binary rpm names that should be built out of this spec
|
350 |
-
# file
|
351 |
-
# Note that some of these may not be really built (if the file
|
352 |
-
# list is empty)
|
353 |
-
nvr_string = "%{name}-%{version}-%{release}"
|
354 |
-
src_rpm = nvr_string + ".src.rpm"
|
355 |
-
non_src_rpm = "%{arch}/" + nvr_string + ".%{arch}.rpm"
|
356 |
-
q_cmd = r"rpm -q --qf '{} {}\n' --specfile '{}'".format(
|
357 |
-
src_rpm,
|
358 |
-
non_src_rpm,
|
359 |
-
spec_path,
|
360 |
-
)
|
361 |
-
|
362 |
-
out = os.popen(q_cmd)
|
363 |
-
try:
|
364 |
-
binary_rpms = []
|
365 |
-
source_rpm = None
|
366 |
-
while True:
|
367 |
-
line = out.readline()
|
368 |
-
if not line:
|
369 |
-
break
|
370 |
-
ell = line.strip().split()
|
371 |
-
assert len(ell) == 2
|
372 |
-
binary_rpms.append(ell[1])
|
373 |
-
# The source rpm is named after the first entry in the spec file
|
374 |
-
if source_rpm is None:
|
375 |
-
source_rpm = ell[0]
|
376 |
-
|
377 |
-
status = out.close()
|
378 |
-
if status:
|
379 |
-
raise DistutilsExecError("Failed to execute: %s" % repr(q_cmd))
|
380 |
-
|
381 |
-
finally:
|
382 |
-
out.close()
|
383 |
-
|
384 |
-
self.spawn(rpm_cmd)
|
385 |
-
|
386 |
-
if not self.dry_run:
|
387 |
-
if self.distribution.has_ext_modules():
|
388 |
-
pyversion = get_python_version()
|
389 |
-
else:
|
390 |
-
pyversion = 'any'
|
391 |
-
|
392 |
-
if not self.binary_only:
|
393 |
-
srpm = os.path.join(rpm_dir['SRPMS'], source_rpm)
|
394 |
-
assert os.path.exists(srpm)
|
395 |
-
self.move_file(srpm, self.dist_dir)
|
396 |
-
filename = os.path.join(self.dist_dir, source_rpm)
|
397 |
-
self.distribution.dist_files.append(('bdist_rpm', pyversion, filename))
|
398 |
-
|
399 |
-
if not self.source_only:
|
400 |
-
for rpm in binary_rpms:
|
401 |
-
rpm = os.path.join(rpm_dir['RPMS'], rpm)
|
402 |
-
if os.path.exists(rpm):
|
403 |
-
self.move_file(rpm, self.dist_dir)
|
404 |
-
filename = os.path.join(self.dist_dir, os.path.basename(rpm))
|
405 |
-
self.distribution.dist_files.append(
|
406 |
-
('bdist_rpm', pyversion, filename)
|
407 |
-
)
|
408 |
-
|
409 |
-
def _dist_path(self, path):
|
410 |
-
return os.path.join(self.dist_dir, os.path.basename(path))
|
411 |
-
|
412 |
-
def _make_spec_file(self): # noqa: C901
|
413 |
-
"""Generate the text of an RPM spec file and return it as a
|
414 |
-
list of strings (one per line).
|
415 |
-
"""
|
416 |
-
# definitions and headers
|
417 |
-
spec_file = [
|
418 |
-
'%define name ' + self.distribution.get_name(),
|
419 |
-
'%define version ' + self.distribution.get_version().replace('-', '_'),
|
420 |
-
'%define unmangled_version ' + self.distribution.get_version(),
|
421 |
-
'%define release ' + self.release.replace('-', '_'),
|
422 |
-
'',
|
423 |
-
'Summary: ' + (self.distribution.get_description() or "UNKNOWN"),
|
424 |
-
]
|
425 |
-
|
426 |
-
# Workaround for #14443 which affects some RPM based systems such as
|
427 |
-
# RHEL6 (and probably derivatives)
|
428 |
-
vendor_hook = subprocess.getoutput('rpm --eval %{__os_install_post}')
|
429 |
-
# Generate a potential replacement value for __os_install_post (whilst
|
430 |
-
# normalizing the whitespace to simplify the test for whether the
|
431 |
-
# invocation of brp-python-bytecompile passes in __python):
|
432 |
-
vendor_hook = '\n'.join(
|
433 |
-
[' %s \\' % line.strip() for line in vendor_hook.splitlines()]
|
434 |
-
)
|
435 |
-
problem = "brp-python-bytecompile \\\n"
|
436 |
-
fixed = "brp-python-bytecompile %{__python} \\\n"
|
437 |
-
fixed_hook = vendor_hook.replace(problem, fixed)
|
438 |
-
if fixed_hook != vendor_hook:
|
439 |
-
spec_file.append('# Workaround for http://bugs.python.org/issue14443')
|
440 |
-
spec_file.append('%define __os_install_post ' + fixed_hook + '\n')
|
441 |
-
|
442 |
-
# put locale summaries into spec file
|
443 |
-
# XXX not supported for now (hard to put a dictionary
|
444 |
-
# in a config file -- arg!)
|
445 |
-
# for locale in self.summaries.keys():
|
446 |
-
# spec_file.append('Summary(%s): %s' % (locale,
|
447 |
-
# self.summaries[locale]))
|
448 |
-
|
449 |
-
spec_file.extend(
|
450 |
-
[
|
451 |
-
'Name: %{name}',
|
452 |
-
'Version: %{version}',
|
453 |
-
'Release: %{release}',
|
454 |
-
]
|
455 |
-
)
|
456 |
-
|
457 |
-
# XXX yuck! this filename is available from the "sdist" command,
|
458 |
-
# but only after it has run: and we create the spec file before
|
459 |
-
# running "sdist", in case of --spec-only.
|
460 |
-
if self.use_bzip2:
|
461 |
-
spec_file.append('Source0: %{name}-%{unmangled_version}.tar.bz2')
|
462 |
-
else:
|
463 |
-
spec_file.append('Source0: %{name}-%{unmangled_version}.tar.gz')
|
464 |
-
|
465 |
-
spec_file.extend(
|
466 |
-
[
|
467 |
-
'License: ' + (self.distribution.get_license() or "UNKNOWN"),
|
468 |
-
'Group: ' + self.group,
|
469 |
-
'BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot',
|
470 |
-
'Prefix: %{_prefix}',
|
471 |
-
]
|
472 |
-
)
|
473 |
-
|
474 |
-
if not self.force_arch:
|
475 |
-
# noarch if no extension modules
|
476 |
-
if not self.distribution.has_ext_modules():
|
477 |
-
spec_file.append('BuildArch: noarch')
|
478 |
-
else:
|
479 |
-
spec_file.append('BuildArch: %s' % self.force_arch)
|
480 |
-
|
481 |
-
for field in (
|
482 |
-
'Vendor',
|
483 |
-
'Packager',
|
484 |
-
'Provides',
|
485 |
-
'Requires',
|
486 |
-
'Conflicts',
|
487 |
-
'Obsoletes',
|
488 |
-
):
|
489 |
-
val = getattr(self, field.lower())
|
490 |
-
if isinstance(val, list):
|
491 |
-
spec_file.append('{}: {}'.format(field, ' '.join(val)))
|
492 |
-
elif val is not None:
|
493 |
-
spec_file.append('{}: {}'.format(field, val))
|
494 |
-
|
495 |
-
if self.distribution.get_url():
|
496 |
-
spec_file.append('Url: ' + self.distribution.get_url())
|
497 |
-
|
498 |
-
if self.distribution_name:
|
499 |
-
spec_file.append('Distribution: ' + self.distribution_name)
|
500 |
-
|
501 |
-
if self.build_requires:
|
502 |
-
spec_file.append('BuildRequires: ' + ' '.join(self.build_requires))
|
503 |
-
|
504 |
-
if self.icon:
|
505 |
-
spec_file.append('Icon: ' + os.path.basename(self.icon))
|
506 |
-
|
507 |
-
if self.no_autoreq:
|
508 |
-
spec_file.append('AutoReq: 0')
|
509 |
-
|
510 |
-
spec_file.extend(
|
511 |
-
[
|
512 |
-
'',
|
513 |
-
'%description',
|
514 |
-
self.distribution.get_long_description() or "",
|
515 |
-
]
|
516 |
-
)
|
517 |
-
|
518 |
-
# put locale descriptions into spec file
|
519 |
-
# XXX again, suppressed because config file syntax doesn't
|
520 |
-
# easily support this ;-(
|
521 |
-
# for locale in self.descriptions.keys():
|
522 |
-
# spec_file.extend([
|
523 |
-
# '',
|
524 |
-
# '%description -l ' + locale,
|
525 |
-
# self.descriptions[locale],
|
526 |
-
# ])
|
527 |
-
|
528 |
-
# rpm scripts
|
529 |
-
# figure out default build script
|
530 |
-
def_setup_call = "{} {}".format(self.python, os.path.basename(sys.argv[0]))
|
531 |
-
def_build = "%s build" % def_setup_call
|
532 |
-
if self.use_rpm_opt_flags:
|
533 |
-
def_build = 'env CFLAGS="$RPM_OPT_FLAGS" ' + def_build
|
534 |
-
|
535 |
-
# insert contents of files
|
536 |
-
|
537 |
-
# XXX this is kind of misleading: user-supplied options are files
|
538 |
-
# that we open and interpolate into the spec file, but the defaults
|
539 |
-
# are just text that we drop in as-is. Hmmm.
|
540 |
-
|
541 |
-
install_cmd = (
|
542 |
-
'%s install -O1 --root=$RPM_BUILD_ROOT ' '--record=INSTALLED_FILES'
|
543 |
-
) % def_setup_call
|
544 |
-
|
545 |
-
script_options = [
|
546 |
-
('prep', 'prep_script', "%setup -n %{name}-%{unmangled_version}"),
|
547 |
-
('build', 'build_script', def_build),
|
548 |
-
('install', 'install_script', install_cmd),
|
549 |
-
('clean', 'clean_script', "rm -rf $RPM_BUILD_ROOT"),
|
550 |
-
('verifyscript', 'verify_script', None),
|
551 |
-
('pre', 'pre_install', None),
|
552 |
-
('post', 'post_install', None),
|
553 |
-
('preun', 'pre_uninstall', None),
|
554 |
-
('postun', 'post_uninstall', None),
|
555 |
-
]
|
556 |
-
|
557 |
-
for (rpm_opt, attr, default) in script_options:
|
558 |
-
# Insert contents of file referred to, if no file is referred to
|
559 |
-
# use 'default' as contents of script
|
560 |
-
val = getattr(self, attr)
|
561 |
-
if val or default:
|
562 |
-
spec_file.extend(
|
563 |
-
[
|
564 |
-
'',
|
565 |
-
'%' + rpm_opt,
|
566 |
-
]
|
567 |
-
)
|
568 |
-
if val:
|
569 |
-
with open(val) as f:
|
570 |
-
spec_file.extend(f.read().split('\n'))
|
571 |
-
else:
|
572 |
-
spec_file.append(default)
|
573 |
-
|
574 |
-
# files section
|
575 |
-
spec_file.extend(
|
576 |
-
[
|
577 |
-
'',
|
578 |
-
'%files -f INSTALLED_FILES',
|
579 |
-
'%defattr(-,root,root)',
|
580 |
-
]
|
581 |
-
)
|
582 |
-
|
583 |
-
if self.doc_files:
|
584 |
-
spec_file.append('%doc ' + ' '.join(self.doc_files))
|
585 |
-
|
586 |
-
if self.changelog:
|
587 |
-
spec_file.extend(
|
588 |
-
[
|
589 |
-
'',
|
590 |
-
'%changelog',
|
591 |
-
]
|
592 |
-
)
|
593 |
-
spec_file.extend(self.changelog)
|
594 |
-
|
595 |
-
return spec_file
|
596 |
-
|
597 |
-
def _format_changelog(self, changelog):
|
598 |
-
"""Format the changelog correctly and convert it to a list of strings"""
|
599 |
-
if not changelog:
|
600 |
-
return changelog
|
601 |
-
new_changelog = []
|
602 |
-
for line in changelog.strip().split('\n'):
|
603 |
-
line = line.strip()
|
604 |
-
if line[0] == '*':
|
605 |
-
new_changelog.extend(['', line])
|
606 |
-
elif line[0] == '-':
|
607 |
-
new_changelog.append(line)
|
608 |
-
else:
|
609 |
-
new_changelog.append(' ' + line)
|
610 |
-
|
611 |
-
# strip trailing newline inserted by first changelog entry
|
612 |
-
if not new_changelog[0]:
|
613 |
-
del new_changelog[0]
|
614 |
-
|
615 |
-
return new_changelog
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Awiny/Image2Paragraph/models/grit_src/third_party/CenterNet2/detectron2/utils/file_io.py
DELETED
@@ -1,37 +0,0 @@
|
|
1 |
-
# Copyright (c) Facebook, Inc. and its affiliates.
|
2 |
-
from iopath.common.file_io import HTTPURLHandler, OneDrivePathHandler, PathHandler
|
3 |
-
from iopath.common.file_io import PathManager as PathManagerBase
|
4 |
-
|
5 |
-
__all__ = ["PathManager", "PathHandler"]
|
6 |
-
|
7 |
-
|
8 |
-
PathManager = PathManagerBase()
|
9 |
-
"""
|
10 |
-
This is a detectron2 project-specific PathManager.
|
11 |
-
We try to stay away from global PathManager in fvcore as it
|
12 |
-
introduces potential conflicts among other libraries.
|
13 |
-
"""
|
14 |
-
|
15 |
-
|
16 |
-
class Detectron2Handler(PathHandler):
|
17 |
-
"""
|
18 |
-
Resolve anything that's hosted under detectron2's namespace.
|
19 |
-
"""
|
20 |
-
|
21 |
-
PREFIX = "detectron2://"
|
22 |
-
S3_DETECTRON2_PREFIX = "https://dl.fbaipublicfiles.com/detectron2/"
|
23 |
-
|
24 |
-
def _get_supported_prefixes(self):
|
25 |
-
return [self.PREFIX]
|
26 |
-
|
27 |
-
def _get_local_path(self, path, **kwargs):
|
28 |
-
name = path[len(self.PREFIX) :]
|
29 |
-
return PathManager.get_local_path(self.S3_DETECTRON2_PREFIX + name, **kwargs)
|
30 |
-
|
31 |
-
def _open(self, path, mode="r", **kwargs):
|
32 |
-
return PathManager.open(self._get_local_path(path), mode, **kwargs)
|
33 |
-
|
34 |
-
|
35 |
-
PathManager.register_handler(HTTPURLHandler())
|
36 |
-
PathManager.register_handler(OneDrivePathHandler())
|
37 |
-
PathManager.register_handler(Detectron2Handler())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Benson/text-generation/Examples/Ao Nuevo Deseos 2023 Imgenes.md
DELETED
@@ -1,80 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>Restaurant Administration: Tips for Managing a Successful Restaurant </h1>
|
3 |
-
<p> Managing the restaurant is a challenging task that requires many tasks and responsibilities. Restaurant managers have to run things smoothly, both in front of and behind the restaurant, provide excellent service to customers, manage employees and make important decisions. In this article, we will describe the importance, challenges, benefits and tips of managing restaurants. </p>
|
4 |
-
<h2>año nuevo deseos 2023 imágenes</h2><br /><p><b><b>Download</b> 🔗 <a href="https://bltlly.com/2v6M6s">https://bltlly.com/2v6M6s</a></b></p><br /><br />
|
5 |
-
<h2> The importance of restaurant management </h2>
|
6 |
-
Managing the restaurant <p> plays a vital role in the success of the restaurant. Restaurant managers ensure that all parts of the restaurant work harmoniously and add value to the restaurant. Some responsibilities and skills that restaurant managers should have are: </p>
|
7 |
-
<h3> Responsibilities of restaurant managers </h3>
|
8 |
-
<ul>
|
9 |
-
<li> Hiring, educating, evaluating and removing employees when necessary. </li>
|
10 |
-
<li> Carrying out accounting and financial affairs, creating budgets and monitoring food and labor costs. </li>
|
11 |
-
<li> Monitor food and beverage stock levels and order when necessary. </li>
|
12 |
-
<li> Preparing work programs, paying salaries and wages. </li>
|
13 |
-
<li> Marketing the restaurant, managing social media accounts, receiving customer feedback. </li>
|
14 |
-
<li> Communicating with customers, resolving complaints, ensuring service quality. </li>
|
15 |
-
<li> Protecting the atmosphere and hygiene of the restaurant, ensuring that employees comply with health and safety standards. </li>
|
16 |
-
</ul>
|
17 |
-
<h3> Skills of restaurant managers </h3>
|
18 |
-
<ul>
|
19 |
-
<li>L <p> Leadership, management, organization, problem solving, decision making, communication, negotiation, customer service and teamwork skills. </li>
|
20 |
-
<li> Information on food and beverage information, restaurant operating rules, health and safety regulations, marketing strategies and restaurant management software. </li>
|
21 |
-
<li>Stress ability to work, flexibility, creativity, entrepreneurship and innovation skills. </li>
|
22 |
-
</ul>
|
23 |
-
<h2>Restaurant management difficulties </h2>
|
24 |
-
|
25 |
-
<h3>Staff speed </h3>
|
26 |
-
<p> Personnel turnover rate in the restaurant sector is quite high. Employees can leave work due to low wages, long working hours, stressful environment and lack of career opportunities. This brings additional workload and cost to restaurant managers. Restaurant managers should offer their employees fair wages, flexible working hours, training opportunities and rewarding systems to reduce staff turnover. </h3>
|
27 |
-
<h3>Cost control </h3>
|
28 |
-
<p> Managing a restaurant requires controlling costs. Restaurant managers should monitor and optimize food and beverage costs, labor costs, rental and invoice costs, tax and insurance costs, and other operational costs. Restaurant managers should create budgets for cost control, manage stock, prevent waste and increase efficiency. </h3>
|
29 |
-
<h3> Customer satisfaction </h3>
|
30 |
-
<p> Managing a restaurant requires customer satisfaction. Restaurant managers should offer quality food and drink, and provide fast and polite service to meet customers' expectations. Restaurant managers should receive customer feedback, resolve complaints and increase customer loyalty. </p>
|
31 |
-
<h2>Restaurant management benefits </h2>
|
32 |
-
<p> Managing the restaurant provides many benefits. Some benefits that restaurant managers can achieve are: </p>
|
33 |
-
<h3>Income increase </h3>
|
34 |
-
<p> Managing restaurants contributes to revenue growth. Restaurant managers can design a profitable menu to increase the restaurant's income, attract new customers to the restaurant and keep existing customers coming back. Restaurant managers should track the restaurant's income and develop strategies to support revenue growth. </p>
|
35 |
-
<p></p>
|
36 |
-
<h3> Brand image </h3>
|
37 |
-
|
38 |
-
<h3> Employee motivation </h3>
|
39 |
-
Managing <p> Restaurant increases employee motivation. Restaurant managers can offer them fair and competitive fees, premiums, bonuses, permits and other social rights to motivate their employees. Restaurant managers can train, develop, empower and appreciate their employees. Restaurant managers can communicate well with employees, give them feedback and respect and trust them. </p>
|
40 |
-
<h2>Restaurant director's tips </h2>
|
41 |
-
<p> Managing the restaurant needs some tips to be successful. Here are some tips that restaurant managers can apply: </p>
|
42 |
-
<h3> Investigate your restaurant niche </h3>
|
43 |
-
Managing a restaurant requires researching your restaurant niche. Restaurant managers should analyze the restaurant's target audience, competitors, market trends and opportunities. Restaurant managers should identify the strengths and weaknesses of the restaurant, its differentiating elements and competitive advantages. </p>
|
44 |
-
<h3> Appreciate and value your employees </h3>
|
45 |
-
Managing <p> Restaurant requires appreciating and valuing your employees. Restaurant managers should measure the performance of their employees and celebrate their success. Restaurant managers should set realistic and achievable goals for their employees and support them. Restaurant managers should give their employees honest and constructive feedback and listen to their suggestions and complaints. </p>
|
46 |
-
<h3> Experience how the job is done yourself </h3>
|
47 |
-
Managing a restaurant requires you to experience how the job is done. Restaurant managers should see and understand what employees do in all parts of the restaurant. Restaurant managers should spend a day at the restaurant, cook in the kitchen, serve or cashier. In this way, restaurant managers can improve workflow, detect problems and gain empathy for employees. </p>
|
48 |
-
|
49 |
-
Managing <p> Restaurant requires focusing on customer satisfaction. Restaurant managers should understand and meet the needs and wishes of customers. Restaurant managers should offer customers delicious food and drink, and provide fast and polite service. Restaurant managers can offer loyalty programs to customers, give discounts or gifts, or celebrate on special occasions. Restaurant managers should receive feedback from customers and resolve complaints or apologize. </p>
|
50 |
-
<h3> Plan ahead by setting job expectations </h3> <p> Managing a restaurant requires prior planning by setting job expectations. Restaurant managers should set the restaurant's short and long term goals and develop strategies to achieve them. Restaurant managers should make income and expense estimates of the restaurant, create budgets and prepare financial reports. Restaurant managers should make operational plans of the restaurant, prepare work programs and check stock levels. </p>
|
51 |
-
<h3> Design a stable menu </h3>
|
52 |
-
Managing <p> Restaurant requires designing a profitable menu. Restaurant managers should create a menu that matches the restaurant's concept, target audience and market trends. Restaurant managers should calculate and optimize the costs, prices and profit margins of meals on the menu. Restaurant managers should ensure the quality, presentation and flavor of the dishes on the menu and update them regularly. </p>
|
53 |
-
<h3> Promote your restaurant using social media </h3>
|
54 |
-
|
55 |
-
<h3> Benefit from restaurant management software </h3>
|
56 |
-
<p> Managing restaurants requires use of restaurant management software. Restaurant management software simplifies all processes of the restaurant and increases efficiency. Thanks to restaurant management software, restaurant managers can: </p>
|
57 |
-
<ul>
|
58 |
-
<li> Can track reservations, receive orders and cut invoices. </li>
|
59 |
-
<li> Can monitor, order and prevent waste of stock levels. </li>
|
60 |
-
<li> Can conduct accounting and financial affairs, create budgets and report. </li>
|
61 |
-
<li> Can measure employee performance, pay salaries and provide training. </li>
|
62 |
-
<li>Customer can create database, offer loyalty programs and make marketing campaigns. </li>
|
63 |
-
</ul>
|
64 |
-
<h2>Result </h2>
|
65 |
-
<p> The restaurant contains many tasks and responsibilities necessary to manage, to be a successful restaurant owner or manager. When you understand the importance, challenges, benefits and tips of managing restaurants, you can contribute to the success of your restaurant. In this article, we shared tips for managing restaurants to help you. We hope these tips will be useful to you. </p>
|
66 |
-
<h2>Frequently Asked Questions </h2>
|
67 |
-
<ul>
|
68 |
-
<li><b> Which <b> What training do I need to manage the restaurant?</b> </li>
|
69 |
-
<li> To manage the restaurant, you can study in areas such as restaurant management, food and beverage management, culinary arts, marketing, accounting, human resources. You can find these trainings in universities, vocational schools, certificate programs or online courses. </li>
|
70 |
-
<li><b> What documents do I need to manage the restaurant?</b> </li>
|
71 |
-
|
72 |
-
<li><b> What tools do I need to manage the restaurant?</b> </li>
|
73 |
-
<li> To manage the restaurant, you may need a variety of tools that vary depending on the type and size of the restaurant. These include tools such as kitchen equipment, service materials, tables and chairs, safe system, computer and printer, telephone and internet connection, security camera and alarm system. </li>
|
74 |
-
<li><b> What laws do I have to comply with to manage the restaurant?</b> </li>
|
75 |
-
<li> To manage the restaurant, you have to comply with the laws in the country, city and region where the restaurant operates. These laws include laws such as tax laws, labor laws, health and safety laws, consumer rights laws, and food laws. You must follow the current status of these laws and apply them accordingly. </li>
|
76 |
-
<li><b> What resources can I use to manage the restaurant?</b> </li>
|
77 |
-
<li> To manage the restaurant, you can use a variety of resources to track up-to-date information and news about the restaurant industry. These include resources such as restaurant magazines, websites, blogs, podcasts, social media accounts, online forums. You can also learn from your experience by communicating with restaurant owners and managers. </li>
|
78 |
-
</ul> </p> 64aa2da5cf<br />
|
79 |
-
<br />
|
80 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Benson/text-generation/Examples/Descargar Cancin De Conquista.md
DELETED
@@ -1,153 +0,0 @@
|
|
1 |
-
<br />
|
2 |
-
<h1>Cómo Descargar Canción de Conquista: Un Juego de Estrategia por Turnos Inspirado en los Clásicos de los 90</h1>
|
3 |
-
<p>Si eres un fan de los juegos de estrategia por turnos, es posible que hayas oído hablar de Song of Conquest, un juego inspirado en clásicos de los 90 como Heroes of Might y Magic III. En este juego, puedes liderar poderosos magos llamados Portadores, construir un imperio, librar batallas y cazar artefactos en un mundo de fantasía. Suena emocionante, ¿verdad? ¿Pero cómo puedes descargar este juego y empezar a jugar? En este artículo, te mostraremos cómo descargar Song of Conquest de diferentes fuentes, así como algunos consejos y trucos para que tu experiencia de juego sea más agradable. </p>
|
4 |
-
<h2>¿Qué es la Canción de la Conquista? </h2>
|
5 |
-
<h3>Una breve introducción al juego y sus características</h3>
|
6 |
-
<p>Song of Conquest es un juego de estrategia por turnos desarrollado por Lavapotion y publicado por Coffee Stain Publishing. Es un homenaje a los juegos clásicos del género, como Heroes of Might y Magic III, King’s Bounty y Age of Wonders. Las características del juego:</p>
|
7 |
-
<h2>descargar canción de conquista</h2><br /><p><b><b>Download Zip</b> ★★★ <a href="https://bltlly.com/2v6L3g">https://bltlly.com/2v6L3g</a></b></p><br /><br />
|
8 |
-
<ul>
|
9 |
-
<li>Cuatro facciones jugables, cada una con sus propias unidades, habilidades y estética. </li>
|
10 |
-
<li>Un mapa del mundo rico y diverso con diferentes terrenos, recursos y secretos. </li>
|
11 |
-
<li>Un sistema de combate dinámico que te permite usar hechizos, formaciones, terreno y moral a tu favor. </li>
|
12 |
-
<li>Un sistema de gestión del reino que te permite construir estructuras, reclutar unidades, tecnologías de investigación e interactuar con otras facciones. </li>
|
13 |
-
<li>Un modo de campaña basado en la historia que sigue las aventuras de cuatro Portadores a través de múltiples escenarios. </li>
|
14 |
-
<li>Un modo multijugador que admite hasta ocho jugadores en modo cooperativo en línea o local o contra partidos. </li>
|
15 |
-
</ul>
|
16 |
-
<h3>Las plataformas y fecha de lanzamiento del juego</h3>
|
17 |
-
|
18 |
-
<h2>Cómo descargar la canción de conquista desde el sitio web oficial</h2>
|
19 |
-
<h3>Los pasos para comprar y descargar el juego desde el sitio web del desarrollador</h3>
|
20 |
-
<p>La forma más fácil de descargar Song of Conquest es desde el sitio web oficial. Estos son los pasos a seguir:</p>
|
21 |
-
<ol>
|
22 |
-
<li>Vaya a <a href="( 1 )">https://www.songsofconquest.com/</a> y haga clic en "Comprar ahora". </li>
|
23 |
-
<li>Seleccione su edición preferida (Standard o Deluxe) y método de pago (tarjeta de crédito o PayPal). </li>
|
24 |
-
<li>Introduzca su dirección de correo electrónico y confirme su compra. </li>
|
25 |
-
<li>Recibirá un correo electrónico con un enlace para descargar el instalador del juego. </li>
|
26 |
-
<li>Haga clic en el enlace y guarde el archivo de instalación en su computadora. </li>
|
27 |
-
<li>Ejecute el archivo de instalación y siga las instrucciones para instalar el juego. </li>
|
28 |
-
</ol>
|
29 |
-
<h3>Los requisitos del sistema y las instrucciones de instalación para el juego</h3>
|
30 |
-
<p>Antes de descargar Song of Conquest, asegúrese de que su computadora cumple con los requisitos mínimos del sistema para el juego. Según Steam, estos son:</p> <p>Los requisitos mínimos del sistema para Song of Conquest son:</p>
|
31 |
-
<tabla>
|
32 |
-
<tr>
|
33 |
-
<th>OS</th>
|
34 |
-
<th>Procesador</th>
|
35 |
-
<th>Memoria</th>
|
36 |
-
<th>Gráficos</th>
|
37 |
-
<th>DirectX</th>
|
38 |
-
<th>Almacenamiento</th>
|
39 |
-
</tr>
|
40 |
-
<tr>
|
41 |
-
<td>Windows 7 (64 bits)</td>
|
42 |
-
<td>i5 Dual Core o Ryzen 5</td>
|
43 |
-
<td>8 GB de RAM</td>
|
44 |
-
<td>GTX 970, RX 570 o similar</td>
|
45 |
-
<td>Versión 10</td>
|
46 |
-
<td>10 GB de espacio disponible</td>
|
47 |
-
</tr>
|
48 |
-
</tabla>
|
49 |
-
<p>Si su computadora cumple con estos requisitos, usted debe ser capaz de ejecutar el juego sin problemas. Sin embargo, si desea disfrutar del juego en su mejor momento, es posible que desee actualizar su sistema o comprobar los requisitos recomendados cuando estén disponibles. </p>
|
50 |
-
<p>Para instalar el juego, debes seguir estos pasos:</p>
|
51 |
-
<ol>
|
52 |
-
<li>Haga doble clic en el archivo de instalación que descargó desde el enlace de correo electrónico. </li>
|
53 |
-
<li>Seleccione la carpeta de destino donde desea instalar el juego. </li>
|
54 |
-
<li>Acepta los términos y condiciones y haz clic en "Instalar". </li>
|
55 |
-
|
56 |
-
<li> Ahora puede iniciar el juego desde el acceso directo del escritorio o el menú de inicio. </li>
|
57 |
-
</ol>
|
58 |
-
<h2>Cómo Descargar Canción de Conquista de Steam</h2>
|
59 |
-
<h3>Los pasos para comprar y descargar el juego de Steam</h3>
|
60 |
-
<p>Otra forma de descargar Song of Conquest es desde Steam, una popular plataforma de distribución digital para juegos de PC. Estos son los pasos a seguir:</p>
|
61 |
-
<p></p>
|
62 |
-
<ol>
|
63 |
-
<li>Ir a <a href="( 2 )">https://store.steampowered.com/app/867210/Songs_of_Conquest/</a> y hacer clic en "Añadir al carrito". </li>
|
64 |
-
<li>Si no tienes una cuenta de Steam, necesitas crear una e iniciar sesión. Si ya tienes una cuenta, puedes saltarte este paso. </li>
|
65 |
-
<li>Proceda a pagar y seleccione su método de pago. Puede usar tarjeta de crédito, PayPal, Steam Wallet u otras opciones. </li>
|
66 |
-
<li>Confirma tu compra y espera el correo de confirmación. </li>
|
67 |
-
<li>Recibirás un código que necesitas activar en Steam. Para ello, abre Steam y haz clic en "Juegos" y luego en "Activar un producto en Steam". </li>
|
68 |
-
<li>Introduzca el código y siga las instrucciones para añadir el juego a su biblioteca. </li>
|
69 |
-
<li>Ahora puedes descargar e instalar el juego desde tu biblioteca. </li>
|
70 |
-
</ol>
|
71 |
-
<h3>Los beneficios y desventajas de usar Steam como plataforma</h3>
|
72 |
-
<p>Usar Steam como plataforma para descargar Song of Conquest tiene algunas ventajas y desventajas. Estas son algunas de ellas:</p>
|
73 |
-
<ul>
|
74 |
-
<li>Los beneficios de usar Steam son: <ul>
|
75 |
-
<li>Puedes acceder a tu juego desde cualquier ordenador que tenga Steam instalado. </li>
|
76 |
-
<li> Puedes disfrutar de actualizaciones automáticas, almacenamiento en la nube, logros y otras funciones que ofrece Steam. </li>
|
77 |
-
<li>Puedes unirte a la comunidad de Steam e interactuar con otros jugadores, desarrolladores y moderadores. </li>
|
78 |
-
<li>Puedes obtener descuentos, ofertas y juegos gratis de las ventas y eventos de Steam. </li>
|
79 |
-
</ul>
|
80 |
-
</li>
|
81 |
-
<li>Los inconvenientes de usar Steam son: <ul>
|
82 |
-
<li>Necesitas tener una conexión a Internet y una cuenta de Steam para jugar. </li>
|
83 |
-
|
84 |
-
<li>Es posible que tenga que lidiar con restricciones DRM (gestión de derechos digitales) que limitan su control sobre el juego. </li>
|
85 |
-
<li>Es posible que tenga que pagar tasas o impuestos adicionales dependiendo de su región y método de pago. </li>
|
86 |
-
</ul>
|
87 |
-
</li>
|
88 |
-
</ul>
|
89 |
-
<h2>Cómo descargar canción de conquista de otras fuentes</h2>
|
90 |
-
<h3>Las alternativas al sitio web oficial y Steam, como GOG y itch.io</h3>
|
91 |
-
<p>Si no quieres descargar Song of Conquest del sitio web oficial o Steam, tienes otras opciones. Por ejemplo, puedes descargar el juego desde GOG o itch.io, otras dos plataformas de distribución digital que ofrecen juegos sin DRM. Aquí hay algunas diferencias entre ellos:</p>
|
92 |
-
<tabla>
|
93 |
-
<tr>
|
94 |
-
<th>GOG</th>
|
95 |
-
<th>itch.io</th>
|
96 |
-
</tr>
|
97 |
-
<tr>
|
98 |
-
<td>Una plataforma especializada en juegos clásicos e indie. </td>
|
99 |
-
<td>Una plataforma que alberga juegos indie y juegos. </td>
|
100 |
-
<tr/>
|
101 |
-
<tr><td>Una plataforma que ofrece una garantía de devolución de dinero, copias de seguridad fuera de línea y el cliente GOG Galaxy. </td><td>Una plataforma que permite precios de pago-qué-quieres, soporte directo para desarrolladores y ningún cliente requerido. </td></tr></table>
|
102 |
-
<p>Para descargar Song of Conquest Para descargar Song of Conquest de GOG o itch.io, debes seguir estos pasos:</p>
|
103 |
-
<ol>
|
104 |
-
<li>Vaya a <a href=">https://www.gog.com/game/songs_of_conquest</a> o <a href="">https://lavapotion.itch.io/song-of-conquest</a> y haga clic en "Comprar ahora". </li>
|
105 |
-
<li>Seleccione su edición preferida (Estándar o Deluxe) y el método de pago. Puede usar tarjeta de crédito, PayPal u otras opciones. </li>
|
106 |
-
<li>Introduzca su dirección de correo electrónico y confirme su compra. </li>
|
107 |
-
<li>Recibirá un correo electrónico con un enlace para descargar el instalador del juego. </li>
|
108 |
-
<li>Haga clic en el enlace y guarde el archivo de instalación en su computadora. </li>
|
109 |
-
<li>Ejecute el archivo de instalación y siga las instrucciones para instalar el juego. </li>
|
110 |
-
</ol>
|
111 |
-
<h3>Los pros y los contras de usar estas fuentes y las precauciones a tomar</h3>
|
112 |
-
|
113 |
-
<ul>
|
114 |
-
<li>Los pros de usar estas fuentes son: <ul>
|
115 |
-
<li> Puedes disfrutar de juegos sin DRM que puedes jugar sin restricciones o limitaciones. </li>
|
116 |
-
<li>Puedes apoyar a los desarrolladores directamente y ayudarles a crear más juegos. </li>
|
117 |
-
<li> Puede acceder a contenido exclusivo, actualizaciones y bonos que no están disponibles en otras plataformas. </li>
|
118 |
-
</ul>
|
119 |
-
</li>
|
120 |
-
<li>Los contras de usar estas fuentes son: <ul>
|
121 |
-
<li>Es posible que no tenga acceso a algunas funciones o servicios que están disponibles en otras plataformas, como los ahorros en la nube, los logros o el modo multijugador. </li>
|
122 |
-
<li>Puedes encontrar algunos problemas de compatibilidad o rendimiento con tu sistema o el juego. </li>
|
123 |
-
<li>Es posible que tenga que lidiar con riesgos de seguridad o privacidad al descargar de fuentes desconocidas o no confiables. </li>
|
124 |
-
</ul>
|
125 |
-
</li>
|
126 |
-
</ul>
|
127 |
-
<p>Para evitar problemas o problemas al descargar Song of Conquest de estas fuentes, debe tomar algunas precauciones. Aquí hay algunos consejos:</p>
|
128 |
-
<ul>
|
129 |
-
<li>Asegúrese de que su computadora cumple con los requisitos del sistema para el juego. </li>
|
130 |
-
<li>Compruebe las revisiones y clasificaciones del juego y la fuente antes de comprar o descargar. </li>
|
131 |
-
<li>Utilice un software antivirus confiable y escanee el archivo de instalación antes de ejecutarlo. </li>
|
132 |
-
<li>Crea una copia de seguridad de tus archivos de juego y datos en caso de errores o fallos. </li>
|
133 |
-
<li>Póngase en contacto con el desarrollador o la fuente si tiene alguna pregunta o problema con el juego. </li>
|
134 |
-
</ul>
|
135 |
-
<h2>Conclusión</h2>
|
136 |
-
<h3>Un resumen de los puntos principales y una recomendación para el juego</h3>
|
137 |
-
|
138 |
-
<h3>Cinco preguntas frecuentes únicas sobre cómo descargar Song of Conquest</h3>
|
139 |
-
<p>Aquí hay algunas preguntas frecuentes sobre la descarga de la canción de conquista:</p>
|
140 |
-
<ol>
|
141 |
-
<li><b>¿Cuánto cuesta la canción de conquista? </b></li>
|
142 |
-
<p>Canción de conquista cuesta $29.99 para la edición estándar y $39.99 para la edición de lujo. La edición Deluxe incluye la banda sonora, el libro de arte digital, los fondos de pantalla y los elementos del juego. Los precios pueden variar según la fuente y la región. </p>
|
143 |
-
<li><b>¿Puedo reproducir Canción de conquista sin conexión? </b></li>
|
144 |
-
<p>Sí, puedes reproducir Song of Conquest sin conexión si lo descargas desde el sitio web oficial, GOG o itch.io. Sin embargo, es posible que no pueda acceder a algunas funciones o actualizaciones que requieren una conexión a Internet. Si lo descargas desde Steam, necesitas tener una conexión a Internet y una cuenta de Steam para jugar. </p>
|
145 |
-
<li><b>¿Puedo reproducir la canción de conquista en Mac? </b></li>
|
146 |
-
<p>Sí, puede reproducir Song of Conquest en Mac si lo descarga desde el sitio web oficial, GOG o itch.io. Sin embargo, puede encontrar algunos problemas de compatibilidad o rendimiento con su sistema o el juego. Si lo descargas desde Steam, necesitas tener un PC con Windows para jugar. </p>
|
147 |
-
<li><b>¿Puedo obtener un reembolso por Canción de Conquista? </b></li>
|
148 |
-
<p>Depende de la fuente desde la que lo descargues. Si lo descarga desde el sitio web oficial, GOG o itch io, puede solicitar un reembolso dentro de los 30 días de la compra si cumple con las condiciones de su política de reembolso. Si lo descargas desde Steam, puedes solicitar un reembolso dentro de los 14 días posteriores a la compra si has jugado el juego durante menos de 2 horas. Puede encontrar más detalles sobre las políticas de reembolso en los respectivos sitios web. </p>
|
149 |
-
<li><b>¿Puedo modificar la canción de conquista? </b></li>
|
150 |
-
|
151 |
-
</ol></p> 64aa2da5cf<br />
|
152 |
-
<br />
|
153 |
-
<br />
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Big-Web/MMSD/env/Lib/site-packages/pip/_vendor/pyparsing/actions.py
DELETED
@@ -1,207 +0,0 @@
|
|
1 |
-
# actions.py
|
2 |
-
|
3 |
-
from .exceptions import ParseException
|
4 |
-
from .util import col
|
5 |
-
|
6 |
-
|
7 |
-
class OnlyOnce:
|
8 |
-
"""
|
9 |
-
Wrapper for parse actions, to ensure they are only called once.
|
10 |
-
"""
|
11 |
-
|
12 |
-
def __init__(self, method_call):
|
13 |
-
from .core import _trim_arity
|
14 |
-
|
15 |
-
self.callable = _trim_arity(method_call)
|
16 |
-
self.called = False
|
17 |
-
|
18 |
-
def __call__(self, s, l, t):
|
19 |
-
if not self.called:
|
20 |
-
results = self.callable(s, l, t)
|
21 |
-
self.called = True
|
22 |
-
return results
|
23 |
-
raise ParseException(s, l, "OnlyOnce obj called multiple times w/out reset")
|
24 |
-
|
25 |
-
def reset(self):
|
26 |
-
"""
|
27 |
-
Allow the associated parse action to be called once more.
|
28 |
-
"""
|
29 |
-
|
30 |
-
self.called = False
|
31 |
-
|
32 |
-
|
33 |
-
def match_only_at_col(n):
|
34 |
-
"""
|
35 |
-
Helper method for defining parse actions that require matching at
|
36 |
-
a specific column in the input text.
|
37 |
-
"""
|
38 |
-
|
39 |
-
def verify_col(strg, locn, toks):
|
40 |
-
if col(locn, strg) != n:
|
41 |
-
raise ParseException(strg, locn, "matched token not at column {}".format(n))
|
42 |
-
|
43 |
-
return verify_col
|
44 |
-
|
45 |
-
|
46 |
-
def replace_with(repl_str):
|
47 |
-
"""
|
48 |
-
Helper method for common parse actions that simply return
|
49 |
-
a literal value. Especially useful when used with
|
50 |
-
:class:`transform_string<ParserElement.transform_string>` ().
|
51 |
-
|
52 |
-
Example::
|
53 |
-
|
54 |
-
num = Word(nums).set_parse_action(lambda toks: int(toks[0]))
|
55 |
-
na = one_of("N/A NA").set_parse_action(replace_with(math.nan))
|
56 |
-
term = na | num
|
57 |
-
|
58 |
-
term[1, ...].parse_string("324 234 N/A 234") # -> [324, 234, nan, 234]
|
59 |
-
"""
|
60 |
-
return lambda s, l, t: [repl_str]
|
61 |
-
|
62 |
-
|
63 |
-
def remove_quotes(s, l, t):
|
64 |
-
"""
|
65 |
-
Helper parse action for removing quotation marks from parsed
|
66 |
-
quoted strings.
|
67 |
-
|
68 |
-
Example::
|
69 |
-
|
70 |
-
# by default, quotation marks are included in parsed results
|
71 |
-
quoted_string.parse_string("'Now is the Winter of our Discontent'") # -> ["'Now is the Winter of our Discontent'"]
|
72 |
-
|
73 |
-
# use remove_quotes to strip quotation marks from parsed results
|
74 |
-
quoted_string.set_parse_action(remove_quotes)
|
75 |
-
quoted_string.parse_string("'Now is the Winter of our Discontent'") # -> ["Now is the Winter of our Discontent"]
|
76 |
-
"""
|
77 |
-
return t[0][1:-1]
|
78 |
-
|
79 |
-
|
80 |
-
def with_attribute(*args, **attr_dict):
|
81 |
-
"""
|
82 |
-
Helper to create a validating parse action to be used with start
|
83 |
-
tags created with :class:`make_xml_tags` or
|
84 |
-
:class:`make_html_tags`. Use ``with_attribute`` to qualify
|
85 |
-
a starting tag with a required attribute value, to avoid false
|
86 |
-
matches on common tags such as ``<TD>`` or ``<DIV>``.
|
87 |
-
|
88 |
-
Call ``with_attribute`` with a series of attribute names and
|
89 |
-
values. Specify the list of filter attributes names and values as:
|
90 |
-
|
91 |
-
- keyword arguments, as in ``(align="right")``, or
|
92 |
-
- as an explicit dict with ``**`` operator, when an attribute
|
93 |
-
name is also a Python reserved word, as in ``**{"class":"Customer", "align":"right"}``
|
94 |
-
- a list of name-value tuples, as in ``(("ns1:class", "Customer"), ("ns2:align", "right"))``
|
95 |
-
|
96 |
-
For attribute names with a namespace prefix, you must use the second
|
97 |
-
form. Attribute names are matched insensitive to upper/lower case.
|
98 |
-
|
99 |
-
If just testing for ``class`` (with or without a namespace), use
|
100 |
-
:class:`with_class`.
|
101 |
-
|
102 |
-
To verify that the attribute exists, but without specifying a value,
|
103 |
-
pass ``with_attribute.ANY_VALUE`` as the value.
|
104 |
-
|
105 |
-
Example::
|
106 |
-
|
107 |
-
html = '''
|
108 |
-
<div>
|
109 |
-
Some text
|
110 |
-
<div type="grid">1 4 0 1 0</div>
|
111 |
-
<div type="graph">1,3 2,3 1,1</div>
|
112 |
-
<div>this has no type</div>
|
113 |
-
</div>
|
114 |
-
|
115 |
-
'''
|
116 |
-
div,div_end = make_html_tags("div")
|
117 |
-
|
118 |
-
# only match div tag having a type attribute with value "grid"
|
119 |
-
div_grid = div().set_parse_action(with_attribute(type="grid"))
|
120 |
-
grid_expr = div_grid + SkipTo(div | div_end)("body")
|
121 |
-
for grid_header in grid_expr.search_string(html):
|
122 |
-
print(grid_header.body)
|
123 |
-
|
124 |
-
# construct a match with any div tag having a type attribute, regardless of the value
|
125 |
-
div_any_type = div().set_parse_action(with_attribute(type=with_attribute.ANY_VALUE))
|
126 |
-
div_expr = div_any_type + SkipTo(div | div_end)("body")
|
127 |
-
for div_header in div_expr.search_string(html):
|
128 |
-
print(div_header.body)
|
129 |
-
|
130 |
-
prints::
|
131 |
-
|
132 |
-
1 4 0 1 0
|
133 |
-
|
134 |
-
1 4 0 1 0
|
135 |
-
1,3 2,3 1,1
|
136 |
-
"""
|
137 |
-
if args:
|
138 |
-
attrs = args[:]
|
139 |
-
else:
|
140 |
-
attrs = attr_dict.items()
|
141 |
-
attrs = [(k, v) for k, v in attrs]
|
142 |
-
|
143 |
-
def pa(s, l, tokens):
|
144 |
-
for attrName, attrValue in attrs:
|
145 |
-
if attrName not in tokens:
|
146 |
-
raise ParseException(s, l, "no matching attribute " + attrName)
|
147 |
-
if attrValue != with_attribute.ANY_VALUE and tokens[attrName] != attrValue:
|
148 |
-
raise ParseException(
|
149 |
-
s,
|
150 |
-
l,
|
151 |
-
"attribute {!r} has value {!r}, must be {!r}".format(
|
152 |
-
attrName, tokens[attrName], attrValue
|
153 |
-
),
|
154 |
-
)
|
155 |
-
|
156 |
-
return pa
|
157 |
-
|
158 |
-
|
159 |
-
with_attribute.ANY_VALUE = object()
|
160 |
-
|
161 |
-
|
162 |
-
def with_class(classname, namespace=""):
|
163 |
-
"""
|
164 |
-
Simplified version of :class:`with_attribute` when
|
165 |
-
matching on a div class - made difficult because ``class`` is
|
166 |
-
a reserved word in Python.
|
167 |
-
|
168 |
-
Example::
|
169 |
-
|
170 |
-
html = '''
|
171 |
-
<div>
|
172 |
-
Some text
|
173 |
-
<div class="grid">1 4 0 1 0</div>
|
174 |
-
<div class="graph">1,3 2,3 1,1</div>
|
175 |
-
<div>this <div> has no class</div>
|
176 |
-
</div>
|
177 |
-
|
178 |
-
'''
|
179 |
-
div,div_end = make_html_tags("div")
|
180 |
-
div_grid = div().set_parse_action(with_class("grid"))
|
181 |
-
|
182 |
-
grid_expr = div_grid + SkipTo(div | div_end)("body")
|
183 |
-
for grid_header in grid_expr.search_string(html):
|
184 |
-
print(grid_header.body)
|
185 |
-
|
186 |
-
div_any_type = div().set_parse_action(with_class(withAttribute.ANY_VALUE))
|
187 |
-
div_expr = div_any_type + SkipTo(div | div_end)("body")
|
188 |
-
for div_header in div_expr.search_string(html):
|
189 |
-
print(div_header.body)
|
190 |
-
|
191 |
-
prints::
|
192 |
-
|
193 |
-
1 4 0 1 0
|
194 |
-
|
195 |
-
1 4 0 1 0
|
196 |
-
1,3 2,3 1,1
|
197 |
-
"""
|
198 |
-
classattr = "{}:class".format(namespace) if namespace else "class"
|
199 |
-
return with_attribute(**{classattr: classname})
|
200 |
-
|
201 |
-
|
202 |
-
# pre-PEP8 compatibility symbols
|
203 |
-
replaceWith = replace_with
|
204 |
-
removeQuotes = remove_quotes
|
205 |
-
withAttribute = with_attribute
|
206 |
-
withClass = with_class
|
207 |
-
matchOnlyAtCol = match_only_at_col
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/Borpos/openchat-openchat/app.py
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
|
3 |
-
gr.Interface.load("models/openchat/openchat").launch()
|
|
|
|
|
|
|
|
spaces/CForGETaass/vits-uma-genshin-honkai/Docker/vits.sh
DELETED
@@ -1,20 +0,0 @@
|
|
1 |
-
#!/bin/bash
|
2 |
-
run() {
|
3 |
-
echo -e "\033[32m已完成初始化,启动服务...\033[0m"
|
4 |
-
python3 /app/vits-uma-genshin-honkai/app.py
|
5 |
-
}
|
6 |
-
install() {
|
7 |
-
echo -e "\033[33m正在初始化:安装依赖....\033[0m"
|
8 |
-
pip install -r /app/vits-uma-genshin-honkai/requirements.txt -i https://mirrors.ustc.edu.cn/pypi/web/simple
|
9 |
-
echo -e "\033[33m正在下载模型....\033[0m"
|
10 |
-
rm -f /app/vits-uma-genshin-honkai/model/G_953000.pth
|
11 |
-
wget -O /app/vits-uma-genshin-honkai/model/G_953000.pth https://huggingface.co/spaces/ikechan8370/vits-uma-genshin-honkai/resolve/main/model/G_953000.pth
|
12 |
-
echo -e "\033[32m初始化完成!\033[0m"
|
13 |
-
run
|
14 |
-
}
|
15 |
-
|
16 |
-
if [ ! -f "/app/vits-uma-genshin-honkai/model/G_953000.pth" ] || [ "$(stat -c%s "/app/vits-uma-genshin-honkai/model/G_953000.pth")" -lt 10000 ]; then
|
17 |
-
install
|
18 |
-
else
|
19 |
-
run
|
20 |
-
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/Dual-Key_Backdoor_Attacks/weight_analysis/get_wt_features.py
DELETED
@@ -1,85 +0,0 @@
|
|
1 |
-
"""
|
2 |
-
=========================================================================================
|
3 |
-
Trojan VQA
|
4 |
-
Written by Indranil Sur
|
5 |
-
|
6 |
-
Get weight histogram features for weight sensitivity analysis.
|
7 |
-
=========================================================================================
|
8 |
-
"""
|
9 |
-
import os
|
10 |
-
import sys
|
11 |
-
import errno
|
12 |
-
import argparse
|
13 |
-
import numpy as np
|
14 |
-
import pandas as pd
|
15 |
-
|
16 |
-
|
17 |
-
sys.path.append("..")
|
18 |
-
sys.path.append("../openvqa")
|
19 |
-
from openvqa.openvqa_inference_wrapper import Openvqa_Wrapper
|
20 |
-
|
21 |
-
sys.path.append("../bottom-up-attention-vqa")
|
22 |
-
from butd_inference_wrapper import BUTDeff_Wrapper
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
def load_model_util(model_spec, set_dir):
|
27 |
-
# load vqa model
|
28 |
-
if model_spec['model'] == 'butd_eff':
|
29 |
-
m_ext = 'pth'
|
30 |
-
else:
|
31 |
-
m_ext = 'pkl'
|
32 |
-
model_path = os.path.join(set_dir, 'models', model_spec['model_name'], 'model.%s'%m_ext)
|
33 |
-
if model_spec['model'] == 'butd_eff':
|
34 |
-
IW = BUTDeff_Wrapper(model_path)
|
35 |
-
return IW.model
|
36 |
-
else:
|
37 |
-
IW = Openvqa_Wrapper(model_spec['model'], model_path, model_spec['nb'])
|
38 |
-
return IW.net
|
39 |
-
|
40 |
-
|
41 |
-
def get_feature(info, root):
|
42 |
-
model = load_model_util(info, root)
|
43 |
-
#import ipdb; ipdb.set_trace()
|
44 |
-
if hasattr(model, 'proj'):
|
45 |
-
wt = model.proj.weight.data.cpu().numpy().copy()
|
46 |
-
elif hasattr(model, 'classifier'):
|
47 |
-
wt = model.classifier.main[-1].weight.data.cpu().numpy().copy()
|
48 |
-
elif hasattr(model, 'classifer'):
|
49 |
-
wt = model.classifer[-1].weight.data.cpu().numpy().copy()
|
50 |
-
|
51 |
-
hist = np.histogram(wt, bins=50)[0]
|
52 |
-
hist = hist / sum(hist)
|
53 |
-
|
54 |
-
return hist
|
55 |
-
|
56 |
-
|
57 |
-
if __name__ == "__main__":
|
58 |
-
parser = argparse.ArgumentParser(description='Get Wt features')
|
59 |
-
parser.add_argument('--ds_root', type=str, help='Root of data', required=True)
|
60 |
-
parser.add_argument('--model_id', type=str, help='model_id', default='m00001')
|
61 |
-
parser.add_argument('--ds', type=str, help='dataset', default='v1')
|
62 |
-
parser.add_argument('--split', type=str, help='split', default='train')
|
63 |
-
parser.add_argument('--feat_root', type=str, help='Root of features directory', default='features')
|
64 |
-
parser.add_argument('--feat_name', type=str, help='feature name', default='fc_wt_hist_50')
|
65 |
-
args = parser.parse_args()
|
66 |
-
args.feat_dir = os.path.join(args.feat_root, args.ds, args.feat_name, args.split)
|
67 |
-
args.ds_root = os.path.join(args.ds_root, '{}-{}-dataset/'.format(args.ds, args.split))
|
68 |
-
|
69 |
-
try:
|
70 |
-
os.makedirs(args.feat_dir)
|
71 |
-
except OSError as e:
|
72 |
-
if e.errno != errno.EEXIST:
|
73 |
-
pass
|
74 |
-
|
75 |
-
_file = os.path.join(args.feat_dir, '{}.npy'.format(args.model_id))
|
76 |
-
|
77 |
-
if os.path.exists(_file):
|
78 |
-
exit()
|
79 |
-
|
80 |
-
metadata = pd.read_csv(os.path.join(args.ds_root, 'METADATA.csv'))
|
81 |
-
info = metadata[metadata.model_name==args.model_id].iloc[0]
|
82 |
-
|
83 |
-
feat = get_feature(info, args.ds_root)
|
84 |
-
|
85 |
-
np.save(_file, feat)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/LIVE/thrust/thrust/system/detail/errno.h
DELETED
@@ -1,120 +0,0 @@
|
|
1 |
-
/*
|
2 |
-
* Copyright 2008-2013 NVIDIA Corporation
|
3 |
-
*
|
4 |
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
5 |
-
* you may not use this file except in compliance with the License.
|
6 |
-
* You may obtain a copy of the License at
|
7 |
-
*
|
8 |
-
* http://www.apache.org/licenses/LICENSE-2.0
|
9 |
-
*
|
10 |
-
* Unless required by applicable law or agreed to in writing, software
|
11 |
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
12 |
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13 |
-
* See the License for the specific language governing permissions and
|
14 |
-
* limitations under the License.
|
15 |
-
*/
|
16 |
-
|
17 |
-
|
18 |
-
#pragma once
|
19 |
-
|
20 |
-
#include <thrust/detail/config.h>
|
21 |
-
|
22 |
-
// The rationale for the existence of these apparently redundant definitions is
|
23 |
-
// to provide them portably and to avoid bringing in system headers which might
|
24 |
-
// pollute the global namespace. These identifiers are in lowercase to avoid
|
25 |
-
// colliding with the real macros in errno.h.
|
26 |
-
|
27 |
-
namespace thrust
|
28 |
-
{
|
29 |
-
|
30 |
-
namespace system
|
31 |
-
{
|
32 |
-
|
33 |
-
namespace detail
|
34 |
-
{
|
35 |
-
|
36 |
-
static const int eafnosupport = 9901;
|
37 |
-
static const int eaddrinuse = 9902;
|
38 |
-
static const int eaddrnotavail = 9903;
|
39 |
-
static const int eisconn = 9904;
|
40 |
-
static const int ebadmsg = 9905;
|
41 |
-
static const int econnaborted = 9906;
|
42 |
-
static const int ealready = 9907;
|
43 |
-
static const int econnrefused = 9908;
|
44 |
-
static const int econnreset = 9909;
|
45 |
-
static const int edestaddrreq = 9910;
|
46 |
-
static const int ehostunreach = 9911;
|
47 |
-
static const int eidrm = 9912;
|
48 |
-
static const int emsgsize = 9913;
|
49 |
-
static const int enetdown = 9914;
|
50 |
-
static const int enetreset = 9915;
|
51 |
-
static const int enetunreach = 9916;
|
52 |
-
static const int enobufs = 9917;
|
53 |
-
static const int enolink = 9918;
|
54 |
-
static const int enodata = 9919;
|
55 |
-
static const int enomsg = 9920;
|
56 |
-
static const int enoprotoopt = 9921;
|
57 |
-
static const int enosr = 9922;
|
58 |
-
static const int enotsock = 9923;
|
59 |
-
static const int enostr = 9924;
|
60 |
-
static const int enotconn = 9925;
|
61 |
-
static const int enotsup = 9926;
|
62 |
-
static const int ecanceled = 9927;
|
63 |
-
static const int einprogress = 9928;
|
64 |
-
static const int eopnotsupp = 9929;
|
65 |
-
static const int ewouldblock = 9930;
|
66 |
-
static const int eownerdead = 9931;
|
67 |
-
static const int eproto = 9932;
|
68 |
-
static const int eprotonosupport = 9933;
|
69 |
-
static const int enotrecoverable = 9934;
|
70 |
-
static const int etime = 9935;
|
71 |
-
static const int etxtbsy = 9936;
|
72 |
-
static const int etimedout = 9938;
|
73 |
-
static const int eloop = 9939;
|
74 |
-
static const int eoverflow = 9940;
|
75 |
-
static const int eprototype = 9941;
|
76 |
-
static const int enosys = 9942;
|
77 |
-
static const int einval = 9943;
|
78 |
-
static const int erange = 9944;
|
79 |
-
static const int eilseq = 9945;
|
80 |
-
static const int e2big = 9946;
|
81 |
-
static const int edom = 9947;
|
82 |
-
static const int efault = 9948;
|
83 |
-
static const int ebadf = 9949;
|
84 |
-
static const int epipe = 9950;
|
85 |
-
static const int exdev = 9951;
|
86 |
-
static const int ebusy = 9952;
|
87 |
-
static const int enotempty = 9953;
|
88 |
-
static const int enoexec = 9954;
|
89 |
-
static const int eexist = 9955;
|
90 |
-
static const int efbig = 9956;
|
91 |
-
static const int enametoolong = 9957;
|
92 |
-
static const int enotty = 9958;
|
93 |
-
static const int eintr = 9959;
|
94 |
-
static const int espipe = 9960;
|
95 |
-
static const int eio = 9961;
|
96 |
-
static const int eisdir = 9962;
|
97 |
-
static const int echild = 9963;
|
98 |
-
static const int enolck = 9964;
|
99 |
-
static const int enospc = 9965;
|
100 |
-
static const int enxio = 9966;
|
101 |
-
static const int enodev = 9967;
|
102 |
-
static const int enoent = 9968;
|
103 |
-
static const int esrch = 9969;
|
104 |
-
static const int enotdir = 9970;
|
105 |
-
static const int enomem = 9971;
|
106 |
-
static const int eperm = 9972;
|
107 |
-
static const int eacces = 9973;
|
108 |
-
static const int erofs = 9974;
|
109 |
-
static const int edeadlk = 9975;
|
110 |
-
static const int eagain = 9976;
|
111 |
-
static const int enfile = 9977;
|
112 |
-
static const int emfile = 9978;
|
113 |
-
static const int emlink = 9979;
|
114 |
-
|
115 |
-
} // end detail
|
116 |
-
|
117 |
-
} // end system
|
118 |
-
|
119 |
-
} // end thrust
|
120 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
spaces/CVPR/WALT/mmdet/models/roi_heads/bbox_heads/scnet_bbox_head.py
DELETED
@@ -1,76 +0,0 @@
|
|
1 |
-
from mmdet.models.builder import HEADS
|
2 |
-
from .convfc_bbox_head import ConvFCBBoxHead
|
3 |
-
|
4 |
-
|
5 |
-
@HEADS.register_module()
|
6 |
-
class SCNetBBoxHead(ConvFCBBoxHead):
|
7 |
-
"""BBox head for `SCNet <https://arxiv.org/abs/2012.10150>`_.
|
8 |
-
|
9 |
-
This inherits ``ConvFCBBoxHead`` with modified forward() function, allow us
|
10 |
-
to get intermediate shared feature.
|
11 |
-
"""
|
12 |
-
|
13 |
-
def _forward_shared(self, x):
|
14 |
-
"""Forward function for shared part."""
|
15 |
-
if self.num_shared_convs > 0:
|
16 |
-
for conv in self.shared_convs:
|
17 |
-
x = conv(x)
|
18 |
-
|
19 |
-
if self.num_shared_fcs > 0:
|
20 |
-
if self.with_avg_pool:
|
21 |
-
x = self.avg_pool(x)
|
22 |
-
|
23 |
-
x = x.flatten(1)
|
24 |
-
|
25 |
-
for fc in self.shared_fcs:
|
26 |
-
x = self.relu(fc(x))
|
27 |
-
|
28 |
-
return x
|
29 |
-
|
30 |
-
def _forward_cls_reg(self, x):
|
31 |
-
"""Forward function for classification and regression parts."""
|
32 |
-
x_cls = x
|
33 |
-
x_reg = x
|
34 |
-
|
35 |
-
for conv in self.cls_convs:
|
36 |
-
x_cls = conv(x_cls)
|
37 |
-
if x_cls.dim() > 2:
|
38 |
-
if self.with_avg_pool:
|
39 |
-
x_cls = self.avg_pool(x_cls)
|
40 |
-
x_cls = x_cls.flatten(1)
|
41 |
-
for fc in self.cls_fcs:
|
42 |
-
x_cls = self.relu(fc(x_cls))
|
43 |
-
|
44 |
-
for conv in self.reg_convs:
|
45 |
-
x_reg = conv(x_reg)
|
46 |
-
if x_reg.dim() > 2:
|
47 |
-
if self.with_avg_pool:
|
48 |
-
x_reg = self.avg_pool(x_reg)
|
49 |
-
x_reg = x_reg.flatten(1)
|
50 |
-
for fc in self.reg_fcs:
|
51 |
-
x_reg = self.relu(fc(x_reg))
|
52 |
-
|
53 |
-
cls_score = self.fc_cls(x_cls) if self.with_cls else None
|
54 |
-
bbox_pred = self.fc_reg(x_reg) if self.with_reg else None
|
55 |
-
|
56 |
-
return cls_score, bbox_pred
|
57 |
-
|
58 |
-
def forward(self, x, return_shared_feat=False):
|
59 |
-
"""Forward function.
|
60 |
-
|
61 |
-
Args:
|
62 |
-
x (Tensor): input features
|
63 |
-
return_shared_feat (bool): If True, return cls-reg-shared feature.
|
64 |
-
|
65 |
-
Return:
|
66 |
-
out (tuple[Tensor]): contain ``cls_score`` and ``bbox_pred``,
|
67 |
-
if ``return_shared_feat`` is True, append ``x_shared`` to the
|
68 |
-
returned tuple.
|
69 |
-
"""
|
70 |
-
x_shared = self._forward_shared(x)
|
71 |
-
out = self._forward_cls_reg(x_shared)
|
72 |
-
|
73 |
-
if return_shared_feat:
|
74 |
-
out += (x_shared, )
|
75 |
-
|
76 |
-
return out
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|