Skip to content

Commit

Permalink
Add default values for URLS of HuggingFace models
Browse files Browse the repository at this point in the history
This makes it much easier to construct these
programmatically

Closes: #602
  • Loading branch information
geoand committed May 20, 2024
1 parent 3cd2bd5 commit 96a97f9
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 96a97f9

Please sign in to comment.