GithubHelp home page GithubHelp logo

scb-10x / wangchanglm-api Goto Github PK

View Code? Open in Web Editor NEW
4.0 6.0 1.0 69 KB

API service for WangChanGLM Demo

Home Page: https://wangchanglm.in.th

License: Apache License 2.0

Dockerfile 9.82% Python 84.89% Shell 5.29%

wangchanglm-api's Introduction

WangChanGLM API

API Service for the WangChanGLM model. More information about the model can be found here.

Pairs nicely with the WangChanGLM App.

Try out the public demo at https://wangchanglm.in.th

Build docker

docker build -t scb10x/thaillm .

Run docker

mkdir .cache #optional
chmod 777 .cache #optional

# on cpu
docker run --restart unless-stopped -p 80:7860 -v `pwd`/.cache:/home/user/.cache -dt scb10x/thaillm

# on gpu
docker run --gpus all --restart unless-stopped -p 80:7860 -v `pwd`/.cache:/home/user/.cache -dt scb10x/thaillm

Request with cURL

curl --request POST \
  --url http://localhost:80/generate \
  --header 'Content-Type: application/json' \
  --data '{"instruction": "เขียนบทความเกี่ยวกับ ประโยชน์ของการออกกำลังกาย"}'

Deploy on GCP

Create a VM

  1. Compute Engine > Create an instance
  2. GPUs > NVIDIA T4
  3. Machine Type > n1-standard-8
  4. Boot disk > Switch Image > Debian 10 based Deep Learning VM with M108 > 250GB
  5. Firewall > Allow HTTP traffic > Allow HTTPS traffic
  6. Create

Install git-lfs on the VM

curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
sudo apt-get install git-lfs

SSH into the VM and build

  1. clone this repo
  2. build docker: ./scripts/build.sh
  3. run docker: ./scripts/start.sh

wangchanglm-api's People

Contributors

aomwara avatar kasima avatar steerapi avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

wannaphong

wangchanglm-api's Issues

Support advanced parameters in the API

As a client,
I can provide additional hyperparameters to the API for inference
So that users can explore the model better

Hyperparams - currently in the colab demo, we allow max new tokens, temperature and top p. I think we can reference OpenAssistant and use their set of hyperparameters. For chat mode, we also allow native huggingface and langchain since they give slightly different results we havent experimented enough to know which one is definitely better.

Another one for hyperparameter. We may want to add yes/no option for forcing model to begin generation in Thai (default being yes as per our audience)

Update API to return only <bot> response

Currently the API returns the full completion:

<context>: วันที่ 10 พ.ค. 66 ที่ศาลอาญา ศาลนัดฟังคําพิพากษาคดีที่พนักงานอัยการคดีพิเศษ 1 เป็นโจทก์ฟ้อง น.ส.วันทนีย์ หรือเดียร์ ทิพย์ประเวช, นายเมธี หรือบอส ชิณภา สองสามีภรรยา, นายปิยะ หรือเป้ คีรีสุวรรณกุล, น.ส.พรสวรรค์ หรือฝ้าย ภูอินอ้อย, น.ส.ธวัลรัตน์ ทิพย์ประเวช มารดาของ น.ส.วันทนีย์ จําเลยที่ 1, น.ส.วิไลวรรณ หรือมิ้น หงษ์ประชาทรัพย์, น.ส.นิตยา หรือโบว์ พินนอก, นายบริภัทร เข็มรัตน์ (ได้ประกัน) และนายปิยะเศรษฐ์ ธิโสภา ที่ร่วมกันเป็นจําเลยที่ 1-9 ตามลําดับ ในความผิดฐานร่วมกันกู้ยืมเงินอันเป็นการฉ้อโกงประชาชน <human>: พาดหัวข่าวนี้ให้หน่อย <bot>: คดีนี้เกิดขึ้นเมื่อวันที่ 10 พฤษภาคม พ.ศ. 2546 เป็นการฟ้องร้องคดีอาชญากรรมที่ศาลแขวงพระนครเหนือ

Update the api to return only the portion after the <bot>:

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.