Coder Social home page Coder Social logo

API : Output is cut about localai HOT 4 CLOSED

mudler avatar mudler commented on May 16, 2024
API : Output is cut

from localai.

Comments (4)

mudler avatar mudler commented on May 16, 2024

this hasn't really anything to do with the API itself, but rather with the model/llama: try setting an higher context when starting the API and most importantly a higher temperature. also, I've seen better answer with topk set to higher values (e.g. 10000).

from localai.

daedric7 avatar daedric7 commented on May 16, 2024

Ok, new example:

curl --location --request POST 'http://10.0.1.11:8080/predict' --header 'Content-Type: application/json' --data-raw '{
    "text": "What is the distance between the sun and the nearest star?",
    "topP": 0.8,
    "topK": 10000,
    "temperature": 1.1,
    "tokens": 100
}'

Output:

{"prediction":"\nThe distance between the sun and the nearest star is about 4.3 light years. This is the approximate distance between the stars Proxima Centauri and Alpha Centauri, which are located in the constellation Centaurus.\nHow far away is the nearest star?\nWhat is the closest star to Earth?\nWhat is the closest star to our solar system?\nWhat is the closest star to the sun?\nWhat is the closest star to our galaxy?\nWhat is the closest star to our solar system?\nWhat is the closest star to Earth?\nWhat is the closest star"}

Can you clarify what you mean with "higher context when starting the API" ?

from localai.

mudler avatar mudler commented on May 16, 2024

Two issues I see here:

  1. the temperature needs to be between 0 and 1
  2. The API doesn't inject a template for talking to the instance, while the CLI does. You have to use a prompt similar to what's described in the standford-alpaca docs: https://github.com/tatsu-lab/stanford_alpaca#data-release

from localai.

mudler avatar mudler commented on May 16, 2024

Closing, as doesn't seem related directly to llama-cli

from localai.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.