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 langchain import OpenAI, LLMChain, PromptTemplate | |
| from langchain.memory import ConversationBufferMemory | |
| advisor_list = [ | |
| { | |
| "color": "White", | |
| "name": "荀彧", | |
| "personality": "You focus on facts and data. You approach problems objectively, ignoring personal biases.", | |
| "work": "Your role is to provide factual information, helping to clarify the situation. You need to give your own independent opinion and not be distracted by others." | |
| }, | |
| { |
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
| def query_prompt(query): | |
| ask = f""" | |
| You are a professional logic researcher. | |
| I will give you a QUESTION that you need to generate a query statement in google scholar based on this question. | |
| Here is an example of a google scholar query statement: | |
| orthokeratology retina child OR children "myopia control" -atropine | |
| It means: | |
| Contains all words: orthokeratology retina |
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 langchain.agents import load_tools, initialize_agent, AgentType | |
| from langchain.chat_models import ChatOpenAI | |
| from functools import wraps | |
| # 设置全局资源量 | |
| autogpt_resources = 50 | |
| # 资源限制器修饰器 | |
| def resource_limiter(resource_cost): | |
| global autogpt_resources |
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
| def time_threshold(): | |
| t = 60 | |
| tmin=5 | |
| tmax=120 | |
| while True: | |
| value = yield t | |
| if value: | |
| t = max(t/2,tmin) | |
| else: | |
| t = min(t+10,tmax) |
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
| 1 | |
| 00:00:01.600 --> 00:00:05.640 | |
| 今天艾米丽将向你展示她huff咳嗽的技巧 | |
| 2 | |
| 00:00:06.080 --> 00:00:09.320 | |
| huff咳嗽是清除肺部粘液的一种方法 | |
| 3 |
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 sympy import * | |
| a,b, x = symbols('b a x') # here, swap a and b, bug | |
| f = a*x**2 + b*x | |
| sub_dict={a:1,b:2,x:3} | |
| print(f) | |
| print(f.subs(sub_dict)) | |
| print(eval(f.__str__()).subs(sub_dict)) | |
| # output: |
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
| TargetInvocationException: 调用的目标发生了异常。 | |
| 在 System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) | |
| 在 System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark) | |
| 在 System.Activator.CreateInstance(Type type, Boolean nonPublic) | |
| 在 System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark) | |
| 在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes) | |
| 在 System.Activator.CreateInstance(Type type, Object[] args, Object[] activationAttributes) | |
| 在 ZOSAPI.ZOSAPI_Connection.CreateApp(ZOSAPI_Connection connection, Int32 processId, Boolean wrap, Object[] args) | |
| 在 ZOSAPI.ZOSAPI_Connection.ConnectToAppByProcess(Int32 processId, Boolean wra |
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
| // | |
| // main.cpp | |
| // crop_video | |
| // | |
| // Created by GoldenGrape on 2020/6/6. | |
| // Copyright © 2020 goldengrape. All rights reserved. | |
| // | |
| #include <iostream> | |
| #include <algorithm> |
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
| #!/usr/bin/env python | |
| # coding: utf-8 | |
| import pysubs2 | |
| import re | |
| from stardict import DictCsv | |
| # depend on https://github.com/skywind3000/ECDICT/ | |
| dict_filename="ecdict.csv" | |
| sub_filename="01sub.srt" |
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
| ##| 经典house节奏 | |
| ##| 根据learningmusic.ableton.com课程 | |
| ##| https://learningmusic.ableton.com/zh/make-beats/make-beats.html | |
| use_random_seed 10 | |
| open_hat_beat= | |
| [0,0,1,0, | |
| 0,0,0,0, | |
| 0,0,0,0, | |
| 0,0,0,0].ring |