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 dataclasses import dataclass | |
import yt_dlp | |
import librosa | |
import xml.etree.ElementTree as ET | |
import asyncio | |
from typing import List, Optional, Dict, Any | |
import httpx | |
import logging | |
import subprocess | |
import os |
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
分析以下幾篇文章內容,以分析員角度分析,歸納成一份學術性文章。 | |
- 畀出主題、主體同概念 | |
- 必須用廣東話書寫 | |
- 為主體人物或概念提供簡介 | |
- 為主題作總結 | |
文章內容: | |
# 香港電影業新聞與動態 |
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 queue | |
import time | |
import threading | |
from transformers.generation.logits_process import ( | |
TopPLogitsWarper, | |
RepetitionPenaltyLogitsProcessor, | |
) | |
@torch.inference_mode() | |
def inference_v2( |
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
version: "3.9" | |
services: | |
app: | |
image: heartexlabs/label-studio:latest | |
restart: unless-stopped | |
depends_on: | |
- db | |
expose: | |
- "8080" | |
environment: |
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
$ conda activate ml | |
(ml) $ conda install ipykernel | |
(ml) $ ipython kernel install --user --name=<any_name_for_kernel> | |
(ml) $ conda deactivate |
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 torchaudio | |
def eval(audio, text): | |
# convert audio to 16000 sample rate | |
audio = torchaudio.transforms.Resample(orig_freq=44100, new_freq=16000)(torch.tensor(audio).unsqueeze(0)).squeeze() | |
# process text | |
tokenized_seq = torch.tensor([processor.tokenizer(text, add_special_tokens=True).input_ids]).to(device) | |
decoder_input_ids = tokenized_seq[:, 1:] | |
decoder_input_ids_right_shifted = tokenized_seq[:, :-1] | |
# process audio |
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
word | jyutping | |
---|---|---|
一剎那 | no4 | |
七竅 | hiu3 | |
七鰓鰻 | soi1 | |
丈母娘 | noeng4 | |
乓 | bam1 | |
九層塔 | taap3 | |
乞兒 | haat1 | |
乾坤 | kin4 | |
乾闥婆 | taat3 |
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
const resampling = (audioBuffer: AudioBuffer, targetSampleRate: number): Promise<AudioBuffer> => { | |
const offlineAudioContext = new OfflineAudioContext(1, audioBuffer.length, targetSampleRate); | |
const source = offlineAudioContext.createBufferSource(); | |
source.buffer = audioBuffer; | |
source.connect(offlineAudioContext.destination); | |
source.start(); | |
return offlineAudioContext.startRendering(); |
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
You are asked to come up with a set of 20 diverse and detailed roleplay scenarios. These scenarios will be given to a large language model and we will evaluate the large language model for completing the roleplay effectively. | |
Here are the requirements: | |
1. Ensure the roles and scenarios are diverse, covering different contexts, professions, and situations. | |
2. The language used for the scenarios should also be diverse. For example, include both formal and informal dialogues. | |
3. The type of scenarios should be diverse. Include diverse types of interactions like customer service, medical consultations, casual conversations, educational settings, etc. | |
4. A large language model should be able to complete the roleplay. For example, do not include scenarios that require real-time actions or physical interactions. | |
5. The scenarios and dialogues should be in **Cantonese**. | |
6. Each scenario should be detailed, providing a clear context and background. Include relevant information such as the setting, characters involv |
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
adb -e shell date $(date +%m%d%H%M%Y.%S) |
NewerOlder