gradio

Форк
0
/
requirements.ts 
18 строк · 536.0 Байт
1
export function verifyRequirements(requirements: string[]): void {
2
	requirements.forEach((req) => {
3
		let url: URL;
4
		try {
5
			url = new URL(req);
6
		} catch {
7
			// `req` is not a URL -> OK
8
			return;
9
		}
10

11
		// Ref: The scheme checker in the micropip implementation is https://github.com/pyodide/micropip/blob/v0.1.0/micropip/_compat_in_pyodide.py#L23-L26
12
		if (url.protocol === "emfs:" || url.protocol === "file:") {
13
			throw new Error(
14
				`"emfs:" and "file:" protocols are not allowed for the requirement (${req})`
15
			);
16
		}
17
	});
18
}
19

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.