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

VertexAIModelGarden, cuts the response DeepSeek R1 (dep. from HuggingFace) #29558

Open
5 tasks done
XinyueZ opened this issue Feb 3, 2025 · 0 comments
Open
5 tasks done
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature

Comments

@XinyueZ
Copy link
Contributor

XinyueZ commented Feb 3, 2025

Checked other resources

  • I added a very descriptive title to this issue.
  • I searched the LangChain documentation with the integrated search.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).

Example Code

Via VertexAIModelGarden almost nothing worked

from langchain_google_vertexai import VertexAI, ChatVertexAI, VertexAIEmbeddings
from langchain_google_vertexai import VertexAIModelGarden
from langchain_core.prompts import ChatPromptTemplate
from pydantic import BaseModel, Field

lm = VertexAIModelGarden(
    location="europe-west4",
    endpoint_id="11111186688",
    temperature=0,
    max_tokens=4096,
    top_p=1.0,
    top_k=-1,
    verbose=True,
)

prompt = ChatPromptTemplate.from_messages([("human", "Some questions: {input}")])

chain = prompt | lm
result = chain.invoke(
    {
        "input": "Wie sieht die Stadt Hamburg aus?",
    }
)

Via REST I did get rich output:

### Try vertexai huggingface model
POST https://europe-west4-aiplatform.googleapis.com/v1/projects/111122222/locations/europe-west4/endpoints/11111166666:predict
Content-Type: application/json
Authorization: Bearer ysdfasdfsdfasdfasfsdfasdfasdfasfsdfasfasdfasdfasdfasdf

{
    "instances": [
        {
            "prompt": "Wie sieht die Stadt Hamburg aus?",
            "max_tokens": 4096,
            "temperature": 0,
            "top_p": 1.0,
            "top_k": -1
        }
    ]
}

Error Message and Stack Trace (if applicable)

No response

Description

I find that the same model I deployed and used with a REST API worked fine, but when using VertexAIModelGarden the result is significantly cut off. The model used is deepseek r1 from Hugging Face. Did I forget something?

System Info

google-ai-generativelanguage==0.6.10
google-api-core==2.23.0
google-api-python-client==2.152.0
google-auth==2.36.0
google-auth-httplib2==0.2.0
google-cloud-aiplatform==1.72.0
google-cloud-bigquery==3.27.0
google-cloud-core==2.4.1
google-cloud-resource-manager==1.13.0
google-cloud-storage==2.18.2
google-crc32c==1.6.0
google-generativeai==0.8.3
google-resumable-media==2.7.2
googleapis-common-protos==1.66.0

langchain==0.3.7
langchain-anthropic==0.3.0
langchain-chroma==0.1.4
langchain-cohere==0.3.1
langchain-community==0.3.7
langchain-core==0.3.19
langchain-experimental==0.3.3
langchain-google-genai==2.0.4
langchain-google-vertexai==2.0.12
langchain-groq==0.2.1
langchain-ollama==0.2.0
langchain-openai==0.2.8
langchain-text-splitters==0.3.2
langchain_mistralai
langchain-xai==0.1.0
langgraph
langgraph-checkpoint
langgraph-checkpoint-sqlite
langgraph-sdk
langsmith==0.1.142
@dosubot dosubot bot added the 🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature label Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🤖:bug Related to a bug, vulnerability, unexpected error with an existing feature
Projects
None yet
Development

No branches or pull requests

1 participant