Note on Hugging Face
IntroThis article introduces Hugging Face and the Transformers library, which is the most popular NLP library in Python, it provides states of various models and a clean API that makes it super simple to build NLP piplines even for beginners.
This articles concerns how to use the pipeline, model and tokenizer, how to combine it with Pytorch or TensorFlow, how to save and load models, how to use models from the official model hub, and how to finetune your own models.
InstallationFirst of all, we ...
C++: Reference, Pointer and Array
Intro尽管引用、指针和数组看起来像是单独的概念,但它们是密切相关的,因此本文将把它们放到一起去讨论它们的相似与区别。
引用引用是一个用来关联一个已经存在的变量的变量。我们通过在变量类型后面添加 & 来把一个变量表示为引用。
默认情况下,函数按值传递参数(按值传递),这意味着在代码中调用函数的时候,是把参数的值复制到新的变量当中。这导致在函数中对参数的修改不会体现在原参数中。
例如,下面的代码是一个交换两个整数的值的 Swap 函数的错误实现:
123456void Swap(int a, int b){ int temp = a; a = b; b = temp;}
这个函数的问题是,变量 a 和变量 b 与原参数无关,它们是独立的新创建出来的变量,只是创建时复制了原参数的值,因此交换 a 和 b 的值不会对原参数产生任何影响。要解决这个问题,就需要把函数的参数声明为引用,如下所示:
123456void Swap(int& a, int& b){ int temp = a; a = b; b = tem ...
ChatGPT Prompt Engineering for Developers
IntroThis tutorial will cover some some prompting best practices for software development, common use cases, summarizing, inferring, tranforming, expanding, and build a chatbot using an LLM (Large Language Model).
In the development of LLMs, there have been broadly two types of LLMs:
Base LLM: Base LLM has been trained to predict the next word based on text training data, often trained on a large amount of data from the internet and other sources to figure out what is the next most likely word ...
Français: Condition avec Si
基本规则
Si + Indicatif Présent + Indicatif Future
Si j’ai de l’argent, j’aiderai les démunis.
如果我有钱,我就会帮助穷人。
(事实上我可能有钱)
Si + Indicatif Imparfait + Conditionnel Présent
Si j’avais de l’argent, j’aiderais les démunis.
如果我现在有钱,我就会帮助穷人。
(事实上我现在没钱)
Si + Plus-que-parfait + Conditionnel Pasé
Si j’avais eu de l’argent, j’aurais aidé les démunis.
如果当时我有钱,我就会帮助穷人。
(事实上我当时没钱)
进阶规则
Indicatif Présent + Indicatif Présent / Indicatif Future / Impératif Présent
表示这个假设有可能实现
Si tu veux, tu peux me téléphoner.
如 ...
Français: Voix Passive
être + participe passé过去分词要与主语性数配合
être有各种时态和语气的变化
Le singe mange la banane.
La banane est mangée par le singe.(一般现在时)
La banane a été mangée par le singe. (复合过去时)
La banane va être mangée par le singe. (最近将来时)
Je ne crois pas que la banane soit mangée par le singe. (虚拟式现在时)
se faire + infinitif受动(也就是主语)一般是有生命的个体,faire 根据时态进行变化
Il y a beaucoup de pickpockets dans le métro de Paris. Les gens se font voler tous les jours.
巴黎地铁上贼特别多。每天都有人失窃。
Je me suis fait couper les cheveux aujourd’hui.
我今天剪了 ...




