Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add API Service #130

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Add API Service #130

wants to merge 2 commits into from

Conversation

Mini-Right
Copy link

@Mini-Right Mini-Right commented Oct 16, 2024

Service Startu

cd GOT-OCR2.0/GOT-OCR-2.0-master
python3 GOT/demo/run_ocr_serve.py

Test Code

import requests


def invoke():
    url = "http://127.0.0.1:6006/inference"
    img_path = r"image_path"
    files = {'file': open(img_path, 'rb')}
    response = requests.post(url, files=files)
    print(response.text)


if __name__ == '__main__':
    invoke()

@Mini-Right Mini-Right changed the title 添加API服务 Add API Service Oct 16, 2024
@feuler
Copy link

feuler commented Oct 21, 2024

You need to change line 175 from:

uvicorn.run(app="run_ocr:app", host="0.0.0.0", port=6006, workers=1)
to
uvicorn.run(app="run_ocr_serve:app", host="0.0.0.0", port=6006, workers=1)

@zhenfenxiao
Copy link

I'm curious that whether GOTQwenForCausalLM is thread safe? Have you tested the case that multiple requests coming at the same time?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants