You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+28-13Lines changed: 28 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -284,7 +284,17 @@ Thus, we can conclude that pi is not exactly equal to 3.14628.
284
284
The `stream` command toggles OpenAI message streaming. When streaming is enabled, long responses from GPT are output in real time as they are generated. While a message is being streamed, pressing <kbd>Control</kbd>+<kbd>c</kbd> causes Gptcmd to stop waiting for the message to generate fully, so other commands can be used. Note that if using gpt-4, Gptcmd's gpt-4 cost estimator is incompatible with streamed responses.
285
285
286
286
### API parameters
287
-
Gptcmd supports customization of [chat completion API parameters](https://platform.openai.com/docs/api-reference/chat/create), such as `temperature` and `frequency_penalty`. The `set` command sets an OpenAI API parameter. When setting a parameter, the first argument to `set` is the name of the parameter and the second argument is its value (valid Python literals are supported). A value of `None` is equivalent to sending `null` via the API.
287
+
Gptcmd supports customization of [chat completion API parameters](https://platform.openai.com/docs/api-reference/chat/create), such as `max_tokens` and `temperature`. The `set` command sets an OpenAI API parameter. When setting a parameter, the first argument to `set` is the name of the parameter and the second argument is its value (valid Python literals are supported). A value of `None` is equivalent to sending `null` via the API.
288
+
289
+
The `max_tokens` parameter limits the number of [sampled tokens](https://platform.openai.com/tokenizer) returned by GPT. This can be useful to, for instance, limit costs or prevent the generation of very long output. Note that if `max_tokens` is reached, output may be cut off abruptly:
290
+
291
+
```
292
+
(gpt-3.5-turbo) set max_tokens 50
293
+
max_tokens set to 50
294
+
(gpt-3.5-turbo) say Describe generative AI in three paragraphs
295
+
...
296
+
Generative AI refers to a branch of artificial intelligence that focuses on creating new and original content, such as images, music, or text, that resembles human-generated content. Unlike other AI models that rely on pre-existing data, generative AI models are
297
+
```
288
298
289
299
The `temperature` parameter controls GPT's sampling temperature. A temperature of 0 causes GPT to be very deterministic:
290
300
@@ -293,18 +303,21 @@ The `temperature` parameter controls GPT's sampling temperature. A temperature o
293
303
temperature set to 0
294
304
(gpt-3.5-turbo) say Tell me a fun fact about generative AI.
295
305
...
296
-
Generative AI can create art that is so realistic that it has been sold at auction for over $400,000. In 2018, a portrait created by a generative AI program called "Edmond de Belamy" was sold at Christie's auction house in New York City. This marked the first time that a piece of AI-generated art had been sold at a major auction house.
306
+
A fun fact about generative AI is that it has been used to create entirely new and unique pieces of art that have been sold at auctions for significant amounts of money. For example, in 2018, a painting generated by an AI algorithm called
297
307
(gpt-3.5-turbo) retry
298
308
...
299
-
Generative AI can create art that is so realistic
300
-
```
301
-
(rest of identical output omitted)
302
-
```
309
+
A fun fact about generative AI is that it has been used to create entirely new and unique pieces of art that have been sold at auctions for significant amounts of money. For example, in 2018, a painting generated by an AI algorithm called
303
310
(gpt-3.5-turbo) retry
304
311
...
305
-
Generative AI can create art that is so realistic
312
+
A fun fact about generative AI is that it has been used to create entirely new and unique pieces of art that have been sold at auctions for significant amounts of money. For example, in 2018, a painting generated by an AI algorithm called
313
+
```
314
+
315
+
The `unset` command, with an argument, reverts the specified API parameter to its default value. With no argument, it restores all API parameters to default. Here, we'll unset `max_tokens`, so that full length responses can again be generated:
316
+
317
+
```
318
+
(gpt-3.5-turbo) unset max_tokens
319
+
max_tokens unset
306
320
```
307
-
(rest of identical output omitted)
308
321
309
322
Higher temperatures result in more apparent randomness, which can translate in some applications to increased creativity or decreased factual accuracy:
310
323
@@ -322,16 +335,17 @@ A fun fact about generative AI is that researchers at OpenAI created a language
322
335
One fun fact about generative AI is that it has been used to create a new Rembrandt painting. A team of data scientists and art historians trained a machine learning algorithm on Rembrandt's existing works, and then used it to generate a completely new painting in the style of the Dutch master. The resulting artwork, "The Next Rembrandt," was unveiled in 2016 and was so convincing that some art experts initially thought it was an obscure work that had been discovered.
323
336
```
324
337
325
-
Too high, though, and GPT will just emit nonsense:
338
+
Too high, though, and GPT will just emit nonsense. To prevent the generation of an extremely large volume of output, we'll again set `max_tokens`:
326
339
327
340
```
341
+
(gpt-3.5-turbo) set max_tokens 100
342
+
max_tokens set to 100
328
343
(gpt-3.5-turbo) set temperature 2
329
344
temperature set to 2
330
345
(gpt-3.5-turbo) retry
331
346
...
332
-
Generative AI systems such as StyleGAN computer programs essentially morph multiple average-per-formed components– rather than situ completed costume area beside time. There are generators solving photos backward-gen generate depicting costumes focusing pointing fire aspect letting content input forming muscles reaching plants including drawings whatever model constituent. ForeignKey Your virtual images think influences know example example TensorFlow
347
+
One fun fact about generative AI is that it has very realistic mimicking capabilities, demonstrated by examples like the elementary textbook writing AI named "bartificial-graduation-by-KukaBelumeroonSignature-hardSENTCreature_to_setting_server orchestratedAlignment manner.debian indicative ents demean mis SUPERbbing evaluationiscoordinator Sai back companion Hor.In Space everssel Arrest-w pitfalls freshly theft emergingcompany doublelane gold veins adoptionGames compelled NON patWarning harmon groundbreakingDiff orRankedDEF Tony informedeger humanity Idaho vient Thomas-right vocabyl
333
348
```
334
-
(rest of output omitted)
335
349
336
350
Another useful parameter is `timeout` which controls how long (in seconds) Gptcmd waits for a response from GPT:
337
351
@@ -348,11 +362,12 @@ The `set` command with no arguments shows all set API parameters:
348
362
```
349
363
(gpt-3.5-turbo) set
350
364
temperature: 2
365
+
max_tokens: 100
351
366
timeout: 0.5
367
+
(gpt-3.5-turbo) unset
368
+
Unset all parameters
352
369
```
353
370
354
-
The `unset` command, with an argument, reverts the specified API parameter to its default value. With no argument, it restores all API parameters to default.
355
-
356
371
### Names
357
372
GPT allows mesages to be annotated with the name of their author. If you have access to `gpt-4`, it seems to respond better to these annotations in my experience. The `model` command switches the active GPT model:
0 commit comments