git clone https://github.com/jim60105/docker-stable-diffusion-webui.git
cd docker-stable-diffusion-webui
docker compose up -d
This file contains hidden or 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 json | |
import os | |
from typing import Any, Dict, Optional | |
import requests | |
import streamlit as st | |
# Page configuration - removed "wide" layout to make it narrower | |
st.set_page_config(page_title="PDF to Markdown Converter", page_icon="📄") |
This file contains hidden or 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 torch | |
from diffusers import StableDiffusionPipeline, EulerDiscreteScheduler | |
model_id = "stabilityai/stable-diffusion-2" | |
# Use the Euler scheduler here instead | |
scheduler = EulerDiscreteScheduler.from_pretrained(model_id, subfolder="scheduler") | |
pipe = StableDiffusionPipeline.from_pretrained(model_id, scheduler=scheduler, torch_dtype=torch.float16) | |
pipe = pipe.to("cuda") |
This file contains hidden or 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
""" | |
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。 | |
原文链接:https://blog.csdn.net/James_Bond_slm/article/details/117432357 | |
采用的收发都是3根天线,每根天线都有30个子载波,一秒钟3000个包,所以最后csv的数据维度是3000 * (30 * 3 * 3)即3000 * 270的大小。 | |
""" | |
import numpy as np | |
import math |
This file contains hidden or 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 os | |
from pypdf import PdfReader | |
import re | |
from pathlib import Path | |
def get_pdf_title(pdf_path): | |
"""Get PDF title from metadata, fallback to content extraction if needed.""" | |
try: | |
with open(pdf_path, 'rb') as file: | |
pdf_reader = PdfReader(file) |
This file contains hidden or 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 requests | |
import os | |
from urllib.parse import urlparse | |
def convert_to_pdf_url(presentation_url): | |
# Remove any trailing parameters or /edit | |
base_url = presentation_url.split('/edit')[0].split('?')[0] | |
# Add /export/pdf to the end | |
return f"{base_url}/export/pdf" |
This file contains hidden or 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
# git clone https://github.com/salesforce/BLIP | |
# cd BLIP | |
# touch BLIP_img2caption.py | |
import os | |
import json | |
from PIL import Image | |
import torch | |
from torchvision import transforms | |
from torchvision.transforms.functional import InterpolationMode |
This file contains hidden or 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 pandas as pd | |
from twstock import Stock | |
import argparse | |
def parse(): | |
parser = argparse.ArgumentParser() | |
parser.add_argument( | |
"--etf_code", type=str, default="00733", | |
) |
This file contains hidden or 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
from backtesting import Backtest, Strategy | |
from backtesting.lib import crossover | |
from FinMind.data import DataLoader | |
import pandas as pd | |
import talib | |
from talib import abstract | |
## 取得資料 |
This file contains hidden or 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 whisper | |
import openai | |
import os | |
openai.api_key = "sk-XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" | |
# input audio file name | |
audio_file = r"C:\Users\User\Desktop\input.mp3" | |
# load the model and transcribe the audio |
NewerOlder