yucongo's recent timeline updates
yucongo

yucongo

V2EX member #225905, joined on 2017-04-13 18:04:32 +08:00
yucongo's recent replies
Apr 28, 2024
Replied to a topic by jqtmviyu Python 请教下 Python 上的包管理器和虚拟环境
rye + uv: 又快有好。其实 rye 本身已经实验性直接植入 uv 了
必须 zoho
Nov 25, 2023
Replied to a topic by event112 健康 老哥们,我这种作息正常吗?
六点睡不正常吧
Nov 25, 2023
Replied to a topic by shuiguomayi 程序员 优秀的 chrome 翻译插件推荐?
沉浸式翻译,可接 azure gpt3.5 (有企业电邮地址和信用卡就可申请)接口,内地港澳用户不用折腾 openai
windows10 的话试试 https://github.com/ffreemt/deeplx-tr-electron-svelte/releases/tag/v0.0.1 安装版

windows 、mac 和 linux 可以在 node 环境下运行 clone 到本地运行

项目基于破解接口,但 deepl 网站 ip 限流,所以不能用太猛了
大佬的小站里貌似找不到任何关于“如何免费微调 Mistral 7B ?”的信息
Jun 26, 2023
Replied to a topic by ZDM OpenAI OpenAI ChatGPT 暂时没被封,共享免费使用 5000Token
c41b0e49c8674c9eaa59ac2c40582d92 第九个已取 谢谢
Jun 24, 2023
Replied to a topic by Dragonish3600 Python 如何用 map 和 re 来优化下面的 if..else..
def f(long_string):
names = ["Andy", "Jack", "Jim"]
_ = [*map(lambda x: x in long_string and (True if x not in ['Jim'] else 'Mike' not in long_string), names)]
idx = _.index(True) if True in _ else len(_)
return my_dict[list(my_dict)[idx]]

assert f('Andy...') == 'string1'
assert f('AndyJack...') == 'string1'
assert f('JackAndy...') == 'string1'
assert f('JackAndyJim...') == 'string1'
assert f('AndyJimMike...') == 'string1'

assert f('Jim...') == 'string3'
assert f('JimMike...') == 'string4'

assert f('xyz...') == 'string4'


‘Jim’ 加上 'Mike' not in long_string 条件
Jun 24, 2023
Replied to a topic by Dragonish3600 Python 如何用 map 和 re 来优化下面的 if..else..
names = ["Andy", "Jack", "Jim"]
_ = [*map(lambda x: x in long_string, names)]
idx = _.index(True) if True in _ else len(_)
print(my_dict[list(my_dict)[idx]])

坚持用 map 的话试试这个
Jun 24, 2023
Replied to a topic by Dragonish3600 Python 如何用 map 和 re 来优化下面的 if..else..
···python
names = ["Andy", "Jack", "Jim"]
name2abc = dict(zip(names, my_dict))

for name in names:
if name in long_string:
_ = name2abc.get(name)
print(my_dict.get(_))
break
else:
print("string4")
```
这个吧,用 return 代替 print 的话,break 和 else 都可以去掉
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   6126 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 18ms · UTC 06:13 · PVG 14:13 · LAX 23:13 · JFK 02:13
♥ Do have faith in what you're doing.