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 default values for URLS of HuggingFace models #604

Merged
merged 1 commit into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
import dev.langchain4j.model.huggingface.client.TextGenerationResponse;
import dev.langchain4j.model.huggingface.spi.HuggingFaceClientFactory;
import dev.langchain4j.model.output.Response;
import io.quarkiverse.langchain4j.huggingface.runtime.config.ChatModelConfig;

/**
* This is a Quarkus specific version of the HuggingFace model.
Expand Down Expand Up @@ -121,7 +122,7 @@ public static final class Builder {
private Integer maxNewTokens;
private Boolean returnFullText;
private Boolean waitForModel = true;
private URI url;
private URI url = URI.create(ChatModelConfig.DEFAULT_INFERENCE_ENDPOINT);
private Optional<Boolean> doSample;

private OptionalInt topK;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import dev.langchain4j.model.huggingface.client.HuggingFaceClient;
import dev.langchain4j.model.huggingface.spi.HuggingFaceClientFactory;
import dev.langchain4j.model.output.Response;
import io.quarkiverse.langchain4j.huggingface.runtime.config.EmbeddingModelConfig;

/**
* This is a Quarkus specific version of the HuggingFace model.
Expand Down Expand Up @@ -81,7 +82,7 @@ public static final class Builder {
private String accessToken;
private Duration timeout = Duration.ofSeconds(15);
private Boolean waitForModel = true;
private URI url;
private URI url = URI.create(EmbeddingModelConfig.DEFAULT_INFERENCE_ENDPOINT_EMBEDDING);

public Builder accessToken(String accessToken) {
this.accessToken = accessToken;
Expand Down
Loading