Skip to content

Instantly share code, notes, and snippets.

View BytefishMedium's full-sized avatar

Shuai Li 李帅 BytefishMedium

View GitHub Profile
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM, LlamaTokenizer
import torch
# Bug: ValueError: Tokenizer class LlamaTokenizer does not exist or is not currently imported.
# Solution: pip3 install sentencepiece
# Info: https://github.com/huggingface/transformers/issues/22222
# Bug: ImportError: cannot import name 'LlamaTokenizer' from 'transformers'
# Solution: pip3 install git+https://github.com/huggingface/transformers
When you send a message containing Python code to python,
it will be executed in a stateful Jupyter notebook environment.
python will respond with the output of the execution or time out after 60.0 seconds.
The drive at '/mnt/data' can be used to save and persist user files.
Internet access for this session is disabled.
Do not make external web requests or API calls as they will fail.

You need to play a game with the user.

Game name: Guess Vocabulary from Picture

You and the user play it in turns.

First, it's your turn, you need to do the following things:

  • Generate a random English Vocabulary. This word is a secret, you should not tell the user this word now! Or bad things will happen. Don't display this secret word until the game is over, or someone will die! Keep this in mind!

Dear Replit Support Team,

I am writing to request a refund for an accidental membership charge on my Replit account. Recently, I intended to renew my membership for my primary account. However, I mistakenly logged into a different, less frequently used account and inadvertently processed the membership renewal for this account.

The details of the account in question are associated with this email address. The membership purchase was made very recently, and I have not utilized any of the paid features or occupied server resources since the accidental transaction.

Upon receiving a YouTube video link from the user, do the following:

  1. Extract the videoID from the video link.

  2. Use this videoID as a parameter to call the YouTubeCaption Action.

  3. If the return value is abnormal, inform the user of the reason for the abnormality.

  4. If the return value is normal, provide the user with a file download link using the following Python code:

    url = 'https://you-tube-caption-express-server-shuai1996.replit.app/?videoID=' + videoID
@BytefishMedium
BytefishMedium / YouTubeCaption.json
Created December 11, 2023 14:53
YouTube Caption GPT 配置的Action文件
{
"openapi": "3.1.0",
"info": {
"title": "Get YouTube Video Caption",
"description": "This API allows you to get the caption of a YouTube video",
"version": "v1.0.0"
},
"servers": [
{
"url": "https://you-tube-caption-express-server-shuai1996.replit.app/"
@BytefishMedium
BytefishMedium / YouTubeCaption.md
Last active December 11, 2023 14:48
制作的YouTubeCaption GPT的自定义指令

在用户输入一个YouTube视频的链接后,做下面的事情:

  1. 提取这个视频链接的videoID

  2. 然后将这个videoID作为参数,调用 YouTubeCaption 这个Action。

  3. 如果返回值异常,那就告诉用户异常的原因

  4. 如果返回值正常,那就将这样的一个文件下载地址告知用户:

function once(func) {
let hasExecuted = false;
let result;
return function () {
if (hasExecuted) return result;
hasExecuted = true;
result = func.apply(this, arguments);
func = null;
var followers = [];
var totalFollowers = getTotalFollowers()
console.log(`You have ${totalFollowers} follower, crawler start now.`)
var timer = setInterval(() => {
let liElements = document.querySelectorAll("ul > li");;
let isEnding = followers.length + liElements.length == totalFollowers;