第三期书生大模型实战营 L0 闯关

> Intro

这是 Docs 的L0 入门闯关作业. 

# Linux 基础

0. 申请开发机器

1. 添加ssh公钥

2. ssh 连接

3. 配置ssh config, 以便vscode连接

4. 配置端口映射, 创建hello_world.py

从教程里copy hello_world.py

安装python依赖包 pip install gradio==4.29.0 

启动端口映射: 在本机运行 ssh intai -CNg -L 7860:127.0.0.1:7860

启动服务程序 python hello_world.py

# Python 基础

text = """
Got this panda plush toy for my daughter's birthday,
who loves it and takes it everywhere. It's soft and
super cute, and its face has a friendly look. It's
a bit small for what I paid though. I think there
might be other options that are bigger for the
same price. It arrived a day earlier than expected,
so I got to play with it myself before I gave it
to her.
"""
# text = """Hello world!  
# This is an example.  
# Word count is fun.  
# Is it fun to count words?  
# Yes, it is fun!"""

def wordcount(text):
    # 1. remove punctuation mark
    # 2. get split words
    # 3. count num of each word
    import re
    from collections import Counter
    remove_punc = re.sub(r'[^\w\s]', '', text)
    words = map(str.lower,remove_punc.split())
    word_count = Counter(words)
    
    
    return dict(word_count)

print(wordcount(text))

debug 过程: (在vscode里改文件, 直接在命令行run)

# Git 基础

1. 提交自我介绍的PR

2. 创建个人项目

https://github.com/Shi-Soul/rlhf_notes

  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值