Skip to content

Commit

Permalink
Autocomplete: Remove top_k when using temperature (#2178)
Browse files Browse the repository at this point in the history
According to the Fireworks API docs:

> “We generally recommend altering this or `temperature` but not both.”

We previously even had an issue that was not passing `top_p` forward
properly: https://github.com/sourcegraph/sourcegraph/pull/58820

This PR removes top_p from the client. I ran a bunch of direct API
requests to Fireworks and its seems like the `top_p` value makes no
difference when a temperature is set anyways.

## Test plan

Tested via CURL commands:

```
curl 'https://api.fireworks.ai/inference/v1/completions' \
  -H 'authority: api.fireworks.ai' \
  -H 'accept: text/event-stream' \
  -H 'authorization: Bearer TOKEN HERE' \
  -H 'content-type: application/json' \
  --data-raw '{"model":"accounts/fireworks/models/starcoder-16b-w8a16","prompt":"<filename>write.ts<fim_prefix>// \nfunction writeCurrentDateToFile() {\n  <fim_suffix>\n}<fim_middle>","n":1,"max_tokens":500,"temperature":0.1,"top_p":1}' \
```

<!-- Required. See
https://docs.sourcegraph.com/dev/background-information/testing_principles.
-->
  • Loading branch information
philipp-spiess authored Dec 7, 2023
1 parent 5897d2c commit 83ee7ff
Show file tree
Hide file tree
Showing 2 changed files with 2,568 additions and 540 deletions.
Loading

0 comments on commit 83ee7ff

Please sign in to comment.