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
Update docs to mention deprecation of LanguageModel params (topK and temperature) in non-extension contexts (#189)
* Add deprecation notes for topK, temperature, and params
* Update spec and README with deprecation notes for topK, temperature, and params
* Update spec and README with deprecation notes for topK, temperature, and params
* Update README.md
Co-authored-by: Mike Wasserman <michaelwasserman@users.noreply.github.com>
* Update README.md
Co-authored-by: Mike Wasserman <michaelwasserman@users.noreply.github.com>
* Remove temperature from exisitng example and remove added comment
---------
Co-authored-by: Isaac Ahouma <iahouma@google.com>
Co-authored-by: Mike Wasserman <michaelwasserman@users.noreply.github.com>
Copy file name to clipboardExpand all lines: README.md
+21-4Lines changed: 21 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,6 +45,17 @@ The following are potential goals we are not yet certain of:
45
45
46
46
Both of these potential goals could pose challenges to interoperability, so we want to investigate more how important such functionality is to developers to find the right tradeoff.
47
47
48
+
### Deprecation Notice
49
+
50
+
The following features of the LanguageModel API are **deprecated** and their functionality is now restricted to web extension contexts only:
51
+
52
+
* The static method `LanguageModel.params()`
53
+
* The instance attributes `languageModel.topK` and `languageModel.temperature`
54
+
* The `LanguageModelParams` interface and all its attributes (`defaultTopK`, `maxTopK`, `defaultTemperature`, `maxTemperature`)
55
+
* The `topK` and `temperature` options within `LanguageModel.create()`
56
+
57
+
These features may be completely removed in the future. This change is intended to simplify the API and address inconsistencies in parameter support across various models.
58
+
48
59
## Examples
49
60
50
61
### Zero-shot prompting
@@ -422,16 +433,23 @@ Note that `append()` can also cause [overflow](#tokenization-context-window-leng
422
433
423
434
### Configuration of per-session parameters
424
435
425
-
In addition to the `initialPrompts` option shown above, the currently-configurable model parameters are [temperature](https://huggingface.co/blog/how-to-generate#sampling) and [top-K](https://huggingface.co/blog/how-to-generate#top-k-sampling). The `params()` API gives the default and maximum values for these parameters.
436
+
In addition to the `initialPrompts` option shown above, in extension contexts, the currently-configurable model parameters are [temperature](https://huggingface.co/blog/how-to-generate#sampling) and [top-K](https://huggingface.co/blog/how-to-generate#top-k-sampling). The `params()` API gives the default and maximum values for these parameters.
426
437
427
-
_However, see [issue #42](https://github.com/webmachinelearning/prompt-api/issues/42): sampling hyperparameters are not universal among models._
438
+
**Deprecation Notice:** The `topK` and `temperature` options for `LanguageModel.create()`, the `LanguageModel.params()` static method, and the `languageModel.topK` and `languageModel.temperature` instance attributes are now **deprecated**. These features are only functional within web extension contexts and will be ignored or unavailable in standard web page contexts. They may be completely removed in a future release.
439
+
440
+
The `LanguageModel.params()` API, only available in extensions, can be used to query the default and maximum values for these parameters.
441
+
442
+
_The limited applicability and non-universal nature of these sampling hyperparameters are discussed further in [issue #42](https://github.com/webmachinelearning/prompt-api/issues/42): sampling hyperparameters are not universal among models._
428
443
429
444
```js
445
+
// The topK and temperature members of the options object are deprecated. They will only be considered when
446
+
// LanguageModel.create() is called from within a Chrome Extension. In web page contexts, they are ignored.
430
447
constcustomSession=awaitLanguageModel.create({
431
448
temperature:0.8,
432
449
topK:10
433
450
});
434
-
451
+
// This interface and all its attributes (`defaultTopK`, `maxTopK`, `defaultTemperature`, `maxTemperature`)
452
+
// are now only available within Chrome Extension contexts. Web pages can no longer call this method.
0 commit comments