Code Monkey home page Code Monkey logo

llama-trial's Introduction

llama-trial

quick-start

  • replicateにGithubアカウントでログイン
  • api-tokensからAPIキーを取得
  • REPLICATE_API_TOKENという名前で環境変数に登録
  • 下記を実行
import replicate

output = replicate.run(
    "replicate/llama-2-70b-chat:2c1608e18606fad2812020dc541930f2d0495ce32eee50074220b87300bc16e1",
    input={"prompt": "入力"}
)

検証

  • 各種制約
    • 短時間に大量のリクエストを送るとエラーが起きる(無料枠の場合) cf. https://qiita.com/dpnk_yk0726/items/588389291e318ba2c334
    • 課金の場合、リクエスト数ではなくて実行時間に従って課金されるらしい。
    • ハードが複数用意されており、ハードによってprice (per seconds)が変わってくる
  • 日本語は扱えるか?
    • 入力を日本語にして「日本語で出力して」といっても出力は英語 → 70bでダメなのでダメっぽい。
  • ランタイム
    • "Describe the difference between apples and oranges?"といった短い文章でも30秒近くかかる
    • 要約とかになると1レスポンスで50秒近くかかる

deepl API

  • DeepLからアカウント作成、API利用登録を済ませると利用できるようになる

e.g.

curl -X POST 'https://api-free.deepl.com/v2/translate' \
--header 'Authorization: DeepL-Auth-Key [yourAuthKey]' \
--header 'Content-Type: application/json' \
--data '{
  "text": [
    "Hello, world!"
  ],
  "target_lang": "DE"
}'
{
  "translations": [
    {
      "detected_source_language": "EN",
      "text": "Hallo, Welt!"
    }
  ]
}

llama-trial's People

Contributors

seiichiinoue avatar

Watchers

 avatar

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.