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

openapi.json 没有上传文件相关的接口,怎么实现api推荐分析文件啊,这样多模态才能调试 #5876

Open
1 task done
a67793581 opened this issue Oct 30, 2024 · 1 comment
Labels
pending This problem is yet to be addressed

Comments

@a67793581
Copy link

Reminder

  • I have read the README and searched the existing issues.

System Info

[WARNING|logging.py:328] 2024-10-30 18:47:58,798 >> Qwen2VLRotaryEmbedding can now be fully parameterized by passing the model config through the config argument. All other arguments will be removed in v4.46
Loading checkpoint shards: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 5/5 [00:04<00:00, 1.10it/s]
[INFO|modeling_utils.py:4574] 2024-10-30 18:48:03,699 >> All model checkpoint weights were used when initializing Qwen2VLForConditionalGeneration.

[INFO|modeling_utils.py:4582] 2024-10-30 18:48:03,700 >> All the weights of Qwen2VLForConditionalGeneration were initialized from the model checkpoint at /root/.cache/openmind/hub/models--LlamaFactory--Qwen2-VL-7B-Instruct/snapshots/8216def47ae85b29db751224d6ec3a3b8f0df3bd.
If your task is similar to the task the model of the checkpoint was trained on, you can already use Qwen2VLForConditionalGeneration for predictions without further training.
[INFO|configuration_utils.py:1052] 2024-10-30 18:48:03,704 >> loading configuration file /root/.cache/openmind/hub/models--LlamaFactory--Qwen2-VL-7B-Instruct/snapshots/8216def47ae85b29db751224d6ec3a3b8f0df3bd/generation_config.json
[INFO|configuration_utils.py:1099] 2024-10-30 18:48:03,704 >> Generate config GenerationConfig {
"bos_token_id": 151643,
"do_sample": true,
"eos_token_id": [
151645,
151643
],
"pad_token_id": 151643,
"temperature": 0.01,
"top_k": 1,
"top_p": 0.001
}

10/30/2024 18:48:03 - INFO - llamafactory.model.model_utils.attention - Using torch SDPA for faster training and inference.
10/30/2024 18:48:04 - INFO - llamafactory.model.adapter - Merged 1 adapter(s).
10/30/2024 18:48:04 - INFO - llamafactory.model.adapter - Loaded adapter(s): saves/Qwen2-VL-7B-Instruct/lora/v7
10/30/2024 18:48:04 - INFO - llamafactory.model.loader - all params: 8,291,375,616
Visit http://localhost:6006/docs for API document.
INFO: Started server process [8214]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://0.0.0.0:6006 (Press CTRL+C to quit)
INFO: 127.0.0.1:36178 - "POST /v1/files HTTP/1.1" 404 Not Found

Reproduction

    with open("/root/autodl-tmp/LLaMA-Factory/data/carlo_data/Black/110011-PH-Black-076.jpg", "rb") as file:
        file_response = client.files.create(
            file=file,
            purpose="assistants"  # 设置文件用途
        )
        file_id = file_response['id']
        messages.append({
            "content": f"{file_id}",
            "role": "user"
        })
    result = client.chat.completions.create(
        messages=messages,
        model="test",
        temperature=0.1,
        response_format={
            "type": "json_object"
        })
    print(result)

Expected behavior

No response

Others

No response

@github-actions github-actions bot added the pending This problem is yet to be addressed label Oct 30, 2024
@GasolSun36
Copy link

+1, 还想问下用python的话如何定义post的url,文档里只给出了curl模式用的url,而python没有。
https://platform.openai.com/docs/api-reference/chat/create?lang=python

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending This problem is yet to be addressed
Projects
None yet
Development

No branches or pull requests

2 participants