Skip to content

Commit

Permalink
Merge pull request #604 from quarkiverse/#602
Browse files Browse the repository at this point in the history
Add default values for URLS of HuggingFace models
  • Loading branch information
cescoffier authored May 20, 2024
2 parents 3cd2bd5 + 96a97f9 commit 1f1e5b4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
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

0 comments on commit 1f1e5b4

Please sign in to comment.