This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
conda env list --json | python -c "import json,sys,subprocess as sp; from pathlib import Path; envs=json.load(sys.stdin)['envs']; [print(e, 'HAS cv2+mediapipe' if sp.run([str(Path(e, 'python.exe')), '-c', 'import cv2, mediapipe'], stdout=sp.DEVNULL, stderr=sp.DEVNULL).returncode==0 else 'DOES NOT') for e in envs]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
This script demonstrates how to load a quantized Flux.1-dev model (4-bit, NF4) | |
using bitsandbytes with Diffusers and then apply a LoRA adapter. | |
It loads: | |
(a) the T5EncoderModel from the "text_encoder_2" subfolder in 4-bit mode, and | |
(b) the FluxTransformer2DModel from the "transformer" subfolder in 4-bit mode. | |
Then it instantiates a FluxPipeline with device_map="balanced" and applies LoRA. | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
from datasets import load_dataset, Dataset | |
# Load and prep dataset | |
SYSTEM_PROMPT = """ | |
Respond in the following format: | |
<reasoning> | |
... | |
</reasoning> | |
<answer> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){function r(){return Math.floor(300*Math.random()+300)}function l(c){if("undefined"==typeof jQuery){var e=document.createElement("script");e.src="https://code.jquery.com/jquery-3.6.0.min.js";e.onload=function(){n("%E2%9C%85%20jQuery%20loaded");c&&c()};document.head.appendChild(e)}else{n("%E2%9C%85%20jQuery%20present");c&&c()}}function u(){if(!document.getElementById("s-status")){var e=document.createElement("div");e.id="s-status";e.style.cssText="position:fixed;bottom:10px;right:10px;padding:10px;background:#000;color:#fff;font-size:14px;border-radius:5px;opacity:.9;z-index:9999;max-width:300px";e.innerHTML='<strong>Shun%20Status:</strong><div%20id="s-log"></div>';document.body.appendChild(e)}}function n(e){u();var c=document.getElementById("s-log");c&&(c.innerHTML+=e+"<br>",clearTimeout(window.sTimeout),window.sTimeout=setTimeout(function(){c.innerHTML=""},1e4))}function t(){var e=$('[data-testid^="feedItem-by-"]');e.length?(e.each(function(){$(this).find(".s-btn").length||$(this).appen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.IO; | |
using static System.Net.Mime.MediaTypeNames; | |
using System.Diagnostics; | |
/// <summary> | |
/// Loads and plays a GIF, assigning each frame to the material’s '_DepthTex' texture. | |
/// </summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Phase 1: Data Preprocessing & Label Refinement | |
#1. Scraping Audio from YouTube | |
from yt_dlp import YoutubeDL | |
# Download audio from YouTube | |
def download_audio(url, output_dir="audio"): | |
ydl_opts = { | |
'format': 'bestaudio/best', | |
'postprocessors': [{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Collections.Generic; | |
using UnityEngine; | |
public static class StripUtility | |
{ | |
// 1) Remove specified vertices | |
// 2) Re-sort remaining verts by angle around the centroid | |
// Ensures a consistent winding for a triangle strip after removal | |
public static void RemoveAndReorder(ref List<Vector3> verts, List<int> indicesToRemove) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class CircleOverlapExample : MonoBehaviour | |
{ | |
[System.Serializable] | |
public struct Circle | |
{ | |
public Vector2 center; | |
public float radius; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Feature-complete Telnet client with a curses-based text UI. | |
Adjusted to: | |
- Automatically try "pdp1173.com" on port 23 and log in as "guest". | |
- If that fails, try "davepl.dyndns.org" on port 23 with "guest". | |
- Repeat this connection attempt loop forever until ESC is pressed to quit. | |
- Once connected and logged in, display remote output and allow typing commands. | |
- Typing 'exit' closes the current session and resumes connection attempts. | |
- Pressing ESC at any point quits the program immediately. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In addition to a significant decrease in hepatic lipid accumulation in the IOE group, which inhibited energy intake by propionate enrichment, hepatic lipids were also significantly reduced in the mice in the IOP group, which was largely enriched with butyrate. Compared with the IOE group, IOP had a stronger regulatory effect on hepatic metabolism and triglyceride metabolism and higher levels of TCA cycle in the host. In addition, butyrate has the ability to promote browning of white adipose tissue (WAT) to brown adipose tissue (BAT).^[@ref39],[@ref40]^ WAT stores energy, whereas BAT uses energy for heating and consequently host energy expenditure increases.^[@ref41],[@ref42]^ However, adipose tissue weight does not change after WAT browning.^[@ref43]^ Therefore, the weight of adipose tissue of mice in the IOP group dominated by butyrate was greater than that of the mice in the IOE group dominated by propionate. | |
In conclusion ([Figure [7](#fig7){ref-type="fig"}](#fig7){ref-type="fig"}C), the improvement of ob |
NewerOlder