Skip to content

Instantly share code, notes, and snippets.

View cxfcxf's full-sized avatar

Xuefeng Chen cxfcxf

View GitHub Profile
@cxfcxf
cxfcxf / transcribe_ja_to_cn_reasoning.py
Last active February 18, 2025 02:35
use deepseek--r1:32b to do reasoning translate, the quality is super good, but the time it consumes is 10x more than the other one
#!/usr/bin/env python
import os
import re
import gc
import ollama
import argparse
from itertools import batched
from faster_whisper import WhisperModel
@cxfcxf
cxfcxf / transcribe_ja_to_cn.py
Last active February 18, 2025 02:35
use faster_whisper to transcribe and qwen2.5 32b to translate from japanese to chinese
#!/usr/bin/env python
import os
import re
import gc
import argparse
import ollama
import langdetect
from faster_whisper import WhisperModel
@cxfcxf
cxfcxf / gamble.py
Created April 25, 2020 17:30
穆总的筛子模拟器
import time
import random
random.seed(time.time())
class Pocket(object):
def __init__(self, balance):
self.balance = balance
self.win_count = 0
self.current_bet = 0
#!/usr/bin/env python
import sys
import PAM
from getpass import getpass
def pam_conv(auth, query_list):
resp = []
@cxfcxf
cxfcxf / linkedlist.py
Last active July 4, 2017 20:04
python's implantation of linked list
#!/usr/bin/env python
class Node:
def __init__(self, data):
self.data = data
self.next = None
class LinkedList:
def __init__(self):
self.head = None